@theopenapps/cli 0.1.5 → 0.1.6
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/openapps.js +3 -3
- package/package.json +1 -1
package/dist/openapps.js
CHANGED
|
@@ -61,7 +61,7 @@ ${u}
|
|
|
61
61
|
}`,m;try{m=new d(...a,p)(...c)}catch(f){throw new M(`this schema (generated code failed to evaluate: ${f.message})`)}return r?.debug&&(m.code=l),m.definite=o.definite,m}function N(e,r){for(let[o,t]of e.constants)if(t===r)return o;let i=`c${e.constantCounter++}`;return e.constants.set(i,r),i}function At(e,r){return e.definite=!1,N(e,r)}function T(e){return`v${e.varCounter++}`}function w$(e,r){let i=e._zod.run({value:r,issues:[]},{});if(i&&typeof i.then=="function")return be;let o=i;return o.issues.length===0?o.value:be}function fe(e,r,i,o,t=!0){let n=e.content.length,a=r.constants.size,c=r.constantCounter,u=r.varCounter;try{return ee(e,r,i,o,t)}catch(l){if(!(l instanceof M)||!l.islandable)throw l;if(e.content.length=n,r.constants.size>a){let d=Array.from(r.constants.keys()).slice(a);for(let p of d)r.constants.delete(p)}return r.constantCounter=c,r.varCounter=u,x$(e,r,i,o)}}function x$(e,r,i,o){r.definite=!1;let t=N(r,i),n=N(r,w$),a=T(r);return e.write(`const ${a} = ${n}(${t}, ${o});`),e.write(`if (${a} === INVALID) return INVALID;`),a}var S$=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function I$(e,r,i,o){let t=i._zod.def.checks;if(!t||t.length===0)return o;let n=o;for(let a of t){let c=a._zod.def;if(c.when&&!S$.has(c.check))throw new M('check with a custom "when" condition');switch(c.check){case"greater_than":z$(e,r,c,n);break;case"less_than":P$(e,r,c,n);break;case"multiple_of":O$(e,r,c,n);break;case"number_format":Pf(e,c,n);break;case"min_length":{let u=Pt(c.minimum,"min_length"),l=cu(e,r,n,`${n}.length >= ${u} && ${n}.length < ${c.minimum*2}`);e.write(`if (${l} < ${u}) return INVALID;`);break}case"max_length":{let u=Pt(c.maximum,"max_length"),l=cu(e,r,n,`${n}.length > ${u}`);e.write(`if (${l} > ${u}) return INVALID;`);break}case"length_equals":{let u=Pt(c.length,"length_equals"),l=cu(e,r,n,`${n}.length >= ${u} && ${n}.length <= ${c.length*2}`);e.write(`if (${l} !== ${u}) return INVALID;`);break}case"min_size":e.write(`if (${n}.size < ${Pt(c.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${n}.size > ${Pt(c.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${n}.size !== ${Pt(c.size,"size_equals")}) return INVALID;`);break;case"string_format":n=Of(e,r,c,n);break;case"custom":n=C$(e,r,a,n);break;case"bigint_format":A$(e,c,n);break;case"mime_type":j$(e,r,c,n);break;case"property":D$(e,r,c,n);break;case"properties":T$(e,r,c,n);break;case"overwrite":{let u=T(r);N$(e,r,a,n,u),n=u;break}default:throw new M(`check type ${c.check}`)}}return n}function cu(e,r,i,o){let t=N(r,xt),n=T(r);return e.write(`const ${n} = typeof ${i} === "string" && ${o} ? ${t}(${i}) : ${i}.length;`),n}function Pt(e,r){if(typeof e!="number"||!Number.isFinite(e))throw new M(`${r} bound of type ${typeof e}`);return`${e}`}function zf(e,r){if(typeof r=="bigint")return`${r}n`;if(typeof r=="number"){if(Number.isNaN(r))throw new M("comparison check with NaN bound");return`${r}`}if(r instanceof Date){if(Number.isNaN(r.getTime()))throw new M("comparison check with Invalid Date bound");return N(e,r)}throw new M(`comparison check bound of type ${typeof r}`)}function z$(e,r,i,o){let t=i.inclusive?"<":"<=";e.write(`if (${o} ${t} ${zf(r,i.value)}) return INVALID;`)}function P$(e,r,i,o){let t=i.inclusive?">":">=";e.write(`if (${o} ${t} ${zf(r,i.value)}) return INVALID;`)}function O$(e,r,i,o){if(typeof i.value=="bigint"){if(i.value===BigInt(0))throw new M("multiple_of check with a zero divisor");e.write(`if (${o} % ${i.value}n !== 0n) return INVALID;`)}else{let t=N(r,Vr);e.write(`if (${t}(${o}, ${Pt(i.value,"multiple_of")}) !== 0) return INVALID;`)}}function Pf(e,r,i){let o=r.format;switch(o){case"safeint":e.write(`if (!Number.isSafeInteger(${i})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${i}) || ${i} < -2147483648 || ${i} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${i}) || ${i} < 0 || ${i} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${i}) || ${i} < -3.4028234663852886e38 || ${i} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${i})) return INVALID;`);break;default:throw new M(`number format ${o}`)}}function A$(e,r,i){let o=r.format;if(o)switch(o){case"int64":e.write(`if (${i} < -9223372036854775808n || ${i} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${i} < 0n || ${i} > 18446744073709551615n) return INVALID;`);break;default:throw new M(`bigint format ${o}`)}}function j$(e,r,i,o){let t=i.mime;if(t&&t.length>0){let n=N(r,new Set(t));e.write(`if (!${n}.has(${o}.type)) return INVALID;`)}}function T$(e,r,i,o){if(i.when)throw new M('check with a custom "when" condition');e.write(`if (${o} == null) return INVALID;`);let t=i.shape;for(let n of Reflect.ownKeys(t)){let a=typeof n=="symbol"?N(r,n):he(n),c=T(r);e.write(`const ${c} = ${o}[${a}];`),fe(e,r,t[n],c,!1)}}function D$(e,r,i,o){let t=`${o}[${JSON.stringify(i.property)}]`;ee(e,r,i.schema,t)}function N$(e,r,i,o,t){let n=i._zod.def.tx;if(!n)throw new M("overwrite check without a transform function");if(jt(n))throw new Re("z.compile: async overwrite transforms are not supported");let a=N(r,n);e.write(`const ${t} = ${a}(${o});`)}function uu(){throw new xe}function pu(e){this.issues.push(e)}function C$(e,r,i,o){let t=i._zod.def;if(t.fn){if(jt(t.fn))throw new Re("z.compile: async .refine() predicates are not supported");let n=At(r,t.fn),a=N(r,uu),c=T(r);return e.write(`const ${c} = ${n}(${o});`),e.write(`if (${c} instanceof Promise) ${a}();`),e.write(`if (!${c}) return INVALID;`),o}if(i._zod.check){if(jt(i._zod.check))throw new Re("z.compile: async .superRefine() / check functions are not supported");let n=i._zod.check,c=At(r,l=>{let d={value:l,issues:[],addIssue:pu};return n(d)instanceof Promise&&uu(),d.issues.length===0?d.value:be}),u=T(r);return e.write(`const ${u} = ${c}(${o});`),e.write(`if (${u} === INVALID) return INVALID;`),u}throw new M("custom check without a predicate or check function")}var U$=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function Of(e,r,i,o,t=!0){let n=i.format;if(n==="base64"){let l=N(r,cn);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(n==="base64url"){let l=N(r,Ai);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(n==="jwt"){let l=N(r,Di),d=N(r,i.alg??null);return e.write(`if (!${l}(${o}, ${d})) return INVALID;`),o}if(n==="ipv6"){let l=N(r,sn);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(n==="cidrv6"){let l=N(r,Pi);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(n==="credit_card"){let l=N(r,ji);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(n==="iban"){let l=N(r,Ti);return e.write(`if (!${l}(${o})) return INVALID;`),o}let a=i;if(n==="url"||n==="httpurl"||a.normalize||a.hostname!==void 0||a.protocol!==void 0){let l=N(r,Si),d=N(r,i),p=T(r),m=T(r);if(e.write(`const ${p} = ${o}.trim();`),e.write(`const ${m} = ${l}(${p}, ${d});`),e.write(`if (typeof ${m} === "number") return INVALID;`),a.hostname!==void 0){let k=N(r,Ii);e.write(`if (!${k}(${m}, ${d}.hostname)) return INVALID;`)}if(a.protocol!==void 0){let k=N(r,zi);e.write(`if (!${k}(${m}, ${d}.protocol)) return INVALID;`)}if(!t)return null;let f=T(r),v=a.normalize?`${m}.href`:`${N(r,an)}(${p})`;return e.write(`const ${f} = ${v};`),f}let c=i.fn;if(c){if(jt(c))throw new M(`async string format ${n}`);let l=N(r,c);return e.write(`if (!${l}(${o})) return INVALID;`),o}if(U$.has(n)&&i.pattern){let l=N(r,i.pattern);return e.write(`${l}.lastIndex = 0;`),e.write(`if (!${l}.test(${o})) return INVALID;`),o}let u=i.format;switch(u){case"regex":throw new M("regex format without a pattern");case"lowercase":e.write(`if (${o} !== ${o}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${o} !== ${o}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${o}.includes(${he(i.includes)})) return INVALID;`);break;case"starts_with":{let l=i.prefix;e.write(`if (${o}.slice(0, ${l.length}) !== ${he(l)}) return INVALID;`);break}case"ends_with":{let l=i.suffix;e.write(`if (${o}.slice(-${l.length}) !== ${he(l)}) return INVALID;`);break}default:throw new M(`string format ${u}`)}return o}function ee(e,r,i,o,t=!0){let n=i._zod.def,a=n.type;if(n.coerce)throw new M(`coercion (z.coerce.${a}())`);let c=t||!!n.checks?.length,u;switch(a){case"string":u=E$(e,r,i,o,c);break;case"number":u=R$(e,i,o);break;case"boolean":u=L$(e,o);break;case"bigint":u=Z$(e,i,o);break;case"symbol":u=M$(e,o);break;case"undefined":u=V$(e,o);break;case"null":u=F$(e,o);break;case"any":case"unknown":u=o;break;case"never":e.write("return INVALID;"),u=o;break;case"void":u=B$(e,o);break;case"nan":u=G$(e,o);break;case"date":u=K$(e,o);break;case"object":u=J$(e,r,i,o,c);break;case"optional":u=W$(e,r,i,o,c);break;case"nullable":u=X$(e,r,i,o,c);break;case"array":u=Y$(e,r,i,o,c);break;case"literal":u=Q$(e,r,i,o);break;case"enum":u=ek(e,r,i,o);break;case"readonly":{let l=xf(e,r,i,o),d=T(r);e.write(`const ${d} = Object.freeze(${l});`),u=d;break}case"success":xf(e,r,i,o),u="true";break;case"default":case"prefault":u=tk(e,r,i,o);break;case"nonoptional":u=rk(e,r,i,o);break;case"tuple":u=nk(e,r,i,o);break;case"union":u=ik(e,r,i,o);break;case"intersection":u=sk(e,r,i,o);break;case"record":u=ck(e,r,i,o);break;case"map":u=lk(e,r,i,o);break;case"set":u=dk(e,r,i,o);break;case"file":u=pk(e,o);break;case"template_literal":u=mk(e,r,i,o);break;case"lazy":u=fk(e,r,i,o);break;case"pipe":u=gk(e,r,i,o);break;case"custom":u=hk(e,r,i,o);break;case"transform":u=yk(e,r,i,o);break;case"catch":u=bk(e,r,i,o);break;default:throw new M(`schema type ${a}`)}return u===null?null:I$(e,r,i,u)}function E$(e,r,i,o,t=!0){e.write(`if (typeof ${o} !== "string") return INVALID;`);let n=i._zod.def;return n.format===void 0?o:Of(e,r,n,o,t)}function R$(e,r,i){e.write(`if (typeof ${i} !== "number" || !Number.isFinite(${i})) return INVALID;`);let o=r._zod.def;return o.check==="number_format"&&o.format&&Pf(e,{format:o.format},i),i}function L$(e,r){return e.write(`if (typeof ${r} !== "boolean") return INVALID;`),r}function Z$(e,r,i){e.write(`if (typeof ${i} !== "bigint") return INVALID;`);let o=r._zod.def;if(o.format)switch(o.format){case"int64":e.write(`if (${i} < -9223372036854775808n || ${i} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${i} < 0n || ${i} > 18446744073709551615n) return INVALID;`);break}return i}function M$(e,r){return e.write(`if (typeof ${r} !== "symbol") return INVALID;`),r}function V$(e,r){return e.write(`if (${r} !== undefined) return INVALID;`),r}function F$(e,r){return e.write(`if (${r} !== null) return INVALID;`),r}function B$(e,r){return e.write(`if (${r} !== undefined) return INVALID;`),r}function G$(e,r){return e.write(`if (typeof ${r} !== "number" || !Number.isNaN(${r})) return INVALID;`),r}function K$(e,r){return e.write(`if (!(${r} instanceof Date) || Number.isNaN(${r}.getTime())) return INVALID;`),r}function J$(e,r,i,o,t=!0){let n=i._zod.def;e.write(`if (typeof ${o} !== "object" || ${o} === null || Array.isArray(${o})) return INVALID;`);let a=n.shape,c=Object.keys(a),u=Object.getOwnPropertySymbols(a),l=u.length?[...c,...u]:c,d=P=>typeof P=="symbol"?N(r,P):he(P),p=P=>typeof P=="symbol"?`[${d(P)}]`:he(P),m=a;if(c.includes("__proto__"))throw new M('object shape key "__proto__"');let f=new Map;for(let P of l){let D=m[P],Z=d(P),H=T(r);if(e.write(`const ${H} = ${o}[${Z}];`),D._zod.optin!==void 0){let B=T(r);e.write(`let ${B} = (() => {`),e.indented(me=>{let Zr=fe(me,r,D,H);me.write(`return ${Zr};`)}),e.write("})();"),D._zod.optout==="optional"?(e.write(`if (${B} === INVALID) {`),e.indented(me=>{me.write(`if (${Z} in ${o}) return INVALID;`),me.write(`${B} = undefined;`)}),e.write("}")):e.write(`if (${B} === INVALID) return INVALID;`),f.set(P,B)}else{q$(D)&&e.write(`if (!(${Z} in ${o})) return INVALID;`);let B=fe(e,r,D,H,t);B!==null&&f.set(P,B)}}let v=n.catchall,k="none";if(v){let P=v._zod.def.type;if(P==="never"){let D=c.map(Z=>`k !== ${he(Z)}`).join(" && ")||"true";e.write(`for (const k in ${o}) {`),e.indented(Z=>{Z.write(`if (${D}) return INVALID;`)}),e.write("}")}else(P==="unknown"||P==="any")&&!v._zod.def.checks?.length?k="passthrough":k="schema"}let x=T(r),A=l.some(P=>wf(m[P])||lu(m[P]));if(!t){if(k==="schema"){let P=c.length>0?N(r,new Set(c)):null;e.write(`for (const k in ${o}) {`),e.indented(D=>{D.write('if (k === "__proto__") continue;'),P&&D.write(`if (${P}.has(k)) continue;`);let Z=T(r);D.write(`const ${Z} = ${o}[k];`),fe(D,r,v,Z,!1)}),e.write("}")}return null}if(A){e.write(`const ${x} = {};`);for(let P of l){let D=d(P),Z=f.get(P);lu(m[P])?e.write(`if (${D} in ${o}) ${x}[${D}] = ${Z};`):wf(m[P])?e.write(`if (${Z} !== undefined || ${D} in ${o}) ${x}[${D}] = ${Z};`):e.write(`${x}[${D}] = ${Z};`)}}else{let P=l.map(D=>`${p(D)}: ${f.get(D)}`).join(", ");e.write(`const ${x} = { ${P} };`)}if(k!=="none"){let P=c.length>0?N(r,new Set(c)):null;e.write(`for (const k in ${o}) {`),e.indented(D=>{if(D.write('if (k === "__proto__") continue;'),P&&D.write(`if (${P}.has(k)) continue;`),k==="passthrough")D.write(`${x}[k] = ${o}[k];`);else{let Z=T(r);D.write(`const ${Z} = ${o}[k];`);let H=fe(D,r,v,Z);D.write(`${x}[k] = ${H};`)}}),e.write("}")}return x}function W$(e,r,i,o,t=!0){let n=i._zod.def;if(H$(i))return ee(e,r,n.innerType,o,t);if(n.innerType._zod.optin==="defaulted"){let c=T(r),u=T(r);return e.write(`let ${c};`),e.write(`if (${o} === undefined) {`),e.indented(l=>{l.write(`const ${u} = (() => {`),l.indented(d=>{let p=ee(d,r,n.innerType,o);d.write(`return ${p};`)}),l.write("})();"),l.write(`if (${u} !== INVALID) ${c} = ${u};`)}),e.write("} else {"),e.indented(l=>{let d=ee(l,r,n.innerType,o);l.write(`${c} = ${d};`)}),e.write("}"),c}let a=t?T(r):null;return a&&e.write(`let ${a};`),e.write(`if (${o} !== undefined) {`),e.indented(c=>{let u=ee(c,r,n.innerType,o,t);a&&u!==null&&c.write(`${a} = ${u};`)}),e.write("}"),a}function H$(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function q$(e){return e._zod.optin===void 0&&Ot(e)}function Ot(e){if(e._zod.def.coerce)return!0;let r=e._zod.def;switch(r.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return r.innerType?Ot(r.innerType):!1;case"literal":return!!r.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return r.innerType?Ot(r.innerType):!0;case"catch":return!0;case"union":return r.options?r.options.some(Ot):!0;case"intersection":return!r.left||!r.right?!0:Ot(r.left)&&Ot(r.right);case"pipe":return r.in?Ot(r.in):!0;default:return!0}}function lu(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function wf(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&ar(e)}function ar(e){let r=e._zod.def;switch(r.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!r.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return r.innerType?ar(r.innerType):!0;case"union":return r.options?r.options.some(ar):!0;case"intersection":return!r.left||!r.right||ar(r.left)||ar(r.right);case"pipe":return r.out?ar(r.out):!0;default:return!0}}function X$(e,r,i,o,t=!0){let n=i._zod.def,a=t?T(r):null;return a&&e.write(`let ${a} = null;`),e.write(`if (${o} !== null) {`),e.indented(c=>{let u=ee(c,r,n.innerType,o,t);a&&u!==null&&c.write(`${a} = ${u};`)}),e.write("}"),a}function Y$(e,r,i,o,t=!0){let n=i._zod.def;e.write(`if (!Array.isArray(${o})) return INVALID;`);let a=t?T(r):null,c=T(r),u=T(r);return a&&e.write(`const ${a} = new Array(${o}.length);`),e.write(`for (let ${c} = 0; ${c} < ${o}.length; ${c}++) {`),e.indented(l=>{l.write(`const ${u} = ${o}[${c}];`);let d=fe(l,r,n.element,u,t);a&&d!==null&&l.write(`${a}[${c}] = ${d};`)}),e.write("}"),a}function Q$(e,r,i,o){let n=i._zod.def.values;if(n.length!==1){let c=N(r,new Set(n));return e.write(`if (!${c}.has(${o})) return INVALID;`),o}let a=n[0];if(typeof a=="number"&&Number.isNaN(a)){let c=N(r,new Set(n));return e.write(`if (!${c}.has(${o})) return INVALID;`),o}if(typeof a=="string")e.write(`if (${o} !== ${he(a)}) return INVALID;`);else if(typeof a=="number"||typeof a=="boolean")e.write(`if (${o} !== ${a}) return INVALID;`);else if(a===null)e.write(`if (${o} !== null) return INVALID;`);else if(a===void 0)e.write(`if (${o} !== undefined) return INVALID;`);else if(typeof a=="bigint")e.write(`if (${o} !== ${a}n) return INVALID;`);else throw new M(`literal type ${typeof a}`);return o}function ek(e,r,i,o){let t=i._zod.values;if(!t)throw new M("enum schema without enumerated values");let n=N(r,t);return e.write(`if (!${n}.has(${o})) return INVALID;`),o}function xf(e,r,i,o){let t=i._zod.def;return ee(e,r,t.innerType,o)}function tk(e,r,i,o){let t=i._zod.def,a=Object.getOwnPropertyDescriptor(i._zod.def,"defaultValue")?()=>i._zod.def.defaultValue:void 0;if(i._zod.def.type==="prefault"){if(!a)return ee(e,r,t.innerType,o);let u=N(r,a),l=T(r);return e.write(`let ${l} = ${o};`),e.write(`if (${o} === undefined) ${l} = ${u}();`),ee(e,r,t.innerType,l)}let c=T(r);if(a){let u=N(r,a),l=N(r,Fr);e.write(`let ${c};`),e.write(`if (${o} === undefined) {`),e.indented(d=>{d.write(`${c} = ${l}(${u}());`)}),e.write("} else {"),e.indented(d=>{let p=ee(d,r,t.innerType,o);d.write(`${c} = ${p} === undefined ? ${l}(${u}()) : ${p};`)}),e.write("}")}else e.write(`let ${c};`),e.write(`if (${o} !== undefined) {`),e.indented(u=>{let l=ee(u,r,t.innerType,o);u.write(`${c} = ${l};`)}),e.write("}");return c}function rk(e,r,i,o){let t=i._zod.def,n=ee(e,r,t.innerType,o),a=T(r);return e.write(`const ${a} = ${n};`),e.write(`if (${a} === undefined) return INVALID;`),a}function nk(e,r,i,o){let t=i._zod.def,n=t.items,a=t.rest;e.write(`if (!Array.isArray(${o})) return INVALID;`);let c=Sf(n,"optin"),u=Sf(n,"optout");a?e.write(`if (${o}.length < ${c}) return INVALID;`):e.write(`if (${o}.length < ${c} || ${o}.length > ${n.length}) return INVALID;`);let l=T(r);e.write(`const ${l} = [];`);for(let d=0;d<n.length;d++){let p=n[d];if(d>=u)e.write(`if (${l}.length === ${d}) {`),e.indented(m=>{m.write(`if (${d} < ${o}.length) {`),m.indented(f=>{let v=T(r);f.write(`const ${v} = ${o}[${d}];`);let k=fe(f,r,p,v);f.write(`${l}[${d}] = ${k};`)}),m.write("} else {"),m.indented(f=>{if(lu(p)){f.write(`${l}.length = ${d};`);return}let v=T(r),k=T(r);f.write(`const ${v} = undefined;`),f.write(`const ${k} = (() => {`),f.indented(x=>{let A=fe(x,r,p,v);x.write(`return ${A};`)}),f.write("})();"),f.write(`if (${k} === INVALID || ${k} === undefined) ${l}.length = ${d};`),f.write(`else ${l}[${d}] = ${k};`)}),m.write("}")}),e.write("}");else{let m=T(r);e.write(`const ${m} = ${o}[${d}];`);let f=fe(e,r,p,m);e.write(`${l}[${d}] = ${f};`)}}if(a){let d=T(r),p=T(r);e.write(`for (let ${d} = ${n.length}; ${d} < ${o}.length; ${d}++) {`),e.indented(m=>{m.write(`const ${p} = ${o}[${d}];`);let f=fe(m,r,a,p);m.write(`${l}[${d}] = ${f};`)}),e.write("}")}return l}function Sf(e,r){for(let i=e.length-1;i>=0;i--)if(!(r==="optin"?e[i]._zod.optin!==void 0:e[i]._zod.optout==="optional"))return i+1;return 0}function ik(e,r,i,o){let t=i._zod.def,n=t.options;if(t.discriminator)return ok(e,r,t,o);if(t.inclusive===!1)throw new M("exclusive unions (z.xor)");if(n.length===0)return e.write("return INVALID;"),o;if(n.length===1)return ee(e,r,n[0],o);if(n.every(u=>u._zod.def.type==="literal"&&!u._zod.def.checks?.length)){let u=new Set(n.flatMap(d=>d._zod.def.values)),l=N(r,u);return e.write(`if (!${l}.has(${o})) return INVALID;`),o}let c=T(r);e.write(`let ${c};`);for(let u=0;u<n.length;u++){let l=n[u];u===0?e.write(`${c} = (() => {`):e.write(`if (${c} === INVALID) ${c} = (() => {`),e.indented(d=>{let p=ee(d,r,l,o);d.write(`return ${p};`)}),e.write("})();")}return e.write(`if (${c} === INVALID) return INVALID;`),c}function ok(e,r,i,o){if(i.unionFallback)throw new M("discriminated union with unionFallback");if(i.options.length===0)return e.write("return INVALID;"),o;let t=T(r),n=T(r);e.write(`const ${t} = ${o}?.[${he(i.discriminator)}];`),e.write(`let ${n};`);let a=!0,c=new Set;for(let u of i.options){let l=u._zod.propValues?.[i.discriminator];if(!l||l.size===0)throw new M("discriminated union option without static discriminator values");for(let m of l){if(c.has(m))throw new M(`duplicate discriminator value ${String(m)}`);c.add(m)}let d=Array.from(l,m=>ak(r,t,m)),p=a?"if":"else if";e.write(`${p} (${d.join(" || ")}) {`),e.indented(m=>{let f=ee(m,r,u,o);m.write(`${n} = ${f};`)}),e.write("}"),a=!1}return e.write("else { return INVALID; }"),n}function ak(e,r,i){if(typeof i=="string")return`${r} === ${he(i)}`;if(typeof i=="number")return Number.isNaN(i)?`Number.isNaN(${r})`:`${r} === ${i}`;if(typeof i=="boolean")return`${r} === ${i}`;if(i===null)return`${r} === null`;if(i===void 0)return`${r} === undefined`;if(typeof i=="bigint")return`${r} === ${i}n`;if(typeof i=="symbol"){let o=N(e,i);return`${r} === ${o}`}throw new M(`literal discriminator value ${String(i)}`)}function sk(e,r,i,o){let t=i._zod.def;r.definite=!1;let n=fe(e,r,t.left,o),a=fe(e,r,t.right,o),c=N(r,nr),u=T(r);return e.write(`const ${u} = ${c}(${n}, ${a});`),e.write(`if (!${u}.valid) return INVALID;`),`${u}.data`}function ck(e,r,i,o){let t=i._zod.def,n=N(r,De);e.write(`if (!${n}(${o})) return INVALID;`);let a=T(r),c=T(r),u=T(r);e.write(`const ${a} = {};`);let l=t,d=l.partial?void 0:t.keyType._zod.values;if(d){let f=[];for(let k of d){if(!(typeof k=="string"||typeof k=="number"||typeof k=="symbol"))throw new M(`record key value ${String(k)}`);let x=typeof k=="number"?k.toString():k;if(x==="__proto__")throw new M('record key "__proto__"');f.push(x);let A=N(r,k),P=ee(e,r,t.keyType,A),D=T(r);e.write(`const ${D} = ${o}[${uk(r,x)}];`);let Z=fe(e,r,t.valueType,D);e.write(`${a}[${P}] = ${Z};`)}let v=N(r,new Set(f));return e.write(`for (const ${c} in ${o}) {`),e.indented(k=>{k.write(`if (${v}.has(${c})) continue;`),l.mode==="loose"?k.write(`if (${c} !== "__proto__") ${a}[${c}] = ${o}[${c}];`):k.write("return INVALID;")}),e.write("}"),a}let p=t.keyType._zod.def;if(!(p.type==="string"&&p.format===void 0&&!p.coerce&&(p.checks?.length??0)===0)){let f=t.mode==="loose",v=Xi(t.keyType);v.definite===!1&&(r.definite=!1);let k=N(r,v),x=N(r,Ye),A=T(r);return If(e,r,o,c,P=>{P.write(`let ${A} = ${k}(${c});`),P.write(`if (${A} === INVALID && typeof ${c} === "string" && ${x}.test(${c})) ${A} = ${k}(Number(${c}));`),f?P.write(`if (${A} === INVALID) { ${a}[${c}] = ${o}[${c}]; continue; }`):P.write(`if (${A} === INVALID) return INVALID;`),P.write(`if (${A} === "__proto__") continue;`);let D=T(r);P.write(`const ${D} = ${o}[${c}];`);let Z=fe(P,r,t.valueType,D);P.write(`${a}[${A}] = ${Z};`)}),a}return If(e,r,o,c,f=>{f.write(`const ${u} = ${o}[${c}];`);let v=fe(f,r,t.valueType,u);f.write(`${a}[${c}] = ${v};`)},"return INVALID;"),a}function If(e,r,i,o,t,n){let a=N(r,Object.prototype.propertyIsEnumerable),c=T(r),u=T(r),l=T(r);e.write(`const ${c} = Object.getOwnPropertySymbols(${i});`),e.write(`const ${u} = Object.getOwnPropertyNames(${i});`),e.write(`for (let ${l} = 0; ${l} < ${u}.length; ${l}++) {`),e.indented(d=>{d.write(`const ${o} = ${u}[${l}];`),d.write(`if (${o} === "__proto__" || !${a}.call(${i}, ${o})) continue;`),t(d)}),e.write("}"),e.write(`for (let ${l} = 0; ${l} < ${c}.length; ${l}++) {`),e.indented(d=>{d.write(`const ${o} = ${c}[${l}];`),d.write(`if (!${a}.call(${i}, ${o})) continue;`),n?d.write(n):t(d)}),e.write("}")}function uk(e,r){return typeof r=="string"?he(r):N(e,r)}function lk(e,r,i,o){let t=i._zod.def;e.write(`if (!(${o} instanceof Map)) return INVALID;`);let n=T(r),a=T(r),c=T(r);return e.write(`const ${n} = new Map();`),e.write(`for (const [${a}, ${c}] of ${o}) {`),e.indented(u=>{let l=ee(u,r,t.keyType,a),d=ee(u,r,t.valueType,c);u.write(`${n}.set(${l}, ${d});`)}),e.write("}"),n}function dk(e,r,i,o){let t=i._zod.def;e.write(`if (!(${o} instanceof Set)) return INVALID;`);let n=T(r),a=T(r);return e.write(`const ${n} = new Set();`),e.write(`for (const ${a} of ${o}) {`),e.indented(c=>{let u=ee(c,r,t.valueType,a);c.write(`${n}.add(${u});`)}),e.write("}"),n}function pk(e,r){return e.write(`if (!(${r} instanceof File)) return INVALID;`),r}function mk(e,r,i,o){e.write(`if (typeof ${o} !== "string") return INVALID;`);let t=i._zod.pattern;if(t){let n=N(r,t);e.write(`${n}.lastIndex = 0;`),e.write(`if (!${n}.test(${o})) return INVALID;`)}return o}function fk(e,r,i,o){let t=i._zod.def,n=At(r,t.getter),a=N(r,{parser:null});e.write(`if (!${a}.parser) {`),e.indented(u=>{u.write(`const inner = ${n}();`),u.write(`${a}.parser = function(input) {`),u.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),u.write("};")}),e.write("}");let c=T(r);return e.write(`const ${c} = ${a}.parser(${o});`),e.write(`if (${c} === INVALID) return INVALID;`),c}function gk(e,r,i,o){let t=i._zod.def,n=ee(e,r,t.in,o);if(t.transform){if(jt(t.transform))throw new Re("z.compile: async transforms in pipes are not supported");let a=t.transform,u=At(r,d=>{let p={value:d,issues:[],addIssue:pu},m=a(d,p);return m instanceof Promise?be:p.issues.length===0?m:be}),l=T(r);return e.write(`const ${l} = ${u}(${n});`),e.write(`if (${l} === INVALID) return INVALID;`),ee(e,r,t.out,l)}else return ee(e,r,t.out,n)}function jt(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function hk(e,r,i,o){let t=i._zod.def;if(t.fn){if(jt(t.fn))throw new Re("z.compile: async custom predicates are not supported");let n=At(r,t.fn),a=N(r,uu),c=T(r);e.write(`const ${c} = ${n}(${o});`),e.write(`if (${c} instanceof Promise) ${a}();`),e.write(`if (!${c}) return INVALID;`)}else throw new M("custom schema without a predicate function");return o}function vk(e,r,i){let o=e._zod.run({value:i,issues:[]},{});if(o&&typeof o.then=="function")return be;let t=o;return t.issues.length===0?t.value:r()}function bk(e,r,i,o){let t=i._zod.def;if(!t.catchValue[ri])throw new M("catch with a callback (only a constant catch value compiles)",!1);let n=T(r);e.write(`let ${n} = (() => {`),e.indented(l=>{let d=fe(l,r,t.innerType,o);l.write(`return ${d};`)}),e.write("})();");let a=N(r,t.innerType),c=At(r,t.catchValue),u=N(r,vk);return e.write(`if (${n} === INVALID) {`),e.indented(l=>{l.write(`${n} = ${u}(${a}, ${c}, ${o});`),l.write(`if (${n} === INVALID) return INVALID;`)}),e.write("}"),n}function yk(e,r,i,o){let t=i._zod.def;if(t.transform){if(jt(t.transform))throw new Re("z.compile: async transforms are not supported");let n=t.transform,c=At(r,l=>{let d={value:l,issues:[],addIssue:pu},p=n(l,d);return p instanceof Promise?be:d.issues.length===0?p:be}),u=T(r);return e.write(`const ${u} = ${c}(${o});`),e.write(`if (${u} === INVALID) return INVALID;`),u}return o}function Yi(e){return e.checks&&(e.checks=[...e.checks]),e}function mu(e,r){return new e(Yi({type:"string",...I(r)}))}function fu(e,r){return new e(Yi({type:"string",coerce:!0,...I(r)}))}function Qi(e,r){return new e({type:"string",format:"email",check:"string_format",abort:!1,...I(r)})}function eo(e,r){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...I(r)})}function to(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...I(r)})}function ro(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...I(r)})}function no(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...I(r)})}function io(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...I(r)})}function yn(e,r){return new e({type:"string",format:"url",check:"string_format",abort:!1,...I(r)})}function oo(e,r){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...I(r)})}function ao(e,r){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...I(r)})}function so(e,r){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...I(r)})}function co(e,r){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...I(r)})}function uo(e,r){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...I(r)})}function lo(e,r){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...I(r)})}function po(e,r){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...I(r)})}function mo(e,r){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...I(r)})}function fo(e,r){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...I(r)})}function gu(e,r){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...I(r)})}function go(e,r){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...I(r)})}function ho(e,r){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...I(r)})}function vo(e,r){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...I(r)})}function bo(e,r){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...I(r)})}function yo(e,r){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...I(r)})}function hu(e,r){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...I(r)})}function vu(e,r){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...I(r)})}function _o(e,r){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...I(r)})}var bu={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function _n(e,r){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...I(r)})}function $n(e,r){return new e({type:"string",format:"date",check:"string_format",...I(r)})}function kn(e,r){return new e({type:"string",format:"time",check:"string_format",precision:null,...I(r)})}function wn(e,r){return new e({type:"string",format:"duration",check:"string_format",...I(r)})}function yu(e,r){return new e(Yi({type:"number",checks:[],...I(r)}))}function _u(e,r){return new e(Yi({type:"number",coerce:!0,checks:[],...I(r)}))}function $u(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...I(r)})}function ku(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...I(r)})}function wu(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...I(r)})}function xu(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...I(r)})}function Su(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...I(r)})}function Iu(e,r){return new e({type:"boolean",...I(r)})}function zu(e,r){return new e({type:"boolean",coerce:!0,...I(r)})}function Pu(e,r){return new e({type:"bigint",...I(r)})}function Ou(e,r){return new e({type:"bigint",coerce:!0,...I(r)})}function Au(e,r){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...I(r)})}function ju(e,r){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...I(r)})}function Tu(e,r){return new e({type:"symbol",...I(r)})}function Du(e,r){return new e({type:"undefined",...I(r)})}function Nu(e,r){return new e({type:"null",...I(r)})}function Cu(e){return new e({type:"any"})}function Uu(e){return new e({type:"unknown"})}function Eu(e,r){return new e({type:"never",...I(r)})}function Ru(e,r){return new e({type:"void",...I(r)})}function Lu(e,r){return new e({type:"date",...I(r)})}function Zu(e,r){return new e({type:"date",coerce:!0,...I(r)})}function Mu(e,r){return new e({type:"nan",...I(r)})}function Fe(e,r){return new bi({check:"less_than",...I(r),value:e,inclusive:!1})}function Ae(e,r){return new bi({check:"less_than",...I(r),value:e,inclusive:!0})}function Be(e,r){return new yi({check:"greater_than",...I(r),value:e,inclusive:!1})}function je(e,r){return new yi({check:"greater_than",...I(r),value:e,inclusive:!0})}function $o(e){return Be(0,e)}function ko(e){return Fe(0,e)}function wo(e){return Ae(0,e)}function xo(e){return je(0,e)}function ut(e,r){return new Ss({check:"multiple_of",...I(r),value:e})}function lt(e,r){return new Ps({check:"max_size",...I(r),maximum:e})}function Ge(e,r){return new Os({check:"min_size",...I(r),minimum:e})}function Tt(e,r){return new As({check:"size_equals",...I(r),size:e})}function Dt(e,r){return new js({check:"max_length",...I(r),maximum:e})}function Qe(e,r){return new Ts({check:"min_length",...I(r),minimum:e})}function Nt(e,r){return new Ds({check:"length_equals",...I(r),length:e})}function sr(e,r){return new Ns({check:"string_format",format:"regex",...I(r),pattern:e})}function cr(e){return new Cs({check:"string_format",format:"lowercase",...I(e)})}function ur(e){return new Us({check:"string_format",format:"uppercase",...I(e)})}function lr(e,r){return new Es({check:"string_format",format:"includes",...I(r),includes:e})}function dr(e,r){return new Rs({check:"string_format",format:"starts_with",...I(r),prefix:e})}function pr(e,r){return new Ls({check:"string_format",format:"ends_with",...I(r),suffix:e})}function So(e,r,i){return new Zs({check:"property",property:e,schema:r,...I(i)})}function mr(e,r){return new Ms({check:"properties",shape:e,...I(r)})}function fr(e,r){return new Vs({check:"mime_type",mime:e,...I(r)})}function Le(e){return new Fs({check:"overwrite",tx:e})}function gr(e){return Le(r=>r.normalize(e))}function hr(){return Le(e=>e.trim())}function vr(){return Le(e=>e.toLowerCase())}function br(){return Le(e=>e.toUpperCase())}function yr(){return Le(e=>za(e))}function Vu(e,r,i){return new e({type:"array",element:r,...I(i)})}function _k(e,r,i){return new e({type:"union",options:r,...I(i)})}function $k(e,r,i){return new e({type:"union",options:r,inclusive:!1,...I(i)})}function kk(e,r,i,o){return new e({type:"union",options:i,discriminator:r,...I(o)})}function wk(e,r,i){return new e({type:"intersection",left:r,right:i})}function xk(e,r,i,o){let t=i instanceof U,n=t?o:i,a=t?i:null;return new e({type:"tuple",items:r,rest:a,...I(n)})}function Sk(e,r,i,o){return new e({type:"record",keyType:r,valueType:i,...I(o)})}function Ik(e,r,i,o){return new e({type:"map",keyType:r,valueType:i,...I(o)})}function zk(e,r,i){return new e({type:"set",valueType:r,...I(i)})}function Pk(e,r,i){let o=Array.isArray(r)?Object.fromEntries(r.map(t=>[t,t])):r;return new e({type:"enum",entries:o,...I(i)})}function Ok(e,r,i){return new e({type:"enum",entries:r,...I(i)})}function Ak(e,r,i){return new e({type:"literal",values:Array.isArray(r)?r:[r],...I(i)})}function Fu(e,r){return new e({type:"file",...I(r)})}function jk(e,r){return new e({type:"transform",transform:r})}function Tk(e,r){return new e({type:"optional",innerType:r})}function Dk(e,r){return new e({type:"nullable",innerType:r})}function Nk(e,r,i){return new e({type:"default",innerType:r,get defaultValue(){return typeof i=="function"?i():Fr(i)}})}function Ck(e,r,i){return new e({type:"nonoptional",innerType:r,...I(i)})}function Uk(e,r){return new e({type:"success",innerType:r})}function Ek(e,r,i){return new e({type:"catch",innerType:r,catchValue:typeof i=="function"?i:Da(i)})}function Rk(e,r,i){return new e({type:"pipe",in:r,out:i})}function Lk(e,r){return new e({type:"readonly",innerType:r})}function Zk(e,r,i){return new e({type:"template_literal",parts:r,...I(i)})}function Mk(e,r){return new e({type:"lazy",getter:r})}function Vk(e,r){return new e({type:"promise",innerType:r})}function Bu(e,r,i){let o=I(i);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:r,...o})}function Gu(e,r,i){return new e({type:"custom",check:"custom",fn:r,...I(i)})}function Ku(e,r){let i=Af(o=>(o.addIssue=t=>{if(typeof t=="string")o.issues.push(Xt(t,o.value,i._zod.def));else{let n=t;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),"input"in n||(n.input=o.value),n.inst??(n.inst=i),n.continue??(n.continue=!i._zod.def.abort),o.issues.push(Xt(n))}},e(o.value,o)),r);return i}function Af(e,r){let i=new X({check:"custom",...I(r)});return i._zod.check=e,i}function Ju(e){let r=new X({check:"describe"});return r._zod.onattach=[i=>{let o=le.get(i)??{};le.add(i,{...o,description:e})}],r._zod.check=()=>{},r}function Wu(e){let r=new X({check:"meta"});return r._zod.onattach=[i=>{let o=le.get(i)??{};le.add(i,{...o,...e})}],r._zod.check=()=>{},r}function Hu(e,r){let i=I(r),o=i.truthy??["true","1","yes","on","y","enabled"],t=i.falsy??["false","0","no","off","n","disabled"];i.case!=="sensitive"&&(o=o.map(f=>typeof f=="string"?f.toLowerCase():f),t=t.map(f=>typeof f=="string"?f.toLowerCase():f));let n=new Set(o),a=new Set(t),c=e.Codec??pn,u=e.Boolean??ln,l=e.String??zt,d=new l({type:"string",error:i.error}),p=new u({type:"boolean",error:i.error}),m=new c({type:"pipe",in:d,out:p,transform:((f,v)=>{let k=f;return i.case!=="sensitive"&&(k=k.toLowerCase()),n.has(k)?!0:a.has(k)?!1:(v.issues.push({code:"invalid_value",expected:"stringbool",values:[...n,...a],input:v.value,inst:m,continue:!1}),{})}),reverseTransform:((f,v)=>f===!0?o[0]||"true":t[0]||"false"),error:i.error});return m._zod.bag.truthy=o,m._zod.bag.falsy=t,m._zod.bag.case=i.case??"insensitive",m}function Ct(e,r,i,o={}){let t=I(o),n={check:"string_format",type:"string",format:r,fn:typeof i=="function"?i:c=>i.test(c),...t};return i instanceof RegExp&&(n.pattern=i),new e(n)}function xn(e,...r){for(let i of r)for(let o of Reflect.ownKeys(i))Object.prototype.propertyIsEnumerable.call(i,o)&&ue(e,o,i[o]);return e}function dt(e){let r=e?.target??"draft-2020-12";return r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??le,target:r,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function ie(e,r,i,o,t){let n=typeof r.unrepresentable=="function"?r.unrepresentable({zodSchema:e,path:o.path,message:t}):r.unrepresentable;if(n==="any")return!1;if(n===void 0||n==="throw")throw new Error(t);return Object.assign(i,n),!0}function W(e,r,i={path:[],schemaPath:[]}){var o;let t=e._zod.def,n=r.seen.get(e);if(n)return n.count++,i.schemaPath.includes(e)&&(n.cycle=i.path),n.schema;let a={schema:{},count:1,cycle:void 0,path:i.path};r.seen.set(e,a),r.sharedDefsExtractedFor=void 0,r.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)a.schema=c;else{let d={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(r,a.schema,d);else{let m=a.schema,f=r.processors[t.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${t.type}`);f(e,r,m,d)}let p=e._zod.parent;p&&(a.ref||(a.ref=p),W(p,r,d),r.seen.get(p).isParent=!0)}let u=r.metadataRegistry.get(e);return u&&xn(a.schema,u),r.io==="input"&&ye(e)&&(delete a.schema.examples,delete a.schema.default),r.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,r.seen.get(e).schema}function jf(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function pt(e,r){let i=e.seen.get(r);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let a of e.seen.entries()){let c=e.metadataRegistry.get(a[0])?.id;if(c){let u=o.get(c);if(u&&u!==a[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(c,a[0])}}let t=a=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(a[0])?.id,m=e.external.uri??(v=>v);if(p)return{ref:m(p)};let f=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=f,{defId:f,ref:`${m("__shared")}#/${c}/${jf(f)}`}}let u="#",l=`${u}/${c}/`;if(a[1]===i&&!a[1].schema.id)return{ref:u};let d=a[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:l+jf(d)}},n=a=>{if(a[1].schema.$ref)return;let c=a[1],{ref:u,defId:l}=t(a);c.def={...c.schema},l&&(c.defId=l);let d=c.schema;for(let p in d)delete d[p];d.$ref=u};if(e.cycles==="throw")for(let a of e.seen.entries()){let c=a[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
62
62
|
|
|
63
63
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let c=a[1];if(r===a[0]){n(a);continue}if(e.external){let l=e.external.registry.get(a[0])?.id;if(r!==a[0]&&l){n(a);continue}}if(e.metadataRegistry.get(a[0])?.id){n(a);continue}if(c.cycle){n(a);continue}c.count>1&&e.reused==="ref"&&n(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Nf(e){let r=e.anyOf;if(!Array.isArray(r)||r.length===0||e.type!==void 0)return;let i=[];for(let o of r){if(!o||typeof o!="object")return;Nf(o);let t=Object.keys(o);if(t.length!==1||t[0]!=="type")return;let n=o.type;for(let a of Array.isArray(n)?n:[n]){if(typeof a!="string")return;i.includes(a)||i.push(a)}}delete e.anyOf,e.type=i.length===1?i[0]:i}var Cf=new Set(["type","properties","required","additionalProperties"]),Tf=["oneOf","anyOf"];function Df(e){let r=e.additionalProperties;return r===void 0||r===!1||typeof r!="object"||r===null?null:Object.keys(r).length?r:null}function qu(e){let r=[];for(let n of e){if(typeof n!="object"||n.type!=="object")return null;for(let a in n)if(!Cf.has(a))return null;r.push(n)}let i={},o=new Set;for(let n of r){for(let a in n.properties){if(Object.prototype.hasOwnProperty.call(i,a))continue;let c=[];for(let l of r){let d=l.properties?.[a]??Df(l);d!=null&&(c.some(p=>JSON.stringify(p)===JSON.stringify(d))||c.push(d))}let u=c.length===1?c[0]:qu(c)??{allOf:c};ue(i,a,u)}for(let a of n.required??[])o.add(a)}let t={type:"object",properties:i};if(o.size&&(t.required=[...o]),r.every(n=>n.additionalProperties===!1))t.additionalProperties=!1;else{let n=[];for(let a of r){let c=Df(a);c&&!n.some(u=>JSON.stringify(u)===JSON.stringify(c))&&n.push(c)}n.length===1?t.additionalProperties=n[0]:n.length>1&&(t.additionalProperties={allOf:n})}return t}function Fk(e){let r=e.allOf;if(!Array.isArray(r)||r.length<2)return;for(let t of Cf)if(t in e)return;let i=r.filter(t=>Tf.some(n=>Array.isArray(t[n]))),o=null;if(!i.length)o=qu(r);else{let t=i[0],n=Tf.find(u=>Array.isArray(t[u]));if(Object.keys(t).length!==1)return;let a=r.filter(u=>u!==t),c=t[n].map(u=>qu([...a,u]));if(c.some(u=>!u))return;o={[n]:c}}o&&(delete e.allOf,xn(e,o))}function mt(e,r){let i=e.seen.get(r);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=c=>{let u=e.seen.get(c);if(u.ref===null)return;let l=u.def??u.schema,d={...l},p=u.ref;if(u.ref=null,p){o(p);let f=e.seen.get(p),v=f.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(v)):xn(l,v),xn(l,d),c._zod.parent===p)for(let x in l)x==="$ref"||x==="allOf"||x in d||delete l[x];if(v.$ref&&f.def)for(let x in l)x==="$ref"||x==="allOf"||x in f.def&&JSON.stringify(l[x])===JSON.stringify(f.def[x])&&delete l[x]}let m=c._zod.parent;if(m&&m!==p){o(m);let f=e.seen.get(m);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let v in l)v==="$ref"||v==="allOf"||v in f.def&&JSON.stringify(l[v])===JSON.stringify(f.def[v])&&delete l[v]}e.override({zodSchema:c,jsonSchema:l,path:u.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())o(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())Nf(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let u of e.seen.values())for(let l of[u.schema,u.def]){let d=l?.allOf;if(!Array.isArray(d))continue;let p=c.get(d);p?p.push(l):c.set(d,[l])}for(let u of e.intersections)for(let l of c.get(u)??[])Fk(l)}}let t={};if(e.target==="draft-2020-12"?t.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?t.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?t.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let c=e.external.registry.get(r)?.id;if(!c)throw new Error("Schema is missing an `id` property");t.$id=e.external.uri(c)}xn(t,i.defId?i.schema:i.def??i.schema);let n=e.metadataRegistry.get(r)?.id;n!==void 0&&t.id===n&&delete t.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,ue(a,u.defId,u.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?t.$defs=a:t.definitions=a);try{let c=JSON.parse(JSON.stringify(t));return Object.defineProperty(c,"~standard",{value:{...r["~standard"],jsonSchema:{input:_r(r,"input",e.processors),output:_r(r,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function ye(e,r){let i=r??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return ye(o.element,i);if(o.type==="set")return ye(o.valueType,i);if(o.type==="lazy")return ye(o.getter(),i);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return ye(o.innerType,i);if(o.type==="intersection")return ye(o.left,i)||ye(o.right,i);if(o.type==="record"||o.type==="map")return ye(o.keyType,i)||ye(o.valueType,i);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ye(o.in,i)||ye(o.out,i);if(o.type==="object"){for(let t in o.shape)if(ye(o.shape[t],i))return!0;return!1}if(o.type==="union"){for(let t of o.options)if(ye(t,i))return!0;return!1}if(o.type==="tuple"){for(let t of o.items)if(ye(t,i))return!0;return!!(o.rest&&ye(o.rest,i))}return!1}var Xu=(e,r={})=>i=>{let o=dt({...i,processors:r});return W(e,o),pt(o,e),mt(o,e)},_r=(e,r,i={})=>o=>{let{libraryOptions:t,target:n}=o??{},a=dt({...t??{},target:n,io:r,processors:i});return W(e,a),pt(a,e),mt(a,e)};var $r=(e,r,i)=>{(e[r]===void 0||i>e[r])&&(e[r]=i)},kr=(e,r,i)=>{(e[r]===void 0||i<e[r])&&(e[r]=i)},Uf=(e,r)=>{$r(e,"minimum",r),kr(e,"maximum",r)},Zf=(e,r)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(r)||e.multipleOf.push(r)},Mf=(e,r)=>{e.patterns??(e.patterns=new Set),e.patterns.add(r)},Vf=(e,r)=>{e.mime=e.mime?e.mime.filter(i=>r.includes(i)):[...r]},Ff=(e,r)=>{e.format=r,r.includes("int")&&(e.isInt=!0)},Ef=(e,r)=>$r(e,"minimum",r.minimum),Rf=(e,r)=>kr(e,"maximum",r.maximum),Lf=e=>(r,i)=>{Ff(r,i.format);let[o,t]=e[i.format];$r(r,"minimum",o),kr(r,"maximum",t)},Bk={greater_than:(e,r)=>$r(e,r.inclusive?"minimum":"exclusiveMinimum",r.value),less_than:(e,r)=>kr(e,r.inclusive?"maximum":"exclusiveMaximum",r.value),multiple_of:(e,r)=>Zf(e,r.value),number_format:Lf(Gr),bigint_format:Lf(Kr),min_length:Ef,max_length:Rf,length_equals:(e,r)=>Uf(e,r.length),min_size:Ef,max_size:Rf,size_equals:(e,r)=>Uf(e,r.size),string_format:(e,r)=>{Ff(e,r.format),r.pattern&&Mf(e,r.pattern),(r.format==="base64"||r.format==="base64url")&&(e.contentEncoding=r.format),(r.local||r.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,r)=>Vf(e,r.mime)};function oe(e){let r={},i=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...i.checks??[]]:i.checks??[];for(let n of o)Bk[n._zod.def.check]?.(r,n._zod.def);let t=e._zod.bag;t.minimum!==void 0&&$r(r,"minimum",t.minimum),t.exclusiveMinimum!==void 0&&$r(r,"exclusiveMinimum",t.exclusiveMinimum),t.maximum!==void 0&&kr(r,"maximum",t.maximum),t.exclusiveMaximum!==void 0&&kr(r,"exclusiveMaximum",t.exclusiveMaximum),t.multipleOf!==void 0&&Zf(r,t.multipleOf),t.format!==void 0&&(r.format??(r.format=t.format),t.format.includes("int")&&(r.isInt=!0)),t.mime&&Vf(r,t.mime);for(let n of t.patterns??[])Mf(r,n);return r}var Gk={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Kk=new Map([[Oi,os],[un,as]]),Bf=e=>Kk.get(e)??e,el=(e,r,i,o)=>{let t=i;t.type="string";let{minimum:n,maximum:a,format:c,patterns:u,contentEncoding:l,laxFormat:d}=oe(e);if(typeof n=="number"&&(t.minLength=n),typeof a=="number"&&(t.maxLength=a),c&&(t.format=Gk[c]??c,t.format===""&&delete t.format,(c==="time"||d)&&delete t.format),l&&(t.contentEncoding=l),u&&u.size>0){let p=[...u].map(Bf);p.length===1?t.pattern=p[0].source:p.length>1&&(t.allOf=[...p.map(m=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},tl=(e,r,i,o)=>{let t=i,{minimum:n,maximum:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l,isInt:d}=oe(e);t.type=d?"integer":"number";let p=typeof l=="number"&&l>=(n??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(a??Number.POSITIVE_INFINITY),f=r.target==="draft-04"||r.target==="openapi-3.0";if(p?f?(t.minimum=l,t.exclusiveMinimum=!0):t.exclusiveMinimum=l:typeof n=="number"&&(t.minimum=n),m?f?(t.maximum=u,t.exclusiveMaximum=!0):t.exclusiveMaximum=u:typeof a=="number"&&(t.maximum=a),c){let v=new Set;for(let A of c)Number.isFinite(A)&&A!==0?v.add(Math.abs(A)):ie(e,r,t,o,`A multipleOf divisor of ${A} cannot be represented in JSON Schema`);let[k,...x]=v;k!==void 0&&(t.multipleOf=k),x.length&&(t.allOf=[...t.allOf??[],...x.map(A=>({multipleOf:A}))])}},rl=(e,r,i,o)=>{i.type="boolean"},nl=(e,r,i,o)=>{ie(e,r,i,o,"BigInt cannot be represented in JSON Schema")},il=(e,r,i,o)=>{ie(e,r,i,o,"Symbols cannot be represented in JSON Schema")},ol=(e,r,i,o)=>{r.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},al=(e,r,i,o)=>{ie(e,r,i,o,"Undefined cannot be represented in JSON Schema")},sl=(e,r,i,o)=>{ie(e,r,i,o,"Void cannot be represented in JSON Schema")},cl=(e,r,i,o)=>{i.not={}},ul=(e,r,i,o)=>{},ll=(e,r,i,o)=>{},dl=(e,r,i,o)=>{ie(e,r,i,o,"Date cannot be represented in JSON Schema")},pl=(e,r,i,o)=>{let t=e._zod.def,n=Jt(t.entries);if(n.length===0){i.not={};return}n.every(a=>typeof a=="number")&&(i.type="number"),n.every(a=>typeof a=="string")&&(i.type="string"),i.enum=n},ml=(e,r,i,o)=>{let t=e._zod.def;if(t.values.length===0){i.not={};return}let n=[];for(let a of t.values)if(a===void 0){if(ie(e,r,i,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(ie(e,r,i,o,"BigInt literals cannot be represented in JSON Schema"))return;n.push(Number(a))}else n.push(a);if(n.length!==0)if(n.length===1){let a=n[0];i.type=a===null?"null":typeof a,r.target==="draft-04"||r.target==="openapi-3.0"?i.enum=[a]:i.const=a}else n.every(a=>typeof a=="number")&&(i.type="number"),n.every(a=>typeof a=="string")&&(i.type="string"),n.every(a=>typeof a=="boolean")&&(i.type="boolean"),n.every(a=>a===null)&&(i.type="null"),i.enum=n},fl=(e,r,i,o)=>{ie(e,r,i,o,"NaN cannot be represented in JSON Schema")},gl=(e,r,i,o)=>{let t=i,n=e._zod.pattern;if(!n)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=n.source},hl=(e,r,i,o)=>{let t=i;t.type="string",t.format="binary",t.contentEncoding="binary";let{minimum:n,maximum:a,mime:c}=oe(e);n!==void 0&&(t.minLength=n),a!==void 0&&(t.maxLength=a),c&&(c.length===0?t.not={}:c.length===1?t.contentMediaType=c[0]:t.anyOf=c.map(u=>({contentMediaType:u})))},vl=(e,r,i,o)=>{i.type="boolean"},bl=(e,r,i,o)=>{ie(e,r,i,o,"Custom types cannot be represented in JSON Schema")},yl=(e,r,i,o)=>{ie(e,r,i,o,"Function types cannot be represented in JSON Schema")},_l=(e,r,i,o)=>{ie(e,r,i,o,"Transforms cannot be represented in JSON Schema")},$l=(e,r,i,o)=>{ie(e,r,i,o,"Map cannot be represented in JSON Schema")},kl=(e,r,i,o)=>{ie(e,r,i,o,"Set cannot be represented in JSON Schema")},wl=(e,r,i,o)=>{let t=i,n=e._zod.def,{minimum:a,maximum:c}=oe(e);typeof a=="number"&&(t.minItems=a),typeof c=="number"&&(t.maxItems=c),t.type="array",t.items=W(n.element,r,{...o,path:[...o.path,"items"]})};function Sn(e){let r=e._zod.def;return r.type==="pipe"&&r.in._zod.traits.has("$ZodTransform")?Sn(r.out):r.type==="catch"?Sn(r.innerType):e._zod.optin}var xl=(e,r,i,o)=>{let t=i,n=e._zod.def,a=n.shape;if(Object.getOwnPropertySymbols(a).length&&ie(e,r,t,o,"Symbol keys cannot be represented in JSON Schema"))return;t.type="object",t.properties={};for(let l in a)ue(t.properties,l,W(a[l],r,{...o,path:[...o.path,"properties",l]}));let u=[];for(let l of Object.keys(a)){let d=n.shape[l];(r.io==="input"?Sn(d)===void 0:d._zod.optout===void 0)&&u.push(l)}u.length>0&&(t.required=u),n.catchall?._zod.def.type==="never"?t.additionalProperties=!1:n.catchall?n.catchall&&(t.additionalProperties=W(n.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(t.additionalProperties=!1)},zo=(e,r,i,o)=>{let t=e._zod.def,n=t.inclusive===!1,a=t.options.map((c,u)=>W(c,r,{...o,path:[...o.path,n?"oneOf":"anyOf",u]}));n?i.oneOf=a:i.anyOf=a},Sl=(e,r,i,o)=>{let t=e._zod.def,n=W(t.left,r,{...o,path:[...o.path,"allOf",0]}),a=W(t.right,r,{...o,path:[...o.path,"allOf",1]}),c=l=>"allOf"in l&&Object.keys(l).length===1,u=[...c(n)?n.allOf:[n],...c(a)?a.allOf:[a]];i.allOf=u,r.intersections.push(u)},Il=(e,r,i,o)=>{let t=i,n=e._zod.def;t.type="array";let a=r.target==="draft-2020-12"?"prefixItems":"items",c=r.target==="draft-2020-12"||r.target==="openapi-3.0"?"items":"additionalItems",u=n.items.map((k,x)=>W(k,r,{...o,path:[...o.path,a,x]})),l=n.rest?W(n.rest,r,{...o,path:[...o.path,c,...r.target==="openapi-3.0"?[n.items.length]:[]]}):null,d=n.items.length;for(;d>0;){let k=n.items[d-1];if(!(r.io==="input"?Sn(k)!==void 0:k._zod.optout==="optional"))break;d--}let p=n.items.length,m=!n.rest;r.target==="draft-2020-12"?(t.prefixItems=u,m?t.items=!1:l&&(t.items=l),d>0&&(t.minItems=d),m&&(t.maxItems=p)):r.target==="openapi-3.0"?(t.items={anyOf:u},l&&t.items.anyOf.push(l),d>0&&(t.minItems=d),m&&(t.maxItems=p)):(t.items=u,m?t.additionalItems=!1:l&&(t.additionalItems=l),d>0&&(t.minItems=d),m&&(t.maxItems=p));let{minimum:f,maximum:v}=oe(e);typeof f=="number"&&(t.minItems=f),typeof v=="number"&&(t.maxItems=v)};function Yu(e,r,i){if(r.$ref){if(i.has(r))return r;i.add(r);let v=e.get(r)?.def;if(!v)return r;let k=Yu(e,v,i);return k===v?r:k}for(let v of["anyOf","oneOf"]){let k=r[v];if(!Array.isArray(k))continue;let x=k.map(A=>Yu(e,A,i));x.some((A,P)=>A!==k[P])&&(r={...r,[v]:x})}let o=Array.isArray(r.type)?r.type:[r.type],t=!o.includes("string")&&o.some(v=>v==="number"||v==="integer"),n=r.enum??(r.const!==void 0?[r.const]:void 0);if(!t&&!n?.some(v=>typeof v=="number"))return r;let{minimum:a,maximum:c,exclusiveMinimum:u,exclusiveMaximum:l,multipleOf:d,format:p,id:m,...f}=r;return f.enum?f.enum=f.enum.map(v=>typeof v=="number"?String(v):v):typeof f.const=="number"&&(f.const=String(f.const)),t&&(f.type="string",n||(f.pattern=(o.includes("number")?Ye:tn).source)),f}var Qu=new WeakMap;function Jk(e){let r=new Map;for(let o of e.seen.values())o.def&&!r.has(o.schema)&&r.set(o.schema,o);let i=new Map;for(let o of Qu.get(e)??[]){let t=e.seen.get(o),n=(t?.def??t?.schema)?.propertyNames;if(!n||n===!0||i.has(n))continue;let a=Yu(r,n,new Set);a!==n&&i.set(n,a)}if(i.size)for(let o of e.seen.values())for(let t of[o.schema,o.def]){let n=t&&i.get(t.propertyNames);n&&(t.propertyNames=n)}}var zl=(e,r,i,o)=>{let t=i,n=e._zod.def;t.type="object";let a=n.keyType,c=oe(a).patterns;if(n.mode==="loose"&&c&&c.size>0){let d=W(n.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});t.patternProperties={};for(let p of c)ue(t.patternProperties,Bf(p).source,d)}else{if(r.target==="draft-07"||r.target==="draft-2020-12"){t.propertyNames=W(n.keyType,r,{...o,path:[...o.path,"propertyNames"]});let d=Qu.get(r);d||(d=[],Qu.set(r,d),r.deferred.push(()=>Jk(r))),d.push(e)}t.additionalProperties=W(n.valueType,r,{...o,path:[...o.path,"additionalProperties"]})}let u=a._zod.values,l=r.io==="input"&&Sn(n.valueType)!==void 0;if(u&&!n.partial&&!l){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(t.required=d.map(String))}},Pl=(e,r,i,o)=>{let t=e._zod.def,n=W(t.innerType,r,o),a=r.seen.get(e);r.target==="openapi-3.0"?(a.ref=t.innerType,i.nullable=!0):i.anyOf=[n,{type:"null"}]},Ol=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},Al=Symbol();function Gf(e,r,i,o,t){let n=!1,a=JSON.stringify(e,(c,u)=>typeof u!="bigint"?u:(n=!0,null));return n?(ie(r,i,o,t,"BigInt defaults cannot be represented in JSON Schema"),Al):JSON.parse(a)}var jl=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType;let a=Gf(t.defaultValue,e,r,i,o);a!==Al&&(i.default=a)},Tl=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);if(n.ref=t.innerType,r.io!=="input")return;let a=Gf(t.defaultValue,e,r,i,o);a!==Al&&(i._prefault=a)},Dl=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType;let a;try{a=t.catchValue(void 0)}catch{ie(e,r,i,o,"Dynamic catch values are not supported in JSON Schema");return}i.default=a},Nl=(e,r,i,o)=>{let t=e._zod.def,n=t.in._zod.traits.has("$ZodTransform"),a=r.io==="input"?n?t.out:t.in:t.out;W(a,r,o);let c=r.seen.get(e);c.ref=a},Cl=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType,i.readOnly=!0},Ul=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},Po=(e,r,i,o)=>{let t=e._zod.def;W(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},El=(e,r,i,o)=>{let t=e._zod.innerType;W(t,r,o);let n=r.seen.get(e);n.ref=t},Io={string:el,number:tl,boolean:rl,bigint:nl,symbol:il,null:ol,undefined:al,void:sl,never:cl,any:ul,unknown:ll,date:dl,enum:pl,literal:ml,nan:fl,template_literal:gl,file:hl,success:vl,custom:bl,function:yl,transform:_l,map:$l,set:kl,array:wl,object:xl,union:zo,intersection:Sl,tuple:Il,record:zl,nullable:Pl,nonoptional:Ol,default:jl,prefault:Tl,catch:Dl,pipe:Nl,readonly:Cl,promise:Ul,optional:Po,lazy:El};function Oo(e,r){if("_idmap"in e){let o=e,t=dt({...r,processors:Io}),n={};for(let u of o._idmap.entries()){let[l,d]=u;W(d,t)}let a={},c={registry:o,uri:r?.uri,defs:n};t.external=c;for(let u of o._idmap.entries()){let[l,d]=u;pt(t,d),ue(a,l,mt(t,d))}if(Object.keys(n).length>0){let u=t.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[u]:n}}return{schemas:a}}let i=dt({...r,processors:Io});return W(e,i),pt(i,e),mt(i,e)}var Ao=class{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(r){this.ctx.counter=r}get seen(){return this.ctx.seen}constructor(r){let i=r?.target??"draft-2020-12";i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),this.ctx=dt({processors:Io,target:i,...r?.metadata&&{metadata:r.metadata},...r?.unrepresentable&&{unrepresentable:r.unrepresentable},...r?.override&&{override:r.override},...r?.io&&{io:r.io}})}process(r,i={path:[],schemaPath:[]}){return W(r,this.ctx,i)}emit(r,i){i&&(i.cycles&&(this.ctx.cycles=i.cycles),i.reused&&(this.ctx.reused=i.reused),i.external&&(this.ctx.external=i.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,pt(this.ctx,r);let o=mt(this.ctx,r),{"~standard":t,...n}=o;return n}};var Kf={};var Ar={};He(Ar,{ZodAny:()=>od,ZodArray:()=>ud,ZodBase64:()=>Ho,ZodBase64URL:()=>qo,ZodBigInt:()=>Pr,ZodBigIntFormat:()=>Qo,ZodBoolean:()=>zr,ZodCIDRv4:()=>Jo,ZodCIDRv6:()=>Wo,ZodCUID:()=>Zo,ZodCUID2:()=>Mo,ZodCatch:()=>Ad,ZodCodec:()=>Cn,ZodCreditCard:()=>Xl,ZodCustom:()=>Un,ZodCustomStringFormat:()=>Lt,ZodDate:()=>On,ZodDefault:()=>xd,ZodDiscriminatedUnion:()=>dd,ZodE164:()=>Xo,ZodEmail:()=>Uo,ZodEmoji:()=>Ro,ZodEnum:()=>xr,ZodExactOptional:()=>na,ZodFile:()=>_d,ZodFunction:()=>Zd,ZodGUID:()=>Eo,ZodIBAN:()=>Yl,ZodIPv4:()=>Go,ZodIPv6:()=>Ko,ZodISODate:()=>gt,ZodISODateTime:()=>ft,ZodISODuration:()=>vt,ZodISOTime:()=>ht,ZodInstanceOf:()=>Fd,ZodIntersection:()=>pd,ZodJWT:()=>Yo,ZodKSUID:()=>Bo,ZodLazy:()=>Ed,ZodLiteral:()=>yd,ZodMAC:()=>ql,ZodMap:()=>vd,ZodNaN:()=>Td,ZodNanoID:()=>Lo,ZodNever:()=>sd,ZodNonOptional:()=>ia,ZodNull:()=>nd,ZodNullable:()=>wd,ZodNumber:()=>Ir,ZodNumberFormat:()=>Zt,ZodObject:()=>jn,ZodOptional:()=>Dn,ZodPipe:()=>Nn,ZodPrefault:()=>Id,ZodPreprocess:()=>Dd,ZodPromise:()=>Ld,ZodReadonly:()=>Nd,ZodRecord:()=>wr,ZodSet:()=>bd,ZodString:()=>Sr,ZodStringFormat:()=>q,ZodSuccess:()=>Od,ZodSymbol:()=>td,ZodTemplateLiteral:()=>Ud,ZodTransform:()=>$d,ZodTuple:()=>fd,ZodType:()=>R,ZodULID:()=>Vo,ZodURL:()=>Pn,ZodUUID:()=>Ke,ZodUndefined:()=>rd,ZodUnion:()=>Tn,ZodUnknown:()=>ad,ZodVoid:()=>cd,ZodXID:()=>Fo,ZodXor:()=>ld,_ZodString:()=>Co,_default:()=>Sd,_function:()=>ih,any:()=>Cg,array:()=>An,base64:()=>gg,base64url:()=>hg,bigint:()=>Ag,boolean:()=>ed,catch:()=>jd,check:()=>oh,cidrv4:()=>mg,cidrv6:()=>fg,codec:()=>eh,creditCard:()=>bg,cuid:()=>og,cuid2:()=>ag,currencyCode:()=>xg,custom:()=>ah,date:()=>Eg,describe:()=>sh,discriminatedUnion:()=>Fg,e164:()=>vg,email:()=>Hf,emoji:()=>ng,enum:()=>ta,exactOptional:()=>kd,file:()=>qg,float32:()=>Ig,float64:()=>zg,function:()=>ih,guid:()=>qf,hash:()=>Sg,hex:()=>wg,hostname:()=>kg,httpUrl:()=>rg,iban:()=>yg,instanceof:()=>uh,int:()=>Do,int32:()=>Pg,int64:()=>jg,intersection:()=>md,invertCodec:()=>th,ipv4:()=>lg,ipv6:()=>pg,json:()=>dh,jwt:()=>_g,keyof:()=>Rg,ksuid:()=>ug,lazy:()=>Rd,literal:()=>Hg,looseObject:()=>Mg,looseRecord:()=>Gg,mac:()=>dg,map:()=>Kg,meta:()=>ch,nan:()=>Qg,nanoid:()=>ig,nativeEnum:()=>Wg,never:()=>ea,nonoptional:()=>Pd,null:()=>id,nullable:()=>zn,nullish:()=>Xg,number:()=>Ql,object:()=>Lg,optional:()=>Et,partialRecord:()=>Bg,pipe:()=>No,prefault:()=>zd,preprocess:()=>ph,promise:()=>nh,readonly:()=>Cd,record:()=>hd,refine:()=>Md,set:()=>Jg,strictObject:()=>Zg,string:()=>In,stringFormat:()=>$g,stringbool:()=>lh,success:()=>Yg,superRefine:()=>Vd,symbol:()=>Dg,templateLiteral:()=>rh,transform:()=>ra,tuple:()=>gd,uint32:()=>Og,uint64:()=>Tg,ulid:()=>sg,undefined:()=>Ng,union:()=>Or,unknown:()=>Ut,url:()=>tg,uuid:()=>Xf,uuidv4:()=>Yf,uuidv6:()=>Qf,uuidv7:()=>eg,void:()=>Ug,xid:()=>cg,xor:()=>Vg});var jo={};He(jo,{endsWith:()=>pr,gt:()=>Be,gte:()=>je,includes:()=>lr,length:()=>Nt,lowercase:()=>cr,lt:()=>Fe,lte:()=>Ae,maxLength:()=>Dt,maxSize:()=>lt,mime:()=>fr,minLength:()=>Qe,minSize:()=>Ge,multipleOf:()=>ut,negative:()=>ko,nonnegative:()=>xo,nonpositive:()=>wo,normalize:()=>gr,overwrite:()=>Le,positive:()=>$o,properties:()=>mr,property:()=>So,regex:()=>sr,size:()=>Tt,slugify:()=>yr,startsWith:()=>dr,toLowerCase:()=>vr,toUpperCase:()=>br,trim:()=>hr,uppercase:()=>ur});var Jf=new WeakSet([Object.prototype,Error.prototype]);function To(e,r,i){Object.defineProperty(e,r,{configurable:!0,enumerable:!1,get(){let o=i(this);return Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0})}})}var Wf=(e,r)=>{La.init(e,r),e.name="ZodError";let i=Object.getPrototypeOf(e);Jf.has(i)||(Jf.add(i),To(i,"format",o=>t=>Xr(o,t)),To(i,"flatten",o=>t=>qr(o,t)),To(i,"addIssue",o=>t=>{o.issues.push(t),o.message=JSON.stringify(o.issues,Wt,2)}),To(i,"addIssues",o=>t=>{o.issues.push(...t),o.message=JSON.stringify(o.issues,Wt,2)}),Object.defineProperty(i,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Hk=g("ZodError",Wf),Ie=g("ZodError",Wf,void 0,{Parent:Error});var Rl=Yt(Ie),Ll=Qt(Ie),Zl=er(Ie),Ml=tr(Ie),Vl=ai(Ie),Fl=si(Ie),Bl=ci(Ie),Gl=ui(Ie),Kl=li(Ie),Jl=di(Ie),Wl=pi(Ie),Hl=mi(Ie);function Xk(){ae.localeError||re(Gi())}function Rt(){ae.memoizer||re({memoizer:hn()})}var R=g("ZodType",(e,r)=>(Xk(),U.init(e,r),e.def=r,e.type=r.type,e),{check(...e){let r=this.def;return this.clone(y.mergeDefs(r,{checks:[...r.checks??[],...e.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,r){return K(this,e,r)},brand(){return this},register(e,r){return e.add(this,r),this},refine(e,r){return this.check(Md(e,r))},superRefine(e,r){return this.check(Vd(e,r))},overwrite(e){return this.check(Le(e))},optional(){return Et(this)},exactOptional(){return kd(this)},nullable(){return zn(this)},nullish(){return Et(zn(this))},nonoptional(e){return Pd(this,e)},array(){return An(this)},or(e){return Or([this,e])},and(e){return md(this,e)},transform(e){return No(this,ra(e))},default(e){return Sd(this,e)},prefault(e){return zd(this,e)},catch(e){return jd(this,e)},pipe(e){return No(this,e)},readonly(){return Cd(this)},describe(e){let r=this.clone();return le.add(r,{description:e}),r},meta(...e){if(e.length===0)return le.get(this);let r=this.clone();return le.add(r,e[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...r){return r.length===0?e(this):e(this,...r)},get"~standard"(){return y.hide(this,"~standard",{...xi(this),jsonSchema:{input:_r(this,"input"),output:_r(this,"output")}})},set"~standard"(e){y.own(this,"~standard",e)},parse:function e(r,i){return Rl(this,r,i,{callee:e})},parseAsync:async function e(r,i){return await Ll(this,r,i,{callee:e})},safeParse(e,r){return Zl(this,e,r)},async safeParseAsync(e,r){return Ml(this,e,r)},get spa(){return this?.safeParseAsync},set spa(e){y.own(this,"spa",e)},validate(e,r){return Yr(this,e,r)},validateAsync(e,r){return Qr(this,e,r)},encode:function e(r,i){return Vl(this,r,i,{callee:e})},decode:function e(r,i){return Fl(this,r,i,{callee:e})},encodeAsync:async function e(r,i){return await Bl(this,r,i,{callee:e})},decodeAsync:async function e(r,i){return await Gl(this,r,i,{callee:e})},safeEncode(e,r){return Kl(this,e,r)},safeDecode(e,r){return Jl(this,e,r)},async safeEncodeAsync(e,r){return Wl(this,e,r)},async safeDecodeAsync(e,r){return Hl(this,e,r)},toJSONSchema(e){return Xu(this,{})(e)},get description(){return le.get(this)?.description},get _def(){return this._zod.def}}),Co=g("_ZodString",(e,r)=>{zt.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>el(e,i,o,t)},y.derived({format:e=>oe(e).format??null,minLength:e=>oe(e).minimum??null,maxLength:e=>oe(e).maximum??null},{regex(...e){return this.check(sr(...e))},includes(...e){return this.check(lr(...e))},startsWith(...e){return this.check(dr(...e))},endsWith(...e){return this.check(pr(...e))},min(...e){return this.check(Qe(...e))},max(...e){return this.check(Dt(...e))},length(...e){return this.check(Nt(...e))},nonempty(...e){return this.check(Qe(1,...e))},lowercase(e){return this.check(cr(e))},uppercase(e){return this.check(ur(e))},trim(){return this.check(hr())},normalize(...e){return this.check(gr(...e))},toLowerCase(){return this.check(vr())},toUpperCase(){return this.check(br())},slugify(){return this.check(yr())}})),Sr=g("ZodString",(e,r)=>{zt.init(e,r),Co.init(e,r)},{email(e){return this.check(Qi(Uo,e))},url(e){return this.check(yn(Pn,e))},jwt(e){return this.check(_o(Yo,e))},emoji(e){return this.check(oo(Ro,e))},guid(e){return this.check(eo(Eo,e))},uuid(e){return this.check(to(Ke,e))},uuidv4(e){return this.check(ro(Ke,e))},uuidv6(e){return this.check(no(Ke,e))},uuidv7(e){return this.check(io(Ke,e))},nanoid(e){return this.check(ao(Lo,e))},cuid(e){return this.check(so(Zo,e))},cuid2(e){return this.check(co(Mo,e))},ulid(e){return this.check(uo(Vo,e))},base64(e){return this.check(vo(Ho,e))},base64url(e){return this.check(bo(qo,e))},xid(e){return this.check(lo(Fo,e))},ksuid(e){return this.check(po(Bo,e))},ipv4(e){return this.check(mo(Go,e))},ipv6(e){return this.check(fo(Ko,e))},cidrv4(e){return this.check(go(Jo,e))},cidrv6(e){return this.check(ho(Wo,e))},e164(e){return this.check(yo(Xo,e))},datetime(e){return this.check(_n(ft,e))},date(e){return this.check($n(gt,e))},time(e){return this.check(kn(ht,e))},duration(e){return this.check(wn(vt,e))}});function In(e){return mu(Sr,e)}var q=g("ZodStringFormat",(e,r)=>{J.init(e,r),Co.init(e,r)}),ft=g("ZodISODateTime",(e,r)=>{oc.init(e,r),q.init(e,r)}),gt=g("ZodISODate",(e,r)=>{ac.init(e,r),q.init(e,r)}),ht=g("ZodISOTime",(e,r)=>{sc.init(e,r),q.init(e,r)}),vt=g("ZodISODuration",(e,r)=>{cc.init(e,r),q.init(e,r)}),Uo=g("ZodEmail",(e,r)=>{Ws.init(e,r),q.init(e,r)});function Hf(e){return Qi(Uo,e)}var Eo=g("ZodGUID",(e,r)=>{Ks.init(e,r),q.init(e,r)});function qf(e){return eo(Eo,e)}var Ke=g("ZodUUID",(e,r)=>{Js.init(e,r),q.init(e,r)});function Xf(e){return to(Ke,e)}function Yf(e){return ro(Ke,e)}function Qf(e){return no(Ke,e)}function eg(e){return io(Ke,e)}var Pn=g("ZodURL",(e,r)=>{Xs.init(e,r),q.init(e,r)});function tg(e){return yn(Pn,e)}function rg(e){return yn(Pn,{protocol:en,hostname:cs,...y.normalizeParams(e)})}var Ro=g("ZodEmoji",(e,r)=>{Ys.init(e,r),q.init(e,r)});function ng(e){return oo(Ro,e)}var Lo=g("ZodNanoID",(e,r)=>{Qs.init(e,r),q.init(e,r)});function ig(e){return ao(Lo,e)}var Zo=g("ZodCUID",(e,r)=>{ec.init(e,r),q.init(e,r)});function og(e){return so(Zo,e)}var Mo=g("ZodCUID2",(e,r)=>{tc.init(e,r),q.init(e,r)});function ag(e){return co(Mo,e)}var Vo=g("ZodULID",(e,r)=>{rc.init(e,r),q.init(e,r)});function sg(e){return uo(Vo,e)}var Fo=g("ZodXID",(e,r)=>{nc.init(e,r),q.init(e,r)});function cg(e){return lo(Fo,e)}var Bo=g("ZodKSUID",(e,r)=>{ic.init(e,r),q.init(e,r)});function ug(e){return po(Bo,e)}var Go=g("ZodIPv4",(e,r)=>{uc.init(e,r),q.init(e,r)});function lg(e){return mo(Go,e)}var ql=g("ZodMAC",(e,r)=>{dc.init(e,r),q.init(e,r)});function dg(e){return gu(ql,e)}var Ko=g("ZodIPv6",(e,r)=>{lc.init(e,r),q.init(e,r)});function pg(e){return fo(Ko,e)}var Jo=g("ZodCIDRv4",(e,r)=>{pc.init(e,r),q.init(e,r)});function mg(e){return go(Jo,e)}var Wo=g("ZodCIDRv6",(e,r)=>{mc.init(e,r),q.init(e,r)});function fg(e){return ho(Wo,e)}var Ho=g("ZodBase64",(e,r)=>{fc.init(e,r),q.init(e,r)});function gg(e){return vo(Ho,e)}var qo=g("ZodBase64URL",(e,r)=>{gc.init(e,r),q.init(e,r)});function hg(e){return bo(qo,e)}var Xo=g("ZodE164",(e,r)=>{hc.init(e,r),q.init(e,r)});function vg(e){return yo(Xo,e)}var Xl=g("ZodCreditCard",(e,r)=>{vc.init(e,r),q.init(e,r)});function bg(e){return hu(Xl,e)}var Yl=g("ZodIBAN",(e,r)=>{bc.init(e,r),q.init(e,r)});function yg(e){return vu(Yl,e)}var Yo=g("ZodJWT",(e,r)=>{yc.init(e,r),q.init(e,r)});function _g(e){return _o(Yo,e)}var Lt=g("ZodCustomStringFormat",(e,r)=>{_c.init(e,r),q.init(e,r)});function $g(e,r,i={}){return Ct(Lt,e,r,i)}function kg(e){return Ct(Lt,"hostname",ss,e)}function wg(e){return Ct(Lt,"hex",ks,e)}function xg(e){return Ct(Lt,"currency_code",ls,e)}function Sg(e,r){let i=r?.enc??"hex",o=`${e}_${i}`,t=Ce[o];if(!t)throw new Error(`Unrecognized hash format: ${o}`);return Ct(Lt,o,t,r)}var Ir=g("ZodNumber",(e,r)=>{Ni.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>tl(e,i,o,t),e.isFinite=!0},y.derived({minValue:e=>{let{minimum:r,exclusiveMinimum:i}=oe(e);return Math.max(r??Number.NEGATIVE_INFINITY,i??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:r,exclusiveMaximum:i}=oe(e);return Math.min(r??Number.POSITIVE_INFINITY,i??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:r,multipleOf:i}=oe(e);return!!r||!!i?.some(Number.isSafeInteger)},format:e=>oe(e).format??null},{gt(e,r){return this.check(Be(e,r))},gte(e,r){return this.check(je(e,r))},min(e,r){return this.check(je(e,r))},lt(e,r){return this.check(Fe(e,r))},lte(e,r){return this.check(Ae(e,r))},max(e,r){return this.check(Ae(e,r))},int(e){return this.check(Do(e))},safe(e){return this.check(Do(e))},positive(e){return this.check(Be(0,e))},nonnegative(e){return this.check(je(0,e))},negative(e){return this.check(Fe(0,e))},nonpositive(e){return this.check(Ae(0,e))},multipleOf(e,r){return this.check(ut(e,r))},step(e,r){return this.check(ut(e,r))},finite(){return this}}));function Ql(e){return yu(Ir,e)}var Zt=g("ZodNumberFormat",(e,r)=>{$c.init(e,r),Ir.init(e,r)});function Do(e){return $u(Zt,e)}function Ig(e){return ku(Zt,e)}function zg(e){return wu(Zt,e)}function Pg(e){return xu(Zt,e)}function Og(e){return Su(Zt,e)}var zr=g("ZodBoolean",(e,r)=>{ln.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>rl(e,i,o,t)});function ed(e){return Iu(zr,e)}var Pr=g("ZodBigInt",(e,r)=>{Ci.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>nl(e,i,o,t)},y.derived({minValue:e=>oe(e).minimum??null,maxValue:e=>oe(e).maximum??null,format:e=>oe(e).format??null},{gte(e,r){return this.check(je(e,r))},min(e,r){return this.check(je(e,r))},gt(e,r){return this.check(Be(e,r))},lt(e,r){return this.check(Fe(e,r))},lte(e,r){return this.check(Ae(e,r))},max(e,r){return this.check(Ae(e,r))},positive(e){return this.check(Be(BigInt(0),e))},negative(e){return this.check(Fe(BigInt(0),e))},nonpositive(e){return this.check(Ae(BigInt(0),e))},nonnegative(e){return this.check(je(BigInt(0),e))},multipleOf(e,r){return this.check(ut(e,r))}}));function Ag(e){return Pu(Pr,e)}var Qo=g("ZodBigIntFormat",(e,r)=>{kc.init(e,r),Pr.init(e,r)});function jg(e){return Au(Qo,e)}function Tg(e){return ju(Qo,e)}var td=g("ZodSymbol",(e,r)=>{wc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>il(e,i,o,t)});function Dg(e){return Tu(td,e)}var rd=g("ZodUndefined",(e,r)=>{xc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>al(e,i,o,t)});function Ng(e){return Du(rd,e)}var nd=g("ZodNull",(e,r)=>{Sc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ol(e,i,o,t)});function id(e){return Nu(nd,e)}var od=g("ZodAny",(e,r)=>{Ic.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ul(e,i,o,t)});function Cg(){return Cu(od)}var ad=g("ZodUnknown",(e,r)=>{zc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ll(e,i,o,t)});function Ut(){return Uu(ad)}var sd=g("ZodNever",(e,r)=>{Pc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>cl(e,i,o,t)});function ea(e){return Eu(sd,e)}var cd=g("ZodVoid",(e,r)=>{Oc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>sl(e,i,o,t)});function Ug(e){return Ru(cd,e)}var On=g("ZodDate",(e,r)=>{Ac.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>dl(e,i,o,t),e.min=(i,o)=>e.check(je(i,o)),e.max=(i,o)=>e.check(Ae(i,o))},y.derived({minDate:e=>{let{minimum:r}=oe(e);return r?new Date(r):null},maxDate:e=>{let{maximum:r}=oe(e);return r?new Date(r):null}},{}));function Eg(e){return Lu(On,e)}var ud=g("ZodArray",(e,r)=>{Rt(),jc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>wl(e,i,o,t),e.element=r.element},{min(e,r){return this.check(Qe(e,r))},nonempty(e){return this.check(Qe(1,e))},max(e,r){return this.check(Dt(e,r))},length(e,r){return this.check(Nt(e,r))},unwrap(){return this.element}});function An(e,r){return Vu(ud,e,r)}function Rg(e){let r=e._zod.def.shape;return ta(Object.keys(r))}var jn=g("ZodObject",(e,r)=>{Rt(),Tc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>xl(e,i,o,t),y.installLazyProp(e,"shape",i=>i._zod.def.shape,!1)},{keyof(){return ta(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(y.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(y.mergeDefs(this._zod.def,{catchall:Ut()}))},loose(){return this.clone(y.mergeDefs(this._zod.def,{catchall:Ut()}))},strict(){return this.clone(y.mergeDefs(this._zod.def,{catchall:ea()}))},strip(){return this.clone(y.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return y.extend(this,e)},safeExtend(e){return y.safeExtend(this,e)},merge(e){return y.merge(this,e)},pick(e){return y.pick(this,e)},omit(e){return y.omit(this,e)},partial(...e){return y.partial(Dn,this,e[0])},exactPartial(...e){return y.partial(na,this,e[0],"exactPartial")},required(...e){return y.required(ia,this,e[0])}});function Lg(e,r){let i={type:"object",shape:e??{},...y.normalizeParams(r)};return new jn(i)}function Zg(e,r){return new jn({type:"object",shape:e,catchall:ea(),...y.normalizeParams(r)})}function Mg(e,r){return new jn({type:"object",shape:e,catchall:Ut(),...y.normalizeParams(r)})}var Tn=g("ZodUnion",(e,r)=>{dn.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>zo(e,i,o,t),e.options=r.options});function Or(e,r){return new Tn({type:"union",options:e,...y.normalizeParams(r)})}var ld=g("ZodXor",(e,r)=>{Tn.init(e,r),Dc.init(e,r),e._zod.processJSONSchema=(i,o,t)=>zo(e,i,o,t),e.options=r.options});function Vg(e,r){return new ld({type:"union",options:e,inclusive:!1,...y.normalizeParams(r)})}var dd=g("ZodDiscriminatedUnion",(e,r)=>{Tn.init(e,r),Cc.init(e,r)});function Fg(e,r,i){return new dd({type:"union",options:r,discriminator:e,...y.normalizeParams(i)})}var pd=g("ZodIntersection",(e,r)=>{Uc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Sl(e,i,o,t)});function md(e,r){return new pd({type:"intersection",left:e,right:r})}var fd=g("ZodTuple",(e,r)=>{Rt(),Ui.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Il(e,i,o,t)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(r=>new Dn({type:"optional",innerType:r}))})}});function gd(e,r,i){let o=r instanceof U,t=o?i:r,n=o?r:null;return new fd({type:"tuple",items:e,rest:n,...y.normalizeParams(t)})}var wr=g("ZodRecord",(e,r)=>{Rt(),Ec.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>zl(e,i,o,t),e.keyType=r.keyType,e.valueType=r.valueType});function hd(e,r,i){return!r||!r._zod?new wr({type:"record",keyType:In(),valueType:e,...y.normalizeParams(r)}):new wr({type:"record",keyType:e,valueType:r,...y.normalizeParams(i)})}function Bg(e,r,i){return new wr({type:"record",keyType:e,valueType:r,...y.normalizeParams(i),partial:!0})}function Gg(e,r,i){return new wr({type:"record",keyType:e,valueType:r,mode:"loose",...y.normalizeParams(i)})}var vd=g("ZodMap",(e,r)=>{Rt(),Rc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>$l(e,i,o,t),e.keyType=r.keyType,e.valueType=r.valueType,e.min=(...i)=>e.check(Ge(...i)),e.nonempty=i=>e.check(Ge(1,i)),e.max=(...i)=>e.check(lt(...i)),e.size=(...i)=>e.check(Tt(...i))});function Kg(e,r,i){return new vd({type:"map",keyType:e,valueType:r,...y.normalizeParams(i)})}var bd=g("ZodSet",(e,r)=>{Rt(),Lc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>kl(e,i,o,t),e.min=(...i)=>e.check(Ge(...i)),e.nonempty=i=>e.check(Ge(1,i)),e.max=(...i)=>e.check(lt(...i)),e.size=(...i)=>e.check(Tt(...i))});function Jg(e,r){return new bd({type:"set",valueType:e,...y.normalizeParams(r)})}var xr=g("ZodEnum",(e,r)=>{Zc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(o,t,n)=>pl(e,o,t,n),e.enum=r.entries,e.options=[...e._zod.values];let i=new Set(Object.keys(r.entries));e.extract=(o,t)=>{let n={};for(let a of o)if(i.has(a))n[a]=r.entries[a];else throw new Error(`Key ${a} not found in enum`);return new xr({...r,checks:[],...y.normalizeParams(t),entries:n})},e.exclude=(o,t)=>{let n={...r.entries};for(let a of o)if(i.has(a))delete n[a];else throw new Error(`Key ${a} not found in enum`);return new xr({...r,checks:[],...y.normalizeParams(t),entries:n})}});function ta(e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new xr({type:"enum",entries:i,...y.normalizeParams(r)})}function Wg(e,r){return new xr({type:"enum",entries:e,...y.normalizeParams(r)})}var yd=g("ZodLiteral",(e,r)=>{Mc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ml(e,i,o,t),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function Hg(e,r){return new yd({type:"literal",values:Array.isArray(e)?e:[e],...y.normalizeParams(r)})}var _d=g("ZodFile",(e,r)=>{Vc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>hl(e,i,o,t),e.min=(i,o)=>e.check(Ge(i,o)),e.max=(i,o)=>e.check(lt(i,o)),e.mime=(i,o)=>e.check(fr(Array.isArray(i)?i:[i],o))});function qg(e){return Fu(_d,e)}var $d=g("ZodTransform",(e,r)=>{Rt(),Fc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>_l(e,i,o,t),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new ct(e.constructor.name);i.addIssue=n=>{if(typeof n=="string")i.issues.push(y.issue(n,i.value,r));else{let a=n;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=i.value),a.inst??(a.inst=e),i.issues.push(y.issue(a))}};let t=r.transform(i.value,i);return t instanceof Promise?t.then(n=>(i.value=n,i)):(i.value=t,i)}});function ra(e){return new $d({type:"transform",transform:e})}var Dn=g("ZodOptional",(e,r)=>{Ei.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Po(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Et(e){return new Dn({type:"optional",innerType:e})}var na=g("ZodExactOptional",(e,r)=>{Bc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Po(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function kd(e){return new na({type:"optional",innerType:e})}var wd=g("ZodNullable",(e,r)=>{Gc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Pl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function zn(e){return new wd({type:"nullable",innerType:e})}function Xg(e){return Et(zn(e))}var xd=g("ZodDefault",(e,r)=>{Kc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>jl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Sd(e,r){return new xd({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():y.shallowClone(r)}})}var Id=g("ZodPrefault",(e,r)=>{Jc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Tl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function zd(e,r){return new Id({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():y.shallowClone(r)}})}var ia=g("ZodNonOptional",(e,r)=>{Wc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Ol(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Pd(e,r){return new ia({type:"nonoptional",innerType:e,...y.normalizeParams(r)})}var Od=g("ZodSuccess",(e,r)=>{Hc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>vl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Yg(e){return new Od({type:"success",innerType:e})}var Ad=g("ZodCatch",(e,r)=>{qc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Dl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function jd(e,r){return new Ad({type:"catch",innerType:e,catchValue:typeof r=="function"?r:y.constantCatch(r)})}var Td=g("ZodNaN",(e,r)=>{Xc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>fl(e,i,o,t)});function Qg(e){return Mu(Td,e)}var Nn=g("ZodPipe",(e,r)=>{Ri.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Nl(e,i,o,t),e.in=r.in,e.out=r.out});function No(e,r){return new Nn({type:"pipe",in:e,out:r})}var Cn=g("ZodCodec",(e,r)=>{Nn.init(e,r),pn.init(e,r)});function eh(e,r,i){return new Cn({type:"pipe",in:e,out:r,transform:i.decode,reverseTransform:i.encode})}function th(e){let r=e._zod.def;return new Cn({type:"pipe",in:r.out,out:r.in,transform:r.reverseTransform,reverseTransform:r.transform})}var Dd=g("ZodPreprocess",(e,r)=>{Nn.init(e,r),Yc.init(e,r)}),Nd=g("ZodReadonly",(e,r)=>{Qc.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Cl(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Cd(e){return new Nd({type:"readonly",innerType:e})}var Ud=g("ZodTemplateLiteral",(e,r)=>{eu.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>gl(e,i,o,t)});function rh(e,r){return new Ud({type:"template_literal",parts:e,...y.normalizeParams(r)})}var Ed=g("ZodLazy",(e,r)=>{mn.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>El(e,i,o,t),e.unwrap=()=>e._zod.def.getter()});function Rd(e){return new Ed({type:"lazy",getter:e})}var Ld=g("ZodPromise",(e,r)=>{ru.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Ul(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function nh(e){return new Ld({type:"promise",innerType:e})}var Zd=g("ZodFunction",(e,r)=>{tu.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>yl(e,i,o,t)});function ih(e){return new Zd({type:"function",input:Array.isArray(e?.input)?gd(e?.input):e?.input??An(Ut()),output:e?.output??Ut()})}var Un=g("ZodCustom",(e,r)=>{nu.init(e,r),R.init(e,r),e._zod.processJSONSchema=(i,o,t)=>bl(e,i,o,t)});function oh(e){let r=new X({check:"custom"});return r._zod.check=e,r}function ah(e,r){return Bu(Un,e??(()=>!0),r)}function Md(e,r={}){return Gu(Un,e,r)}function Vd(e,r){return Ku(e,r)}var sh=Ju,ch=Wu,Fd=g("ZodInstanceOf",(e,r)=>{Un.init(e,r)},{properties(e,r){return this.check(mr(e,r))}});function uh(e,r={}){let i=new Fd({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...y.normalizeParams(r)});return i._zod.bag.Class=e,i._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:i,path:[...i._zod.def.path??[]]})},i}var lh=(...e)=>Hu({Codec:Cn,Boolean:zr,String:Sr},...e);function dh(e){let r=Rd(()=>Or([In(e),Ql(),ed(),id(),An(r),hd(In(),r)]));return r}function ph(e,r){return new Dd({type:"pipe",in:ra(e),out:r})}var Yk={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 Qk(e){re({customError:e})}function ew(){return re().customError}var Bd;Bd||(Bd={});var En={};He(En,{ZodISODate:()=>gt,ZodISODateTime:()=>ft,ZodISODuration:()=>vt,ZodISOTime:()=>ht,date:()=>rw,datetime:()=>tw,duration:()=>iw,time:()=>nw});function tw(e){return _n(ft,e)}function rw(e){return $n(gt,e)}function nw(e){return kn(ht,e)}function iw(e){return wn(vt,e)}var z={...Ar,...jo,iso:En},ow=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"]);function aw(e,r){let i=e.$schema;return i==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":i==="http://json-schema.org/draft-07/schema#"?"draft-7":i==="http://json-schema.org/draft-04/schema#"?"draft-4":r??"draft-2020-12"}function mh(e,r){return e.map((i,o)=>o<r?i:i.optional())}function sw(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function cw(e,r){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let i=e.slice(1).split("/").filter(Boolean);if(i.length===0)return r.rootSchema;let o=r.version==="draft-2020-12"?"$defs":"definitions";if(i[0]===o){let t=i[1]===void 0?void 0:sw(i[1]);if(!t||!r.defs[t])throw new Error(`Reference not found: ${e}`);return r.defs[t]}throw new Error(`Reference not found: ${e}`)}function uw(e,r){return z.transform(o=>o).check(o=>{let t=o.value;if(typeof t!="object"||t===null||Array.isArray(t))return;let n=Object.getOwnPropertyNames(t);if(r.minProperties!==void 0&&n.length<r.minProperties&&o.issues.push({origin:"object",code:"too_small",minimum:r.minProperties,inclusive:!0,message:`Too small: expected object to have >=${r.minProperties} properties`,input:t,inst:e,continue:!0}),r.maxProperties!==void 0&&n.length>r.maxProperties&&o.issues.push({origin:"object",code:"too_big",maximum:r.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${r.maxProperties} properties`,input:t,inst:e,continue:!0}),r.keySchema)for(let a of n){let c=r.keySchema.safeParse(a);c.success||o.issues.push({code:"invalid_key",origin:"record",issues:c.error.issues,input:a,path:[a],continue:!0})}}).pipe(e)}function Gd(e,r){if(e===null)return"z";let i=typeof e;if(i!=="object"){if(i==="number"&&Number.isNaN(e))return null;let o=String(e);return`${i[0]}${o.length}:${o}`}if(r.has(e))return null;r.add(e);try{if(Array.isArray(e)){let n=[];for(let a of e){let c=Gd(a,r);if(c===null)return null;n.push(c)}return`a${n.length}:[${n.join(",")}]`}let o=Object.keys(e).sort(),t=[];for(let n of o){let a=Gd(e[n],r);if(a===null)return null;t.push(`${n.length}:${n}=${a}`)}return`o${t.length}:{${t.join(",")}}`}finally{r.delete(e)}}var lw=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),dw=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Rn(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Rn):typeof e.$ref=="string"?!0:Object.entries(e).some(([r,i])=>lw.has(r)?Rn(i):!dw.has(r)||typeof i!="object"||i===null?!1:Object.values(i).some(Rn))}function fh(e){return e===1?"element":"elements"}function pw(e,r){return z.transform(o=>o).check(o=>{let t=o.value;if(Array.isArray(t)){if(r.uniqueItems===!0){let n=new Map;for(let a=0;a<t.length;a++){let c=Gd(t[a],new Set);if(c===null)continue;let u=n.get(c);if(u===void 0){n.set(c,a);continue}o.issues.push({code:"custom",message:`Array items must be unique: element at index ${a} duplicates the one at index ${u}`,input:t,path:[a],continue:!0})}}if(r.containsSchema){let n=r.minContains??1,a=r.maxContains!==void 0?r.maxContains+1:Number.POSITIVE_INFINITY,c=0;for(let u of t)if(r.containsSchema.safeParse(u).success&&++c>=a)break;c<n&&o.issues.push({code:"custom",message:`Array must contain at least ${n} matching ${fh(n)}; found ${c}`,input:t,continue:!0}),r.maxContains!==void 0&&c>r.maxContains&&o.issues.push({code:"custom",message:`Array must contain at most ${r.maxContains} matching ${fh(r.maxContains)}`,input:t,continue:!0})}}}).pipe(e)}function gh(e,r){if(e!==!1)return e===void 0||e===!0?z.any():_e(e,r)}var mw=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function hh(e,r){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return z.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let t=e.$ref;if(r.refs.has(t))return r.refs.get(t);if(r.processing.has(t))return z.lazy(()=>{if(!r.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return r.refs.get(t)});r.processing.add(t);let n=cw(t,r),a=_e(n,r);return r.refs.set(t,a),r.processing.delete(t),a}if(e.enum!==void 0){let t=e.enum;if(r.version==="openapi-3.0"&&e.nullable===!0&&t.length===1&&t[0]===null)return z.null();if(t.length===0)return z.never();if(t.length===1)return z.literal(t[0]);if(t.every(a=>typeof a=="string"))return z.enum(t);let n=t.map(a=>z.literal(a));return n.length<2?n[0]:z.union([n[0],n[1],...n.slice(2)])}if(e.const!==void 0)return z.literal(e.const);let i=e.type;if(Array.isArray(i)){let t=i.map(n=>{let a={...e,type:n};return hh(a,r)});return t.length===0?z.never():t.length===1?t[0]:z.union(t)}if(!i)return z.any();let o;switch(i){case"string":{let t=z.string();if(e.format){let n=e.format;n==="email"?t=t.check(z.email()):n==="uri"||n==="uri-reference"?t=t.check(z.url()):n==="uuid"||n==="guid"?t=t.check(z.uuid()):n==="date-time"?t=t.check(z.iso.datetime({offset:!0})):n==="date"?t=t.check(z.iso.date()):n==="time"?t=t.check(z.regex(mw)):n==="duration"?t=t.check(z.iso.duration()):n==="hostname"?t=t.check(z.hostname()):n==="ipv4"?t=t.check(z.ipv4()):n==="ipv6"?t=t.check(z.ipv6()):n==="mac"?t=t.check(z.mac()):n==="cidr"?t=t.check(z.cidrv4()):n==="cidr-v6"?t=t.check(z.cidrv6()):n==="base64"?t=t.check(z.base64()):n==="base64url"?t=t.check(z.base64url()):n==="e164"?t=t.check(z.e164()):n==="credit_card"?t=t.check(z.creditCard()):n==="iban"?t=t.check(z.iban()):n==="jwt"?t=t.check(z.jwt()):n==="emoji"?t=t.check(z.emoji()):n==="nanoid"?t=t.check(z.nanoid()):n==="cuid"?t=t.check(z.cuid()):n==="cuid2"?t=t.check(z.cuid2()):n==="ulid"?t=t.check(z.ulid()):n==="xid"?t=t.check(z.xid()):n==="ksuid"&&(t=t.check(z.ksuid()))}typeof e.minLength=="number"&&(t=t.min(e.minLength)),typeof e.maxLength=="number"&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),o=t;break}case"number":case"integer":{let t=i==="integer"?z.number().int():z.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(t=t.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum=="number"?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(t=t.lt(e.maximum)),typeof e.multipleOf=="number"&&(t=t.multipleOf(e.multipleOf)),o=t;break}case"boolean":{o=z.boolean();break}case"null":{o=z.null();break}case"object":{let t={},n=e.properties||{},a=new Set(e.required||[]),c=typeof e.additionalProperties=="object"?_e(e.additionalProperties,r):void 0;for(let[p,m]of Object.entries(n)){let f=_e(m,r);ue(t,p,a.has(p)?f:f.optional())}if(e.patternProperties){let p=e.patternProperties,m=Object.keys(p),f=[];for(let k of m){let x=_e(p[k],r),A=z.string().regex(new RegExp(k));f.push(z.looseRecord(A,x))}let v=[];if(Object.keys(t).length>0&&v.push(z.object(t).passthrough()),v.push(...f),v.length===0)o=z.object({}).passthrough();else if(v.length===1)o=v[0];else{let k=z.intersection(v[0],v[1]);for(let x=2;x<v.length;x++)k=z.intersection(k,v[x]);o=k}if(e.additionalProperties===!1){let k=Object.keys(t),x=m.map(P=>new RegExp(P)),A=o;o=o.check(P=>{if(!De(P.value))return;let D=[];for(let Z of Object.keys(P.value))k.includes(Z)||x.some(H=>H.test(Z))||D.push(Z);D.length&&P.issues.push({code:"unrecognized_keys",keys:D,input:P.value,inst:A})})}}else{let p=z.object(t);e.additionalProperties===!1?o=p.strict():c?o=p.catchall(c):o=p.passthrough()}let u=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,d=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(u||l!==void 0||d!==void 0){let p;if(u){let m=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;p=_e(m,r)}o=uw(o,{keySchema:p,minProperties:l,maxProperties:d})}break}case"array":{let t=e.prefixItems,n=e.items;if(t&&Array.isArray(t)){let a=typeof e.minItems=="number"?e.minItems:0,c=t.map(p=>_e(p,r)),u=mh(c,a),l=Array.isArray(n)?void 0:gh(n,r),d=z.tuple(u);o=l?d.rest(l):d,typeof e.minItems=="number"&&(o=o.check(z.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(z.maxLength(e.maxItems)))}else if(Array.isArray(n)){let a=typeof e.minItems=="number"?e.minItems:0,c=n.map(p=>_e(p,r)),u=mh(c,a),l=gh(e.additionalItems,r),d=z.tuple(u);o=l?d.rest(l):d,typeof e.minItems=="number"&&(o=o.check(z.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(z.maxLength(e.maxItems)))}else if(n!==void 0){let a=_e(n,r),c=z.array(a);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),o=c}else o=z.array(z.any());(e.uniqueItems===!0||e.contains!==void 0)&&(o=pw(o,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?_e(e.contains,r):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${i}`)}return o}function _e(e,r){if(typeof e=="boolean")return e?z.any():z.never();let i=hh(e,r),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(l=>_e(l,r)),u=z.union(c);i=o?z.intersection(i,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(l=>_e(l,r)),u=z.xor(c);i=o?z.intersection(i,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)i=o?i:z.any();else{let c=o?i:_e(e.allOf[0],r),u=o?0:1;for(let l=u;l<e.allOf.length;l++)c=z.intersection(c,_e(e.allOf[l],r));i=c}e.nullable===!0&&r.version==="openapi-3.0"&&(i=z.nullable(i)),e.readOnly===!0&&(i=z.readonly(i)),e.default!==void 0&&(i=i.default(e.default));let t={},n=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of n)c in e&&(t[c]=e[c]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let c of a)c in e&&(t[c]=e[c]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Rn(e.propertyNames)&&(t.propertyNames=e.propertyNames);for(let c of["minProperties","maxProperties"])e[c]!==void 0&&(t[c]=e[c])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Rn(e.contains)&&(t.contains=e.contains);for(let c of["uniqueItems","minContains","maxContains"])e[c]!==void 0&&(t[c]=e[c])}for(let c of Object.keys(e))ow.has(c)||ue(t,c,e[c]);return Object.keys(t).length>0&&r.registry.add(i,t),e.description&&(i=i.describe(e.description)),i}function vh(e,r){if(typeof e=="boolean")return e?z.any():z.never();let i;try{i=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=aw(i,r?.defaultTarget),t=i.$defs||i.definitions||{},n={version:o,defs:t,refs:new Map,processing:new Set,rootSchema:i,registry:r?.registry??le};return _e(i,n)}var bh=Symbol("z.visit/resolving");function Ln(e,r){let i=typeof r=="function"?r:(a,c)=>{let u=r[a._zod.def.type];return u?u(a,c):a},o=new Map;function t(a){let c=o.get(a);if(c===bh)return new mn({type:"lazy",getter:()=>o.get(a)});if(c!==void 0)return c;o.set(a,bh);let u=n(a),l=i(u,u!==a);return o.set(a,l),l}function n(a){let c=a._zod.def,u=c.type;switch(u){case"object":{let l=c.shape,d=Object.keys(l),p=!1,m={};for(let v of d){let k=t(l[v]);k!==l[v]&&(p=!0),m[v]=k}let f=c.catchall;return c.catchall&&(f=t(c.catchall),f!==c.catchall&&(p=!0)),p?K(a,{...c,shape:m,catchall:f}):a}case"array":{let l=t(c.element);return l===c.element?a:K(a,{...c,element:l})}case"tuple":{let l=c.items,d=!1,p=[];for(let f of l){let v=t(f);v!==f&&(d=!0),p.push(v)}let m=c.rest;return c.rest&&(m=t(c.rest),m!==c.rest&&(d=!0)),d?K(a,{...c,items:p,rest:m}):a}case"record":case"map":{let l=t(c.keyType),d=t(c.valueType);return l===c.keyType&&d===c.valueType?a:K(a,{...c,keyType:l,valueType:d})}case"set":{let l=t(c.valueType);return l===c.valueType?a:K(a,{...c,valueType:l})}case"union":{let l=c.options,d=!1,p=[];for(let m of l){let f=t(m);f!==m&&(d=!0),p.push(f)}return d?K(a,{...c,options:p}):a}case"intersection":{let l=t(c.left),d=t(c.right);return l===c.left&&d===c.right?a:K(a,{...c,left:l,right:d})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=t(c.innerType);return l===c.innerType?a:K(a,{...c,innerType:l})}case"pipe":{let l=t(c.in),d=t(c.out);return l===c.in&&d===c.out?a:K(a,{...c,in:l,out:d})}case"function":{let l=t(c.input),d=t(c.output);return l===c.input&&d===c.output?a:K(a,{...c,input:l,output:d})}case"lazy":{let l=c.getter,{_cachedInner:d,...p}=c;return K(a,{...p,getter:()=>t(l())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return a;default:return a}}return t(e)}function yh(e){return Ln(e,{object:r=>r.partial(),union:r=>{let i=r._zod.def;return i.discriminator===void 0?r:Or(i.options)}})}function fw(e,r){if(!r?.length)return e;let i=e._zod.def;return K(e,Ee(i,{checks:[...i.checks??[],...r]}),{parent:!0})}function _h(e){return fw(e.out,e.checks)}function gw(e){return e.in._zod.traits.has("$ZodTransform")?_h(e):e.in}function $h(e){return Ln(e,{pipe:r=>gw(r._zod.def),default:(r,i)=>i?Et(r._zod.def.innerType):r,catch:(r,i)=>i?r._zod.def.innerType:r})}function kh(e){return Ln(e,{pipe:r=>_h(r._zod.def),prefault:(r,i)=>i?r._zod.def.innerType:r})}var Kd={};He(Kd,{bigint:()=>yw,boolean:()=>bw,date:()=>_w,number:()=>vw,string:()=>hw});function hw(e){return fu(Sr,e)}function vw(e){return _u(Ir,e)}function bw(e){return zu(zr,e)}function yw(e){return Ou(Pr,e)}function _w(e){return Zu(On,e)}var Mt=class extends Error{code;detail;constructor(r,i,o={}){super(i),this.code=r,this.detail=o}};var $w=["bad_request","not_found","plan_required","method_not_allowed","gone","rate_limited","internal"],FO=s.object({error:s.object({code:s.enum($w),message:s.string(),param:s.string().optional().describe("The input the error is about"),allowed:s.array(s.string()).optional().describe("Values the input takes"),nearest:s.array(s.string()).optional().describe("Known values closest to the one given"),need:s.enum(["free","plus"]).optional().describe("plan_required: the plan that opens it"),upgrade_url:s.string().optional().describe("need plus: a link for the caller's person to buy Pro")})});var oa=(e,r="and")=>e.length<2?e.join(""):`${e.slice(0,-1).join(", ")} ${r} ${e[e.length-1]}`;var Jd={name:"$.name",description:"$.summary",icon:"$.media.icons[0].url",category:"$.taxonomy",publisher:"$.publisher.name",url:"$.publisher.url",release:"$.release.version",reviewed_commit:"$.source.repository.reviewed_commit"},wh={name:"$.displayName",description:"$.description",icon:"$.logoUrl",category:"$.curatedCategoryKeys",publisher:"$.publisher.displayName",url:"$.repositoryUrl",release:"$.gitRef"},xh={name:"$.name",description:"$.description",icon:"$.logo",publisher:"$.author",url:"$.authorUrl"},sa={"chatgpt:app":{label:["App","apps"],form:"integration",tag:"kind-chatgpt-app",paths:{name:"$.display_name",description:"$.short_description",icon:"$.icon_url",keywords:"$.keywords"}},"claude:connector":{label:["Connector","connectors"],form:"integration",tag:"kind-claude-connector",paths:Jd},"claude:plugin":{label:["Plugin","plugins"],form:"parts",tag:"kind-claude-plugin",paths:Jd},"claude:desktop_extension":{label:["Desktop extension","desktop extensions"],form:"integration",tag:"kind-claude-extension",paths:Jd},"cursor:plugin":{label:["Plugin","plugins"],form:"parts",tag:"kind-cursor-plugin",paths:wh},"cursor:directory_plugin":{label:["Rule","rules"],form:"parts",tag:"kind-rule",hidden:!0,paths:xh},"cursor:directory_mcp":{label:["MCP server","MCP servers"],form:"integration",tag:"kind-mcp-server",paths:xh},"grokbot:plugin":{label:["Plugin","plugins"],form:"parts",tag:"kind-grokbot-plugin",paths:wh},"grokbot:bot":{label:["Bot","bots"],form:"agent",tag:"kind-grokbot-bot",hidden:!0,late:!0,charts:"grokbot:bots:",paths:{name:"$.name",description:"$.description",icon:"$.imageUrl",category:"$.categories",publisher:"$.creatorName",release:"$.updatedAt"}},"perplexity:connector":{label:["Connector","connectors"],form:"integration",paths:{name:"$.display_name",description:"$.description",icon:"$.icon_url",category:"$.display_categories",publisher:"$.source_details.developer",url:"$.source_details.website_url"}},"muse:connector":{label:["Connector","connectors"],form:"integration",paths:{name:"$.name",description:"$.description",icon:"$.icon",category:"$.categories",url:"$.links.terms"}},"muse:unlisted":{label:["Unlisted connector","unlisted connectors"],form:"integration",paths:{name:"$.name",description:"$.description",icon:"$.icon"}}},Zn=Object.entries(sa),ca=e=>e.slice(e.indexOf(":")+1),Q=[...new Set(Zn.map(([e])=>ca(e)))],Sh=(e,r)=>sa[`${e}:${r??""}`],aa={directory_rule:"directory_plugin","cursor:directory_rule":"cursor:directory_plugin"},Ih=e=>typeof e=="string"&&Object.hasOwn(aa,e)?aa[e]:e,zh=e=>Zn.filter(([r])=>r.startsWith(`${e}:`)).map(([r])=>ca(r)),Ph=e=>Zn.filter(([,r])=>r[e]).map(([r])=>ca(r)),kw=new Set(Ph("hidden").flatMap(e=>[e,...Object.keys(aa).filter(r=>aa[r]===e)])),qO=Ph("late"),XO=Zn.flatMap(([,e])=>e.hidden&&e.charts?[e.charts]:[]);var YO=new Map(Zn.map(([e,r])=>[ca(e),r.label]));var j=["chatgpt","claude","cursor","grokbot","perplexity","muse"],Oh={chatgpt:"ChatGPT",claude:"Claude",cursor:"Cursor",grokbot:"Grok Bot",perplexity:"Perplexity",muse:"Muse"},Mn=e=>typeof e=="string"&&j.includes(e),ww=["chatgpt","claude","cursor","grokbot","perplexity","muse"];var rA=oa(ww.map(e=>Oh[e]));var nA=new Intl.DisplayNames(["en"],{type:"region"});var Ah=["anon","account","agent","render"],xw={crawl:{pool:"anon",schedule:"sweep-per-region",run:{store:"chatgpt",region:"job"},settles:["chatgpt"],concurrency:"parallel",lease:20,exit:{via:"region"}},details:{pool:"anon",schedule:"with-primary-crawl",run:null,settles:["chatgpt"],concurrency:"parallel",lease:20,exit:{via:"region"}},claude:{pool:"anon",schedule:"sweep",run:{store:"claude",region:"global"},settles:["claude"],concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},cursor:{pool:"anon",schedule:"sweep",run:{store:"cursor",region:"global"},settles:["cursor"],concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},cursor_directory:{pool:"anon",schedule:"sweep",run:{store:"cursor",region:"directory"},settles:["cursor"],concurrency:"one-per-pool",lease:20,exit:{via:"clearance",relays:["us","de"]}},grokbot:{pool:"anon",schedule:"sweep",run:{store:"grokbot",region:"global"},settles:["grokbot"],concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},perplexity:{pool:"anon",schedule:"sweep",run:{store:"perplexity",region:"global"},settles:["perplexity"],concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},muse:{pool:"anon",schedule:"sweep",run:{store:"muse",region:"global"},settles:["muse"],concurrency:"one-per-pool",lease:20,exit:{via:"region"}},github:{pool:"anon",schedule:"sweep",run:null,settles:["claude"],concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},mcp:{pool:"anon",schedule:"sweep",run:null,settles:j,concurrency:"one-per-pool",lease:20,exit:{via:"direct"}},chatgpt_connectors:{pool:"account",schedule:"sweep-with-account",run:null,settles:["chatgpt"],concurrency:"one-per-pool",lease:60,exit:{via:"direct"}},search_chatgpt:{pool:"anon",schedule:"sweep",run:null,settles:[],concurrency:"parallel",lease:20,exit:{via:"region"}},search_claude:{pool:"anon",schedule:"sweep",run:null,settles:[],concurrency:"parallel",lease:20,exit:{via:"direct"}},widget_shots:{pool:"render",schedule:"hourly",run:null,settles:[],concurrency:"one-per-pool",lease:60,exit:{via:"direct"}}},Wd=Object.keys(xw),jh=e=>Wd.includes(e);var Th=24;var iA=(Th+3)*36e5;var jr=["open","auth","blocked","dead","error"];var Dh=["active","challenged","disabled"];var Nh=["out","free","plus"];var Sw={compare:"Compare","rank-history":"Rank history","listing-changelog":"Change history","live-clock":"Launch lag"},cA=oa(Object.values(Sw));var Vt={out:{rows:200,countries:"us",movers:{perChart:20,perStore:20},publishers:50,explorerRows:3,tagRows:100,changesTopRank:100,compareApps:0,rankHistoryApps:0,history:{ranks:7,featured:7,movers:7,launches:30,changes:7,pulse:7},api:{perMinute:60,rowsPerDay:3e5}},free:{rows:1e3,countries:"all",movers:{perChart:100,perStore:1/0},publishers:500,explorerRows:100,tagRows:1e3,changesTopRank:1/0,compareApps:0,rankHistoryApps:0,history:{ranks:30,featured:30,movers:30,launches:30,changes:30,pulse:30},api:{perMinute:600,rowsPerDay:6e5}},plus:{rows:1/0,countries:"all",movers:{perChart:1/0,perStore:1/0},publishers:1/0,explorerRows:1/0,tagRows:1/0,changesTopRank:1/0,compareApps:5,rankHistoryApps:10,history:{ranks:1/0,featured:1/0,movers:1/0,launches:1/0,changes:1/0,pulse:1/0},api:{perMinute:600,rowsPerDay:12e5}}};var tt=s.enum(j),V=s.string().nullish(),$e=s.string(),Nr=e=>s.preprocess(Ih,e),Ch=s.object({p:s.string(),k:Nr(s.enum(Q)).nullish(),c:V,f:V,l:V,n:V,d:V,i:V,pub:V,v:V,r:V}),Iw=["home","category","top","new"],zw=s.object({slug:s.string(),kind:s.enum(Iw),title:s.string(),description:V,items:s.array(Ch)}),Pw=s.object({store:tt,region:s.string(),relay:V,egress_country:V,started_at:$e,finished_at:$e,requests:s.number().int(),catalog_complete:s.boolean().optional()}),Uh=s.object({p:s.string(),h:s.string(),d:s.string()}),Ow=s.object({p:s.string(),h:s.string()}),Aw=s.object({store:tt,at:$e,details:s.array(Uh),missing:s.array(s.string()).default([])}),jw=s.object({p:s.string(),n:s.string(),v:s.number(),t:s.string().optional()}),Tw=s.object({store:tt,at:$e,metrics:s.array(jw)}),Dw=s.object({s:tt,p:s.string(),url:s.string()}),Nw=s.object({hash:s.string(),server_name:V,server_version:V,protocol_version:V,tools:s.array(s.unknown()),prompts:s.array(s.unknown()).nullish(),resources:s.array(s.unknown()).nullish()}),Cw=["streamable-http","sse"],Uw=s.object({url:s.string(),transport:s.enum(Cw).nullish(),status:s.enum(jr),auth_hint:V,error:V,snapshot:Nw.optional()}),Ew=s.object({at:$e,links:s.array(Dw).default([]),probes:s.array(Uw).default([])});var Rw=s.object({url:s.string(),uri:s.string(),hash:s.string(),mime:V,meta:s.record(s.string(),s.unknown()).nullish(),html:V,bytes:s.number().int().nonnegative()}),Lw=s.object({at:$e,templates:s.array(Rw)});var Zw={light:{theme:"light",width:720},dark:{theme:"dark",width:720},mobile:{theme:"light",width:390}},Mw=["content","blank","loading","empty","failed"],Vw=s.object({server:s.number().int(),tool:s.string(),template:s.string(),profile:s.string(),uri:s.string(),mime:V,input:s.record(s.string(),s.unknown()),output:s.record(s.string(),s.unknown())}),Fw=s.object({server:s.number().int(),tool:s.string(),template:s.string(),profile:s.string(),variant:s.enum(Object.keys(Zw)),outcome:s.enum(Mw),width:s.number().int().nonnegative(),height:s.number().int().nonnegative(),png:V,detail:V}),Bw=s.object({at:$e,renderer:s.string(),shots:s.array(Fw)}),Gw=50,Kw=s.object({q:s.string().min(1).max(100),ids:s.array(s.string()).max(Gw)}),Jw=s.object({store:tt,region:s.string(),at:$e,results:s.array(Kw)}),Ww=s.object({p:s.string(),release:s.string().nullable(),found:s.object({h:s.string(),d:s.string(),version:s.string().nullable()}).nullable()}),Hw=s.object({p:s.string(),n:s.string(),release:s.string().nullable(),found:s.object({h:s.string(),d:s.string()}).nullable()}),qw=s.object({at:$e,connectors:s.array(Ww).default([]),skills:s.array(Hw).default([])}),Xw=s.object({state:s.literal("challenged"),until:$e,error:s.string()}),Yw=s.object({store:tt,kind:Nr(s.enum(Q)).nullish(),categories:s.array(s.string()).default([]),text:s.string().default("")}),mA=s.object({id:s.number().int(),name:s.string(),listings:s.array(Yw)}),fA=s.object({version:s.string(),domains:s.array(s.object({id:s.string(),uses:s.array(s.string())})),audiences:s.array(s.string()),synonyms:s.record(s.string(),s.string()).default({})}),qd=s.object({id:s.number().int(),store:tt,kind:Nr(s.enum(Q)).nullish(),name:V,publisher:V,publisher_key:V,website:V,repo:V,source:V,servers:s.array(s.string()).default([]),description:s.string().default("")}),gA=s.object({id:s.number().int(),app:s.string().nullable(),listings:s.array(qd),scouted:s.literal(!0).optional()}),Qw=["wrapper","third_party","sub_product","same_maker","unrelated"],hA=s.object({verdict:s.enum(["same","not_same","unsure"]),outliers:s.array(s.object({id:s.number().int(),relation:s.enum(Qw),reason:s.string()})),confidence:s.number().min(0).max(1),reason:s.string()}),ex=qd.extend({app:s.string().nullable(),via:s.array(s.string())}),vA=s.object({listing:qd,suggestions:s.array(ex)}),tx=["same","sub_product","same_maker","wrapper","third_party"],Eh=["agency_studio","startup","indie","smb","midmarket","enterprise","platform","unknown"],Rh=["solo","2-10","11-50","51-200","201+","unknown"],Lh=["bootstrapped","vc_funded","public_or_large","unknown"],Zh=["high","medium","low"],bA=s.object({website:s.string(),email:s.string(),linkedin:s.string(),x:s.string(),contact_name:s.string(),confidence:s.enum(Zh),sources:s.array(s.string()).max(5),notes:s.string(),segment:s.enum(Eh),segment_why:s.string(),size:s.enum(Rh),funding:s.enum(Lh)}),yA=s.object({company:s.string(),website:s.string(),summary:s.string(),role:s.string(),linkedin:s.string(),company_linkedin:s.string(),confidence:s.enum(Zh),sources:s.array(s.string()).max(5),notes:s.string(),segment:s.enum(Eh),size:s.enum(Rh),funding:s.enum(Lh)}),_A=s.object({related:s.array(s.object({id:s.number().int(),relation:s.enum(tx),reason:s.string()})),confidence:s.number().min(0).max(1),reason:s.string()}),rx=s.object({server:s.number().int(),app:s.string(),tool:s.string(),title:V,description:V,params:s.unknown(),returns:s.unknown(),widget:V,template:s.string(),excerpt:V,views:s.record(s.string(),s.array(s.string())).default({}),about:V,publisher:V,prompts:s.array(s.string()).default([]),domain:V}),$A=rx.extend({profile:s.string()}),kA=s.object({input:s.record(s.string(),s.unknown()),output:s.record(s.string(),s.unknown())}),wA=s.object({domain:s.string(),secondary_domain:s.string().nullable(),uses:s.array(s.string()),audiences:s.array(s.string()),suggested:s.string().nullable(),confidence:s.number().min(0).max(1)}),xA=s.object({kind:s.enum(Wd).exclude(["crawl"])}),nx=["ok","blocked","challenged","error"],ix=s.object({t:$e,relay:s.string().nullable(),provider:s.string().nullable(),outcome:s.enum(nx),status:s.number().int().nullable(),error:s.string().nullable()}),ze=s.object({lease_token:s.string(),lease_expires_at:s.string(),id:s.number().int(),region:s.string().nullable(),priority:s.number().int(),attempts:s.number().int(),error:s.string().nullable(),created_at:$e,not_before:$e,claimed_at:s.string().nullable()}),Ft={versions:s.record(s.string(),s.string()).default({})},Hd={undetailed:s.array(s.string()).default([])},ox=s.discriminatedUnion("kind",[ze.extend({kind:s.literal("crawl"),region:s.string(),...Ft,...Hd}),ze.extend({kind:s.literal("details"),plugin_ids:s.array(s.string())}),ze.extend({kind:s.literal("claude"),...Ft,...Hd}),ze.extend({kind:s.literal("cursor"),known_refs:s.record(s.string(),s.string()),...Ft}),ze.extend({kind:s.literal("grokbot"),known_refs:s.record(s.string(),s.string()),...Ft,...Hd}),ze.extend({kind:s.literal("cursor_directory"),detail_ids:s.array(s.string()),...Ft}),ze.extend({kind:s.literal("perplexity"),detail_ids:s.array(s.string()),...Ft}),ze.extend({kind:s.literal("muse"),...Ft}),ze.extend({kind:s.literal("github"),backfill_installs:s.boolean()}),ze.extend({kind:s.literal("mcp"),servers:s.array(s.object({id:s.number().int(),url:s.string(),known:s.array(s.string()).default([]),uris:s.array(s.string()).default([])}))}),ze.extend({kind:s.literal("chatgpt_connectors"),account:s.object({id:s.number().int(),label:s.string()}),connectors:s.array(s.object({p:s.string(),c:s.string(),release:s.string().nullable()})),skills:s.array(s.object({p:s.string(),n:s.string(),release:s.string().nullable()}))}),ze.extend({kind:s.literal("search_chatgpt"),queries:s.array(s.string())}),ze.extend({kind:s.literal("search_claude"),queries:s.array(s.string())}),ze.extend({kind:s.literal("widget_shots"),renderer:s.string(),templates:s.record(s.string(),s.string()),subjects:s.array(Vw)})]),SA=s.object({protocol:s.literal("attempt-v1"),pool:s.enum(Ah).default("anon"),kinds:s.array(s.string()).transform(e=>e.filter(jh)).optional()}),IA=s.object({protocol:s.literal("attempt-v1").optional(),job:ox.nullable(),retry_at:s.string().nullable()});var Mh=800,Tr=s.string().min(1).max(200),Dr=s.number().int().nonnegative(),ax=s.object({job:s.number().int(),lease_token:Tr,request_id:Tr}),de={attempt:ax},zA=s.object({...de,store:tt,at:$e,listings:s.array(Uh),seen:s.array(Ow).default([])}),PA=Aw.extend(de),OA=Tw.extend(de),AA=Ew.extend(de),jA=Lw.extend(de),TA=Bw.extend(de),DA=Jw.extend(de),NA=qw.extend(de),CA=s.object({...de,account:s.number().int(),report:Xw}),UA=s.object({...de,tries:s.array(ix)}),EA=s.object(de),RA=s.object({...de,error:s.string()}),LA=s.object(de),sx=zw.omit({items:!0}).extend({item_parts:Dr,item_count:Dr}),ZA=s.object({...de,publication_id:Tr,run:Pw,app_parts:Dr,apps_count:Dr,charts:s.array(sx).max(500)}).superRefine((e,r)=>{e.app_parts===0!=(e.apps_count===0)&&r.addIssue({code:"custom",message:"app parts and count disagree"}),new Set(e.charts.map(i=>i.slug)).size!==e.charts.length&&r.addIssue({code:"custom",message:"duplicate chart slug"});for(let i of e.charts)i.item_parts===0!=(i.item_count===0)&&r.addIssue({code:"custom",message:"chart parts and count disagree"})}),MA=s.object({...de,publication_id:Tr,part:Dr,apps:s.array(Ch).min(1).max(Mh)}),VA=s.object({...de,publication_id:Tr,slug:s.string(),part:Dr,plugin_ids:s.array(s.string()).min(1).max(Mh)}),FA=s.object({...de,publication_id:Tr}),BA=s.discriminatedUnion("action",[s.object({action:s.literal("add"),label:s.string().min(1).max(100)}),s.object({action:s.literal("disable"),label:s.string().min(1)}),s.object({action:s.literal("list")})]),GA=s.object({label:s.string(),store:tt,status:s.enum(Dh),paused_until:s.string().nullable(),last_used_at:s.string().nullable(),last_error:s.string().nullable(),created_at:$e});var Vh=["bug","wrong_data","missing_capability","confusing","other"],Fh=["user","model"],Bh=["app","listing","binding","publisher","tag","chart","server"];var Cr={summary:200,details:4e3,tool:64,subject_id:200,request_id:64};var cx=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;var ux=["chatgpt","claude","cursor","grokbot"];var lx=["apps","connectors","plugins","extensions","mcp","rules"],dx=e=>lx.includes(e),px=e=>e.length<=100&&cx.test(e);function Gh(e){let[,r,i,o,...t]=e.split("/");if(t.length||!o||!px(o))return null;let n=ux.find(a=>a===r);return n&&i&&dx(i)?{store:n,slug:o}:null}var mx={chatgpt:"category:featured",claude:"claude:popularity",cursor:"cursor:directory:top",grokbot:"grokbot:popular",perplexity:"perplexity:popular",muse:"muse:all"},YA={...mx,muse:"muse:featured"};var fx=/^#?\/app\/(?:([a-z]+)\/)?([^/?]+)/,gx=/(^|\.)cursor\.directory$/,Jh=(e,r)=>`${e}:${r}`,Kh=[[/(^|\.)chatgpt\.com$/,"chatgpt"],[/(^|\.)claude\.(ai|com)$/,"claude"],[/(^|\.)cursor\.(com|sh)$/,"cursor"]];function bt(e){let r=e.trim(),i=r.indexOf(":");if(i>0&&Mn(r.slice(0,i)))return{store:r.slice(0,i),plugin_id:r.slice(i+1)};let o;try{o=new URL(r)}catch{return{store:null,plugin_id:r}}let t=Kh.some(([c])=>c.test(o.hostname))?null:Gh(o.pathname);if(t)return{store:t.store,plugin_id:t.slug};let n=fx.exec(o.hash||o.pathname);if(n)return{store:Mn(n[1])?n[1]:"chatgpt",plugin_id:decodeURIComponent(n[2])};let a=decodeURIComponent(o.pathname.split("/").filter(Boolean).at(-1)??"");return gx.test(o.hostname)?{store:"cursor",plugin_id:`dir:${a}`}:{store:Kh.find(([c])=>c.test(o.hostname))?.[1]??null,plugin_id:a}}function Xd(e){let r=bt(e);return r.store?{store:r.store,plugin_id:r.plugin_id}:void 0}var hx=e=>Array.isArray(e)?e.join(","):String(e);function Wh(e,r,i){let o=new Set(e.flatMap(a=>"param"in a?[a.param]:[])),t=e.map(a=>{if("literal"in a)return a.literal;let c=r[a.param];if(c===void 0)return i(a.param,`${a.param} is required.`);if(!a.part)return encodeURIComponent(String(c));let u=Xd(String(c));return u?encodeURIComponent(u[a.part]):i(a.param,`${a.param}: expected '{store}:{plugin_id}', got '${c}'.`)}),n=new URLSearchParams(Object.entries(r).flatMap(([a,c])=>o.has(a)||c===void 0?[]:[[a,hx(c)]]));return`/${t.join("/")}${n.size?`?${n}`:""}`}var Pe=["observed","store_reported","derived","proxy","estimate"];var vx=["ranks","metrics","tools"],Fn=["rank_move","chart_enter","chart_exit","featuring_enter","featuring_exit","launch","toolset_change","listing_change","release_change","mcp_status_change","delisted","metric_change"],_j=Fn.filter(e=>e!=="release_change"),Xh=30,bx=["released_at","first_seen_at"],yx=["apps","rank"],_x=["1d","7d"],$x=["rank","new","name"],kx=["all","any"],wx=["chatgpt:apps_sdk","chatgpt:connector","chatgpt:plugin","chatgpt:curated","chatgpt:other"],xx=[...wx,...Object.keys(sa).filter(e=>!e.startsWith("chatgpt:"))],Sx=["all","missing"],Ix=["tags"],zx=["app"],Px=["weekly_brief","competitor_watch","audit_my_server"],Yh=["store_reported","derived","observed"],Ox=/^-(\d{1,4})([hdw])$/,Vn=e=>Ox.test(e)||!Number.isNaN(Date.parse(e));var qh=s.string().min(1).max(300),Yd=s.string().min(1).max(60),b={store:s.enum(j).describe("App store."),region:s.string().regex(/^([a-z]{2}|global|directory)$/).describe("ChatGPT country code (us, de\u2026), global, or directory (Cursor). Default: main catalog."),at:s.string().max(40).refine(Vn,"expected an ISO-8601 time or a relative time such as -24h or -7d").describe("A past time (ISO-8601, -24h, -7d): the latest data at that time. Default: now."),app:qh.describe("Listing ref '{store}:{plugin_id|slug}' (e.g. chatgpt:figma) or its OpenApps URL."),apps:s.array(qh).min(1).max(10).describe("1 to 10 listing refs or OpenApps URLs."),chart:s.string().min(1).max(120).describe("Chart name as stores lists it, e.g. category:productivity, popularity, directory:top."),query:s.string().min(1).max(200).describe("Words to find in app names, descriptions and publishers."),publisher:s.string().min(1).max(200).describe("Only apps by this publisher, named in any form (Figma, Inc. or figma)."),category:s.string().min(1).max(120).describe("Category title as rows show it, e.g. Productivity (new_list: ChatGPT only)."),kind:Nr(s.enum(Q)).describe("App kind; stores lists each store's kinds."),limit:s.coerce.number().int().min(1).max(1e4).describe("Rows per page."),latest:s.boolean().describe("Only the newest distinct version by first sighting of each record, instead of full history."),cursor:s.string().max(200).describe("The previous page's meta.next_cursor."),include:s.array(s.enum(vx)).describe("Sections per profile: ranks now, metrics, MCP tools."),response_format:s.enum(["concise","detailed"]).describe("detailed adds fields."),since:s.string().max(40).refine(Vn,"expected an ISO-8601 time or a relative time such as -24h or -7d").describe("Start of the window: ISO-8601, or relative to the latest data (-24h, -7d)."),types:s.array(s.enum(Fn)).min(1).describe("Event types to keep. Default: all but release_change."),sort:s.enum(bx).describe("Newest first by this time; since bounds it."),id:s.string().min(1).max(600).describe("A search result id: listing:{store}:{plugin_id}, app:{slug}, tag:{id}, chart:{store}:{chart} or server:{url}."),server:s.string().min(1).max(500).describe("MCP server URL as a listing's tools list it, or its OpenApps id."),metric:s.string().min(1).max(40).describe("Metric name as the stores resource lists it, e.g. installs (Claude), dir_installs (Cursor)."),status:s.enum(jr).describe("MCP server status: open (lists its tools without a sign-in), auth, blocked, dead or error."),diff_from:s.string().min(1).max(80).describe("An earlier toolset to diff against: snapshot hash or time (ISO-8601, -7d)."),context:s.string().max(500).describe("User's goal, briefly; nothing personal."),guide:s.enum(Px).describe("A playbook: the tool calls for a multi-step task, in order."),order:s.enum(yx).describe("apps: most apps first; rank: best chart position first."),window:s.enum(_x).describe("Movement against the previous day (1d) or a week earlier (7d)."),max_position:s.coerce.number().int().min(1).max(1e4).describe("Only rows at or above this position now (1-based)."),slug:s.string().min(1).max(300).describe("An app's slug (e.g. context7), or one of its listings' refs."),key:s.string().min(1).max(200).describe("Publisher key from publishers_list (e.g. figma), or a name it lists under (Figma, Inc.)."),tag:Yd.describe("Tag id from tags_tree, e.g. gmail."),tags:s.array(Yd).min(1).max(20).describe("Tag ids from tags_tree."),exclude:s.array(Yd).min(1).max(20).describe("Tag ids to leave out."),match:s.enum(kx).describe("all: every tag in tags; any: at least one."),linked:s.array(s.enum(j)).min(1).max(j.length).describe("Other stores its app is in."),stores:s.array(s.enum(j)).min(1).max(j.length).describe("App stores."),kinds:s.array(Nr(s.enum([...Q,...xx]))).min(1).max(20).describe("App kinds, bare (connector) or store-qualified (claude:connector, chatgpt:apps_sdk); a value qualified by another store is ignored."),families:s.array(s.string().min(1).max(80)).min(1).max(20).describe("ChatGPT app families, e.g. plugin_asdk_app."),categories:s.array(s.string().min(1).max(120)).min(1).max(20).describe("Category titles as rows show them."),publishers:s.array(s.string().min(1).max(200)).min(1).max(20).describe("Publisher keys (publishers_list) or names."),statuses:s.array(s.enum(jr)).min(1).max(jr.length).describe("MCP server statuses: open, auth, blocked, dead or error."),sort_by:s.enum($x).describe("rank: best chart place; new: newest release; name: A to Z."),availability:s.enum(Sx).describe("ChatGPT: all, listed in every country with data; missing, absent from some."),scope:s.enum(Ix).describe("tags: browsing by tag."),group:s.enum(zx).describe("app: one row per app, its best listing, by OpenApps Rank across stores; total and facets count apps."),released_since:s.string().max(40).refine(Vn,"expected an ISO-8601 time or a relative time such as -24h or -7d").describe("Only apps released since: ISO-8601, or relative to the latest data (-30d)."),from:s.string().max(40).refine(Vn,"expected an ISO-8601 time or a relative time such as -24h or -7d").describe("Range start: ISO-8601, or relative to to (-30d)."),to:s.string().max(40).refine(Vn,"expected an ISO-8601 time or a relative time such as -24h or -7d").describe("Range end, a past time. Default: the latest data."),issue:s.enum(Vh).describe("What the report is: a bug, wrong data, a missing capability, something confusing, or other."),summary:s.string().min(1).max(Cr.summary).describe("One line: what is wrong or missing."),details:s.string().max(Cr.details).describe("What the user tried, what happened and what was expected, paraphrased."),initiator:s.enum(Fh).describe("user when the user asked to send the report, model otherwise."),tool:s.string().min(1).max(Cr.tool).describe("The OpenApps tool the report is about."),subject_type:s.enum(Bh).describe("What the report is about."),subject_id:s.string().min(1).max(Cr.subject_id).describe("Its ref, slug or URL as these tools give it."),request_id:s.string().min(1).max(Cr.request_id).describe("The request id an OpenApps error answer ended with, when the report is about that call.")},Qh={app:{parts:{store:b.store,plugin_id:s.string().min(1).max(280).describe("The listing's id in its store, e.g. plugin_01abc; {store}:{plugin_id} is its ref.")},split:Xd,join:e=>Jh(e.store,e.plugin_id)}};var ev=["response_format","context"],tv={store:null,limit:null,kind:null,response_format:null,sort:null,region:"ChatGPT country code (default us).",at:"Past time: ISO-8601 or -24h, -7d.",since:"Window start: ISO-8601 or -24h, -7d.",app:"Listing ref or OpenApps URL.",apps:"Listing refs or OpenApps URLs.",chart:"Chart name; stores_get lists them.",query:"Words in app names, descriptions or publishers.",publisher:"Publisher name, in any form.",category:"Category title (ChatGPT).",cursor:null,include:"Sections per profile.",types:"Default: all but release_change.",metric:"Metric name; stores_get lists each store's.",server:"MCP server URL.",diff_from:"Earlier toolset: snapshot hash or time.",context:"The user's goal, briefly.",guide:null,kinds:"e.g. claude:connector; stores_get lists them.",issue:null,details:null,tool:null,subject_type:null,summary:"One line.",initiator:"user if the user asked for it, else model.",subject_id:"Ref, slug or URL.",request_id:"From an error answer."},rv=["kinds"],nv=["limit"],iv={country:["region"],country_code:["region"],market:["region"],app_id:["app","apps"],plugin_id:["app","apps"],id:["app","apps"],ids:["apps"],app:["apps","slug"],app_ids:["apps"],refs:["apps"],product:["slug"],listing:["app","slug"],listings:["apps"],q:["query"],search:["query"],term:["query"],keyword:["query"],keywords:["query"],slug:["chart"],chart_id:["chart"],list:["chart"],category:["chart","categories"],platform:["store","stores"],marketplace:["store","stores"],store:["stores"],kind:["kinds","issue"],family:["families"],publisher:["publishers"],status:["statuses"],page_size:["limit"],max_results:["limit"],top:["limit"],count:["limit"],date:["at"],as_of:["at"],time:["at"],url:["server"],server_url:["server"],mcp_server:["server"],from:["diff_from","since","released_since"],after:["since","released_since"],type:["types"],event_types:["types"],compare_to:["diff_from"],since:["diff_from","released_since","from"],until:["to"],end:["to"],format:["response_format"],detail:["response_format"],verbosity:["response_format"],sections:["include"],fields:["include"],description:["details"],message:["summary"],sort:["order","sort_by"],publisher_key:["key","publisher"],product_id:["slug"],max_rank:["max_position"],period:["window"],order:["sort_by"],tag:["tags"],tags:["tag"],tag_id:["tag"],without:["exclude"],exclude_tags:["exclude"],mode:["match"],also_on:["linked"],mcp:["status","statuses"],mcp_status:["status","statuses"],released:["released_since"],launched_since:["released_since"]};var yt=s.string().nullable(),Qd=["current","stale","unavailable","none"],ep=s.object({store:s.enum(j),region:s.string(),as_of:yt.describe("When the region's latest data is from"),status:s.enum(Qd),dark_since:yt.describe("unavailable only: refused since")}),Ax=s.object({tier:s.enum(Nh).describe("out (no account), free or plus (Pro)"),need:s.enum(["free","plus"]).describe("The plan that shows the rest"),cap:s.number().int().nullable().describe("Rows shown"),total:s.number().int().nullable().describe("Rows in full"),since:yt.describe("Earliest time shown"),regions:s.array(s.string()).nullable().describe("Countries shown"),rank:s.number().int().nullable().describe("Only apps ranked this high"),by:s.object({up:s.number().int(),down:s.number().int(),new:s.number().int()}).partial().optional().describe("movers_list: climbers, fallers and new entries in full, each cut to cap apart"),upgrade_url:s.string().optional().describe("need plus: a link for the caller's person to buy Pro")}),jx=s.object({as_of:yt,run:s.object({store:s.enum(j),region:s.string(),started_at:s.string()}).nullable(),compared_to:s.object({prev:yt,day:yt,week:yt.optional().describe("charts_get on the latest run: the run prev_week is from")}).nullable(),freshness:s.object({cadence:s.string(),next_expected_at:yt,stale:s.boolean().describe("Any region older than expected")}).nullable(),basis:s.record(s.string(),s.enum(Pe)),coverage:s.object({notes:s.array(s.string()),regions:s.array(ep).describe("Each region the answer speaks for")}),next_cursor:s.string().nullable(),truncated:s.boolean(),truncation_reason:s.string().nullable(),plan:Ax.optional().describe("What the caller's plan left out (truncation_reason plan)")}),ov=e=>s.object({data:e,meta:jx});var Tx=/^[a-z]+(_[a-z]+){1,2}$/,Dx=/^\/v1(\/([a-z]+|\{[a-z_]+\}))+$/,Nx=/\{([a-z_]+)\}/g,Cx=/^([a-z_0-9]+)(\[\])?$/;function C(e){let r={...e,path:e.path??`/v1/${e.resource}`,output:ov(e.data)},i=[...Tx.test(r.name)&&r.name.startsWith(`${r.resource}_`)?[]:[`${r.name}: an operation is named <resource>_<verb> in lowercase, starting with its resource '${r.resource}'`],...Ex(r.name,r.input,{toolOnly:!1}),...Rx(r.name,r.path,r.input),...Zx(r.name,r.data,r.basis),...r.examples.length?[]:[`${r.name}: give at least one example; tests run every example`],...r.examples.flatMap(o=>r.input.safeParse(o.input).success?[]:[`${r.name}: example '${o.title}' does not parse against the input`])];if(i.length)throw new Error(i.join(`
|
|
64
|
-
`));return r}var Ux=new Set(["optional","default","nullable","prefault"]);function rt(e){let r=e;for(;Ux.has(r._zod.def.type)&&r._zod.def.innerType;)r=r._zod.def.innerType;return r}function Ex(e,r,{toolOnly:i}){return Object.entries(r.shape).flatMap(([o,t])=>{if(!Object.hasOwn(b,o)){let a=iv[o]?.[0];return[`${e}: input '${o}' is not in vocab.ts; ${a?`use '${a}', not '${o}'`:"add it to P there, or use a name P already has"}`]}let n=o;return!i&&ev.includes(n)?[`${e}: '${o}' is a tool-only parameter; operations never take it`]:rt(t)!==b[n]?[`${e}: input '${o}' must be P.${o} from vocab.ts (wrapped only in .optional() or .default()), not a schema of its own`]:[]})}function Rx(e,r,i){return Dx.test(r)?[...r.matchAll(Nx)].flatMap(([,o])=>Object.hasOwn(i.shape,o)?i.shape[o].safeParse(void 0).success?[`${e}: path placeholder {${o}} must be a required input`]:[]:[`${e}: path placeholder {${o}} is not an input`]):[`${e}: path '${r}' must be /v1 followed by lowercase segments and {input} placeholders`]}function Lx(e,r){let i=e;for(let o of r.split(".")){let[,t,n]=Cx.exec(o)??[],a=i&&rt(i);if(!t||!(a instanceof s.ZodObject)||!Object.hasOwn(a.shape,t))return;if(i=a.shape[t],n){let c=rt(i);if(!(c instanceof s.ZodArray))return;i=c.element}}return i}var Zx=(e,r,i)=>Object.keys(i).flatMap(o=>Lx(r,o)?[]:[`${e}: basis path '${o}' names no field of the output`]);var O=e=>e.optional().meta({detailed:!0});var ge=(e,r,i,o)=>({facet:"domain",value:e,title:r,description:i,synonyms:o,parent:null}),w=(e,r,i,o,t)=>({facet:"use",value:e,title:i,description:o,synonyms:t,parent:r}),se=(e,r,i,o)=>({facet:"audience",value:e,title:r,description:i,synonyms:o,parent:null}),S=(e,r,i,o)=>({facet:"connects",value:e,title:r,description:`Works with ${r}.`,synonyms:[i],parent:null,site:o}),Bn=[ge("design-media","Design & media","Make or edit images, video, audio, slides, graphics, 3D models and websites.",[]),w("image-generation","design-media","Images & photos","Generate, edit or enhance images, photos, logos and illustrations.",[]),w("video","design-media","Video","Make, edit or publish video.",["Video generation & avatars","Video editing & publishing"]),w("audio-music","design-media","Audio, voice & music","Work with audio, voice and music.",["Music","Voice & speech","Transcription","Podcasts & audiobooks"]),w("presentations","design-media","Presentations & slides","Build slide decks and presentations.",[]),w("graphic-design","design-media","Graphic & UI design","Graphics, branding, mockups, UI design and design systems.",[]),w("3d-cad","design-media","3D & CAD","3D models, CAD and 3D printing.",[]),w("websites","design-media","Websites & landing pages","Build, generate or publish websites and landing pages.",[]),ge("developer-tools","Developer tools & IT","Write, test, ship, run and secure software.",["Security & IT"]),w("code-review","developer-tools","Code review & quality","Review pull requests, lint, refactor and track code quality.",[]),w("testing-qa","developer-tools","Testing & QA","Write and run unit, end-to-end and regression tests.",[]),w("deploy-cloud","developer-tools","Deploy, hosting & infra","Deploy and run software on cloud infrastructure.",["Hosting & deploys","Containers & Kubernetes","IaC & CI/CD","Cloud cost & FinOps"]),w("databases","developer-tools","Databases","Query, manage and migrate databases, including vector stores.",[]),w("apis-sdks","developer-tools","APIs & SDKs","Design, document, test and call APIs; SDKs and webhooks.",[]),w("observability","developer-tools","Debugging & monitoring","Debug errors, read logs and traces, handle incidents.",[]),w("git","developer-tools","Git & version control","Repositories, commits, branches and merge requests.",[]),w("codebase-docs","developer-tools","Code search & docs","Search codebases and read current developer docs.",[]),w("agent-building","developer-tools","Agent building & orchestration","Build, run and evaluate AI agents.",["Multi-agent orchestration","Memory & context","MCP gateways & tooling","Evals & LLM ops"]),w("harness-addons","developer-tools","Coding agent add-ons","Hooks, status lines, commands and session tools for coding agents.",[]),w("coding-conventions","developer-tools","Coding rules & conventions","Rules, style guides and best practices for writing code.",[]),w("mobile-dev","developer-tools","Mobile & Apple platforms","Build iOS, Android and macOS apps.",[]),w("domains-dns","developer-tools","Domains & DNS","Search, register and configure domains and DNS.",[]),w("appsec","developer-tools","AppSec & vulnerabilities","Vulnerabilities, security scans and threat intelligence.",[]),w("identity-access","developer-tools","Identity & access","Identity, single sign-on, passwords and access control.",[]),w("it-ops","developer-tools","IT ops & devices","IT support, device management and networks.",[]),w("agent-guardrails","developer-tools","Agent guardrails & safety","Guardrails, sandboxes and redaction for AI agents.",[]),ge("data-analytics","Data & analytics","Query, analyze and chart data.",[]),w("bi-dashboards","data-analytics","BI & dashboards","Dashboards, KPIs, reporting and business intelligence.",[]),w("warehouses-pipelines","data-analytics","Warehouses & pipelines","Data warehouses, lakes, catalogs and ETL pipelines.",[]),w("spreadsheets","data-analytics","Spreadsheets & CSV","Work with spreadsheets and CSV files.",[]),w("product-analytics","data-analytics","Product & web analytics","Funnels, experiments, feature flags and web traffic.",[]),w("web-data-extraction","data-analytics","Web data extraction","Pull structured data out of web pages and documents.",[]),w("charts-viz","data-analytics","Charts & visualization","Charts, diagrams, flowcharts and whiteboards.",[]),ge("productivity","Productivity & docs","Writing, notes, documents, files, calendars and meetings.",[]),w("writing","productivity","Writing & editing","Write, rewrite, proofread and edit text.",[]),w("notes-knowledge","productivity","Notes & knowledge base","Notes, wikis, bookmarks and team knowledge.",[]),w("documents-pdfs","productivity","Documents & PDFs","Create, edit, sign and manage documents and PDFs.",[]),w("forms-surveys","productivity","Forms & surveys","Build forms, surveys and questionnaires.",[]),w("calendar-scheduling","productivity","Calendar & scheduling","Calendars, appointments and meeting booking.",[]),w("meetings","productivity","Meeting notes & transcripts","Record, transcribe and summarize meetings.",[]),w("files-storage","productivity","Files & storage","Store, share and search files.",[]),w("translation","productivity","Translation","Translate and localize text.",[]),w("ai-assistant-tools","productivity","AI assistant tools","Memory, chat history and export, prompts, skills and usage for the AI assistant you use.",["Chat export","Prompt library","Skills"]),w("personal-assistant","productivity","Personal assistant & memory","Plan the day, remember things and handle life admin.",[]),ge("project-management","Projects & workflows","Plan work, track tasks and automate workflows.",[]),w("tasks","project-management","Tasks & to-dos","To-do lists, checklists and task tracking.",[]),w("issues-sprints","project-management","Issues & sprints","Issue tracking, backlogs, sprints and roadmaps.",[]),w("product-specs","project-management","Product specs & PRDs","Product requirements, specs and user stories.",[]),w("automation","project-management","Automation & workflows","Automate repetitive work across apps.",[]),w("time-tracking","project-management","Time tracking","Track hours and timesheets.",[]),ge("communication","Communication","Email, chat, messaging and calls.",[]),w("email","communication","Email","Read, sort, write and send email.",[]),w("team-chat","communication","Team chat & messaging","Team chat, direct messages and text messages.",[]),w("calls","communication","Calls & video meetings","Phone calls, video calls and dialers.",[]),ge("sales-crm","Sales & customers","Find leads, close deals and support customers.",["Customer support"]),w("crm","sales-crm","CRM","Contacts, accounts and deal pipelines.",[]),w("prospecting","sales-crm","Prospecting & leads","Find, enrich and contact leads.",[]),w("sales-enablement","sales-crm","Sales enablement","Sales calls, coaching, proposals and RFPs.",[]),w("partnerships","sales-crm","Partnerships & affiliates","Partner, affiliate and referral programs.",[]),w("helpdesk","sales-crm","Helpdesk & tickets","Support tickets, live chat and customer conversations.",[]),w("feedback-reviews","sales-crm","Feedback & reviews","Collect and analyze customer feedback and reviews.",[]),w("help-center","sales-crm","Help center & FAQs","Help articles and FAQs.",[]),ge("marketing","Marketing & SEO","Search, ads, social, content, email and brand.",[]),w("seo","marketing","SEO & AI search","Keyword research, search rankings and visibility in AI answers.",[]),w("ads","marketing","Ads & paid media","Plan, run and report on ad campaigns.",[]),w("social-media","marketing","Social media","Post to, schedule and track social media.",[]),w("content-marketing","marketing","Content & copy","Blog posts, content plans and marketing copy.",[]),w("email-marketing","marketing","Email marketing","Newsletters, email campaigns and subscriber lists.",[]),w("brand-intel","marketing","Brand & competitor intel","Track brand mentions, competitors and sentiment.",[]),w("marketing-analytics","marketing","Marketing analytics & attribution","Campaign performance, attribution and marketing data.",[]),w("app-marketing","marketing","App store & product marketing","App store optimization, app rankings and product launches.",[]),ge("finance","Finance & payments","Payments, accounting, tax, investing, banking and insurance.",[]),w("payments-billing","finance","Payments & billing","Take payments, send invoices and manage billing.",[]),w("accounting","finance","Accounting & bookkeeping","Books, expenses, receipts and reconciliation.",[]),w("tax","finance","Tax","Tax returns, VAT and tax filings.",[]),w("investing","finance","Investing & market data","Stocks, market data, filings, portfolios and trading.",[]),w("deals-vc","finance","Deals, M&A & VC","Fundraising, due diligence, data rooms and deal flow.",[]),w("crypto","finance","Crypto & web3","Tokens, wallets, chains and exchanges.",[]),w("banking","finance","Banking & personal finance","Bank accounts, budgets, cards, loans and mortgages.",[]),w("insurance","finance","Insurance","Insurance quotes, policies and underwriting.",[]),w("fpa","finance","FP&A & finance ops","Financial planning, forecasts, cash flow and spend.",[]),ge("commerce","Commerce & shopping","Shopping, online stores and real estate.",[]),w("shopping","commerce","Shopping & deals","Find products, compare prices and get deals.",[]),w("ecommerce-ops","commerce","E-commerce operations","Run online stores: listings, inventory and orders.",[]),w("real-estate","commerce","Real estate","Homes, rentals and property data.",[]),ge("research","Research & search","Search the web, papers, companies and news.",[]),w("web-search","research","Web search","Search the web.",[]),w("academic","research","Academic & scientific","Papers, preprints, clinical trials and scientific data.",[]),w("company-research","research","Company & market research","Company profiles, industries and markets.",[]),w("news","research","News & media","News, headlines and press releases.",[]),w("deep-research","research","Deep research & reports","Long research reports with sources.",[]),ge("travel-places","Travel & places","Flights, stays, transport, trips, maps, weather and events.",[]),w("flights","travel-places","Flights","Search and book flights.",[]),w("hotels","travel-places","Hotels & stays","Hotels, rentals and other places to stay.",[]),w("ground-transport","travel-places","Trains, transit & cars","Trains, buses, transit, car rentals and rides.",[]),w("trip-planning","travel-places","Trip planning & guides","Itineraries, destinations and things to do.",[]),w("maps-local","travel-places","Maps & local","Maps, directions and local places.",[]),w("weather","travel-places","Weather","Weather forecasts and climate data.",[]),w("events-tickets","travel-places","Events & tickets","Concerts, festivals, venues and event tickets.",[]),ge("education","Education & learning","Studying, language learning and teaching.",[]),w("tutoring","education","Students & tutoring","Homework help, tutoring, quizzes and flashcards.",[]),w("language-learning","education","Language learning","Learn a language: vocabulary and pronunciation.",[]),w("teaching","education","Teaching & courses","Lesson plans, courses and classroom tools.",[]),ge("health","Health & wellness","Fitness, nutrition, medicine and mental health.",[]),w("fitness","health","Fitness & running","Workouts, running, cycling and training plans.",[]),w("nutrition","health","Nutrition & diet","Calories, diets and meal plans.",[]),w("medical","health","Medical & clinical","Clinical care, patients, drugs and health records.",[]),w("mental-health","health","Mental health & sleep","Therapy, meditation, journaling and sleep.",["Meditation","Mindfulness"]),ge("lifestyle","Entertainment & lifestyle","Games, entertainment, food, home, sports and relationships.",[]),w("games","lifestyle","Games & puzzles","Games, puzzles and trivia.",[]),w("movies-books","lifestyle","Movies, TV & books","Movies, TV shows, books and reading lists.",[]),w("food-recipes","lifestyle","Food & recipes","Recipes, cooking, restaurants and drinks.",[]),w("home-family","lifestyle","Home, family & pets","Home, family, kids and pets.",[]),w("spirituality","lifestyle","Astrology & spirituality","Astrology, tarot and religion.",[]),w("sports","lifestyle","Sports & betting","Sports scores, fantasy leagues and betting.",[]),w("dating","lifestyle","Dating & relationships","Dating and relationship advice.",[]),ge("business-ops","Business operations","Hiring, legal, logistics, ERP, procurement and small business tools.",["HR & recruiting","Legal & compliance"]),w("recruiting","business-ops","Recruiting & hiring","Source, screen and hire candidates.",[]),w("careers","business-ops","Careers & job search","Resumes, cover letters, job search and interview prep.",[]),w("people-ops","business-ops","People ops & payroll","Payroll, employee records, time off and reviews.",[]),w("contracts","business-ops","Contracts","Draft, review and redline contracts.",[]),w("compliance","business-ops","Compliance & privacy","Regulation, privacy, risk and governance.",[]),w("legal-research","business-ops","Legal research","Case law, statutes, patents and trademarks.",[]),w("logistics","business-ops","Logistics & shipping","Shipping, freight, fleets and supply chains.",[]),w("erp-procurement","business-ops","ERP & procurement","ERP, purchase orders and suppliers.",[]),w("small-business-ops","business-ops","Small business tools","Tools for small businesses, freelancers and field services.",[]),se("for-developers","Developers","Software developers and engineering teams.",[]),se("for-designers","Designers & creators","Designers, artists and content creators.",[]),se("for-marketers","Marketers","Marketers, growth teams and agencies.",[]),se("for-sales","Sales teams","Sales reps and sales teams.",[]),se("for-support","Support teams","Customer support teams.",[]),se("for-product","Product managers","Product managers and product teams.",[]),se("for-data","Data teams & analysts","Data teams, analysts and data scientists.",[]),se("for-finance","Finance teams & accountants","Finance teams, accountants and bookkeepers.",[]),se("for-hr","HR & recruiters","Recruiters, hiring managers and HR teams.",[]),se("for-legal","Legal teams","Lawyers, paralegals and legal teams.",[]),se("for-it-security","IT & security teams","IT admins, security teams and SREs.",[]),se("for-researchers","Researchers & scientists","Researchers, scientists and academics.",[]),se("for-students","Students & educators","Students, learners and educators.",["Teachers","Learners"]),se("for-clinicians","Clinicians & health pros","Doctors, nurses, pharmacists and other health professionals.",[]),se("for-investors","Investors & traders","Investors, traders and portfolio managers.",[]),se("for-small-business","Small business & freelancers","Small businesses, freelancers and founders.",[]),se("for-consumers","Consumers","People using it in their personal life: travel, shopping, health, money and entertainment.",[]),se("for-enterprise","Enterprise","Large organizations.",[]),S("gmail","Gmail","Google Workspace","mail.google.com"),S("google-drive","Google Drive","Google Workspace","drive.google.com"),S("google-calendar","Google Calendar","Google Workspace","calendar.google.com"),S("google-docs","Google Docs","Google Workspace","docs.google.com"),S("google-sheets","Google Sheets","Google Workspace","sheets.google.com"),S("google-slides","Google Slides","Google Workspace","slides.google.com"),S("google-meet","Google Meet","Google Workspace","meet.google.com"),S("google-ads","Google Ads","Google marketing","ads.google.com"),S("google-analytics","Google Analytics","Google marketing","analytics.google.com"),S("search-console","Search Console","Google marketing","search.google.com"),S("youtube","YouTube","Google marketing","youtube.com"),S("google-maps","Google Maps","Google marketing","maps.google.com"),S("outlook","Outlook","Microsoft 365","outlook.live.com"),S("microsoft-teams","Teams","Microsoft 365","teams.microsoft.com"),S("excel","Excel","Microsoft 365","excel.cloud.microsoft"),S("word","Word","Microsoft 365","word.cloud.microsoft"),S("powerpoint","PowerPoint","Microsoft 365","powerpoint.cloud.microsoft"),S("sharepoint-onedrive","SharePoint & OneDrive","Microsoft 365","onedrive.live.com"),S("power-bi","Power BI","Microsoft 365","powerbi.com"),S("dynamics","Dynamics 365","Microsoft 365","dynamics.microsoft.com"),S("jira","Jira","Atlassian","jira.atlassian.com"),S("confluence","Confluence","Atlassian","confluence.atlassian.com"),S("bitbucket","Bitbucket","Atlassian","bitbucket.org"),S("trello","Trello","Atlassian","trello.com"),S("github","GitHub","Code hosting","github.com"),S("gitlab","GitLab","Code hosting","gitlab.com"),S("aws","AWS","Cloud & hosting","aws.amazon.com"),S("google-cloud","Google Cloud","Cloud & hosting","cloud.google.com"),S("azure","Azure","Cloud & hosting","azure.microsoft.com"),S("cloudflare","Cloudflare","Cloud & hosting","cloudflare.com"),S("vercel","Vercel","Cloud & hosting","vercel.com"),S("netlify","Netlify","Cloud & hosting","netlify.com"),S("firebase","Firebase","Cloud & hosting","firebase.google.com"),S("supabase","Supabase","Cloud & hosting","supabase.com"),S("docker-k8s","Docker & Kubernetes","Cloud & hosting","docker.com"),S("postgres","Postgres","Databases & warehouses","postgresql.org"),S("mysql","MySQL","Databases & warehouses","mysql.com"),S("mongodb","MongoDB","Databases & warehouses","mongodb.com"),S("redis","Redis","Databases & warehouses","redis.io"),S("snowflake","Snowflake","Databases & warehouses","snowflake.com"),S("databricks","Databricks","Databases & warehouses","databricks.com"),S("elasticsearch","Elasticsearch","Databases & warehouses","elastic.co"),S("sqlite","SQLite","Databases & warehouses","sqlite.org"),S("sentry","Sentry","Developer services","sentry.io"),S("datadog","Datadog","Developer services","datadoghq.com"),S("postman","Postman","Developer services","postman.com"),S("twilio","Twilio","Developer services","twilio.com"),S("slack","Slack","Chat & meetings","slack.com"),S("discord","Discord","Chat & meetings","discord.com"),S("zoom","Zoom","Chat & meetings","zoom.us"),S("whatsapp","WhatsApp","Chat & meetings","whatsapp.com"),S("telegram","Telegram","Chat & meetings","telegram.org"),S("notion","Notion","Work management","notion.so"),S("linear","Linear","Work management","linear.app"),S("asana","Asana","Work management","asana.com"),S("clickup","ClickUp","Work management","clickup.com"),S("monday","monday.com","Work management","monday.com"),S("airtable","Airtable","Work management","airtable.com"),S("todoist","Todoist","Work management","todoist.com"),S("obsidian","Obsidian","Work management","obsidian.md"),S("dropbox","Dropbox","Work management","dropbox.com"),S("box","Box","Work management","box.com"),S("zapier","Zapier","Work management","zapier.com"),S("calendly","Calendly","Work management","calendly.com"),S("salesforce","Salesforce","CRM & sales tools","salesforce.com"),S("hubspot","HubSpot","CRM & sales tools","hubspot.com"),S("pipedrive","Pipedrive","CRM & sales tools","pipedrive.com"),S("attio","Attio","CRM & sales tools","attio.com"),S("zoho","Zoho","CRM & sales tools","zoho.com"),S("apollo","Apollo","CRM & sales tools","apollo.io"),S("stripe","Stripe","Commerce & payments","stripe.com"),S("shopify","Shopify","Commerce & payments","shopify.com"),S("paypal","PayPal","Commerce & payments","paypal.com"),S("square","Square","Commerce & payments","squareup.com"),S("woocommerce","WooCommerce","Commerce & payments","woocommerce.com"),S("amazon","Amazon","Commerce & payments","amazon.com"),S("quickbooks","QuickBooks","Commerce & payments","quickbooks.intuit.com"),S("xero","Xero","Commerce & payments","xero.com"),S("figma","Figma","Design & web","figma.com"),S("canva","Canva","Design & web","canva.com"),S("adobe","Adobe","Design & web","adobe.com"),S("webflow","Webflow","Design & web","webflow.com"),S("framer","Framer","Design & web","framer.com"),S("wordpress","WordPress","Design & web","wordpress.org"),S("instagram","Instagram","Social networks","instagram.com"),S("tiktok","TikTok","Social networks","tiktok.com"),S("x-twitter","X / Twitter","Social networks","x.com"),S("facebook","Facebook & Meta","Social networks","facebook.com"),S("reddit","Reddit","Social networks","reddit.com"),S("linkedin","LinkedIn","Social networks","linkedin.com"),S("zendesk","Zendesk","Support tools","zendesk.com"),S("intercom","Intercom","Support tools","intercom.com"),S("freshdesk","Freshdesk","Support tools","freshdesk.com"),S("openai-api","OpenAI API","AI models & media APIs","openai.com"),S("gemini","Gemini","AI models & media APIs","gemini.google.com"),S("hugging-face","Hugging Face","AI models & media APIs","huggingface.co"),S("elevenlabs","ElevenLabs","AI models & media APIs","elevenlabs.io"),S("replicate","Replicate","AI models & media APIs","replicate.com")];var lv=[{id:"job",label:"Use case",hint:"What it does"},{id:"works",label:"Works with",hint:"Products and platforms it connects to"},{id:"for",label:"Audience",hint:"Who it is for"},{id:"cap",label:"Capabilities",hint:"Read from listing data, not text"}],E=(e,r,i,o=[])=>({id:e,label:r,description:i,kids:o}),av=e=>({...e,api:!0});function dv(e,r,i=null,o=!1){return r.flatMap(t=>{let n=o||!!t.api;return[{id:t.id,label:t.label,description:t.description,facet:e,parent:i,other:!1,...n?{api:!0}:{}},...dv(e,t.kids,t.id,n)]})}function Mx(e){let r=[],i=new Map;for(let n of e){let a=n.parent===null?void 0:i.get(n.parent);if(i.has(n.id))throw new Error(`duplicate tag id ${n.id}`);if(n.parent!==null&&!a)throw new Error(`tag ${n.id} comes before its parent ${n.parent}`);let c={...n,depth:a?a.depth+1:1,kids:[]};r.push(c),i.set(n.id,c),a?.kids.push(n.id)}let o=new Map(r.map((n,a)=>[n.id,a])),t=n=>{let a=[];for(let c=i.get(n)?.parent??null;c;c=i.get(c)?.parent??null)a.push(c);return a};return{tags:r,node:n=>i.get(n),ancestors:t,withAncestors:n=>{let a=new Set;for(let c of n)if(i.has(c)){a.add(c);for(let u of t(c))a.add(u)}return[...a].sort((c,u)=>o.get(c)-o.get(u))}}}var Vx=[E("cap-kind","Listing type","What the listing is in its store.",[E("kind-chatgpt-app","ChatGPT app","An app in ChatGPT."),E("kind-claude-connector","Claude connector","A connector in Claude."),E("kind-claude-plugin","Claude plugin","A plugin in Claude."),E("kind-cursor-plugin","Cursor plugin","A plugin in the Cursor marketplace."),E("kind-mcp-server","MCP server (cursor.directory)","An MCP server listed on cursor.directory."),E("kind-rule","Rule (cursor.directory)","A rule listed on cursor.directory."),E("kind-claude-extension","Claude desktop extension","A desktop extension in Claude."),E("kind-grokbot-plugin","Grok Bot plugin","A plugin in Grok Bot."),E("kind-grokbot-bot","Grok Bot template","A bot template in Grok Bot's marketplace.")]),E("cap-ui","ChatGPT surface","Whether a ChatGPT app can show its own interface.",[E("apps-sdk","Apps SDK app (can show UI)","Built with the Apps SDK, so it can show its own interface in the chat."),E("connector-only","Connector (no UI)","A connector that returns data to the chat and shows no interface of its own.")]),E("cap-access","Sign-in","Whether it needs you to sign in, and how.",[E("signin-oauth","OAuth sign-in","Asks you to sign in with your account."),E("signin-key","API key or token","Needs an API key or token."),E("signin-open","Open, no sign-in","Its MCP server works without signing in.")]),E("cap-mcp","MCP server","What its MCP server reports.",[E("mcp-remote","Remote MCP (streamable HTTP)","A remote MCP server over streamable HTTP."),E("mcp-sse","SSE transport","A remote MCP server over the older SSE transport."),E("mcp-down","Server down or erroring","Its MCP server is down, blocked or returning errors.")]),E("cap-actions","Tool actions","What its tools do, read from their names and annotations.",[E("writes-data","Writes data (create/update/send)","Has tools that create, change, send or delete things."),E("read-only","Read-only tools","Every tool only reads.")]),E("cap-reach","Reach","Where the listing is available and promoted.",[E("multi-store","On 2+ stores","The same product is listed in two or more stores."),E("all-stores","On 3+ stores","The same product is listed in three or more stores."),E("geo-restricted","Missing in some countries","Missing from the ChatGPT directory in some countries."),E("worldwide","Listed in every country","Listed in the ChatGPT directory in every country we cover."),E("on-shelf","On a home shelf now","On one of its store's home shelves now.")]),E("cap-age","Age","When the listing was created.",[E("new-30d","Created in the last 30 days","Created in the last 30 days, by the listing's own creation date."),E("new-7d","Created in the last 7 days","Created in the last 7 days, by the listing's own creation date.")]),av(E("cap-form","Form","What the listing is across stores, read from what it holds (an MCP server makes it an integration).",[E("form-integration","Integration","Reaches a service through a server it runs: an MCP server, an LSP server or a CLI."),E("form-instruction","Instruction","Text the assistant follows: rules, skills, commands, subagents or hooks, and no server."),E("form-agent","Agent","A ready-made assistant: a Grok Bot template.")])),av(E("cap-parts","Parts","What the listing holds, as its store's records list it.",[E("has-skills","Skills","Holds one or more skills."),E("has-rules","Rules","Holds one or more rules."),E("has-commands","Commands","Holds one or more commands."),E("has-agents","Subagents","Holds one or more subagents."),E("has-hooks","Hooks","Holds one or more hooks.")])),E("cap-review","Store review","How its store vetted the listing.",[E("community","Community listing","In the community tier of Claude's directory, which records no review of the listing by Anthropic or a partner.")])],pv={"Google Workspace":"google-workspace","Google marketing":"google-marketing","Microsoft 365":"microsoft-365",Atlassian:"atlassian","Code hosting":"code-hosts","Cloud & hosting":"clouds","Databases & warehouses":"data-stores","Developer services":"dev-services","Chat & meetings":"chat-apps","Work management":"work-apps","CRM & sales tools":"crm-tools","Commerce & payments":"commerce-tools","Design & web":"design-tools","Social networks":"social-networks","Support tools":"support-tools","AI models & media APIs":"ai-models"},Fx={domain:"job",use:"job",connects:"works",audience:"for"},sv=Bn.filter(e=>e.facet==="connects"),cv=e=>{let r=pv[e.synonyms[0]];if(!r)throw new Error(`brand ${e.value} names no known group`);return r},Bx=[...new Set(sv.map(cv))].flatMap(e=>{let r=sv.filter(o=>cv(o)===e),i=r[0].synonyms[0];return[{id:e,label:i,description:`Works with ${r.slice(0,-1).map(o=>o.title).join(", ")} or ${r.at(-1).title}.`,facet:"works",parent:null,other:!1},...r.map(o=>({id:o.value,label:o.title,description:o.description,facet:"works",parent:e,other:!1,site:o.site}))]}),uv=Bn.filter(e=>e.facet!=="connects").map(e=>({id:e.value,label:e.title,description:e.description,facet:Fx[e.facet],parent:e.parent,other:!1})),tp=Mx([...uv.filter(e=>e.facet==="job"),...Bx,...uv.filter(e=>e.facet==="for"),...dv("cap",Vx)]),rp=tp.tags,Rj=rp.map(e=>e.id),Lj=new Map(rp.map(e=>[e.id,e])),Zj=new Map(rp.map((e,r)=>[e.id,r])),Mj=new Map([...Bn.map(e=>[e.value,e.facet]),...Object.values(pv).map(e=>[e,"connects"])]);var Vj=new Map(Bn.filter(e=>e.facet!=="connects").map(e=>[e.value,e.synonyms]));var Fj=tp.ancestors;var Bj=tp.withAncestors;var Y=s.number().int(),ne=s.string(),F=s.string().nullable(),Bt=s.record(s.string(),s.unknown()),ip=O(F.describe("The app's icon on the OpenApps site")),Me=s.string().nullable().describe("Unique in its store; listings_get takes it"),Gx=F.describe("The app's page in the store"),pe=s.object({app:s.string(),slug:Me,name:F,kind:s.enum(Q),store:s.enum(j),url:s.string(),short_description:F,publisher:O(F),icon:ip,product:O(s.string().nullable().describe("Same value: same product, within one answer"))}),_t=F.describe("The app's store category, e.g. Productivity"),np=s.string().nullable(),Ur=s.array(s.object({store:s.enum(j),app:s.string(),slug:np,kind:s.enum(Q),url:s.string()})).describe("The product's apps in other stores"),Ve=s.object({chart:s.string(),title:F,position:Y.describe("1-based; among the app's kind when kind is set"),kind:s.string().nullable()}).describe("Best place now: the main ranking if it lists the app, else the best other"),nt=s.array(s.string()).describe("Tag ids it carries now, ancestors included, in tags_tree order"),mv=Y.nullable().optional(),Ze=Y.nullable().optional(),la=pe.extend({best:Ve.nullable(),category:_t,tags:nt,linked:Ur,prev_day:mv.describe("best.position ~24h earlier; null: not listed then"),prev_week:mv.describe("As prev_day, ~7 days earlier"),day_change:Ze.describe("Cohort change on best.chart since ~24h earlier"),week_change:Ze.describe("As day_change, since ~7 days earlier"),countries:s.object({listed:Y,of:Y}).optional().describe("ChatGPT: countries whose directory lists it, of those with complete data"),launched_at:O(ne.nullable()),first_seen_at:O(ne),mcp_status:O(F.describe("Status of the first MCP server it links"))}),Er=s.object({position:Y,app:s.string(),slug:Me,name:F,url:s.string(),prev:Y.nullable(),prev_day:Y.nullable(),is_new:s.boolean(),kind:O(s.enum(Q)),publisher:O(F),short_description:O(F),launched_at:O(ne.nullable()),listing:O(Bt.describe("Store-specific listing fields, e.g. Claude tier and surfaces")),icon:ip,product:O(s.string().nullable().describe("Same value: same product, within one answer")),category:_t,linked:Ur,prev_week:O(Y.nullable().describe("Position ~7 days earlier: charts_get on the latest run, and movers_list with window=7d")),day_change:Ze.describe("Cohort change since ~24h earlier: what the site's change pill shows"),week_change:O(Ze.describe("As day_change, since ~7 days earlier: charts_get on the latest run, and movers_list with window=7d")),first_seen_at:O(ne),kind_position:O(Y.nullable().describe("Position among the list's apps of the same kind, in lists that join kinds (Claude's Most popular); else null")),tags:O(nt)}),Kx=s.partialRecord(s.enum(j),Y).describe("Apps carrying it per store"),da=s.enum(lv.map(e=>e.id)),Gn=s.object({id:s.string(),label:s.string(),facet:da,parent:F.describe("The tag one level up; null for a top tag"),depth:Y.describe("1 for a top tag"),other:s.boolean().describe("An 'X: Other' tag: in its parent, in none of the parent's narrower tags"),n:Y.describe("Apps carrying it, in the stores asked for"),stores:Kx,description:O(s.string()),icon:s.string().optional().describe("A brand's mark on the OpenApps site: its website's favicon")}),op=s.object({key:s.string().describe("Publisher key: publishers_get takes it"),name:s.string().describe("The name most of its apps carry"),stores:s.array(s.object({store:s.enum(j),apps:Y})).describe("Every store it has apps in"),apps:Y,best:Ve.extend({app:s.string()}).nullable().describe("Its app with the best place now"),icon:ip}),ap=s.object({chart:s.string(),slug:s.string(),store:s.enum(j),kind:s.string(),title:F,description:O(F),url:s.string()}),Jx=s.object({region:s.string(),status:s.enum(["listed","not_listed","unknown"]),as_of:ne.nullable(),reason:s.enum(["complete","incomplete","missing","stale","unavailable","none"])}),pa=s.object({app:s.string(),slug:Me,name:F,kind:s.enum(Q),publisher:F,short_description:F,launched_at:ne.nullable(),first_seen_at:ne,url:s.string(),store_url:Gx,availability:s.array(Jx),also:s.array(s.object({app:s.string(),slug:np.optional(),kind:s.enum(Q),url:s.string()})).describe("The app's other listings in this store"),linked:s.array(s.object({app:s.string(),slug:np,name:F,short_description:F,kind:s.enum(Q),url:s.string(),evidence:s.array(s.string())})).describe("The app's listings in other stores, with what binds each: server (same MCP server), owner_domain, publisher, store_name, admin, or an agent check"),part_of:s.object({slug:s.string(),name:F,url:s.string()}).nullable().describe("The app this listing belongs to (apps_get); null until binding gives it one"),store:O(s.enum(j)),plugin_id:O(s.string()),version:O(F),last_seen_at:O(ne),icon:O(F),listing:O(Bt),tags:O(nt)}),fv=s.object({region:s.string(),position:Y,as_of:ne.describe("When the position is from")}),gv=Y.nullable().optional(),sp=s.object({chart:s.string(),title:F,kind:s.string(),url:s.string(),regions:Y,best:fv,primary:Y.nullable().describe("Position in the store's main region"),kind_position:Y.nullable().describe("primary among its own kind, in lists that join kinds; else null"),prev_day:gv.describe("kind_position (on lists that join kinds) or primary ~24h earlier; null: not listed then"),prev_week:gv.describe("As prev_day, ~7 days earlier"),day_change:Ze.describe("Cohort change in the main region since ~24h earlier"),week_change:Ze.describe("As day_change, since ~7 days earlier"),positions:O(s.array(fv))}),cp=s.object({name:s.string(),unit:s.string(),basis:s.enum(Pe),reported_at:ne.describe("Latest reported period, including unchanged values"),cadence:s.string(),next_expected_at:ne,stale:s.boolean(),value:s.number().nullable(),t:ne,prev:s.number().nullable(),prev_t:ne.nullable(),points:O(s.array(s.object({t:ne,value:s.number().nullable()})))}),ua=s.object({name:s.string(),title:s.string().optional(),description:s.string(),params:s.array(s.string()),annotations:Bt.optional(),input_schema:O(Bt),output_schema:O(Bt)}),Wx=s.object({name:s.string(),fields:s.array(s.string()).describe("title, description, inputSchema, annotations or outputSchema"),before:O(Bt),after:O(Bt)}),ma=s.object({hash:s.string(),server_version:F,seen_since:ne,seen_until:ne,tool_count:Y}),hv=Y.describe("The server's OpenApps id: /v1/mcp/servers/{id}"),up=s.string().nullable().describe("The OpenApps page of the first app that links this server; null when none does"),lp=s.object({hash:s.string(),server_name:F,server_version:F,protocol_version:F,seen_since:ne.describe("When this toolset first appeared"),seen_until:ne.describe("When it last appeared"),tool_count:Y,prompt_count:Y,resource_count:Y,tools:s.array(ua).optional().describe("Left out when diff_from is given")}),vv=s.object({id:hv,url:s.string(),page:up,status:F,transport:F,checked_at:ne.nullable(),apps:s.array(s.string()).describe("Refs of the apps that link to it, across stores"),snapshot:lp.nullable().describe("The toolset at `at` (latest if omitted); null if never seen without sign-in by then"),diff:s.object({from:s.object({hash:s.string(),seen_since:ne}).nullable().describe("In force at diff_from, else the earliest one (see notes)"),added:s.array(ua),removed:s.array(ua),changed:s.array(Wx)}).nullable().describe("Only with diff_from"),history:O(s.array(ma))}),dp=s.object({id:hv,url:s.string(),status:F,transport:F,auth_hint:F,checked_at:ne.nullable(),snapshot:s.object({hash:s.string(),server_name:F,server_version:F,protocol_version:F,seen_since:ne.nullable(),tool_count:Y,prompt_count:Y,resource_count:Y,tools:s.array(ua)}).nullable().describe("Latest toolset; null if never seen without sign-in"),history:O(s.array(ma))}),Xj=s.object({profiles:s.array(s.object({app:pa,ranks:s.array(sp).optional(),metrics:s.array(cp).optional(),tools:s.array(dp).optional()})),not_found:s.array(s.object({app:s.string(),nearest:s.array(s.string())}))});var it=s.string().nullable(),Je=s.number().int(),Hx=["mcp_host","developer","website","name"],bv=C({name:"apps_get",resource:"apps",path:"/v1/apps/{slug}",summary:"One app across stores: each of its listings' name, kind, publisher, category and best chart place now.",description:"Use for where one app is listed. slug is the app's (apps_list, publishers_get and listing rows' product give it), or a listing ref of one of its listings, which finds the app it is in now. match: how sure the binding between its listings is. tools: each tool or skill name across its listings.",input:s.object({slug:b.slug}),data:s.object({slug:s.string().describe("The app's slug, as its listings' rows carry it in product"),name:it.describe("The name most of its listings carry"),listings:s.array(s.object({store:s.enum(j),app:s.string(),slug:Me,name:it,kind:s.enum(Q),publisher:it,category:_t,best:Ve.nullable(),launched_at:s.string().nullable(),first_seen_at:s.string(),url:s.string(),icon:O(it),charts:Je.describe("Ranked charts that list it now"),countries:s.object({listed:Je,of:Je,missing:s.array(s.string()).optional().describe("The countries that don't list it, by region code; with an account only")}).nullable().describe("ChatGPT: of the countries with current data, how many list it; null elsewhere"),tools:Je.describe("Tools its MCP server lists, else the tool or skill names its listing gives"),mcp:it.describe("Its MCP server's host"),website:it.describe("The website its listing names"),prompts:Je.describe("Starter prompts its listing gives"),changes:Je.describe("Listing changes in the last 30 days"),oa_rank:Je.nullable().describe("Its store's OpenApps Rank; null: uncharted")})).describe("By store, then name"),rank:s.object({method:s.string(),day:s.string(),score:s.number(),rank:Je.describe("Among apps across every store, 1 first"),tier:Je.describe("Best tier of its listings"),tier_title:s.string(),momentum:s.number().nullable().describe("Change over one window")}).nullable().describe("OpenApps Rank across stores (oa_app@2); null when no listing is charted"),match:s.object({confidence:s.enum(["high","medium","low"]).describe("high: three or more signals agree; medium: two; low: one"),evidence:s.array(s.object({kind:s.enum(Hx),value:it.describe("What was compared"),ok:s.boolean().describe("Whether the listings agree on it")})),pairs:O(s.array(s.object({a:s.string(),b:s.string(),state:s.enum(["suggested","bound","rejected"]).describe("bound: strong evidence or a reviewer's yes; rejected: a reviewer's no"),evidence:s.array(s.object({source:s.string(),strong:s.boolean().describe("Binds the pair on its own"),detail:it}))})).describe("Each pair of its listings, by listing ref, that evidence or a review names"))}),tools:s.array(s.object({name:s.string().describe("Lower case, separators as spaces, without the app's name"),apps:s.array(s.string()).describe("The listings that name it, by listing ref"),names:s.array(s.string()).describe("The name each of those listings gives it, in apps' order")})).describe("Most listings first, then A to Z")}),examples:[{title:"Context7 by slug",input:{slug:"context7"}},{title:"The app a listing is in",input:{slug:"claude:notion"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{name:"derived",slug:"derived","listings[].category":"observed","listings[].best":"derived","listings[].launched_at":"derived","listings[].first_seen_at":"observed","listings[].charts":"observed","listings[].countries":"observed","listings[].tools":"observed","listings[].changes":"observed","listings[].oa_rank":"derived","rank.score":"derived","rank.rank":"derived","rank.momentum":"derived","match.confidence":"derived","tools[].name":"derived"}}),yv=C({name:"apps_list",resource:"apps",summary:"Apps listed in more than one store or kind, by name: each one's slug and stores.",description:"Use to find an app's slug for apps_get. query: words in the app's name or slug; without it, the apps listed in most stores first.",input:s.object({query:b.query.optional(),limit:b.limit.default(20)}),data:s.object({total:Je.describe("Apps that match"),rows:s.array(s.object({slug:s.string(),name:it,stores:s.array(s.enum(j)).describe("In store order")}))}),examples:[{title:"Apps named like Notion",input:{query:"notion"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"rows[].name":"derived","rows[].stores":"observed"}});var _v=["name","description","icon","category","publisher","url","keywords"],$v=["release","reviewed_commit"];var cT=Object.fromEntries(j.map(e=>[e,Object.fromEntries(zh(e).flatMap(r=>{let i=Sh(e,r)?.paths;return i?[[r,i]]:[]}))]));var kv=s.union([s.number(),s.string(),s.array(s.unknown()),s.record(s.string(),s.unknown())]).nullable(),qx=s.object({chart:s.string(),title:s.string().nullable(),before:s.number().int().nullable().describe("1-based position at the change; null when the chart didn't list the app then"),after:s.number().int().nullable().describe("1-based position 7 days after the change; null when the chart didn't list the app then")}).describe("Positions count within the app's kind on a list that joins kinds, as best does"),Xx=s.object({type:s.enum(Fn),t:s.string().describe("When it happened: the data run that recorded it, the release time, or when the new toolset was first recorded"),basis:s.enum(Pe).optional().describe("launch: how t is known: store_reported (the store's launch date), derived (decoded from the ChatGPT app id) or observed (the day the app went live); metric_change: how the metric is known"),app:s.string(),slug:Me,name:s.string().nullable(),store:s.enum(j),kind:O(s.enum(Q).nullable()),publisher:O(s.string().nullable()),tags:O(nt),best:Ve.nullable().describe("The app's best place now, as listings_search gives it"),icon:O(s.string().nullable().describe("The app's icon on the OpenApps site")),region:s.string().nullable().describe("null for store-wide events (launch, toolset_change, listing_change, release_change, mcp_status_change, delisted, metric_change)"),field:s.enum([..._v,...$v]).optional().describe("The listing field that changed; release for a build version or gitRef, reviewed_commit for a reviewed repository commit"),prev_t:s.string().nullable().optional().describe("listing_change and release_change: when the version this one replaced was first recorded; null when that isn't known, as for a listing already live when its history began"),rank_impact:qx.nullable().optional().describe("listing_change and release_change, for Pro: the rank at the change and 7 days later on the app's best chart; null for a change under 7 days old or one that chart didn't list the app around"),metric:s.string().optional(),unit:s.string().optional(),chart:s.string().optional(),server:s.string().optional(),before:kv.describe("Earlier position, toolset, listing field value, release or MCP status; null when absent"),after:kv.describe("New position, toolset, listing value (lists for keywords/category), release, or MCP status (open/auth/dead)"),url:s.string()}),wv=C({name:"changes_list",resource:"changes",summary:"A store's changes: ranks, featuring, launches, listings, releases, MCP tools and status, delistings, metrics.",description:`Up to ${Xh} days. listing_change: dated field values; release_change: builds or reviewed commits; mcp_status_change: servers down, needing sign-in or back; delisted: needs complete current catalogs in every reachable region; metric_change: clears per-metric floors, never rank proxies.`,input:s.object({store:b.store,region:b.region.optional(),since:b.since.default("-24h"),apps:b.apps.optional(),types:b.types.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(j),regions:s.array(s.string()),since:s.string(),until:s.string().describe("The newest data in the window"),total:s.number().int(),counts:s.partialRecord(s.enum(Fn),s.number().int()).describe("Events per type over the whole window"),held:s.number().int().optional().describe("Changes in the window the caller's plan holds back, of apps ranked below meta.plan.rank; a listing or release version (the fields one app changed at one time) counts once"),events:s.array(Xx)}),examples:[{title:"ChatGPT US in the last day",input:{store:"chatgpt"}},{title:"Claude moves and toolset changes this week",input:{store:"claude",since:"-7d",types:["rank_move","chart_enter","toolset_change"]}},{title:"Claude listing and server status",input:{store:"claude",types:["listing_change","mcp_status_change","release_change"]}},{title:"One Cursor app",input:{store:"cursor",apps:["cursor:406"],since:"-7d"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:e.region??(e.store==="chatgpt"?"us":null),toolsets:!e.types||e.types.includes("toolset_change")||e.types.includes("mcp_status_change"),countries:"status"})},basis:{"events[].type":"derived","events[].field":"observed","events[].t":"observed","events[].before":"observed","events[].after":"observed",counts:"derived","events[].best":"derived","events[].prev_t":"observed","events[].rank_impact":"derived"}});var xv=C({name:"charts_get",resource:"charts",path:"/v1/charts/{store}/{chart}",summary:"One store chart now or at a past time, with each app's previous position and its position a day earlier.",description:"Use for who ranks where in a store list and who moved, entered or dropped. Positions are 1-based. Not a history: one snapshot, compared with two earlier ones. kinds: only those kinds, ranked among themselves (positions, movement and total count them alone).",input:s.object({store:b.store,chart:b.chart,region:b.region.optional(),at:b.at.optional(),kinds:b.kinds.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({chart:ap,region:s.string(),total:s.number().int().describe("Apps in the list (of the kinds asked)"),dropped:s.number().int().describe("Apps gone since the previous list"),rows:s.array(Er)}),examples:[{title:"Claude's popularity chart now",input:{store:"claude",chart:"popularity"}},{title:"ChatGPT productivity in the US a day ago",input:{store:"chatgpt",chart:"category:productivity",region:"us",at:"-24h"}},{title:"ChatGPT productivity in Germany",input:{store:"chatgpt",chart:"category:productivity",region:"de"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:e.region??null,countries:"unavailable"})},basis:{"rows[].position":"observed","rows[].prev":"observed","rows[].prev_day":"observed","rows[].is_new":"derived","rows[].launched_at":"derived",dropped:"derived","rows[].category":"observed","rows[].linked":"derived","rows[].first_seen_at":"observed","rows[].kind_position":"derived"}}),Sv=C({name:"charts_regions_get",resource:"charts",path:"/v1/charts/{store}/{chart}/regions",summary:"One ChatGPT chart in every country at once: the top apps of the US list with each app's position per country.",description:"Use to compare where a chart differs by country. ChatGPT only (the other stores are one worldwide catalog). Positions are 1-based; null means not in that country's list. Countries the store refuses are left out and named in meta.coverage.",input:s.object({store:b.store,chart:b.chart,limit:b.limit.default(20)}),data:s.object({chart:ap,regions:s.array(s.object({region:s.string(),as_of:s.string().describe("The time of that region's latest list, which its positions come from")})),total:s.number().int().describe("Apps in the list the rows follow"),region_count:s.number().int().describe("Countries with a current list, which listed_in counts against"),rows:s.array(s.object({app:s.string(),slug:Me,name:s.string().nullable(),url:s.string(),icon:O(s.string().nullable()),positions:s.record(s.string(),s.number().int().nullable()),listed_in:s.number().int().describe("How many of those countries list the app")}))}),examples:[{title:"ChatGPT productivity by country",input:{store:"chatgpt",chart:"category:productivity"}}],cache:{kind:"snapshot",scope:()=>({store:"chatgpt",region:null,countries:"unavailable"})},basis:{"rows[].positions":"observed"}});var Iv=C({name:"featuring_get",resource:"featuring",path:"/v1/featuring/{store}",summary:"Every section of a store's home page now, each with its apps and their recent movement.",description:"Use for what a store features on its home page. Positions are 1-based within each section. Claude's one section is its directory's Trending strip.",input:s.object({store:b.store,region:b.region.optional()}),data:s.object({store:s.enum(j),region:s.string(),sections:s.array(s.object({chart:s.string(),slug:s.string(),title:s.string().nullable(),rows:s.array(Er)}))}),examples:[{title:"ChatGPT's home page in the US",input:{store:"chatgpt"}},{title:"ChatGPT in Germany",input:{store:"chatgpt",region:"de"}},{title:"Cursor",input:{store:"cursor"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:e.region??null,countries:"unavailable"})},basis:{"sections[].rows[].position":"observed","sections[].rows[].prev":"observed","sections[].rows[].is_new":"derived"}}),zv=C({name:"featuring_history",resource:"featuring",path:"/v1/featuring/{store}/history",summary:"Featuring intervals per app or shelf, including apps that have left, over a bounded window.",description:"Filter app, shelf or country. Default 24h; max 30 days. baseline: on the shelf when the window starts; first_observed: its earliest entry on record, which may not be its first ever. left=null: no exit on record. A region without data cannot show an exit.",input:s.object({store:b.store,app:b.app.optional(),chart:b.chart.optional(),region:b.region.optional(),since:b.since.default("-24h"),at:b.at.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(j),since:s.string(),until:s.string(),total:s.number().int(),rows:s.array(s.object({app:s.string(),name:s.string().nullable(),chart:s.string(),title:s.string().nullable(),region:s.string(),entered:s.string().nullable(),entered_before_window:s.boolean(),entry_kind:s.enum(["baseline","first_observed","observed_enter"]),left:s.string().nullable(),observed_at:s.string(),url:s.string(),days:O(s.array(s.object({day:s.string().describe("YYYY-MM-DD (UTC)"),position:s.number().int().nullable().describe("The app's slot on the shelf at the day's end; null: not on it")})).describe("Each day of the window with data in the shelf's country, oldest first; a day without data is left out"))}))}),examples:[{title:"ChatGPT featured shelf history",input:{store:"chatgpt",chart:"home:featured",region:"us"}},{title:"One app's featuring history",input:{store:"chatgpt",app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}},{title:"Cursor featuring",input:{store:"cursor"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null,countries:"unavailable"})},basis:{"rows[].entered":"observed","rows[].left":"observed","rows[].observed_at":"observed","rows[].entered_before_window":"derived","rows[].days":"observed"}});var fa=s.number().int(),Rr=s.string(),Pv=C({name:"freshness_get",resource:"freshness",summary:"Our own service monitoring: each store's data status and open issues. It may change.",description:"Use to judge how fresh the data is or why a region is missing. Measured when asked, never cached. With region, adds that region's latest job.",input:s.object({region:b.region.optional()}),data:s.object({status:s.enum(["ok","degraded"]),issues:s.array(s.string()),checked_at:Rr,collector_seen:Rr.nullable().describe("The collector's last poll"),cron:s.object({t:Rr,probe:s.string().nullable()}).nullable(),refused_regions:s.array(s.string()).describe("ChatGPT regions the store refused through every relay in the last day: their catalog data is unavailable"),regions:s.array(ep).describe("Every store and region with data: its latest snapshot and whether it is current, stale or unavailable"),exits_24h:s.array(s.object({provider:s.string().nullable(),tries:fa,blocked:fa,regions:s.array(s.string())})).describe("Tries per relay provider in the last day"),stores:s.array(s.object({store:s.enum(j),runs:fa.describe("Successful runs ever"),last_run:Rr.nullable()})),slots:s.array(s.object({region:s.string(),slot:s.string().describe("UTC date and hour the slot starts, e.g. 2026-10-13T09"),ok:s.boolean(),failed:fa,error:s.string().nullable()})).describe("ChatGPT runs in the last 24 hours, per region and slot"),crawl:s.object({region:s.string(),status:s.string(),requested_at:Rr,claimed_at:Rr.nullable(),error:s.string().nullable()}).nullable().describe("With region: its latest job")}),examples:[{title:"Service status",input:{}},{title:"Germany's latest job",input:{region:"de"}}],cache:{kind:"none"},basis:{status:"derived",issues:"derived","stores[].runs":"observed","slots[].ok":"observed","regions[].as_of":"observed","regions[].status":"derived"}});var Ov=C({name:"leaderboards_get",resource:"leaderboards",path:"/v1/leaderboards/{store}/{metric}",summary:"A store's apps ranked by one metric, labelled by its source basis, such as installs, with the value each replaced.",description:"Use for who leads on installs, popularity score or stars. The metrics a store ranks by are in the stores resource; ChatGPT publishes none. kinds: only apps of these kinds, ranked among themselves; a value qualified by another store is ignored.",input:s.object({store:b.store,metric:b.metric,kinds:b.kinds.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(j),metric:s.string(),unit:s.string(),basis:s.enum(Pe),cadence:s.string(),total:s.number().int().describe("Apps with a value (of the kinds asked)"),rows:s.array(pe.extend({position:s.number().int(),value:s.number(),prev:s.number().nullable(),t:s.string().describe("When the value last changed"),reported_at:s.string(),cadence:s.string(),next_expected_at:s.string(),stale:s.boolean(),prev_t:s.string().nullable()}))}),examples:[{title:"Top 10 Claude plugins by installs",input:{store:"claude",metric:"installs",limit:10}},{title:"cursor.directory by installs",input:{store:"cursor",metric:"dir_installs"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null})},basis:{"rows[].position":"derived","rows[].value":"store_reported","rows[].prev":"store_reported"}});var G=s.number().int(),$t=G.nullable(),ga=s.object({name:s.string(),tools:G,servers:G}),Yx=s.object({n:G,of:G}),Av=C({name:"market_get",resource:"market",summary:"Each store's size and shape: apps per kind, weekly launches over a year, list sizes, and open MCP toolset statistics.",description:"Use for market-level questions: how big a store is, how fast it grows, how MCP servers are built. Not per app; use listings_profile.",input:s.object({store:b.store.optional()}),data:s.object({stores:s.array(s.object({store:s.enum(j),label:s.string(),url:s.string(),apps:G,kinds:s.partialRecord(s.enum(Q),G),last_run:s.string().nullable(),launches:s.object({basis:s.enum(Pe).describe("derived on ChatGPT (decoded from app ids), store_reported on Claude and Cursor"),last_7d:G,weeks:s.array(s.object({week:s.string().describe("Monday the week starts"),n:G})),weekdays:s.array(s.object({day:G.min(0).max(6).describe("0 Monday to 6 Sunday"),n:G})).describe("Every app with a launch date by its weekday: the day its id was created on ChatGPT, the store's launch date elsewhere")}),top10:s.object({frozen:G,of:G}).nullable().describe("Category lists (ChatGPT categories, Claude departments of 10 or more) whose top 10 held the same apps in the same order as the previous day; null on Cursor and Grok Bot"),lists:O(s.array(s.object({chart:s.string(),title:s.string().nullable(),apps:G,collection:s.boolean().describe("A curated collection rather than a category")})).describe("Category lists in the main region, largest first"))})),mcp:s.object({servers:G.describe("MCP servers linked from any store"),by_status:s.array(s.object({status:s.string().nullable(),n:G})),snapshots:G,cross_store:G.describe("Servers linked from apps in more than one store"),url:s.string().describe("The Market pulse page"),open:s.object({servers:G,tools:G,tools_per_server:s.object({median:$t,p90:$t,max:$t,histogram:O(s.array(s.object({bucket:s.string(),n:G})))}),annotations:s.array(ga.extend({tools_true:$t.optional()})).describe("Tools and servers that set each annotation; tools_true: tools setting the hint to true"),output_schema:ga.omit({name:!0}),meta:O(ga.omit({name:!0})),params:s.array(ga).describe("Most common input parameter names"),params_per_tool:s.object({median:$t,p90:$t,none_pct:s.number().nullable(),required_pct:s.number().nullable()}),description_len:s.object({median:$t,p90:$t}),protocols:s.array(s.object({version:s.string(),n:G}))}).describe("Across every open server's latest toolset")}),facts:O(s.object({chatgpt:s.object({apps_sdk:G.describe("Apps SDK apps (family plugin_asdk_app)"),top100:s.object({every:G.describe("Listed in every country with data"),only_us:G.describe("Listed in the United States only"),of:G.describe("Apps in a US top 100 of any category list, collections included"),countries:G.describe("Countries with data")}),shelves_in_order:Yx.describe("US home shelves that are an unbroken run of their category list, of every shelf")}).nullable().describe("null unless ChatGPT is asked for"),claude:s.object({in_most_popular:G.describe("Listings Most popular ranks"),mcp_auth:G.describe("Listings whose MCP server asks for a sign-in (mcp_status auth)"),mcp_status:s.array(s.object({status:s.string(),n:G})).describe("Listings that link an MCP server, by its latest status (the best of several)")}).nullable().describe("null unless Claude is asked for"),products:s.object({n:G.describe("Apps listed in more than one store"),top:s.array(s.string()).describe("The first names, most stores first")})}).describe("Headline numbers for the Stats pages"))}),examples:[{title:"Every store",input:{}},{title:"Cursor",input:{store:"cursor"}}],cache:{kind:"snapshot",scope:()=>({daily:!0})},basis:{"stores[].apps":"observed","stores[].launches.weeks[].n":"derived","stores[].launches.weekdays[].n":"derived","stores[].top10":"derived","mcp.by_status":"observed","mcp.cross_store":"derived","mcp.open":"observed",facts:"derived"}});var jv=C({name:"mcp_toolset_get",resource:"mcp",path:"/v1/mcp/toolsets",summary:"An MCP server's tools at a time, or what changed between two of its toolset versions: tools added, removed and changed.",description:"Use for an app's or a server's toolset now, at a past time, or against an earlier version. Reads OpenApps' stored toolsets, the tools each server lists without a sign-in; it never calls the server.",input:s.object({app:b.app.optional(),server:b.server.optional(),at:b.at.optional(),diff_from:b.diff_from.optional()}),data:s.object({servers:s.array(vv)}),examples:[{title:"Context7's server now",input:{server:"https://mcp.context7.com/mcp"}},{title:"What changed in Context7's tools this week",input:{app:"claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ",diff_from:"-7d"}},{title:"Context7's tools on 1 January 2099",input:{server:"https://mcp.context7.com/mcp",at:"2099-01-01T12:00:00Z"}}],cache:{kind:"snapshot",scope:e=>({store:e.app?bt(e.app).store:null,region:null,toolsets:!0})},basis:{"servers[].status":"observed","servers[].snapshot.tools":"observed","servers[].diff":"derived","servers[].apps":"observed"}}),ha=s.number().int(),Gt=s.string().nullable(),Tv=s.object({id:ha,url:s.string(),page:up,host:Gt,status:Gt,transport:Gt,auth_hint:Gt,checked_at:Gt}),Dv=C({name:"mcp_servers_list",resource:"mcp",path:"/v1/mcp/servers",summary:"The remote MCP servers that store listings link to, open ones first, with tool counts and the apps that link each.",description:"Use to browse or count MCP servers by status or store. For one server's tools, use mcp_servers_get or mcp_toolset_get.",input:s.object({status:b.status.optional(),store:b.store.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({total:ha,rows:s.array(Tv.extend({tool_count:ha.nullable().describe("Tools in its latest toolset; null if never seen without sign-in"),snapshots:ha.describe("Toolset versions seen"),stores:s.array(s.enum(j)),apps:s.array(s.object({app:s.string(),name:Gt,url:s.string()}))}))}),examples:[{title:"Open servers",input:{status:"open"}},{title:"Servers Claude links to",input:{store:"claude"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,toolsets:!0})},basis:{"rows[].status":"observed","rows[].tool_count":"observed","rows[].stores":"observed"}}),Nv=C({name:"mcp_servers_get",resource:"mcp",path:"/v1/mcp/servers/{server}",summary:"One MCP server: its status, the apps that link to it, its latest toolset with every tool, and its toolset history.",description:"Use for everything about one server by id or URL. For its tools at a past time or a diff between versions, use mcp_toolset_get.",input:s.object({server:b.server}),data:s.object({server:Tv.extend({error:Gt.describe("The last check's error")}),apps:s.array(pe),toolset:lp.nullable().describe("Latest toolset; null if never seen without sign-in"),history:s.array(ma)}),examples:[{title:"Context7's server",input:{server:"https://mcp.context7.com/mcp"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null,toolsets:!0})},basis:{"server.status":"observed","toolset.tools":"observed",apps:"observed"}});var Kn=s.string(),Cv=C({name:"movers_list",resource:"movers",path:"/v1/movers/{store}",summary:"What moved in a store's latest data: rank movers in its lead charts, featured-list entries and exits, metric changes.",description:"Use for a store's headlines: who climbed, fell or entered its charts, joined or left a featured list, or changed installs or scores. By default every ranking chart, each product once where it moved most; chart: one chart, every mover. For a span of time, use changes_list.",input:s.object({store:b.store,chart:b.chart.optional(),window:b.window.optional(),max_position:b.max_position.optional(),kinds:b.kinds.optional()}),data:s.object({store:s.enum(j),region:s.string().describe("The store's main region, which movement is measured in"),charts:s.array(s.object({chart:s.string(),slug:s.string(),title:s.string().nullable(),region:s.string(),url:s.string(),week:O(Kn.nullable().describe("window=7d only: the time, ~7 days earlier, of the data the rows are compared with")),rows:s.array(Er).describe("Rows that moved, biggest move up or down first, at most 8 a chart; a product shows once across the charts (with chart: every row)")})),featuring:s.array(s.object({chart:s.string(),slug:s.string(),title:s.string().nullable(),entered:s.array(pe),left:s.array(pe)})).describe("Entries and exits of the store's featured lists in the latest data"),metrics:s.array(s.object({metric:s.string(),title:s.string(),unit:s.string(),basis:s.enum(Pe),rows:s.array(pe.extend({value:s.number(),prev:s.number(),change:s.number(),t:Kn,prev_t:Kn.nullable(),reported_at:Kn,cadence:s.string(),next_expected_at:Kn,stale:s.boolean()})).describe("Apps whose value moved past the noise floor since a week before the metric's latest update, biggest change first; prev 0: new")}))}),examples:[{title:"ChatGPT",input:{store:"chatgpt"}},{title:"Claude",input:{store:"claude"}},{title:"Cursor",input:{store:"cursor"}},{title:"Claude's Most popular over a week, top 50",input:{store:"claude",chart:"popularity",window:"7d",max_position:50}},{title:"Every Claude ranking's top 100",input:{store:"claude",max_position:100}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null,countries:"unavailable"})},basis:{"charts[].rows[].position":"observed","charts[].rows[].prev":"observed","charts[].rows[].is_new":"derived","featuring[].entered":"derived","metrics[].rows[].change":"derived","charts[].rows[].prev_week":"observed","charts[].rows[].linked":"derived","charts[].rows[].kind_position":"derived"}});var Qx=365,Uv=C({name:"new_list",resource:"new",summary:"A store's apps launched since a time, newest first, by launch date (on ChatGPT, when the app's ID was created).",description:`Use for new releases. A ChatGPT app goes live days after its ID is created: sort=first_seen_at orders by go-live day, as the site does. since reaches back at most ${Qx} days. ChatGPT rows carry the app's category. kinds: only those kinds, counted among themselves (total and facets too).`,input:s.object({store:b.store,since:b.since.default("-24h"),sort:b.sort.default("released_at"),limit:b.limit.default(20),cursor:b.cursor.optional(),category:b.category.optional(),kind:b.kind.optional(),kinds:b.kinds.optional()}),data:s.object({store:s.enum(j),since:s.string(),until:s.string().describe("When the newest data is from"),total:s.number().int(),category_observation:s.enum(["available","unavailable","not_applicable"]),unfiltered_total:s.number().int(),rows:s.array(pe.extend({launched_at:O(s.string().nullable()),first_seen_at:s.string(),released_at:s.string().describe("launched_at, or first_seen_at without one"),release_basis:s.enum(Yh).describe("derived: decoded from the ChatGPT app id; observed: the day the app went live"),category:s.string().nullable().describe("First category list it is in (ChatGPT)"),linked:Ur,tags:O(nt),lag_days:s.number().int().nullable().describe("ChatGPT, with Pro (Launch lag): whole days from the app's ID being created to the day it went live; null on other plans, elsewhere or when unknown")})),facets:s.array(s.object({value:s.string(),total:s.number().int()})).describe("Release-window category or kind counts, before selection and pagination.")}),examples:[{title:"ChatGPT this week",input:{store:"chatgpt",since:"-7d"}},{title:"Claude in the last day",input:{store:"claude"}},{title:"ChatGPT apps that went live today",input:{store:"chatgpt",sort:"first_seen_at",limit:5}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null})},basis:{"rows[].launched_at":"derived","rows[].first_seen_at":"observed","rows[].category":"observed","rows[].lag_days":"derived","rows[].linked":"derived","rows[].tags":"derived"}});var Lr=e=>({store:bt(e.app).store,region:null}),Rv=C({name:"listings_search",resource:"listings",summary:"Apps matching the query by name, publisher, brand, tag or what they do, one row per app, exact names first.",description:`Use to find an app's ref from its name, a brand it works with or what it does ("send invoices"). One row per app: its listing that best matches, with its other stores in linked. Ties go to OpenApps Rank.`,input:s.object({query:b.query,publisher:b.publisher.optional(),store:b.store.optional(),kind:b.kind.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({rows:s.array(pe.extend({publisher:s.string().nullable(),best:Ve.nullable(),category:_t,tags:nt,linked:Ur}))}),examples:[{title:"Notion anywhere",input:{query:"notion"}},{title:"Context7 in Cursor",input:{query:"context7",store:"cursor"}},{title:"Linear by its publisher",input:{query:"linear",publisher:"Linear"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null})},basis:{"rows[].name":"observed","rows[].publisher":"observed","rows[].best":"derived","rows[].category":"observed","rows[].tags":"derived","rows[].linked":"derived"}}),ot=s.array(s.object({value:s.string(),n:s.number().int()})),Lv=C({name:"listings_list",resource:"listings",path:"/v1/listings/list",summary:"Listings by store, kind, category, publisher, tags, MCP status, other stores and release; ranked, newest or A to Z.",description:"Use to browse the catalog by filters, e.g. Claude connectors tagged gmail. Each list filter keeps a listing with any of its values. tags: ids from tags_tree, match all or any; exclude leaves tags out. facets count each filter's values under the others. For a name, listings_search.",input:s.object({stores:b.stores.optional(),kinds:b.kinds.optional(),families:b.families.optional(),categories:b.categories.optional(),publishers:b.publishers.optional(),tags:b.tags.optional(),exclude:b.exclude.optional(),match:b.match.default("all"),linked:b.linked.optional(),statuses:b.statuses.optional(),availability:b.availability.optional(),released_since:b.released_since.optional(),query:b.query.optional(),scope:b.scope.optional(),group:b.group.optional(),sort_by:b.sort_by.default("rank"),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({total:s.number().int().describe("Listings every filter keeps; with group=app, apps with one or more of them"),rows:s.array(la.extend({app_rank:s.number().int().nullable().optional().describe("group=app: the app's OpenApps Rank across stores; null: on no counted chart"),ranks:s.array(s.object({store:s.enum(j),rank:s.number().int()})).optional().describe("group=app: its rank in each store's OpenApps Rank, in store order")}).describe("A listing; with group=app, the app's best listing, carrying every tag of its listings")),facets:O(s.object({store:ot,kind:ot.describe("Store-qualified, e.g. claude:connector or chatgpt:apps_sdk"),family:ot,category:ot,publisher:s.array(s.object({value:s.string().describe("Publisher key"),name:s.string(),n:s.number().int()})).describe("The 100 with most listings, then any asked for"),status:ot,linked:ot,availability:ot,released:ot.describe("Listings released in the last 7 and 30 days before the newest data; value is a released_since"),tags:ot.describe("Listings with each tag among those the other filters keep, after exclude and, with match all, every tag asked for")}).describe("Per filter, how many listings each value has among those the other filters keep"))}),examples:[{title:"Every listing, best ranked first",input:{}},{title:"Claude connectors that work with Notion",input:{stores:["claude"],kinds:["connector"],tags:["notion"]}},{title:"Listings of apps on two or more stores, newest first",input:{tags:["multi-store"],sort_by:"new"}}],cache:{kind:"snapshot",scope:e=>({store:e.stores?.length===1?e.stores[0]:null,region:null,toolsets:!0})},basis:{"rows[].best":"derived","rows[].prev_day":"derived","rows[].prev_week":"derived","rows[].countries":"derived","rows[].category":"observed","rows[].tags":"derived","rows[].linked":"derived","rows[].launched_at":"derived","rows[].first_seen_at":"observed","rows[].mcp_status":"observed",facets:"derived"}}),Zv=e=>e.apps?.length?{store:null,region:null}:Lr(e),Mv=C({name:"listings_get",resource:"listings",path:"/v1/listings/{app}",summary:"One listing: name, kind, publisher, description, launch and go-live dates, and its app with the app's other listings.",description:`Use for what a listing is; part_of names its app, linked the app's listings in other stores. The ref may hold the slug. apps: up to ${Vt.plus.compareApps-1} more listings to compare, with Pro. For ranks, metrics or tools, use listings_ranks_current, listings_metrics or listings_tools.`,input:s.object({app:b.app,apps:b.apps.optional()}),data:s.object({app:pa,apps:s.record(s.string(),pa).optional().describe("With apps: each of those listings by its ref, in the order asked, as app is given")}),examples:[{title:"A Claude connector",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae"}},{title:"A listing whose app is in two stores",input:{app:"claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ"}},{title:"A Claude connector by its slug",input:{app:"claude:notion"}}],cache:{kind:"snapshot",scope:e=>({...Zv(e),countries:"status"})},basis:{"app.name":"observed","app.publisher":"observed","app.availability[].status":"derived","app.availability[].as_of":"observed","app.launched_at":"derived","app.first_seen_at":"observed","app.linked":"derived","app.tags":"derived"}}),Vv=C({name:"listings_ranks_current",resource:"listings",path:"/v1/listings/{app}/ranks/current",summary:"Every chart a listing is in now: best position and region, position in the main region, and how many regions list it.",description:"Use for where a listing ranks today. Positions are 1-based, each from its region's latest data (as_of). Countries the store refuses are left out and named in meta.coverage.",input:s.object({app:b.app}),data:s.object({app:s.string(),charts:s.array(sp)}),examples:[{title:"Where a ChatGPT listing ranks",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}}],cache:{kind:"snapshot",scope:e=>({...Lr(e),countries:"unavailable"})},basis:{"charts[].positions[].position":"observed","charts[].positions[].as_of":"observed","charts[].best":"derived","charts[].primary":"observed","charts[].regions":"derived","charts[].kind_position":"derived","charts[].prev_day":"derived","charts[].prev_week":"derived"}}),Fv=C({name:"listings_metrics",resource:"listings",path:"/v1/listings/{app}/metrics",summary:"A listing's latest value of each metric its store publishes, with the value it replaced; each carries its basis.",description:"Use for installs, popularity scores and GitHub stars. Series change-only: t is when the value last changed.",input:s.object({app:b.app}),data:s.object({app:s.string(),metrics:s.array(cp)}),examples:[{title:"Claude installs",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae"}}],cache:{kind:"snapshot",scope:Lr},basis:{"metrics[].t":"observed","metrics[].prev":"observed"}}),Bv=C({name:"listings_tools",resource:"listings",path:"/v1/listings/{app}/tools",summary:"The MCP servers a listing links to, each with its latest tool list.",description:"Use for what a listing's MCP server exposes. Servers that need sign-in have status auth and no snapshot.",input:s.object({app:b.app}),data:s.object({app:s.string(),servers:s.array(dp)}),examples:[{title:"Context7's tools via Claude",input:{app:"claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ"}}],cache:{kind:"snapshot",scope:e=>({...Lr(e),toolsets:!0})},basis:{"servers[].status":"observed","servers[].snapshot.tools":"observed"}}),pp=s.object({url:s.string(),width:s.number().int(),height:s.number().int()}),Gv=C({name:"listings_widgets",resource:"listings",path:"/v1/listings/{app}/widgets",summary:"The widgets a ChatGPT listing's tools show, as images rendered with OpenApps' sample account.",description:"Use for what an app looks like inside ChatGPT. Each widget is one tool's current template, rendered in a browser with input and output a model wrote for a fictional OpenApps account, never a user's data. Images are 720 px wide (mobile 390 px); empty for listings without rendered widgets.",input:s.object({app:b.app}),data:s.object({app:s.string(),widgets:s.array(s.object({tool:s.string(),title:s.string().nullable(),description:s.string().nullable(),template:s.string().describe("The template's resource URI"),since:s.string().describe("Since when the app has used this version of the template"),images:s.object({light:pp,dark:pp,mobile:pp.nullable()})})).describe("In the order the app lists its tools")}),examples:[{title:"Alpha Docs's widgets",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}}],cache:{kind:"snapshot",scope:Lr},basis:{"widgets[].tool":"observed","widgets[].template":"observed","widgets[].images":"derived"}}),Kv=C({name:"listings_ranks_history",resource:"listings",path:"/v1/listings/{app}/ranks",summary:"Rank series of every chart a listing is in now: 14 days or from-to in the chart's home region, the latest elsewhere.",description:`Use for how positions moved. A point is a change (lists are stored on change); a series' last point is carried to its region's latest data, marked carried. apps adds up to ${Vt.plus.rankHistoryApps-1} listings beside app; over ${Vt.out.history.ranks} days back needs a key, more than one listing or over ${Vt.free.history.ranks} days Pro.`,input:s.object({app:b.app,apps:b.apps.optional(),from:b.from.optional(),to:b.to.optional()}),data:s.object({app:s.string(),since:s.string().describe("Start of the home-region window"),until:s.string().nullable().describe("End of the window: to, else the latest data"),series:s.array(s.object({app:s.string().describe("The listing the series is of"),chart:s.string(),title:s.string().nullable(),kind:s.string(),region:s.string(),url:s.string(),points:s.array(s.object({t:s.string().describe("When the position was recorded; a carried point's is the time of the latest data, the list unchanged"),position:s.number().int(),kind_position:s.number().int().nullable().describe("Among its own kind, in lists that join kinds; else null"),carried:s.boolean()}))}))}),examples:[{title:"A ChatGPT listing's ranks",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}},{title:"Two Claude listings over a week",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae",apps:["claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ"],from:"-7d"}}],cache:{kind:"snapshot",scope:e=>({...Zv(e),countries:"unavailable"})},basis:{"series[].points[].position":"observed","series[].points[].kind_position":"derived","series[].points[].t":"observed","series[].points[].carried":"derived"}}),Ev=s.object({hash:s.string(),seen_since:s.string(),seen_until:s.string(),data:O(s.record(s.string(),s.unknown()).describe("The record as the store returned it"))}),Jv=C({name:"listings_versions",resource:"listings",path:"/v1/listings/{app}/versions",summary:"Every version of a store listing and of its detail record, oldest first, each with its date.",description:`Listing and detail versions, stored only when records change. latest=true selects the newest distinct first sighting. Detail history covers ChatGPT, Perplexity and Muse. History over ${Vt.out.history.ranks} days needs a key, ${Vt.free.history.ranks} days Pro; each record's latest shows.`,input:s.object({app:b.app,latest:b.latest.optional()}),data:s.object({app:s.string(),listing:s.array(Ev),detail:s.array(Ev)}),examples:[{title:"A ChatGPT listing's versions",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}}],cache:{kind:"snapshot",scope:Lr},basis:{"listing[].data":"observed","detail[].data":"observed","listing[].seen_since":"observed"}});var We=s.number().int(),Jn=We.nullable().optional().describe("Position on the row's best chart then (best.chart); null: not listed then");var Wv=C({name:"tags_tree",resource:"tags",summary:"Every tag with its facet, parent and app count per store.",description:"Use to find tag ids for listings_list and tags_get. A tag counts every app with a narrower tag too. Use-case (job), works and for tags are per app, cap tags per listing. kinds: count only these kinds, as listings_list filters them.",input:s.object({store:b.store.optional(),kinds:b.kinds.optional()}),data:s.object({version:s.string().describe("The tag vocabulary's version"),tagger:s.string().describe("Methods that assign tags"),tags:s.array(Gn.extend({synonyms:s.array(s.string()).describe("Other names it answers to")})).describe("Vocabulary order: each facet's tree, a tag before the tags under it"),facets:s.array(s.object({facet:da,label:s.string(),hint:s.string(),apps:We.describe("Apps with at least one of its tags")})),stores:s.array(s.object({store:s.enum(j),apps:We.describe("Apps tagged: every app OpenApps has seen in the store, of the kinds asked")}))}),examples:[{title:"Every tag",input:{}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,toolsets:!0})},basis:{"tags[].n":"derived","tags[].stores":"derived","facets[].apps":"derived","stores[].apps":"observed"}}),Hv=C({name:"tags_get",resource:"tags",path:"/v1/tags/{tag}",summary:"One tag: path, narrower tags, counts, top apps per store, related tags.",description:"Use for one tag's apps and neighbours. Old ids answer their successor, else gone. top: per store, best chart place first, limit each. related: tags its apps carry more often than apps at large. kinds: count and list these kinds only.",input:s.object({tag:b.tag,store:b.store.optional(),kinds:b.kinds.optional(),limit:b.limit.default(20)}),data:s.object({tag:Gn,url:s.string().describe("Its page"),top:s.array(la).describe("By store: apps with the tag, best chart place first, at most limit"),kpis:s.object({new_30d:We.describe("Apps with the tag created (ChatGPT: the app's id) or launched in the last 30 days"),with_mcp:s.object({n:We.describe("Claude apps with the tag whose MCP server has a status (listings_list mcp_status)"),of_claude:We.describe("Claude apps with the tag")}),on_both:We.describe("Apps with the tag whose product is listed in another store too")}),weeks:s.array(s.object({week:s.string().describe("The week's Monday, YYYY-MM-DD"),n:We.describe("Apps with the tag created (ChatGPT) or launched that week")})).describe("Every week of the window to the newest data's, oldest first"),path:s.array(s.object({id:s.string(),label:s.string()})).describe("From its top tag down to it"),parent:Gn.nullable(),children:s.array(Gn).describe("Its narrower tags"),siblings:s.array(s.object({id:s.string(),label:s.string(),n:We.describe("Apps carrying it, in the stores asked for")})).describe("Other tags under its parent, in vocabulary order; none for a top tag"),related:s.array(s.object({id:s.string(),label:s.string(),facet:da,n:We.describe("Apps with both tags"),lift:s.number().describe("How many times more often the tag's apps carry it than apps at large")})).describe("At most 10, strongest first, without its ancestors and narrower tags")}),examples:[{title:"Apps that work with Notion",input:{tag:"notion"}},{title:"Developer tools in Claude",input:{tag:"developer-tools",store:"claude",limit:5}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,toolsets:!0})},basis:{"tag.n":"derived","top[].best":"derived","top[].tags":"derived","top[].category":"observed","top[].linked":"derived","top[].prev_day":"observed","top[].prev_week":"observed","kpis.new_30d":"derived","kpis.with_mcp.n":"derived","kpis.on_both":"derived","weeks[].n":"derived","children[].n":"derived","siblings[].n":"derived","related[].n":"derived","related[].lift":"derived"}});var qv=s.string(),Ue=s.number().int(),Xv=s.number().describe("Percent, one decimal"),eS=s.object({app:s.string(),slug:Me,kind:s.enum(Q),name:s.string().nullable(),icon:O(s.string().nullable().describe("The listing's icon on the OpenApps site")),best:Ve,prev_day:Jn,prev_week:Jn,day_change:Ze.describe("Cohort change on best.chart since ~24h earlier"),week_change:Ze.describe("As day_change, since ~7 days earlier")}).nullable().describe("Its listing with the best place now, in the stores asked; null when none ranks"),Yv=C({name:"publishers_list",resource:"publishers",summary:"Publishers across stores, one per publisher key: apps per store, and their app with the best chart place now.",description:"Use to rank developers by how many apps they list or by their best chart position. With store, only publishers with apps there, counted, ranked and pictured by those apps; stores still lists every store. summary: the selection's figures, and how many apps name a publisher.",input:s.object({store:b.store.optional(),publisher:b.publisher.optional(),order:b.order.default("apps"),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({total:Ue.describe("Publishers in the selection"),rows:s.array(op.extend({top:eS,tags:s.array(s.string()).describe("The two tags that describe its listings most often")})),summary:s.object({publishers:Ue.describe("Publishers in the selection"),on_both:Ue.describe("Of them, those with apps in more than one store"),chatgpt_with_developer_pct:Xv.describe("ChatGPT apps whose listing names a developer, percent"),chatgpt_with_developer:Ue,claude_with_publisher_pct:Xv.describe("Claude apps that name a publisher, percent"),claude_with_publisher:Ue})}),examples:[{title:"Publishers with the most apps",input:{}},{title:"Claude publishers by best rank",input:{store:"claude",order:"rank"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null})},basis:{"rows[].name":"derived","rows[].stores":"observed","rows[].apps":"observed","rows[].best":"derived","rows[].top":"derived","rows[].tags":"derived","summary.on_both":"derived","summary.chatgpt_with_developer_pct":"derived","summary.claude_with_publisher_pct":"derived"}}),Qv=C({name:"publishers_get",resource:"publishers",path:"/v1/publishers/{key}",summary:"One publisher's listings in every store, each with its category and best chart place now, and the apps they belong to.",description:"Use for everything one developer lists. key is the publisher key from publishers_list, or any name the publisher lists under (Figma, Inc. or figma); another legal name has its own key. identities: the websites and MCP hosts its listings name, the values with OpenApps Pro, the count with every plan.",input:s.object({key:b.key}),data:s.object({publisher:op,apps:s.array(pe.extend({best:Ve.nullable(),category:_t,launched_at:qv.nullable(),first_seen_at:qv,prev_day:Jn,prev_week:Jn,day_change:Ze.describe("Cohort change on best.chart since ~24h earlier"),week_change:Ze.describe("As day_change, since ~7 days earlier")})).describe("Best place first, then by store and name"),products:s.array(s.object({product:s.string().describe("Same value: same app, within one answer"),slug:s.string().describe("apps_get takes it"),name:s.string().nullable(),listings:s.array(s.object({store:s.enum(j),app:s.string(),url:s.string()}))})).describe("Apps one of its listings belongs to, with every listing of each"),countries:s.object({listed:Ue,of:Ue}).nullable().describe("Its ChatGPT app listed in the most countries: in how many of the countries with current data; null without a ChatGPT app"),shelves:s.object({n:Ue,names:s.array(s.string())}).describe("Its ChatGPT apps on a ChatGPT home shelf now, and their names"),with_mcp:s.object({n:Ue.describe("Claude apps whose MCP server has a status (listings_list mcp_status)"),of_claude:Ue.describe("Its Claude apps")}),identities:s.object({n:Ue.describe("Distinct websites and MCP hosts its listings name"),websites:s.array(s.string()).optional().describe("Website domains; OpenApps Pro only"),hosts:s.array(s.string()).optional().describe("MCP server hosts; OpenApps Pro only")}),others_on_both:s.array(s.object({key:s.string(),name:s.string(),listings:Ue})).describe("Up to 8 other publishers with apps in more than one store, most apps first")}),examples:[{title:"A publisher by key",input:{key:"context7"}},{title:"A publisher by name",input:{key:"Upstash"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"publisher.name":"derived","publisher.best":"derived","apps[].best":"derived","apps[].category":"observed","apps[].launched_at":"derived","apps[].first_seen_at":"observed","apps[].prev_day":"observed","apps[].prev_week":"observed","products[].listings":"derived","countries.listed":"observed","shelves.n":"observed","with_mcp.n":"observed","identities.n":"observed","others_on_both[].listings":"observed"}});var ce=s.number().int(),eb={score:s.number().describe("Mean daily points over the window: 1/position on each counted chart, weighted"),rank:ce.describe("By score among the store's apps, 1 first"),tier:ce.describe("3: top 10 on a counted chart today, 2: top 50, 1: charted within the window"),tier_title:s.string(),days_charted:ce,peak:ce.describe("Best position on a counted chart in the window"),momentum:s.number().nullable().describe("Score minus the previous window's; null until that window has enough days")},tS=pe.extend({...eb,chart_rank:ce.nullable().describe("Rank by score among the apps on the chart asked for"),kind_peak:ce.describe("peak counted among the listing's own kind on a chart that joins kinds (Claude's Most popular and its tag lists, cursor.directory), as chart pages number it; else peak")}),rS=s.object({store:s.enum(j),target:s.string(),day:s.string(),n:ce,rho:s.number().nullable(),half:s.number().nullable()}),nS=s.object({method:s.string(),title:s.string(),window_days:ce,published:s.boolean(),figures:s.record(s.string(),s.string()),validation:s.array(rS).describe("Newest check against each published count: Spearman rho, share on the same side of the median")}),tb=C({name:"scores_list",resource:"scores",path:"/v1/scores/{store}",summary:"A store's apps by OpenApps Rank: a 28-day aggregate of every chart that orders by popularity, with tier and momentum.",description:"Use for who is popular in a store over the last month, not one day's chart. chart narrows to the apps on one chart, ranked among themselves. Derived from store charts, not a usage count.",input:s.object({store:b.store,chart:b.chart.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(j),method:s.string(),day:s.string().nullable().describe("The UTC day the figures are for"),total:ce,rows:s.array(tS)}),examples:[{title:"Top ChatGPT apps by OpenApps Rank",input:{store:"chatgpt",limit:10}},{title:"Within one chart",input:{store:"chatgpt",chart:"category:productivity"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null})},basis:{"rows[].score":"derived","rows[].rank":"derived","rows[].tier":"derived","rows[].momentum":"derived","rows[].chart_rank":"derived","rows[].kind_peak":"derived"}}),rb=C({name:"scores_get",resource:"scores",path:"/v1/scores/{app}",summary:"One app's OpenApps Rank figures, its OpenApps Rank within each chart, and daily score and rank series.",description:"Use for how an app has been doing over the last month and whether it is rising. Apps off every counted chart have no figures (charted: false).",input:s.object({app:b.app}),data:s.object({app:s.string(),method:s.string(),charted:s.boolean(),day:s.string().nullable(),figures:s.object(eb).nullable(),chart_ranks:s.array(s.object({chart:s.string(),rank:ce})).describe("Its OpenApps Rank among the apps scored on each chart, not its position in the chart (listings_ranks_current has those)"),series:O(s.array(s.object({day:s.string(),score:s.number(),rank:ce})))}),examples:[{title:"A Claude connector's rank over time",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae"}}],cache:{kind:"snapshot",scope:e=>({store:bt(e.app).store,region:null})},basis:{"figures.score":"derived","figures.rank":"derived","figures.momentum":"derived","chart_ranks[].rank":"derived","series[].score":"derived"}}),nb=C({name:"scores_methods",resource:"scores",summary:"How OpenApps Rank is computed, which version is published, and how well each version agrees with published counts.",description:"Use to explain or judge the score. Validation pairs a method's scores with counts stores publish (Claude installs and popularity, cursor.directory installs).",input:s.object({}),data:s.object({published:s.string(),methods:s.array(nS)}),examples:[{title:"Methods and their validation",input:{}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"methods[].validation[].rho":"derived","methods[].validation[].half":"derived"}}),ib=s.object({slug:s.string().describe("The app's slug (apps_get)"),name:s.string().nullable(),icon:s.string().nullable().describe("Its best-ranked listing's icon"),score:s.number().describe("Its score under method"),tier:ce.describe("Best tier of its listings"),tier_title:s.string(),momentum:s.number().nullable().describe("Change over one window"),rank:ce.describe("Among apps across every store, 1 first"),listings:s.array(s.object({store:s.enum(j),app:s.string().describe("Listing ref"),rank:ce.describe("The listing's OpenApps Rank in its store")})).describe("Its charted listings")}),iS=ib.extend({rank:ce.describe("Among the apps with the tag"),overall_rank:ce.describe("Rank before the tag filter")}),ob=C({name:"scores_apps",resource:"scores",path:"/v1/scores/apps",summary:"Apps across every store by OpenApps Rank: the sum over stores of 1/rank of each app's best listing there.",description:"Use for who is popular across stores, not in one. By oa_app@2 (scores_methods). kinds keeps only listings of those kinds and ranks each store's kept listings among themselves; without it, every charted listing counts, Cursor's rules included.",input:s.object({kinds:b.kinds.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({method:s.string(),day:s.string().nullable().describe("The UTC day the figures are for"),total:ce,rows:s.array(ib)}),examples:[{title:"Top apps across stores",input:{limit:10}},{title:"Apps only, no Claude plugins or Cursor rules",input:{kinds:["app","claude:connector","cursor:plugin","cursor:directory_mcp","grokbot:plugin"],limit:10}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"rows[].score":"derived","rows[].rank":"derived","rows[].tier":"derived","rows[].momentum":"derived","rows[].listings[].rank":"derived"}}),ab=C({name:"scores_tag",resource:"scores",path:"/v1/scores/tags/{tag}",summary:"Apps with one tag by OpenApps Rank, in one store or all.",description:"Use for the top apps in a category. With store, by the best listing's OpenApps Rank there; without, by oa_app@2 (scores_methods). tag: a v1 domain, use or audience value; a domain counts only as an app's primary.",input:s.object({tag:b.tag,store:b.store.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({tag:s.object({facet:s.string(),value:s.string(),title:s.string()}),store:s.enum(j).nullable(),method:s.string(),day:s.string().nullable().describe("The UTC day the figures are for"),total:ce,rows:s.array(iS)}),examples:[{title:"Video apps",input:{tag:"video"}},{title:"Developer tools on Claude",input:{tag:"developer-tools",store:"claude",limit:10}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null})},basis:{"rows[].score":"derived","rows[].rank":"derived","rows[].overall_rank":"derived","rows[].tier":"derived","rows[].momentum":"derived","rows[].listings[].rank":"derived"}});var sb=C({name:"stores_get",resource:"stores",summary:"The app stores OpenApps tracks: listings per kind, regions, charts and metrics.",description:"Use for which stores, regions, charts and metrics exist and how fresh each region is. Chart names here are what charts_get takes.",input:s.object({store:b.store.optional()}),data:s.object({stores:s.array(s.object({store:s.enum(j),label:s.string(),apps:s.number().int().describe("Listings that are apps: every kind but cursor.directory rules, which kinds still counts"),kinds:s.partialRecord(s.enum(Q),s.number().int()),url:s.string(),last_run:s.string().nullable(),regions:s.array(s.object({region:s.string(),last_run:s.string(),status:s.enum(Qd).describe("Whether the region's latest data can stand for now; unavailable: the store gives no data there now")})),charts:s.array(s.object({chart:s.string(),kind:O(s.string()),title:s.string().nullable(),url:O(s.string()),size:O(s.number().int().nullable().describe("Apps in its latest list in its home region; null before the first"))})).optional(),metrics:s.array(s.object({name:s.string(),unit:s.string(),basis:s.enum(Pe),cadence:s.string().describe("How often it is read: daily or weekly")}))}))}),examples:[{title:"Every store",input:{}},{title:"Claude only",input:{store:"claude"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,countries:"status"})},basis:{"stores[].apps":"observed","stores[].regions[].last_run":"observed","stores[].charts[].size":"observed"}});var mp={changes_list:wv,movers_list:Cv,stores_get:sb,freshness_get:Pv,charts_get:xv,charts_regions_get:Sv,featuring_get:Iv,featuring_history:zv,leaderboards_get:Ov,new_list:Uv,listings_search:Rv,listings_list:Lv,listings_get:Mv,listings_ranks_current:Vv,listings_ranks_history:Kv,listings_metrics:Fv,listings_tools:Bv,listings_widgets:Gv,listings_versions:Jv,apps_get:bv,apps_list:yv,publishers_list:Yv,publishers_get:Qv,tags_tree:Wv,tags_get:Hv,market_get:Av,mcp_toolset_get:jv,mcp_servers_list:Dv,mcp_servers_get:Nv,scores_apps:ob,scores_list:tb,scores_tag:ab,scores_get:rb,scores_methods:nb};var oS=/^\{([a-z_]+)\}$/;function cb(e,r=e.path){let i=r.split("/").filter(Boolean).flatMap(o=>{let t=oS.exec(o)?.[1];if(!t)return[{literal:o}];let n=Qh[t];return n?Object.keys(n.parts).map(a=>({param:t,part:a})):[{param:t}]});return{op:e,segments:i,template:`/${i.map(o=>"literal"in o?o.literal:`{${o.part??o.param}}`).join("/")}`}}var ub=Object.values(mp).map(e=>cb(e));var aS=[["/v1/apps/list","listings_list"],["/v1/apps/{app}","listings_get"],["/v1/apps/{app}/ranks/current","listings_ranks_current"],["/v1/apps/{app}/ranks","listings_ranks_history"],["/v1/apps/{app}/metrics","listings_metrics"],["/v1/apps/{app}/tools","listings_tools"],["/v1/apps/{app}/versions","listings_versions"],["/v1/products","apps_list"],["/v1/products/{slug}","apps_get"]],_N=aS.map(([e,r])=>cb(mp[r],e));var lb=(e,r)=>Wh(e.segments,r,(i,o)=>{throw new Mt("bad_request",o,{param:i})}),fp="OpenApps-Contract";var sS=new Set(["$schema","$id","detailed"]),cS=new Set(["additionalProperties","propertyNames","enum","required"]),uS=new Set(["maxLength","minLength","minItems","maxItems","minimum","maximum","pattern"]),lS=e=>e.detailed===!0,dS=e=>!!e&&typeof e=="object"&&Object.keys(e).length>0;function va(e,r,i){if(Array.isArray(e))return e.map(c=>va(c,r,i));if(!e||typeof e!="object")return e;let o=e,t=r==="output"&&i==="mcp",n=r==="input"&&i==="mcp",a=Object.fromEntries(Object.entries(o).flatMap(([c,u])=>c==="properties"&&u&&typeof u=="object"?[[c,Object.fromEntries(Object.entries(u).flatMap(([l,d])=>t&&lS(d)?[]:[[l,va(d,r,i)]]))]]:sS.has(c)?[]:t&&cS.has(c)&&!(c==="additionalProperties"&&dS(u))?[]:n&&uS.has(c)?[]:r==="output"&&c==="additionalProperties"&&u===!1?[]:c==="propertyNames"&&JSON.stringify(u)==='{"type":"string"}'?[]:c==="pattern"&&"format"in o?[]:c==="maximum"&&u===Number.MAX_SAFE_INTEGER||c==="minimum"&&u===Number.MIN_SAFE_INTEGER?[]:[[c,va(u,r,i)]]));return i==="rest"&&Array.isArray(a.anyOf)?pS(a):a}function pS(e){let{anyOf:r,...i}=e,o=r,t=o.flatMap(a=>[a.type].flat());if(o.some(a=>"$ref"in a||"anyOf"in a||!a.type)||t.some(a=>typeof a!="string")||new Set(t).size!==t.length)return e;let n={};for(let{type:a,...c}of o)for(let[u,l]of Object.entries(c)){if(u in n&&JSON.stringify(n[u])!==JSON.stringify(l))return e;n[u]=l}if(n.enum){if(t.length!==2||!t.includes("null"))return e;n.enum=[...n.enum,null]}return{...i,...n,type:t}}function db(e,r,i){let o=va(s.toJSONSchema(e,{io:r,target:"draft-2020-12"}),r,i);return r==="input"&&i==="mcp"?mS(o):o}function mS(e){let r=e.properties;if(!r)return e;let i=(o,t)=>Object.fromEntries(Object.entries(o).filter(([n])=>n!==t));return{...e,properties:Object.fromEntries(Object.entries(r).map(([o,t])=>{let n=tv[o],a=n===void 0?t.description:n,c=t.items,u=rv.includes(o)?i({...t,...c&&{items:i(c,"enum")}},"enum"):t,l=nv.includes(o)?i(u,"default"):u;return[o,{...i(l,"description"),...a!=null&&{description:a}}]}))}}var fS=/^[\w:.,/@-]+$/,Wn=e=>e.replaceAll("_","-");function gS(e){let r=db(e.input,"input","rest");return Object.entries(r.properties).map(([i,o])=>({key:i,flag:Wn(i),array:o.type==="array",description:o.description??"",...(o.enum??o.items?.enum)&&{allowed:o.enum??o.items.enum},...o.default!==void 0&&{fallback:o.default}}))}var hS=[s.ZodString,s.ZodNumber,s.ZodBoolean,s.ZodEnum],vS=e=>s.globalRegistry.get(e)?.detailed===!0;function bS(e){let r=Object.entries(e.shape).map(([o,t])=>[o,rt(t)]);for(let[o,t]of r)if(t instanceof s.ZodArray&&rt(t.element)instanceof s.ZodObject)return{rows:o,element:rt(t.element)};let i=r.find(([,o])=>o instanceof s.ZodObject);return i?{rows:i[0],element:i[1]}:{rows:null,element:e}}var yS=e=>Object.entries(e.shape).filter(([r,i],o)=>(r!=="url"||o===0)&&!vS(i)&&(hS.some(t=>rt(i)instanceof t)||r==="before"||r==="after")).map(([r])=>r);function _S(e){let r=e.op,{rows:i,element:o}=bS(r.data),t=Object.entries(r.input.shape).filter(([,n])=>!n.safeParse(void 0).success).map(([n])=>n);return{resource:r.resource,verb:Wn(r.name.slice(r.resource.length+1)),op:r,route:e,positionals:t,params:gS(r),rows:i,fields:Object.keys(o.shape),columns:yS(o)}}var Hn=ub.map(_S),pb=(e,r)=>Hn.find(i=>i.resource===e&&i.verb===r);function mb(e,r){let i=t=>{let n=Array.isArray(t)?t.join(","):String(t);return fS.test(n)?n:`'${n.replaceAll("'","'\\''")}'`},o=Object.entries(r).filter(([t])=>!e.positionals.includes(t)).map(([t,n])=>`--${Wn(t)}${i(n).startsWith("-")?"=":" "}${i(n)}`);return["openapps",e.resource,e.verb,...e.positionals.map(t=>i(r[t])),...o].join(" ")}var $S=/[",\n\r]/,ba=["json","table","csv","md"];function fb(e,r){let i=e.rows===null?r.data:r.data[e.rows];return(Array.isArray(i)?i:[i]).filter(o=>!!o&&typeof o=="object")}var kS=e=>e==null?"":typeof e=="object"?JSON.stringify(e):String(e),wS=e=>e.length>60?`${e.slice(0,59)}\u2026`:e,xS=e=>$S.test(e)?`"${e.replaceAll('"','""')}"`:e,SS=e=>e.replaceAll("|","\\|").replaceAll(`
|
|
64
|
+
`));return r}var Ux=new Set(["optional","default","nullable","prefault"]);function rt(e){let r=e;for(;Ux.has(r._zod.def.type)&&r._zod.def.innerType;)r=r._zod.def.innerType;return r}function Ex(e,r,{toolOnly:i}){return Object.entries(r.shape).flatMap(([o,t])=>{if(!Object.hasOwn(b,o)){let a=iv[o]?.[0];return[`${e}: input '${o}' is not in vocab.ts; ${a?`use '${a}', not '${o}'`:"add it to P there, or use a name P already has"}`]}let n=o;return!i&&ev.includes(n)?[`${e}: '${o}' is a tool-only parameter; operations never take it`]:rt(t)!==b[n]?[`${e}: input '${o}' must be P.${o} from vocab.ts (wrapped only in .optional() or .default()), not a schema of its own`]:[]})}function Rx(e,r,i){return Dx.test(r)?[...r.matchAll(Nx)].flatMap(([,o])=>Object.hasOwn(i.shape,o)?i.shape[o].safeParse(void 0).success?[`${e}: path placeholder {${o}} must be a required input`]:[]:[`${e}: path placeholder {${o}} is not an input`]):[`${e}: path '${r}' must be /v1 followed by lowercase segments and {input} placeholders`]}function Lx(e,r){let i=e;for(let o of r.split(".")){let[,t,n]=Cx.exec(o)??[],a=i&&rt(i);if(!t||!(a instanceof s.ZodObject)||!Object.hasOwn(a.shape,t))return;if(i=a.shape[t],n){let c=rt(i);if(!(c instanceof s.ZodArray))return;i=c.element}}return i}var Zx=(e,r,i)=>Object.keys(i).flatMap(o=>Lx(r,o)?[]:[`${e}: basis path '${o}' names no field of the output`]);var O=e=>e.optional().meta({detailed:!0});var ge=(e,r,i,o)=>({facet:"domain",value:e,title:r,description:i,synonyms:o,parent:null}),w=(e,r,i,o,t)=>({facet:"use",value:e,title:i,description:o,synonyms:t,parent:r}),se=(e,r,i,o)=>({facet:"audience",value:e,title:r,description:i,synonyms:o,parent:null}),S=(e,r,i,o)=>({facet:"connects",value:e,title:r,description:`Works with ${r}.`,synonyms:[i],parent:null,site:o}),Bn=[ge("design-media","Design & media","Make or edit images, video, audio, slides, graphics, 3D models and websites.",[]),w("image-generation","design-media","Images & photos","Generate, edit or enhance images, photos, logos and illustrations.",[]),w("video","design-media","Video","Make, edit or publish video.",["Video generation & avatars","Video editing & publishing"]),w("audio-music","design-media","Audio, voice & music","Work with audio, voice and music.",["Music","Voice & speech","Transcription","Podcasts & audiobooks"]),w("presentations","design-media","Presentations & slides","Build slide decks and presentations.",[]),w("graphic-design","design-media","Graphic & UI design","Graphics, branding, mockups, UI design and design systems.",[]),w("3d-cad","design-media","3D & CAD","3D models, CAD and 3D printing.",[]),w("websites","design-media","Websites & landing pages","Build, generate or publish websites and landing pages.",[]),ge("developer-tools","Developer tools & IT","Write, test, ship, run and secure software.",["Security & IT"]),w("code-review","developer-tools","Code review & quality","Review pull requests, lint, refactor and track code quality.",[]),w("testing-qa","developer-tools","Testing & QA","Write and run unit, end-to-end and regression tests.",[]),w("deploy-cloud","developer-tools","Deploy, hosting & infra","Deploy and run software on cloud infrastructure.",["Hosting & deploys","Containers & Kubernetes","IaC & CI/CD","Cloud cost & FinOps"]),w("databases","developer-tools","Databases","Query, manage and migrate databases, including vector stores.",[]),w("apis-sdks","developer-tools","APIs & SDKs","Design, document, test and call APIs; SDKs and webhooks.",[]),w("observability","developer-tools","Debugging & monitoring","Debug errors, read logs and traces, handle incidents.",[]),w("git","developer-tools","Git & version control","Repositories, commits, branches and merge requests.",[]),w("codebase-docs","developer-tools","Code search & docs","Search codebases and read current developer docs.",[]),w("agent-building","developer-tools","Agent building & orchestration","Build, run and evaluate AI agents.",["Multi-agent orchestration","Memory & context","MCP gateways & tooling","Evals & LLM ops"]),w("harness-addons","developer-tools","Coding agent add-ons","Hooks, status lines, commands and session tools for coding agents.",[]),w("coding-conventions","developer-tools","Coding rules & conventions","Rules, style guides and best practices for writing code.",[]),w("mobile-dev","developer-tools","Mobile & Apple platforms","Build iOS, Android and macOS apps.",[]),w("domains-dns","developer-tools","Domains & DNS","Search, register and configure domains and DNS.",[]),w("appsec","developer-tools","AppSec & vulnerabilities","Vulnerabilities, security scans and threat intelligence.",[]),w("identity-access","developer-tools","Identity & access","Identity, single sign-on, passwords and access control.",[]),w("it-ops","developer-tools","IT ops & devices","IT support, device management and networks.",[]),w("agent-guardrails","developer-tools","Agent guardrails & safety","Guardrails, sandboxes and redaction for AI agents.",[]),ge("data-analytics","Data & analytics","Query, analyze and chart data.",[]),w("bi-dashboards","data-analytics","BI & dashboards","Dashboards, KPIs, reporting and business intelligence.",[]),w("warehouses-pipelines","data-analytics","Warehouses & pipelines","Data warehouses, lakes, catalogs and ETL pipelines.",[]),w("spreadsheets","data-analytics","Spreadsheets & CSV","Work with spreadsheets and CSV files.",[]),w("product-analytics","data-analytics","Product & web analytics","Funnels, experiments, feature flags and web traffic.",[]),w("web-data-extraction","data-analytics","Web data extraction","Pull structured data out of web pages and documents.",[]),w("charts-viz","data-analytics","Charts & visualization","Charts, diagrams, flowcharts and whiteboards.",[]),ge("productivity","Productivity & docs","Writing, notes, documents, files, calendars and meetings.",[]),w("writing","productivity","Writing & editing","Write, rewrite, proofread and edit text.",[]),w("notes-knowledge","productivity","Notes & knowledge base","Notes, wikis, bookmarks and team knowledge.",[]),w("documents-pdfs","productivity","Documents & PDFs","Create, edit, sign and manage documents and PDFs.",[]),w("forms-surveys","productivity","Forms & surveys","Build forms, surveys and questionnaires.",[]),w("calendar-scheduling","productivity","Calendar & scheduling","Calendars, appointments and meeting booking.",[]),w("meetings","productivity","Meeting notes & transcripts","Record, transcribe and summarize meetings.",[]),w("files-storage","productivity","Files & storage","Store, share and search files.",[]),w("translation","productivity","Translation","Translate and localize text.",[]),w("ai-assistant-tools","productivity","AI assistant tools","Memory, chat history and export, prompts, skills and usage for the AI assistant you use.",["Chat export","Prompt library","Skills"]),w("personal-assistant","productivity","Personal assistant & memory","Plan the day, remember things and handle life admin.",[]),ge("project-management","Projects & workflows","Plan work, track tasks and automate workflows.",[]),w("tasks","project-management","Tasks & to-dos","To-do lists, checklists and task tracking.",[]),w("issues-sprints","project-management","Issues & sprints","Issue tracking, backlogs, sprints and roadmaps.",[]),w("product-specs","project-management","Product specs & PRDs","Product requirements, specs and user stories.",[]),w("automation","project-management","Automation & workflows","Automate repetitive work across apps.",[]),w("time-tracking","project-management","Time tracking","Track hours and timesheets.",[]),ge("communication","Communication","Email, chat, messaging and calls.",[]),w("email","communication","Email","Read, sort, write and send email.",[]),w("team-chat","communication","Team chat & messaging","Team chat, direct messages and text messages.",[]),w("calls","communication","Calls & video meetings","Phone calls, video calls and dialers.",[]),ge("sales-crm","Sales & customers","Find leads, close deals and support customers.",["Customer support"]),w("crm","sales-crm","CRM","Contacts, accounts and deal pipelines.",[]),w("prospecting","sales-crm","Prospecting & leads","Find, enrich and contact leads.",[]),w("sales-enablement","sales-crm","Sales enablement","Sales calls, coaching, proposals and RFPs.",[]),w("partnerships","sales-crm","Partnerships & affiliates","Partner, affiliate and referral programs.",[]),w("helpdesk","sales-crm","Helpdesk & tickets","Support tickets, live chat and customer conversations.",[]),w("feedback-reviews","sales-crm","Feedback & reviews","Collect and analyze customer feedback and reviews.",[]),w("help-center","sales-crm","Help center & FAQs","Help articles and FAQs.",[]),ge("marketing","Marketing & SEO","Search, ads, social, content, email and brand.",[]),w("seo","marketing","SEO & AI search","Keyword research, search rankings and visibility in AI answers.",[]),w("ads","marketing","Ads & paid media","Plan, run and report on ad campaigns.",[]),w("social-media","marketing","Social media","Post to, schedule and track social media.",[]),w("content-marketing","marketing","Content & copy","Blog posts, content plans and marketing copy.",[]),w("email-marketing","marketing","Email marketing","Newsletters, email campaigns and subscriber lists.",[]),w("brand-intel","marketing","Brand & competitor intel","Track brand mentions, competitors and sentiment.",[]),w("marketing-analytics","marketing","Marketing analytics & attribution","Campaign performance, attribution and marketing data.",[]),w("app-marketing","marketing","App store & product marketing","App store optimization, app rankings and product launches.",[]),ge("finance","Finance & payments","Payments, accounting, tax, investing, banking and insurance.",[]),w("payments-billing","finance","Payments & billing","Take payments, send invoices and manage billing.",[]),w("accounting","finance","Accounting & bookkeeping","Books, expenses, receipts and reconciliation.",[]),w("tax","finance","Tax","Tax returns, VAT and tax filings.",[]),w("investing","finance","Investing & market data","Stocks, market data, filings, portfolios and trading.",[]),w("deals-vc","finance","Deals, M&A & VC","Fundraising, due diligence, data rooms and deal flow.",[]),w("crypto","finance","Crypto & web3","Tokens, wallets, chains and exchanges.",[]),w("banking","finance","Banking & personal finance","Bank accounts, budgets, cards, loans and mortgages.",[]),w("insurance","finance","Insurance","Insurance quotes, policies and underwriting.",[]),w("fpa","finance","FP&A & finance ops","Financial planning, forecasts, cash flow and spend.",[]),ge("commerce","Commerce & shopping","Shopping, online stores and real estate.",[]),w("shopping","commerce","Shopping & deals","Find products, compare prices and get deals.",[]),w("ecommerce-ops","commerce","E-commerce operations","Run online stores: listings, inventory and orders.",[]),w("real-estate","commerce","Real estate","Homes, rentals and property data.",[]),ge("research","Research & search","Search the web, papers, companies and news.",[]),w("web-search","research","Web search","Search the web.",[]),w("academic","research","Academic & scientific","Papers, preprints, clinical trials and scientific data.",[]),w("company-research","research","Company & market research","Company profiles, industries and markets.",[]),w("news","research","News & media","News, headlines and press releases.",[]),w("deep-research","research","Deep research & reports","Long research reports with sources.",[]),ge("travel-places","Travel & places","Flights, stays, transport, trips, maps, weather and events.",[]),w("flights","travel-places","Flights","Search and book flights.",[]),w("hotels","travel-places","Hotels & stays","Hotels, rentals and other places to stay.",[]),w("ground-transport","travel-places","Trains, transit & cars","Trains, buses, transit, car rentals and rides.",[]),w("trip-planning","travel-places","Trip planning & guides","Itineraries, destinations and things to do.",[]),w("maps-local","travel-places","Maps & local","Maps, directions and local places.",[]),w("weather","travel-places","Weather","Weather forecasts and climate data.",[]),w("events-tickets","travel-places","Events & tickets","Concerts, festivals, venues and event tickets.",[]),ge("education","Education & learning","Studying, language learning and teaching.",[]),w("tutoring","education","Students & tutoring","Homework help, tutoring, quizzes and flashcards.",[]),w("language-learning","education","Language learning","Learn a language: vocabulary and pronunciation.",[]),w("teaching","education","Teaching & courses","Lesson plans, courses and classroom tools.",[]),ge("health","Health & wellness","Fitness, nutrition, medicine and mental health.",[]),w("fitness","health","Fitness & running","Workouts, running, cycling and training plans.",[]),w("nutrition","health","Nutrition & diet","Calories, diets and meal plans.",[]),w("medical","health","Medical & clinical","Clinical care, patients, drugs and health records.",[]),w("mental-health","health","Mental health & sleep","Therapy, meditation, journaling and sleep.",["Meditation","Mindfulness"]),ge("lifestyle","Entertainment & lifestyle","Games, entertainment, food, home, sports and relationships.",[]),w("games","lifestyle","Games & puzzles","Games, puzzles and trivia.",[]),w("movies-books","lifestyle","Movies, TV & books","Movies, TV shows, books and reading lists.",[]),w("food-recipes","lifestyle","Food & recipes","Recipes, cooking, restaurants and drinks.",[]),w("home-family","lifestyle","Home, family & pets","Home, family, kids and pets.",[]),w("spirituality","lifestyle","Astrology & spirituality","Astrology, tarot and religion.",[]),w("sports","lifestyle","Sports & betting","Sports scores, fantasy leagues and betting.",[]),w("dating","lifestyle","Dating & relationships","Dating and relationship advice.",[]),ge("business-ops","Business operations","Hiring, legal, logistics, ERP, procurement and small business tools.",["HR & recruiting","Legal & compliance"]),w("recruiting","business-ops","Recruiting & hiring","Source, screen and hire candidates.",[]),w("careers","business-ops","Careers & job search","Resumes, cover letters, job search and interview prep.",[]),w("people-ops","business-ops","People ops & payroll","Payroll, employee records, time off and reviews.",[]),w("contracts","business-ops","Contracts","Draft, review and redline contracts.",[]),w("compliance","business-ops","Compliance & privacy","Regulation, privacy, risk and governance.",[]),w("legal-research","business-ops","Legal research","Case law, statutes, patents and trademarks.",[]),w("logistics","business-ops","Logistics & shipping","Shipping, freight, fleets and supply chains.",[]),w("erp-procurement","business-ops","ERP & procurement","ERP, purchase orders and suppliers.",[]),w("small-business-ops","business-ops","Small business tools","Tools for small businesses, freelancers and field services.",[]),se("for-developers","Developers","Software developers and engineering teams.",[]),se("for-designers","Designers & creators","Designers, artists and content creators.",[]),se("for-marketers","Marketers","Marketers, growth teams and agencies.",[]),se("for-sales","Sales teams","Sales reps and sales teams.",[]),se("for-support","Support teams","Customer support teams.",[]),se("for-product","Product managers","Product managers and product teams.",[]),se("for-data","Data teams & analysts","Data teams, analysts and data scientists.",[]),se("for-finance","Finance teams & accountants","Finance teams, accountants and bookkeepers.",[]),se("for-hr","HR & recruiters","Recruiters, hiring managers and HR teams.",[]),se("for-legal","Legal teams","Lawyers, paralegals and legal teams.",[]),se("for-it-security","IT & security teams","IT admins, security teams and SREs.",[]),se("for-researchers","Researchers & scientists","Researchers, scientists and academics.",[]),se("for-students","Students & educators","Students, learners and educators.",["Teachers","Learners"]),se("for-clinicians","Clinicians & health pros","Doctors, nurses, pharmacists and other health professionals.",[]),se("for-investors","Investors & traders","Investors, traders and portfolio managers.",[]),se("for-small-business","Small business & freelancers","Small businesses, freelancers and founders.",[]),se("for-consumers","Consumers","People using it in their personal life: travel, shopping, health, money and entertainment.",[]),se("for-enterprise","Enterprise","Large organizations.",[]),S("gmail","Gmail","Google Workspace","mail.google.com"),S("google-drive","Google Drive","Google Workspace","drive.google.com"),S("google-calendar","Google Calendar","Google Workspace","calendar.google.com"),S("google-docs","Google Docs","Google Workspace","docs.google.com"),S("google-sheets","Google Sheets","Google Workspace","sheets.google.com"),S("google-slides","Google Slides","Google Workspace","slides.google.com"),S("google-meet","Google Meet","Google Workspace","meet.google.com"),S("google-ads","Google Ads","Google marketing","ads.google.com"),S("google-analytics","Google Analytics","Google marketing","analytics.google.com"),S("search-console","Search Console","Google marketing","search.google.com"),S("youtube","YouTube","Google marketing","youtube.com"),S("google-maps","Google Maps","Google marketing","maps.google.com"),S("outlook","Outlook","Microsoft 365","outlook.live.com"),S("microsoft-teams","Teams","Microsoft 365","teams.microsoft.com"),S("excel","Excel","Microsoft 365","excel.cloud.microsoft"),S("word","Word","Microsoft 365","word.cloud.microsoft"),S("powerpoint","PowerPoint","Microsoft 365","powerpoint.cloud.microsoft"),S("sharepoint-onedrive","SharePoint & OneDrive","Microsoft 365","onedrive.live.com"),S("power-bi","Power BI","Microsoft 365","powerbi.com"),S("dynamics","Dynamics 365","Microsoft 365","dynamics.microsoft.com"),S("jira","Jira","Atlassian","jira.atlassian.com"),S("confluence","Confluence","Atlassian","confluence.atlassian.com"),S("bitbucket","Bitbucket","Atlassian","bitbucket.org"),S("trello","Trello","Atlassian","trello.com"),S("github","GitHub","Code hosting","github.com"),S("gitlab","GitLab","Code hosting","gitlab.com"),S("aws","AWS","Cloud & hosting","aws.amazon.com"),S("google-cloud","Google Cloud","Cloud & hosting","cloud.google.com"),S("azure","Azure","Cloud & hosting","azure.microsoft.com"),S("cloudflare","Cloudflare","Cloud & hosting","cloudflare.com"),S("vercel","Vercel","Cloud & hosting","vercel.com"),S("netlify","Netlify","Cloud & hosting","netlify.com"),S("firebase","Firebase","Cloud & hosting","firebase.google.com"),S("supabase","Supabase","Cloud & hosting","supabase.com"),S("docker-k8s","Docker & Kubernetes","Cloud & hosting","docker.com"),S("postgres","Postgres","Databases & warehouses","postgresql.org"),S("mysql","MySQL","Databases & warehouses","mysql.com"),S("mongodb","MongoDB","Databases & warehouses","mongodb.com"),S("redis","Redis","Databases & warehouses","redis.io"),S("snowflake","Snowflake","Databases & warehouses","snowflake.com"),S("databricks","Databricks","Databases & warehouses","databricks.com"),S("elasticsearch","Elasticsearch","Databases & warehouses","elastic.co"),S("sqlite","SQLite","Databases & warehouses","sqlite.org"),S("sentry","Sentry","Developer services","sentry.io"),S("datadog","Datadog","Developer services","datadoghq.com"),S("postman","Postman","Developer services","postman.com"),S("twilio","Twilio","Developer services","twilio.com"),S("slack","Slack","Chat & meetings","slack.com"),S("discord","Discord","Chat & meetings","discord.com"),S("zoom","Zoom","Chat & meetings","zoom.us"),S("whatsapp","WhatsApp","Chat & meetings","whatsapp.com"),S("telegram","Telegram","Chat & meetings","telegram.org"),S("notion","Notion","Work management","notion.so"),S("linear","Linear","Work management","linear.app"),S("asana","Asana","Work management","asana.com"),S("clickup","ClickUp","Work management","clickup.com"),S("monday","monday.com","Work management","monday.com"),S("airtable","Airtable","Work management","airtable.com"),S("todoist","Todoist","Work management","todoist.com"),S("obsidian","Obsidian","Work management","obsidian.md"),S("dropbox","Dropbox","Work management","dropbox.com"),S("box","Box","Work management","box.com"),S("zapier","Zapier","Work management","zapier.com"),S("calendly","Calendly","Work management","calendly.com"),S("salesforce","Salesforce","CRM & sales tools","salesforce.com"),S("hubspot","HubSpot","CRM & sales tools","hubspot.com"),S("pipedrive","Pipedrive","CRM & sales tools","pipedrive.com"),S("attio","Attio","CRM & sales tools","attio.com"),S("zoho","Zoho","CRM & sales tools","zoho.com"),S("apollo","Apollo","CRM & sales tools","apollo.io"),S("stripe","Stripe","Commerce & payments","stripe.com"),S("shopify","Shopify","Commerce & payments","shopify.com"),S("paypal","PayPal","Commerce & payments","paypal.com"),S("square","Square","Commerce & payments","squareup.com"),S("woocommerce","WooCommerce","Commerce & payments","woocommerce.com"),S("amazon","Amazon","Commerce & payments","amazon.com"),S("quickbooks","QuickBooks","Commerce & payments","quickbooks.intuit.com"),S("xero","Xero","Commerce & payments","xero.com"),S("figma","Figma","Design & web","figma.com"),S("canva","Canva","Design & web","canva.com"),S("adobe","Adobe","Design & web","adobe.com"),S("webflow","Webflow","Design & web","webflow.com"),S("framer","Framer","Design & web","framer.com"),S("wordpress","WordPress","Design & web","wordpress.org"),S("instagram","Instagram","Social networks","instagram.com"),S("tiktok","TikTok","Social networks","tiktok.com"),S("x-twitter","X / Twitter","Social networks","x.com"),S("facebook","Facebook & Meta","Social networks","facebook.com"),S("reddit","Reddit","Social networks","reddit.com"),S("linkedin","LinkedIn","Social networks","linkedin.com"),S("zendesk","Zendesk","Support tools","zendesk.com"),S("intercom","Intercom","Support tools","intercom.com"),S("freshdesk","Freshdesk","Support tools","freshdesk.com"),S("openai-api","OpenAI API","AI models & media APIs","openai.com"),S("gemini","Gemini","AI models & media APIs","gemini.google.com"),S("hugging-face","Hugging Face","AI models & media APIs","huggingface.co"),S("elevenlabs","ElevenLabs","AI models & media APIs","elevenlabs.io"),S("replicate","Replicate","AI models & media APIs","replicate.com")];var lv=[{id:"job",label:"Use case",hint:"What it does"},{id:"works",label:"Works with",hint:"Products and platforms it connects to"},{id:"for",label:"Audience",hint:"Who it is for"},{id:"cap",label:"Capabilities",hint:"Read from listing data, not text"}],E=(e,r,i,o=[])=>({id:e,label:r,description:i,kids:o}),av=e=>({...e,api:!0});function dv(e,r,i=null,o=!1){return r.flatMap(t=>{let n=o||!!t.api;return[{id:t.id,label:t.label,description:t.description,facet:e,parent:i,other:!1,...n?{api:!0}:{}},...dv(e,t.kids,t.id,n)]})}function Mx(e){let r=[],i=new Map;for(let n of e){let a=n.parent===null?void 0:i.get(n.parent);if(i.has(n.id))throw new Error(`duplicate tag id ${n.id}`);if(n.parent!==null&&!a)throw new Error(`tag ${n.id} comes before its parent ${n.parent}`);let c={...n,depth:a?a.depth+1:1,kids:[]};r.push(c),i.set(n.id,c),a?.kids.push(n.id)}let o=new Map(r.map((n,a)=>[n.id,a])),t=n=>{let a=[];for(let c=i.get(n)?.parent??null;c;c=i.get(c)?.parent??null)a.push(c);return a};return{tags:r,node:n=>i.get(n),ancestors:t,withAncestors:n=>{let a=new Set;for(let c of n)if(i.has(c)){a.add(c);for(let u of t(c))a.add(u)}return[...a].sort((c,u)=>o.get(c)-o.get(u))}}}var Vx=[E("cap-kind","Listing type","What the listing is in its store.",[E("kind-chatgpt-app","ChatGPT app","An app in ChatGPT."),E("kind-claude-connector","Claude connector","A connector in Claude."),E("kind-claude-plugin","Claude plugin","A plugin in Claude."),E("kind-cursor-plugin","Cursor plugin","A plugin in the Cursor marketplace."),E("kind-mcp-server","MCP server (cursor.directory)","An MCP server listed on cursor.directory."),E("kind-rule","Rule (cursor.directory)","A rule listed on cursor.directory."),E("kind-claude-extension","Claude desktop extension","A desktop extension in Claude."),E("kind-grokbot-plugin","Grok Bot plugin","A plugin in Grok Bot."),E("kind-grokbot-bot","Grok Bot template","A bot template in Grok Bot's marketplace.")]),E("cap-ui","ChatGPT surface","Whether a ChatGPT app can show its own interface.",[E("apps-sdk","Apps SDK app (can show UI)","Built with the Apps SDK, so it can show its own interface in the chat."),E("connector-only","Connector (no UI)","A connector that returns data to the chat and shows no interface of its own.")]),E("cap-access","Sign-in","Whether it needs you to sign in, and how.",[E("signin-oauth","OAuth sign-in","Asks you to sign in with your account."),E("signin-key","API key or token","Needs an API key or token."),E("signin-open","Open, no sign-in","Its MCP server works without signing in.")]),E("cap-mcp","MCP server","What its MCP server reports.",[E("mcp-remote","Remote MCP (streamable HTTP)","A remote MCP server over streamable HTTP."),E("mcp-sse","SSE transport","A remote MCP server over the older SSE transport."),E("mcp-down","Server down or erroring","Its MCP server is down, blocked or returning errors.")]),E("cap-actions","Tool actions","What its tools do, read from their names and annotations.",[E("writes-data","Writes data (create/update/send)","Has tools that create, change, send or delete things."),E("read-only","Read-only tools","Every tool only reads.")]),E("cap-reach","Reach","Where the listing is available and promoted.",[E("multi-store","On 2+ stores","The same product is listed in two or more stores."),E("all-stores","On 3+ stores","The same product is listed in three or more stores."),E("geo-restricted","Missing in some countries","Missing from the ChatGPT directory in some countries."),E("worldwide","Listed in every country","Listed in the ChatGPT directory in every country we cover."),E("on-shelf","On a home shelf now","On one of its store's home shelves now.")]),E("cap-age","Age","When the listing was created.",[E("new-30d","Created in the last 30 days","Created in the last 30 days, by the listing's own creation date."),E("new-7d","Created in the last 7 days","Created in the last 7 days, by the listing's own creation date.")]),av(E("cap-form","Form","What the listing is across stores, read from what it holds (an MCP server makes it an integration).",[E("form-integration","Integration","Reaches a service through a server it runs: an MCP server, an LSP server or a CLI."),E("form-instruction","Instruction","Text the assistant follows: rules, skills, commands, subagents or hooks, and no server."),E("form-agent","Agent","A ready-made assistant: a Grok Bot template.")])),av(E("cap-parts","Parts","What the listing holds, as its store's records list it.",[E("has-skills","Skills","Holds one or more skills."),E("has-rules","Rules","Holds one or more rules."),E("has-commands","Commands","Holds one or more commands."),E("has-agents","Subagents","Holds one or more subagents."),E("has-hooks","Hooks","Holds one or more hooks.")])),E("cap-review","Store review","How its store vetted the listing.",[E("community","Community listing","In the community tier of Claude's directory, which records no review of the listing by Anthropic or a partner.")])],pv={"Google Workspace":"google-workspace","Google marketing":"google-marketing","Microsoft 365":"microsoft-365",Atlassian:"atlassian","Code hosting":"code-hosts","Cloud & hosting":"clouds","Databases & warehouses":"data-stores","Developer services":"dev-services","Chat & meetings":"chat-apps","Work management":"work-apps","CRM & sales tools":"crm-tools","Commerce & payments":"commerce-tools","Design & web":"design-tools","Social networks":"social-networks","Support tools":"support-tools","AI models & media APIs":"ai-models"},Fx={domain:"job",use:"job",connects:"works",audience:"for"},sv=Bn.filter(e=>e.facet==="connects"),cv=e=>{let r=pv[e.synonyms[0]];if(!r)throw new Error(`brand ${e.value} names no known group`);return r},Bx=[...new Set(sv.map(cv))].flatMap(e=>{let r=sv.filter(o=>cv(o)===e),i=r[0].synonyms[0];return[{id:e,label:i,description:`Works with ${r.slice(0,-1).map(o=>o.title).join(", ")} or ${r.at(-1).title}.`,facet:"works",parent:null,other:!1},...r.map(o=>({id:o.value,label:o.title,description:o.description,facet:"works",parent:e,other:!1,site:o.site}))]}),uv=Bn.filter(e=>e.facet!=="connects").map(e=>({id:e.value,label:e.title,description:e.description,facet:Fx[e.facet],parent:e.parent,other:!1})),tp=Mx([...uv.filter(e=>e.facet==="job"),...Bx,...uv.filter(e=>e.facet==="for"),...dv("cap",Vx)]),rp=tp.tags,Rj=rp.map(e=>e.id),Lj=new Map(rp.map(e=>[e.id,e])),Zj=new Map(rp.map((e,r)=>[e.id,r])),Mj=new Map([...Bn.map(e=>[e.value,e.facet]),...Object.values(pv).map(e=>[e,"connects"])]);var Vj=new Map(Bn.filter(e=>e.facet!=="connects").map(e=>[e.value,e.synonyms]));var Fj=tp.ancestors;var Bj=tp.withAncestors;var Y=s.number().int(),ne=s.string(),F=s.string().nullable(),Bt=s.record(s.string(),s.unknown()),ip=O(F.describe("The app's icon on the OpenApps site")),Me=s.string().nullable().describe("Unique in its store; listings_get takes it"),Gx=F.describe("The app's page in the store"),pe=s.object({app:s.string(),slug:Me,name:F,kind:s.enum(Q),store:s.enum(j),url:s.string(),short_description:F,publisher:O(F),icon:ip,product:O(s.string().nullable().describe("Same value: same product, within one answer"))}),_t=F.describe("The app's store category, e.g. Productivity"),np=s.string().nullable(),Ur=s.array(s.object({store:s.enum(j),app:s.string(),slug:np,kind:s.enum(Q),url:s.string()})).describe("The product's apps in other stores"),Ve=s.object({chart:s.string(),title:F,position:Y.describe("1-based; among the app's kind when kind is set"),kind:s.string().nullable()}).describe("Best place now: the main ranking if it lists the app, else the best other"),nt=s.array(s.string()).describe("Tag ids it carries now, ancestors included, in tags_tree order"),mv=Y.nullable().optional(),Ze=Y.nullable().optional(),la=pe.extend({best:Ve.nullable(),category:_t,tags:nt,linked:Ur,prev_day:mv.describe("best.position ~24h earlier; null: not listed then"),prev_week:mv.describe("As prev_day, ~7 days earlier"),day_change:Ze.describe("Cohort change on best.chart since ~24h earlier"),week_change:Ze.describe("As day_change, since ~7 days earlier"),countries:s.object({listed:Y,of:Y}).optional().describe("ChatGPT: countries whose directory lists it, of those with complete data"),launched_at:O(ne.nullable()),first_seen_at:O(ne),mcp_status:O(F.describe("Status of the first MCP server it links"))}),Er=s.object({position:Y,app:s.string(),slug:Me,name:F,url:s.string(),prev:Y.nullable(),prev_day:Y.nullable(),is_new:s.boolean(),kind:O(s.enum(Q)),publisher:O(F),short_description:O(F),launched_at:O(ne.nullable()),listing:O(Bt.describe("Store-specific listing fields, e.g. Claude tier and surfaces")),icon:ip,product:O(s.string().nullable().describe("Same value: same product, within one answer")),category:_t,linked:Ur,prev_week:O(Y.nullable().describe("Position ~7 days earlier: charts_get on the latest run, and movers_list with window=7d")),day_change:Ze.describe("Cohort change since ~24h earlier: what the site's change pill shows"),week_change:O(Ze.describe("As day_change, since ~7 days earlier: charts_get on the latest run, and movers_list with window=7d")),first_seen_at:O(ne),kind_position:O(Y.nullable().describe("Position among the list's apps of the same kind, in lists that join kinds (Claude's Most popular); else null")),tags:O(nt)}),Kx=s.partialRecord(s.enum(j),Y).describe("Apps carrying it per store"),da=s.enum(lv.map(e=>e.id)),Gn=s.object({id:s.string(),label:s.string(),facet:da,parent:F.describe("The tag one level up; null for a top tag"),depth:Y.describe("1 for a top tag"),other:s.boolean().describe("An 'X: Other' tag: in its parent, in none of the parent's narrower tags"),n:Y.describe("Apps carrying it, in the stores asked for"),stores:Kx,description:O(s.string()),icon:s.string().optional().describe("A brand's mark on the OpenApps site: its website's favicon")}),op=s.object({key:s.string().describe("Publisher key: publishers_get takes it"),name:s.string().describe("The name most of its apps carry"),stores:s.array(s.object({store:s.enum(j),apps:Y})).describe("Every store it has apps in"),apps:Y,best:Ve.extend({app:s.string()}).nullable().describe("Its app with the best place now"),icon:ip}),ap=s.object({chart:s.string(),slug:s.string(),store:s.enum(j),kind:s.string(),title:F,description:O(F),url:s.string()}),Jx=s.object({region:s.string(),status:s.enum(["listed","not_listed","unknown"]),as_of:ne.nullable(),reason:s.enum(["complete","incomplete","missing","stale","unavailable","none"])}),pa=s.object({app:s.string(),slug:Me,name:F,kind:s.enum(Q),publisher:F,short_description:F,launched_at:ne.nullable(),first_seen_at:ne,url:s.string(),store_url:Gx,availability:s.array(Jx),also:s.array(s.object({app:s.string(),slug:np.optional(),kind:s.enum(Q),url:s.string()})).describe("The app's other listings in this store"),linked:s.array(s.object({app:s.string(),slug:np,name:F,short_description:F,kind:s.enum(Q),url:s.string(),evidence:s.array(s.string())})).describe("The app's listings in other stores, with what binds each: server (same MCP server), owner_domain, publisher, store_name, admin, or an agent check"),part_of:s.object({slug:s.string(),name:F,url:s.string()}).nullable().describe("The app this listing belongs to (apps_get); null until binding gives it one"),store:O(s.enum(j)),plugin_id:O(s.string()),version:O(F),last_seen_at:O(ne),icon:O(F),listing:O(Bt),tags:O(nt)}),fv=s.object({region:s.string(),position:Y,as_of:ne.describe("When the position is from")}),gv=Y.nullable().optional(),sp=s.object({chart:s.string(),title:F,kind:s.string(),url:s.string(),regions:Y,best:fv,primary:Y.nullable().describe("Position in the store's main region"),kind_position:Y.nullable().describe("primary among its own kind, in lists that join kinds; else null"),prev_day:gv.describe("kind_position (on lists that join kinds) or primary ~24h earlier; null: not listed then"),prev_week:gv.describe("As prev_day, ~7 days earlier"),day_change:Ze.describe("Cohort change in the main region since ~24h earlier"),week_change:Ze.describe("As day_change, since ~7 days earlier"),positions:O(s.array(fv))}),cp=s.object({name:s.string(),unit:s.string(),basis:s.enum(Pe),reported_at:ne.describe("Latest reported period, including unchanged values"),cadence:s.string(),next_expected_at:ne,stale:s.boolean(),value:s.number().nullable(),t:ne,prev:s.number().nullable(),prev_t:ne.nullable(),points:O(s.array(s.object({t:ne,value:s.number().nullable()})))}),ua=s.object({name:s.string(),title:s.string().optional(),description:s.string(),params:s.array(s.string()),annotations:Bt.optional(),input_schema:O(Bt),output_schema:O(Bt)}),Wx=s.object({name:s.string(),fields:s.array(s.string()).describe("title, description, inputSchema, annotations or outputSchema"),before:O(Bt),after:O(Bt)}),ma=s.object({hash:s.string(),server_version:F,seen_since:ne,seen_until:ne,tool_count:Y}),hv=Y.describe("The server's OpenApps id: /v1/mcp/servers/{id}"),up=s.string().nullable().describe("The OpenApps page of the first app that links this server; null when none does"),lp=s.object({hash:s.string(),server_name:F,server_version:F,protocol_version:F,seen_since:ne.describe("When this toolset first appeared"),seen_until:ne.describe("When it last appeared"),tool_count:Y,prompt_count:Y,resource_count:Y,tools:s.array(ua).optional().describe("Left out when diff_from is given")}),vv=s.object({id:hv,url:s.string(),page:up,status:F,transport:F,checked_at:ne.nullable(),apps:s.array(s.string()).describe("Refs of the apps that link to it, across stores"),snapshot:lp.nullable().describe("The toolset at `at` (latest if omitted); null if never seen without sign-in by then"),diff:s.object({from:s.object({hash:s.string(),seen_since:ne}).nullable().describe("In force at diff_from, else the earliest one (see notes)"),added:s.array(ua),removed:s.array(ua),changed:s.array(Wx)}).nullable().describe("Only with diff_from"),history:O(s.array(ma))}),dp=s.object({id:hv,url:s.string(),status:F,transport:F,auth_hint:F,checked_at:ne.nullable(),snapshot:s.object({hash:s.string(),server_name:F,server_version:F,protocol_version:F,seen_since:ne.nullable(),tool_count:Y,prompt_count:Y,resource_count:Y,tools:s.array(ua)}).nullable().describe("Latest toolset; null if never seen without sign-in"),history:O(s.array(ma))}),Xj=s.object({profiles:s.array(s.object({app:pa,ranks:s.array(sp).optional(),metrics:s.array(cp).optional(),tools:s.array(dp).optional()})),not_found:s.array(s.object({app:s.string(),nearest:s.array(s.string())}))});var it=s.string().nullable(),Je=s.number().int(),Hx=["mcp_host","developer","website","name"],bv=C({name:"apps_get",resource:"apps",path:"/v1/apps/{slug}",summary:"One app across stores: each of its listings' name, kind, publisher, category and best chart place now.",description:"Use for where one app is listed. slug is the app's (apps_list, publishers_get and listing rows' product give it), or a listing ref of one of its listings, which finds the app it is in now. match: how sure the binding between its listings is. tools: each tool or skill name across its listings.",input:s.object({slug:b.slug}),data:s.object({slug:s.string().describe("The app's slug, as its listings' rows carry it in product"),name:it.describe("The name most of its listings carry"),listings:s.array(s.object({store:s.enum(j),app:s.string(),slug:Me,name:it,kind:s.enum(Q),publisher:it,category:_t,best:Ve.nullable(),launched_at:s.string().nullable(),first_seen_at:s.string(),url:s.string(),icon:O(it),charts:Je.describe("Ranked charts that list it now"),countries:s.object({listed:Je,of:Je,missing:s.array(s.string()).optional().describe("The countries that don't list it, by region code; with an account only")}).nullable().describe("ChatGPT: of the countries with current data, how many list it; null elsewhere"),tools:Je.describe("Tools its MCP server lists, else the tool or skill names its listing gives"),mcp:it.describe("Its MCP server's host"),website:it.describe("The website its listing names"),prompts:Je.describe("Starter prompts its listing gives"),changes:Je.describe("Listing changes in the last 30 days"),oa_rank:Je.nullable().describe("Its store's OpenApps Rank; null: uncharted")})).describe("By store, then name"),rank:s.object({method:s.string(),day:s.string(),score:s.number(),rank:Je.describe("Among apps across every store, 1 first"),tier:Je.describe("Best tier of its listings"),tier_title:s.string(),momentum:s.number().nullable().describe("Change over one window")}).nullable().describe("OpenApps Rank across stores (oa_app@2); null when no listing is charted"),match:s.object({confidence:s.enum(["high","medium","low"]).describe("high: three or more signals agree; medium: two; low: one"),evidence:s.array(s.object({kind:s.enum(Hx),value:it.describe("What was compared"),ok:s.boolean().describe("Whether the listings agree on it")})),pairs:O(s.array(s.object({a:s.string(),b:s.string(),state:s.enum(["suggested","bound","rejected"]).describe("bound: strong evidence or a reviewer's yes; rejected: a reviewer's no"),evidence:s.array(s.object({source:s.string(),strong:s.boolean().describe("Binds the pair on its own"),detail:it}))})).describe("Each pair of its listings, by listing ref, that evidence or a review names"))}),tools:s.array(s.object({name:s.string().describe("Lower case, separators as spaces, without the app's name"),apps:s.array(s.string()).describe("The listings that name it, by listing ref"),names:s.array(s.string()).describe("The name each of those listings gives it, in apps' order")})).describe("Most listings first, then A to Z")}),examples:[{title:"Context7 by slug",input:{slug:"context7"}},{title:"The app a listing is in",input:{slug:"claude:notion"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{name:"derived",slug:"derived","listings[].category":"observed","listings[].best":"derived","listings[].launched_at":"derived","listings[].first_seen_at":"observed","listings[].charts":"observed","listings[].countries":"observed","listings[].tools":"observed","listings[].changes":"observed","listings[].oa_rank":"derived","rank.score":"derived","rank.rank":"derived","rank.momentum":"derived","match.confidence":"derived","tools[].name":"derived"}}),yv=C({name:"apps_list",resource:"apps",summary:"Apps listed in more than one store or kind, by name: each one's slug and stores.",description:"Use to find an app's slug for apps_get. query: words in the app's name or slug; without it, the apps listed in most stores first.",input:s.object({query:b.query.optional(),limit:b.limit.default(20)}),data:s.object({total:Je.describe("Apps that match"),rows:s.array(s.object({slug:s.string(),name:it,stores:s.array(s.enum(j)).describe("In store order")}))}),examples:[{title:"Apps named like Notion",input:{query:"notion"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"rows[].name":"derived","rows[].stores":"observed"}});var _v=["name","description","icon","category","publisher","url","keywords"],$v=["release","reviewed_commit"];var cT=Object.fromEntries(j.map(e=>[e,Object.fromEntries(zh(e).flatMap(r=>{let i=Sh(e,r)?.paths;return i?[[r,i]]:[]}))]));var kv=s.union([s.number(),s.string(),s.array(s.unknown()),s.record(s.string(),s.unknown())]).nullable(),qx=s.object({chart:s.string(),title:s.string().nullable(),before:s.number().int().nullable().describe("1-based position at the change; null when the chart didn't list the app then"),after:s.number().int().nullable().describe("1-based position 7 days after the change; null when the chart didn't list the app then")}).describe("Positions count within the app's kind on a list that joins kinds, as best does"),Xx=s.object({type:s.enum(Fn),t:s.string().describe("When it happened: the data run that recorded it, the release time, or when the new toolset was first recorded"),basis:s.enum(Pe).optional().describe("launch: how t is known: store_reported (the store's launch date), derived (decoded from the ChatGPT app id) or observed (the day the app went live); metric_change: how the metric is known"),app:s.string(),slug:Me,name:s.string().nullable(),store:s.enum(j),kind:O(s.enum(Q).nullable()),publisher:O(s.string().nullable()),tags:O(nt),best:Ve.nullable().describe("The app's best place now, as listings_search gives it"),icon:O(s.string().nullable().describe("The app's icon on the OpenApps site")),region:s.string().nullable().describe("null for store-wide events (launch, toolset_change, listing_change, release_change, mcp_status_change, delisted, metric_change)"),field:s.enum([..._v,...$v]).optional().describe("The listing field that changed; release for a build version or gitRef, reviewed_commit for a reviewed repository commit"),prev_t:s.string().nullable().optional().describe("listing_change and release_change: when the version this one replaced was first recorded; null when that isn't known, as for a listing already live when its history began"),rank_impact:qx.nullable().optional().describe("listing_change and release_change, for Pro: the rank at the change and 7 days later on the app's best chart; null for a change under 7 days old or one that chart didn't list the app around"),metric:s.string().optional(),unit:s.string().optional(),chart:s.string().optional(),server:s.string().optional(),before:kv.describe("Earlier position, toolset, listing field value, release or MCP status; null when absent"),after:kv.describe("New position, toolset, listing value (lists for keywords/category), release, or MCP status (open/auth/dead)"),url:s.string()}),wv=C({name:"changes_list",resource:"changes",summary:"A store's changes: ranks, featuring, launches, listings, releases, MCP tools and status, delistings, metrics.",description:`Up to ${Xh} days. listing_change: dated field values; release_change: builds or reviewed commits; mcp_status_change: servers down, needing sign-in or back; delisted: needs complete current catalogs in every reachable region; metric_change: clears per-metric floors, never rank proxies.`,input:s.object({store:b.store,region:b.region.optional(),since:b.since.default("-24h"),apps:b.apps.optional(),types:b.types.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(j),regions:s.array(s.string()),since:s.string(),until:s.string().describe("The newest data in the window"),total:s.number().int(),counts:s.partialRecord(s.enum(Fn),s.number().int()).describe("Events per type over the whole window"),held:s.number().int().optional().describe("Changes in the window the caller's plan holds back, of apps ranked below meta.plan.rank; a listing or release version (the fields one app changed at one time) counts once"),events:s.array(Xx)}),examples:[{title:"ChatGPT US in the last day",input:{store:"chatgpt"}},{title:"Claude moves and toolset changes this week",input:{store:"claude",since:"-7d",types:["rank_move","chart_enter","toolset_change"]}},{title:"Claude listing and server status",input:{store:"claude",types:["listing_change","mcp_status_change","release_change"]}},{title:"One Cursor app",input:{store:"cursor",apps:["cursor:406"],since:"-7d"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:e.region??(e.store==="chatgpt"?"us":null),toolsets:!e.types||e.types.includes("toolset_change")||e.types.includes("mcp_status_change"),countries:"status"})},basis:{"events[].type":"derived","events[].field":"observed","events[].t":"observed","events[].before":"observed","events[].after":"observed",counts:"derived","events[].best":"derived","events[].prev_t":"observed","events[].rank_impact":"derived"}});var xv=C({name:"charts_get",resource:"charts",path:"/v1/charts/{store}/{chart}",summary:"One store chart now or at a past time, with each app's previous position and its position a day earlier.",description:"Use for who ranks where in a store list and who moved, entered or dropped. Positions are 1-based. Not a history: one snapshot, compared with two earlier ones. kinds: only those kinds, ranked among themselves (positions, movement and total count them alone).",input:s.object({store:b.store,chart:b.chart,region:b.region.optional(),at:b.at.optional(),kinds:b.kinds.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({chart:ap,region:s.string(),total:s.number().int().describe("Apps in the list (of the kinds asked)"),dropped:s.number().int().describe("Apps gone since the previous list"),rows:s.array(Er)}),examples:[{title:"Claude's popularity chart now",input:{store:"claude",chart:"popularity"}},{title:"ChatGPT productivity in the US a day ago",input:{store:"chatgpt",chart:"category:productivity",region:"us",at:"-24h"}},{title:"ChatGPT productivity in Germany",input:{store:"chatgpt",chart:"category:productivity",region:"de"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:e.region??null,countries:"unavailable"})},basis:{"rows[].position":"observed","rows[].prev":"observed","rows[].prev_day":"observed","rows[].is_new":"derived","rows[].launched_at":"derived",dropped:"derived","rows[].category":"observed","rows[].linked":"derived","rows[].first_seen_at":"observed","rows[].kind_position":"derived"}}),Sv=C({name:"charts_regions_get",resource:"charts",path:"/v1/charts/{store}/{chart}/regions",summary:"One ChatGPT chart in every country at once: the top apps of the US list with each app's position per country.",description:"Use to compare where a chart differs by country. ChatGPT only (the other stores are one worldwide catalog). Positions are 1-based; null means not in that country's list. Countries the store refuses are left out and named in meta.coverage.",input:s.object({store:b.store,chart:b.chart,limit:b.limit.default(20)}),data:s.object({chart:ap,regions:s.array(s.object({region:s.string(),as_of:s.string().describe("The time of that region's latest list, which its positions come from")})),total:s.number().int().describe("Apps in the list the rows follow"),region_count:s.number().int().describe("Countries with a current list, which listed_in counts against"),rows:s.array(s.object({app:s.string(),slug:Me,name:s.string().nullable(),url:s.string(),icon:O(s.string().nullable()),positions:s.record(s.string(),s.number().int().nullable()),listed_in:s.number().int().describe("How many of those countries list the app")}))}),examples:[{title:"ChatGPT productivity by country",input:{store:"chatgpt",chart:"category:productivity"}}],cache:{kind:"snapshot",scope:()=>({store:"chatgpt",region:null,countries:"unavailable"})},basis:{"rows[].positions":"observed"}});var Iv=C({name:"featuring_get",resource:"featuring",path:"/v1/featuring/{store}",summary:"Every section of a store's home page now, each with its apps and their recent movement.",description:"Use for what a store features on its home page. Positions are 1-based within each section. Claude's one section is its directory's Trending strip.",input:s.object({store:b.store,region:b.region.optional()}),data:s.object({store:s.enum(j),region:s.string(),sections:s.array(s.object({chart:s.string(),slug:s.string(),title:s.string().nullable(),rows:s.array(Er)}))}),examples:[{title:"ChatGPT's home page in the US",input:{store:"chatgpt"}},{title:"ChatGPT in Germany",input:{store:"chatgpt",region:"de"}},{title:"Cursor",input:{store:"cursor"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:e.region??null,countries:"unavailable"})},basis:{"sections[].rows[].position":"observed","sections[].rows[].prev":"observed","sections[].rows[].is_new":"derived"}}),zv=C({name:"featuring_history",resource:"featuring",path:"/v1/featuring/{store}/history",summary:"Featuring intervals per app or shelf, including apps that have left, over a bounded window.",description:"Filter app, shelf or country. Default 24h; max 30 days. baseline: on the shelf when the window starts; first_observed: its earliest entry on record, which may not be its first ever. left=null: no exit on record. A region without data cannot show an exit.",input:s.object({store:b.store,app:b.app.optional(),chart:b.chart.optional(),region:b.region.optional(),since:b.since.default("-24h"),at:b.at.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(j),since:s.string(),until:s.string(),total:s.number().int(),rows:s.array(s.object({app:s.string(),name:s.string().nullable(),chart:s.string(),title:s.string().nullable(),region:s.string(),entered:s.string().nullable(),entered_before_window:s.boolean(),entry_kind:s.enum(["baseline","first_observed","observed_enter"]),left:s.string().nullable(),observed_at:s.string(),url:s.string(),days:O(s.array(s.object({day:s.string().describe("YYYY-MM-DD (UTC)"),position:s.number().int().nullable().describe("The app's slot on the shelf at the day's end; null: not on it")})).describe("Each day of the window with data in the shelf's country, oldest first; a day without data is left out"))}))}),examples:[{title:"ChatGPT featured shelf history",input:{store:"chatgpt",chart:"home:featured",region:"us"}},{title:"One app's featuring history",input:{store:"chatgpt",app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}},{title:"Cursor featuring",input:{store:"cursor"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null,countries:"unavailable"})},basis:{"rows[].entered":"observed","rows[].left":"observed","rows[].observed_at":"observed","rows[].entered_before_window":"derived","rows[].days":"observed"}});var fa=s.number().int(),Rr=s.string(),Pv=C({name:"freshness_get",resource:"freshness",summary:"Our own service monitoring: each store's data status and open issues. It may change.",description:"Use to judge how fresh the data is or why a region is missing. Measured when asked, never cached. With region, adds that region's latest job.",input:s.object({region:b.region.optional()}),data:s.object({status:s.enum(["ok","degraded"]),issues:s.array(s.string()),checked_at:Rr,collector_seen:Rr.nullable().describe("The collector's last poll"),cron:s.object({t:Rr,probe:s.string().nullable()}).nullable(),refused_regions:s.array(s.string()).describe("ChatGPT regions the store refused through every relay in the last day: their catalog data is unavailable"),regions:s.array(ep).describe("Every store and region with data: its latest snapshot and whether it is current, stale or unavailable"),exits_24h:s.array(s.object({provider:s.string().nullable(),tries:fa,blocked:fa,regions:s.array(s.string())})).describe("Tries per relay provider in the last day"),stores:s.array(s.object({store:s.enum(j),runs:fa.describe("Successful runs ever"),last_run:Rr.nullable()})),slots:s.array(s.object({region:s.string(),slot:s.string().describe("UTC date and hour the slot starts, e.g. 2026-10-13T09"),ok:s.boolean(),failed:fa,error:s.string().nullable()})).describe("ChatGPT runs in the last 24 hours, per region and slot"),crawl:s.object({region:s.string(),status:s.string(),requested_at:Rr,claimed_at:Rr.nullable(),error:s.string().nullable()}).nullable().describe("With region: its latest job")}),examples:[{title:"Service status",input:{}},{title:"Germany's latest job",input:{region:"de"}}],cache:{kind:"none"},basis:{status:"derived",issues:"derived","stores[].runs":"observed","slots[].ok":"observed","regions[].as_of":"observed","regions[].status":"derived"}});var Ov=C({name:"leaderboards_get",resource:"leaderboards",path:"/v1/leaderboards/{store}/{metric}",summary:"A store's apps ranked by one metric, labelled by its source basis, such as installs, with the value each replaced.",description:"Use for who leads on installs, popularity score or stars. The metrics a store ranks by are in the stores resource; ChatGPT publishes none. kinds: only apps of these kinds, ranked among themselves; a value qualified by another store is ignored.",input:s.object({store:b.store,metric:b.metric,kinds:b.kinds.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(j),metric:s.string(),unit:s.string(),basis:s.enum(Pe),cadence:s.string(),total:s.number().int().describe("Apps with a value (of the kinds asked)"),rows:s.array(pe.extend({position:s.number().int(),value:s.number(),prev:s.number().nullable(),t:s.string().describe("When the value last changed"),reported_at:s.string(),cadence:s.string(),next_expected_at:s.string(),stale:s.boolean(),prev_t:s.string().nullable()}))}),examples:[{title:"Top 10 Claude plugins by installs",input:{store:"claude",metric:"installs",limit:10}},{title:"cursor.directory by installs",input:{store:"cursor",metric:"dir_installs"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null})},basis:{"rows[].position":"derived","rows[].value":"store_reported","rows[].prev":"store_reported"}});var G=s.number().int(),$t=G.nullable(),ga=s.object({name:s.string(),tools:G,servers:G}),Yx=s.object({n:G,of:G}),Av=C({name:"market_get",resource:"market",summary:"Each store's size and shape: apps per kind, weekly launches over a year, list sizes, and open MCP toolset statistics.",description:"Use for market-level questions: how big a store is, how fast it grows, how MCP servers are built. Not per app; use listings_profile.",input:s.object({store:b.store.optional()}),data:s.object({stores:s.array(s.object({store:s.enum(j),label:s.string(),url:s.string(),apps:G,kinds:s.partialRecord(s.enum(Q),G),last_run:s.string().nullable(),launches:s.object({basis:s.enum(Pe).describe("derived on ChatGPT (decoded from app ids), store_reported on Claude and Cursor"),last_7d:G,weeks:s.array(s.object({week:s.string().describe("Monday the week starts"),n:G})),weekdays:s.array(s.object({day:G.min(0).max(6).describe("0 Monday to 6 Sunday"),n:G})).describe("Every app with a launch date by its weekday: the day its id was created on ChatGPT, the store's launch date elsewhere")}),top10:s.object({frozen:G,of:G}).nullable().describe("Category lists (ChatGPT categories, Claude departments of 10 or more) whose top 10 held the same apps in the same order as the previous day; null on Cursor and Grok Bot"),lists:O(s.array(s.object({chart:s.string(),title:s.string().nullable(),apps:G,collection:s.boolean().describe("A curated collection rather than a category")})).describe("Category lists in the main region, largest first"))})),mcp:s.object({servers:G.describe("MCP servers linked from any store"),by_status:s.array(s.object({status:s.string().nullable(),n:G})),snapshots:G,cross_store:G.describe("Servers linked from apps in more than one store"),url:s.string().describe("The Market pulse page"),open:s.object({servers:G,tools:G,tools_per_server:s.object({median:$t,p90:$t,max:$t,histogram:O(s.array(s.object({bucket:s.string(),n:G})))}),annotations:s.array(ga.extend({tools_true:$t.optional()})).describe("Tools and servers that set each annotation; tools_true: tools setting the hint to true"),output_schema:ga.omit({name:!0}),meta:O(ga.omit({name:!0})),params:s.array(ga).describe("Most common input parameter names"),params_per_tool:s.object({median:$t,p90:$t,none_pct:s.number().nullable(),required_pct:s.number().nullable()}),description_len:s.object({median:$t,p90:$t}),protocols:s.array(s.object({version:s.string(),n:G}))}).describe("Across every open server's latest toolset")}),facts:O(s.object({chatgpt:s.object({apps_sdk:G.describe("Apps SDK apps (family plugin_asdk_app)"),top100:s.object({every:G.describe("Listed in every country with data"),only_us:G.describe("Listed in the United States only"),of:G.describe("Apps in a US top 100 of any category list, collections included"),countries:G.describe("Countries with data")}),shelves_in_order:Yx.describe("US home shelves that are an unbroken run of their category list, of every shelf")}).nullable().describe("null unless ChatGPT is asked for"),claude:s.object({in_most_popular:G.describe("Listings Most popular ranks"),mcp_auth:G.describe("Listings whose MCP server asks for a sign-in (mcp_status auth)"),mcp_status:s.array(s.object({status:s.string(),n:G})).describe("Listings that link an MCP server, by its latest status (the best of several)")}).nullable().describe("null unless Claude is asked for"),products:s.object({n:G.describe("Apps listed in more than one store"),top:s.array(s.string()).describe("The first names, most stores first")})}).describe("Headline numbers for the Stats pages"))}),examples:[{title:"Every store",input:{}},{title:"Cursor",input:{store:"cursor"}}],cache:{kind:"snapshot",scope:()=>({daily:!0})},basis:{"stores[].apps":"observed","stores[].launches.weeks[].n":"derived","stores[].launches.weekdays[].n":"derived","stores[].top10":"derived","mcp.by_status":"observed","mcp.cross_store":"derived","mcp.open":"observed",facts:"derived"}});var jv=C({name:"mcp_toolset_get",resource:"mcp",path:"/v1/mcp/toolsets",summary:"An MCP server's tools at a time, or what changed between two of its toolset versions: tools added, removed and changed.",description:"Use for an app's or a server's toolset now, at a past time, or against an earlier version. Reads OpenApps' stored toolsets, the tools each server lists without a sign-in; it never calls the server.",input:s.object({app:b.app.optional(),server:b.server.optional(),at:b.at.optional(),diff_from:b.diff_from.optional()}),data:s.object({servers:s.array(vv)}),examples:[{title:"Context7's server now",input:{server:"https://mcp.context7.com/mcp"}},{title:"What changed in Context7's tools this week",input:{app:"claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ",diff_from:"-7d"}},{title:"Context7's tools on 1 January 2099",input:{server:"https://mcp.context7.com/mcp",at:"2099-01-01T12:00:00Z"}}],cache:{kind:"snapshot",scope:e=>({store:e.app?bt(e.app).store:null,region:null,toolsets:!0})},basis:{"servers[].status":"observed","servers[].snapshot.tools":"observed","servers[].diff":"derived","servers[].apps":"observed"}}),ha=s.number().int(),Gt=s.string().nullable(),Tv=s.object({id:ha,url:s.string(),page:up,host:Gt,status:Gt,transport:Gt,auth_hint:Gt,checked_at:Gt}),Dv=C({name:"mcp_servers_list",resource:"mcp",path:"/v1/mcp/servers",summary:"The remote MCP servers that store listings link to, open ones first, with tool counts and the apps that link each.",description:"Use to browse or count MCP servers by status or store. For one server's tools, use mcp_servers_get or mcp_toolset_get.",input:s.object({status:b.status.optional(),store:b.store.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({total:ha,rows:s.array(Tv.extend({tool_count:ha.nullable().describe("Tools in its latest toolset; null if never seen without sign-in"),snapshots:ha.describe("Toolset versions seen"),stores:s.array(s.enum(j)),apps:s.array(s.object({app:s.string(),name:Gt,url:s.string()}))}))}),examples:[{title:"Open servers",input:{status:"open"}},{title:"Servers Claude links to",input:{store:"claude"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,toolsets:!0})},basis:{"rows[].status":"observed","rows[].tool_count":"observed","rows[].stores":"observed"}}),Nv=C({name:"mcp_servers_get",resource:"mcp",path:"/v1/mcp/servers/{server}",summary:"One MCP server: its status, the apps that link to it, its latest toolset with every tool, and its toolset history.",description:"Use for everything about one server by id or URL. For its tools at a past time or a diff between versions, use mcp_toolset_get.",input:s.object({server:b.server}),data:s.object({server:Tv.extend({error:Gt.describe("The last check's error")}),apps:s.array(pe),toolset:lp.nullable().describe("Latest toolset; null if never seen without sign-in"),history:s.array(ma)}),examples:[{title:"Context7's server",input:{server:"https://mcp.context7.com/mcp"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null,toolsets:!0})},basis:{"server.status":"observed","toolset.tools":"observed",apps:"observed"}});var Kn=s.string(),Cv=C({name:"movers_list",resource:"movers",path:"/v1/movers/{store}",summary:"What moved in a store's latest data: rank movers in its lead charts, featured-list entries and exits, metric changes.",description:"Use for a store's headlines: who climbed, fell or entered its charts, joined or left a featured list, or changed installs or scores. By default every ranking chart, each product once where it moved most; chart: one chart, every mover. For a span of time, use changes_list.",input:s.object({store:b.store,chart:b.chart.optional(),window:b.window.optional(),max_position:b.max_position.optional(),kinds:b.kinds.optional()}),data:s.object({store:s.enum(j),region:s.string().describe("The store's main region, which movement is measured in"),charts:s.array(s.object({chart:s.string(),slug:s.string(),title:s.string().nullable(),region:s.string(),url:s.string(),week:O(Kn.nullable().describe("window=7d only: the time, ~7 days earlier, of the data the rows are compared with")),rows:s.array(Er).describe("Rows that moved, biggest move up or down first, at most 8 a chart; a product shows once across the charts (with chart: every row)")})),featuring:s.array(s.object({chart:s.string(),slug:s.string(),title:s.string().nullable(),entered:s.array(pe),left:s.array(pe)})).describe("Entries and exits of the store's featured lists in the latest data"),metrics:s.array(s.object({metric:s.string(),title:s.string(),unit:s.string(),basis:s.enum(Pe),rows:s.array(pe.extend({value:s.number(),prev:s.number(),change:s.number(),t:Kn,prev_t:Kn.nullable(),reported_at:Kn,cadence:s.string(),next_expected_at:Kn,stale:s.boolean()})).describe("Apps whose value moved past the noise floor since a week before the metric's latest update, biggest change first; prev 0: new")}))}),examples:[{title:"ChatGPT",input:{store:"chatgpt"}},{title:"Claude",input:{store:"claude"}},{title:"Cursor",input:{store:"cursor"}},{title:"Claude's Most popular over a week, top 50",input:{store:"claude",chart:"popularity",window:"7d",max_position:50}},{title:"Every Claude ranking's top 100",input:{store:"claude",max_position:100}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null,countries:"unavailable"})},basis:{"charts[].rows[].position":"observed","charts[].rows[].prev":"observed","charts[].rows[].is_new":"derived","featuring[].entered":"derived","metrics[].rows[].change":"derived","charts[].rows[].prev_week":"observed","charts[].rows[].linked":"derived","charts[].rows[].kind_position":"derived"}});var Qx=365,Uv=C({name:"new_list",resource:"new",summary:"A store's apps launched since a time, newest first, by launch date (on ChatGPT, when the app's ID was created).",description:`Use for new releases. A ChatGPT app goes live days after its ID is created: sort=first_seen_at orders by go-live day, as the site does. since reaches back at most ${Qx} days. ChatGPT rows carry the app's category. kinds: only those kinds, counted among themselves (total and facets too).`,input:s.object({store:b.store,since:b.since.default("-24h"),sort:b.sort.default("released_at"),limit:b.limit.default(20),cursor:b.cursor.optional(),category:b.category.optional(),kind:b.kind.optional(),kinds:b.kinds.optional()}),data:s.object({store:s.enum(j),since:s.string(),until:s.string().describe("When the newest data is from"),total:s.number().int(),category_observation:s.enum(["available","unavailable","not_applicable"]),unfiltered_total:s.number().int(),rows:s.array(pe.extend({launched_at:O(s.string().nullable()),first_seen_at:s.string(),released_at:s.string().describe("launched_at, or first_seen_at without one"),release_basis:s.enum(Yh).describe("derived: decoded from the ChatGPT app id; observed: the day the app went live"),category:s.string().nullable().describe("First category list it is in (ChatGPT)"),linked:Ur,tags:O(nt),lag_days:s.number().int().nullable().describe("ChatGPT, with Pro (Launch lag): whole days from the app's ID being created to the day it went live; null on other plans, elsewhere or when unknown")})),facets:s.array(s.object({value:s.string(),total:s.number().int()})).describe("Release-window category or kind counts, before selection and pagination.")}),examples:[{title:"ChatGPT this week",input:{store:"chatgpt",since:"-7d"}},{title:"Claude in the last day",input:{store:"claude"}},{title:"ChatGPT apps that went live today",input:{store:"chatgpt",sort:"first_seen_at",limit:5}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null})},basis:{"rows[].launched_at":"derived","rows[].first_seen_at":"observed","rows[].category":"observed","rows[].lag_days":"derived","rows[].linked":"derived","rows[].tags":"derived"}});var Lr=e=>({store:bt(e.app).store,region:null}),Rv=C({name:"listings_search",resource:"listings",summary:"Apps matching the query by name, publisher, brand, tag or what they do, one row per app, exact names first.",description:`Use to find an app's ref from its name, a brand it works with or what it does ("send invoices"). One row per app: its listing that best matches, with its other stores in linked. Ties go to OpenApps Rank.`,input:s.object({query:b.query,publisher:b.publisher.optional(),store:b.store.optional(),kind:b.kind.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({rows:s.array(pe.extend({publisher:s.string().nullable(),best:Ve.nullable(),category:_t,tags:nt,linked:Ur}))}),examples:[{title:"Notion anywhere",input:{query:"notion"}},{title:"Context7 in Cursor",input:{query:"context7",store:"cursor"}},{title:"Linear by its publisher",input:{query:"linear",publisher:"Linear"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,search:!0})},basis:{"rows[].name":"observed","rows[].publisher":"observed","rows[].best":"derived","rows[].category":"observed","rows[].tags":"derived","rows[].linked":"derived"}}),ot=s.array(s.object({value:s.string(),n:s.number().int()})),Lv=C({name:"listings_list",resource:"listings",path:"/v1/listings/list",summary:"Listings by store, kind, category, publisher, tags, MCP status, other stores and release; ranked, newest or A to Z.",description:"Use to browse the catalog by filters, e.g. Claude connectors tagged gmail. Each list filter keeps a listing with any of its values. tags: ids from tags_tree, match all or any; exclude leaves tags out. facets count each filter's values under the others. For a name, listings_search.",input:s.object({stores:b.stores.optional(),kinds:b.kinds.optional(),families:b.families.optional(),categories:b.categories.optional(),publishers:b.publishers.optional(),tags:b.tags.optional(),exclude:b.exclude.optional(),match:b.match.default("all"),linked:b.linked.optional(),statuses:b.statuses.optional(),availability:b.availability.optional(),released_since:b.released_since.optional(),query:b.query.optional(),scope:b.scope.optional(),group:b.group.optional(),sort_by:b.sort_by.default("rank"),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({total:s.number().int().describe("Listings every filter keeps; with group=app, apps with one or more of them"),rows:s.array(la.extend({app_rank:s.number().int().nullable().optional().describe("group=app: the app's OpenApps Rank across stores; null: on no counted chart"),ranks:s.array(s.object({store:s.enum(j),rank:s.number().int()})).optional().describe("group=app: its rank in each store's OpenApps Rank, in store order")}).describe("A listing; with group=app, the app's best listing, carrying every tag of its listings")),facets:O(s.object({store:ot,kind:ot.describe("Store-qualified, e.g. claude:connector or chatgpt:apps_sdk"),family:ot,category:ot,publisher:s.array(s.object({value:s.string().describe("Publisher key"),name:s.string(),n:s.number().int()})).describe("The 100 with most listings, then any asked for"),status:ot,linked:ot,availability:ot,released:ot.describe("Listings released in the last 7 and 30 days before the newest data; value is a released_since"),tags:ot.describe("Listings with each tag among those the other filters keep, after exclude and, with match all, every tag asked for")}).describe("Per filter, how many listings each value has among those the other filters keep"))}),examples:[{title:"Every listing, best ranked first",input:{}},{title:"Claude connectors that work with Notion",input:{stores:["claude"],kinds:["connector"],tags:["notion"]}},{title:"Listings of apps on two or more stores, newest first",input:{tags:["multi-store"],sort_by:"new"}}],cache:{kind:"snapshot",scope:e=>({store:e.stores?.length===1?e.stores[0]:null,region:null,toolsets:!0,search:e.query!==void 0})},basis:{"rows[].best":"derived","rows[].prev_day":"derived","rows[].prev_week":"derived","rows[].countries":"derived","rows[].category":"observed","rows[].tags":"derived","rows[].linked":"derived","rows[].launched_at":"derived","rows[].first_seen_at":"observed","rows[].mcp_status":"observed",facets:"derived"}}),Zv=e=>e.apps?.length?{store:null,region:null}:Lr(e),Mv=C({name:"listings_get",resource:"listings",path:"/v1/listings/{app}",summary:"One listing: name, kind, publisher, description, launch and go-live dates, and its app with the app's other listings.",description:`Use for what a listing is; part_of names its app, linked the app's listings in other stores. The ref may hold the slug. apps: up to ${Vt.plus.compareApps-1} more listings to compare, with Pro. For ranks, metrics or tools, use listings_ranks_current, listings_metrics or listings_tools.`,input:s.object({app:b.app,apps:b.apps.optional()}),data:s.object({app:pa,apps:s.record(s.string(),pa).optional().describe("With apps: each of those listings by its ref, in the order asked, as app is given")}),examples:[{title:"A Claude connector",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae"}},{title:"A listing whose app is in two stores",input:{app:"claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ"}},{title:"A Claude connector by its slug",input:{app:"claude:notion"}}],cache:{kind:"snapshot",scope:e=>({...Zv(e),countries:"status"})},basis:{"app.name":"observed","app.publisher":"observed","app.availability[].status":"derived","app.availability[].as_of":"observed","app.launched_at":"derived","app.first_seen_at":"observed","app.linked":"derived","app.tags":"derived"}}),Vv=C({name:"listings_ranks_current",resource:"listings",path:"/v1/listings/{app}/ranks/current",summary:"Every chart a listing is in now: best position and region, position in the main region, and how many regions list it.",description:"Use for where a listing ranks today. Positions are 1-based, each from its region's latest data (as_of). Countries the store refuses are left out and named in meta.coverage.",input:s.object({app:b.app}),data:s.object({app:s.string(),charts:s.array(sp)}),examples:[{title:"Where a ChatGPT listing ranks",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}}],cache:{kind:"snapshot",scope:e=>({...Lr(e),countries:"unavailable"})},basis:{"charts[].positions[].position":"observed","charts[].positions[].as_of":"observed","charts[].best":"derived","charts[].primary":"observed","charts[].regions":"derived","charts[].kind_position":"derived","charts[].prev_day":"derived","charts[].prev_week":"derived"}}),Fv=C({name:"listings_metrics",resource:"listings",path:"/v1/listings/{app}/metrics",summary:"A listing's latest value of each metric its store publishes, with the value it replaced; each carries its basis.",description:"Use for installs, popularity scores and GitHub stars. Series change-only: t is when the value last changed.",input:s.object({app:b.app}),data:s.object({app:s.string(),metrics:s.array(cp)}),examples:[{title:"Claude installs",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae"}}],cache:{kind:"snapshot",scope:Lr},basis:{"metrics[].t":"observed","metrics[].prev":"observed"}}),Bv=C({name:"listings_tools",resource:"listings",path:"/v1/listings/{app}/tools",summary:"The MCP servers a listing links to, each with its latest tool list.",description:"Use for what a listing's MCP server exposes. Servers that need sign-in have status auth and no snapshot.",input:s.object({app:b.app}),data:s.object({app:s.string(),servers:s.array(dp)}),examples:[{title:"Context7's tools via Claude",input:{app:"claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ"}}],cache:{kind:"snapshot",scope:e=>({...Lr(e),toolsets:!0})},basis:{"servers[].status":"observed","servers[].snapshot.tools":"observed"}}),pp=s.object({url:s.string(),width:s.number().int(),height:s.number().int()}),Gv=C({name:"listings_widgets",resource:"listings",path:"/v1/listings/{app}/widgets",summary:"The widgets a ChatGPT listing's tools show, as images rendered with OpenApps' sample account.",description:"Use for what an app looks like inside ChatGPT. Each widget is one tool's current template, rendered in a browser with input and output a model wrote for a fictional OpenApps account, never a user's data. Images are 720 px wide (mobile 390 px); empty for listings without rendered widgets.",input:s.object({app:b.app}),data:s.object({app:s.string(),widgets:s.array(s.object({tool:s.string(),title:s.string().nullable(),description:s.string().nullable(),template:s.string().describe("The template's resource URI"),since:s.string().describe("Since when the app has used this version of the template"),images:s.object({light:pp,dark:pp,mobile:pp.nullable()})})).describe("In the order the app lists its tools")}),examples:[{title:"Alpha Docs's widgets",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}}],cache:{kind:"snapshot",scope:Lr},basis:{"widgets[].tool":"observed","widgets[].template":"observed","widgets[].images":"derived"}}),Kv=C({name:"listings_ranks_history",resource:"listings",path:"/v1/listings/{app}/ranks",summary:"Rank series of every chart a listing is in now: 14 days or from-to in the chart's home region, the latest elsewhere.",description:`Use for how positions moved. A point is a change (lists are stored on change); a series' last point is carried to its region's latest data, marked carried. apps adds up to ${Vt.plus.rankHistoryApps-1} listings beside app; over ${Vt.out.history.ranks} days back needs a key, more than one listing or over ${Vt.free.history.ranks} days Pro.`,input:s.object({app:b.app,apps:b.apps.optional(),from:b.from.optional(),to:b.to.optional()}),data:s.object({app:s.string(),since:s.string().describe("Start of the home-region window"),until:s.string().nullable().describe("End of the window: to, else the latest data"),series:s.array(s.object({app:s.string().describe("The listing the series is of"),chart:s.string(),title:s.string().nullable(),kind:s.string(),region:s.string(),url:s.string(),points:s.array(s.object({t:s.string().describe("When the position was recorded; a carried point's is the time of the latest data, the list unchanged"),position:s.number().int(),kind_position:s.number().int().nullable().describe("Among its own kind, in lists that join kinds; else null"),carried:s.boolean()}))}))}),examples:[{title:"A ChatGPT listing's ranks",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}},{title:"Two Claude listings over a week",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae",apps:["claude:plugin_017oWX9xDRL2TsTP3jVw6bEJ"],from:"-7d"}}],cache:{kind:"snapshot",scope:e=>({...Zv(e),countries:"unavailable"})},basis:{"series[].points[].position":"observed","series[].points[].kind_position":"derived","series[].points[].t":"observed","series[].points[].carried":"derived"}}),Ev=s.object({hash:s.string(),seen_since:s.string(),seen_until:s.string(),data:O(s.record(s.string(),s.unknown()).describe("The record as the store returned it"))}),Jv=C({name:"listings_versions",resource:"listings",path:"/v1/listings/{app}/versions",summary:"Every version of a store listing and of its detail record, oldest first, each with its date.",description:`Listing and detail versions, stored only when records change. latest=true selects the newest distinct first sighting. Detail history covers ChatGPT, Perplexity and Muse. History over ${Vt.out.history.ranks} days needs a key, ${Vt.free.history.ranks} days Pro; each record's latest shows.`,input:s.object({app:b.app,latest:b.latest.optional()}),data:s.object({app:s.string(),listing:s.array(Ev),detail:s.array(Ev)}),examples:[{title:"A ChatGPT listing's versions",input:{app:"chatgpt:plugin_asdk_app_69c18c28f1188191bf5b8445c4ab0a2e"}}],cache:{kind:"snapshot",scope:Lr},basis:{"listing[].data":"observed","detail[].data":"observed","listing[].seen_since":"observed"}});var We=s.number().int(),Jn=We.nullable().optional().describe("Position on the row's best chart then (best.chart); null: not listed then");var Wv=C({name:"tags_tree",resource:"tags",summary:"Every tag with its facet, parent and app count per store.",description:"Use to find tag ids for listings_list and tags_get. A tag counts every app with a narrower tag too. Use-case (job), works and for tags are per app, cap tags per listing. kinds: count only these kinds, as listings_list filters them.",input:s.object({store:b.store.optional(),kinds:b.kinds.optional()}),data:s.object({version:s.string().describe("The tag vocabulary's version"),tagger:s.string().describe("Methods that assign tags"),tags:s.array(Gn.extend({synonyms:s.array(s.string()).describe("Other names it answers to")})).describe("Vocabulary order: each facet's tree, a tag before the tags under it"),facets:s.array(s.object({facet:da,label:s.string(),hint:s.string(),apps:We.describe("Apps with at least one of its tags")})),stores:s.array(s.object({store:s.enum(j),apps:We.describe("Apps tagged: every app OpenApps has seen in the store, of the kinds asked")}))}),examples:[{title:"Every tag",input:{}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,toolsets:!0})},basis:{"tags[].n":"derived","tags[].stores":"derived","facets[].apps":"derived","stores[].apps":"observed"}}),Hv=C({name:"tags_get",resource:"tags",path:"/v1/tags/{tag}",summary:"One tag: path, narrower tags, counts, top apps per store, related tags.",description:"Use for one tag's apps and neighbours. Old ids answer their successor, else gone. top: per store, best chart place first, limit each. related: tags its apps carry more often than apps at large. kinds: count and list these kinds only.",input:s.object({tag:b.tag,store:b.store.optional(),kinds:b.kinds.optional(),limit:b.limit.default(20)}),data:s.object({tag:Gn,url:s.string().describe("Its page"),top:s.array(la).describe("By store: apps with the tag, best chart place first, at most limit"),kpis:s.object({new_30d:We.describe("Apps with the tag created (ChatGPT: the app's id) or launched in the last 30 days"),with_mcp:s.object({n:We.describe("Claude apps with the tag whose MCP server has a status (listings_list mcp_status)"),of_claude:We.describe("Claude apps with the tag")}),on_both:We.describe("Apps with the tag whose product is listed in another store too")}),weeks:s.array(s.object({week:s.string().describe("The week's Monday, YYYY-MM-DD"),n:We.describe("Apps with the tag created (ChatGPT) or launched that week")})).describe("Every week of the window to the newest data's, oldest first"),path:s.array(s.object({id:s.string(),label:s.string()})).describe("From its top tag down to it"),parent:Gn.nullable(),children:s.array(Gn).describe("Its narrower tags"),siblings:s.array(s.object({id:s.string(),label:s.string(),n:We.describe("Apps carrying it, in the stores asked for")})).describe("Other tags under its parent, in vocabulary order; none for a top tag"),related:s.array(s.object({id:s.string(),label:s.string(),facet:da,n:We.describe("Apps with both tags"),lift:s.number().describe("How many times more often the tag's apps carry it than apps at large")})).describe("At most 10, strongest first, without its ancestors and narrower tags")}),examples:[{title:"Apps that work with Notion",input:{tag:"notion"}},{title:"Developer tools in Claude",input:{tag:"developer-tools",store:"claude",limit:5}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,toolsets:!0})},basis:{"tag.n":"derived","top[].best":"derived","top[].tags":"derived","top[].category":"observed","top[].linked":"derived","top[].prev_day":"observed","top[].prev_week":"observed","kpis.new_30d":"derived","kpis.with_mcp.n":"derived","kpis.on_both":"derived","weeks[].n":"derived","children[].n":"derived","siblings[].n":"derived","related[].n":"derived","related[].lift":"derived"}});var qv=s.string(),Ue=s.number().int(),Xv=s.number().describe("Percent, one decimal"),eS=s.object({app:s.string(),slug:Me,kind:s.enum(Q),name:s.string().nullable(),icon:O(s.string().nullable().describe("The listing's icon on the OpenApps site")),best:Ve,prev_day:Jn,prev_week:Jn,day_change:Ze.describe("Cohort change on best.chart since ~24h earlier"),week_change:Ze.describe("As day_change, since ~7 days earlier")}).nullable().describe("Its listing with the best place now, in the stores asked; null when none ranks"),Yv=C({name:"publishers_list",resource:"publishers",summary:"Publishers across stores, one per publisher key: apps per store, and their app with the best chart place now.",description:"Use to rank developers by how many apps they list or by their best chart position. With store, only publishers with apps there, counted, ranked and pictured by those apps; stores still lists every store. summary: the selection's figures, and how many apps name a publisher.",input:s.object({store:b.store.optional(),publisher:b.publisher.optional(),order:b.order.default("apps"),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({total:Ue.describe("Publishers in the selection"),rows:s.array(op.extend({top:eS,tags:s.array(s.string()).describe("The two tags that describe its listings most often")})),summary:s.object({publishers:Ue.describe("Publishers in the selection"),on_both:Ue.describe("Of them, those with apps in more than one store"),chatgpt_with_developer_pct:Xv.describe("ChatGPT apps whose listing names a developer, percent"),chatgpt_with_developer:Ue,claude_with_publisher_pct:Xv.describe("Claude apps that name a publisher, percent"),claude_with_publisher:Ue})}),examples:[{title:"Publishers with the most apps",input:{}},{title:"Claude publishers by best rank",input:{store:"claude",order:"rank"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null})},basis:{"rows[].name":"derived","rows[].stores":"observed","rows[].apps":"observed","rows[].best":"derived","rows[].top":"derived","rows[].tags":"derived","summary.on_both":"derived","summary.chatgpt_with_developer_pct":"derived","summary.claude_with_publisher_pct":"derived"}}),Qv=C({name:"publishers_get",resource:"publishers",path:"/v1/publishers/{key}",summary:"One publisher's listings in every store, each with its category and best chart place now, and the apps they belong to.",description:"Use for everything one developer lists. key is the publisher key from publishers_list, or any name the publisher lists under (Figma, Inc. or figma); another legal name has its own key. identities: the websites and MCP hosts its listings name, the values with OpenApps Pro, the count with every plan.",input:s.object({key:b.key}),data:s.object({publisher:op,apps:s.array(pe.extend({best:Ve.nullable(),category:_t,launched_at:qv.nullable(),first_seen_at:qv,prev_day:Jn,prev_week:Jn,day_change:Ze.describe("Cohort change on best.chart since ~24h earlier"),week_change:Ze.describe("As day_change, since ~7 days earlier")})).describe("Best place first, then by store and name"),products:s.array(s.object({product:s.string().describe("Same value: same app, within one answer"),slug:s.string().describe("apps_get takes it"),name:s.string().nullable(),listings:s.array(s.object({store:s.enum(j),app:s.string(),url:s.string()}))})).describe("Apps one of its listings belongs to, with every listing of each"),countries:s.object({listed:Ue,of:Ue}).nullable().describe("Its ChatGPT app listed in the most countries: in how many of the countries with current data; null without a ChatGPT app"),shelves:s.object({n:Ue,names:s.array(s.string())}).describe("Its ChatGPT apps on a ChatGPT home shelf now, and their names"),with_mcp:s.object({n:Ue.describe("Claude apps whose MCP server has a status (listings_list mcp_status)"),of_claude:Ue.describe("Its Claude apps")}),identities:s.object({n:Ue.describe("Distinct websites and MCP hosts its listings name"),websites:s.array(s.string()).optional().describe("Website domains; OpenApps Pro only"),hosts:s.array(s.string()).optional().describe("MCP server hosts; OpenApps Pro only")}),others_on_both:s.array(s.object({key:s.string(),name:s.string(),listings:Ue})).describe("Up to 8 other publishers with apps in more than one store, most apps first")}),examples:[{title:"A publisher by key",input:{key:"context7"}},{title:"A publisher by name",input:{key:"Upstash"}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"publisher.name":"derived","publisher.best":"derived","apps[].best":"derived","apps[].category":"observed","apps[].launched_at":"derived","apps[].first_seen_at":"observed","apps[].prev_day":"observed","apps[].prev_week":"observed","products[].listings":"derived","countries.listed":"observed","shelves.n":"observed","with_mcp.n":"observed","identities.n":"observed","others_on_both[].listings":"observed"}});var ce=s.number().int(),eb={score:s.number().describe("Mean daily points over the window: 1/position on each counted chart, weighted"),rank:ce.describe("By score among the store's apps, 1 first"),tier:ce.describe("3: top 10 on a counted chart today, 2: top 50, 1: charted within the window"),tier_title:s.string(),days_charted:ce,peak:ce.describe("Best position on a counted chart in the window"),momentum:s.number().nullable().describe("Score minus the previous window's; null until that window has enough days")},tS=pe.extend({...eb,chart_rank:ce.nullable().describe("Rank by score among the apps on the chart asked for"),kind_peak:ce.describe("peak counted among the listing's own kind on a chart that joins kinds (Claude's Most popular and its tag lists, cursor.directory), as chart pages number it; else peak")}),rS=s.object({store:s.enum(j),target:s.string(),day:s.string(),n:ce,rho:s.number().nullable(),half:s.number().nullable()}),nS=s.object({method:s.string(),title:s.string(),window_days:ce,published:s.boolean(),figures:s.record(s.string(),s.string()),validation:s.array(rS).describe("Newest check against each published count: Spearman rho, share on the same side of the median")}),tb=C({name:"scores_list",resource:"scores",path:"/v1/scores/{store}",summary:"A store's apps by OpenApps Rank: a 28-day aggregate of every chart that orders by popularity, with tier and momentum.",description:"Use for who is popular in a store over the last month, not one day's chart. chart narrows to the apps on one chart, ranked among themselves. Derived from store charts, not a usage count.",input:s.object({store:b.store,chart:b.chart.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({store:s.enum(j),method:s.string(),day:s.string().nullable().describe("The UTC day the figures are for"),total:ce,rows:s.array(tS)}),examples:[{title:"Top ChatGPT apps by OpenApps Rank",input:{store:"chatgpt",limit:10}},{title:"Within one chart",input:{store:"chatgpt",chart:"category:productivity"}}],cache:{kind:"snapshot",scope:e=>({store:e.store,region:null})},basis:{"rows[].score":"derived","rows[].rank":"derived","rows[].tier":"derived","rows[].momentum":"derived","rows[].chart_rank":"derived","rows[].kind_peak":"derived"}}),rb=C({name:"scores_get",resource:"scores",path:"/v1/scores/{app}",summary:"One app's OpenApps Rank figures, its OpenApps Rank within each chart, and daily score and rank series.",description:"Use for how an app has been doing over the last month and whether it is rising. Apps off every counted chart have no figures (charted: false).",input:s.object({app:b.app}),data:s.object({app:s.string(),method:s.string(),charted:s.boolean(),day:s.string().nullable(),figures:s.object(eb).nullable(),chart_ranks:s.array(s.object({chart:s.string(),rank:ce})).describe("Its OpenApps Rank among the apps scored on each chart, not its position in the chart (listings_ranks_current has those)"),series:O(s.array(s.object({day:s.string(),score:s.number(),rank:ce})))}),examples:[{title:"A Claude connector's rank over time",input:{app:"claude:plugin_01E5qTAcHfq3r1UJ8Zxgzjae"}}],cache:{kind:"snapshot",scope:e=>({store:bt(e.app).store,region:null})},basis:{"figures.score":"derived","figures.rank":"derived","figures.momentum":"derived","chart_ranks[].rank":"derived","series[].score":"derived"}}),nb=C({name:"scores_methods",resource:"scores",summary:"How OpenApps Rank is computed, which version is published, and how well each version agrees with published counts.",description:"Use to explain or judge the score. Validation pairs a method's scores with counts stores publish (Claude installs and popularity, cursor.directory installs).",input:s.object({}),data:s.object({published:s.string(),methods:s.array(nS)}),examples:[{title:"Methods and their validation",input:{}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"methods[].validation[].rho":"derived","methods[].validation[].half":"derived"}}),ib=s.object({slug:s.string().describe("The app's slug (apps_get)"),name:s.string().nullable(),icon:s.string().nullable().describe("Its best-ranked listing's icon"),score:s.number().describe("Its score under method"),tier:ce.describe("Best tier of its listings"),tier_title:s.string(),momentum:s.number().nullable().describe("Change over one window"),rank:ce.describe("Among apps across every store, 1 first"),listings:s.array(s.object({store:s.enum(j),app:s.string().describe("Listing ref"),rank:ce.describe("The listing's OpenApps Rank in its store")})).describe("Its charted listings")}),iS=ib.extend({rank:ce.describe("Among the apps with the tag"),overall_rank:ce.describe("Rank before the tag filter")}),ob=C({name:"scores_apps",resource:"scores",path:"/v1/scores/apps",summary:"Apps across every store by OpenApps Rank: the sum over stores of 1/rank of each app's best listing there.",description:"Use for who is popular across stores, not in one. By oa_app@2 (scores_methods). kinds keeps only listings of those kinds and ranks each store's kept listings among themselves; without it, every charted listing counts, Cursor's rules included.",input:s.object({kinds:b.kinds.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({method:s.string(),day:s.string().nullable().describe("The UTC day the figures are for"),total:ce,rows:s.array(ib)}),examples:[{title:"Top apps across stores",input:{limit:10}},{title:"Apps only, no Claude plugins or Cursor rules",input:{kinds:["app","claude:connector","cursor:plugin","cursor:directory_mcp","grokbot:plugin"],limit:10}}],cache:{kind:"snapshot",scope:()=>({store:null,region:null})},basis:{"rows[].score":"derived","rows[].rank":"derived","rows[].tier":"derived","rows[].momentum":"derived","rows[].listings[].rank":"derived"}}),ab=C({name:"scores_tag",resource:"scores",path:"/v1/scores/tags/{tag}",summary:"Apps with one tag by OpenApps Rank, in one store or all.",description:"Use for the top apps in a category. With store, by the best listing's OpenApps Rank there; without, by oa_app@2 (scores_methods). tag: a v1 domain, use or audience value; a domain counts only as an app's primary.",input:s.object({tag:b.tag,store:b.store.optional(),limit:b.limit.default(20),cursor:b.cursor.optional()}),data:s.object({tag:s.object({facet:s.string(),value:s.string(),title:s.string()}),store:s.enum(j).nullable(),method:s.string(),day:s.string().nullable().describe("The UTC day the figures are for"),total:ce,rows:s.array(iS)}),examples:[{title:"Video apps",input:{tag:"video"}},{title:"Developer tools on Claude",input:{tag:"developer-tools",store:"claude",limit:10}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null})},basis:{"rows[].score":"derived","rows[].rank":"derived","rows[].overall_rank":"derived","rows[].tier":"derived","rows[].momentum":"derived","rows[].listings[].rank":"derived"}});var sb=C({name:"stores_get",resource:"stores",summary:"The app stores OpenApps tracks: listings per kind, regions, charts and metrics.",description:"Use for which stores, regions, charts and metrics exist and how fresh each region is. Chart names here are what charts_get takes.",input:s.object({store:b.store.optional()}),data:s.object({stores:s.array(s.object({store:s.enum(j),label:s.string(),apps:s.number().int().describe("Listings that are apps: every kind but cursor.directory rules, which kinds still counts"),kinds:s.partialRecord(s.enum(Q),s.number().int()),url:s.string(),last_run:s.string().nullable(),regions:s.array(s.object({region:s.string(),last_run:s.string(),status:s.enum(Qd).describe("Whether the region's latest data can stand for now; unavailable: the store gives no data there now")})),charts:s.array(s.object({chart:s.string(),kind:O(s.string()),title:s.string().nullable(),url:O(s.string()),size:O(s.number().int().nullable().describe("Apps in its latest list in its home region; null before the first"))})).optional(),metrics:s.array(s.object({name:s.string(),unit:s.string(),basis:s.enum(Pe),cadence:s.string().describe("How often it is read: daily or weekly")}))}))}),examples:[{title:"Every store",input:{}},{title:"Claude only",input:{store:"claude"}}],cache:{kind:"snapshot",scope:e=>({store:e.store??null,region:null,countries:"status"})},basis:{"stores[].apps":"observed","stores[].regions[].last_run":"observed","stores[].charts[].size":"observed"}});var mp={changes_list:wv,movers_list:Cv,stores_get:sb,freshness_get:Pv,charts_get:xv,charts_regions_get:Sv,featuring_get:Iv,featuring_history:zv,leaderboards_get:Ov,new_list:Uv,listings_search:Rv,listings_list:Lv,listings_get:Mv,listings_ranks_current:Vv,listings_ranks_history:Kv,listings_metrics:Fv,listings_tools:Bv,listings_widgets:Gv,listings_versions:Jv,apps_get:bv,apps_list:yv,publishers_list:Yv,publishers_get:Qv,tags_tree:Wv,tags_get:Hv,market_get:Av,mcp_toolset_get:jv,mcp_servers_list:Dv,mcp_servers_get:Nv,scores_apps:ob,scores_list:tb,scores_tag:ab,scores_get:rb,scores_methods:nb};var oS=/^\{([a-z_]+)\}$/;function cb(e,r=e.path){let i=r.split("/").filter(Boolean).flatMap(o=>{let t=oS.exec(o)?.[1];if(!t)return[{literal:o}];let n=Qh[t];return n?Object.keys(n.parts).map(a=>({param:t,part:a})):[{param:t}]});return{op:e,segments:i,template:`/${i.map(o=>"literal"in o?o.literal:`{${o.part??o.param}}`).join("/")}`}}var ub=Object.values(mp).map(e=>cb(e));var aS=[["/v1/apps/list","listings_list"],["/v1/apps/{app}","listings_get"],["/v1/apps/{app}/ranks/current","listings_ranks_current"],["/v1/apps/{app}/ranks","listings_ranks_history"],["/v1/apps/{app}/metrics","listings_metrics"],["/v1/apps/{app}/tools","listings_tools"],["/v1/apps/{app}/versions","listings_versions"],["/v1/products","apps_list"],["/v1/products/{slug}","apps_get"]],_N=aS.map(([e,r])=>cb(mp[r],e));var lb=(e,r)=>Wh(e.segments,r,(i,o)=>{throw new Mt("bad_request",o,{param:i})}),fp="OpenApps-Contract";var sS=new Set(["$schema","$id","detailed"]),cS=new Set(["additionalProperties","propertyNames","enum","required"]),uS=new Set(["maxLength","minLength","minItems","maxItems","minimum","maximum","pattern"]),lS=e=>e.detailed===!0,dS=e=>!!e&&typeof e=="object"&&Object.keys(e).length>0;function va(e,r,i){if(Array.isArray(e))return e.map(c=>va(c,r,i));if(!e||typeof e!="object")return e;let o=e,t=r==="output"&&i==="mcp",n=r==="input"&&i==="mcp",a=Object.fromEntries(Object.entries(o).flatMap(([c,u])=>c==="properties"&&u&&typeof u=="object"?[[c,Object.fromEntries(Object.entries(u).flatMap(([l,d])=>t&&lS(d)?[]:[[l,va(d,r,i)]]))]]:sS.has(c)?[]:t&&cS.has(c)&&!(c==="additionalProperties"&&dS(u))?[]:n&&uS.has(c)?[]:r==="output"&&c==="additionalProperties"&&u===!1?[]:c==="propertyNames"&&JSON.stringify(u)==='{"type":"string"}'?[]:c==="pattern"&&"format"in o?[]:c==="maximum"&&u===Number.MAX_SAFE_INTEGER||c==="minimum"&&u===Number.MIN_SAFE_INTEGER?[]:[[c,va(u,r,i)]]));return i==="rest"&&Array.isArray(a.anyOf)?pS(a):a}function pS(e){let{anyOf:r,...i}=e,o=r,t=o.flatMap(a=>[a.type].flat());if(o.some(a=>"$ref"in a||"anyOf"in a||!a.type)||t.some(a=>typeof a!="string")||new Set(t).size!==t.length)return e;let n={};for(let{type:a,...c}of o)for(let[u,l]of Object.entries(c)){if(u in n&&JSON.stringify(n[u])!==JSON.stringify(l))return e;n[u]=l}if(n.enum){if(t.length!==2||!t.includes("null"))return e;n.enum=[...n.enum,null]}return{...i,...n,type:t}}function db(e,r,i){let o=va(s.toJSONSchema(e,{io:r,target:"draft-2020-12"}),r,i);return r==="input"&&i==="mcp"?mS(o):o}function mS(e){let r=e.properties;if(!r)return e;let i=(o,t)=>Object.fromEntries(Object.entries(o).filter(([n])=>n!==t));return{...e,properties:Object.fromEntries(Object.entries(r).map(([o,t])=>{let n=tv[o],a=n===void 0?t.description:n,c=t.items,u=rv.includes(o)?i({...t,...c&&{items:i(c,"enum")}},"enum"):t,l=nv.includes(o)?i(u,"default"):u;return[o,{...i(l,"description"),...a!=null&&{description:a}}]}))}}var fS=/^[\w:.,/@-]+$/,Wn=e=>e.replaceAll("_","-");function gS(e){let r=db(e.input,"input","rest");return Object.entries(r.properties).map(([i,o])=>({key:i,flag:Wn(i),array:o.type==="array",description:o.description??"",...(o.enum??o.items?.enum)&&{allowed:o.enum??o.items.enum},...o.default!==void 0&&{fallback:o.default}}))}var hS=[s.ZodString,s.ZodNumber,s.ZodBoolean,s.ZodEnum],vS=e=>s.globalRegistry.get(e)?.detailed===!0;function bS(e){let r=Object.entries(e.shape).map(([o,t])=>[o,rt(t)]);for(let[o,t]of r)if(t instanceof s.ZodArray&&rt(t.element)instanceof s.ZodObject)return{rows:o,element:rt(t.element)};let i=r.find(([,o])=>o instanceof s.ZodObject);return i?{rows:i[0],element:i[1]}:{rows:null,element:e}}var yS=e=>Object.entries(e.shape).filter(([r,i],o)=>(r!=="url"||o===0)&&!vS(i)&&(hS.some(t=>rt(i)instanceof t)||r==="before"||r==="after")).map(([r])=>r);function _S(e){let r=e.op,{rows:i,element:o}=bS(r.data),t=Object.entries(r.input.shape).filter(([,n])=>!n.safeParse(void 0).success).map(([n])=>n);return{resource:r.resource,verb:Wn(r.name.slice(r.resource.length+1)),op:r,route:e,positionals:t,params:gS(r),rows:i,fields:Object.keys(o.shape),columns:yS(o)}}var Hn=ub.map(_S),pb=(e,r)=>Hn.find(i=>i.resource===e&&i.verb===r);function mb(e,r){let i=t=>{let n=Array.isArray(t)?t.join(","):String(t);return fS.test(n)?n:`'${n.replaceAll("'","'\\''")}'`},o=Object.entries(r).filter(([t])=>!e.positionals.includes(t)).map(([t,n])=>`--${Wn(t)}${i(n).startsWith("-")?"=":" "}${i(n)}`);return["openapps",e.resource,e.verb,...e.positionals.map(t=>i(r[t])),...o].join(" ")}var $S=/[",\n\r]/,ba=["json","table","csv","md"];function fb(e,r){let i=e.rows===null?r.data:r.data[e.rows];return(Array.isArray(i)?i:[i]).filter(o=>!!o&&typeof o=="object")}var kS=e=>e==null?"":typeof e=="object"?JSON.stringify(e):String(e),wS=e=>e.length>60?`${e.slice(0,59)}\u2026`:e,xS=e=>$S.test(e)?`"${e.replaceAll('"','""')}"`:e,SS=e=>e.replaceAll("|","\\|").replaceAll(`
|
|
65
65
|
`," ");function gb(e,r,i,o,t){if(e==="json"){let l=o?fb(r,i).map(d=>Object.fromEntries(o.map(p=>[p,d[p]??null]))):i;return JSON.stringify(l,null,t?2:void 0)}let n=o??r.columns,a=fb(r,i).map(l=>n.map(d=>kS(l[d])));if(e==="csv")return[n,...a].map(l=>l.map(xS).join(",")).join(`
|
|
66
66
|
`);if(e==="md")return[n,n.map(()=>"---"),...a].map(l=>`| ${l.map(SS).join(" | ")} |`).join(`
|
|
67
67
|
`);let c=[n,...a].map(l=>l.map(wS)),u=n.map((l,d)=>Math.max(...c.map(p=>p[d].length)));return c.map(l=>l.map((d,p)=>d.padEnd(u[p])).join(" ").trimEnd()).join(`
|
|
@@ -101,8 +101,8 @@ ${e.op.examples.map(n=>` ${mb(e,n.input)}`).join(`
|
|
|
101
101
|
API: GET ${e.route.template}
|
|
102
102
|
`}function HS(e,r,i){let o={};for(let c of e.params){let u=r[c.flag];u!==void 0&&(o[c.key]=c.array?[u].flat().flatMap(l=>String(l).split(",")).map(l=>l.trim()).filter(Boolean):u)}let t=e.positionals.filter(c=>!(c in o));if(i.length>t.length)throw Te(`Unexpected argument '${i[t.length]}'. Usage: ${Pb(e)}`);t.forEach((c,u)=>{i[u]!==void 0&&(o[c]=i[u])});let n=t.slice(i.length);if(n.length)throw Te(`Missing ${n.map(c=>`<${c}>`).join(" ")}. Usage: ${Pb(e)}`);let a=e.op.input.safeParse(o);if(!a.success){let c=a.error.issues[0],u=String(c.path[0]??""),l=e.positionals.includes(u)?`<${u}>`:`--${Wn(u)}`;if(c.code!=="invalid_value")throw Te(`${l}: ${c.message}`);let d=c.path.reduce((p,m)=>p?.[m],o);throw Te(`${l}: '${String(d)}' is not one of the allowed values.
|
|
103
103
|
Allowed: ${c.values.join(", ")}`)}return o}var Pb=e=>["openapps",e.resource,e.verb,...e.positionals.map(r=>`<${r}>`),"[flags]"].join(" ");function qS(e,r){if(r===void 0)return;let i=r.split(",").map(t=>t.trim()).filter(Boolean),o=i.filter(t=>!e.fields.includes(t));if(o.length)throw Te(`--fields: no field ${o.join(", ")} in the rows.
|
|
104
|
-
Allowed: ${e.fields.join(", ")}`);return i}function XS(e,r){if(e.json)return"json";if(e.format===void 0)return r?"table":"json";if(!ba.includes(e.format))throw Te(`--format: expected one of ${ba.join(", ")}, got '${e.format}'.`);return e.format}function _p(e,r){let i=(e["base-url"]??r.env.OPENAPPS_BASE_URL??"https://theopenapps.com/v1").replace(FS,"");return BS.test(i)?`${i}/v1`:i}var Ab=e=>new URL(e.env.OPENAPPS_AUTH_ORIGIN??"https://theopenapps.com").origin;async function YS(e,r){let i=r.env.OPENAPPS_API_KEY,o=Ab(r);if(i&&e.origin!==o)throw Te(`Refusing to send OPENAPPS_API_KEY to ${e.origin}. Set OPENAPPS_AUTH_ORIGIN explicitly for a trusted server.`);if(i)return{token:i,login:!1};let t=await Ib(e.origin,r);return t?{token:t,login:!0}:void 0}async function Ob(e,r,i){let o=new URL(`${e}${r}`),t=await YS(o,i),n;try{n=await fetch(o,{redirect:"error",headers:{accept:"application/json",[fp]:"5065ff79","user-agent":"openapps-cli/0.1.
|
|
105
|
-
`))}function $p(e,r){try{return VS({args:e,options:r,allowPositionals:!0,strict:!0})}catch(i){throw Te(i.message)}}async function QS(e,r){try{let[i,o]=e;if(!i||i==="--help"||i==="-h")return r.out(WS()),te.ok;if(i==="--version")return r.out("0.1.
|
|
104
|
+
Allowed: ${e.fields.join(", ")}`);return i}function XS(e,r){if(e.json)return"json";if(e.format===void 0)return r?"table":"json";if(!ba.includes(e.format))throw Te(`--format: expected one of ${ba.join(", ")}, got '${e.format}'.`);return e.format}function _p(e,r){let i=(e["base-url"]??r.env.OPENAPPS_BASE_URL??"https://theopenapps.com/v1").replace(FS,"");return BS.test(i)?`${i}/v1`:i}var Ab=e=>new URL(e.env.OPENAPPS_AUTH_ORIGIN??"https://theopenapps.com").origin;async function YS(e,r){let i=r.env.OPENAPPS_API_KEY,o=Ab(r);if(i&&e.origin!==o)throw Te(`Refusing to send OPENAPPS_API_KEY to ${e.origin}. Set OPENAPPS_AUTH_ORIGIN explicitly for a trusted server.`);if(i)return{token:i,login:!1};let t=await Ib(e.origin,r);return t?{token:t,login:!0}:void 0}async function Ob(e,r,i){let o=new URL(`${e}${r}`),t=await YS(o,i),n;try{n=await fetch(o,{redirect:"error",headers:{accept:"application/json",[fp]:"5065ff79","user-agent":"openapps-cli/0.1.6",...t&&{authorization:`Bearer ${t.token}`}}})}catch(d){let p=d.cause;throw new Oe(te.other,`Cannot reach ${e}: ${p?.code??p?.message??d.message}`)}if(n.status===401&&t?.login)throw ya(o.origin);let a=n.headers.get(fp);a&&a!=="5065ff79"&&i.err(`openapps: the API's contract (${a}) differs from this CLI's (5065ff79); npm i -g @theopenapps/cli for the current one.`);let c=await n.json().catch(()=>null);if(n.ok&&c)return c;let u=c?.error,l=[u?.message??`HTTP ${n.status}`,u?.allowed?.length&&`Allowed: ${u.allowed.join(", ")}`,u?.nearest?.length&&`Closest: ${u.nearest.join(", ")}`].filter(Boolean);throw new Oe(JS[n.status]??te.other,l.join(`
|
|
105
|
+
`))}function $p(e,r){try{return VS({args:e,options:r,allowPositionals:!0,strict:!0})}catch(i){throw Te(i.message)}}async function QS(e,r){try{let[i,o]=e;if(!i||i==="--help"||i==="-h")return r.out(WS()),te.ok;if(i==="--version")return r.out("0.1.6"),te.ok;if(i==="auth"){let{values:x}=$p(e.slice(2),{...yp,"no-browser":{type:"boolean"}}),A=x,P=$a.find(([Z])=>Z===`auth ${o}`);if(!P||A.help){if(!P&&o&&o!=="--help"&&o!=="-h")throw Te(`Unknown verb '${o}' for auth: openapps auth login, openapps auth status, openapps auth logout.`);return r.out(`Usage: openapps auth <login|status|logout> [--base-url <url>]
|
|
106
106
|
|
|
107
107
|
${Xn($a.filter(([Z])=>Z.startsWith("auth ")).map(([Z,H])=>[Z,H]))}
|
|
108
108
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theopenapps/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "The OpenApps API from a terminal: what is listed, ranked, featured and launched in the AI app stores (ChatGPT, Claude, Cursor, Grok Bot, Perplexity and Muse).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|