@superglue/cli 1.1.123 → 1.1.125
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/.claude-plugin/plugin.json +1 -1
- package/dist/cli.js +5 -5
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "superglue",
|
|
3
3
|
"description": "Build, test, and manage superglue tools via the sg CLI. Use when working with superglue tools, systems, APIs, SDKs, or the sg command.",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.125",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "superglue",
|
|
7
7
|
"email": "hello@superglue.cloud"
|
package/dist/cli.js
CHANGED
|
@@ -10,7 +10,7 @@ attempted value: ${s}
|
|
|
10
10
|
return {};
|
|
11
11
|
}`;if(e==="$")return`(sourceData) => {
|
|
12
12
|
return sourceData;
|
|
13
|
-
}`;if(yR(e))return e;throw e.startsWith("//")?new Error(`Found comment in code: ${e}.`):new Error(`Invalid arrow function: ${e}. Expected a valid arrow function.`)}var M9=["accesstoken","refreshtoken","apikey","apisecret","bearertoken","token","clientsecret","secretaccesskey","secretkey","password","pass","secret","privatekey","oauthkey","oauthcert"];function ER(t){return t.toLowerCase().replace(/[_\-\s]/g,"")}R.CREDENTIAL_KEY_PATTERN=/^[A-Za-z_][A-Za-z0-9_]*$/;R.CREDENTIAL_KEY_VALIDATION_DESCRIPTION="Credential keys must start with a letter or underscore and contain only letters, numbers, and underscores.";function IR(t){return R.CREDENTIAL_KEY_PATTERN.test(t)}function CR(t){return t.trim()?IR(t)?null:R.CREDENTIAL_KEY_VALIDATION_DESCRIPTION:"Credential key is required."}function x9(t){return[...t].filter(e=>!!CR(e))}var L9=t=>{let e=ER(t);return M9.some(r=>e===r||e.endsWith(r))};R.isSensitiveCredentialKey=L9;var P9=(t,e)=>e==null||e===""?"":R.FULLY_MASKED_CREDENTIAL_VALUE;R.maskCredentialValue=P9;R.FULLY_MASKED_CREDENTIAL_VALUE="****";function bR(t){return t==null?!1:typeof t=="string"?t.trim().length>0:!0}function F9(t,e){return!!t?.some(r=>r.key===e&&r.hasValue)}function $9(t){return Object.entries(t||{}).sort(([e],[r])=>e.localeCompare(r)).map(([e,r])=>({key:e,hasValue:bR(r)}))}function j9(t,e){let r=new Set(e.filter(n=>n.hasValue).map(n=>n.key));return[...new Set(t||[])].filter(n=>!r.has(n))}function SR(t){return t===R.FULLY_MASKED_CREDENTIAL_VALUE}function q9(t){return t?Object.fromEntries(Object.entries(t).filter(([,e])=>e!=null&&e!=="").map(([e])=>[e,R.FULLY_MASKED_CREDENTIAL_VALUE])):{}}function H9({incoming:t,existing:e}){if(!t)return{};let r={};for(let[n,i]of Object.entries(t)){if(SR(i)){let o=e?.[n];o!=null&&o!==""&&(r[n]=o);continue}r[n]=i}return r}function wI(t){if(typeof t!="string")return!1;let e=t.trim();return!!(e.startsWith("<<")&&e.endsWith(">>")||e.startsWith("{masked_")&&e.endsWith("}"))}function G9(t,e){if(!t||Object.keys(t).length===0)return e||{};if(!e||Object.keys(e).length===0)return Object.fromEntries(Object.entries(t).filter(([n,i])=>!wI(i)&&i!==!0));let r={...e};for(let[n,i]of Object.entries(t))wI(i)||i!==!0&&(r[n]=i);return r}function BR(t,e){if(!e)return t;let r=t,n=[],i=0;Object.entries(e).sort(([,o],[,s])=>String(s).length-String(o).length).forEach(([o,s])=>{let a=String(s);if(s&&a){let c=`\0MASK_${i++}\0`;n.push([c,`{masked_${o}}`]);let u=new RegExp(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");r=r.replace(u,c)}});for(let[o,s]of n)r=r.split(o).join(s);return r}function V9(t){let e={};for(let r of t)for(let[n,i]of Object.entries(r.credentials||{}))(0,R.isSensitiveCredentialKey)(n)&&i!==null&&i!==void 0&&i!==""&&(e[`${r.id}_${n}`]=String(i));return e}function vI(t,e){if(t==null)return t;if(typeof t=="string")return BR(t,e);if(typeof t!="object"||t instanceof Date)return t;if(Array.isArray(t))return t.map(n=>vI(n,e));let r={};for(let[n,i]of Object.entries(t))r[n]=vI(i,e);return r}R.MAX_INLINE_RESULT_PREVIEW_BYTES=5*1024*1024;R.MAX_STRING_PREVIEW_LENGTH=3e3;R.MAX_ARRAY_PREVIEW_ITEMS=10;R.MAX_TRUNCATION_DEPTH=10;R.MAX_OBJECT_PREVIEW_KEYS=100;var z9=8,Y9=100,J9=100;function W9(t){let e=new WeakSet,r=(n,i)=>{if(n==null)return 0;if(typeof n=="string")return new TextEncoder().encode(n).byteLength;if(typeof n=="number"||typeof n=="boolean")return 8;if(typeof n=="bigint")return String(n).length;if(typeof n=="function"||typeof n=="symbol")return 0;if(n instanceof Date)return 24;if(n instanceof Error)return(n.message?.length||0)+(n.stack?.length||0);if(typeof n!="object"||e.has(n)||(e.add(n),i>z9))return 0;if(Array.isArray(n)){let u=n.length*2,l=Math.min(n.length,Y9),A=0;for(let d=0;d<l;d++)A+=r(n[d],i+1);return l===0||l===n.length?u+A:u+Math.round(A/l*n.length)}let o=2,s=Object.keys(n),a=Math.min(s.length,J9),c=0;for(let u=0;u<a;u++){let l=s[u];c+=l.length+r(n[l],i+1)}return a===0||a===s.length?o+c:o+Math.round(c/a*s.length)};try{return r(t,0)}catch{return 0}}function Vf(t,e=0){if(e>R.MAX_TRUNCATION_DEPTH)return Array.isArray(t)?"[...]":typeof t=="object"&&t!==null?"{...}":"...";if(typeof t=="function")return"[FUNCTION]";if(typeof t=="string")return t.length>R.MAX_STRING_PREVIEW_LENGTH?t.substring(0,R.MAX_STRING_PREVIEW_LENGTH)+`... [${t.length.toLocaleString()} chars total]`:t;if(Array.isArray(t))return t.length>R.MAX_ARRAY_PREVIEW_ITEMS?[...t.slice(0,R.MAX_ARRAY_PREVIEW_ITEMS).map(r=>Vf(r,e+1)),`... ${t.length-R.MAX_ARRAY_PREVIEW_ITEMS} more items`]:t.map(r=>Vf(r,e+1));if(typeof t=="object"&&t!==null){let r={},n=Object.keys(t);for(let i of n.slice(0,R.MAX_OBJECT_PREVIEW_KEYS))r[i]=Vf(t[i],e+1);return n.length>R.MAX_OBJECT_PREVIEW_KEYS&&(r["..."]=`${(n.length-R.MAX_OBJECT_PREVIEW_KEYS).toLocaleString()} more keys`),r}return t}function Qc(t,e,r){if(t==null||typeof t!="object")return t;if(r.includes(t))return"[Circular]";if(t instanceof Date)return t.toISOString();if(t instanceof RegExp)return t.toString();if(t instanceof Error)return{name:t.name,message:t.message};r.push(t);try{if(Array.isArray(t)){let n=t.length;if(n<=e)return t.map(o=>Qc(o,e,r));let i=t.slice(0,e).map(o=>Qc(o,e,r));return i.push(`sampled from ${n} items`),i}return t instanceof Map?Object.fromEntries(Array.from(t.entries()).map(([n,i])=>[n,Qc(i,e,r)])):t instanceof Set?Qc(Array.from(t),e,r):Ml(t)?Object.entries(t).reduce((n,[i,o])=>({...n,[i]:Qc(o,e,r)}),{}):String(t)}finally{r.pop()}}function QR(t,e=10){return Qc(t,e,[])}function _I(t,e=2){let r=[];try{return JSON.stringify(t,function(n,i){if(typeof i=="bigint")return i.toString();if(typeof i=="function")return"[Function]";if(typeof i!="object"||i===null)return i;for(;r.length>0&&r[r.length-1]!==this;)r.pop();return r.includes(i)?"[Circular]":(r.push(i),i)},e)}catch(n){return JSON.stringify(`[unserializable ${typeof t}: ${n instanceof Error?n.message:String(n)}]`)}}function zf(t,e=new Date){if(t instanceof Date&&!Number.isNaN(t.getTime()))return t;if(typeof t!="string"&&typeof t!="number")return e;let r=new Date(t);return Number.isNaN(r.getTime())?e:r}function wR(t){let{output:e,...r}=t;return{...r,frontendOutput:r.frontendOutput??e,startTime:r.startTime?zf(r.startTime):void 0,endTime:r.endTime?zf(r.endTime):void 0}}function DI(t){let{context:e,...r}=t;return{...r,...t.stale||e?.stale?{stale:!0}:{},timestamp:zf(t.timestamp),parts:t.parts?.map(n=>n.type==="tool"&&n.tool?{...n,tool:wR(n.tool)}:n)}}function Z9(t){return t.map(DI)}function K9(t,e){let r=e.memoryMessage?DI(e.memoryMessage):null,n=new Set(e.staleMessageIds);if(!r||n.size===0)return t;let
|
|
13
|
+
}`;if(yR(e))return e;throw e.startsWith("//")?new Error(`Found comment in code: ${e}.`):new Error(`Invalid arrow function: ${e}. Expected a valid arrow function.`)}var M9=["accesstoken","refreshtoken","apikey","apisecret","bearertoken","token","clientsecret","secretaccesskey","secretkey","password","pass","secret","privatekey","oauthkey","oauthcert"];function ER(t){return t.toLowerCase().replace(/[_\-\s]/g,"")}R.CREDENTIAL_KEY_PATTERN=/^[A-Za-z_][A-Za-z0-9_]*$/;R.CREDENTIAL_KEY_VALIDATION_DESCRIPTION="Credential keys must start with a letter or underscore and contain only letters, numbers, and underscores.";function IR(t){return R.CREDENTIAL_KEY_PATTERN.test(t)}function CR(t){return t.trim()?IR(t)?null:R.CREDENTIAL_KEY_VALIDATION_DESCRIPTION:"Credential key is required."}function x9(t){return[...t].filter(e=>!!CR(e))}var L9=t=>{let e=ER(t);return M9.some(r=>e===r||e.endsWith(r))};R.isSensitiveCredentialKey=L9;var P9=(t,e)=>e==null||e===""?"":R.FULLY_MASKED_CREDENTIAL_VALUE;R.maskCredentialValue=P9;R.FULLY_MASKED_CREDENTIAL_VALUE="****";function bR(t){return t==null?!1:typeof t=="string"?t.trim().length>0:!0}function F9(t,e){return!!t?.some(r=>r.key===e&&r.hasValue)}function $9(t){return Object.entries(t||{}).sort(([e],[r])=>e.localeCompare(r)).map(([e,r])=>({key:e,hasValue:bR(r)}))}function j9(t,e){let r=new Set(e.filter(n=>n.hasValue).map(n=>n.key));return[...new Set(t||[])].filter(n=>!r.has(n))}function SR(t){return t===R.FULLY_MASKED_CREDENTIAL_VALUE}function q9(t){return t?Object.fromEntries(Object.entries(t).filter(([,e])=>e!=null&&e!=="").map(([e])=>[e,R.FULLY_MASKED_CREDENTIAL_VALUE])):{}}function H9({incoming:t,existing:e}){if(!t)return{};let r={};for(let[n,i]of Object.entries(t)){if(SR(i)){let o=e?.[n];o!=null&&o!==""&&(r[n]=o);continue}r[n]=i}return r}function wI(t){if(typeof t!="string")return!1;let e=t.trim();return!!(e.startsWith("<<")&&e.endsWith(">>")||e.startsWith("{masked_")&&e.endsWith("}"))}function G9(t,e){if(!t||Object.keys(t).length===0)return e||{};if(!e||Object.keys(e).length===0)return Object.fromEntries(Object.entries(t).filter(([n,i])=>!wI(i)&&i!==!0));let r={...e};for(let[n,i]of Object.entries(t))wI(i)||i!==!0&&(r[n]=i);return r}function BR(t,e){if(!e)return t;let r=t,n=[],i=0;Object.entries(e).sort(([,o],[,s])=>String(s).length-String(o).length).forEach(([o,s])=>{let a=String(s);if(s&&a){let c=`\0MASK_${i++}\0`;n.push([c,`{masked_${o}}`]);let u=new RegExp(a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");r=r.replace(u,c)}});for(let[o,s]of n)r=r.split(o).join(s);return r}function V9(t){let e={};for(let r of t)for(let[n,i]of Object.entries(r.credentials||{}))(0,R.isSensitiveCredentialKey)(n)&&i!==null&&i!==void 0&&i!==""&&(e[`${r.id}_${n}`]=String(i));return e}function vI(t,e){if(t==null)return t;if(typeof t=="string")return BR(t,e);if(typeof t!="object"||t instanceof Date)return t;if(Array.isArray(t))return t.map(n=>vI(n,e));let r={};for(let[n,i]of Object.entries(t))r[n]=vI(i,e);return r}R.MAX_INLINE_RESULT_PREVIEW_BYTES=5*1024*1024;R.MAX_STRING_PREVIEW_LENGTH=3e3;R.MAX_ARRAY_PREVIEW_ITEMS=10;R.MAX_TRUNCATION_DEPTH=10;R.MAX_OBJECT_PREVIEW_KEYS=100;var z9=8,Y9=100,J9=100;function W9(t){let e=new WeakSet,r=(n,i)=>{if(n==null)return 0;if(typeof n=="string")return new TextEncoder().encode(n).byteLength;if(typeof n=="number"||typeof n=="boolean")return 8;if(typeof n=="bigint")return String(n).length;if(typeof n=="function"||typeof n=="symbol")return 0;if(n instanceof Date)return 24;if(n instanceof Error)return(n.message?.length||0)+(n.stack?.length||0);if(typeof n!="object"||e.has(n)||(e.add(n),i>z9))return 0;if(Array.isArray(n)){let u=n.length*2,l=Math.min(n.length,Y9),A=0;for(let d=0;d<l;d++)A+=r(n[d],i+1);return l===0||l===n.length?u+A:u+Math.round(A/l*n.length)}let o=2,s=Object.keys(n),a=Math.min(s.length,J9),c=0;for(let u=0;u<a;u++){let l=s[u];c+=l.length+r(n[l],i+1)}return a===0||a===s.length?o+c:o+Math.round(c/a*s.length)};try{return r(t,0)}catch{return 0}}function Vf(t,e=0){if(e>R.MAX_TRUNCATION_DEPTH)return Array.isArray(t)?"[...]":typeof t=="object"&&t!==null?"{...}":"...";if(typeof t=="function")return"[FUNCTION]";if(typeof t=="string")return t.length>R.MAX_STRING_PREVIEW_LENGTH?t.substring(0,R.MAX_STRING_PREVIEW_LENGTH)+`... [${t.length.toLocaleString()} chars total]`:t;if(Array.isArray(t))return t.length>R.MAX_ARRAY_PREVIEW_ITEMS?[...t.slice(0,R.MAX_ARRAY_PREVIEW_ITEMS).map(r=>Vf(r,e+1)),`... ${t.length-R.MAX_ARRAY_PREVIEW_ITEMS} more items`]:t.map(r=>Vf(r,e+1));if(typeof t=="object"&&t!==null){let r={},n=Object.keys(t);for(let i of n.slice(0,R.MAX_OBJECT_PREVIEW_KEYS))r[i]=Vf(t[i],e+1);return n.length>R.MAX_OBJECT_PREVIEW_KEYS&&(r["..."]=`${(n.length-R.MAX_OBJECT_PREVIEW_KEYS).toLocaleString()} more keys`),r}return t}function Qc(t,e,r){if(t==null||typeof t!="object")return t;if(r.includes(t))return"[Circular]";if(t instanceof Date)return t.toISOString();if(t instanceof RegExp)return t.toString();if(t instanceof Error)return{name:t.name,message:t.message};r.push(t);try{if(Array.isArray(t)){let n=t.length;if(n<=e)return t.map(o=>Qc(o,e,r));let i=t.slice(0,e).map(o=>Qc(o,e,r));return i.push(`sampled from ${n} items`),i}return t instanceof Map?Object.fromEntries(Array.from(t.entries()).map(([n,i])=>[n,Qc(i,e,r)])):t instanceof Set?Qc(Array.from(t),e,r):Ml(t)?Object.entries(t).reduce((n,[i,o])=>({...n,[i]:Qc(o,e,r)}),{}):String(t)}finally{r.pop()}}function QR(t,e=10){return Qc(t,e,[])}function _I(t,e=2){let r=[];try{return JSON.stringify(t,function(n,i){if(typeof i=="bigint")return i.toString();if(typeof i=="function")return"[Function]";if(typeof i!="object"||i===null)return i;for(;r.length>0&&r[r.length-1]!==this;)r.pop();return r.includes(i)?"[Circular]":(r.push(i),i)},e)}catch(n){return JSON.stringify(`[unserializable ${typeof t}: ${n instanceof Error?n.message:String(n)}]`)}}function zf(t,e=new Date){if(t instanceof Date&&!Number.isNaN(t.getTime()))return t;if(typeof t!="string"&&typeof t!="number")return e;let r=new Date(t);return Number.isNaN(r.getTime())?e:r}function wR(t){let{output:e,...r}=t;return{...r,frontendOutput:r.frontendOutput??e,startTime:r.startTime?zf(r.startTime):void 0,endTime:r.endTime?zf(r.endTime):void 0}}function DI(t){let{context:e,...r}=t;return{...r,...t.stale||e?.stale?{stale:!0}:{},timestamp:zf(t.timestamp),parts:t.parts?.map(n=>n.type==="tool"&&n.tool?{...n,tool:wR(n.tool)}:n)}}function Z9(t){return t.map(DI)}function K9(t,e){let r=e.memoryMessage?DI(e.memoryMessage):null,n=new Set(e.staleMessageIds),i=new Map((e.modelContextLimits??[]).map(u=>[u.messageId,u]));if(!r||n.size===0&&i.size===0)return t;let o=t.map(u=>{let l=i.get(u.id),A=e.modelContextLimits!==void 0&&!l;if(!n.has(u.id)&&!l&&!(A&&u.modelContextLimit))return u;let{modelContextLimit:d,...f}=u;return{...f,...n.has(u.id)?{stale:!0}:{},...l&&!n.has(u.id)?{modelContextLimit:{maxChars:l.maxChars,keep:l.keep}}:{}}});if(o.some(u=>u.id===r.id))return o;let s=new Set(e.retainedHeadMessageIds??[]),a=e.retainedHeadMessageIds!==void 0?o.findIndex(u=>u.role!=="system"&&!s.has(u.id)):o.findIndex(u=>n.has(u.id)),c=a===-1?o.length:a;return[...o.slice(0,c),r,...o.slice(c)]}function TI(t){return t.content.trim()?t.content.trim():t.parts?.filter(e=>e.type==="content"||e.type==="error").map(e=>e.content||"").join("").trim()||""}function RI(t){return(t.parts||[]).flatMap(e=>e.type==="tool"&&e.tool?[e.tool]:[])}function vR(t){return TI(t)?!0:RI(t).length>0}function kI(t){return t.role==="assistant"&&!t.isStreaming&&!vR(t)}function X9(t){return t.role==="system"||t.isHidden?!1:!kI(t)}function e5(t){return t.filter(e=>!kI(e))}function t5(t){return t.filter(e=>{let r=TI(e),n=RI(e).length>0;return(r||n)&&!(e.id==="1"&&!r)})}function r5(t,e=5e3,r=10){if(t==null)return"null";if(typeof t=="string")return t.length<=e?t:t.slice(0,e)+"... [truncated]";let n=_I(t);if(n.length<=e)return n;let i=QR(t,r),o=_I(i);return o.length<=e?o:o.slice(0,e)+"... [truncated]"}function n5(t,e){if(t.length<=e)return t;let r=Math.ceil(e/2),n=Math.floor(e/2),i=t.length-r-n;return`${t.slice(0,r)}
|
|
14
14
|
... [${i} characters omitted] ...
|
|
15
15
|
${t.slice(t.length-n)}`}function i5(t){return t instanceof Error?t.message:typeof t=="string"?t:typeof t=="object"&&t!==null&&"message"in t?String(t.message):String(t)}function o5(t,e){if(!e||Object.keys(e).length===0)return{};let r=/file::([^,\s)}\]"']+)/g,n=typeof t=="string"?t:JSON.stringify(t||{}),i=[...new Set([...n.matchAll(r)].map(o=>{let s=o[1];return s.endsWith(".raw")?s=s.slice(0,-4):s.endsWith(".base64")?s=s.slice(0,-7):s.endsWith(".extracted")&&(s=s.slice(0,-10)),s}))];return Object.fromEntries(i.flatMap(o=>e[o]?[[o,e[o]]]:[]))}function s5(t){if(!t)return null;let e=t.indexOf(":");if(e===-1)return{source:"simpleicons",name:t};let r=t.substring(0,e),n=t.substring(e+1);return r!=="simpleicons"&&r!=="lucide"?{source:"simpleicons",name:t}:{source:r,name:n}}function a5(t){return t?typeof t=="string"?t.indexOf(":")!==-1?t:`simpleicons:${t}`:`${t.source}:${t.name}`:null}function _R(t){if(t.op==="remove"||t.value===void 0||typeof t.value!="string")return t;if(t.path==="/inputSchema"||t.path==="/outputSchema"||t.path.startsWith("/inputSchema/properties/")||t.path.startsWith("/outputSchema/properties/")||t.path.match(/^\/steps\/\d+\/config\/pagination$/)||t.path.match(/^\/steps\/\d+\/config\/headers$/)||t.path.match(/^\/steps\/\d+\/config\/queryParams$/))try{return{...t,value:JSON.parse(t.value)}}catch{return t}return t}function c5(t){return t.map(e=>_R(e))}function u5(t,e){t||(t=""),e||(e=""),/^(https?|postgres(ql)?|ftp(s)?|sftp|smb|file):\/\//i.test(t)||(t=`https://${t}`);let r=t.endsWith("/")?t.slice(0,-1):t,n=e.startsWith("/")?e.slice(1):e;return`${r}/${n}`}R.ALLOWED_PATCH_SYSTEM_FIELDS=["name","url","specificInstructions","icon","credentials","authentication","metadata","templateName","requiredCredentialKeys","documentationFiles","tunnel","tags"];var l5=new Set(["data","stepResults","toolPayload","rawData","transformedData"]),A5=8e4;function d5(t,e=A5){if(t==null)return t;let r=t;if(typeof t=="string"){if(t.length<=e)return t;try{r=JSON.parse(t)}catch{return{_truncated:!0,_message:"String result too large to parse",_size:t.length}}}if(typeof r!="object")return r;let n=0,i=0,o=(s,a=0)=>{if(a>20||s===null||typeof s!="object")return s;if(Array.isArray(s))return s.map(u=>o(u,a+1));let c={};for(let[u,l]of Object.entries(s))if(l5.has(u)&&l!==null&&typeof l=="object"){let A=JSON.stringify(l);if(A.length>e){i+=A.length;try{let{jsonString:d,truncatedProps:f}=(0,f9.default)(A,e);c[u]=JSON.parse(d),n+=f.length}catch{c[u]=l}}else c[u]=l}else c[u]=o(l,a+1);return c};try{if(JSON.stringify(r).length<=e)return r;let a=o(r);return n>0&&typeof a=="object"&&a!==null&&(a._note=`Result truncated: ${n} items omitted (original ${i} characters)`),a}catch{return{_truncated:!0,_message:"Result too large to display"}}}function f5(t){if(!t.steps)return[];let e=new Set;for(let r of t.steps)r.config&&(0,gR.isRequestConfig)(r.config)&&r.config.systemId&&e.add(r.config.systemId);return Array.from(e)}function Yf(t,e,r=new WeakSet){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object")&&!r.has(t)){if(r.add(t),Array.isArray(t)){for(let n of t)Yf(n,e,r);return}for(let n of Object.values(t))Yf(n,e,r)}}function p5(t){let e=[];for(let r of t.matchAll(/<<([\s\S]*?)>>/g)){let n=r[1].trim();n&&e.push(n)}for(let r of t.matchAll(/{{\s*([^{}\s]+)\s*}}/g)){let n=r[1].trim();n&&e.push(n)}return e}function DR(t,e){let r=[];Yf(t,r);let n=`${e}_`,i=new Set;for(let o of r)for(let s of p5(o)){if(!s.startsWith(n))continue;let a=s.slice(n.length);!a||a==="url"||!R.CREDENTIAL_KEY_PATTERN.test(a)||i.add(a)}return[...i]}var g5=/^\s*(async\s+)?(\([^)]*\)|[a-zA-Z_$][a-zA-Z0-9_$]*)\s*=>/,h5=new Set(["sg_auth_email","sg_auth_jwt"]);function m5({config:t,systemId:e}){let r=[];Yf(t,r);let n=e?`${e}_`:null,i=new Set;for(let u of r)for(let l of u.matchAll(/<<([\s\S]*?)>>/g)){let A=l[1].trim();A&&(n&&A.startsWith(n)||g5.test(A)||h5.has(A)||i.add(A))}if(i.size===0)return null;let o=[...i].map(u=>`<<${u}>>`).join(", "),s=`Unresolved placeholder${i.size===1?"":"s"} ${o}`;if(!n)return`${s}. Credential placeholders need systemId and the form <<systemId_secretName>>. Nothing was sent.`;let a=[...i].filter(u=>R.CREDENTIAL_KEY_PATTERN.test(u)).map(u=>`<<${n}${u}>>`),c=a.length>0?`Credential placeholders are namespaced by system: use ${a.join(", ")}.`:`Credential placeholders are namespaced by system as <<${n}secretName>>.`;return`${s}. ${c} Nothing was sent.`}function y5(t){let e={};if(!t.steps)return e;for(let r of t.steps){if(!r.config||!(0,gR.isRequestConfig)(r.config)||!r.config.systemId)continue;let n=DR(r.config,r.config.systemId);if(n.length===0)continue;let i=new Set(e[r.config.systemId]||[]);for(let o of n)i.add(o);e[r.config.systemId]=[...i]}return e}});var NR=h(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.AGENT_CONTEXT_MEMORY_MESSAGE_ID_PREFIX=void 0;dt.applyToolMutation=TR;dt.mutateToolCallInMessages=E5;dt.buildStreamingAssistantMessage=RR;dt.parseToolOutput=C5;dt.parseAgentStreamEventLine=b5;dt.stopActiveTool=kR;dt.appendContentToMessage=OI;dt.updateMessageWithData=xl;dt.findAwaitingConfirmationToolCallIds=S5;dt.declineAwaitingConfirmationTools=B5;dt.findAndResumeMessageWithTool=Q5;dt.serializeMessageForPersistence=v5;dt.normalizeAgentSessionForkMessages=_5;dt.normalizeAgentSessionImportMessages=D5;dt.createAgentTranscriptState=T5;dt.applyAgentStreamChunk=R5;var Wf=jn();function TR(t,e){let r=e.frontendOutput!==void 0?e.frontendOutput:t.frontendOutput;return{...t,...e.input!==void 0?{input:e.input}:{},...e.result!==void 0?{result:e.result}:{},...e.status!==void 0?{status:e.status}:{},...e.startTime!==void 0?{startTime:e.startTime}:{},...e.endTime!==void 0?{endTime:e.endTime}:{},...e.error!==void 0?{error:e.error||void 0}:{},...r!==void 0?{frontendOutput:r}:{},...e.llmOutput!==void 0?{llmOutput:e.llmOutput}:{},...e.resultMetadata!==void 0?{resultMetadata:e.resultMetadata}:{},...e.confirmationState!==void 0?{confirmationState:e.confirmationState===null?void 0:e.confirmationState}:{},...e.confirmationData!==void 0?{confirmationData:e.confirmationData===null?void 0:e.confirmationData}:{}}}function E5(t,e,r){return t.map(n=>{let i=!1,o=n.parts?.map(s=>s.type!=="tool"||!s.tool||s.tool.id!==e?s:(i=!0,{...s,tool:TR(s.tool,r)}));return i&&o?{...n,parts:o}:n})}function RR(t){return{id:t,content:"",role:"assistant",timestamp:new Date,parts:[{type:"content",content:"",id:"content-0"}],isStreaming:!0}}function I5(){return{status:"declined",endTime:new Date,confirmationState:"declined",confirmationData:{reason:"new_user_message",message:"Rejected: the user sent a new message instead of confirming this action. The proposed changes were NOT applied."}}}function C5(t){if(!t)return null;if(typeof t=="string")try{let e=JSON.parse(t);return e&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}return typeof t=="object"&&!Array.isArray(t)?t:null}function b5(t){if(!t.startsWith("data: "))return null;try{let e=JSON.parse(t.slice(6));return e&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}}function kR(t){return t.status==="running"||t.status==="pending"||t.status==="awaiting_confirmation"?{...t,status:"stopped",endTime:new Date,confirmationState:void 0,confirmationData:void 0}:t}function OI(t,e){if(!e)return t;let r=[...t.parts||[]],n=r[r.length-1];return n?.type==="content"?r[r.length-1]={...n,content:(n.content||"")+e}:r.push({type:"content",content:e,id:`content-${r.length}`}),{...t,parts:r,content:""}}function xl(t,e,r){if(t.id!==r.id)return t;switch(e.type){case"content":return OI(t,e.content||"");case"tool_call_start":{let n=t.parts?.find(u=>u.type==="tool"&&u.tool?.id===e.toolCall.id)?.tool,i=e.toolCall.input??n?.input,o=e.executionMode==="confirm"?"awaiting_confirmation":i?"running":"pending",s={...n,id:e.toolCall.id,name:e.toolCall.name,input:i,status:o,startTime:n?.startTime||new Date,...n?.confirmationState!==void 0?{confirmationState:n.confirmationState}:{},...n?.confirmationData!==void 0?{confirmationData:n.confirmationData}:{}},a=[...t.parts||[]],c=a.findIndex(u=>u.type==="tool"&&u.tool?.id===e.toolCall.id);return c===-1?a.push({type:"tool",tool:s,id:`tool-${e.toolCall.id}`}):a[c]={...a[c],tool:s},{...t,parts:a,content:""}}case"tool_call_input":{let n=i=>i.id===e.toolCall.id&&e.toolCall.input!==void 0?{...i,input:e.toolCall.input}:i;return{...t,parts:t.parts?.map(i=>i.type==="tool"&&i.tool?{...i,tool:n(i.tool)}:i)}}case"tool_call_update":{let n=t.parts?.map(i=>i.type==="tool"&&i.tool?.id===e.toolCall.id?{...i,tool:{...i.tool,executionTraceId:e.toolCall.executionTraceId??i.tool.executionTraceId,status:i.tool.status==="pending"?"running":i.tool.status}}:i)||[];return{...t,parts:n}}case"tool_call_complete":{let n=t.parts?.find(g=>g.type==="tool"&&g.tool?.id===e.toolCall.id)?.tool,i=n?.status==="completed"||n?.status==="declined",o=e.toolCall.result!==void 0||e.toolCall.frontendOutput!==void 0||e.toolCall.status!==void 0||e.toolCall.confirmationState!==void 0||e.toolCall.confirmationData!==void 0;if(i&&!o)return t;let s=null;try{s=typeof e.toolCall.frontendOutput=="string"?JSON.parse(e.toolCall.frontendOutput):e.toolCall.frontendOutput}catch{}let a=s?.success===!1&&s?.error,c=e.toolCall.result?.outcome,u=c==="failure"?"error":c==="rejected"?"declined":c==="aborted"?"stopped":c==="success"?"completed":void 0,l=e.toolCall.status||u||"completed";a&&l==="completed"&&(l="error");let A=l==="awaiting_confirmation",d={...e.toolCall.input!==void 0?{input:e.toolCall.input}:{},...e.toolCall.result!==void 0?{result:e.toolCall.result}:{},status:l,frontendOutput:e.toolCall.frontendOutput,llmOutput:e.toolCall.llmOutput,resultMetadata:e.toolCall.resultMetadata,error:c==="failure"?e.toolCall.result.error.message:a?s.error:null,endTime:A?void 0:new Date,...e.toolCall.confirmationState!==void 0?{confirmationState:e.toolCall.confirmationState}:{},...e.toolCall.confirmationData!==void 0?{confirmationData:e.toolCall.confirmationData}:{}},f=t.parts?.map(g=>g.type==="tool"&&g.tool?.id===e.toolCall.id?{...g,tool:{...g.tool,...d}}:g)||[];return{...t,parts:f}}case"done":{if(!t.isStreaming)return t;let n=(t.parts||[]).map(i=>i.type==="tool"&&i.tool&&i.tool.status!=="awaiting_confirmation"?{...i,tool:kR(i.tool)}:i);return{...t,isStreaming:!1,parts:n,content:""}}default:return t}}function S5(t){let e=new Set;for(let r of t)for(let n of(0,Wf.getMessageToolCalls)(r))n.status==="awaiting_confirmation"&&e.add(n.id);return[...e]}function B5(t){let e=I5();return t.map(r=>({...r,parts:r.parts?.map(n=>n.type==="tool"&&n.tool?.status==="awaiting_confirmation"?{...n,tool:{...n.tool,...e}}:n)}))}function Q5(t,e){let r=t.find(i=>i.parts?.some(o=>o.type==="tool"&&o.tool?.id===e));return r?{messages:t.map(i=>i.id===r.id?{...i,isStreaming:!0}:i),targetMessage:{...r,isStreaming:!0}}:{messages:t,targetMessage:null}}function w5(t){return{id:t.id,name:t.name,status:t.status,input:t.input,result:t.result,frontendOutput:t.frontendOutput,llmOutput:t.llmOutput,resultMetadata:t.resultMetadata,error:t.error,startTime:t.startTime,endTime:t.endTime,confirmationState:t.confirmationState,confirmationData:t.confirmationData}}function v5(t){let{isStreaming:e,tools:r,...n}=t;return JSON.parse((0,Wf.safeStringify)({...n,...t.parts?{parts:t.parts.map(i=>i.type==="tool"&&i.tool?{...i,tool:w5(i.tool)}:i)}:{}},0))}dt.AGENT_CONTEXT_MEMORY_MESSAGE_ID_PREFIX="context-memory-";function _5(t){return t.filter(e=>e.role!=="system"&&!e.id.startsWith(dt.AGENT_CONTEXT_MEMORY_MESSAGE_ID_PREFIX)).map(e=>({...e,stale:void 0,isStreaming:void 0}))}function D5(t){return t.filter(e=>!e.stale&&!e.isStreaming&&!!e.id)}function T5(t=[],e=null){return{messages:t,assistantMessageId:e,outcome:"streaming"}}function NI(t,e){return(0,Wf.getMessageToolCalls)(t).some(r=>r.id===e)}function wc(t,e){let r=t.assistantMessageId?t.messages.find(i=>i.id===t.assistantMessageId):void 0;if(r)return{state:t,target:r};let n=RR(t.assistantMessageId??e.createAssistantMessageId());return{state:{...t,messages:[...t.messages,n],assistantMessageId:n.id},target:n}}function R5(t,e,r){switch(e.type){case"system_message":{if(!e.systemMessage)return t;let n={id:e.systemMessage.id,role:"system",content:e.systemMessage.content,timestamp:new Date};return{...t,messages:[n,...t.messages]}}case"assistant_message_start":{if(!e.assistantMessageId)return t;let n=t.assistantMessageId?t.messages.find(o=>o.id===t.assistantMessageId):void 0;return t.messages.find(o=>o.id===e.assistantMessageId)?{...t,assistantMessageId:e.assistantMessageId,messages:t.messages.filter(o=>!n||n.id===e.assistantMessageId||o.id!==n.id).map(o=>o.id===e.assistantMessageId?{...o,isStreaming:!0}:o)}:n?{...t,assistantMessageId:e.assistantMessageId,messages:t.messages.map(o=>o.id===n.id?{...o,id:e.assistantMessageId,isStreaming:!0}:o)}:{...t,assistantMessageId:e.assistantMessageId}}case"context_usage":case"compaction_start":return t;case"compaction_complete":return e.compaction?{...t,messages:(0,Wf.applyAgentCompactionToMessages)(t.messages,e.compaction)}:t;case"content":{let n=wc(t,r);return{...n.state,messages:n.state.messages.map(i=>i.id===n.target.id?OI(i,e.content||""):i)}}case"error":{let n=wc(t,r);return{...n.state,outcome:"failed",messages:n.state.messages.map(i=>i.id!==n.target.id?i:{...i,parts:[...i.parts||[],{type:"error",content:e.content,errorDetails:e.errorDetails,id:`error-${i.parts?.length??0}`}],isStreaming:!1})}}case"tool_call_start":case"tool_call_update":{if(!e.toolCall)return t;let n=e.type==="tool_call_start"?null:t.messages.find(o=>NI(o,e.toolCall.id))??null,i=n?{state:t,target:n}:wc(t,r);return{...i.state,messages:i.state.messages.map(o=>xl(o,e,i.target))}}case"tool_call_input":{if(!e.toolCall)return t;let n=t.messages.find(i=>NI(i,e.toolCall.id));return n?{...t,messages:t.messages.map(i=>xl(i,e,n))}:t}case"tool_call_complete":{if(!e.toolCall)return t;let n=t.messages.find(o=>NI(o,e.toolCall.id)),i=n?{state:t,target:n}:wc(t,r);return{...i.state,messages:i.state.messages.map(o=>xl(o,e,i.target))}}case"paused":{let n=wc(t,r);return{...n.state,outcome:"paused",messages:n.state.messages.map(i=>i.id===n.target.id?{...i,isStreaming:!1}:i)}}case"done":{let n=wc(t,r);return{...n.state,outcome:t.outcome==="failed"?"failed":"completed",messages:n.state.messages.map(i=>xl(i,e,n.target))}}default:return t}}});var qR=h(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.AgentRequestValidationError=be.AGENT_TOOL_CONTINUATION_ACTION_BY_CONFIRMATION_STATE=be.AGENT_TOOL_CONTINUATION_ACTIONS=be.AGENT_IDENTIFIER_PATTERN=be.AGENT_REQUEST_LIMITS=void 0;be.validateAgentRequestPayload=PR;be.validateResourceBinding=FR;be.validateAgentSessionIdentity=$R;be.validateAgentSessionTarget=jR;be.validateAgentRequestSubmission=L5;be.isAgentMessagePayload=P5;be.isAgentToolContinuationPayload=F5;var mo=qr();be.AGENT_REQUEST_LIMITS={messageContentChars:5e4,identifierChars:256,attachedFiles:20,toolContinuations:20,continuationInputChars:1e5,frontendDraftsChars:2e6,accessRulesContextChars:2e6};be.AGENT_IDENTIFIER_PATTERN=/^[A-Za-z0-9._-]+$/;be.AGENT_TOOL_CONTINUATION_ACTIONS=["approve","reject","oauth_success","oauth_failure"];be.AGENT_TOOL_CONTINUATION_ACTION_BY_CONFIRMATION_STATE={[mo.ConfirmationAction.CONFIRMED]:"approve",[mo.ConfirmationAction.DECLINED]:"reject",[mo.ConfirmationAction.OAUTH_SUCCESS]:"oauth_success",[mo.ConfirmationAction.OAUTH_FAILURE]:"oauth_failure"};var Zf=class extends Error{constructor(e){super(e),this.name="AgentRequestValidationError"}};be.AgentRequestValidationError=Zf;function Ve(t){throw new Zf(t)}function qn(t,e){return(!t||typeof t!="object"||Array.isArray(t))&&Ve(`${e} must be an object`),t}function vc(t,e){(typeof t!="string"||!t.trim())&&Ve(`${e} must be a non-empty string`);let r=t.trim();return r.length>be.AGENT_REQUEST_LIMITS.identifierChars&&Ve(`${e} exceeds ${be.AGENT_REQUEST_LIMITS.identifierChars} characters`),be.AGENT_IDENTIFIER_PATTERN.test(r)||Ve(`${e} may only contain letters, numbers, dots, underscores, and hyphens`),r}function k5(t,e){return typeof t!="boolean"&&Ve(`${e} must be a boolean`),t}function UI(t,e){try{return JSON.stringify(t).length}catch{return Ve(`${e} must be JSON-serializable`)}}function N5(t,e){if(t!==void 0)return Array.isArray(t)||Ve(`${e} must be an array`),t.length>be.AGENT_REQUEST_LIMITS.attachedFiles&&Ve(`${e} exceeds ${be.AGENT_REQUEST_LIMITS.attachedFiles} entries`),t.map((r,n)=>{let i=qn(r,`${e}[${n}]`);return{...i,key:vc(i.key,`${e}[${n}].key`)}})}function OR({value:t,label:e,requireHidden:r}){let n=qn(t,e),i=vc(n.id,`${e}.id`);typeof n.content!="string"&&Ve(`${e}.content must be a string`);let o=n.content;o.length>be.AGENT_REQUEST_LIMITS.messageContentChars&&Ve(`${e}.content exceeds ${be.AGENT_REQUEST_LIMITS.messageContentChars} characters`);let s=k5(n.isHidden,`${e}.isHidden`);r&&!s&&Ve(`${e}.isHidden must be true`);let a=N5(n.attachedFiles,`${e}.attachedFiles`);return!o.trim()&&!a?.length&&Ve(`${e}.content may only be empty when an attachment is present`),{id:i,content:o,isHidden:s,...a?{attachedFiles:a}:{}}}function UR(t){if(t===void 0)return;let e=qn(t,"frontendDrafts");return UI(e,"frontendDrafts")>be.AGENT_REQUEST_LIMITS.frontendDraftsChars&&Ve(`frontendDrafts exceeds ${be.AGENT_REQUEST_LIMITS.frontendDraftsChars} characters`),e}function MR(t){if(t===void 0)return;let e=qn(t,"accessRulesContext");return UI(e,"accessRulesContext")>be.AGENT_REQUEST_LIMITS.accessRulesContextChars&&Ve(`accessRulesContext exceeds ${be.AGENT_REQUEST_LIMITS.accessRulesContextChars} characters`),e}function xR(t){if(t!==void 0)return(typeof t!="string"||!mo.AGENT_APPROVAL_MODES.includes(t))&&Ve(`request.approvalMode must be one of: ${mo.AGENT_APPROVAL_MODES.join(", ")}`),t}function LR(t,e){let r=qn(t,e),n=vc(r.toolCallId,`${e}.toolCallId`);return(typeof r.action!="string"||!be.AGENT_TOOL_CONTINUATION_ACTIONS.includes(r.action))&&Ve(`${e}.action must be one of: ${be.AGENT_TOOL_CONTINUATION_ACTIONS.join(", ")}`),r.input!==void 0&&UI(r.input,`${e}.input`)>be.AGENT_REQUEST_LIMITS.continuationInputChars&&Ve(`${e}.input exceeds ${be.AGENT_REQUEST_LIMITS.continuationInputChars} characters`),{toolCallId:n,action:r.action,...r.input!==void 0?{input:r.input}:{}}}function O5(t){if(t===void 0)return;(!Array.isArray(t)||t.length===0)&&Ve("request.toolContinuations must be a non-empty array"),t.length>be.AGENT_REQUEST_LIMITS.toolContinuations&&Ve(`request.toolContinuations exceeds ${be.AGENT_REQUEST_LIMITS.toolContinuations} entries`);let e=t.map((r,n)=>LR(r,`request.toolContinuations[${n}]`));return new Set(e.map(({toolCallId:r})=>r)).size!==e.length&&Ve("request.toolContinuations must not contain duplicate toolCallId values"),e}function U5(t){if(t===void 0)return;(typeof t!="string"||!t.trim())&&Ve("request.titleInput must be a non-empty string");let e=t.trim();return e.length>be.AGENT_REQUEST_LIMITS.messageContentChars&&Ve(`request.titleInput exceeds ${be.AGENT_REQUEST_LIMITS.messageContentChars} characters`),e}function M5(t){let e=OR({value:t.message,label:"request.message"}),r=U5(t.titleInput),n=t.hiddenSteeringMessage===void 0?void 0:OR({value:t.hiddenSteeringMessage,label:"request.hiddenSteeringMessage",requireHidden:!0});n&&n.id===e.id&&Ve("request.hiddenSteeringMessage.id must differ from request.message.id");let i=O5(t.toolContinuations),o=xR(t.approvalMode),s=UR(t.frontendDrafts),a=MR(t.accessRulesContext);return{kind:"message",message:e,...n?{hiddenSteeringMessage:n}:{},...r?{titleInput:r}:{},...i?{toolContinuations:i}:{},...o?{approvalMode:o}:{},...s?{frontendDrafts:s}:{},...a?{accessRulesContext:a}:{}}}function x5(t){let e=LR(t,"request"),r=xR(t.approvalMode),n=UR(t.frontendDrafts),i=MR(t.accessRulesContext);return{kind:"tool_continuation",...e,...r?{approvalMode:r}:{},...n?{frontendDrafts:n}:{},...i?{accessRulesContext:i}:{}}}function PR(t){let e=qn(t,"request");return e.kind==="message"?M5(e):e.kind==="tool_continuation"?x5(e):Ve('request.kind must be "message" or "tool_continuation"')}function FR(t,e){let r=qn(t,e);return(typeof r.kind!="string"||!mo.AGENT_SESSION_RESOURCE_KINDS.includes(r.kind))&&Ve(`${e}.kind must be one of: ${mo.AGENT_SESSION_RESOURCE_KINDS.join(", ")}`),{kind:r.kind,id:vc(r.id,`${e}.id`)}}function $R(t,e="session.createIfMissing"){let r=qn(t,e),n=r.projectId===void 0?void 0:vc(r.projectId,`${e}.projectId`),i=Object.values(mo.AgentType);(typeof r.agentId!="string"||!i.includes(r.agentId))&&Ve(`${e}.agentId must be one of: ${i.join(", ")}`);let o=r.resourceBinding===void 0?void 0:FR(r.resourceBinding,`${e}.resourceBinding`);return{agentId:r.agentId,...n?{projectId:n}:{},...o?{resourceBinding:o}:{}}}function jR(t){let e=qn(t,"session"),r=e.createIfMissing===void 0?void 0:$R(e.createIfMissing);return{id:vc(e.id,"session.id"),...r?{createIfMissing:r}:{}}}function L5(t){let e=qn(t,"body");return{session:jR(e.session),request:PR(e.request)}}function P5(t){return t.kind==="message"}function F5(t){return t.kind==="tool_continuation"}});var la=h(Lt=>{"use strict";var HR;Object.defineProperty(Lt,"__esModule",{value:!0});Lt.globalConfig=Lt.$ZodEncodeError=Lt.$ZodAsyncError=Lt.$brand=Lt.NEVER=void 0;Lt.$constructor=$5;Lt.config=j5;Lt.NEVER=Object.freeze({status:"aborted"});function $5(t,e,r){function n(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);let u=s.prototype,l=Object.keys(u);for(let A=0;A<l.length;A++){let d=l[A];d in a||(a[d]=u[d].bind(a))}}let i=r?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:t});function s(a){var c;let u=r?.Parent?new o:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}Lt.$brand=Symbol("zod_brand");var MI=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};Lt.$ZodAsyncError=MI;var xI=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};Lt.$ZodEncodeError=xI;(HR=globalThis).__zod_globalConfig??(HR.__zod_globalConfig={});Lt.globalConfig=globalThis.__zod_globalConfig;function j5(t){return t&&Object.assign(Lt.globalConfig,t),Lt.globalConfig}});var W=h(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.Class=q.BIGINT_FORMAT_RANGES=q.NUMBER_FORMAT_RANGES=q.primitiveTypes=q.propertyKeyTypes=q.getParsedType=q.allowsEval=q.captureStackTrace=void 0;q.assertEqual=H5;q.assertNotEqual=G5;q.assertIs=V5;q.assertNever=z5;q.assert=Y5;q.getEnumValues=J5;q.joinValues=W5;q.jsonStringifyReplacer=Z5;q.cached=VR;q.nullish=K5;q.cleanRegex=X5;q.floatSafeRemainder=eX;q.defineLazy=tX;q.objectClone=rX;q.assignProp=os;q.mergeDefs=yo;q.cloneDef=nX;q.getElementAtPath=iX;q.promiseAllObject=oX;q.randomString=sX;q.esc=aX;q.slugify=cX;q.isObject=LI;q.isPlainObject=Kf;q.shallowClone=uX;q.numKeys=lX;q.escapeRegex=dX;q.clone=ss;q.normalizeParams=fX;q.createTransparentProxy=pX;q.stringifyPrimitive=zR;q.optionalKeys=gX;q.pick=hX;q.omit=mX;q.extend=yX;q.safeExtend=EX;q.merge=IX;q.partial=CX;q.required=bX;q.aborted=SX;q.explicitlyAborted=BX;q.prefixIssues=QX;q.unwrapMessage=Ll;q.finalizeIssue=wX;q.getSizableOrigin=vX;q.getLengthableOrigin=_X;q.parsedType=DX;q.issue=TX;q.cleanEnum=RX;q.base64ToUint8Array=YR;q.uint8ArrayToBase64=JR;q.base64urlToUint8Array=kX;q.uint8ArrayToBase64url=NX;q.hexToUint8Array=OX;q.uint8ArrayToHex=UX;var q5=la();function H5(t){return t}function G5(t){return t}function V5(t){}function z5(t){throw new Error("Unexpected value in exhaustive check")}function Y5(t){}function J5(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function W5(t,e="|"){return t.map(r=>zR(r)).join(e)}function Z5(t,e){return typeof e=="bigint"?e.toString():e}function VR(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function K5(t){return t==null}function X5(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function eX(t,e){let r=t/e,n=Math.round(r),i=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<i?0:r-n}var GR=Symbol("evaluating");function tX(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==GR)return n===void 0&&(n=GR,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}function rX(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function os(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function yo(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function nX(t){return yo(t._zod.def)}function iX(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function oX(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let i={};for(let o=0;o<e.length;o++)i[e[o]]=n[o];return i})}function sX(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function aX(t){return JSON.stringify(t)}function cX(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}q.captureStackTrace="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function LI(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}q.allowsEval=VR(()=>{if(q5.globalConfig.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Kf(t){if(LI(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(LI(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function uX(t){return Kf(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function lX(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var AX=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}};q.getParsedType=AX;q.propertyKeyTypes=new Set(["string","number","symbol"]);q.primitiveTypes=new Set(["string","number","bigint","boolean","symbol","undefined"]);function dX(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ss(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function fX(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function pX(t){let e;return new Proxy({},{get(r,n,i){return e??(e=t()),Reflect.get(e,n,i)},set(r,n,i,o){return e??(e=t()),Reflect.set(e,n,i,o)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,i){return e??(e=t()),Reflect.defineProperty(e,n,i)}})}function zR(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function gX(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}q.NUMBER_FORMAT_RANGES={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};q.BIGINT_FORMAT_RANGES={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function hX(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=yo(t._zod.def,{get shape(){let s={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=r.shape[a])}return os(this,"shape",s),s},checks:[]});return ss(t,o)}function mX(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=yo(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return os(this,"shape",s),s},checks:[]});return ss(t,o)}function yX(t,e){if(!Kf(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let o=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=yo(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return os(this,"shape",o),o}});return ss(t,i)}function EX(t,e){if(!Kf(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=yo(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return os(this,"shape",n),n}});return ss(t,r)}function IX(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=yo(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return os(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return ss(t,r)}function CX(t,e,r){let i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=yo(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=t?new t({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=t?new t({type:"optional",innerType:a[u]}):a[u];return os(this,"shape",c),c},checks:[]});return ss(e,s)}function bX(t,e,r){let n=yo(e._zod.def,{get shape(){let i=e._zod.def.shape,o={...i};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:i[s]}))}else for(let s in i)o[s]=new t({type:"nonoptional",innerType:i[s]});return os(this,"shape",o),o}});return ss(e,n)}function SX(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function BX(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function QX(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function Ll(t){return typeof t=="string"?t:t?.message}function wX(t,e,r){let n=t.message?t.message:Ll(t.inst?._zod.def?.error?.(t))??Ll(e?.error?.(t))??Ll(r.customError?.(t))??Ll(r.localeError?.(t))??"Invalid input",{inst:i,continue:o,input:s,...a}=t;return a.path??(a.path=[]),a.message=n,e?.reportInput&&(a.input=s),a}function vX(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function _X(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function DX(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function TX(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function RX(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function YR(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function JR(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function kX(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return YR(e+r)}function NX(t){return JR(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function OX(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n/2]=Number.parseInt(e.slice(n,n+2),16);return r}function UX(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var PI=class{constructor(...e){}};q.Class=PI});var FI=h(kt=>{"use strict";var MX=kt&&kt.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),xX=kt&&kt.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),LX=kt&&kt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&MX(e,t,r);return xX(e,t),e};Object.defineProperty(kt,"__esModule",{value:!0});kt.$ZodRealError=kt.$ZodError=void 0;kt.flattenError=FX;kt.formatError=$X;kt.treeifyError=jX;kt.toDotPath=KR;kt.prettifyError=qX;var WR=la(),PX=LX(W()),ZR=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,PX.jsonStringifyReplacer,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})};kt.$ZodError=(0,WR.$constructor)("$ZodError",ZR);kt.$ZodRealError=(0,WR.$constructor)("$ZodError",ZR,{Parent:Error});function FX(t,e=r=>r.message){let r={},n=[];for(let i of t.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}function $X(t,e=r=>r.message){let r={_errors:[]},n=(i,o=[])=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>n({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)r._errors.push(e(s));else{let c=r,u=0;for(;u<a.length;){let l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(e(s))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return n(t),r}function jX(t,e=r=>r.message){let r={errors:[]},n=(i,o=[])=>{var s,a;for(let c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>n({issues:u},[...o,...c.path]));else if(c.code==="invalid_key")n({issues:c.issues},[...o,...c.path]);else if(c.code==="invalid_element")n({issues:c.issues},[...o,...c.path]);else{let u=[...o,...c.path];if(u.length===0){r.errors.push(e(c));continue}let l=r,A=0;for(;A<u.length;){let d=u[A],f=A===u.length-1;typeof d=="string"?(l.properties??(l.properties={}),(s=l.properties)[d]??(s[d]={errors:[]}),l=l.properties[d]):(l.items??(l.items=[]),(a=l.items)[d]??(a[d]={errors:[]}),l=l.items[d]),f&&l.errors.push(e(c)),A++}}};return n(t),r}function KR(t){let e=[],r=t.map(n=>typeof n=="object"?n.key:n);for(let n of r)typeof n=="number"?e.push(`[${n}]`):typeof n=="symbol"?e.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?e.push(`[${JSON.stringify(n)}]`):(e.length&&e.push("."),e.push(n));return e.join("")}function qX(t){let e=[],r=[...t.issues].sort((n,i)=>(n.path??[]).length-(i.path??[]).length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${KR(n.path)}`);return e.join(`
|
|
16
16
|
`)}});var jI=h(F=>{"use strict";var HX=F&&F.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),GX=F&&F.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),$I=F&&F.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&HX(e,t,r);return GX(e,t),e};Object.defineProperty(F,"__esModule",{value:!0});F.safeDecodeAsync=F._safeDecodeAsync=F.safeEncodeAsync=F._safeEncodeAsync=F.safeDecode=F._safeDecode=F.safeEncode=F._safeEncode=F.decodeAsync=F._decodeAsync=F.encodeAsync=F._encodeAsync=F.decode=F._decode=F.encode=F._encode=F.safeParseAsync=F._safeParseAsync=F.safeParse=F._safeParse=F.parseAsync=F._parseAsync=F.parse=F._parse=void 0;var _c=$I(la()),Br=$I(FI()),Dc=$I(W()),VX=t=>(e,r,n,i)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new _c.$ZodAsyncError;if(s.issues.length){let a=new(i?.Err??t)(s.issues.map(c=>Dc.finalizeIssue(c,o,_c.config())));throw Dc.captureStackTrace(a,i?.callee),a}return s.value};F._parse=VX;F.parse=(0,F._parse)(Br.$ZodRealError);var zX=t=>async(e,r,n,i)=>{let o=n?{...n,async:!0}:{async:!0},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(i?.Err??t)(s.issues.map(c=>Dc.finalizeIssue(c,o,_c.config())));throw Dc.captureStackTrace(a,i?.callee),a}return s.value};F._parseAsync=zX;F.parseAsync=(0,F._parseAsync)(Br.$ZodRealError);var YX=t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new _c.$ZodAsyncError;return o.issues.length?{success:!1,error:new(t??Br.$ZodError)(o.issues.map(s=>Dc.finalizeIssue(s,i,_c.config())))}:{success:!0,data:o.value}};F._safeParse=YX;F.safeParse=(0,F._safeParse)(Br.$ZodRealError);var JX=t=>async(e,r,n)=>{let i=n?{...n,async:!0}:{async:!0},o=e._zod.run({value:r,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>Dc.finalizeIssue(s,i,_c.config())))}:{success:!0,data:o.value}};F._safeParseAsync=JX;F.safeParseAsync=(0,F._safeParseAsync)(Br.$ZodRealError);var WX=t=>(e,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return(0,F._parse)(t)(e,r,i)};F._encode=WX;F.encode=(0,F._encode)(Br.$ZodRealError);var ZX=t=>(e,r,n)=>(0,F._parse)(t)(e,r,n);F._decode=ZX;F.decode=(0,F._decode)(Br.$ZodRealError);var KX=t=>async(e,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return(0,F._parseAsync)(t)(e,r,i)};F._encodeAsync=KX;F.encodeAsync=(0,F._encodeAsync)(Br.$ZodRealError);var XX=t=>async(e,r,n)=>(0,F._parseAsync)(t)(e,r,n);F._decodeAsync=XX;F.decodeAsync=(0,F._decodeAsync)(Br.$ZodRealError);var e8=t=>(e,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return(0,F._safeParse)(t)(e,r,i)};F._safeEncode=e8;F.safeEncode=(0,F._safeEncode)(Br.$ZodRealError);var t8=t=>(e,r,n)=>(0,F._safeParse)(t)(e,r,n);F._safeDecode=t8;F.safeDecode=(0,F._safeDecode)(Br.$ZodRealError);var r8=t=>async(e,r,n)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return(0,F._safeParseAsync)(t)(e,r,i)};F._safeEncodeAsync=r8;F.safeEncodeAsync=(0,F._safeEncodeAsync)(Br.$ZodRealError);var n8=t=>async(e,r,n)=>(0,F._safeParseAsync)(t)(e,r,n);F._safeDecodeAsync=n8;F.safeDecodeAsync=(0,F._safeDecodeAsync)(Br.$ZodRealError)});var Xf=h(D=>{"use strict";var i8=D&&D.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),o8=D&&D.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),s8=D&&D.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&i8(e,t,r);return o8(e,t),e};Object.defineProperty(D,"__esModule",{value:!0});D.sha256_base64url=D.sha256_base64=D.sha256_hex=D.sha1_base64url=D.sha1_base64=D.sha1_hex=D.md5_base64url=D.md5_base64=D.md5_hex=D.hex=D.uppercase=D.lowercase=D.undefined=D.null=D.boolean=D.number=D.integer=D.bigint=D.string=D.date=D.e164=D.httpProtocol=D.domain=D.hostname=D.base64url=D.base64=D.cidrv6=D.cidrv4=D.mac=D.ipv6=D.ipv4=D.browserEmail=D.idnEmail=D.unicodeEmail=D.rfc5322Email=D.html5Email=D.email=D.uuid7=D.uuid6=D.uuid4=D.uuid=D.guid=D.extendedDuration=D.duration=D.nanoid=D.ksuid=D.xid=D.ulid=D.cuid2=D.cuid=void 0;D.sha512_base64url=D.sha512_base64=D.sha512_hex=D.sha384_base64url=D.sha384_base64=D.sha384_hex=void 0;D.emoji=l8;D.time=d8;D.datetime=f8;var a8=s8(W());D.cuid=/^[cC][0-9a-z]{6,}$/;D.cuid2=/^[0-9a-z]+$/;D.ulid=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;D.xid=/^[0-9a-vA-V]{20}$/;D.ksuid=/^[A-Za-z0-9]{27}$/;D.nanoid=/^[a-zA-Z0-9_-]{21}$/;D.duration=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;D.extendedDuration=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;D.guid=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;var c8=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;D.uuid=c8;D.uuid4=(0,D.uuid)(4);D.uuid6=(0,D.uuid)(6);D.uuid7=(0,D.uuid)(7);D.email=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;D.html5Email=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;D.rfc5322Email=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;D.unicodeEmail=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;D.idnEmail=D.unicodeEmail;D.browserEmail=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;var u8="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function l8(){return new RegExp(u8,"u")}D.ipv4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;D.ipv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var A8=t=>{let e=a8.escapeRegex(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)};D.mac=A8;D.cidrv4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;D.cidrv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;D.base64=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;D.base64url=/^[A-Za-z0-9_-]*$/;D.hostname=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/;D.domain=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;D.httpProtocol=/^https?$/;D.e164=/^\+[1-9]\d{6,14}$/;var XR="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";D.date=new RegExp(`^${XR}$`);function ek(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function d8(t){return new RegExp(`^${ek(t)}$`)}function f8(t){let e=ek({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${XR}T(?:${n})$`)}var p8=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)};D.string=p8;D.bigint=/^-?\d+n?$/;D.integer=/^-?\d+$/;D.number=/^-?\d+(?:\.\d+)?$/;D.boolean=/^(?:true|false)$/i;var g8=/^null$/i;D.null=g8;var h8=/^undefined$/i;D.undefined=h8;D.lowercase=/^[^A-Z]*$/;D.uppercase=/^[^a-z]*$/;D.hex=/^[0-9a-fA-F]*$/;function Pl(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function Fl(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}D.md5_hex=/^[0-9a-fA-F]{32}$/;D.md5_base64=Pl(22,"==");D.md5_base64url=Fl(22);D.sha1_hex=/^[0-9a-fA-F]{40}$/;D.sha1_base64=Pl(27,"=");D.sha1_base64url=Fl(27);D.sha256_hex=/^[0-9a-fA-F]{64}$/;D.sha256_base64=Pl(43,"=");D.sha256_base64url=Fl(43);D.sha384_hex=/^[0-9a-fA-F]{96}$/;D.sha384_base64=Pl(64,"");D.sha384_base64url=Fl(64);D.sha512_hex=/^[0-9a-fA-F]{128}$/;D.sha512_base64=Pl(86,"==");D.sha512_base64url=Fl(86)});var ep=h(H=>{"use strict";var m8=H&&H.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),y8=H&&H.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),qI=H&&H.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&m8(e,t,r);return y8(e,t),e};Object.defineProperty(H,"__esModule",{value:!0});H.$ZodCheckOverwrite=H.$ZodCheckMimeType=H.$ZodCheckProperty=H.$ZodCheckEndsWith=H.$ZodCheckStartsWith=H.$ZodCheckIncludes=H.$ZodCheckUpperCase=H.$ZodCheckLowerCase=H.$ZodCheckRegex=H.$ZodCheckStringFormat=H.$ZodCheckLengthEquals=H.$ZodCheckMinLength=H.$ZodCheckMaxLength=H.$ZodCheckSizeEquals=H.$ZodCheckMinSize=H.$ZodCheckMaxSize=H.$ZodCheckBigIntFormat=H.$ZodCheckNumberFormat=H.$ZodCheckMultipleOf=H.$ZodCheckGreaterThan=H.$ZodCheckLessThan=H.$ZodCheck=void 0;var ot=qI(la()),HI=qI(Xf()),bt=qI(W());H.$ZodCheck=ot.$constructor("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])});var rk={number:"number",bigint:"bigint",object:"date"};H.$ZodCheckLessThan=ot.$constructor("$ZodCheckLessThan",(t,e)=>{H.$ZodCheck.init(t,e);let r=rk[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,o=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}});H.$ZodCheckGreaterThan=ot.$constructor("$ZodCheckGreaterThan",(t,e)=>{H.$ZodCheck.init(t,e);let r=rk[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,o=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}});H.$ZodCheckMultipleOf=ot.$constructor("$ZodCheckMultipleOf",(t,e)=>{H.$ZodCheck.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):bt.floatSafeRemainder(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}});H.$ZodCheckNumberFormat=ot.$constructor("$ZodCheckNumberFormat",(t,e)=>{H.$ZodCheck.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,o]=bt.NUMBER_FORMAT_RANGES[e.format];t._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=i,a.maximum=o,r&&(a.pattern=HI.integer)}),t._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}});H.$ZodCheckBigIntFormat=ot.$constructor("$ZodCheckBigIntFormat",(t,e)=>{H.$ZodCheck.init(t,e);let[r,n]=bt.BIGINT_FORMAT_RANGES[e.format];t._zod.onattach.push(i=>{let o=i._zod.bag;o.format=e.format,o.minimum=r,o.maximum=n}),t._zod.check=i=>{let o=i.value;o<r&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),o>n&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:n,inclusive:!0,inst:t,continue:!e.abort})}});H.$ZodCheckMaxSize=ot.$constructor("$ZodCheckMaxSize",(t,e)=>{var r;H.$ZodCheck.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!bt.nullish(i)&&i.size!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let i=n.value;i.size<=e.maximum||n.issues.push({origin:bt.getSizableOrigin(i),code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});H.$ZodCheckMinSize=ot.$constructor("$ZodCheckMinSize",(t,e)=>{var r;H.$ZodCheck.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!bt.nullish(i)&&i.size!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;i.size>=e.minimum||n.issues.push({origin:bt.getSizableOrigin(i),code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});H.$ZodCheckSizeEquals=ot.$constructor("$ZodCheckSizeEquals",(t,e)=>{var r;H.$ZodCheck.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!bt.nullish(i)&&i.size!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.size,i.maximum=e.size,i.size=e.size}),t._zod.check=n=>{let i=n.value,o=i.size;if(o===e.size)return;let s=o>e.size;n.issues.push({origin:bt.getSizableOrigin(i),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}});H.$ZodCheckMaxLength=ot.$constructor("$ZodCheckMaxLength",(t,e)=>{var r;H.$ZodCheck.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!bt.nullish(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let i=n.value;if(i.length<=e.maximum)return;let s=bt.getLengthableOrigin(i);n.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});H.$ZodCheckMinLength=ot.$constructor("$ZodCheckMinLength",(t,e)=>{var r;H.$ZodCheck.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!bt.nullish(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let s=bt.getLengthableOrigin(i);n.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});H.$ZodCheckLengthEquals=ot.$constructor("$ZodCheckLengthEquals",(t,e)=>{var r;H.$ZodCheck.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!bt.nullish(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=n=>{let i=n.value,o=i.length;if(o===e.length)return;let s=bt.getLengthableOrigin(i),a=o>e.length;n.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}});H.$ZodCheckStringFormat=ot.$constructor("$ZodCheckStringFormat",(t,e)=>{var r,n;H.$ZodCheck.init(t,e),t._zod.onattach.push(i=>{let o=i._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})});H.$ZodCheckRegex=ot.$constructor("$ZodCheckRegex",(t,e)=>{H.$ZodCheckStringFormat.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}});H.$ZodCheckLowerCase=ot.$constructor("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=HI.lowercase),H.$ZodCheckStringFormat.init(t,e)});H.$ZodCheckUpperCase=ot.$constructor("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=HI.uppercase),H.$ZodCheckStringFormat.init(t,e)});H.$ZodCheckIncludes=ot.$constructor("$ZodCheckIncludes",(t,e)=>{H.$ZodCheck.init(t,e);let r=bt.escapeRegex(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(i=>{let o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}});H.$ZodCheckStartsWith=ot.$constructor("$ZodCheckStartsWith",(t,e)=>{H.$ZodCheck.init(t,e);let r=new RegExp(`^${bt.escapeRegex(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}});H.$ZodCheckEndsWith=ot.$constructor("$ZodCheckEndsWith",(t,e)=>{H.$ZodCheck.init(t,e);let r=new RegExp(`.*${bt.escapeRegex(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});function tk(t,e,r){t.issues.length&&e.issues.push(...bt.prefixIssues(r,t.issues))}H.$ZodCheckProperty=ot.$constructor("$ZodCheckProperty",(t,e)=>{H.$ZodCheck.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(i=>tk(i,r,e.property));tk(n,r,e.property)}});H.$ZodCheckMimeType=ot.$constructor("$ZodCheckMimeType",(t,e)=>{H.$ZodCheck.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t,continue:!e.abort})}});H.$ZodCheckOverwrite=ot.$constructor("$ZodCheckOverwrite",(t,e)=>{H.$ZodCheck.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}})});var VI=h(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.Doc=void 0;var GI=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
|
|
@@ -641,7 +641,7 @@ ${e.map(r=>`- ${r.path}: ${r.message}`).join(`
|
|
|
641
641
|
`).map(n=>`${e}${n}`)].join(`
|
|
642
642
|
`)}function ds(t,e){return t.includes(`
|
|
643
643
|
`)?HAe(t,e):JSON.stringify(t)}function GAe(t){let e=["---"];if(e.push(`name: ${ds(t.id," ")}`),e.push(`title: ${ds(t.name," ")}`),e.push(`when_to_run: ${ds(t.whenToRun," ")}`),t.systemRefs.length>0){e.push("systems:");for(let n of t.systemRefs)e.push(` - id: ${ds(n.id," ")}`)}if(t.toolRefs.length>0){e.push("tools:");for(let n of t.toolRefs)e.push(` - id: ${ds(n.id," ")}`)}if(t.credentialRefs.length>0){e.push("credentials:");for(let n of t.credentialRefs)e.push(` - id: ${ds(n.id," ")}`)}if(t.fileRefs.length>0){e.push("files:");for(let n of t.fileRefs)e.push(` - ${ds(n.name," ")}`);e.push(`# read attachments at /org/playbooks/${t.id}/files/<name>.json (.raw for original bytes)`)}e.push(`completion_criteria: ${ds(t.completionCriteria," ")}`),e.push("---"),e.push(""),t.inputs.trim()&&(e.push("## Required inputs"),e.push(""),e.push(t.inputs.trim()),e.push("")),e.push("## Instructions"),e.push(""),e.push(t.instructions.trim()),e.push("");let r=e.join(`
|
|
644
|
-
`);if(r.length>AM.PLAYBOOK_LIMITS.compiledRender)throw new Error(`Compiled playbook render for '${t.id}' exceeds ${AM.PLAYBOOK_LIMITS.compiledRender} chars (${r.length})`);return r}});var fM=h(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.PROJECT_LIMITS=So.PROJECT_TASK_STATUSES=So.PROJECT_RESOURCE_TYPES=void 0;So.projectResourceKey=VAe;So.PROJECT_RESOURCE_TYPES=["system","playbook","artifact","file","tool"];So.PROJECT_TASK_STATUSES=["not_started","in_progress","waiting","done"];So.PROJECT_LIMITS={name:80,description:500,taskName:120,taskDescription:5e3,taskResources:100};function VAe(t){return`${t.type}:${t.id}`}});var $C=h(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.RESOURCE_KINDS=vn.RESOURCE_DEFINITIONS=void 0;vn.isResourceKind=zAe;vn.getResourceDefinition=YAe;vn.RESOURCE_DEFINITIONS={tool:{label:"Tool",pluralLabel:"Tools",collectionKey:"tools",memberDefaultPermission:"editor",pickerDefaultPermission:"editor"},system:{label:"System",pluralLabel:"Systems",collectionKey:"systems",memberDefaultPermission:"editor",pickerDefaultPermission:"editor"},credential:{label:"Credential",pluralLabel:"Credentials",collectionKey:"credentials",pickerDefaultPermission:"viewer"},playbook:{label:"Playbook",pluralLabel:"Playbooks",collectionKey:"playbooks",pickerDefaultPermission:"editor"},artifact:{label:"Artifact",pluralLabel:"Artifacts",collectionKey:"artifacts",pickerDefaultPermission:"editor"},file:{label:"File",pluralLabel:"Files",collectionKey:"files",pickerDefaultPermission:"viewer"},project:{label:"Project",pluralLabel:"Projects",collectionKey:"projects",pickerDefaultPermission:"viewer"}};vn.RESOURCE_KINDS=Object.keys(vn.RESOURCE_DEFINITIONS);function zAe(t){return typeof t=="string"&&Object.prototype.hasOwnProperty.call(vn.RESOURCE_DEFINITIONS,t)}function YAe(t){return vn.RESOURCE_DEFINITIONS[t]}});var BM=h(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.RESERVED_ROLE_NAMES=ne.RESERVED_ROLE_IDS=ne.PREDEFINED_ROLE_IDS=void 0;ne.toResourceRef=aA;ne.toWildcardResourceRef=cA;ne.getDefaultMemberResourceGrants=JAe;ne.parseResourceRef=Ng;ne.getWildcardResourceRef=pM;ne.normalizeResourcePermissions=fs;ne.permissionSatisfies=Og;ne.highestResourcePermission=Ug;ne.grantHasPermission=HC;ne.grantMatchesResource=$c;ne.getEffectiveResourcePermissions=GC;ne.hasResourcePermission=WAe;ne.getRoleResourceGrants=Mg;ne.getAllowedResourceIds=gM;ne.getAllowedResourceIdsForRoles=xg;ne.getEffectiveResourcePermissionsForRoles=jc;ne.getAllowedToolIds=hM;ne.getAllowedSystemIds=mM;ne.pickLongestHeldResource=KAe;ne.getAllowedCredentialsIds=XAe;ne.getEffectiveCredentialsPermissions=ede;ne.getEffectiveToolPermissions=tde;ne.getEffectiveSystemPermissions=rde;ne.checkResourcePermission=Lg;ne.isToolAllowed=nde;ne.isSystemVisible=ide;ne.isPlaybookVisible=ode;ne.hasAllSystems=sde;ne.hasAllTools=ade;ne.getResourceGrantSources=yM;ne.getSharePermissionForResource=EM;ne.getAccessRulePermissionForResource=IM;ne.hasAdminBaseRole=VC;ne.resolveResourceAccessForRoles=cde;ne.normalizeResourceGrantInput=CM;ne.normalizeRoleResourceGrantInput=ude;ne.isPredefinedRole=lde;ne.isReservedRoleId=Ade;ne.isReservedRoleName=dde;ne.hasRole=fde;ne.getRoleIds=pde;ne.getBaseRole=bM;ne.getBaseRoleId=gde;ne.getPersonalRole=SM;ne.getPersonalRoleId=hde;var Rg=$C(),kg="*";function aA(t,e){if(!e||e===kg)throw new Error("Resource id is required");return`${t}:${encodeURIComponent(e)}`}function cA(t){return`${t}:${kg}`}function JAe(){return Rg.RESOURCE_KINDS.flatMap(t=>{let e=(0,Rg.getResourceDefinition)(t).memberDefaultPermission;return e?[{resourceRef:cA(t),permissions:[e]}]:[]})}function Ng(t){let e=t.indexOf(":");if(e<=0)return null;let r=t.slice(0,e);if(!(0,Rg.isResourceKind)(r))return null;let n=t.slice(e+1);if(!n)return null;if(n===kg)return{kind:r,id:kg,isWildcard:!0};try{return{kind:r,id:decodeURIComponent(n),isWildcard:!1}}catch{return null}}function pM(t){let e=Ng(t);return e?cA(e.kind):null}function fs(t){let e=new Set;for(let r of t||[])(r==="viewer"||r==="editor")&&e.add(r);return e.has("editor")&&e.add("viewer"),Array.from(e)}function Og(t,e){return t===e||t==="editor"&&e==="viewer"}function Ug(t){let e=fs(t);if(e.includes("editor"))return"editor";if(e.includes("viewer"))return"viewer"}function HC(t,e){return t.revokedAt?!1:fs(t.permissions).some(r=>Og(r,e))}function $c(t,e){return t.revokedAt?!1:t.resourceRef===e||t.resourceRef===pM(e)}function GC(t,e){let r=new Set;for(let n of t)if($c(n,e))for(let i of fs(n.permissions))r.add(i);return Array.from(r)}function WAe(t,e,r){return GC(t,e).some(n=>Og(n,r))}function Mg(t){return t.flatMap(e=>e.isBaseRole&&e.id==="admin"?[]:e.resourceGrants||[])}function gM(t,e,r){let n=cA(e),i=new Set;for(let o of t){if(!HC(o,r))continue;if(o.resourceRef===n)return;let s=Ng(o.resourceRef);s?.kind===e&&!s.isWildcard&&i.add(s.id)}return Array.from(i)}function xg(t,e,r){if(!VC(t))return gM(Mg(t),e,r)}function jc(t,e,r){return VC(t)?["editor","viewer"]:GC(Mg(t),aA(e,r))}function ZAe(t){return(0,Rg.getResourceDefinition)(t).label}function hM(t,e="viewer"){return xg(t,"tool",e)}function mM(t,e="viewer"){return xg(t,"system",e)}var qC=Number.MAX_SAFE_INTEGER;function jC(t){if(!t)return qC;let e=new Date(t).getTime();return Number.isNaN(e)?qC:e}function KAe(t,e,r){if(t.length<=1)return t[0];let n=i=>{let o=aA(r,i.id),s=qC;for(let a of e)$c(a,o)&&(s=Math.min(s,jC(a.createdAt)));return s};return[...t].sort((i,o)=>{let s=n(i)-n(o);return s!==0?s:jC(i.createdAt)-jC(o.createdAt)})[0]}function XAe(t,e="viewer"){return xg(t,"credential",e)}function ede(t,e){return jc(t,"credential",e)}function tde(t,e){return jc(t,"tool",e)}function rde(t,e){return jc(t,"system",e)}function Lg(t,e,r,n){return jc(t,e,r).some(o=>Og(o,n))?{allowed:!0}:{allowed:!1,error:`${ZAe(e)} '${r}' requires a '${n}' grant`}}function nde(t,e,r="viewer"){return Lg(t,"tool",e,r)}function ide(t,e,r="viewer"){return Lg(t,"system",e,r)}function ode(t,e,r="viewer"){return Lg(t,"playbook",e,r)}function sde(t,e="viewer"){return mM(t,e)===void 0}function ade(t,e="viewer"){return hM(t,e)===void 0}function yM(t,e,r="viewer"){let n=new Set;for(let i of t)$c(i,e)&&HC(i,r)&&n.add(i.source);return Array.from(n)}function EM(t,e){let r=t.filter(n=>n.source==="share"&&$c(n,e)).flatMap(n=>fs(n.permissions));return Ug(r)}function IM(t,e){let r=t.filter(n=>n.source==="access_rule"&&$c(n,e)).flatMap(n=>fs(n.permissions));return Ug(r)}function VC(t){return t.some(e=>e.isBaseRole&&e.id==="admin")}function cde({roles:t,resource:e,userId:r}){let n=aA(e.kind,e.id),i=Mg(t),o=new Set(jc(t,e.kind,e.id)),s=new Set(yM(i,n));e.ownerUserId&&e.ownerUserId===r&&(o.add("editor"),o.add("viewer"),s.add("ownership"));let a=fs(Array.from(o));return{permissions:a,sources:Array.from(s),sharePermission:EM(i,n),accessRulePermission:IM(i,n),maxPermission:Ug(a)}}function CM(t){let e=Ng(t.resourceRef);if(!e)throw new Error(`Invalid resource ref '${t.resourceRef}'`);return{...t,resourceRef:e.isWildcard?cA(e.kind):aA(e.kind,e.id),permissions:fs(t.permissions||["viewer"]),source:t.source||"access_rule"}}function ude(t){let e=CM({resourceRef:t.resourceRef,permissions:t.permissions,source:"access_rule"});return{resourceRef:e.resourceRef,permissions:e.permissions,source:"access_rule"}}ne.PREDEFINED_ROLE_IDS=["admin","member","service_account"];ne.RESERVED_ROLE_IDS=["admin","member","service_account"];ne.RESERVED_ROLE_NAMES=["member","admin","service account"];function lde(t){return ne.PREDEFINED_ROLE_IDS.includes(t)}function Ade(t){return ne.RESERVED_ROLE_IDS.includes(t)}function dde(t){return ne.RESERVED_ROLE_NAMES.includes(t.toLowerCase().trim())}function fde(t,e){return t.some(r=>r.id===e)}function pde(t){return t.map(e=>e.id)}function bM(t){let e=t.filter(r=>r.isBaseRole);return e.length===1?e[0]:null}function gde(t){let e=bM(t);return e?e.id:null}function SM(t){return t.find(e=>e.isPersonalRole)||null}function hde(t){let e=SM(t);return e?e.id:null}});var wM=h(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.NOTIFICATION_EXCLUDED_REQUEST_SOURCES=_r.CLIENT_REQUEST_SOURCES=_r.REQUEST_SOURCES=void 0;_r.isRequestSource=QM;_r.isClientRequestSource=Ede;_r.parseRequestSource=Ide;var Kt=qr();_r.REQUEST_SOURCES=[Kt.RequestSource.API,Kt.RequestSource.FRONTEND,Kt.RequestSource.AGENT,Kt.RequestSource.SCHEDULER,Kt.RequestSource.MCP,Kt.RequestSource.TOOL_CHAIN,Kt.RequestSource.WEBHOOK,Kt.RequestSource.CLI];_r.CLIENT_REQUEST_SOURCES=[Kt.RequestSource.FRONTEND,Kt.RequestSource.AGENT,Kt.RequestSource.MCP,Kt.RequestSource.CLI];_r.NOTIFICATION_EXCLUDED_REQUEST_SOURCES=[Kt.RequestSource.FRONTEND,Kt.RequestSource.AGENT,Kt.RequestSource.MCP];var mde=new Set(_r.REQUEST_SOURCES),yde=new Set(_r.CLIENT_REQUEST_SOURCES);function QM(t){return mde.has(t)}function Ede(t){return yde.has(t)}function Ide(t){let e=t.toLowerCase();return QM(e)?e:void 0}});var vM=h(Pg=>{"use strict";Object.defineProperty(Pg,"__esModule",{value:!0});Pg.contextSourceTemplates=void 0;var Cde={slack:{category:"workspace",systemId:"slack",onboardingOrder:7,onboardingDescription:"Connect joined public channels so superglue can use relevant workspace context."},gmail:{category:"email",systemId:"gmail",onboardingOrder:9,onboardingDescription:"Let superglue access your gmail inbox. superglue will never send emails on your behalf."},fathomMcp:{category:"meetings",systemId:"fathomMcp",onboardingOrder:4,onboardingDescription:"Let superglue use meeting notes and transcripts. superglue will never join or record meetings."},granolaMcp:{category:"meetings",systemId:"granolaMcp",onboardingOrder:2,onboardingDescription:"Let superglue use notes and transcripts. superglue will never join or record meetings."},readAiMcp:{category:"meetings",systemId:"read-ai",onboardingOrder:6,onboardingDescription:"Let superglue use meeting summaries and transcripts. superglue will never join or record meetings."},otterMcp:{category:"meetings",systemId:"otter",onboardingOrder:7,onboardingDescription:"Let superglue use meeting notes and transcripts. superglue will never join or record meetings."},googleDrive:{category:"workspace",systemId:"google-drive",onboardingOrder:9,onboardingDescription:"Connect accessible Drive files for relevant workspace context."},box:{category:"workspace",systemId:"box",onboardingOrder:11,onboardingDescription:"Connect accessible Box files for relevant workspace context."},dropbox:{category:"workspace",systemId:"dropbox",onboardingOrder:12,onboardingDescription:"Connect accessible Dropbox files for relevant workspace context."},jira:{category:"workspace",systemId:"jira",onboardingOrder:13,onboardingDescription:"Connect Jira projects, issues, and comments for relevant workspace context."},rocketlaneMcp:{category:"workspace",systemId:"rocketlane",onboardingOrder:14,onboardingDescription:"Connect Rocketlane projects, tasks, and status for relevant workspace context."},notion:{category:"workspace",systemId:"notion",onboardingOrder:8,onboardingDescription:"Connect selected Notion pages for relevant workspace context."},sharepoint:{category:"workspace",systemId:"sharepoint",onboardingOrder:10,onboardingDescription:"Connect accessible SharePoint sites and files for workspace context."},microsoftTeams:{category:"workspace",systemId:"microsoft-teams",onboardingOrder:6,onboardingDescription:"Connect Microsoft Teams channels and meetings for workspace context."},outlookMail:{category:"email",systemId:"outlook-mail",onboardingOrder:8,onboardingDescription:"Let superglue access your outlook inbox. superglue will never send emails on your behalf."},circleback:{category:"meetings",systemId:"circleback",onboardingOrder:1,onboardingDescription:"Let superglue use notes and transcripts. superglue will never join or record meetings.",endpointAliases:["https://app.circleback.ai/api/mcp"]},fireflies:{category:"meetings",systemId:"fireflies",onboardingOrder:3,onboardingDescription:"Let superglue use transcripts and summaries. superglue will never join or record meetings."},fellowMcp:{category:"meetings",systemId:"fellow",onboardingOrder:5,onboardingDescription:"Let superglue use meeting notes and transcripts. superglue will never join or record meetings."}};Pg.contextSourceTemplates=Cde});var YC=h(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.systemOptions=Pe.systems=void 0;Pe.getSystemTemplateOAuthClientMode=Sde;Pe.getSystemTemplateAuthentication=TM;Pe.mergeSystemTemplateAuthentication=RM;Pe.resolveSystemAuthentication=zC;Pe.getContextSourceTemplates=kM;Pe.resolveContextSourceSetup=Rde;Pe.findTemplateForSystem=$g;Pe.uniqueKeywords=kde;Pe.getOAuthConfig=Nde;Pe.getOAuthTokenExchangeConfig=Ode;Pe.getOAuthTokenUrl=Ude;var DM=iA(),bde=vM(),Fg=Dg();function Sde(t){let e=t?.oauth;if(e)return e.registrationUrl?"dynamic":e.managed?"managed":"custom"}function Bde(t){let e=t?.split(/[,\s]+/).filter(Boolean);return e?.length?e:void 0}function TM(t){if(!t?.preferredAuthType)return;if(t.preferredAuthType!=="oauth2")return{type:t.preferredAuthType};let e=t.oauth;if(!e)return{type:"oauth2"};let r={};e.tokenAuthMethod&&(r.tokenAuthMethod=e.tokenAuthMethod),e.tokenContentType&&(r.tokenContentType=e.tokenContentType),e.extraHeaders&&(r.extraHeaders=e.extraHeaders),e.extraBodyParams&&(r.extraBodyParams=e.extraBodyParams),e.usePKCE!==void 0&&(r.usePKCE=e.usePKCE),e.resource&&(r.resource=e.resource);let n=Bde(e.scopes);return{type:"oauth2",...e.registrationUrl?{oauthClientMode:"dynamic"}:{},...e.authUrl?{authUrl:e.authUrl}:{},...e.tokenUrl?{tokenUrl:e.tokenUrl}:{},...e.grant_type?{grantType:e.grant_type}:{},...n?{scopes:n}:{},...Object.keys(r).length?{config:r}:{}}}function Qde(t){return!t.config||Object.keys(t.config).length===0}function wde(t,e){let r={...t||{},...e||{}};return Object.keys(r).length>0?r:void 0}function vde(t,e){if(e)return{...t,config:e};let{config:r,...n}=t;return n}function RM({authentication:t,template:e}){let r=TM(e),n=(0,DM.normalizeSystemAuthentication)(t);return n?r?n.type==="none"&&Qde(n)?r:n.type!==r.type?n:vde({...r,...n},wde(r.config,n.config)):n:r}function zC(t){let e=(0,DM.normalizeSystemAuthentication)(t.authentication)||{type:"none"};return RM({authentication:e,template:$g(t)?.template})||e}var _de={postgres:{name:"postgres",apiUrl:"postgres://<<username>>:<<password>>@<<host>>:<<port>>/<<database>>",regex:"^.*(postgres|postgresql).*$",icon:"postgresql",docsUrl:"",preferredAuthType:"connection_string",connectionFields:[{key:"host",label:"Host",placeholder:"db.example.com",required:!0},{key:"port",label:"Port",type:"number",defaultValue:"5432",placeholder:"5432"},{key:"database",label:"Database",placeholder:"mydb",required:!0},{key:"username",label:"Username",placeholder:"postgres",required:!0},{key:"password",label:"Password",type:"password",required:!0}],keywords:["database","sql","postgres","postgresql","api key","tables"]},mssql:{name:"mssql",apiUrl:"mssql://<<username>>:<<password>>@<<host>>:<<port>>/<<database>>",regex:"^.*\\b(mssql|sql[\\s._-]?server).*$",icon:"lucide:database",docsUrl:"https://learn.microsoft.com/en-us/sql/sql-server/connect-to-database-engine",preferredAuthType:"connection_string",connectionFields:[{key:"host",label:"Host",placeholder:"sql.example.com",required:!0},{key:"port",label:"Port",type:"number",defaultValue:"1433",placeholder:"1433"},{key:"database",label:"Database",placeholder:"mydb",required:!0},{key:"username",label:"Username",required:!0},{key:"password",label:"Password",type:"password",required:!0}],systemSpecificInstructions:`TCP/IP must be enabled on SQL Server. SQL Server logins require mixed-mode authentication.
|
|
644
|
+
`);if(r.length>AM.PLAYBOOK_LIMITS.compiledRender)throw new Error(`Compiled playbook render for '${t.id}' exceeds ${AM.PLAYBOOK_LIMITS.compiledRender} chars (${r.length})`);return r}});var fM=h(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.PROJECT_LIMITS=So.PROJECT_TASK_STATUSES=So.PROJECT_RESOURCE_TYPES=void 0;So.projectResourceKey=VAe;So.PROJECT_RESOURCE_TYPES=["system","playbook","artifact","file","tool"];So.PROJECT_TASK_STATUSES=["not_started","in_progress","waiting","done"];So.PROJECT_LIMITS={name:80,description:500,taskName:120,taskDescription:5e3,taskResources:100};function VAe(t){return`${t.type}:${t.id}`}});var $C=h(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.RESOURCE_KINDS=vn.RESOURCE_DEFINITIONS=void 0;vn.isResourceKind=zAe;vn.getResourceDefinition=YAe;vn.RESOURCE_DEFINITIONS={tool:{label:"Tool",pluralLabel:"Tools",collectionKey:"tools",memberDefaultPermission:"editor",pickerDefaultPermission:"editor"},system:{label:"System",pluralLabel:"Systems",collectionKey:"systems",memberDefaultPermission:"editor",pickerDefaultPermission:"editor"},credential:{label:"Credential",pluralLabel:"Credentials",collectionKey:"credentials",pickerDefaultPermission:"viewer"},playbook:{label:"Playbook",pluralLabel:"Playbooks",collectionKey:"playbooks",pickerDefaultPermission:"editor"},artifact:{label:"Artifact",pluralLabel:"Artifacts",collectionKey:"artifacts",pickerDefaultPermission:"editor"},file:{label:"File",pluralLabel:"Files",collectionKey:"files",pickerDefaultPermission:"viewer"},project:{label:"Project",pluralLabel:"Projects",collectionKey:"projects",pickerDefaultPermission:"viewer"}};vn.RESOURCE_KINDS=Object.keys(vn.RESOURCE_DEFINITIONS);function zAe(t){return typeof t=="string"&&Object.prototype.hasOwnProperty.call(vn.RESOURCE_DEFINITIONS,t)}function YAe(t){return vn.RESOURCE_DEFINITIONS[t]}});var BM=h(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.RESERVED_ROLE_NAMES=ne.RESERVED_ROLE_IDS=ne.PREDEFINED_ROLE_IDS=void 0;ne.toResourceRef=aA;ne.toWildcardResourceRef=cA;ne.getDefaultMemberResourceGrants=JAe;ne.parseResourceRef=Ng;ne.getWildcardResourceRef=pM;ne.normalizeResourcePermissions=fs;ne.permissionSatisfies=Og;ne.highestResourcePermission=Ug;ne.grantHasPermission=HC;ne.grantMatchesResource=$c;ne.getEffectiveResourcePermissions=GC;ne.hasResourcePermission=WAe;ne.getRoleResourceGrants=Mg;ne.getAllowedResourceIds=gM;ne.getAllowedResourceIdsForRoles=xg;ne.getEffectiveResourcePermissionsForRoles=jc;ne.getAllowedToolIds=hM;ne.getAllowedSystemIds=mM;ne.pickLongestHeldResource=KAe;ne.getAllowedCredentialsIds=XAe;ne.getEffectiveCredentialsPermissions=ede;ne.getEffectiveToolPermissions=tde;ne.getEffectiveSystemPermissions=rde;ne.checkResourcePermission=Lg;ne.isToolAllowed=nde;ne.isSystemVisible=ide;ne.isPlaybookVisible=ode;ne.hasAllSystems=sde;ne.hasAllTools=ade;ne.getResourceGrantSources=yM;ne.getSharePermissionForResource=EM;ne.getAccessRulePermissionForResource=IM;ne.hasAdminBaseRole=VC;ne.resolveResourceAccessForRoles=cde;ne.normalizeResourceGrantInput=CM;ne.normalizeRoleResourceGrantInput=ude;ne.isPredefinedRole=lde;ne.isReservedRoleId=Ade;ne.isReservedRoleName=dde;ne.hasRole=fde;ne.getRoleIds=pde;ne.getBaseRole=bM;ne.getBaseRoleId=gde;ne.getPersonalRole=SM;ne.getPersonalRoleId=hde;var Rg=$C(),kg="*";function aA(t,e){if(!e||e===kg)throw new Error("Resource id is required");return`${t}:${encodeURIComponent(e)}`}function cA(t){return`${t}:${kg}`}function JAe(){return Rg.RESOURCE_KINDS.flatMap(t=>{let e=(0,Rg.getResourceDefinition)(t).memberDefaultPermission;return e?[{resourceRef:cA(t),permissions:[e]}]:[]})}function Ng(t){let e=t.indexOf(":");if(e<=0)return null;let r=t.slice(0,e);if(!(0,Rg.isResourceKind)(r))return null;let n=t.slice(e+1);if(!n)return null;if(n===kg)return{kind:r,id:kg,isWildcard:!0};try{return{kind:r,id:decodeURIComponent(n),isWildcard:!1}}catch{return null}}function pM(t){let e=Ng(t);return e?cA(e.kind):null}function fs(t){let e=new Set;for(let r of t||[])(r==="viewer"||r==="editor")&&e.add(r);return e.has("editor")&&e.add("viewer"),Array.from(e)}function Og(t,e){return t===e||t==="editor"&&e==="viewer"}function Ug(t){let e=fs(t);if(e.includes("editor"))return"editor";if(e.includes("viewer"))return"viewer"}function HC(t,e){return t.revokedAt?!1:fs(t.permissions).some(r=>Og(r,e))}function $c(t,e){return t.revokedAt?!1:t.resourceRef===e||t.resourceRef===pM(e)}function GC(t,e){let r=new Set;for(let n of t)if($c(n,e))for(let i of fs(n.permissions))r.add(i);return Array.from(r)}function WAe(t,e,r){return GC(t,e).some(n=>Og(n,r))}function Mg(t){return t.flatMap(e=>e.isBaseRole&&e.id==="admin"?[]:e.resourceGrants||[])}function gM(t,e,r){let n=cA(e),i=new Set;for(let o of t){if(!HC(o,r))continue;if(o.resourceRef===n)return;let s=Ng(o.resourceRef);s?.kind===e&&!s.isWildcard&&i.add(s.id)}return Array.from(i)}function xg(t,e,r){if(!VC(t))return gM(Mg(t),e,r)}function jc(t,e,r){return VC(t)?["editor","viewer"]:GC(Mg(t),aA(e,r))}function ZAe(t){return(0,Rg.getResourceDefinition)(t).label}function hM(t,e="viewer"){return xg(t,"tool",e)}function mM(t,e="viewer"){return xg(t,"system",e)}var qC=Number.MAX_SAFE_INTEGER;function jC(t){if(!t)return qC;let e=new Date(t).getTime();return Number.isNaN(e)?qC:e}function KAe(t,e,r){if(t.length<=1)return t[0];let n=i=>{let o=aA(r,i.id),s=qC;for(let a of e)$c(a,o)&&(s=Math.min(s,jC(a.createdAt)));return s};return[...t].sort((i,o)=>{let s=n(i)-n(o);return s!==0?s:jC(i.createdAt)-jC(o.createdAt)})[0]}function XAe(t,e="viewer"){return xg(t,"credential",e)}function ede(t,e){return jc(t,"credential",e)}function tde(t,e){return jc(t,"tool",e)}function rde(t,e){return jc(t,"system",e)}function Lg(t,e,r,n){return jc(t,e,r).some(o=>Og(o,n))?{allowed:!0}:{allowed:!1,error:`${ZAe(e)} '${r}' requires a '${n}' grant`}}function nde(t,e,r="viewer"){return Lg(t,"tool",e,r)}function ide(t,e,r="viewer"){return Lg(t,"system",e,r)}function ode(t,e,r="viewer"){return Lg(t,"playbook",e,r)}function sde(t,e="viewer"){return mM(t,e)===void 0}function ade(t,e="viewer"){return hM(t,e)===void 0}function yM(t,e,r="viewer"){let n=new Set;for(let i of t)$c(i,e)&&HC(i,r)&&n.add(i.source);return Array.from(n)}function EM(t,e){let r=t.filter(n=>n.source==="share"&&$c(n,e)).flatMap(n=>fs(n.permissions));return Ug(r)}function IM(t,e){let r=t.filter(n=>n.source==="access_rule"&&$c(n,e)).flatMap(n=>fs(n.permissions));return Ug(r)}function VC(t){return t.some(e=>e.isBaseRole&&e.id==="admin")}function cde({roles:t,resource:e,userId:r}){let n=aA(e.kind,e.id),i=Mg(t),o=new Set(jc(t,e.kind,e.id)),s=new Set(yM(i,n));e.ownerUserId&&e.ownerUserId===r&&(o.add("editor"),o.add("viewer"),s.add("ownership"));let a=fs(Array.from(o));return{permissions:a,sources:Array.from(s),sharePermission:EM(i,n),accessRulePermission:IM(i,n),maxPermission:Ug(a)}}function CM(t){let e=Ng(t.resourceRef);if(!e)throw new Error(`Invalid resource ref '${t.resourceRef}'`);return{...t,resourceRef:e.isWildcard?cA(e.kind):aA(e.kind,e.id),permissions:fs(t.permissions||["viewer"]),source:t.source||"access_rule"}}function ude(t){let e=CM({resourceRef:t.resourceRef,permissions:t.permissions,source:"access_rule"});return{resourceRef:e.resourceRef,permissions:e.permissions,source:"access_rule"}}ne.PREDEFINED_ROLE_IDS=["admin","member","service_account"];ne.RESERVED_ROLE_IDS=["admin","member","service_account"];ne.RESERVED_ROLE_NAMES=["member","admin","service account"];function lde(t){return ne.PREDEFINED_ROLE_IDS.includes(t)}function Ade(t){return ne.RESERVED_ROLE_IDS.includes(t)}function dde(t){return ne.RESERVED_ROLE_NAMES.includes(t.toLowerCase().trim())}function fde(t,e){return t.some(r=>r.id===e)}function pde(t){return t.map(e=>e.id)}function bM(t){let e=t.filter(r=>r.isBaseRole);return e.length===1?e[0]:null}function gde(t){let e=bM(t);return e?e.id:null}function SM(t){return t.find(e=>e.isPersonalRole)||null}function hde(t){let e=SM(t);return e?e.id:null}});var wM=h(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.NOTIFICATION_EXCLUDED_REQUEST_SOURCES=_r.CLIENT_REQUEST_SOURCES=_r.REQUEST_SOURCES=void 0;_r.isRequestSource=QM;_r.isClientRequestSource=Ede;_r.parseRequestSource=Ide;var Kt=qr();_r.REQUEST_SOURCES=[Kt.RequestSource.API,Kt.RequestSource.FRONTEND,Kt.RequestSource.AGENT,Kt.RequestSource.SCHEDULER,Kt.RequestSource.MCP,Kt.RequestSource.TOOL_CHAIN,Kt.RequestSource.WEBHOOK,Kt.RequestSource.CLI];_r.CLIENT_REQUEST_SOURCES=[Kt.RequestSource.FRONTEND,Kt.RequestSource.AGENT,Kt.RequestSource.MCP,Kt.RequestSource.CLI];_r.NOTIFICATION_EXCLUDED_REQUEST_SOURCES=[Kt.RequestSource.FRONTEND,Kt.RequestSource.AGENT,Kt.RequestSource.MCP];var mde=new Set(_r.REQUEST_SOURCES),yde=new Set(_r.CLIENT_REQUEST_SOURCES);function QM(t){return mde.has(t)}function Ede(t){return yde.has(t)}function Ide(t){let e=t.toLowerCase();return QM(e)?e:void 0}});var vM=h(Pg=>{"use strict";Object.defineProperty(Pg,"__esModule",{value:!0});Pg.contextSourceTemplates=void 0;var Cde={slack:{category:"workspace",systemId:"slack",onboardingOrder:7,onboardingDescription:"Connect joined public channels so superglue can use relevant workspace context."},gmail:{category:"email",systemId:"gmail",onboardingOrder:9,onboardingDescription:"Let superglue access your gmail inbox. superglue will never send emails on your behalf."},fathomMcp:{category:"meetings",systemId:"fathomMcp",onboardingOrder:4,onboardingDescription:"Let superglue use meeting notes and transcripts. superglue will never join or record meetings."},granolaMcp:{category:"meetings",systemId:"granolaMcp",onboardingOrder:2,onboardingDescription:"Let superglue use notes and transcripts. superglue will never join or record meetings."},readAiMcp:{category:"meetings",systemId:"read-ai",onboardingOrder:6,onboardingDescription:"Let superglue use meeting summaries and transcripts. superglue will never join or record meetings."},otterMcp:{category:"meetings",systemId:"otter",onboardingOrder:7,onboardingDescription:"Let superglue use meeting notes and transcripts. superglue will never join or record meetings."},googleDrive:{category:"workspace",systemId:"google-drive",onboardingOrder:9,onboardingDescription:"Connect accessible Drive files for relevant workspace context."},box:{category:"workspace",systemId:"box",onboardingOrder:11,onboardingDescription:"Connect accessible Box files for relevant workspace context."},dropbox:{category:"workspace",systemId:"dropbox",onboardingOrder:12,onboardingDescription:"Connect accessible Dropbox files for relevant workspace context."},jira:{category:"workspace",systemId:"jira",onboardingOrder:13,onboardingDescription:"Connect Jira projects, issues, and comments for relevant workspace context."},rocketlaneMcp:{category:"workspace",systemId:"rocketlane",onboardingOrder:14,onboardingDescription:"Connect Rocketlane projects, tasks, and status for relevant workspace context."},notion:{category:"workspace",systemId:"notion",onboardingOrder:8,onboardingDescription:"Connect selected Notion pages for relevant workspace context."},sharepoint:{category:"workspace",systemId:"sharepoint",onboardingOrder:10,onboardingDescription:"Connect accessible SharePoint sites and files for workspace context."},microsoftTeams:{category:"workspace",systemId:"microsoft-teams",onboardingOrder:6,onboardingDescription:"Connect Microsoft Teams channels and meetings for workspace context."},outlookMail:{category:"email",systemId:"outlook-mail",onboardingOrder:8,onboardingDescription:"Let superglue access your outlook inbox and calendar. superglue will never send emails on your behalf."},circleback:{category:"meetings",systemId:"circleback",onboardingOrder:1,onboardingDescription:"Let superglue use notes and transcripts. superglue will never join or record meetings.",endpointAliases:["https://app.circleback.ai/api/mcp"]},fireflies:{category:"meetings",systemId:"fireflies",onboardingOrder:3,onboardingDescription:"Let superglue use transcripts and summaries. superglue will never join or record meetings."},fellowMcp:{category:"meetings",systemId:"fellow",onboardingOrder:5,onboardingDescription:"Let superglue use meeting notes and transcripts. superglue will never join or record meetings."}};Pg.contextSourceTemplates=Cde});var YC=h(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.systemOptions=Pe.systems=void 0;Pe.getSystemTemplateOAuthClientMode=Sde;Pe.getSystemTemplateAuthentication=TM;Pe.mergeSystemTemplateAuthentication=RM;Pe.resolveSystemAuthentication=zC;Pe.getContextSourceTemplates=kM;Pe.resolveContextSourceSetup=Rde;Pe.findTemplateForSystem=$g;Pe.uniqueKeywords=kde;Pe.getOAuthConfig=Nde;Pe.getOAuthTokenExchangeConfig=Ode;Pe.getOAuthTokenUrl=Ude;var DM=iA(),bde=vM(),Fg=Dg();function Sde(t){let e=t?.oauth;if(e)return e.registrationUrl?"dynamic":e.managed?"managed":"custom"}function Bde(t){let e=t?.split(/[,\s]+/).filter(Boolean);return e?.length?e:void 0}function TM(t){if(!t?.preferredAuthType)return;if(t.preferredAuthType!=="oauth2")return{type:t.preferredAuthType};let e=t.oauth;if(!e)return{type:"oauth2"};let r={};e.tokenAuthMethod&&(r.tokenAuthMethod=e.tokenAuthMethod),e.tokenContentType&&(r.tokenContentType=e.tokenContentType),e.extraHeaders&&(r.extraHeaders=e.extraHeaders),e.extraBodyParams&&(r.extraBodyParams=e.extraBodyParams),e.usePKCE!==void 0&&(r.usePKCE=e.usePKCE),e.resource&&(r.resource=e.resource);let n=Bde(e.scopes);return{type:"oauth2",...e.registrationUrl?{oauthClientMode:"dynamic"}:{},...e.authUrl?{authUrl:e.authUrl}:{},...e.tokenUrl?{tokenUrl:e.tokenUrl}:{},...e.grant_type?{grantType:e.grant_type}:{},...n?{scopes:n}:{},...Object.keys(r).length?{config:r}:{}}}function Qde(t){return!t.config||Object.keys(t.config).length===0}function wde(t,e){let r={...t||{},...e||{}};return Object.keys(r).length>0?r:void 0}function vde(t,e){if(e)return{...t,config:e};let{config:r,...n}=t;return n}function RM({authentication:t,template:e}){let r=TM(e),n=(0,DM.normalizeSystemAuthentication)(t);return n?r?n.type==="none"&&Qde(n)?r:n.type!==r.type?n:vde({...r,...n},wde(r.config,n.config)):n:r}function zC(t){let e=(0,DM.normalizeSystemAuthentication)(t.authentication)||{type:"none"};return RM({authentication:e,template:$g(t)?.template})||e}var _de={postgres:{name:"postgres",apiUrl:"postgres://<<username>>:<<password>>@<<host>>:<<port>>/<<database>>",regex:"^.*(postgres|postgresql).*$",icon:"postgresql",docsUrl:"",preferredAuthType:"connection_string",connectionFields:[{key:"host",label:"Host",placeholder:"db.example.com",required:!0},{key:"port",label:"Port",type:"number",defaultValue:"5432",placeholder:"5432"},{key:"database",label:"Database",placeholder:"mydb",required:!0},{key:"username",label:"Username",placeholder:"postgres",required:!0},{key:"password",label:"Password",type:"password",required:!0}],keywords:["database","sql","postgres","postgresql","api key","tables"]},mssql:{name:"mssql",apiUrl:"mssql://<<username>>:<<password>>@<<host>>:<<port>>/<<database>>",regex:"^.*\\b(mssql|sql[\\s._-]?server).*$",icon:"lucide:database",docsUrl:"https://learn.microsoft.com/en-us/sql/sql-server/connect-to-database-engine",preferredAuthType:"connection_string",connectionFields:[{key:"host",label:"Host",placeholder:"sql.example.com",required:!0},{key:"port",label:"Port",type:"number",defaultValue:"1433",placeholder:"1433"},{key:"database",label:"Database",placeholder:"mydb",required:!0},{key:"username",label:"Username",required:!0},{key:"password",label:"Password",type:"password",required:!0}],systemSpecificInstructions:`TCP/IP must be enabled on SQL Server. SQL Server logins require mixed-mode authentication.
|
|
645
645
|
|
|
646
646
|
Default instances typically use TCP port 1433. Named instances can use dynamic ports and SQL Server Browser on UDP 1434; request the instance's actual TCP port when direct connections fail.`,keywords:["database","sql","sql server","mssql","transact-sql","t-sql","table","schema","view","stored procedure"]},redis_direct:{name:"redis_direct",apiUrl:"redis://<<username>>:<<password>>@<<host>>:<<port>>/<<database>>",regex:"^.*(rediss?://).*$",icon:"redis",docsUrl:"https://redis.io/docs/latest/commands/",preferredAuthType:"connection_string",connectionFields:[{key:"host",label:"Host",placeholder:"redis.example.com",required:!0},{key:"port",label:"Port",type:"number",defaultValue:"6379",placeholder:"6379"},{key:"database",label:"Database Index",placeholder:"0"},{key:"username",label:"Username",placeholder:"default"},{key:"password",label:"Password",type:"password",required:!0}],keywords:["database","cache","redis","key-value","nosql"]},mongodb_direct:{name:"mongodb_direct",apiUrl:"mongodb://<<username>>:<<password>>@<<host>>:<<port>>/<<database>>?authSource=admin",regex:"^.*(mongodb(\\+srv)?://).*$",icon:"mongodb",docsUrl:"https://www.mongodb.com/docs/manual/reference/method/",preferredAuthType:"connection_string",connectionFields:[{key:"host",label:"Host",placeholder:"cluster.example.com",required:!0},{key:"port",label:"Port",type:"number",defaultValue:"27017",placeholder:"27017"},{key:"database",label:"Database",placeholder:"mydb",required:!0},{key:"username",label:"Username",placeholder:"admin"},{key:"password",label:"Password",type:"password"}],keywords:["database","mongodb","mongo","nosql","document","collection","atlas"]},azure_sql:{name:"azure_sql",apiUrl:"mssql://<<user>>:<<password>>@<<host>>:1433/<<database>>",regex:"^.*(azure.*sql|sql.*azure|database\\.windows\\.net).*$",icon:"/logos/azure_sql.svg",docsUrl:"https://learn.microsoft.com/en-us/azure/azure-sql/",preferredAuthType:"connection_string",connectionFields:[{key:"host",label:"Host",placeholder:"myserver.database.windows.net",required:!0},{key:"database",label:"Database",placeholder:"mydb",required:!0},{key:"user",label:"Username",placeholder:"user@domain.com",required:!0},{key:"password",label:"Password",type:"password",required:!0},{key:"authType",label:"Auth Type",placeholder:"azure-active-directory-password"},{key:"clientId",label:"Client ID",placeholder:"App Registration client ID"},{key:"clientSecret",label:"Client Secret",type:"password",placeholder:"Service principal secret"},{key:"tenantId",label:"Tenant ID",placeholder:"Azure AD directory ID"}],systemSpecificInstructions:`Azure SQL supports two authentication modes:
|
|
647
647
|
|
|
@@ -679,7 +679,7 @@ Authentication is not sent as Authorization: Bearer. First call POST /openapi/v1
|
|
|
679
679
|
|
|
680
680
|
API keys are generated by a Jisr Admin in Settings > Webhook & API Keys > API Keys. Enabled API and lookup permissions control which endpoints and fields are accessible, the secret can only be copied once, and employee financial fields require the "Get Employee Financial Info" permission.
|
|
681
681
|
|
|
682
|
-
Most list endpoints paginate with page plus rpp or limit, capped at 100 records per page. Payroll and accrual endpoints often require specific type values, paygroup filters, and pay period dates set to the first day of a confirmed month. Some payroll endpoints, including employee monthly payables and payroll transaction deletion, are available only for whitelisted organizations.`},attio:{name:"attio",apiUrl:"https://api.attio.com/v2/",regex:"^.*attio.*$",icon:"/logos/attio.svg",docsUrl:"https://docs.attio.com/rest-api/overview",openApiUrl:"https://api.attio.com/openapi/api",preferredAuthType:"api_key",keywords:["people","objects","records","lists","entries","workspace_members","notes","tasks","threads","comments","sorts","api_slug","attribute_type","record_id","workspace_id","object_id"]},twilio:{name:"twilio",apiUrl:"https://api.twilio.com",regex:"^.*twilio.*$",icon:"/logos/twilio.svg",docsUrl:"https://www.twilio.com/docs/api",openApiUrl:"https://raw.githubusercontent.com/twilio/twilio-oai/refs/heads/main/spec/json/twilio_api_v2010.json",preferredAuthType:"api_key",keywords:["Messages","Media","MessageFeedback","Calls","Accounts","APIKeys","Addresses","UsageRecords","CallFeedback","CredentialsList","TaskRouter_Workspaces","TaskRouter_Tasks","TaskRouter_Workers","TaskRouter_Activities","MessagingServices"]},sendgrid:{name:"sendgrid",apiUrl:"https://api.sendgrid.com",regex:"^.*sendgrid.*$",icon:"/logos/sendgrid.svg",docsUrl:"https://www.twilio.com/docs/sendgrid/api-reference",openApiUrl:"https://raw.githubusercontent.com/sendgrid/sendgrid-oai/main/oai.json",preferredAuthType:"api_key",keywords:["mail_send","templates","campaigns","marketing_contacts","marketing_lists","suppression_groups","global_suppressions","asm_suppressions","subusers","stats","categories","whitelabel","ips","access_settings"]},github:{name:"github",apiUrl:"https://api.github.com",regex:"^.*github.*$",icon:"github",docsUrl:"https://docs.github.com/en/rest",openApiUrl:"https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json",preferredAuthType:"api_key",oauth:{authUrl:"https://github.com/login/oauth/authorize",tokenUrl:"https://github.com/login/oauth/access_token",scopes:"repo user admin:org workflow gist notifications delete_repo write:packages read:packages"},keywords:["repositories","issues","pull_requests","commits","branches","tags","releases","deployments","check_runs","actions_artifacts","organizations","packages","collaborators","gists","milestones"]},gitlab:{name:"gitlab",apiUrl:"https://api.gitlab.com",regex:"^.*gitlab.*$",icon:"gitlab",docsUrl:"https://docs.gitlab.com/api/rest/",openApiUrl:"https://gitlab.com/gitlab-org/gitlab/-/raw/master/doc/api/openapi/openapi.yaml",preferredAuthType:"api_key",oauth:{authUrl:"https://gitlab.com/oauth/authorize",tokenUrl:"https://gitlab.com/oauth/token",scopes:"api"},keywords:["projects","repositories","issues","pull_requests","commits","branches","tags","releases","deployments","check_runs","actions_artifacts","organizations","packages","collaborators","gists","milestones"]},bitbucket:{name:"bitbucket",apiUrl:"https://api.bitbucket.org",regex:"^.*bitbucket.*$",icon:"bitbucket",docsUrl:"https://developer.atlassian.com/cloud/bitbucket/rest",openApiUrl:"https://api.bitbucket.org/swagger.json",preferredAuthType:"oauth2",oauth:{authUrl:"https://bitbucket.org/site/oauth2/authorize",tokenUrl:"https://bitbucket.org/site/oauth2/access_token",scopes:"repository:admin account:write team:write webhook"},keywords:["repositories","projects","commits","branches","pullrequests","downloads","issues","pipelines","branchRestrictions","components","milestones","refs","hooks","forks","user"]},slack:{name:"slack",label:"Slack",apiUrl:"https://slack.com/api",regex:"^.*slack.*$",icon:"slack",docsUrl:"https://docs.slack.dev/apis/web-api/",openApiUrl:"https://raw.githubusercontent.com/slackapi/slack-api-specs/master/web-api/slack_web_openapi_v2.json",preferredAuthType:"oauth2",oauth:{grant_type:"authorization_code",authUrl:"https://slack.com/oauth/v2/authorize",tokenUrl:"https://slack.com/api/oauth.v2.access",scopes:"channels:history channels:join channels:read files:read users:read users:read.email",managed:!0},keywords:["channel","conversation","user","file","event","message","workflow_step","workflow_published","workflow_step_execute","usergroup","im","mpim","group","check_run","apps_permissions_resource"],systemSpecificInstructions:"Slack OAuth returns a bot token. Bot access depends on its granted scopes and channel membership."},airtable:{name:"airtable",apiUrl:"https://api.airtable.com",regex:"^.*airtable.*$",icon:"airtable",docsUrl:"https://airtable.com/developers/web/api",preferredAuthType:"oauth2",oauth:{authUrl:"https://airtable.com/oauth2/v1/authorize",tokenUrl:"https://airtable.com/oauth2/v1/token",scopes:"data.recordComments:read data.recordComments:write data.records:read data.records:write schema.bases:read schema.bases:write user.email:read enterprise.groups:read data.records:manage enterprise.account:read enterprise.account:write enterprise.auditLogs:read enterprise.changeEvents:read enterprise.exports:manage enterprise.groups:manage enterprise.scim.usersAndGroups:manage enterprise.user:read enterprise.user:write webhook:manage",managed:!0,usePKCE:!0,tokenAuthMethod:"basic_auth",tokenContentType:"form"},keywords:["bases","tables","records","fields","views","formulas","attachments","comments","collaborators","metadata","schemas","api key","key"]},gmail:{name:"gmail",label:"Gmail",apiUrl:"https://gmail.googleapis.com/gmail/v1",regex:"^.*(gmail\\.googleapis|developers\\.google\\.com/gmail|mail\\.google).*$",icon:"gmail",docsUrl:"https://developers.google.com/gmail/api/reference/rest",openApiUrl:"https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/gmail.modify",managed:!0},keywords:["messages","threads","labels","drafts","send","attachments","history","filters","settings","forwarding","inbox","profile","oauth"]},googleWorkspace:{name:"googleWorkspace",label:"Google Workspace",apiUrl:"https://www.googleapis.com",regex:"^.*(workspace\\.google\\.com|developers\\.google\\.com/workspace(?!/tasks)).*$",icon:"/logos/google.svg",docsUrl:"https://developers.google.com/workspace",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:["openid","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/calendar","https://www.googleapis.com/auth/calendar.settings.readonly","https://www.googleapis.com/auth/documents","https://www.googleapis.com/auth/spreadsheets","https://www.googleapis.com/auth/presentations","https://www.googleapis.com/auth/forms.body","https://www.googleapis.com/auth/forms.responses.readonly","https://www.googleapis.com/auth/gmail.modify","https://www.googleapis.com/auth/contacts","https://www.googleapis.com/auth/contacts.other.readonly","https://www.googleapis.com/auth/directory.readonly","https://www.googleapis.com/auth/tasks","https://www.googleapis.com/auth/drive.readonly","https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/drive.appdata"].join(" "),managed:!0},systemSpecificInstructions:"superglue provides a managed Google Workspace OAuth app; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. The System URL is the shared Google API host; address each product by its own path prefix or host: Calendar /calendar/v3, Docs https://docs.googleapis.com/v1, Sheets https://sheets.googleapis.com/v4, Slides https://slides.googleapis.com/v1, Forms https://forms.googleapis.com/v1, Gmail https://gmail.googleapis.com/gmail/v1 (read, search, and drafts; send via POST /users/me/messages/send with a base64url RFC 5322 message only when the user explicitly asks to send), People https://people.googleapis.com/v1 (contacts, otherContacts, and people:searchDirectoryPeople for the Workspace directory; directory search requires a Google Workspace account), Tasks https://tasks.googleapis.com/tasks/v1, Drive https://www.googleapis.com/drive/v3 (drive.readonly lists and reads any file the user can access; drive.file grants write access to files created or opened through this app). Send OAuth tokens as Authorization: Bearer <<access_token>>.",keywords:["workspace","calendar","events","docs","documents","sheets","spreadsheets","slides","presentations","forms","responses","gmail","send email","contacts","people","directory","tasks","oauth"]},granola:{name:"granola",label:"Granola API",apiUrl:"https://public-api.granola.ai",regex:"^.*granola.*$",icon:"/logos/granola.svg",docsUrl:"https://docs.granola.ai",preferredAuthType:"api_key",keywords:["meeting","notes","transcript","summary","ai","recording"]},fathom:{name:"fathom",apiUrl:"https://api.fathom.ai/external/v1",regex:"^.*(fathom\\.ai|fathom\\.video).*$",icon:"/logos/fathom.png",docsUrl:"https://developers.fathom.ai",openApiUrl:"https://developers.fathom.ai/api-reference/openapi.yaml",preferredAuthType:"oauth2",oauth:{grant_type:"authorization_code",authUrl:"https://fathom.video/external/v1/oauth2/authorize",tokenUrl:"https://api.fathom.ai/external/v1/oauth2/token",scopes:"public_api",managed:!0},keywords:["meeting","meetings","notetaker","transcript","transcription","recording","summary","action items","webhook","oauth"],systemSpecificInstructions:"Fathom is an AI meeting notetaker. superglue provides a managed Fathom OAuth app, so no app registration is needed \u2014 authenticate directly via OAuth (authorization code with refresh tokens; the only scope is public_api). Alternatively, an API key created in Fathom settings works via an X-Api-Key header. Send OAuth tokens as Authorization: Bearer <<access_token>>. Webhooks must set at least one of include_transcript, include_summary, include_action_items, or include_crm_matches. Rate limits: 60 requests per 60 seconds overall, 30 per 60 seconds for transcript, summary, and content-heavy meeting requests (5 per 60 seconds under high load)."},fathomMcp:{name:"fathomMcp",label:"Fathom",apiUrl:"https://api.fathom.ai/mcp",regex:"^https://api\\.fathom\\.ai/mcp/?(?:\\?.*)?$",icon:"/logos/fathom.png",docsUrl:"https://developers.fathom.ai/mcp-docs",preferredAuthType:"oauth2",oauth:{authUrl:"https://fathom.video/mcp/oauth/authorize",tokenUrl:"https://api.fathom.ai/mcp/oauth/token",registrationUrl:"https://api.fathom.ai/mcp/oauth/register",scopes:"mcp",resource:"https://api.fathom.ai/mcp",tokenAuthMethod:"body",usePKCE:!0},systemSpecificInstructions:"Fathom is a brain context source (meetings) backed by remote MCP. Load the meetings skill before using it. Keep the MCP endpoint unchanged. Authentication uses OAuth dynamic client registration with PKCE. Store the registered client configuration on the shared System and tokens in the current user's credential. Discover the current read tools before use, search narrowly, and retrieve transcript content only when relevant. Never join, record, edit, or otherwise mutate meetings through this integration. Use the separate Fathom API template only when deterministic REST access is required.",keywords:["meetings","notes","transcripts","summaries","action_items","attendees","recordings","decisions"]},granolaMcp:{name:"granolaMcp",label:"Granola",apiUrl:"https://mcp.granola.ai/mcp",regex:"^https://mcp\\.granola\\.ai/mcp/?(?:\\?.*)?$",icon:"/logos/granola.svg",docsUrl:"https://docs.granola.ai/help-center/sharing/integrations/mcp",preferredAuthType:"oauth2",oauth:{authUrl:"https://mcp-auth.granola.ai/oauth2/authorize",tokenUrl:"https://mcp-auth.granola.ai/oauth2/token",registrationUrl:"https://mcp-auth.granola.ai/oauth2/register",scopes:"mcp",resource:"https://mcp.granola.ai/mcp",tokenAuthMethod:"body",usePKCE:!0},systemSpecificInstructions:"Granola is a brain context source (meetings) backed by remote MCP. Load the meetings skill before using it. Keep the MCP endpoint unchanged. Authentication uses OAuth dynamic client registration with PKCE. Store the registered client configuration on the shared System and tokens in the current user's credential. Search narrowly and retrieve transcript content only when relevant. Never edit meeting data through this integration.",keywords:["meetings","notes","transcripts","summaries","action_items","attendees","folders","decisions"]},readAiMcp:{name:"readAiMcp",label:"Read AI",apiUrl:"https://api.read.ai/mcp",regex:"^https://api\\.read\\.ai/mcp/?(?:\\?.*)?$",icon:"/logos/read-ai.png",docsUrl:"https://support.read.ai/hc/en-us/articles/49381158409491-MCP-Server",preferredAuthType:"oauth2",oauth:{authUrl:"https://authn.read.ai/oauth2/auth",tokenUrl:"https://authn.read.ai/oauth2/token",registrationUrl:"https://api.read.ai/oauth/register",scopes:"mcp:execute meeting:read offline_access",resource:"https://api.read.ai/mcp",tokenAuthMethod:"body",usePKCE:!0},systemSpecificInstructions:"Read AI is a brain context source (meetings) backed by remote MCP. Load the meetings skill before using it. Keep the MCP endpoint unchanged. Authentication uses OAuth dynamic client registration with PKCE. Store the registered client configuration on the shared System and tokens in the current user's credential. Request read-only scopes only. Discover the current tools before use, search narrowly, and retrieve transcript content only when relevant. Never join, record, edit, or otherwise mutate meetings through this integration.",keywords:["meetings","transcripts","summaries","action_items","topics","participants","metrics"]},otterMcp:{name:"otterMcp",label:"Otter",apiUrl:"https://mcp.otter.ai/mcp",regex:"^https://mcp\\.otter\\.ai/mcp/?(?:\\?.*)?$",icon:"/logos/otter.png",docsUrl:"https://help.otter.ai/hc/en-us/articles/35287607569687-Otter-MCP-Server",preferredAuthType:"oauth2",oauth:{authUrl:"https://otter.ai/oauth2/authorize",tokenUrl:"https://otter.ai/oauth/token",registrationUrl:"https://otter.ai/oauth/register",scopes:"profile:read conversations:read",resource:"https://mcp.otter.ai/",tokenAuthMethod:"body",usePKCE:!0},systemSpecificInstructions:"Otter is a brain context source (meetings) backed by remote MCP. Load the meetings skill before using it. Keep the MCP endpoint unchanged. Authentication uses OAuth dynamic client registration with PKCE. Store the registered client configuration on the shared System and tokens in the current user's credential. Request read-only scopes only. Discover the current tools before use, search narrowly, and retrieve transcript content only when relevant. Never join, record, edit, or otherwise mutate meetings through this integration.",keywords:["meetings","conversations","transcripts"]},rocketlaneMcp:{name:"rocketlaneMcp",label:"Rocketlane",apiUrl:"https://mcp.rocketlane.com/mcp",regex:"^https://mcp\\.rocketlane\\.com/mcp/?(?:\\?.*)?$",icon:"/logos/rocketlane.svg",docsUrl:"https://help.rocketlane.com/support/solutions/articles/67000754219-connect-rocketlane-mcp-to-claude-code",preferredAuthType:"oauth2",oauth:{authUrl:"https://rocketlane.scalekit.com/resources/res_121247790507492638/oauth/authorize",tokenUrl:"https://rocketlane.scalekit.com/resources/res_121247790507492638/oauth/token",registrationUrl:"https://rocketlane.scalekit.com/api/v1/resources/res_121247790507492638/clients:register",scopes:"openid email profile",resource:"https://mcp.rocketlane.com/mcp",tokenAuthMethod:"body",usePKCE:!0},systemSpecificInstructions:"Rocketlane is a brain context source (workspace) backed by remote MCP. Load the workspace-apps skill before using it. Keep the MCP endpoint unchanged. Authentication uses OAuth dynamic client registration with PKCE. Store the registered client configuration on the shared System and tokens in the current user's credential. Discover the current tools before use, search narrowly, and retrieve project detail only when relevant.",keywords:["projects","tasks","phases","time_entries","customers","status"]},googleDrive:{name:"googleDrive",label:"Google Drive",apiUrl:"https://www.googleapis.com/drive/v3",regex:"^.*(googleapis\\.com/drive|developers\\.google\\.com/drive|drive\\.google).*$",icon:"googledrive",docsUrl:"https://developers.google.com/drive/api/v3/reference",openApiUrl:"https://www.googleapis.com/discovery/v1/apis/drive/v3/rest",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/drive.readonly",managed:!0},keywords:["files","folders","permissions","sharing","comments","revisions","changes","uploads","downloads","metadata","teamdrives","export","copy","move","oauth"],systemSpecificInstructions:"Use Drive API v3. Export Google Workspace files and use media download for stored files."},googleCalendar:{name:"googleCalendar",apiUrl:"https://www.googleapis.com/calendar/v3",regex:"^.*(googleapis\\.com/calendar|developers\\.google\\.com/calendar|calendar\\.google).*$",icon:"googlecalendar",docsUrl:"https://developers.google.com/calendar/api/v3/reference",openApiUrl:"https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/calendar.settings.readonly",managed:!0},systemSpecificInstructions:"superglue provides a managed Google OAuth app for Google Calendar; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. Send OAuth tokens as Authorization: Bearer <<access_token>>.",keywords:["events","calendars","attendees","reminders","recurring","availability","free busy","settings","acl","colors","notifications","timezone","quick add","oauth"]},googleSheets:{name:"googleSheets",apiUrl:"https://sheets.googleapis.com/v4",regex:"^.*(sheets\\.googleapis|developers\\.google\\.com/sheets|sheets\\.google).*$",icon:"googlesheets",docsUrl:"https://developers.google.com/sheets/api/reference/rest",openApiUrl:"https://www.googleapis.com/discovery/v1/apis/sheets/v4/rest",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/spreadsheets https://www.googleapis.com/auth/drive.file",managed:!0},systemSpecificInstructions:"superglue provides a managed Google OAuth app for Google Sheets; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. Send OAuth tokens as Authorization: Bearer <<access_token>>. The drive.file scope only lists files created or opened through this app; open any existing spreadsheet directly by its ID with the spreadsheets scope.",keywords:["spreadsheets","sheets","cells","ranges","values","formulas","formatting","charts","pivot tables","named ranges","protected ranges","batch update","append","oauth"]},googleDocs:{name:"googleDocs",label:"Google Docs",apiUrl:"https://docs.googleapis.com/v1",regex:"^.*(docs\\.googleapis|developers\\.google\\.com/docs|docs\\.google\\.com/document).*$",icon:"googledocs",docsUrl:"https://developers.google.com/docs/api/reference/rest",openApiUrl:"https://docs.googleapis.com/$discovery/rest?version=v1",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/documents https://www.googleapis.com/auth/drive.file",managed:!0},systemSpecificInstructions:"superglue provides a managed Google OAuth app for Google Docs; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. Send OAuth tokens as Authorization: Bearer <<access_token>>. Create a document with POST /documents and edit it with POST /documents/{documentId}:batchUpdate.",keywords:["documents","docs","text","paragraphs","headings","tables","images","batch update","insert text","replace text","named ranges","oauth"]},googleSlides:{name:"googleSlides",label:"Google Slides",apiUrl:"https://slides.googleapis.com/v1",regex:"^.*(slides\\.googleapis|developers\\.google\\.com/slides|docs\\.google\\.com/presentation).*$",icon:"googleslides",docsUrl:"https://developers.google.com/slides/api/reference/rest",openApiUrl:"https://slides.googleapis.com/$discovery/rest?version=v1",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/presentations https://www.googleapis.com/auth/drive.file",managed:!0},systemSpecificInstructions:"superglue provides a managed Google OAuth app for Google Slides; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. Send OAuth tokens as Authorization: Bearer <<access_token>>. Create a presentation with POST /presentations and edit it with POST /presentations/{presentationId}:batchUpdate.",keywords:["presentations","slides","decks","shapes","text boxes","images","layouts","batch update","thumbnails","oauth"]},googleForms:{name:"googleForms",label:"Google Forms",apiUrl:"https://forms.googleapis.com/v1",regex:"^.*(forms\\.googleapis|developers\\.google\\.com/forms|docs\\.google\\.com/forms).*$",icon:"googleforms",docsUrl:"https://developers.google.com/forms/api/reference/rest",openApiUrl:"https://forms.googleapis.com/$discovery/rest?version=v1",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/forms.body https://www.googleapis.com/auth/forms.responses.readonly https://www.googleapis.com/auth/drive.file",managed:!0},systemSpecificInstructions:"superglue provides a managed Google OAuth app for Google Forms; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. Send OAuth tokens as Authorization: Bearer <<access_token>>. Create a form with POST /forms (title only), add questions with POST /forms/{formId}:batchUpdate, and read submissions with GET /forms/{formId}/responses.",keywords:["forms","questions","responses","submissions","surveys","quizzes","batch update","items","oauth"]},googleContacts:{name:"googleContacts",label:"Google Contacts",apiUrl:"https://people.googleapis.com/v1",regex:"^.*(people\\.googleapis|developers\\.google\\.com/people|contacts\\.google\\.com).*$",icon:"/logos/google.svg",docsUrl:"https://developers.google.com/people/api/rest",openApiUrl:"https://people.googleapis.com/$discovery/rest?version=v1",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/contacts https://www.googleapis.com/auth/contacts.other.readonly https://www.googleapis.com/auth/directory.readonly",managed:!0},systemSpecificInstructions:"superglue provides a managed Google OAuth app for Google Contacts; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. Send OAuth tokens as Authorization: Bearer <<access_token>>. Use /people/me/connections and /people:createContact for saved contacts, /otherContacts for automatically saved contacts, and /people:searchDirectoryPeople for the Google Workspace directory (requires a Workspace account). Every request needs personFields or readMask.",keywords:["contacts","people","directory","other contacts","connections","emails","phone numbers","organizations","search","oauth"]},googleTasks:{name:"googleTasks",label:"Google Tasks",apiUrl:"https://tasks.googleapis.com/tasks/v1",regex:"^.*(tasks\\.googleapis|developers\\.google\\.com/(workspace/)?tasks|tasks\\.google\\.com).*$",icon:"googletasks",docsUrl:"https://developers.google.com/tasks/reference/rest",openApiUrl:"https://tasks.googleapis.com/$discovery/rest?version=v1",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/tasks",managed:!0},systemSpecificInstructions:"superglue provides a managed Google OAuth app for Google Tasks; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. Send OAuth tokens as Authorization: Bearer <<access_token>>. List task lists with GET /users/@me/lists and create tasks with POST /lists/{tasklist}/tasks.",keywords:["tasks","task lists","to-do","due dates","completed","subtasks","oauth"]},googleAnalytics:{name:"googleAnalytics",apiUrl:"https://analytics.google.com",regex:"^.*(analytics|analyticsdata).*$",icon:"googleAnalytics",docsUrl:"https://developers.google.com/analytics/devguides/reporting/data/v1",openApiUrl:"https://analyticsdata.googleapis.com/$discovery/rest?version=v1beta",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/analytics.edit"},keywords:["properties","dimensions","metrics","reports","audiences","conversions","events","goals","segments","real time","user activity","attribution","funnels","cohorts","oauth"]},youtube:{name:"youtube",apiUrl:"https://youtube.googleapis.com",regex:"^.*youtube.*$",icon:"youtube",docsUrl:"https://developers.google.com/youtube/v3/docs",openApiUrl:"https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/youtube"},keywords:["videos","channels","playlists","comments","captions","live streams","analytics","thumbnails","subscriptions","activities","ratings","uploads","members","oauth"]},AWS:{name:"AWS",apiUrl:"https://amazonaws.com",regex:"^.*(aws|amazonaws).*$",icon:"/logos/aws.svg",docsUrl:"https://docs.aws.amazon.com/index.html",preferredAuthType:"api_key",keywords:["ec2","s3","lambda","rds","dynamodb","sqs","sns","cloudformation","iam","cloudwatch","vpc","instances","buckets","functions","api key"]},amazon_sp_api:{name:"amazon_sp_api",apiUrl:"https://sellingpartnerapi-na.amazon.com",regex:"^.*(sellingpartnerapi[-\\w]*\\.amazon\\.com).*$",icon:"/logos/amazon.svg",docsUrl:"https://developer-docs.amazon.com/sp-api/docs",preferredAuthType:"oauth2",oauth:{authUrl:"https://sellercentral.amazon.com/apps/authorize/consent",tokenUrl:"https://api.amazon.com/auth/o2/token",grant_type:"authorization_code",tokenAuthMethod:"body",tokenContentType:"form"},keywords:["orders","catalog items","listings","feeds","reports","fba inbound","fulfillment","inventory","pricing","seller central","marketplace"],systemSpecificInstructions:`Base host is region-specific: sellingpartnerapi-na.amazon.com (US/CA/MX/BR), sellingpartnerapi-eu.amazon.com (EU/UK/IN/ME/AF), sellingpartnerapi-fe.amazon.com (Singapore/AU/JP) \u2014 swap the region segment to match the seller's marketplace; sandbox testing uses sandbox.sellingpartnerapi-<region>.amazon.com. Requires registering an app in Seller Central > Develop Apps first. Third-party apps redirect sellers to https://sellercentral.amazon.com/apps/authorize/consent?application_id=<APP_ID>&state=<STATE> (add &version=beta only while the app is in Draft state, remove once Published); private/single-account developers can skip this by generating a refresh token directly via Seller Central > Develop Apps > "Authorize new developer" (self-authorization). Access tokens require header x-amz-access-token in addition to Authorization; some operations (e.g. FBA/notifications) use a separate grantless client_credentials flow instead of the refresh-token flow.`},googleCloud:{name:"googleCloud",apiUrl:"https://cloud.google.com",regex:"^.*(cloud\\.google|gcp|googlecloud).*$",icon:"googleCloud",docsUrl:"https://cloud.google.com/apis/docs/overview",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/cloud-platform"},keywords:["compute","storage","pubsub","cloud run","kubernetes","iam","vpc","cloud sql","bigtable","dataflow","logging","monitoring","oauth"]},bigquery:{name:"bigquery",apiUrl:"https://bigquery.googleapis.com/bigquery/v2",regex:"^.*(bigquery|bq\\.googleapis).*$",icon:"googleCloud",docsUrl:"https://cloud.google.com/bigquery/docs/reference/rest",openApiUrl:"https://bigquery.googleapis.com/$discovery/rest?version=v2",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/bigquery"},systemSpecificInstructions:`BigQuery REST API - Authentication Options:
|
|
682
|
+
Most list endpoints paginate with page plus rpp or limit, capped at 100 records per page. Payroll and accrual endpoints often require specific type values, paygroup filters, and pay period dates set to the first day of a confirmed month. Some payroll endpoints, including employee monthly payables and payroll transaction deletion, are available only for whitelisted organizations.`},attio:{name:"attio",apiUrl:"https://api.attio.com/v2/",regex:"^.*attio.*$",icon:"/logos/attio.svg",docsUrl:"https://docs.attio.com/rest-api/overview",openApiUrl:"https://api.attio.com/openapi/api",preferredAuthType:"api_key",keywords:["people","objects","records","lists","entries","workspace_members","notes","tasks","threads","comments","sorts","api_slug","attribute_type","record_id","workspace_id","object_id"]},twilio:{name:"twilio",apiUrl:"https://api.twilio.com",regex:"^.*twilio.*$",icon:"/logos/twilio.svg",docsUrl:"https://www.twilio.com/docs/api",openApiUrl:"https://raw.githubusercontent.com/twilio/twilio-oai/refs/heads/main/spec/json/twilio_api_v2010.json",preferredAuthType:"api_key",keywords:["Messages","Media","MessageFeedback","Calls","Accounts","APIKeys","Addresses","UsageRecords","CallFeedback","CredentialsList","TaskRouter_Workspaces","TaskRouter_Tasks","TaskRouter_Workers","TaskRouter_Activities","MessagingServices"]},sendgrid:{name:"sendgrid",apiUrl:"https://api.sendgrid.com",regex:"^.*sendgrid.*$",icon:"/logos/sendgrid.svg",docsUrl:"https://www.twilio.com/docs/sendgrid/api-reference",openApiUrl:"https://raw.githubusercontent.com/sendgrid/sendgrid-oai/main/oai.json",preferredAuthType:"api_key",keywords:["mail_send","templates","campaigns","marketing_contacts","marketing_lists","suppression_groups","global_suppressions","asm_suppressions","subusers","stats","categories","whitelabel","ips","access_settings"]},github:{name:"github",apiUrl:"https://api.github.com",regex:"^.*github.*$",icon:"github",docsUrl:"https://docs.github.com/en/rest",openApiUrl:"https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.json",preferredAuthType:"api_key",oauth:{authUrl:"https://github.com/login/oauth/authorize",tokenUrl:"https://github.com/login/oauth/access_token",scopes:"repo user admin:org workflow gist notifications delete_repo write:packages read:packages"},keywords:["repositories","issues","pull_requests","commits","branches","tags","releases","deployments","check_runs","actions_artifacts","organizations","packages","collaborators","gists","milestones"]},gitlab:{name:"gitlab",apiUrl:"https://api.gitlab.com",regex:"^.*gitlab.*$",icon:"gitlab",docsUrl:"https://docs.gitlab.com/api/rest/",openApiUrl:"https://gitlab.com/gitlab-org/gitlab/-/raw/master/doc/api/openapi/openapi.yaml",preferredAuthType:"api_key",oauth:{authUrl:"https://gitlab.com/oauth/authorize",tokenUrl:"https://gitlab.com/oauth/token",scopes:"api"},keywords:["projects","repositories","issues","pull_requests","commits","branches","tags","releases","deployments","check_runs","actions_artifacts","organizations","packages","collaborators","gists","milestones"]},bitbucket:{name:"bitbucket",apiUrl:"https://api.bitbucket.org",regex:"^.*bitbucket.*$",icon:"bitbucket",docsUrl:"https://developer.atlassian.com/cloud/bitbucket/rest",openApiUrl:"https://api.bitbucket.org/swagger.json",preferredAuthType:"oauth2",oauth:{authUrl:"https://bitbucket.org/site/oauth2/authorize",tokenUrl:"https://bitbucket.org/site/oauth2/access_token",scopes:"repository:admin account:write team:write webhook"},keywords:["repositories","projects","commits","branches","pullrequests","downloads","issues","pipelines","branchRestrictions","components","milestones","refs","hooks","forks","user"]},slack:{name:"slack",label:"Slack",apiUrl:"https://slack.com/api",regex:"^.*slack.*$",icon:"slack",docsUrl:"https://docs.slack.dev/apis/web-api/",openApiUrl:"https://raw.githubusercontent.com/slackapi/slack-api-specs/master/web-api/slack_web_openapi_v2.json",preferredAuthType:"oauth2",oauth:{grant_type:"authorization_code",authUrl:"https://slack.com/oauth/v2/authorize",tokenUrl:"https://slack.com/api/oauth.v2.access",scopes:"channels:history channels:join channels:read files:read users:read users:read.email",managed:!0},keywords:["channel","conversation","user","file","event","message","workflow_step","workflow_published","workflow_step_execute","usergroup","im","mpim","group","check_run","apps_permissions_resource"],systemSpecificInstructions:"Slack OAuth returns a bot token. Bot access depends on its granted scopes and channel membership."},airtable:{name:"airtable",apiUrl:"https://api.airtable.com",regex:"^.*airtable.*$",icon:"airtable",docsUrl:"https://airtable.com/developers/web/api",preferredAuthType:"oauth2",oauth:{authUrl:"https://airtable.com/oauth2/v1/authorize",tokenUrl:"https://airtable.com/oauth2/v1/token",scopes:"data.recordComments:read data.recordComments:write data.records:read data.records:write schema.bases:read schema.bases:write user.email:read enterprise.groups:read data.records:manage enterprise.account:read enterprise.account:write enterprise.auditLogs:read enterprise.changeEvents:read enterprise.exports:manage enterprise.groups:manage enterprise.scim.usersAndGroups:manage enterprise.user:read enterprise.user:write webhook:manage",managed:!0,usePKCE:!0,tokenAuthMethod:"basic_auth",tokenContentType:"form"},keywords:["bases","tables","records","fields","views","formulas","attachments","comments","collaborators","metadata","schemas","api key","key"]},gmail:{name:"gmail",label:"Gmail",apiUrl:"https://gmail.googleapis.com/gmail/v1",regex:"^.*(gmail\\.googleapis|developers\\.google\\.com/gmail|mail\\.google).*$",icon:"gmail",docsUrl:"https://developers.google.com/gmail/api/reference/rest",openApiUrl:"https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/gmail.modify",managed:!0},keywords:["messages","threads","labels","drafts","send","attachments","history","filters","settings","forwarding","inbox","profile","oauth"]},googleWorkspace:{name:"googleWorkspace",label:"Google Workspace",apiUrl:"https://www.googleapis.com",regex:"^.*(workspace\\.google\\.com|developers\\.google\\.com/workspace(?!/tasks)).*$",icon:"/logos/google.svg",docsUrl:"https://developers.google.com/workspace",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:["openid","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/calendar","https://www.googleapis.com/auth/calendar.settings.readonly","https://www.googleapis.com/auth/documents","https://www.googleapis.com/auth/spreadsheets","https://www.googleapis.com/auth/presentations","https://www.googleapis.com/auth/forms.body","https://www.googleapis.com/auth/forms.responses.readonly","https://www.googleapis.com/auth/gmail.modify","https://www.googleapis.com/auth/contacts","https://www.googleapis.com/auth/contacts.other.readonly","https://www.googleapis.com/auth/directory.readonly","https://www.googleapis.com/auth/tasks","https://www.googleapis.com/auth/drive.readonly","https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/drive.appdata"].join(" "),managed:!0},systemSpecificInstructions:"superglue provides a managed Google Workspace OAuth app; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. The System URL is the shared Google API host; address each product by its own path prefix or host: Calendar /calendar/v3, Docs https://docs.googleapis.com/v1, Sheets https://sheets.googleapis.com/v4, Slides https://slides.googleapis.com/v1, Forms https://forms.googleapis.com/v1, Gmail https://gmail.googleapis.com/gmail/v1 (read, search, and drafts; send via POST /users/me/messages/send with a base64url RFC 5322 message only when the user explicitly asks to send), People https://people.googleapis.com/v1 (contacts, otherContacts, and people:searchDirectoryPeople for the Workspace directory; directory search requires a Google Workspace account), Tasks https://tasks.googleapis.com/tasks/v1, Drive https://www.googleapis.com/drive/v3 (drive.readonly lists and reads any file the user can access; drive.file grants write access to files created or opened through this app). Send OAuth tokens as Authorization: Bearer <<access_token>>.",keywords:["workspace","calendar","events","docs","documents","sheets","spreadsheets","slides","presentations","forms","responses","gmail","send email","contacts","people","directory","tasks","oauth"]},granola:{name:"granola",label:"Granola API",apiUrl:"https://public-api.granola.ai",regex:"^.*granola.*$",icon:"/logos/granola.svg",docsUrl:"https://docs.granola.ai",preferredAuthType:"api_key",keywords:["meeting","notes","transcript","summary","ai","recording"]},fathom:{name:"fathom",apiUrl:"https://api.fathom.ai/external/v1",regex:"^.*(fathom\\.ai|fathom\\.video).*$",icon:"/logos/fathom.png",docsUrl:"https://developers.fathom.ai",openApiUrl:"https://developers.fathom.ai/api-reference/openapi.yaml",preferredAuthType:"oauth2",oauth:{grant_type:"authorization_code",authUrl:"https://fathom.video/external/v1/oauth2/authorize",tokenUrl:"https://api.fathom.ai/external/v1/oauth2/token",scopes:"public_api",managed:!0},keywords:["meeting","meetings","notetaker","transcript","transcription","recording","summary","action items","webhook","oauth"],systemSpecificInstructions:"Fathom is an AI meeting notetaker. superglue provides a managed Fathom OAuth app, so no app registration is needed \u2014 authenticate directly via OAuth (authorization code with refresh tokens; the only scope is public_api). Alternatively, an API key created in Fathom settings works via an X-Api-Key header. Send OAuth tokens as Authorization: Bearer <<access_token>>. Webhooks must set at least one of include_transcript, include_summary, include_action_items, or include_crm_matches. Rate limits: 60 requests per 60 seconds overall, 30 per 60 seconds for transcript, summary, and content-heavy meeting requests (5 per 60 seconds under high load)."},fathomMcp:{name:"fathomMcp",label:"Fathom",apiUrl:"https://api.fathom.ai/mcp",regex:"^https://api\\.fathom\\.ai/mcp/?(?:\\?.*)?$",icon:"/logos/fathom.png",docsUrl:"https://developers.fathom.ai/mcp-docs",preferredAuthType:"oauth2",oauth:{authUrl:"https://fathom.video/mcp/oauth/authorize",tokenUrl:"https://api.fathom.ai/mcp/oauth/token",registrationUrl:"https://api.fathom.ai/mcp/oauth/register",scopes:"mcp",resource:"https://api.fathom.ai/mcp",tokenAuthMethod:"body",usePKCE:!0},systemSpecificInstructions:"Fathom is a brain context source (meetings) backed by remote MCP. Load the meetings skill before using it. Keep the MCP endpoint unchanged. Authentication uses OAuth dynamic client registration with PKCE. Store the registered client configuration on the shared System and tokens in the current user's credential. Discover the current read tools before use, search narrowly, and retrieve transcript content only when relevant. Never join, record, edit, or otherwise mutate meetings through this integration. Use the separate Fathom API template only when deterministic REST access is required.",keywords:["meetings","notes","transcripts","summaries","action_items","attendees","recordings","decisions"]},granolaMcp:{name:"granolaMcp",label:"Granola",apiUrl:"https://mcp.granola.ai/mcp",regex:"^https://mcp\\.granola\\.ai/mcp/?(?:\\?.*)?$",icon:"/logos/granola.svg",docsUrl:"https://docs.granola.ai/help-center/sharing/integrations/mcp",preferredAuthType:"oauth2",oauth:{authUrl:"https://mcp-auth.granola.ai/oauth2/authorize",tokenUrl:"https://mcp-auth.granola.ai/oauth2/token",registrationUrl:"https://mcp-auth.granola.ai/oauth2/register",scopes:"mcp",resource:"https://mcp.granola.ai/mcp",tokenAuthMethod:"body",usePKCE:!0},systemSpecificInstructions:"Granola is a brain context source (meetings) backed by remote MCP. Load the meetings skill before using it. Keep the MCP endpoint unchanged. Authentication uses OAuth dynamic client registration with PKCE. Store the registered client configuration on the shared System and tokens in the current user's credential. Search narrowly and retrieve transcript content only when relevant. Never edit meeting data through this integration.",keywords:["meetings","notes","transcripts","summaries","action_items","attendees","folders","decisions"]},readAiMcp:{name:"readAiMcp",label:"Read AI",apiUrl:"https://api.read.ai/mcp",regex:"^https://api\\.read\\.ai/mcp/?(?:\\?.*)?$",icon:"/logos/read-ai.png",docsUrl:"https://support.read.ai/hc/en-us/articles/49381158409491-MCP-Server",preferredAuthType:"oauth2",oauth:{authUrl:"https://authn.read.ai/oauth2/auth",tokenUrl:"https://authn.read.ai/oauth2/token",registrationUrl:"https://api.read.ai/oauth/register",scopes:"mcp:execute meeting:read offline_access",resource:"https://api.read.ai/mcp",tokenAuthMethod:"body",usePKCE:!0},systemSpecificInstructions:"Read AI is a brain context source (meetings) backed by remote MCP. Load the meetings skill before using it. Keep the MCP endpoint unchanged. Authentication uses OAuth dynamic client registration with PKCE. Store the registered client configuration on the shared System and tokens in the current user's credential. Request read-only scopes only. Discover the current tools before use, search narrowly, and retrieve transcript content only when relevant. Never join, record, edit, or otherwise mutate meetings through this integration.",keywords:["meetings","transcripts","summaries","action_items","topics","participants","metrics"]},otterMcp:{name:"otterMcp",label:"Otter",apiUrl:"https://mcp.otter.ai/mcp",regex:"^https://mcp\\.otter\\.ai/mcp/?(?:\\?.*)?$",icon:"/logos/otter.png",docsUrl:"https://help.otter.ai/hc/en-us/articles/35287607569687-Otter-MCP-Server",preferredAuthType:"oauth2",oauth:{authUrl:"https://otter.ai/oauth2/authorize",tokenUrl:"https://otter.ai/oauth/token",registrationUrl:"https://otter.ai/oauth/register",scopes:"profile:read conversations:read",resource:"https://mcp.otter.ai/",tokenAuthMethod:"body",usePKCE:!0},systemSpecificInstructions:"Otter is a brain context source (meetings) backed by remote MCP. Load the meetings skill before using it. Keep the MCP endpoint unchanged. Authentication uses OAuth dynamic client registration with PKCE. Store the registered client configuration on the shared System and tokens in the current user's credential. Request read-only scopes only. Discover the current tools before use, search narrowly, and retrieve transcript content only when relevant. Never join, record, edit, or otherwise mutate meetings through this integration.",keywords:["meetings","conversations","transcripts"]},rocketlaneMcp:{name:"rocketlaneMcp",label:"Rocketlane",apiUrl:"https://mcp.rocketlane.com/mcp",regex:"^https://mcp\\.rocketlane\\.com/mcp/?(?:\\?.*)?$",icon:"/logos/rocketlane.svg",docsUrl:"https://help.rocketlane.com/support/solutions/articles/67000754219-connect-rocketlane-mcp-to-claude-code",preferredAuthType:"oauth2",oauth:{authUrl:"https://rocketlane.scalekit.com/resources/res_121247790507492638/oauth/authorize",tokenUrl:"https://rocketlane.scalekit.com/resources/res_121247790507492638/oauth/token",registrationUrl:"https://rocketlane.scalekit.com/api/v1/resources/res_121247790507492638/clients:register",scopes:"openid email profile",resource:"https://mcp.rocketlane.com/mcp",tokenAuthMethod:"body",usePKCE:!0},systemSpecificInstructions:"Rocketlane is a brain context source (workspace) backed by remote MCP. Load the workspace-apps skill before using it. Keep the MCP endpoint unchanged. Authentication uses OAuth dynamic client registration with PKCE. Store the registered client configuration on the shared System and tokens in the current user's credential. Discover the current tools before use, search narrowly, and retrieve project detail only when relevant.",keywords:["projects","tasks","phases","time_entries","customers","status"]},zoominfoMcp:{name:"zoominfoMcp",label:"ZoomInfo",apiUrl:"https://mcp.zoominfo.com/mcp",regex:"^https://mcp\\.zoominfo\\.com/mcp/?(?:\\?.*)?$",icon:"/logos/zoominfo.svg",docsUrl:"https://docs.gtm.ai/docs/connect-to-zoominfo-mcp",preferredAuthType:"oauth2",oauth:{authUrl:"https://mcp.zoominfo.com/oauth/authorize",tokenUrl:"https://okta-login.zoominfo.com/oauth2/default/v1/token",scopes:"openid profile email offline_access",tokenAuthMethod:"body",usePKCE:!0},systemSpecificInstructions:"ZoomInfo is a B2B prospect research System backed by remote MCP. Keep the MCP endpoint unchanged. ZoomInfo accepts dynamic client registration only from approved vendors, so each organization supplies its own OAuth client: a ZoomInfo admin assigns the DevPortal subscription, creates an MCP App at developer.zoominfo.com with the current superglue origin plus /api/auth/callback as the redirect URI, and pastes the client ID and secret into the System. A ZoomInfo admin must also enable API Access for each user under Admin Portal > Users > User Management. Store tokens in the current user's credential. Discover the current tools with tools/list before use. Resolve a company with search_companies before enrich_companies, enrich_company_signals, or account_research, and resolve attendees with search_contacts before enrich_contacts or contact_research. Every search and enrichment consumes the customer's ZoomInfo credits; fetch only the companies and contacts the task needs. ZoomInfo terms restrict storing its data: use results in the current answer and never copy them into brain files, playbooks, or other persistent context.",keywords:["prospects","companies","contacts","enrichment","intent","scoops","sales","meeting_prep"]},googleDrive:{name:"googleDrive",label:"Google Drive",apiUrl:"https://www.googleapis.com/drive/v3",regex:"^.*(googleapis\\.com/drive|developers\\.google\\.com/drive|drive\\.google).*$",icon:"googledrive",docsUrl:"https://developers.google.com/drive/api/v3/reference",openApiUrl:"https://www.googleapis.com/discovery/v1/apis/drive/v3/rest",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/drive.readonly",managed:!0},keywords:["files","folders","permissions","sharing","comments","revisions","changes","uploads","downloads","metadata","teamdrives","export","copy","move","oauth"],systemSpecificInstructions:"Use Drive API v3. Export Google Workspace files and use media download for stored files."},googleCalendar:{name:"googleCalendar",apiUrl:"https://www.googleapis.com/calendar/v3",regex:"^.*(googleapis\\.com/calendar|developers\\.google\\.com/calendar|calendar\\.google).*$",icon:"googlecalendar",docsUrl:"https://developers.google.com/calendar/api/v3/reference",openApiUrl:"https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/calendar.settings.readonly",managed:!0},systemSpecificInstructions:"superglue provides a managed Google OAuth app for Google Calendar; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. Send OAuth tokens as Authorization: Bearer <<access_token>>.",keywords:["events","calendars","attendees","reminders","recurring","availability","free busy","settings","acl","colors","notifications","timezone","quick add","oauth"]},googleSheets:{name:"googleSheets",apiUrl:"https://sheets.googleapis.com/v4",regex:"^.*(sheets\\.googleapis|developers\\.google\\.com/sheets|sheets\\.google).*$",icon:"googlesheets",docsUrl:"https://developers.google.com/sheets/api/reference/rest",openApiUrl:"https://www.googleapis.com/discovery/v1/apis/sheets/v4/rest",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/spreadsheets https://www.googleapis.com/auth/drive.file",managed:!0},systemSpecificInstructions:"superglue provides a managed Google OAuth app for Google Sheets; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. Send OAuth tokens as Authorization: Bearer <<access_token>>. The drive.file scope only lists files created or opened through this app; open any existing spreadsheet directly by its ID with the spreadsheets scope.",keywords:["spreadsheets","sheets","cells","ranges","values","formulas","formatting","charts","pivot tables","named ranges","protected ranges","batch update","append","oauth"]},googleDocs:{name:"googleDocs",label:"Google Docs",apiUrl:"https://docs.googleapis.com/v1",regex:"^.*(docs\\.googleapis|developers\\.google\\.com/docs|docs\\.google\\.com/document).*$",icon:"googledocs",docsUrl:"https://developers.google.com/docs/api/reference/rest",openApiUrl:"https://docs.googleapis.com/$discovery/rest?version=v1",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/documents https://www.googleapis.com/auth/drive.file",managed:!0},systemSpecificInstructions:"superglue provides a managed Google OAuth app for Google Docs; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. Send OAuth tokens as Authorization: Bearer <<access_token>>. Create a document with POST /documents and edit it with POST /documents/{documentId}:batchUpdate.",keywords:["documents","docs","text","paragraphs","headings","tables","images","batch update","insert text","replace text","named ranges","oauth"]},googleSlides:{name:"googleSlides",label:"Google Slides",apiUrl:"https://slides.googleapis.com/v1",regex:"^.*(slides\\.googleapis|developers\\.google\\.com/slides|docs\\.google\\.com/presentation).*$",icon:"googleslides",docsUrl:"https://developers.google.com/slides/api/reference/rest",openApiUrl:"https://slides.googleapis.com/$discovery/rest?version=v1",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/presentations https://www.googleapis.com/auth/drive.file",managed:!0},systemSpecificInstructions:"superglue provides a managed Google OAuth app for Google Slides; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. Send OAuth tokens as Authorization: Bearer <<access_token>>. Create a presentation with POST /presentations and edit it with POST /presentations/{presentationId}:batchUpdate.",keywords:["presentations","slides","decks","shapes","text boxes","images","layouts","batch update","thumbnails","oauth"]},googleForms:{name:"googleForms",label:"Google Forms",apiUrl:"https://forms.googleapis.com/v1",regex:"^.*(forms\\.googleapis|developers\\.google\\.com/forms|docs\\.google\\.com/forms).*$",icon:"googleforms",docsUrl:"https://developers.google.com/forms/api/reference/rest",openApiUrl:"https://forms.googleapis.com/$discovery/rest?version=v1",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/forms.body https://www.googleapis.com/auth/forms.responses.readonly https://www.googleapis.com/auth/drive.file",managed:!0},systemSpecificInstructions:"superglue provides a managed Google OAuth app for Google Forms; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. Send OAuth tokens as Authorization: Bearer <<access_token>>. Create a form with POST /forms (title only), add questions with POST /forms/{formId}:batchUpdate, and read submissions with GET /forms/{formId}/responses.",keywords:["forms","questions","responses","submissions","surveys","quizzes","batch update","items","oauth"]},googleContacts:{name:"googleContacts",label:"Google Contacts",apiUrl:"https://people.googleapis.com/v1",regex:"^.*(people\\.googleapis|developers\\.google\\.com/people|contacts\\.google\\.com).*$",icon:"/logos/google.svg",docsUrl:"https://developers.google.com/people/api/rest",openApiUrl:"https://people.googleapis.com/$discovery/rest?version=v1",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/contacts https://www.googleapis.com/auth/contacts.other.readonly https://www.googleapis.com/auth/directory.readonly",managed:!0},systemSpecificInstructions:"superglue provides a managed Google OAuth app for Google Contacts; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. Send OAuth tokens as Authorization: Bearer <<access_token>>. Use /people/me/connections and /people:createContact for saved contacts, /otherContacts for automatically saved contacts, and /people:searchDirectoryPeople for the Google Workspace directory (requires a Workspace account). Every request needs personFields or readMask.",keywords:["contacts","people","directory","other contacts","connections","emails","phone numbers","organizations","search","oauth"]},googleTasks:{name:"googleTasks",label:"Google Tasks",apiUrl:"https://tasks.googleapis.com/tasks/v1",regex:"^.*(tasks\\.googleapis|developers\\.google\\.com/(workspace/)?tasks|tasks\\.google\\.com).*$",icon:"googletasks",docsUrl:"https://developers.google.com/tasks/reference/rest",openApiUrl:"https://tasks.googleapis.com/$discovery/rest?version=v1",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/tasks",managed:!0},systemSpecificInstructions:"superglue provides a managed Google OAuth app for Google Tasks; users connect with their Google login and never need to create a Google Cloud project or supply a client ID or secret. Send OAuth tokens as Authorization: Bearer <<access_token>>. List task lists with GET /users/@me/lists and create tasks with POST /lists/{tasklist}/tasks.",keywords:["tasks","task lists","to-do","due dates","completed","subtasks","oauth"]},googleAnalytics:{name:"googleAnalytics",apiUrl:"https://analytics.google.com",regex:"^.*(analytics|analyticsdata).*$",icon:"googleAnalytics",docsUrl:"https://developers.google.com/analytics/devguides/reporting/data/v1",openApiUrl:"https://analyticsdata.googleapis.com/$discovery/rest?version=v1beta",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/analytics.edit"},keywords:["properties","dimensions","metrics","reports","audiences","conversions","events","goals","segments","real time","user activity","attribution","funnels","cohorts","oauth"]},youtube:{name:"youtube",apiUrl:"https://youtube.googleapis.com",regex:"^.*youtube.*$",icon:"youtube",docsUrl:"https://developers.google.com/youtube/v3/docs",openApiUrl:"https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/youtube"},keywords:["videos","channels","playlists","comments","captions","live streams","analytics","thumbnails","subscriptions","activities","ratings","uploads","members","oauth"]},AWS:{name:"AWS",apiUrl:"https://amazonaws.com",regex:"^.*(aws|amazonaws).*$",icon:"/logos/aws.svg",docsUrl:"https://docs.aws.amazon.com/index.html",preferredAuthType:"api_key",keywords:["ec2","s3","lambda","rds","dynamodb","sqs","sns","cloudformation","iam","cloudwatch","vpc","instances","buckets","functions","api key"]},amazon_sp_api:{name:"amazon_sp_api",apiUrl:"https://sellingpartnerapi-na.amazon.com",regex:"^.*(sellingpartnerapi[-\\w]*\\.amazon\\.com).*$",icon:"/logos/amazon.svg",docsUrl:"https://developer-docs.amazon.com/sp-api/docs",preferredAuthType:"oauth2",oauth:{authUrl:"https://sellercentral.amazon.com/apps/authorize/consent",tokenUrl:"https://api.amazon.com/auth/o2/token",grant_type:"authorization_code",tokenAuthMethod:"body",tokenContentType:"form"},keywords:["orders","catalog items","listings","feeds","reports","fba inbound","fulfillment","inventory","pricing","seller central","marketplace"],systemSpecificInstructions:`Base host is region-specific: sellingpartnerapi-na.amazon.com (US/CA/MX/BR), sellingpartnerapi-eu.amazon.com (EU/UK/IN/ME/AF), sellingpartnerapi-fe.amazon.com (Singapore/AU/JP) \u2014 swap the region segment to match the seller's marketplace; sandbox testing uses sandbox.sellingpartnerapi-<region>.amazon.com. Requires registering an app in Seller Central > Develop Apps first. Third-party apps redirect sellers to https://sellercentral.amazon.com/apps/authorize/consent?application_id=<APP_ID>&state=<STATE> (add &version=beta only while the app is in Draft state, remove once Published); private/single-account developers can skip this by generating a refresh token directly via Seller Central > Develop Apps > "Authorize new developer" (self-authorization). Access tokens require header x-amz-access-token in addition to Authorization; some operations (e.g. FBA/notifications) use a separate grantless client_credentials flow instead of the refresh-token flow.`},googleCloud:{name:"googleCloud",apiUrl:"https://cloud.google.com",regex:"^.*(cloud\\.google|gcp|googlecloud).*$",icon:"googleCloud",docsUrl:"https://cloud.google.com/apis/docs/overview",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/cloud-platform"},keywords:["compute","storage","pubsub","cloud run","kubernetes","iam","vpc","cloud sql","bigtable","dataflow","logging","monitoring","oauth"]},bigquery:{name:"bigquery",apiUrl:"https://bigquery.googleapis.com/bigquery/v2",regex:"^.*(bigquery|bq\\.googleapis).*$",icon:"googleCloud",docsUrl:"https://cloud.google.com/bigquery/docs/reference/rest",openApiUrl:"https://bigquery.googleapis.com/$discovery/rest?version=v2",preferredAuthType:"oauth2",oauth:{authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:"https://www.googleapis.com/auth/bigquery"},systemSpecificInstructions:`BigQuery REST API - Authentication Options:
|
|
683
683
|
|
|
684
684
|
OPTION 1: OAuth App (Recommended)
|
|
685
685
|
If the user has or creates an OAuth app in their Google Cloud project:
|
|
@@ -807,7 +807,7 @@ PAGINATION: Teams endpoints ignore $skip and $count. Page only with @odata.nextL
|
|
|
807
807
|
|
|
808
808
|
QUERY LIMITS: Chat messages support $orderby lastModifiedDateTime or createdDateTime (desc only) and $filter on the same property; $filter is ignored without the matching $orderby. Channel messages support only $top and $expand=replies (first 200 replies inline, more via replies@odata.nextLink) and are sorted by last activity of the whole reply chain, not by creation. /chats supports $expand=members (capped at 25 members) and $expand=lastMessagePreview.
|
|
809
809
|
|
|
810
|
-
RATE LIMITS: 429 with Retry-After. Per app per tenant: 1 request per second on a given chat or channel and 4 per second on a given team. Long backfills of one channel get throttled; keep page size at 50 and retry on Retry-After.`},outlookMail:{name:"outlookMail",label:"Outlook",apiUrl:"https://graph.microsoft.com",regex:"^.*(outlook|graph\\.microsoft\\.com.*(messages|mailFolders|mailboxSettings)|learn\\.microsoft\\.com.*graph.*(mail|message)).*$",icon:"/logos/outlook.svg",docsUrl:"https://learn.microsoft.com/en-us/graph/api/resources/mail-api-overview",preferredAuthType:"oauth2",oauth:{authUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",tokenUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/token",scopes:"openid profile email offline_access User.Read Mail.ReadWrite Mail.Send MailboxSettings.Read Contacts.ReadWrite Calendars.ReadWrite",managed:!0},keywords:["outlook","email","mail","mailbox","messages","inbox","drafts","send","attachments","microsoft graph","office 365","oauth"],systemSpecificInstructions:"Outlook uses delegated Microsoft Graph access for work or school accounts. Some permissions require tenant administrator approval. Avoid requesting scopes that need admin consent unless the tool cannot work without them."},powerAutomate:{name:"powerAutomate",label:"Power Automate",apiUrl:"https://api.flow.microsoft.com",regex:"^.*(flow\\.microsoft\\.com|powerautomate|power-automate|api\\.powerplatform\\.com.*powerautomate|learn\\.microsoft\\.com.*power-automate).*$",icon:"/logos/power_automate.svg",docsUrl:"https://learn.microsoft.com/en-us/power-automate/manage-flows-with-code",preferredAuthType:"oauth2",oauth:{authUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",tokenUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/token",scopes:"openid profile email offline_access Activity.Read.All Approvals.Manage.All Approvals.Read.All Flows.Install Flows.Manage.All Flows.Read.All",managed:!0},keywords:["power automate","flow","cloud flow","flow run","run history","activity","approval","approvals","approve","reject","trigger","environment","power platform","oauth"],systemSpecificInstructions:"Power Automate uses the delegated Flow service API with a work or school account."},microsoft:{name:"microsoft",apiUrl:"https://graph.microsoft.com",regex:"^.*(microsoft|graph\\.microsoft|office|outlook|live\\.com|sharepoint).*$",icon:"default",docsUrl:"https://learn.microsoft.com/en-us/graph/api/overview",preferredAuthType:"oauth2",oauth:{authUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",tokenUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/token",scopes:"openid profile email offline_access User.Read User.ReadBasic.All Mail.ReadWrite Mail.Send MailboxSettings.Read Calendars.ReadWrite Contacts.ReadWrite Files.ReadWrite.All Sites.ReadWrite.All Sites.Manage.All Notes.ReadWrite.All Tasks.ReadWrite Team.ReadBasic.All Team.Create Channel.ReadBasic.All ChannelMessage.Send Chat.ReadWrite",managed:!0},keywords:["users","groups","mail","calendar","contacts","onedrive","sharepoint","teams","planner","tasks","drives","sites","lists","permissions","graph","oauth"],systemSpecificInstructions:"superglue provides a managed multi-tenant Microsoft app (work/school and personal accounts), so no Azure app registration is needed \u2014 authenticate directly via OAuth. The default scopes are user-consentable in most tenants. Add the admin-consent scopes Channel.Create, ChannelMessage.Read.All, Group.ReadWrite.All and TeamMember.ReadWrite.All only when strictly needed. Conditional Access policies can require administrator involvement for other permissions. Always keep offline_access in scopes to receive refresh tokens for long-term access. A custom Entra Web app registration is only needed when an organization requires single-tenant access or its own app governance: register it with the exact OAuth callback URL of the current superglue deployment, use tenant-specific authorization and token URLs instead of /common, and copy the client secret Value, not the Secret ID."},dynamics365_sales:{name:"dynamics365_sales",apiUrl:"https://<<api_host>>/api/data/v9.2",regex:"^.*(crm\\d*\\.dynamics\\.com|dynamicscrm).*$",icon:"dynamics365",docsUrl:"https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/query-data-web-api",preferredAuthType:"oauth2",connectionFields:[{key:"api_host",label:"Environment host",placeholder:"contoso.crm.dynamics.com",required:!0}],oauth:{authUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",tokenUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/token",scopes:"https://<<api_host>>/user_impersonation offline_access",managed:!0,grant_type:"authorization_code"},keywords:["accounts","contacts","leads","opportunities","quotes","salesorders","salesorderdetails","products","incidents","campaigns","invoices","competitors","teams","systemusers","businessunits","odata","dynamics","crm","dynamics 365 sales","dataverse","oauth"],systemSpecificInstructions:`Dynamics 365 Sales \u2014 Dataverse Web API v9.2
|
|
810
|
+
RATE LIMITS: 429 with Retry-After. Per app per tenant: 1 request per second on a given chat or channel and 4 per second on a given team. Long backfills of one channel get throttled; keep page size at 50 and retry on Retry-After.`},outlookMail:{name:"outlookMail",label:"Outlook",apiUrl:"https://graph.microsoft.com",regex:"^.*(outlook|graph\\.microsoft\\.com.*(messages|mailFolders|mailboxSettings|calendarView|events)|learn\\.microsoft\\.com.*graph.*(mail|message)).*$",icon:"/logos/outlook.svg",docsUrl:"https://learn.microsoft.com/en-us/graph/api/resources/mail-api-overview",preferredAuthType:"oauth2",oauth:{authUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",tokenUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/token",scopes:"openid profile email offline_access User.Read Mail.ReadWrite Mail.Send MailboxSettings.Read Contacts.ReadWrite Calendars.ReadWrite",managed:!0},keywords:["outlook","email","mail","mailbox","messages","inbox","drafts","send","attachments","calendar","events","microsoft graph","office 365","oauth"],systemSpecificInstructions:"Outlook uses delegated Microsoft Graph access for work or school accounts. Some permissions require tenant administrator approval. Avoid requesting scopes that need admin consent unless the tool cannot work without them."},powerAutomate:{name:"powerAutomate",label:"Power Automate",apiUrl:"https://api.flow.microsoft.com",regex:"^.*(flow\\.microsoft\\.com|powerautomate|power-automate|api\\.powerplatform\\.com.*powerautomate|learn\\.microsoft\\.com.*power-automate).*$",icon:"/logos/power_automate.svg",docsUrl:"https://learn.microsoft.com/en-us/power-automate/manage-flows-with-code",preferredAuthType:"oauth2",oauth:{authUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",tokenUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/token",scopes:"openid profile email offline_access Activity.Read.All Approvals.Manage.All Approvals.Read.All Flows.Install Flows.Manage.All Flows.Read.All",managed:!0},keywords:["power automate","flow","cloud flow","flow run","run history","activity","approval","approvals","approve","reject","trigger","environment","power platform","oauth"],systemSpecificInstructions:"Power Automate uses the delegated Flow service API with a work or school account."},microsoft:{name:"microsoft",apiUrl:"https://graph.microsoft.com",regex:"^.*(microsoft|graph\\.microsoft|office|outlook|live\\.com|sharepoint).*$",icon:"default",docsUrl:"https://learn.microsoft.com/en-us/graph/api/overview",preferredAuthType:"oauth2",oauth:{authUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",tokenUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/token",scopes:"openid profile email offline_access User.Read User.ReadBasic.All Mail.ReadWrite Mail.Send MailboxSettings.Read Calendars.ReadWrite Contacts.ReadWrite Files.ReadWrite.All Sites.ReadWrite.All Sites.Manage.All Notes.ReadWrite.All Tasks.ReadWrite Team.ReadBasic.All Team.Create Channel.ReadBasic.All ChannelMessage.Send Chat.ReadWrite",managed:!0},keywords:["users","groups","mail","calendar","contacts","onedrive","sharepoint","teams","planner","tasks","drives","sites","lists","permissions","graph","oauth"],systemSpecificInstructions:"superglue provides a managed multi-tenant Microsoft app (work/school and personal accounts), so no Azure app registration is needed \u2014 authenticate directly via OAuth. The default scopes are user-consentable in most tenants. Add the admin-consent scopes Channel.Create, ChannelMessage.Read.All, Group.ReadWrite.All and TeamMember.ReadWrite.All only when strictly needed. Conditional Access policies can require administrator involvement for other permissions. Always keep offline_access in scopes to receive refresh tokens for long-term access. A custom Entra Web app registration is only needed when an organization requires single-tenant access or its own app governance: register it with the exact OAuth callback URL of the current superglue deployment, use tenant-specific authorization and token URLs instead of /common, and copy the client secret Value, not the Secret ID."},dynamics365_sales:{name:"dynamics365_sales",apiUrl:"https://<<api_host>>/api/data/v9.2",regex:"^.*(crm\\d*\\.dynamics\\.com|dynamicscrm).*$",icon:"dynamics365",docsUrl:"https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/query-data-web-api",preferredAuthType:"oauth2",connectionFields:[{key:"api_host",label:"Environment host",placeholder:"contoso.crm.dynamics.com",required:!0}],oauth:{authUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",tokenUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/token",scopes:"https://<<api_host>>/user_impersonation offline_access",managed:!0,grant_type:"authorization_code"},keywords:["accounts","contacts","leads","opportunities","quotes","salesorders","salesorderdetails","products","incidents","campaigns","invoices","competitors","teams","systemusers","businessunits","odata","dynamics","crm","dynamics 365 sales","dataverse","oauth"],systemSpecificInstructions:`Dynamics 365 Sales \u2014 Dataverse Web API v9.2
|
|
811
811
|
|
|
812
812
|
CONNECTING: superglue provides a managed multi-tenant Microsoft app, so no Azure app registration is needed \u2014 authenticate directly via OAuth. The Dataverse scope is per-environment: the template scope contains an <<api_host>> placeholder and Microsoft rejects it unresolved \u2014 ALWAYS substitute the environment host (e.g. https://contoso.crm.dynamics.com/user_impersonation offline_access) in scopes when calling authenticate_oauth. Ask the user for the host if it is unknown. The user_impersonation scope does not require Entra administrator consent, but the signed-in user needs a Dynamics 365 license and a security role in the target environment. Keep offline_access in scopes to receive refresh tokens.
|
|
813
813
|
|
|
@@ -1714,7 +1714,7 @@ ${o}`;break;case"retry":CH(o)&&(r[i]=o);break;case"id":bH(o)&&(r[i]=o);break;cas
|
|
|
1714
1714
|
`);t.stack=r?`${r}
|
|
1715
1715
|
${o}`:i.stack}V.exports.fetch=function(e,r=void 0){return E_e(e,r).catch(n=>{throw NH?xH(n,NH):n&&typeof n=="object"&&Error.captureStackTrace(n,V.exports.fetch),n})};V.exports.Headers=Ha().Headers;V.exports.Response=cd().Response;V.exports.Request=bu().Request;V.exports.FormData=uh().FormData;var{setGlobalOrigin:I_e,getGlobalOrigin:C_e}=tS();V.exports.setGlobalOrigin=I_e;V.exports.getGlobalOrigin=C_e;var{CacheStorage:b_e}=Eq(),{kConstruct:S_e}=Fe();V.exports.caches=new b_e(S_e);var{deleteCookie:B_e,getCookies:Q_e,getSetCookies:w_e,setCookie:v_e,parseCookie:__e}=Rq();V.exports.deleteCookie=B_e;V.exports.getCookies=Q_e;V.exports.getSetCookies=w_e;V.exports.setCookie=v_e;V.exports.parseCookie=__e;var{parseMIMEType:D_e,serializeAMimeType:T_e}=cn();V.exports.parseMIMEType=D_e;V.exports.serializeAMimeType=T_e;var{CloseEvent:R_e,ErrorEvent:k_e,MessageEvent:N_e}=_m(),{WebSocket:O_e,ping:U_e}=lH();V.exports.WebSocket=O_e;V.exports.CloseEvent=R_e;V.exports.ErrorEvent=k_e;V.exports.MessageEvent=N_e;V.exports.ping=U_e;V.exports.WebSocketStream=yH().WebSocketStream;V.exports.WebSocketError=Rw().WebSocketError;V.exports.request=Id(Nu.request);V.exports.stream=Id(Nu.stream);V.exports.pipeline=Id(Nu.pipeline);V.exports.connect=Id(Nu.connect);V.exports.upgrade=Id(Nu.upgrade);V.exports.MockClient=a_e;V.exports.MockCallHistory=c_e;V.exports.MockCallHistoryLog=u_e;V.exports.MockPool=A_e;V.exports.MockAgent=l_e;V.exports.SnapshotAgent=d_e;V.exports.mockErrors=f_e;var{EventSource:M_e}=kH();V.exports.EventSource=M_e;function x_e(){globalThis.fetch=V.exports.fetch,globalThis.Headers=V.exports.Headers,globalThis.Response=V.exports.Response,globalThis.Request=V.exports.Request,globalThis.FormData=V.exports.FormData,globalThis.WebSocket=V.exports.WebSocket,globalThis.CloseEvent=V.exports.CloseEvent,globalThis.ErrorEvent=V.exports.ErrorEvent,globalThis.MessageEvent=V.exports.MessageEvent,globalThis.EventSource=V.exports.EventSource}V.exports.install=x_e});var FH=h(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.SuperglueClient=Uu.SuperglueHttpError=void 0;var Ou=qr(),Fo=SC(),L_e=ZC(),P_e=ZM(),F_e=jn(),$o=Sc(),$_e=jf(),bd=14400*1e3,Cd;if(typeof globalThis.process<"u"&&globalThis.process.versions?.node)try{let{Agent:t}=LH();Cd=new t({headersTimeout:bd,bodyTimeout:bd})}catch{}function PH(t){if(t?.aborted)throw t.reason??new DOMException("Aborted","AbortError")}var jm=class extends Error{constructor(e,r,n,i){super(e),this.status=r,this.code=n,this.details=i,this.name="SuperglueHttpError"}};Uu.SuperglueHttpError=jm;var xw=class{constructor({apiKey:e,apiEndpoint:r,onInfrastructureError:n,refreshToken:i,sseTokenProvider:o,tokenProvider:s}){if(!e&&!s)throw new Error("SuperglueClient requires either apiKey or tokenProvider");this.tokenProvider=s??(async()=>e),this.apiEndpoint=r??"https://api.superglue.cloud",this.sseManager=new L_e.SSELogSubscriptionManager(this.apiEndpoint,o??this.tokenProvider,i),this.onInfrastructureError=n,this.refreshToken=i}async getApiKey(){return this.tokenProvider()}async fetchWithAuthRetry(e,r){let n=await this.getApiKey(),i=await e(n);if(i.status!==401||!this.refreshToken)return i;PH(r);let o=await this.refreshToken();return PH(r),!o||o===n?i:(i.body?.cancel(),e(o))}isInfrastructureError(e){return(0,F_e.isAbortError)(e)?!1:!!(e instanceof TypeError&&e.message.toLowerCase().includes("fetch")||e instanceof Error&&e.name==="TimeoutError")}async restRequest(e,r,n,i,o){let a=await(await this.restResponse({method:e,path:r,body:n,extraHeaders:i,requestInit:o})).text();if(a)return JSON.parse(a)}async restResponse({method:e,path:r,body:n,extraHeaders:i,requestInit:o}){let s=`${this.apiEndpoint.replace(/\/$/,"")}${r}`,a=n!=null,c=typeof FormData<"u"&&n instanceof FormData,u=A=>{let d={Authorization:`Bearer ${A}`,...i};return a&&!c&&e!=="GET"&&(d["Content-Type"]="application/json"),fetch(s,{...o,method:e,headers:d,body:a?c?n:JSON.stringify(n):void 0,signal:o?.signal??AbortSignal.timeout(bd),...Cd?{dispatcher:Cd}:{}})},l;try{l=await this.fetchWithAuthRetry(u,o?.signal)}catch(A){throw this.isInfrastructureError(A)&&this.onInfrastructureError?.(),A}if(!l.ok)throw await this.buildHttpError(l);return l}async uploadFiles(e,r){if(typeof r?.process!="boolean")throw new Error("process must be a boolean");if(e.length===0)return[];let n=e.map(l=>({...l,contentLength:l.contentLength??this.getUploadContentLength(l.content)})),o=(await this.restRequest("POST","/v1/files/uploads",{process:r.process,files:n.map(({fileName:l,contentType:A,contentLength:d})=>({fileName:l,contentLength:d,...A?{contentType:A}:{}}))})).data.files;if(o.length!==n.length)throw await Promise.all(o.map(l=>this.deleteFileUpload(l.id).catch(()=>{}))),new Error("Upload response did not match the selected files");let s=await Promise.allSettled(o.map(async(l,A)=>{let d=n[A],f=await fetch(l.uploadUrl,{method:"PUT",body:d.content,headers:d.contentType?{"Content-Type":d.contentType}:void 0,signal:AbortSignal.timeout(Math.min(bd,l.expiresIn*1e3))});if(!f.ok)throw new Error(`Upload failed for ${d.fileName}: ${f.status} ${f.statusText}`);return l.id})),a=s.flatMap(l=>l.status==="fulfilled"?[l.value]:[]),c=new Map;if(a.length>0)try{let l=await this.restRequest("POST","/v1/files/uploads/complete",{fileIds:a});c=new Map(l.data.files.map(A=>[A.id,A]))}catch(l){c=new Map(a.map(A=>[A,{id:A,fileName:n[o.findIndex(d=>d.id===A)]?.fileName||A,contentLength:n[o.findIndex(d=>d.id===A)]?.contentLength||0,status:"failed",error:l instanceof Error?l.message:String(l)}]))}let u=o.map((l,A)=>{let d=s[A],f=n[A];return d.status==="rejected"?{id:l.id,fileName:f.fileName,contentLength:f.contentLength,status:"failed",error:d.reason instanceof Error?d.reason.message:String(d.reason)}:c.get(l.id)||{id:l.id,fileName:f.fileName,contentLength:f.contentLength,status:"failed",error:"Upload completion returned no result"}});return await Promise.all(u.filter(l=>l.status==="failed").map(l=>this.deleteFileUpload(l.id).catch(()=>{}))),u}async deleteFileUpload(e){await this.restRequest("DELETE",`/v1/files/uploads/${encodeURIComponent(e)}`)}getUploadContentLength(e){return typeof e=="string"?new TextEncoder().encode(e).byteLength:e instanceof Uint8Array?e.byteLength:e.size}async buildHttpError(e){e.status>=500&&this.onInfrastructureError?.();let r=await e.text(),n=`HTTP ${e.status}: ${r}`,i,o;try{let s=JSON.parse(r);s&&typeof s=="object"&&!Array.isArray(s)&&(o=s),typeof s?.code=="string"&&(i=s.code);let a=s.error;typeof a=="string"?n=a:a&&typeof a=="object"&&(n=a.message||JSON.stringify(a))}catch{}return new jm(n,e.status,i,o)}async streamRequest(e,r,n){let i=e.includes("?")?"&":"?",o=`${this.apiEndpoint.replace(/\/$/,"")}${e}${i}stream=true`,s=u=>fetch(o,{method:"POST",headers:{Authorization:`Bearer ${u}`,Accept:"text/event-stream","Content-Type":"application/json"},body:JSON.stringify(r),signal:n??AbortSignal.timeout(bd),...Cd?{dispatcher:Cd}:{}}),a;try{a=await this.fetchWithAuthRetry(s,n)}catch(u){throw this.isInfrastructureError(u)&&this.onInfrastructureError?.(),u}if(!a.ok)throw await this.buildHttpError(a);if(!(a.headers.get("content-type")||"").includes("text/event-stream")){let u=await a.text();return u?JSON.parse(u):void 0}try{return await(0,P_e.consumeEventStreamResult)(a)}catch(u){throw this.isInfrastructureError(u)&&this.onInfrastructureError?.(),u}}async subscribeToLogsSSE(e={}){return this.sseManager.subscribeToLogs(e)}async disconnect(){await this.sseManager.disconnect()}async getMe(){return this.restRequest("GET","/v1/me")}async completeOnboarding(){return this.restRequest("POST","/v1/me/onboarding/complete")}async runTool(e){let r=await this.restRequest("POST",`/v1/tools/${encodeURIComponent(e.toolId)}/run`,{inputs:e.payload,files:e.files,credentials:e.credentials,includeStepResultData:e.includeStepResultData,options:e.options,runId:e.runId,stateFixture:e.stateFixture},void 0,e.signal?{signal:e.signal}:void 0);return{success:r.status==="success",data:r.data,error:r.error,tool:r.tool,stepResults:r.stepResults?.map(n=>({...n}))||[],...r.fileArtifacts&&r.fileArtifacts.length>0?{fileArtifacts:r.fileArtifacts}:{},...r.metadata?.warnings?.length?{warnings:r.metadata.warnings}:{}}}async runToolConfig(e){let r=e.createRun?"/v1/tools/run?createRun=true":"/v1/tools/run",n=await this.restRequest("POST",r,{tool:e.tool,payload:e.payload,files:e.files,credentials:e.credentials,includeStepResultData:e.includeStepResultData,options:e.options,runId:e.runId,stateFixture:e.stateFixture,executionKind:e.executionKind,parentToolId:e.parentToolId,draftId:e.draftId},e.traceId?{"X-Trace-Id":e.traceId}:void 0,e.signal?{signal:e.signal}:void 0);return{success:n.status?n.status==="success":n.success??!1,data:n.data,error:n.error,tool:n.tool||e.tool,stepResults:n.stepResults?.map(o=>({...o}))||[],...n.fileArtifacts&&n.fileArtifacts.length>0?{fileArtifacts:n.fileArtifacts}:{},...n.metadata?.warnings?.length?{warnings:n.metadata.warnings}:{}}}async abortToolExecution(e){return{success:!0,runId:(await this.restRequest("POST",`/v1/runs/${encodeURIComponent(e)}/cancel`)).runId}}async executeStep({step:e,payload:r,files:n,previousResults:i,credentials:o,options:s,runId:a,systemIds:c,createRun:u,parentToolId:l,stepIndex:A,stepId:d,signal:f,stream:g}){let I={step:e,payload:r,files:n,previousResults:i,credentials:o,options:s,runId:a,systemIds:c,createRun:u,parentToolId:l,stepIndex:A,stepId:d};return g?this.streamRequest("/v1/tools/step/run",I,f):this.restRequest("POST","/v1/tools/step/run",I,void 0,f?{signal:f}:void 0)}async abortStep(e){return this.restRequest("POST","/v1/tools/step/abort",{runId:e})}async executeTransformOnly({outputTransform:e,outputSchema:r,inputSchema:n,payload:i,files:o,stepResults:s,options:a,runId:c,createRun:u,parentToolId:l,stepId:A,signal:d,stream:f}){let g={outputTransform:e,outputSchema:r,inputSchema:n,payload:i,files:o,stepResults:s,options:a,runId:c,createRun:u,parentToolId:l,stepId:A};return f?this.streamRequest("/v1/tools/transform/run",g,d):this.restRequest("POST","/v1/tools/transform/run",g,void 0,d?{signal:d}:void 0)}async createRun({toolId:e,toolConfig:r,toolResult:n,stepResults:i,toolPayload:o,status:s,error:a,startedAt:c,completedAt:u,executionKind:l,parentToolId:A,draftId:d}){return this.restRequest("POST","/v1/runs",{toolId:e,toolConfig:r,toolResult:n,stepResults:i,toolPayload:o,status:s,error:a,startedAt:(0,$o.toUTCISOString)(c,"run.startedAt"),completedAt:(0,$o.toUTCISOString)(u,"run.completedAt"),executionKind:l,parentToolId:A,draftId:d})}async checkRunLimit(){return(await this.restRequest("POST","/v1/runs/check-limit")).data}async extract({file:e,envelope:r}){if(!e)throw new Error("File must be provided for extract.");let n=new FormData;n.append("file",e);let i=r?"/v1/extract?envelope=true":"/v1/extract";return this.restRequest("POST",i,n)}mapOpenAPIRunToRun(e){let r={running:Ou.RunStatus.RUNNING,success:Ou.RunStatus.SUCCESS,failed:Ou.RunStatus.FAILED,aborted:Ou.RunStatus.ABORTED};return{runId:e.runId??e.id,toolId:e.toolId,tool:e.tool,systemIds:e.systemIds,status:r[e.status]??Ou.RunStatus.FAILED,toolPayload:e.toolPayload,data:e.data,toolResult:e.data,error:e.error,stepResults:e.stepResults,options:e.options,requestSource:e.requestSource,traceId:e.traceId,resultStorageUri:e.resultStorageUri,userId:e.userId,userEmail:e.userEmail,userName:e.userName,metadata:{...e.metadata,executionKind:e.metadata?.executionKind??Ou.RunExecutionKind.FULL},fileArtifacts:e.fileArtifacts}}mapOpenAPIScheduleToToolSchedule(e){return{...e,lastRunAt:e.lastRunAt?(0,$o.requireUTCDate)(e.lastRunAt,"schedule.lastRunAt"):void 0,nextRunAt:(0,$o.requireUTCDate)(e.nextRunAt,"schedule.nextRunAt"),createdAt:(0,$o.requireUTCDate)(e.createdAt,"schedule.createdAt"),updatedAt:(0,$o.requireUTCDate)(e.updatedAt,"schedule.updatedAt")}}async listRuns(e={}){let r=(0,Fo.createSearchListQueryParams)(e);e.toolId!==void 0&&r.set("toolId",e.toolId),e.searchUserIds?.length&&r.set("searchUserIds",e.searchUserIds.join(",")),e.includeTotal!==void 0&&r.set("includeTotal",String(e.includeTotal)),e.startedAfter!==void 0&&r.set("startedAfter",e.startedAfter instanceof Date?(0,$o.toUTCISOString)(e.startedAfter,"run.startedAfter"):e.startedAfter),e.statuses!==void 0?r.set("status",e.statuses.join(",")):e.status!==void 0&&r.set("status",e.status),e.requestSources!==void 0&&r.set("requestSources",e.requestSources.join(",")),e.executionKinds!==void 0&&r.set("executionKinds",e.executionKinds.join(",")),e.userId!==void 0&&r.set("userId",e.userId),e.systemId!==void 0&&r.set("systemId",e.systemId),e.systemIds!==void 0&&r.set("systemIds",e.systemIds.join(","));let n=r.size>0?`?${r.toString()}`:"",i=await this.restRequest("GET",`/v1/runs${n}`,void 0,void 0,{signal:e.signal});return{data:i.data.map(o=>this.mapOpenAPIRunToRun(o)),total:i.total,page:i.page,limit:i.limit,hasMore:i.hasMore}}async getActivityCounts(e){let r=new URLSearchParams;e?.from&&r.set("from",e.from instanceof Date?(0,$o.toUTCISOString)(e.from,"activity.from"):e.from),e?.to&&r.set("to",e.to instanceof Date?(0,$o.toUTCISOString)(e.to,"activity.to"):e.to);let n=r.toString();return(await this.restRequest("GET",`/v1/activity/counts${n?`?${n}`:""}`,void 0,void 0,{signal:e?.signal})).counts}async getRun(e){try{let r=await this.restRequest("GET",`/v1/runs/${encodeURIComponent(e)}`);return this.mapOpenAPIRunToRun(r)}catch(r){if(r.message?.includes("404")||r.message?.includes("not found"))return null;throw r}}async getTool(e){try{return await this.restRequest("GET",`/v1/tools/${encodeURIComponent(e)}`)}catch(r){if(r.message?.includes("404")||r.message?.includes("not found")||r.message?.includes("403")||r.message?.includes("not allowed"))return null;throw r}}async getToolState(e){return(await this.restRequest("GET",`/v1/tools/${encodeURIComponent(e)}/state`)).state}async setToolState(e,r){await this.restRequest("PUT",`/v1/tools/${encodeURIComponent(e)}/state`,{state:r})}async deleteToolState(e){return(await this.restRequest("DELETE",`/v1/tools/${encodeURIComponent(e)}/state`)).deletedKeys}async archiveTool(e,r=!0){return this.updateTool(e,{archived:r})}async bulkArchiveTools(e,r=!0){return this.restRequest("POST","/v1/tools/bulk/archive",{ids:e,archived:r})}async bulkDeleteTools(e){return this.restRequest("POST","/v1/tools/bulk/delete",{ids:e})}async listTools(e={}){let r=(0,Fo.createListQueryParams)(e);e.includeArchived!==void 0&&r.set("includeArchived",String(e.includeArchived));let n=r.size>0?`?${r.toString()}`:"";return this.restRequest("GET",`/v1/tools${n}`)}async listAllTools(e={}){return(0,Fo.listAllPages)((r,n)=>this.listTools({...e,page:r,limit:n}))}async createTool(e,r){return this.restRequest("POST","/v1/tools",{...r,id:e})}async updateTool(e,r){return this.restRequest("PUT",`/v1/tools/${encodeURIComponent(e)}`,r)}async deleteTool(e){try{return await this.restRequest("DELETE",`/v1/tools/${encodeURIComponent(e)}`),!0}catch(r){if(r.message?.includes("404"))return!1;throw r}}async renameTool(e,r){return this.restRequest("POST",`/v1/tools/${encodeURIComponent(e)}/rename`,{newId:r})}async getWorkflow(e){return this.getTool(e)}async archiveWorkflow(e,r=!0){return this.upsertWorkflow(e,{archived:r})}async createWorkflow(e,r){return this.createTool(e,r)}async updateWorkflow(e,r){return this.updateTool(e,r)}async upsertWorkflow(e,r){return await this.getTool(e)?this.updateTool(e,r):this.createTool(e,r)}async deleteWorkflow(e){return this.deleteTool(e)}async renameWorkflow(e,r){return this.renameTool(e,r)}async listSchedules(e={}){let r=(0,Fo.createListQueryParams)(e),n=r.size>0?`?${r.toString()}`:"",i=e.toolId?`/v1/tools/${encodeURIComponent(e.toolId)}/schedules${n}`:`/v1/schedules${n}`,o=await this.restRequest("GET",i);return{...o,data:o.data.map(s=>this.mapOpenAPIScheduleToToolSchedule(s))}}async listAllSchedules(e={}){return(0,Fo.listAllPages)((r,n)=>this.listSchedules({...e,page:r,limit:n}))}async getToolSchedule(e,r){try{let n=await this.restRequest("GET",`/v1/tools/${encodeURIComponent(e)}/schedules/${encodeURIComponent(r)}`);return this.mapOpenAPIScheduleToToolSchedule(n)}catch(n){if(n.message?.includes("404")||n.message?.includes("not found"))return null;throw n}}async createToolSchedule(e,r){let n=await this.restRequest("POST",`/v1/tools/${encodeURIComponent(e)}/schedules`,{...r,timezone:r.timezone||(0,$_e.getRuntimeTimezone)()});return this.mapOpenAPIScheduleToToolSchedule(n)}async updateToolSchedule(e,r,n){let i=await this.restRequest("PUT",`/v1/tools/${encodeURIComponent(e)}/schedules/${encodeURIComponent(r)}`,n);return this.mapOpenAPIScheduleToToolSchedule(i)}async deleteToolSchedule(e,r){return await this.restRequest("DELETE",`/v1/tools/${encodeURIComponent(e)}/schedules/${encodeURIComponent(r)}`),!0}async bulkSetSchedulesEnabled(e,r){return this.restRequest("POST","/v1/schedules/bulk/enable",{ids:e,enabled:r})}async bulkDeleteSchedules(e){return this.restRequest("POST","/v1/schedules/bulk/delete",{ids:e})}async listCredentials(e={}){let r=(0,Fo.createListQueryParams)(e);e.systemId!==void 0&&r.set("systemId",e.systemId);let n=r.size>0?`?${r.toString()}`:"";return this.restRequest("GET",`/v1/credentials${n}`)}async listAllCredentials(e={}){return(0,Fo.listAllPages)((r,n)=>this.listCredentials({...e,page:r,limit:n}))}async createCredentials(e){return(await this.restRequest("POST","/v1/credentials",e)).data}async replaceCredentials(e,r){return(await this.restRequest("PUT",`/v1/credentials/${encodeURIComponent(e)}`,{credentials:r})).data}async updateCredentials(e,r){return(await this.restRequest("PATCH",`/v1/credentials/${encodeURIComponent(e)}`,r)).data}async deleteCredentials(e){await this.restRequest("DELETE",`/v1/credentials/${encodeURIComponent(e)}`)}async setDefaultCredentials(e){await this.restRequest("POST",`/v1/credentials/${encodeURIComponent(e)}/default`)}async listSystems(e={}){let r=(0,Fo.createListQueryParams)(e),n=r.size>0?`?${r.toString()}`:"";return this.restRequest("GET",`/v1/systems${n}`)}async listAllSystems(e={}){return(0,Fo.listAllPages)((r,n)=>this.listSystems({...e,page:r,limit:n}))}async getSystem(e){return(await this.restRequest("GET",`/v1/systems/${encodeURIComponent(e)}`)).data}async createSystem(e){return(await this.restRequest("POST","/v1/systems",e)).data}async updateSystem(e,r){return(await this.restRequest("PATCH",`/v1/systems/${encodeURIComponent(e)}`,r)).data}async deleteSystem(e){return await this.restRequest("DELETE",`/v1/systems/${encodeURIComponent(e)}`),!0}async bulkDeleteSystems(e){return this.restRequest("POST","/v1/systems/bulk/delete",{ids:e})}async createOAuthExchange(e){return(await this.restRequest("POST","/v1/oauth/exchanges",e)).data}async completeOAuthExchange(e,r){return(await this.restRequest("POST",`/v1/oauth/exchanges/${encodeURIComponent(e)}/complete`,r)).data}async searchSystemDocumentation(e,r){return(await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/search`,{keywords:r})).data}async triggerSystemDocumentationScrapeJob(e,r){return(await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/scrape`,r)).data}async fetchOpenApiSpec(e,r,n){return(await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/openapi`,{url:r,link:n?.link})).data}async uploadSystemDocumentationFiles(e,r,n){let i=await this.uploadFiles(r,{process:!0}),o=i.flatMap(s=>s.status==="uploaded"?[s.id]:[]);if(o.length>0)try{await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/files`,{fileIds:o,link:n?.link!==!1})}catch(s){throw await Promise.all(o.map(a=>this.deleteFileUpload(a).catch(()=>{}))),s}if(!n?.settle){let s=i.filter(a=>a.status==="failed");if(s.length>0)throw new Error(s.map(a=>a.error).join("; "))}return i}async listSystemDocumentationFiles(e,r){let n=new URLSearchParams;r?.length&&n.set("fileIds",r.join(","));let i=n.size>0?`?${n.toString()}`:"";return(await this.restRequest("GET",`/v1/systems/${encodeURIComponent(e)}/documentation/files${i}`)).data}async getSystemDocumentationFileContent(e,r,n){return(await this.restRequest("GET",`/v1/systems/${encodeURIComponent(e)}/documentation/files/${encodeURIComponent(r)}/content?processed=${n.processed}`)).data}async deleteSystemDocumentationFile(e,r){await this.restRequest("DELETE",`/v1/systems/${encodeURIComponent(e)}/documentation/files/${encodeURIComponent(r)}`)}async generateCredentialsLink(e){try{return{success:!0,credentialsUrl:(await this.restRequest("POST","/v1/authenticate",e||{})).data.credentialsUrl}}catch(r){return{success:!1,error:r.message}}}};Uu.SuperglueClient=xw});var jH=h(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.UnquotedKeyStrategy=nt.TripleQuoteStrategy=nt.TrailingCommaStrategy=nt.SingleQuoteStrategy=nt.PythonLiteralStrategy=nt.CommentStrategy=nt.ResilientJsonParser=nt.RepairStrategy=void 0;nt.parseJsonResilient=j_e;nt.parseJSON=q_e;nt.isValidJson=H_e;nt.prettyPrintJson=G_e;nt.minifyJson=V_e;var Un=class{validate(e){try{return JSON.parse(e),!0}catch{return!1}}};nt.RepairStrategy=Un;var qm=class extends Un{constructor(){super(...arguments),this.name="TripleQuoteRepair",this.description="Converts triple-quoted strings to proper JSON, parsing nested JSON content"}canApply(e){return/"""/.test(e)}apply(e){return e.replace(/"""([\s\S]*?)"""/g,(r,n)=>{let i=n.trim();if(i.startsWith("{")&&i.endsWith("}")||i.startsWith("[")&&i.endsWith("]"))try{let s=JSON.parse(i);return JSON.stringify(s)}catch{return`"${n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`}return`"${n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`})}};nt.TripleQuoteStrategy=qm;var Hm=class extends Un{constructor(){super(...arguments),this.name="PythonLiteralRepair",this.description="Converts Python literals to JavaScript equivalents"}canApply(e){return/\b(None|True|False)\b/.test(e)}apply(e){return e.replace(/\bNone\b/g,"null").replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false")}};nt.PythonLiteralStrategy=Hm;var Gm=class extends Un{constructor(){super(...arguments),this.name="TrailingCommaRepair",this.description="Removes trailing commas from objects and arrays"}canApply(e){return/,\s*[}\]]/.test(e)}apply(e){return e.replace(/,(\s*[}\]])/g,"$1")}};nt.TrailingCommaStrategy=Gm;var Vm=class extends Un{constructor(){super(...arguments),this.name="SingleQuoteRepair",this.description="Converts single quotes to double quotes"}canApply(e){return/[{,]\s*'[^']*'\s*:/.test(e)||/:\s*'[^']*'/.test(e)}apply(e){let r=e.replace(/([{,]\s*)'([^']+)'(\s*:)/g,'$1"$2"$3');return r=r.replace(/(:\s*)'([^']+)'(\s*[,}])/g,'$1"$2"$3'),r}};nt.SingleQuoteStrategy=Vm;var zm=class extends Un{constructor(){super(...arguments),this.name="UnquotedKeyRepair",this.description="Adds quotes to unquoted object keys"}canApply(e){return/[{,]\s*[a-zA-Z_$][a-zA-Z0-9_$]*\s*:/.test(e)}apply(e){return e.replace(/([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)(\s*:)/g,'$1"$2"$3')}};nt.UnquotedKeyStrategy=zm;var Ym=class extends Un{constructor(){super(...arguments),this.name="CommentRemoval",this.description="Removes JavaScript-style comments"}canApply(e){return/\/\/.*$|\/\*[\s\S]*?\*\//m.test(e)}apply(e){let r=e.replace(/\/\/.*$/gm,"");return r=r.replace(/\/\*[\s\S]*?\*\//g,""),r}};nt.CommentStrategy=Ym;var Lw=class extends Un{constructor(){super(...arguments),this.name="UnescapedControlCharactersRepair",this.description="Escapes unescaped control characters (newlines, tabs, etc.) in JSON strings"}canApply(e){try{return JSON.parse(e),!1}catch(r){let n=r.message||"";return n.includes("control character")||n.includes("Bad control")||n.includes("Unexpected token")&&/[\n\r\t]/.test(e)}}apply(e){let r="",n=!1,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=o>0?e[o-1]:"";if(i){r+=s,i=!1;continue}if(s==="\\"&&n){r+=s,i=!0;continue}if(s==='"'&&a!=="\\"){n=!n,r+=s;continue}if(n)switch(s){case`
|
|
1716
1716
|
`:r+="\\n";break;case"\r":r+="\\r";break;case" ":r+="\\t";break;case"\b":r+="\\b";break;case"\f":r+="\\f";break;default:let c=s.charCodeAt(0);c<32?r+="\\u"+("0000"+c.toString(16)).slice(-4):r+=s}else r+=s}return r}},Pw=class extends Un{constructor(){super(...arguments),this.name="TrailingCharactersRepair",this.description="Removes trailing characters after valid JSON structure"}canApply(e){let r=e.trim();if(!r.startsWith("{")&&!r.startsWith("["))return!1;let n=0,i=0,o=!1,s=!1;for(let a=0;a<r.length;a++){let c=r[a];if(o)s?s=!1:c==="\\"?s=!0:c==='"'&&(o=!1);else if(c==='"')o=!0;else if(c==="{")n++;else if(c==="}"){if(n--,n===0&&i===0&&a>0&&a<r.length-1)return!0}else if(c==="[")i++;else if(c==="]"&&(i--,i===0&&n===0&&a>0&&a<r.length-1))return!0}return!1}apply(e){let r=e.trim(),n=0,i=0,o=!1,s=!1,a=-1;for(let c=0;c<r.length;c++){let u=r[c];if(o)s?s=!1:u==="\\"?s=!0:u==='"'&&(o=!1);else if(u==='"')o=!0;else if(u==="{")n++;else if(u==="}"){if(n--,n===0&&i===0&&c>0){a=c;break}}else if(u==="[")i++;else if(u==="]"&&(i--,i===0&&n===0&&c>0)){a=c;break}}return a>0&&a<r.length-1?r.substring(0,a+1):e}},Mu=class{constructor(e={}){this.strategies=[],this.repairLog=[],this.options={attemptRepair:!0,maxDepth:10,preserveStringsOnFailure:!1,logRepairs:!1,...e},this.initializeDefaultStrategies(),e.customStrategies&&this.strategies.push(...e.customStrategies)}initializeDefaultStrategies(){this.strategies=[new qm,new Vm,new Lw,new Pw,new Hm,new Gm,new zm,new Ym]}parse(e){let r=Date.now();this.repairLog=[];let n=e instanceof Buffer?e.toString("utf8"):String(e);try{return{success:!0,data:JSON.parse(n),metadata:{parseTime:Date.now()-r,strategiesApplied:[]}}}catch(s){if(!this.options.attemptRepair)return{success:!1,error:`JSON parse error: ${s}`,metadata:{parseTime:Date.now()-r}}}let i=n,o=[];for(let s of this.strategies)if(s.canApply(i)){let a=i;if(i=s.apply(i),a!==i){o.push(s.name),this.repairLog.push(s.description),this.options.logRepairs&&console.log(`Applied ${s.name}: ${s.description}`);try{return{success:!0,data:JSON.parse(i),repairs:this.repairLog,metadata:{parseTime:Date.now()-r,strategiesApplied:o}}}catch{}}}try{return{success:!0,data:JSON.parse(i),repairs:this.repairLog,metadata:{parseTime:Date.now()-r,strategiesApplied:o}}}catch(s){let a=this.aggressiveFallback(i);return a.success?{...a,repairs:[...this.repairLog,"Applied aggressive fallback"],metadata:{parseTime:Date.now()-r,strategiesApplied:[...o,"AggressiveFallback"]}}:{success:!1,error:`Failed to parse JSON after applying ${o.length} strategies: ${s}`,repairs:this.repairLog,metadata:{parseTime:Date.now()-r,strategiesApplied:o}}}}aggressiveFallback(e){try{let r=e.indexOf("{"),n=e.indexOf("[");if(r===-1&&n===-1)return{success:!1,error:"No JSON-like structure found"};let i=r===-1?n:n===-1?r:Math.min(r,n),o=e.substring(i);for(let a of this.strategies)a.canApply(o)&&(o=a.apply(o));return{success:!0,data:JSON.parse(o)}}catch(r){return{success:!1,error:`Aggressive fallback failed: ${r}`}}}addStrategy(e){this.strategies.push(e)}removeStrategy(e){this.strategies=this.strategies.filter(r=>r.name!==e)}getStrategies(){return this.strategies.map(e=>e.name)}};nt.ResilientJsonParser=Mu;var $H=new Mu;function j_e(t,e){return(e?new Mu(e):$H).parse(t)}function q_e(t){let e=$H.parse(t);if(e.success)return e.repairs&&e.repairs.length>0&&console.log("JSON parsed with repairs:",e.repairs),e.data;throw new Error(`Failed to parse JSON: ${e.error}`)}function H_e(t){try{return JSON.parse(t),!0}catch{return!1}}function G_e(t,e=2){return JSON.stringify(t,null,e)}function V_e(t){let r=new Mu().parse(t);if(r.success)return JSON.stringify(r.data);throw new Error("Cannot minify invalid JSON")}});var Fr=h(te=>{"use strict";var z_e=te&&te.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ge=te&&te.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&z_e(e,t,r)};Object.defineProperty(te,"__esModule",{value:!0});te.SSELogSubscriptionManager=te.SuperglueHttpError=te.SuperglueClient=void 0;ge(NR(),te);ge(qR(),te);ge(aU(),te);ge(dU(),te);ge(fU(),te);ge(iA(),te);ge(NU(),te);ge(OU(),te);ge(UU(),te);ge(MU(),te);ge(SC(),te);ge(LU(),te);ge(PU(),te);ge(FU(),te);ge(wC(),te);ge(jU(),te);ge(HU(),te);ge(GU(),te);ge(zU(),te);ge(Fd(),te);ge(JU(),te);ge(WU(),te);ge(KU(),te);ge(tM(),te);ge(rM(),te);ge(cM(),te);ge(lM(),te);ge(dM(),te);ge(fM(),te);ge(BM(),te);ge(wM(),te);ge($C(),te);ge(LM(),te);ge(YC(),te);ge(jM(),te);ge(VM(),te);ge(YM(),te);ge(qr(),te);ge(jn(),te);ge(JM(),te);ge(WM(),te);ge(Dg(),te);ge(Sc(),te);ge(jf(),te);var qH=FH();Object.defineProperty(te,"SuperglueClient",{enumerable:!0,get:function(){return qH.SuperglueClient}});Object.defineProperty(te,"SuperglueHttpError",{enumerable:!0,get:function(){return qH.SuperglueHttpError}});var Y_e=ZC();Object.defineProperty(te,"SSELogSubscriptionManager",{enumerable:!0,get:function(){return Y_e.SSELogSubscriptionManager}});ge(jH(),te)});var Dy=require("commander");var mr=pe(require("fs")),VH=pe(require("os")),jo=pe(require("path")),Sd=pe(Fr()),HH=new Set(["runner","builder","admin"]),GH={output:{mode:"stdout",directory:".superglue/output"},preset:"admin"};function qo(t){let e=jo.join(process.cwd(),".superglue"),r=VH.homedir();if(!r)return e;let n=jo.join(r,".superglue");return t===!0?e:t===!1?n:mr.existsSync(jo.join(e,"config.json"))?e:n}function Fw(t){return jo.join(qo(t),"config.json")}function Jm(t){let e=Fw(t);if(!mr.existsSync(e))return{};try{return JSON.parse(mr.readFileSync(e,"utf-8"))}catch{return{}}}function xu(t){let e=Jm(),r=t.apiKey||(0,Sd.readProcessEnvironmentValue)("SUPERGLUE_API_KEY")||e.apiKey||"",n=t.endpoint||(0,Sd.readProcessEnvironmentValue)("SUPERGLUE_API_ENDPOINT")||e.endpoint||"https://api.superglue.cloud",i=(0,Sd.readProcessEnvironmentValue)("SUPERGLUE_WEB_ENDPOINT")||e.webEndpoint||n.replace(/:3002\b/,":3001").replace(/api\.superglue/,"app.superglue"),o=(0,Sd.readProcessEnvironmentValue)("SUPERGLUE_CLI_PRESET"),s=o&&HH.has(o)?o:e.preset&&HH.has(e.preset)?e.preset:"admin";return{...GH,...e,apiKey:r,endpoint:n,webEndpoint:i,preset:s,output:{...GH.output,...e.output}}}function Wm(t,e){let r=qo(e);mr.existsSync(r)||mr.mkdirSync(r,{recursive:!0}),mr.writeFileSync(jo.join(r,"config.json"),JSON.stringify(t,null,2)+`
|
|
1717
|
-
`,{mode:384})}function Zm(t,e){let r=jo.join(qo(e),"drafts");if(mr.existsSync(r)||mr.mkdirSync(r,{recursive:!0}),t.output.mode==="stdout+file"){let n=jo.resolve(t.output.directory);mr.existsSync(n)||mr.mkdirSync(n,{recursive:!0})}}var zw=pe(Fr());var $w=pe(require("readline"));var JH=require("child_process"),WH=require("util");var zH={name:"@superglue/cli",version:"1.1.
|
|
1717
|
+
`,{mode:384})}function Zm(t,e){let r=jo.join(qo(e),"drafts");if(mr.existsSync(r)||mr.mkdirSync(r,{recursive:!0}),t.output.mode==="stdout+file"){let n=jo.resolve(t.output.directory);mr.existsSync(n)||mr.mkdirSync(n,{recursive:!0})}}var zw=pe(Fr());var $w=pe(require("readline"));var JH=require("child_process"),WH=require("util");var zH={name:"@superglue/cli",version:"1.1.125",bin:{sg:"./dist/cli.js"},files:[".claude-plugin/","dist/","skills/","LICENSE"],dependencies:{commander:"15.0.0-0","fast-json-patch":"3.1.1"},devDependencies:{"@superglue/shared":"file:../shared","@types/node":"25.5.0",tsup:"8.5.1",typescript:"5.8.3"},scripts:{build:"tsup && (cp -r skills dist/ 2>/dev/null || true)",dev:"tsup --watch","type-check":"tsc --noEmit",prepublishOnly:"npm run build"},publishConfig:{access:"public"}};var W_e=(0,WH.promisify)(JH.exec),nr=zH.version;function YH(t){let e=t.match(/^(\d+)(?:-(.+))?$/);return e?{numeric:parseInt(e[1],10),prerelease:e[2]||null}:{numeric:0,prerelease:t}}function Xm(t,e){let r=t.split("."),n=e.split("."),i=Math.max(r.length,n.length);for(let o=0;o<i;o++){let s=YH(r[o]||"0"),a=YH(n[o]||"0");if(s.numeric<a.numeric)return-1;if(s.numeric>a.numeric||s.prerelease===null&&a.prerelease!==null)return 1;if(s.prerelease!==null&&a.prerelease===null)return-1;if(s.prerelease!==null&&a.prerelease!==null){if(s.prerelease<a.prerelease)return-1;if(s.prerelease>a.prerelease)return 1}}return 0}async function ey(){try{let t=await fetch("https://registry.npmjs.org/@superglue/cli/latest",{signal:AbortSignal.timeout(5e3)});return t.ok&&(await t.json()).version||null}catch{return null}}var Km=null;function ZH(){ue()&&(Km=ey())}async function KH(){if(!(!ue()||!Km)){try{let t=new Promise(r=>{setTimeout(()=>r(null),2e3).unref()}),e=await Promise.race([Km,t]);e&&Xm(nr,e)<0&&(console.error(""),console.error(`${m.cyan}${m.bold} Update available: ${nr} \u2192 ${e}${m.reset}`),console.error(`${m.cyan} Run ${m.bold}sg update${m.reset}${m.cyan} to upgrade${m.reset}`),console.error(""))}catch{}Km=null}}async function XH(){let t=await ey();if(!t)return{success:!1,message:"Could not fetch latest version from npm"};if(Xm(nr,t)>=0)return{success:!0,message:`Already on latest version (${nr})`};try{return await W_e("npm install -g @superglue/cli@latest"),{success:!0,message:`Updated from ${nr} to ${t}`}}catch(e){return{success:!1,message:`Update failed: ${e.message}. Try manually: npm install -g @superglue/cli@latest`}}}var ue=()=>process.argv.includes("--table")&&process.stdout.isTTY,mn=()=>process.argv.includes("--full"),m={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m"};function eG(t,e){let r=e||t;return`\x1B]8;;${t}\x07${m.underline}${m.cyan}${r}${m.reset}\x1B]8;;\x07`}function tG(){if(!ue())return;let t=m.reset,e=m.dim,r="\x1B[47;30m",n=[" #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- "," =@@@- @@@@ "," @@@ @@% "," -@@ @@@@= @@@ @@@ @@@@@#@ @@@@@@@ @@@@@@@ @@@@@@ @@@ @@@ @@@ @@@@@@* %@@ "," @@ @@@ *@ @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @% @@@ @@@ @@@ @@* @@# "," #@@ @@@# @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @@@ @@@ @@@ @@* @@ "," @@- @@@@= @@@ @@@ @@@@@@@ @@@@@@ @@@@@@@ @@@ @@% @@@ @@@ @@@ @@@@@. @@."," #@% .@@@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* @@ "," @@ @ @@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* *@@ "," -@@ @@@@= @@@@@@ @@@ @@@@@@@ @@@ -@@ @@@@@@ @@@@@@% @@@@@@. @@@@@@* #@@ "," :@@* @@@ "," %@@@ =@@@. "," :@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@% "];console.log(""),n.forEach(i=>{let o=i.search(/\S/),s=i.length-[...i].reverse().join("").search(/\S/)-1;if(o===-1)return console.log(" "+i);let a=i.slice(0,o),c=i.slice(o,s+1).split("").map(l=>l===" "?" ":"\u2588").join(""),u=i.slice(s+1);console.log(` ${a}${r}${c}${t}${u}`)}),console.log(` ${e} CLI v${nr}${t}`),console.log("")}function et(t){if(!ue())return{stop:()=>{},update:()=>{},log:()=>{}};let e=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],r=0,n=t,i=()=>process.stdout.write("\r\x1B[2K"),o=()=>{process.stdout.write(`\r ${m.cyan}${e[r++%e.length]}${m.reset} ${n}`)},s=setInterval(o,80);return{update:a=>{n=a},log:a=>{i(),console.log(` ${m.dim}\u2502${m.reset} ${a}`),o()},stop:a=>{clearInterval(s),i(),a&&console.log(` ${a}`)}}}function re(t){ue()?ty(t):console.log(JSON.stringify(t,null,2))}function Qe(t,e){ue()?(console.log(` ${m.green}\u2713${m.reset} ${t}`),e&&ty(e,4)):console.log(JSON.stringify({success:!0,message:t,...e&&typeof e=="object"?e:{data:e}}))}function v(t,e){ue()?(console.error(` ${m.red}\u2717${m.reset} ${t}`),e&&ty(e,4)):console.error(JSON.stringify({success:!1,error:t,details:e}))}function rG(t){ue()&&console.log(` ${m.yellow}\u26A0${m.reset} ${t}`)}function zt(t){ue()&&console.log(` ${m.dim}${t}${m.reset}`)}function Ho(t){ue()&&(console.log(`
|
|
1718
1718
|
${m.bold}${m.cyan}${t}${m.reset}`),console.log(` ${m.dim}${"\u2500".repeat(t.length)}${m.reset}`))}function io(t,e,r){if(!ue()){console.log(JSON.stringify({success:!0,total:r?.total??t.length,items:t}));return}if(t.length===0){console.log(`
|
|
1719
1719
|
${m.dim}0 results${m.reset}
|
|
1720
1720
|
`);return}let n=e||Object.keys(t[0]),i=mn()?1/0:60,o=n.map(l=>Math.min(i,Math.max(l.length,...t.map(A=>String(A[l]??"").replace(/[\n\r]+/g," ").trim().length))));console.log("");let s=n.map((l,A)=>`${m.bold}${m.cyan}${l.toUpperCase().padEnd(o[A])}${m.reset}`).join(" ");console.log(` ${s}`);let a=o.map(l=>`${m.dim}${"\u2500".repeat(l)}${m.reset}`).join(`${m.dim}\u2500\u2500${m.reset}`);console.log(` ${a}`);for(let l of t){let A=n.map((d,f)=>{let g=String(l[d]??"").replace(/[\n\r]+/g," ").trim();if(g.length>i){let b=`\u2026 (${g.length})`;g=g.slice(0,Math.max(0,i-b.length))+`${m.dim}${b}${m.reset}`}return d==="status"?`${{success:m.green,running:m.yellow,failed:m.red,aborted:m.red,error:m.red,pending:m.dim}[g.toLowerCase()]||""}${g.padEnd(o[f])}${m.reset}`:g.padEnd(o[f])}).join(" ");console.log(` ${A}`)}let c=r?.total??t.length,u=c===t.length?`${t.length} result${t.length===1?"":"s"}`:`${t.length} of ${c} result${c===1?"":"s"}`;console.log(`
|