@superglue/cli 1.1.105 → 1.1.107

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.
@@ -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.105",
4
+ "version": "1.1.107",
5
5
  "author": {
6
6
  "name": "superglue",
7
7
  "email": "hello@superglue.cloud"
package/dist/cli.js CHANGED
@@ -601,7 +601,7 @@ ${e.map(t=>`- ${t.path}: ${t.message}`).join(`
601
601
  `).map(a=>`${e}${a}`)].join(`
602
602
  `)}function dn(o,e){return o.includes(`
603
603
  `)?mde(o,e):JSON.stringify(o)}function lde(o){let e=["---"];if(e.push(`name: ${dn(o.id," ")}`),e.push(`title: ${dn(o.name," ")}`),e.push(`when_to_run: ${dn(o.whenToRun," ")}`),o.systemRefs.length>0){e.push("systems:");for(let a of o.systemRefs)e.push(` - id: ${dn(a.id," ")}`)}if(o.toolRefs.length>0){e.push("tools:");for(let a of o.toolRefs)e.push(` - id: ${dn(a.id," ")}`)}if(o.credentialRefs.length>0){e.push("credentials:");for(let a of o.credentialRefs)e.push(` - id: ${dn(a.id," ")}`)}if(o.fileRefs.length>0){e.push("files:");for(let a of o.fileRefs)e.push(` - ${dn(a.name," ")}`);e.push(`# read attachments at /org/playbooks/${o.id}/files/<name>.json (.raw for original bytes)`)}e.push(`completion_criteria: ${dn(o.completionCriteria," ")}`),e.push("---"),e.push(""),o.inputs.trim()&&(e.push("## Required inputs"),e.push(""),e.push(o.inputs.trim()),e.push("")),e.push("## Instructions"),e.push(""),e.push(o.instructions.trim()),e.push("");let t=e.join(`
604
- `);if(t.length>y3.PLAYBOOK_LIMITS.compiledRender)throw new Error(`Compiled playbook render for '${o.id}' exceeds ${y3.PLAYBOOK_LIMITS.compiledRender} chars (${t.length})`);return t}});var A3=f(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.PROJECT_LIMITS=xr.PROJECT_TASK_STATUSES=xr.PROJECT_RESOURCE_TYPES=void 0;xr.projectResourceKey=ude;xr.PROJECT_RESOURCE_TYPES=["system","playbook","artifact","file","tool"];xr.PROJECT_TASK_STATUSES=["not_started","in_progress","waiting","done"];xr.PROJECT_LIMITS={name:80,description:500,taskName:120,taskDescription:5e3,taskResources:100};function ude(o){return`${o.type}:${o.id}`}});var Fv=f(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.RESOURCE_KINDS=ja.RESOURCE_DEFINITIONS=void 0;ja.isResourceKind=dde;ja.getResourceDefinition=gde;ja.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"}};ja.RESOURCE_KINDS=Object.keys(ja.RESOURCE_DEFINITIONS);function dde(o){return typeof o=="string"&&Object.prototype.hasOwnProperty.call(ja.RESOURCE_DEFINITIONS,o)}function gde(o){return ja.RESOURCE_DEFINITIONS[o]}});var B3=f(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.RESERVED_ROLE_NAMES=ae.RESERVED_ROLE_IDS=ae.PREDEFINED_ROLE_IDS=void 0;ae.toResourceRef=su;ae.toWildcardResourceRef=cu;ae.getDefaultMemberResourceGrants=pde;ae.parseResourceRef=Qh;ae.getWildcardResourceRef=v3;ae.normalizeResourcePermissions=gn;ae.permissionSatisfies=_h;ae.highestResourcePermission=Dh;ae.grantHasPermission=Gv;ae.grantMatchesResource=Pc;ae.getEffectiveResourcePermissions=Vv;ae.hasResourcePermission=hde;ae.getRoleResourceGrants=Th;ae.getAllowedResourceIds=w3;ae.getAllowedResourceIdsForRoles=Rh;ae.getEffectiveResourcePermissionsForRoles=Fc;ae.getAllowedToolIds=x3;ae.getAllowedSystemIds=z3;ae.pickLongestHeldResource=bde;ae.getAllowedCredentialsIds=yde;ae.getEffectiveCredentialsPermissions=kde;ae.getEffectiveToolPermissions=Ade;ae.getEffectiveSystemPermissions=vde;ae.checkResourcePermission=Nh;ae.isToolAllowed=wde;ae.isSystemVisible=xde;ae.isPlaybookVisible=zde;ae.hasAllSystems=qde;ae.hasAllTools=Ede;ae.getResourceGrantSources=q3;ae.getSharePermissionForResource=E3;ae.getAccessRulePermissionForResource=I3;ae.hasAdminBaseRole=Yv;ae.resolveResourceAccessForRoles=Ide;ae.normalizeResourceGrantInput=j3;ae.normalizeRoleResourceGrantInput=jde;ae.isPredefinedRole=Cde;ae.isReservedRoleId=Sde;ae.isReservedRoleName=Bde;ae.hasRole=Qde;ae.getRoleIds=_de;ae.getBaseRole=C3;ae.getBaseRoleId=Dde;ae.getPersonalRole=S3;ae.getPersonalRoleId=Tde;var Sh=Fv(),Bh="*";function su(o,e){if(!e||e===Bh)throw new Error("Resource id is required");return`${o}:${encodeURIComponent(e)}`}function cu(o){return`${o}:${Bh}`}function pde(){return Sh.RESOURCE_KINDS.flatMap(o=>{let e=(0,Sh.getResourceDefinition)(o).memberDefaultPermission;return e?[{resourceRef:cu(o),permissions:[e]}]:[]})}function Qh(o){let e=o.indexOf(":");if(e<=0)return null;let t=o.slice(0,e);if(!(0,Sh.isResourceKind)(t))return null;let a=o.slice(e+1);if(!a)return null;if(a===Bh)return{kind:t,id:Bh,isWildcard:!0};try{return{kind:t,id:decodeURIComponent(a),isWildcard:!1}}catch{return null}}function v3(o){let e=Qh(o);return e?cu(e.kind):null}function gn(o){let e=new Set;for(let t of o||[])(t==="viewer"||t==="editor")&&e.add(t);return e.has("editor")&&e.add("viewer"),Array.from(e)}function _h(o,e){return o===e||o==="editor"&&e==="viewer"}function Dh(o){let e=gn(o);if(e.includes("editor"))return"editor";if(e.includes("viewer"))return"viewer"}function Gv(o,e){return o.revokedAt?!1:gn(o.permissions).some(t=>_h(t,e))}function Pc(o,e){return o.revokedAt?!1:o.resourceRef===e||o.resourceRef===v3(e)}function Vv(o,e){let t=new Set;for(let a of o)if(Pc(a,e))for(let i of gn(a.permissions))t.add(i);return Array.from(t)}function hde(o,e,t){return Vv(o,e).some(a=>_h(a,t))}function Th(o){return o.flatMap(e=>e.isBaseRole&&e.id==="admin"?[]:e.resourceGrants||[])}function w3(o,e,t){let a=cu(e),i=new Set;for(let r of o){if(!Gv(r,t))continue;if(r.resourceRef===a)return;let n=Qh(r.resourceRef);n?.kind===e&&!n.isWildcard&&i.add(n.id)}return Array.from(i)}function Rh(o,e,t){if(!Yv(o))return w3(Th(o),e,t)}function Fc(o,e,t){return Yv(o)?["editor","viewer"]:Vv(Th(o),su(e,t))}function fde(o){return(0,Sh.getResourceDefinition)(o).label}function x3(o,e="viewer"){return Rh(o,"tool",e)}function z3(o,e="viewer"){return Rh(o,"system",e)}var Hv=Number.MAX_SAFE_INTEGER;function $v(o){if(!o)return Hv;let e=new Date(o).getTime();return Number.isNaN(e)?Hv:e}function bde(o,e,t){if(o.length<=1)return o[0];let a=i=>{let r=su(t,i.id),n=Hv;for(let s of e)Pc(s,r)&&(n=Math.min(n,$v(s.createdAt)));return n};return[...o].sort((i,r)=>{let n=a(i)-a(r);return n!==0?n:$v(i.createdAt)-$v(r.createdAt)})[0]}function yde(o,e="viewer"){return Rh(o,"credential",e)}function kde(o,e){return Fc(o,"credential",e)}function Ade(o,e){return Fc(o,"tool",e)}function vde(o,e){return Fc(o,"system",e)}function Nh(o,e,t,a){return Fc(o,e,t).some(r=>_h(r,a))?{allowed:!0}:{allowed:!1,error:`${fde(e)} '${t}' requires a '${a}' grant`}}function wde(o,e,t="viewer"){return Nh(o,"tool",e,t)}function xde(o,e,t="viewer"){return Nh(o,"system",e,t)}function zde(o,e,t="viewer"){return Nh(o,"playbook",e,t)}function qde(o,e="viewer"){return z3(o,e)===void 0}function Ede(o,e="viewer"){return x3(o,e)===void 0}function q3(o,e,t="viewer"){let a=new Set;for(let i of o)Pc(i,e)&&Gv(i,t)&&a.add(i.source);return Array.from(a)}function E3(o,e){let t=o.filter(a=>a.source==="share"&&Pc(a,e)).flatMap(a=>gn(a.permissions));return Dh(t)}function I3(o,e){let t=o.filter(a=>a.source==="access_rule"&&Pc(a,e)).flatMap(a=>gn(a.permissions));return Dh(t)}function Yv(o){return o.some(e=>e.isBaseRole&&e.id==="admin")}function Ide({roles:o,resource:e,userId:t}){let a=su(e.kind,e.id),i=Th(o),r=new Set(Fc(o,e.kind,e.id)),n=new Set(q3(i,a));e.ownerUserId&&e.ownerUserId===t&&(r.add("editor"),r.add("viewer"),n.add("ownership"));let s=gn(Array.from(r));return{permissions:s,sources:Array.from(n),sharePermission:E3(i,a),accessRulePermission:I3(i,a),maxPermission:Dh(s)}}function j3(o){let e=Qh(o.resourceRef);if(!e)throw new Error(`Invalid resource ref '${o.resourceRef}'`);return{...o,resourceRef:e.isWildcard?cu(e.kind):su(e.kind,e.id),permissions:gn(o.permissions||["viewer"]),source:o.source||"access_rule"}}function jde(o){let e=j3({resourceRef:o.resourceRef,permissions:o.permissions,source:"access_rule"});return{resourceRef:e.resourceRef,permissions:e.permissions,source:"access_rule"}}ae.PREDEFINED_ROLE_IDS=["admin","member"];ae.RESERVED_ROLE_IDS=["admin","member","__admin__"];ae.RESERVED_ROLE_NAMES=["member","admin"];function Cde(o){return ae.PREDEFINED_ROLE_IDS.includes(o)}function Sde(o){return ae.RESERVED_ROLE_IDS.includes(o)}function Bde(o){return ae.RESERVED_ROLE_NAMES.includes(o.toLowerCase().trim())}function Qde(o,e){return o.some(t=>t.id===e)}function _de(o){return o.map(e=>e.id)}function C3(o){let e=o.filter(t=>t.isBaseRole);return e.length===1?e[0]:null}function Dde(o){let e=C3(o);return e?e.id:null}function S3(o){return o.find(e=>e.isPersonalRole)||null}function Tde(o){let e=S3(o);return e?e.id:null}});var _3=f(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.NOTIFICATION_EXCLUDED_REQUEST_SOURCES=St.CLIENT_REQUEST_SOURCES=St.REQUEST_SOURCES=void 0;St.isRequestSource=Q3;St.isClientRequestSource=Ode;St.parseRequestSource=Ude;var et=Ht();St.REQUEST_SOURCES=[et.RequestSource.API,et.RequestSource.FRONTEND,et.RequestSource.AGENT,et.RequestSource.SCHEDULER,et.RequestSource.MCP,et.RequestSource.TOOL_CHAIN,et.RequestSource.WEBHOOK,et.RequestSource.CLI];St.CLIENT_REQUEST_SOURCES=[et.RequestSource.FRONTEND,et.RequestSource.AGENT,et.RequestSource.MCP,et.RequestSource.CLI];St.NOTIFICATION_EXCLUDED_REQUEST_SOURCES=[et.RequestSource.FRONTEND,et.RequestSource.AGENT,et.RequestSource.MCP];var Rde=new Set(St.REQUEST_SOURCES),Nde=new Set(St.CLIENT_REQUEST_SOURCES);function Q3(o){return Rde.has(o)}function Ode(o){return Nde.has(o)}function Ude(o){let e=o.toLowerCase();return Q3(e)?e:void 0}});var D3=f(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.contextSourceTemplates=void 0;var Mde={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."},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."},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."}};Oh.contextSourceTemplates=Mde});var Zv=f(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.systemOptions=Oe.systems=void 0;Oe.getSystemTemplateOAuthClientMode=Pde;Oe.getSystemTemplateAuthentication=O3;Oe.mergeSystemTemplateAuthentication=U3;Oe.resolveSystemAuthentication=Wv;Oe.getContextSourceTemplates=M3;Oe.resolveContextSourceSetup=Yde;Oe.findTemplateForSystem=Mh;Oe.uniqueKeywords=Jde;Oe.getOAuthConfig=Wde;Oe.getOAuthTokenExchangeConfig=Zde;Oe.getOAuthTokenUrl=Kde;var Jv=iu(),Lde=D3(),Uh=jh();function Pde(o){let e=o?.oauth;if(e)return e.registrationUrl?"dynamic":e.client_id?"managed":"custom"}function Fde(o){let e=o?.split(/[,\s]+/).filter(Boolean);return e?.length?e:void 0}function O3(o){if(!o?.preferredAuthType)return;if(o.preferredAuthType!=="oauth2")return{type:o.preferredAuthType};let e=o.oauth;if(!e)return{type:"oauth2"};let t={};e.tokenAuthMethod&&(t.tokenAuthMethod=e.tokenAuthMethod),e.tokenContentType&&(t.tokenContentType=e.tokenContentType),e.extraHeaders&&(t.extraHeaders=e.extraHeaders),e.extraBodyParams&&(t.extraBodyParams=e.extraBodyParams),e.usePKCE!==void 0&&(t.usePKCE=e.usePKCE),e.resource&&(t.resource=e.resource);let a=Fde(e.scopes);return{type:"oauth2",...e.registrationUrl?{oauthClientMode:"dynamic"}:{},...e.authUrl?{authUrl:e.authUrl}:{},...e.tokenUrl?{tokenUrl:e.tokenUrl}:{},...e.client_id?{clientId:e.client_id}:{},...e.grant_type?{grantType:e.grant_type}:{},...a?{scopes:a}:{},...Object.keys(t).length?{config:t}:{}}}function $de(o){return!o.config||Object.keys(o.config).length===0}function T3(o,e){let t={...o||{},...e||{}};return Object.keys(t).length>0?t:void 0}function R3(o,e){if(e)return{...o,config:e};let{config:t,...a}=o;return a}function U3({authentication:o,template:e}){let t=O3(e),a=(0,Jv.normalizeSystemAuthentication)(o);if(!a)return t;if(!t)return a;if(a.type==="none"&&$de(a))return t;if(a.type!==t.type)return a;if(a.type==="oauth2"&&t.type==="oauth2"){let i={...t};a.oauthClientMode==="custom"&&(delete i.clientId,delete i.clientSecret);let r={...i,...a};return(0,Jv.resolveOAuthClientMode)({authentication:a,templateClientId:t.clientId,templateRegistrationUrl:e.oauth?.registrationUrl})==="managed"&&t.clientId&&(r.clientId=t.clientId),R3(r,T3(t.config,a.config))}return R3({...t,...a},T3(t.config,a.config))}function Wv(o){let e=(0,Jv.normalizeSystemAuthentication)(o.authentication)||{type:"none"};return U3({authentication:e,template:Mh(o)?.template})||e}var Hde={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.
604
+ `);if(t.length>y3.PLAYBOOK_LIMITS.compiledRender)throw new Error(`Compiled playbook render for '${o.id}' exceeds ${y3.PLAYBOOK_LIMITS.compiledRender} chars (${t.length})`);return t}});var A3=f(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.PROJECT_LIMITS=xr.PROJECT_TASK_STATUSES=xr.PROJECT_RESOURCE_TYPES=void 0;xr.projectResourceKey=ude;xr.PROJECT_RESOURCE_TYPES=["system","playbook","artifact","file","tool"];xr.PROJECT_TASK_STATUSES=["not_started","in_progress","waiting","done"];xr.PROJECT_LIMITS={name:80,description:500,taskName:120,taskDescription:5e3,taskResources:100};function ude(o){return`${o.type}:${o.id}`}});var Fv=f(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.RESOURCE_KINDS=ja.RESOURCE_DEFINITIONS=void 0;ja.isResourceKind=dde;ja.getResourceDefinition=gde;ja.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"}};ja.RESOURCE_KINDS=Object.keys(ja.RESOURCE_DEFINITIONS);function dde(o){return typeof o=="string"&&Object.prototype.hasOwnProperty.call(ja.RESOURCE_DEFINITIONS,o)}function gde(o){return ja.RESOURCE_DEFINITIONS[o]}});var B3=f(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.RESERVED_ROLE_NAMES=ae.RESERVED_ROLE_IDS=ae.PREDEFINED_ROLE_IDS=void 0;ae.toResourceRef=su;ae.toWildcardResourceRef=cu;ae.getDefaultMemberResourceGrants=pde;ae.parseResourceRef=Qh;ae.getWildcardResourceRef=v3;ae.normalizeResourcePermissions=gn;ae.permissionSatisfies=_h;ae.highestResourcePermission=Dh;ae.grantHasPermission=Gv;ae.grantMatchesResource=Pc;ae.getEffectiveResourcePermissions=Vv;ae.hasResourcePermission=hde;ae.getRoleResourceGrants=Th;ae.getAllowedResourceIds=w3;ae.getAllowedResourceIdsForRoles=Rh;ae.getEffectiveResourcePermissionsForRoles=Fc;ae.getAllowedToolIds=x3;ae.getAllowedSystemIds=z3;ae.pickLongestHeldResource=bde;ae.getAllowedCredentialsIds=yde;ae.getEffectiveCredentialsPermissions=kde;ae.getEffectiveToolPermissions=Ade;ae.getEffectiveSystemPermissions=vde;ae.checkResourcePermission=Nh;ae.isToolAllowed=wde;ae.isSystemVisible=xde;ae.isPlaybookVisible=zde;ae.hasAllSystems=qde;ae.hasAllTools=Ede;ae.getResourceGrantSources=q3;ae.getSharePermissionForResource=E3;ae.getAccessRulePermissionForResource=I3;ae.hasAdminBaseRole=Yv;ae.resolveResourceAccessForRoles=Ide;ae.normalizeResourceGrantInput=j3;ae.normalizeRoleResourceGrantInput=jde;ae.isPredefinedRole=Cde;ae.isReservedRoleId=Sde;ae.isReservedRoleName=Bde;ae.hasRole=Qde;ae.getRoleIds=_de;ae.getBaseRole=C3;ae.getBaseRoleId=Dde;ae.getPersonalRole=S3;ae.getPersonalRoleId=Tde;var Sh=Fv(),Bh="*";function su(o,e){if(!e||e===Bh)throw new Error("Resource id is required");return`${o}:${encodeURIComponent(e)}`}function cu(o){return`${o}:${Bh}`}function pde(){return Sh.RESOURCE_KINDS.flatMap(o=>{let e=(0,Sh.getResourceDefinition)(o).memberDefaultPermission;return e?[{resourceRef:cu(o),permissions:[e]}]:[]})}function Qh(o){let e=o.indexOf(":");if(e<=0)return null;let t=o.slice(0,e);if(!(0,Sh.isResourceKind)(t))return null;let a=o.slice(e+1);if(!a)return null;if(a===Bh)return{kind:t,id:Bh,isWildcard:!0};try{return{kind:t,id:decodeURIComponent(a),isWildcard:!1}}catch{return null}}function v3(o){let e=Qh(o);return e?cu(e.kind):null}function gn(o){let e=new Set;for(let t of o||[])(t==="viewer"||t==="editor")&&e.add(t);return e.has("editor")&&e.add("viewer"),Array.from(e)}function _h(o,e){return o===e||o==="editor"&&e==="viewer"}function Dh(o){let e=gn(o);if(e.includes("editor"))return"editor";if(e.includes("viewer"))return"viewer"}function Gv(o,e){return o.revokedAt?!1:gn(o.permissions).some(t=>_h(t,e))}function Pc(o,e){return o.revokedAt?!1:o.resourceRef===e||o.resourceRef===v3(e)}function Vv(o,e){let t=new Set;for(let a of o)if(Pc(a,e))for(let i of gn(a.permissions))t.add(i);return Array.from(t)}function hde(o,e,t){return Vv(o,e).some(a=>_h(a,t))}function Th(o){return o.flatMap(e=>e.isBaseRole&&e.id==="admin"?[]:e.resourceGrants||[])}function w3(o,e,t){let a=cu(e),i=new Set;for(let r of o){if(!Gv(r,t))continue;if(r.resourceRef===a)return;let n=Qh(r.resourceRef);n?.kind===e&&!n.isWildcard&&i.add(n.id)}return Array.from(i)}function Rh(o,e,t){if(!Yv(o))return w3(Th(o),e,t)}function Fc(o,e,t){return Yv(o)?["editor","viewer"]:Vv(Th(o),su(e,t))}function fde(o){return(0,Sh.getResourceDefinition)(o).label}function x3(o,e="viewer"){return Rh(o,"tool",e)}function z3(o,e="viewer"){return Rh(o,"system",e)}var Hv=Number.MAX_SAFE_INTEGER;function $v(o){if(!o)return Hv;let e=new Date(o).getTime();return Number.isNaN(e)?Hv:e}function bde(o,e,t){if(o.length<=1)return o[0];let a=i=>{let r=su(t,i.id),n=Hv;for(let s of e)Pc(s,r)&&(n=Math.min(n,$v(s.createdAt)));return n};return[...o].sort((i,r)=>{let n=a(i)-a(r);return n!==0?n:$v(i.createdAt)-$v(r.createdAt)})[0]}function yde(o,e="viewer"){return Rh(o,"credential",e)}function kde(o,e){return Fc(o,"credential",e)}function Ade(o,e){return Fc(o,"tool",e)}function vde(o,e){return Fc(o,"system",e)}function Nh(o,e,t,a){return Fc(o,e,t).some(r=>_h(r,a))?{allowed:!0}:{allowed:!1,error:`${fde(e)} '${t}' requires a '${a}' grant`}}function wde(o,e,t="viewer"){return Nh(o,"tool",e,t)}function xde(o,e,t="viewer"){return Nh(o,"system",e,t)}function zde(o,e,t="viewer"){return Nh(o,"playbook",e,t)}function qde(o,e="viewer"){return z3(o,e)===void 0}function Ede(o,e="viewer"){return x3(o,e)===void 0}function q3(o,e,t="viewer"){let a=new Set;for(let i of o)Pc(i,e)&&Gv(i,t)&&a.add(i.source);return Array.from(a)}function E3(o,e){let t=o.filter(a=>a.source==="share"&&Pc(a,e)).flatMap(a=>gn(a.permissions));return Dh(t)}function I3(o,e){let t=o.filter(a=>a.source==="access_rule"&&Pc(a,e)).flatMap(a=>gn(a.permissions));return Dh(t)}function Yv(o){return o.some(e=>e.isBaseRole&&e.id==="admin")}function Ide({roles:o,resource:e,userId:t}){let a=su(e.kind,e.id),i=Th(o),r=new Set(Fc(o,e.kind,e.id)),n=new Set(q3(i,a));e.ownerUserId&&e.ownerUserId===t&&(r.add("editor"),r.add("viewer"),n.add("ownership"));let s=gn(Array.from(r));return{permissions:s,sources:Array.from(n),sharePermission:E3(i,a),accessRulePermission:I3(i,a),maxPermission:Dh(s)}}function j3(o){let e=Qh(o.resourceRef);if(!e)throw new Error(`Invalid resource ref '${o.resourceRef}'`);return{...o,resourceRef:e.isWildcard?cu(e.kind):su(e.kind,e.id),permissions:gn(o.permissions||["viewer"]),source:o.source||"access_rule"}}function jde(o){let e=j3({resourceRef:o.resourceRef,permissions:o.permissions,source:"access_rule"});return{resourceRef:e.resourceRef,permissions:e.permissions,source:"access_rule"}}ae.PREDEFINED_ROLE_IDS=["admin","member"];ae.RESERVED_ROLE_IDS=["admin","member","__admin__"];ae.RESERVED_ROLE_NAMES=["member","admin"];function Cde(o){return ae.PREDEFINED_ROLE_IDS.includes(o)}function Sde(o){return ae.RESERVED_ROLE_IDS.includes(o)}function Bde(o){return ae.RESERVED_ROLE_NAMES.includes(o.toLowerCase().trim())}function Qde(o,e){return o.some(t=>t.id===e)}function _de(o){return o.map(e=>e.id)}function C3(o){let e=o.filter(t=>t.isBaseRole);return e.length===1?e[0]:null}function Dde(o){let e=C3(o);return e?e.id:null}function S3(o){return o.find(e=>e.isPersonalRole)||null}function Tde(o){let e=S3(o);return e?e.id:null}});var _3=f(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.NOTIFICATION_EXCLUDED_REQUEST_SOURCES=St.CLIENT_REQUEST_SOURCES=St.REQUEST_SOURCES=void 0;St.isRequestSource=Q3;St.isClientRequestSource=Ode;St.parseRequestSource=Ude;var et=Ht();St.REQUEST_SOURCES=[et.RequestSource.API,et.RequestSource.FRONTEND,et.RequestSource.AGENT,et.RequestSource.SCHEDULER,et.RequestSource.MCP,et.RequestSource.TOOL_CHAIN,et.RequestSource.WEBHOOK,et.RequestSource.CLI];St.CLIENT_REQUEST_SOURCES=[et.RequestSource.FRONTEND,et.RequestSource.AGENT,et.RequestSource.MCP,et.RequestSource.CLI];St.NOTIFICATION_EXCLUDED_REQUEST_SOURCES=[et.RequestSource.FRONTEND,et.RequestSource.AGENT,et.RequestSource.MCP];var Rde=new Set(St.REQUEST_SOURCES),Nde=new Set(St.CLIENT_REQUEST_SOURCES);function Q3(o){return Rde.has(o)}function Ode(o){return Nde.has(o)}function Ude(o){let e=o.toLowerCase();return Q3(e)?e:void 0}});var D3=f(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.contextSourceTemplates=void 0;var Mde={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."},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."},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."}};Oh.contextSourceTemplates=Mde});var Zv=f(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.systemOptions=Oe.systems=void 0;Oe.getSystemTemplateOAuthClientMode=Pde;Oe.getSystemTemplateAuthentication=O3;Oe.mergeSystemTemplateAuthentication=U3;Oe.resolveSystemAuthentication=Wv;Oe.getContextSourceTemplates=M3;Oe.resolveContextSourceSetup=Yde;Oe.findTemplateForSystem=Mh;Oe.uniqueKeywords=Jde;Oe.getOAuthConfig=Wde;Oe.getOAuthTokenExchangeConfig=Zde;Oe.getOAuthTokenUrl=Kde;var Jv=iu(),Lde=D3(),Uh=jh();function Pde(o){let e=o?.oauth;if(e)return e.registrationUrl?"dynamic":e.client_id?"managed":"custom"}function Fde(o){let e=o?.split(/[,\s]+/).filter(Boolean);return e?.length?e:void 0}function O3(o){if(!o?.preferredAuthType)return;if(o.preferredAuthType!=="oauth2")return{type:o.preferredAuthType};let e=o.oauth;if(!e)return{type:"oauth2"};let t={};e.tokenAuthMethod&&(t.tokenAuthMethod=e.tokenAuthMethod),e.tokenContentType&&(t.tokenContentType=e.tokenContentType),e.extraHeaders&&(t.extraHeaders=e.extraHeaders),e.extraBodyParams&&(t.extraBodyParams=e.extraBodyParams),e.usePKCE!==void 0&&(t.usePKCE=e.usePKCE),e.resource&&(t.resource=e.resource);let a=Fde(e.scopes);return{type:"oauth2",...e.registrationUrl?{oauthClientMode:"dynamic"}:{},...e.authUrl?{authUrl:e.authUrl}:{},...e.tokenUrl?{tokenUrl:e.tokenUrl}:{},...e.client_id?{clientId:e.client_id}:{},...e.grant_type?{grantType:e.grant_type}:{},...a?{scopes:a}:{},...Object.keys(t).length?{config:t}:{}}}function $de(o){return!o.config||Object.keys(o.config).length===0}function T3(o,e){let t={...o||{},...e||{}};return Object.keys(t).length>0?t:void 0}function R3(o,e){if(e)return{...o,config:e};let{config:t,...a}=o;return a}function U3({authentication:o,template:e}){let t=O3(e),a=(0,Jv.normalizeSystemAuthentication)(o);if(!a)return t;if(!t)return a;if(a.type==="none"&&$de(a))return t;if(a.type!==t.type)return a;if(a.type==="oauth2"&&t.type==="oauth2"){let i={...t};a.oauthClientMode==="custom"&&(delete i.clientId,delete i.clientSecret);let r={...i,...a};return(0,Jv.resolveOAuthClientMode)({authentication:a,templateClientId:t.clientId,templateRegistrationUrl:e.oauth?.registrationUrl})==="managed"&&t.clientId&&(r.clientId=t.clientId),R3(r,T3(t.config,a.config))}return R3({...t,...a},T3(t.config,a.config))}function Wv(o){let e=(0,Jv.normalizeSystemAuthentication)(o.authentication)||{type:"none"};return U3({authentication:e,template:Mh(o)?.template})||e}var Hde={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.
605
605
 
606
606
  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:
607
607
 
@@ -663,7 +663,7 @@ REQUIRED GCP PERMISSIONS:
663
663
  - BigQuery Data Editor (roles/bigquery.dataEditor) - write access
664
664
  - BigQuery Job User (roles/bigquery.jobUser) - run queries
665
665
 
666
- HEADERS: { "Authorization": "Bearer <<token>>", "Content-Type": "application/json" }`,keywords:["datasets","tables","queries","jobs","projects","schemas","rows","streaming","partitions","clustering","views","routines","models","data warehouse","sql","oauth"]},firebase:{name:"firebase",apiUrl:"https://firestore.googleapis.com",regex:"^.*(firebase|firestore).*$",icon:"firebase",docsUrl:"https://firebase.google.com/docs/reference/firebase-management/rest",openApiUrl:"https://firestore.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/firebase https://www.googleapis.com/auth/cloud-platform"},keywords:["firestore","realtime database","authentication","cloud functions","storage","hosting","documents","collections","users","projects","apps","query","oauth"]},salesforce:{name:"salesforce",apiUrl:"https://api.salesforce.com",regex:"^.*salesforce.*$",icon:"salesforce",docsUrl:"https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_rest.htm",preferredAuthType:"oauth2",oauth:{authUrl:"https://login.salesforce.com/services/oauth2/authorize",tokenUrl:"https://login.salesforce.com/services/oauth2/token",scopes:"full",grant_type:"authorization_code",client_id:"3MVG9rZjd7MXFdLj8gMo0sojKlWRAgOP9F7nsk3Tec.eesq86nNTvbzDJDcmCW9YRCbteTayd_dP4OCLtISIo"},keywords:["accounts","contacts","leads","opportunities","cases","campaigns","products","price books","quotes","contracts","orders","custom objects","soql","query","search","sobjects","oauth"]},facebook:{name:"facebook",apiUrl:"https://graph.facebook.com",regex:"^.*facebook.*$",icon:"facebook",docsUrl:"https://developers.facebook.com/docs/graph-api",preferredAuthType:"oauth2",oauth:{authUrl:"https://www.facebook.com/v18.0/dialog/oauth",tokenUrl:"https://graph.facebook.com/v18.0/oauth/access_token",scopes:"email public_profile pages_show_list pages_read_engagement pages_manage_metadata pages_read_user_content pages_manage_posts pages_manage_engagement business_management ads_management ads_read catalog_management leads_retrieval"},keywords:["pages","posts","comments","insights","ads","campaigns","audiences","business","catalog","events","groups","photos","videos","live videos","oauth"]},meta_ads:{name:"meta_ads",apiUrl:"https://graph.facebook.com",regex:"^.*(meta[_ .-]?ads|facebook[_ .-]?ads|marketing[_ .-]?api|/act_).*$",icon:"meta",docsUrl:"https://developers.facebook.com/docs/marketing-api/",preferredAuthType:"oauth2",oauth:{authUrl:"https://www.facebook.com/v23.0/dialog/oauth",tokenUrl:"https://graph.facebook.com/v23.0/oauth/access_token",scopes:"ads_read ads_management business_management"},keywords:["meta ads","facebook ads","marketing api","ad accounts","campaigns","adsets","ads","adcreatives","insights","custom audiences","pixels","leadgen forms","product catalogs","spend","reach","oauth"],systemSpecificInstructions:"Ad account IDs are prefixed with act_ in all request paths (e.g. /v23.0/act_<ACCOUNT_ID>/insights, /act_<ACCOUNT_ID>/campaigns) \u2014 the numeric ID alone fails. With Standard Access, ads_read/ads_management only work for users who hold a role on the Meta app (suitable for development); serving arbitrary users requires Advanced Access, which needs business verification and App Review. For unattended server-to-server use, Business Manager system user tokens are the standard approach instead of user OAuth tokens. Graph API versions sunset roughly two years after release \u2014 prefer the latest version in paths rather than copying versions from older examples."},instagram:{name:"instagram",apiUrl:"https://graph.facebook.com/v23.0/",regex:"^.*instagram.*$",icon:"instagram",docsUrl:"https://developers.facebook.com/docs/instagram-platform/",preferredAuthType:"oauth2",oauth:{authUrl:"https://www.facebook.com/v23.0/dialog/oauth",tokenUrl:"https://graph.facebook.com/v23.0/oauth/access_token",scopes:"instagram_basic pages_show_list instagram_content_publish pages_read_engagement instagram_manage_comments instagram_manage_insights instagram_manage_messages business_management"},keywords:["instagram","instagram api","instagram graph api","media","posts","stories","comments","insights","hashtags","mentions","business discovery","content publishing","user media","account info","oauth"],systemSpecificInstructions:"There are two distinct Instagram APIs: this template targets the Instagram API with Facebook Login (host graph.facebook.com), which requires an Instagram professional (Business/Creator) account linked to a Facebook Page; hashtag search and business discovery are only available on this variant. The alternative Instagram API with Instagram Login uses host graph.instagram.com, needs no Facebook Page, and uses different tokens/scopes. The legacy Instagram Basic Display API was shut down in December 2024 and cannot be used."},twitter:{name:"twitter",apiUrl:"https://api.twitter.com",regex:"^https?:\\/\\/(?:[^/]+\\.)*(?:twitter\\.com|x\\.com)(?:[:/?#].*)?$",icon:"x",docsUrl:"https://docs.x.com/x-api/introduction",openApiUrl:"https://api.x.com/2/openapi.json",preferredAuthType:"oauth2",oauth:{authUrl:"https://twitter.com/i/oauth2/authorize",tokenUrl:"https://api.twitter.com/2/oauth2/token",scopes:"tweet.read tweet.write users.read follows.read follows.write offline.access like.read like.write list.read list.write block.read block.write bookmark.read bookmark.write mute.read mute.write"},keywords:["tweets","users","followers","timeline","mentions","retweets","likes","lists","spaces","direct messages","trends","media","polls","oauth"]},linkedin:{name:"linkedin",apiUrl:"https://api.linkedin.com",regex:"^.*linkedin.*$",icon:"/logos/linkedin.svg",docsUrl:"https://learn.microsoft.com/en-us/linkedin/shared/authentication/getting-access",preferredAuthType:"oauth2",oauth:{authUrl:"https://www.linkedin.com/oauth/v2/authorization",tokenUrl:"https://www.linkedin.com/oauth/v2/accessToken",scopes:"r_liteprofile r_emailaddress w_member_social r_fullprofile r_basicprofile rw_company_admin r_1st_connections r_ads r_ads_reporting r_organization_social rw_organization_admin w_organization_social r_events"},keywords:["profiles","connections","companies","shares","posts","articles","jobs","skills","endorsements","recommendations","groups","events","messaging","oauth"]},paypal:{name:"paypal",apiUrl:"https://api.paypal.com",regex:"^.*paypal.*$",icon:"paypal",docsUrl:"https://developer.paypal.com/api/rest",preferredAuthType:"api_key",keywords:["payments","orders","captures","refunds","payouts","invoices","subscriptions","plans","products","transactions","balances","webhooks","checkout","billing","query","search"]},square:{name:"square",apiUrl:"https://connect.squareup.com",regex:"^.*(square|squareup).*$",icon:"square",docsUrl:"https://developer.squareup.com/reference/square",openApiUrl:"https://raw.githubusercontent.com/square/connect-api-specification/refs/heads/master/api.json",preferredAuthType:"oauth2",oauth:{authUrl:"https://connect.squareup.com/oauth2/authorize",tokenUrl:"https://connect.squareup.com/oauth2/token",scopes:"MERCHANT_PROFILE_READ PAYMENTS_READ PAYMENTS_WRITE CUSTOMERS_READ CUSTOMERS_WRITE INVENTORY_READ INVENTORY_WRITE ORDERS_READ ORDERS_WRITE ITEMS_READ ITEMS_WRITE EMPLOYEES_READ EMPLOYEES_WRITE TIMECARDS_READ TIMECARDS_WRITE"},keywords:["payments","customers","orders","catalog","inventory","locations","transactions","refunds","cards","checkout","invoices","subscriptions","terminals","employees","shifts","query","search","oauth"]},adyen:{name:"adyen",apiUrl:"https://checkout-test.adyen.com",regex:"^.*adyen.*$",icon:"adyen",docsUrl:"https://docs.adyen.com/api-explorer",openApiUrl:"https://raw.githubusercontent.com/Adyen/adyen-openapi/main/yaml/CheckoutService-v71.yaml",preferredAuthType:"api_key",keywords:["paymentMethods","sessions","payments","payments.details","cardDetails","recurringContracts","payouts","balanceTransfers","legalEntities","binLookup","storedValueCards","transferRules","terminalManagement","accountHolders","issuers"]},razorpay:{name:"razorpay",apiUrl:"https://api.razorpay.com",regex:"^.*razorpay.*$",icon:"razorpay",docsUrl:"https://razorpay.com/docs/api",preferredAuthType:"api_key",keywords:["payments","orders","customers","refunds","invoices","subscriptions","accounts","fund_accounts","payouts","virtual_accounts","mandates","disputes","settlements","payment_links","bin_lookup"]},plaid:{name:"plaid",apiUrl:"https://production.plaid.com",regex:"^.*plaid.*$",icon:"/logos/plaid.svg",docsUrl:"https://plaid.com/docs/api",openApiUrl:"https://raw.githubusercontent.com/plaid/plaid-openapi/master/2020-09-14.yml",preferredAuthType:"api_key",keywords:["items","accounts","institutions","link_tokens","access_tokens","transactions","auth","identity","assets","liabilities","income","user","processor_tokens","transfer","investments"]},zendesk:{name:"zendesk",apiUrl:"https://api.zendesk.com",regex:"^.*zendesk.*$",icon:"zendesk",docsUrl:"https://developer.zendesk.com/api-reference",openApiUrl:"https://developer.zendesk.com/zendesk/oas.yaml",preferredAuthType:"api_key",oauth:{authUrl:"https://{subdomain}.zendesk.com/oauth/authorizations/new",tokenUrl:"https://{subdomain}.zendesk.com/oauth/tokens",scopes:"read write tickets:read tickets:write users:read users:write organizations:read organizations:write hc:read hc:write chat:read chat:write"},keywords:["tickets","users","organizations","groups","agents","views","macros","triggers","automations","sla","custom fields","tags","satisfaction","help center","api key"]},freshdesk:{name:"freshdesk",apiUrl:"https://{domain}.freshdesk.com/api/v2",regex:"^.*freshdesk.*$",icon:"/logos/freshdesk.svg",docsUrl:"https://developers.freshdesk.com/api",preferredAuthType:"api_key",keywords:["tickets","contacts","agents","companies","groups","forums","solutions","categories","folders","articles","time entries","surveys","satisfaction","sla","escalations","api key"]},freshworks:{name:"freshworks",apiUrl:"https://{domain}.freshservice.com/api/v2",regex:"^.*(freshworks|freshservice).*$",icon:"/logos/freshworks.svg",docsUrl:"https://api.freshservice.com",preferredAuthType:"api_key",keywords:["tickets","requesters","agents","assets","changes","problems","releases","service catalog","service items","departments","locations","products","vendors","contracts","api key"]},servicenow:{name:"servicenow",apiUrl:"https://{instance}.service-now.com/api",regex:"^.*(servicenow|service-now).*$",icon:"servicenow",docsUrl:"https://developer.servicenow.com/dev.do#!/reference/api/latest/rest",preferredAuthType:"api_key",keywords:["incidents","problems","changes","requests","users","groups","cmdb","configuration items","service catalog","knowledge","tasks","approvals","sla","workflows","tables","api key"]},helpscout:{name:"helpscout",apiUrl:"https://api.helpscout.net",regex:"^.*helpscout.*$",icon:"helpscout",docsUrl:"https://developer.helpscout.com/mailbox-api",preferredAuthType:"api_key",keywords:["conversations","customers","mailboxes","threads","tags","teams","users","reports","satisfaction","ratings","workflows","saved replies","docs","beacon","api key"]},box:{name:"box",label:"Box",apiUrl:"https://api.box.com/2.0",regex:"^https?:\\/\\/(?:[^/]+\\.)*box\\.com(?:[:/?#].*)?$",icon:"simpleicons:box",docsUrl:"https://developer.box.com/reference/",preferredAuthType:"oauth2",oauth:{authUrl:"https://account.box.com/api/oauth2/authorize",tokenUrl:"https://api.box.com/oauth2/token",scopes:"root_readwrite",client_id:"m7zi0ai4amo32eg0ao8mpr6rx0uzjell",tokenAuthMethod:"body",tokenContentType:"form"},systemSpecificInstructions:"superglue provides a managed Box OAuth app; users connect with their Box login and never need to create a Box app or supply a client ID or secret. File uploads go to https://upload.box.com/api/2.0, not the main API host. If authorization fails with an app-not-authorized error, the Box enterprise blocks unpublished apps; a Box admin must enable the app in Admin Console > Apps > Custom Apps Manager using the client ID. Refresh tokens rotate and expire after 60 days without use.",keywords:["files","folders","upload","download","sharing","links","metadata","search","collaborations","comments","tasks","enterprise","content","oauth"]},dropbox:{name:"dropbox",apiUrl:"https://api.dropboxapi.com",regex:"^.*dropbox.*$",icon:"dropbox",docsUrl:"https://www.dropbox.com/developers/documentation/http/documentation",preferredAuthType:"oauth2",oauth:{authUrl:"https://www.dropbox.com/oauth2/authorize",tokenUrl:"https://api.dropboxapi.com/oauth2/token",scopes:"files.metadata.read files.metadata.write files.content.read files.content.write sharing.read sharing.write account_info.read account_info.write"},keywords:["files","folders","upload","download","sharing","links","metadata","search","sync","paper","users","teams","move","copy","delete","oauth"]},mailchimp:{name:"mailchimp",apiUrl:"https://api.mailchimp.com",regex:"^.*mailchimp.*$",icon:"mailchimp",docsUrl:"https://mailchimp.com/developer/marketing/api",openApiUrl:"https://api.mailchimp.com/schema/3.0/Swagger.json",preferredAuthType:"api_key",oauth:{authUrl:"https://login.mailchimp.com/oauth2/authorize",tokenUrl:"https://login.mailchimp.com/oauth2/token",scopes:"audiences:read audiences:write automations:read automations:write campaigns:read campaigns:write conversations:read conversations:write ecommerce:read ecommerce:write files:read files:write lists:read lists:write reports:read templates:read templates:write"},keywords:["lists","campaigns","templates","audiences","members","segments","tags","automations","reports","folders","merge fields","activities","ecommerce","batch","query","api key"]},jira:{name:"jira",apiUrl:"https://{your-domain}.atlassian.net/rest/api",regex:"^.*(jira|atlassian).*$",icon:"jira",docsUrl:"https://developer.atlassian.com/cloud/jira/platform/rest/v3",openApiUrl:"https://developer.atlassian.com/cloud/jira/platform/swagger-v3.json",preferredAuthType:"oauth2",oauth:{authUrl:"https://auth.atlassian.com/authorize",tokenUrl:"https://auth.atlassian.com/oauth/token",scopes:"read:jira-work write:jira-work read:jira-user write:jira-user read:jira-work-management write:jira-work-management read:servicedesk-request write:servicedesk-request manage:jira-project manage:jira-configuration manage:jira-data-provider offline_access",client_id:"Az7iTb4uWYSv5N4p295PulP8oO2B3PjK"},systemSpecificInstructions:"You need a cloud id in the url to connect to the Jira instance. Fetch it from available-resources and store it in the system. The /rest/api/3/search endpoint has been deprecated - Use GET /rest/api/3/search/jql with query parameter 'jql' for searching issues. MUST specify a project in the JQL query. Example: GET /rest/api/3/search/jql?jql=project=KAN&maxResults=100. The jql parameter accepts JQL queries like 'project=KEY', 'assignee=currentUser()', 'order by created DESC'. Always URL-encode the jql parameter value.",keywords:["issues","projects","boards","sprints","epics","users","workflows","fields","components","versions","priorities","statuses","comments","attachments","jql","query","search","oauth"]},confluence:{name:"confluence",apiUrl:"https://{your-domain}.atlassian.net/wiki/api/v2",regex:"^.*(confluence|atlassian).*$",icon:"confluence",docsUrl:"https://developer.atlassian.com/cloud/confluence/rest/v2",openApiUrl:"https://dac-static.atlassian.com/cloud/confluence/openapi-v2.v3.json",preferredAuthType:"oauth2",oauth:{authUrl:"https://auth.atlassian.com/authorize",tokenUrl:"https://auth.atlassian.com/oauth/token",scopes:"read:confluence-content.all write:confluence-content read:confluence-space.summary write:confluence-space read:confluence-props write:confluence-props read:confluence-user write:confluence-user read:confluence-groups write:confluence-groups delete:confluence-content delete:confluence-space offline_access",client_id:"Az7iTb4uWYSv5N4p295PulP8oO2B3PjK"},systemSpecificInstructions:"Use the Confluence Cloud REST API v2 under /wiki/api/v2 instead of legacy /wiki/rest/api v1 endpoints when a v2 equivalent exists. With OAuth 2.0, fetch the cloud id from GET https://api.atlassian.com/oauth/token/accessible-resources and use https://api.atlassian.com/ex/confluence/{cloudId}/wiki/api/v2 as the system base URL. V2 list endpoints use cursor-based pagination; follow the Link header or _links.next URL until no next page remains.",keywords:["spaces","pages","content","attachments","comments","labels","templates","blueprints","macros","restrictions","versions","ancestors","descendants","children","oauth"]},quickbooks:{name:"quickbooks",apiUrl:"https://quickbooks.api.intuit.com",regex:"^(?!.*sandbox).*(quickbooks|intuit).*$",icon:"quickbooks",docsUrl:"https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/account",preferredAuthType:"oauth2",oauth:{authUrl:"https://appcenter.intuit.com/connect/oauth2",tokenUrl:"https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer",scopes:"com.intuit.quickbooks.accounting",client_id:"ABzdIKeLde7iGXfGGjbozUUHcQ6k84yINaX42S6OmJtftvM3Q4",grant_type:"authorization_code",tokenAuthMethod:"basic_auth",tokenContentType:"form"},keywords:["accounts","invoices","customers","vendors","bills","payments","estimates","purchase orders","sales receipts","credit memos","journal entries","items","tax rates","employees","reports","oauth"],systemSpecificInstructions:"superglue provides a managed Intuit Production OAuth app for live QuickBooks Online companies. Users connect without supplying client credentials. For sandbox companies, use the QuickBooks Sandbox template. Payments or Payroll scopes can cause authorization errors such as access_denied when unavailable to the Intuit app or selected QuickBooks company."},quickbooks_sandbox:{name:"quickbooks_sandbox",label:"QuickBooks Sandbox",apiUrl:"https://sandbox-quickbooks.api.intuit.com",regex:"^.*(sandbox-quickbooks\\.api\\.intuit\\.com|quickbooks.*sandbox|intuit.*sandbox).*$",icon:"quickbooks",docsUrl:"https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/account",preferredAuthType:"oauth2",oauth:{authUrl:"https://appcenter.intuit.com/connect/oauth2",tokenUrl:"https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer",scopes:"com.intuit.quickbooks.accounting",grant_type:"authorization_code",tokenAuthMethod:"basic_auth",tokenContentType:"form"},keywords:["accounts","invoices","customers","vendors","bills","payments","estimates","purchase orders","sales receipts","credit memos","journal entries","items","tax rates","employees","reports","sandbox","oauth"],systemSpecificInstructions:"Use an Intuit app's Development client ID and client secret. Add the exact superglue OAuth callback URL to that app's Development redirect URIs. This template connects QuickBooks Online sandbox companies only. Payments or Payroll scopes can cause authorization errors such as access_denied when unavailable to the Intuit app or selected QuickBooks company."},ramp:{name:"ramp",apiUrl:"https://api.ramp.com/developer/v1",regex:"(^|.*\\b)(ramp|ramp\\.com|api\\.ramp\\.com|demo-api\\.ramp\\.com)(\\b.*|$)",icon:"ramp",docsUrl:"https://docs.ramp.com/developer-api/v1",openApiUrl:"https://docs.ramp.com/openapi/developer-api.json",preferredAuthType:"oauth2",oauth:{tokenUrl:"https://api.ramp.com/developer/v1/token",scopes:"transactions:read cards:read users:read business:read bills:read reimbursements:read vendors:read accounting:read receipts:read departments:read locations:read limits:read spend_programs:read statements:read transfers:read bank_accounts:read",grant_type:"client_credentials",tokenAuthMethod:"basic_auth",tokenContentType:"form"},keywords:["transactions","cards","users","business","bills","reimbursements","vendors","accounting","receipts","departments","locations","limits","spend_programs","statements","transfers","bank_accounts"],systemSpecificInstructions:`Ramp has separate production and sandbox API hosts. Production calls use https://api.ramp.com/developer/v1; sandbox calls use https://demo-api.ramp.com/developer/v1. Do not use the Ramp web app hosts (app.ramp.com or demo.ramp.com) for API calls.
666
+ HEADERS: { "Authorization": "Bearer <<token>>", "Content-Type": "application/json" }`,keywords:["datasets","tables","queries","jobs","projects","schemas","rows","streaming","partitions","clustering","views","routines","models","data warehouse","sql","oauth"]},firebase:{name:"firebase",apiUrl:"https://firestore.googleapis.com",regex:"^.*(firebase|firestore).*$",icon:"firebase",docsUrl:"https://firebase.google.com/docs/reference/firebase-management/rest",openApiUrl:"https://firestore.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/firebase https://www.googleapis.com/auth/cloud-platform"},keywords:["firestore","realtime database","authentication","cloud functions","storage","hosting","documents","collections","users","projects","apps","query","oauth"]},salesforce:{name:"salesforce",apiUrl:"https://api.salesforce.com",regex:"^.*salesforce.*$",icon:"salesforce",docsUrl:"https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_rest.htm",preferredAuthType:"oauth2",oauth:{authUrl:"https://login.salesforce.com/services/oauth2/authorize",tokenUrl:"https://login.salesforce.com/services/oauth2/token",scopes:"full",grant_type:"authorization_code",client_id:"3MVG9rZjd7MXFdLj8gMo0sojKlWRAgOP9F7nsk3Tec.eesq86nNTvbzDJDcmCW9YRCbteTayd_dP4OCLtISIo"},keywords:["accounts","contacts","leads","opportunities","cases","campaigns","products","price books","quotes","contracts","orders","custom objects","soql","query","search","sobjects","oauth"]},facebook:{name:"facebook",apiUrl:"https://graph.facebook.com",regex:"^.*facebook.*$",icon:"facebook",docsUrl:"https://developers.facebook.com/docs/graph-api",preferredAuthType:"oauth2",oauth:{authUrl:"https://www.facebook.com/v18.0/dialog/oauth",tokenUrl:"https://graph.facebook.com/v18.0/oauth/access_token",scopes:"email public_profile pages_show_list pages_read_engagement pages_manage_metadata pages_read_user_content pages_manage_posts pages_manage_engagement business_management ads_management ads_read catalog_management leads_retrieval"},keywords:["pages","posts","comments","insights","ads","campaigns","audiences","business","catalog","events","groups","photos","videos","live videos","oauth"]},meta_ads:{name:"meta_ads",apiUrl:"https://graph.facebook.com",regex:"^.*(meta[_ .-]?ads|facebook[_ .-]?ads|marketing[_ .-]?api|/act_).*$",icon:"meta",docsUrl:"https://developers.facebook.com/docs/marketing-api/",preferredAuthType:"oauth2",oauth:{authUrl:"https://www.facebook.com/v23.0/dialog/oauth",tokenUrl:"https://graph.facebook.com/v23.0/oauth/access_token",scopes:"ads_read ads_management business_management"},keywords:["meta ads","facebook ads","marketing api","ad accounts","campaigns","adsets","ads","adcreatives","insights","custom audiences","pixels","leadgen forms","product catalogs","spend","reach","oauth"],systemSpecificInstructions:"Ad account IDs are prefixed with act_ in all request paths (e.g. /v23.0/act_<ACCOUNT_ID>/insights, /act_<ACCOUNT_ID>/campaigns) \u2014 the numeric ID alone fails. With Standard Access, ads_read/ads_management only work for users who hold a role on the Meta app (suitable for development); serving arbitrary users requires Advanced Access, which needs business verification and App Review. For unattended server-to-server use, Business Manager system user tokens are the standard approach instead of user OAuth tokens. Graph API versions sunset roughly two years after release \u2014 prefer the latest version in paths rather than copying versions from older examples."},instagram:{name:"instagram",apiUrl:"https://graph.facebook.com/v23.0/",regex:"^.*instagram.*$",icon:"instagram",docsUrl:"https://developers.facebook.com/docs/instagram-platform/",preferredAuthType:"oauth2",oauth:{authUrl:"https://www.facebook.com/v23.0/dialog/oauth",tokenUrl:"https://graph.facebook.com/v23.0/oauth/access_token",scopes:"instagram_basic pages_show_list instagram_content_publish pages_read_engagement instagram_manage_comments instagram_manage_insights instagram_manage_messages business_management"},keywords:["instagram","instagram api","instagram graph api","media","posts","stories","comments","insights","hashtags","mentions","business discovery","content publishing","user media","account info","oauth"],systemSpecificInstructions:"There are two distinct Instagram APIs: this template targets the Instagram API with Facebook Login (host graph.facebook.com), which requires an Instagram professional (Business/Creator) account linked to a Facebook Page; hashtag search and business discovery are only available on this variant. The alternative Instagram API with Instagram Login uses host graph.instagram.com, needs no Facebook Page, and uses different tokens/scopes. The legacy Instagram Basic Display API was shut down in December 2024 and cannot be used."},twitter:{name:"twitter",apiUrl:"https://api.twitter.com",regex:"^https?:\\/\\/(?:[^/]+\\.)*(?:twitter\\.com|x\\.com)(?:[:/?#].*)?$",icon:"x",docsUrl:"https://docs.x.com/x-api/introduction",openApiUrl:"https://api.x.com/2/openapi.json",preferredAuthType:"oauth2",oauth:{authUrl:"https://twitter.com/i/oauth2/authorize",tokenUrl:"https://api.twitter.com/2/oauth2/token",scopes:"tweet.read tweet.write users.read follows.read follows.write offline.access like.read like.write list.read list.write block.read block.write bookmark.read bookmark.write mute.read mute.write"},keywords:["tweets","users","followers","timeline","mentions","retweets","likes","lists","spaces","direct messages","trends","media","polls","oauth"]},linkedin:{name:"linkedin",apiUrl:"https://api.linkedin.com",regex:"^.*linkedin.*$",icon:"/logos/linkedin.svg",docsUrl:"https://learn.microsoft.com/en-us/linkedin/shared/authentication/getting-access",preferredAuthType:"oauth2",oauth:{authUrl:"https://www.linkedin.com/oauth/v2/authorization",tokenUrl:"https://www.linkedin.com/oauth/v2/accessToken",scopes:"r_liteprofile r_emailaddress w_member_social r_fullprofile r_basicprofile rw_company_admin r_1st_connections r_ads r_ads_reporting r_organization_social rw_organization_admin w_organization_social r_events"},keywords:["profiles","connections","companies","shares","posts","articles","jobs","skills","endorsements","recommendations","groups","events","messaging","oauth"]},paypal:{name:"paypal",apiUrl:"https://api.paypal.com",regex:"^.*paypal.*$",icon:"paypal",docsUrl:"https://developer.paypal.com/api/rest",preferredAuthType:"api_key",keywords:["payments","orders","captures","refunds","payouts","invoices","subscriptions","plans","products","transactions","balances","webhooks","checkout","billing","query","search"]},square:{name:"square",apiUrl:"https://connect.squareup.com",regex:"^.*(square|squareup).*$",icon:"square",docsUrl:"https://developer.squareup.com/reference/square",openApiUrl:"https://raw.githubusercontent.com/square/connect-api-specification/refs/heads/master/api.json",preferredAuthType:"oauth2",oauth:{authUrl:"https://connect.squareup.com/oauth2/authorize",tokenUrl:"https://connect.squareup.com/oauth2/token",scopes:"MERCHANT_PROFILE_READ PAYMENTS_READ PAYMENTS_WRITE CUSTOMERS_READ CUSTOMERS_WRITE INVENTORY_READ INVENTORY_WRITE ORDERS_READ ORDERS_WRITE ITEMS_READ ITEMS_WRITE EMPLOYEES_READ EMPLOYEES_WRITE TIMECARDS_READ TIMECARDS_WRITE"},keywords:["payments","customers","orders","catalog","inventory","locations","transactions","refunds","cards","checkout","invoices","subscriptions","terminals","employees","shifts","query","search","oauth"]},adyen:{name:"adyen",apiUrl:"https://checkout-test.adyen.com",regex:"^.*adyen.*$",icon:"adyen",docsUrl:"https://docs.adyen.com/api-explorer",openApiUrl:"https://raw.githubusercontent.com/Adyen/adyen-openapi/main/yaml/CheckoutService-v71.yaml",preferredAuthType:"api_key",keywords:["paymentMethods","sessions","payments","payments.details","cardDetails","recurringContracts","payouts","balanceTransfers","legalEntities","binLookup","storedValueCards","transferRules","terminalManagement","accountHolders","issuers"]},razorpay:{name:"razorpay",apiUrl:"https://api.razorpay.com",regex:"^.*razorpay.*$",icon:"razorpay",docsUrl:"https://razorpay.com/docs/api",preferredAuthType:"api_key",keywords:["payments","orders","customers","refunds","invoices","subscriptions","accounts","fund_accounts","payouts","virtual_accounts","mandates","disputes","settlements","payment_links","bin_lookup"]},plaid:{name:"plaid",apiUrl:"https://production.plaid.com",regex:"^.*plaid.*$",icon:"/logos/plaid.svg",docsUrl:"https://plaid.com/docs/api",openApiUrl:"https://raw.githubusercontent.com/plaid/plaid-openapi/master/2020-09-14.yml",preferredAuthType:"api_key",keywords:["items","accounts","institutions","link_tokens","access_tokens","transactions","auth","identity","assets","liabilities","income","user","processor_tokens","transfer","investments"]},zendesk:{name:"zendesk",apiUrl:"https://api.zendesk.com",regex:"^.*zendesk.*$",icon:"zendesk",docsUrl:"https://developer.zendesk.com/api-reference",openApiUrl:"https://developer.zendesk.com/zendesk/oas.yaml",preferredAuthType:"api_key",oauth:{authUrl:"https://{subdomain}.zendesk.com/oauth/authorizations/new",tokenUrl:"https://{subdomain}.zendesk.com/oauth/tokens",scopes:"read write tickets:read tickets:write users:read users:write organizations:read organizations:write hc:read hc:write chat:read chat:write"},keywords:["tickets","users","organizations","groups","agents","views","macros","triggers","automations","sla","custom fields","tags","satisfaction","help center","api key"]},freshdesk:{name:"freshdesk",apiUrl:"https://{domain}.freshdesk.com/api/v2",regex:"^.*freshdesk.*$",icon:"/logos/freshdesk.svg",docsUrl:"https://developers.freshdesk.com/api",preferredAuthType:"api_key",keywords:["tickets","contacts","agents","companies","groups","forums","solutions","categories","folders","articles","time entries","surveys","satisfaction","sla","escalations","api key"]},freshworks:{name:"freshworks",apiUrl:"https://{domain}.freshservice.com/api/v2",regex:"^.*(freshworks|freshservice).*$",icon:"/logos/freshworks.svg",docsUrl:"https://api.freshservice.com",preferredAuthType:"api_key",keywords:["tickets","requesters","agents","assets","changes","problems","releases","service catalog","service items","departments","locations","products","vendors","contracts","api key"]},servicenow:{name:"servicenow",apiUrl:"https://{instance}.service-now.com/api",regex:"^.*(servicenow|service-now).*$",icon:"servicenow",docsUrl:"https://developer.servicenow.com/dev.do#!/reference/api/latest/rest",preferredAuthType:"api_key",keywords:["incidents","problems","changes","requests","users","groups","cmdb","configuration items","service catalog","knowledge","tasks","approvals","sla","workflows","tables","api key"]},helpscout:{name:"helpscout",apiUrl:"https://api.helpscout.net",regex:"^.*helpscout.*$",icon:"helpscout",docsUrl:"https://developer.helpscout.com/mailbox-api",preferredAuthType:"api_key",keywords:["conversations","customers","mailboxes","threads","tags","teams","users","reports","satisfaction","ratings","workflows","saved replies","docs","beacon","api key"]},box:{name:"box",label:"Box",apiUrl:"https://api.box.com/2.0",regex:"^https?:\\/\\/(?:[^/]+\\.)*box\\.com(?:[:/?#].*)?$",icon:"simpleicons:box",docsUrl:"https://developer.box.com/reference/",preferredAuthType:"oauth2",oauth:{authUrl:"https://account.box.com/api/oauth2/authorize",tokenUrl:"https://api.box.com/oauth2/token",scopes:"root_readwrite",client_id:"m7zi0ai4amo32eg0ao8mpr6rx0uzjell",tokenAuthMethod:"body",tokenContentType:"form"},systemSpecificInstructions:"superglue provides a managed Box OAuth app; users connect with their Box login and never need to create a Box app or supply a client ID or secret. File uploads go to https://upload.box.com/api/2.0, not the main API host. If authorization fails with an app-not-authorized error, the Box enterprise blocks unpublished apps; a Box admin must enable the app in Admin Console > Apps > Custom Apps Manager using the client ID. Refresh tokens rotate and expire after 60 days without use.",keywords:["files","folders","upload","download","sharing","links","metadata","search","collaborations","comments","tasks","enterprise","content","oauth"]},dropbox:{name:"dropbox",label:"Dropbox",apiUrl:"https://api.dropboxapi.com",regex:"^.*dropbox.*$",icon:"dropbox",docsUrl:"https://www.dropbox.com/developers/documentation/http/documentation",preferredAuthType:"oauth2",oauth:{authUrl:"https://www.dropbox.com/oauth2/authorize?token_access_type=offline",tokenUrl:"https://api.dropboxapi.com/oauth2/token",scopes:"files.metadata.read files.metadata.write files.content.read files.content.write sharing.read sharing.write account_info.read account_info.write",client_id:"azpvkrrs745i3dn",tokenAuthMethod:"body",tokenContentType:"form"},systemSpecificInstructions:"Uses the superglue managed Dropbox OAuth app. Downloads and uploads use https://content.dropboxapi.com/2 with arguments in the Dropbox-API-Arg header.",keywords:["files","folders","upload","download","sharing","links","metadata","search","sync","paper","users","teams","move","copy","delete","oauth"]},mailchimp:{name:"mailchimp",apiUrl:"https://api.mailchimp.com",regex:"^.*mailchimp.*$",icon:"mailchimp",docsUrl:"https://mailchimp.com/developer/marketing/api",openApiUrl:"https://api.mailchimp.com/schema/3.0/Swagger.json",preferredAuthType:"api_key",oauth:{authUrl:"https://login.mailchimp.com/oauth2/authorize",tokenUrl:"https://login.mailchimp.com/oauth2/token",scopes:"audiences:read audiences:write automations:read automations:write campaigns:read campaigns:write conversations:read conversations:write ecommerce:read ecommerce:write files:read files:write lists:read lists:write reports:read templates:read templates:write"},keywords:["lists","campaigns","templates","audiences","members","segments","tags","automations","reports","folders","merge fields","activities","ecommerce","batch","query","api key"]},jira:{name:"jira",label:"Jira",apiUrl:"https://{your-domain}.atlassian.net/rest/api",regex:"^.*(jira|atlassian).*$",icon:"jira",docsUrl:"https://developer.atlassian.com/cloud/jira/platform/rest/v3",openApiUrl:"https://developer.atlassian.com/cloud/jira/platform/swagger-v3.json",preferredAuthType:"oauth2",oauth:{authUrl:"https://auth.atlassian.com/authorize",tokenUrl:"https://auth.atlassian.com/oauth/token",scopes:"read:jira-work write:jira-work read:jira-user write:jira-user read:jira-work-management write:jira-work-management read:servicedesk-request write:servicedesk-request manage:jira-project manage:jira-configuration manage:jira-data-provider offline_access",client_id:"Az7iTb4uWYSv5N4p295PulP8oO2B3PjK"},systemSpecificInstructions:"OAuth access tokens only work against https://api.atlassian.com/ex/jira/{cloudId}/rest/api/3; get the cloud id from GET https://api.atlassian.com/oauth/token/accessible-resources. The /rest/api/3/search endpoint has been deprecated - Use GET /rest/api/3/search/jql with query parameter 'jql' for searching issues. MUST specify a project in the JQL query. Example: GET /rest/api/3/search/jql?jql=project=KAN&maxResults=100. The jql parameter accepts JQL queries like 'project=KEY', 'assignee=currentUser()', 'order by created DESC'. Always URL-encode the jql parameter value.",keywords:["issues","projects","boards","sprints","epics","users","workflows","fields","components","versions","priorities","statuses","comments","attachments","jql","query","search","oauth"]},confluence:{name:"confluence",apiUrl:"https://{your-domain}.atlassian.net/wiki/api/v2",regex:"^.*(confluence|atlassian).*$",icon:"confluence",docsUrl:"https://developer.atlassian.com/cloud/confluence/rest/v2",openApiUrl:"https://dac-static.atlassian.com/cloud/confluence/openapi-v2.v3.json",preferredAuthType:"oauth2",oauth:{authUrl:"https://auth.atlassian.com/authorize",tokenUrl:"https://auth.atlassian.com/oauth/token",scopes:"read:confluence-content.all write:confluence-content read:confluence-space.summary write:confluence-space read:confluence-props write:confluence-props read:confluence-user write:confluence-user read:confluence-groups write:confluence-groups delete:confluence-content delete:confluence-space offline_access",client_id:"Az7iTb4uWYSv5N4p295PulP8oO2B3PjK"},systemSpecificInstructions:"Use the Confluence Cloud REST API v2 under /wiki/api/v2 instead of legacy /wiki/rest/api v1 endpoints when a v2 equivalent exists. With OAuth 2.0, fetch the cloud id from GET https://api.atlassian.com/oauth/token/accessible-resources and use https://api.atlassian.com/ex/confluence/{cloudId}/wiki/api/v2 as the system base URL. V2 list endpoints use cursor-based pagination; follow the Link header or _links.next URL until no next page remains.",keywords:["spaces","pages","content","attachments","comments","labels","templates","blueprints","macros","restrictions","versions","ancestors","descendants","children","oauth"]},quickbooks:{name:"quickbooks",apiUrl:"https://quickbooks.api.intuit.com",regex:"^(?!.*sandbox).*(quickbooks|intuit).*$",icon:"quickbooks",docsUrl:"https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/account",preferredAuthType:"oauth2",oauth:{authUrl:"https://appcenter.intuit.com/connect/oauth2",tokenUrl:"https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer",scopes:"com.intuit.quickbooks.accounting",client_id:"ABzdIKeLde7iGXfGGjbozUUHcQ6k84yINaX42S6OmJtftvM3Q4",grant_type:"authorization_code",tokenAuthMethod:"basic_auth",tokenContentType:"form"},keywords:["accounts","invoices","customers","vendors","bills","payments","estimates","purchase orders","sales receipts","credit memos","journal entries","items","tax rates","employees","reports","oauth"],systemSpecificInstructions:"superglue provides a managed Intuit Production OAuth app for live QuickBooks Online companies. Users connect without supplying client credentials. For sandbox companies, use the QuickBooks Sandbox template. Payments or Payroll scopes can cause authorization errors such as access_denied when unavailable to the Intuit app or selected QuickBooks company."},quickbooks_sandbox:{name:"quickbooks_sandbox",label:"QuickBooks Sandbox",apiUrl:"https://sandbox-quickbooks.api.intuit.com",regex:"^.*(sandbox-quickbooks\\.api\\.intuit\\.com|quickbooks.*sandbox|intuit.*sandbox).*$",icon:"quickbooks",docsUrl:"https://developer.intuit.com/app/developer/qbo/docs/api/accounting/most-commonly-used/account",preferredAuthType:"oauth2",oauth:{authUrl:"https://appcenter.intuit.com/connect/oauth2",tokenUrl:"https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer",scopes:"com.intuit.quickbooks.accounting",grant_type:"authorization_code",tokenAuthMethod:"basic_auth",tokenContentType:"form"},keywords:["accounts","invoices","customers","vendors","bills","payments","estimates","purchase orders","sales receipts","credit memos","journal entries","items","tax rates","employees","reports","sandbox","oauth"],systemSpecificInstructions:"Use an Intuit app's Development client ID and client secret. Add the exact superglue OAuth callback URL to that app's Development redirect URIs. This template connects QuickBooks Online sandbox companies only. Payments or Payroll scopes can cause authorization errors such as access_denied when unavailable to the Intuit app or selected QuickBooks company."},ramp:{name:"ramp",apiUrl:"https://api.ramp.com/developer/v1",regex:"(^|.*\\b)(ramp|ramp\\.com|api\\.ramp\\.com|demo-api\\.ramp\\.com)(\\b.*|$)",icon:"ramp",docsUrl:"https://docs.ramp.com/developer-api/v1",openApiUrl:"https://docs.ramp.com/openapi/developer-api.json",preferredAuthType:"oauth2",oauth:{tokenUrl:"https://api.ramp.com/developer/v1/token",scopes:"transactions:read cards:read users:read business:read bills:read reimbursements:read vendors:read accounting:read receipts:read departments:read locations:read limits:read spend_programs:read statements:read transfers:read bank_accounts:read",grant_type:"client_credentials",tokenAuthMethod:"basic_auth",tokenContentType:"form"},keywords:["transactions","cards","users","business","bills","reimbursements","vendors","accounting","receipts","departments","locations","limits","spend_programs","statements","transfers","bank_accounts"],systemSpecificInstructions:`Ramp has separate production and sandbox API hosts. Production calls use https://api.ramp.com/developer/v1; sandbox calls use https://demo-api.ramp.com/developer/v1. Do not use the Ramp web app hosts (app.ramp.com or demo.ramp.com) for API calls.
667
667
 
668
668
  Create the developer app from the Ramp dashboard's Developer area with an Admin or Business Owner account, enable the Client Credentials grant for internal server-to-server integrations, configure only the required scopes, and copy the client ID and client secret. Sandbox access is not self-serve; the customer must request a sandbox from Ramp, and sandbox credentials do not work in production.
669
669
 
@@ -1663,7 +1663,7 @@ ${r}`;break;case"retry":CN(r)&&(t[i]=r);break;case"id":SN(r)&&(t[i]=r);break;cas
1663
1663
  `);o.stack=t?`${t}
1664
1664
  ${r}`:i.stack}G.exports.fetch=function(e,t=void 0){return RIe(e,t).catch(a=>{throw LN?HN(a,LN):a&&typeof a=="object"&&Error.captureStackTrace(a,G.exports.fetch),a})};G.exports.Headers=Hs().Headers;G.exports.Response=cd().Response;G.exports.Request=xm().Request;G.exports.FormData=mf().FormData;var{setGlobalOrigin:NIe,getGlobalOrigin:OIe}=ix();G.exports.setGlobalOrigin=NIe;G.exports.getGlobalOrigin=OIe;var{CacheStorage:UIe}=IR(),{kConstruct:MIe}=Ue();G.exports.caches=new UIe(MIe);var{deleteCookie:LIe,getCookies:PIe,getSetCookies:FIe,setCookie:$Ie,parseCookie:HIe}=UR();G.exports.deleteCookie=LIe;G.exports.getCookies=PIe;G.exports.getSetCookies=FIe;G.exports.setCookie=$Ie;G.exports.parseCookie=HIe;var{parseMIMEType:GIe,serializeAMimeType:VIe}=ma();G.exports.parseMIMEType=GIe;G.exports.serializeAMimeType=VIe;var{CloseEvent:YIe,ErrorEvent:JIe,MessageEvent:WIe}=jb(),{WebSocket:ZIe,ping:KIe}=yN();G.exports.WebSocket=ZIe;G.exports.CloseEvent=YIe;G.exports.ErrorEvent=JIe;G.exports.MessageEvent=WIe;G.exports.ping=KIe;G.exports.WebSocketStream=EN().WebSocketStream;G.exports.WebSocketError=Dq().WebSocketError;G.exports.request=Ad(Dm.request);G.exports.stream=Ad(Dm.stream);G.exports.pipeline=Ad(Dm.pipeline);G.exports.connect=Ad(Dm.connect);G.exports.upgrade=Ad(Dm.upgrade);G.exports.MockClient=zIe;G.exports.MockCallHistory=qIe;G.exports.MockCallHistoryLog=EIe;G.exports.MockPool=jIe;G.exports.MockAgent=IIe;G.exports.SnapshotAgent=CIe;G.exports.mockErrors=SIe;var{EventSource:XIe}=MN();G.exports.EventSource=XIe;function e2e(){globalThis.fetch=G.exports.fetch,globalThis.Headers=G.exports.Headers,globalThis.Response=G.exports.Response,globalThis.Request=G.exports.Request,globalThis.FormData=G.exports.FormData,globalThis.WebSocket=G.exports.WebSocket,globalThis.CloseEvent=G.exports.CloseEvent,globalThis.ErrorEvent=G.exports.ErrorEvent,globalThis.MessageEvent=G.exports.MessageEvent,globalThis.EventSource=G.exports.EventSource}G.exports.install=e2e});var YN=f(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});Rm.SuperglueClient=Rm.SuperglueHttpError=void 0;var Tm=Ht(),Mr=xv(),o2e=ew(),t2e=rQ(),a2e=Fa(),Lr=zc(),i2e=Lg(),wd=14400*1e3,vd;if(typeof globalThis.process<"u"&&globalThis.process.versions?.node)try{let{Agent:o}=GN();vd=new o({headersTimeout:wd,bodyTimeout:wd})}catch{}function VN(o){if(o?.aborted)throw o.reason??new DOMException("Aborted","AbortError")}var Pb=class extends Error{constructor(e,t,a,i){super(e),this.status=t,this.code=a,this.details=i,this.name="SuperglueHttpError"}};Rm.SuperglueHttpError=Pb;var Mq=class{constructor({apiKey:e,apiEndpoint:t,onInfrastructureError:a,refreshToken:i,sseTokenProvider:r,tokenProvider:n}){if(!e&&!n)throw new Error("SuperglueClient requires either apiKey or tokenProvider");this.tokenProvider=n??(async()=>e),this.apiEndpoint=t??"https://api.superglue.cloud",this.sseManager=new o2e.SSELogSubscriptionManager(this.apiEndpoint,r??this.tokenProvider,i),this.onInfrastructureError=a,this.refreshToken=i}async getApiKey(){return this.tokenProvider()}async fetchWithAuthRetry(e,t){let a=await this.getApiKey(),i=await e(a);if(i.status!==401||!this.refreshToken)return i;VN(t);let r=await this.refreshToken();return VN(t),!r||r===a?i:(i.body?.cancel(),e(r))}isInfrastructureError(e){return(0,a2e.isAbortError)(e)?!1:!!(e instanceof TypeError&&e.message.toLowerCase().includes("fetch")||e instanceof Error&&e.name==="TimeoutError")}async restRequest(e,t,a,i,r){let s=await(await this.restResponse({method:e,path:t,body:a,extraHeaders:i,requestInit:r})).text();if(s)return JSON.parse(s)}async restResponse({method:e,path:t,body:a,extraHeaders:i,requestInit:r}){let n=`${this.apiEndpoint.replace(/\/$/,"")}${t}`,s=a!=null,c=typeof FormData<"u"&&a instanceof FormData,m=u=>{let d={Authorization:`Bearer ${u}`,...i};return s&&!c&&e!=="GET"&&(d["Content-Type"]="application/json"),fetch(n,{...r,method:e,headers:d,body:s?c?a:JSON.stringify(a):void 0,signal:r?.signal??AbortSignal.timeout(wd),...vd?{dispatcher:vd}:{}})},l;try{l=await this.fetchWithAuthRetry(m,r?.signal)}catch(u){throw this.isInfrastructureError(u)&&this.onInfrastructureError?.(),u}if(!l.ok)throw await this.buildHttpError(l);return l}async uploadFiles(e,t){if(typeof t?.process!="boolean")throw new Error("process must be a boolean");if(e.length===0)return[];let a=e.map(l=>({...l,contentLength:l.contentLength??this.getUploadContentLength(l.content)})),r=(await this.restRequest("POST","/v1/files/uploads",{process:t.process,files:a.map(({fileName:l,contentType:u,contentLength:d})=>({fileName:l,contentLength:d,...u?{contentType:u}:{}}))})).data.files;if(r.length!==a.length)throw await Promise.all(r.map(l=>this.deleteFileUpload(l.id).catch(()=>{}))),new Error("Upload response did not match the selected files");let n=await Promise.allSettled(r.map(async(l,u)=>{let d=a[u],g=await fetch(l.uploadUrl,{method:"PUT",body:d.content,headers:d.contentType?{"Content-Type":d.contentType}:void 0,signal:AbortSignal.timeout(Math.min(wd,l.expiresIn*1e3))});if(!g.ok)throw new Error(`Upload failed for ${d.fileName}: ${g.status} ${g.statusText}`);return l.id})),s=n.flatMap(l=>l.status==="fulfilled"?[l.value]:[]),c=new Map;if(s.length>0)try{let l=await this.restRequest("POST","/v1/files/uploads/complete",{fileIds:s});c=new Map(l.data.files.map(u=>[u.id,u]))}catch(l){c=new Map(s.map(u=>[u,{id:u,fileName:a[r.findIndex(d=>d.id===u)]?.fileName||u,contentLength:a[r.findIndex(d=>d.id===u)]?.contentLength||0,status:"failed",error:l instanceof Error?l.message:String(l)}]))}let m=r.map((l,u)=>{let d=n[u],g=a[u];return d.status==="rejected"?{id:l.id,fileName:g.fileName,contentLength:g.contentLength,status:"failed",error:d.reason instanceof Error?d.reason.message:String(d.reason)}:c.get(l.id)||{id:l.id,fileName:g.fileName,contentLength:g.contentLength,status:"failed",error:"Upload completion returned no result"}});return await Promise.all(m.filter(l=>l.status==="failed").map(l=>this.deleteFileUpload(l.id).catch(()=>{}))),m}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 t=await e.text(),a=`HTTP ${e.status}: ${t}`,i,r;try{let n=JSON.parse(t);n&&typeof n=="object"&&!Array.isArray(n)&&(r=n),typeof n?.code=="string"&&(i=n.code);let s=n.error;typeof s=="string"?a=s:s&&typeof s=="object"&&(a=s.message||JSON.stringify(s))}catch{}return new Pb(a,e.status,i,r)}async streamRequest(e,t,a){let i=e.includes("?")?"&":"?",r=`${this.apiEndpoint.replace(/\/$/,"")}${e}${i}stream=true`,n=m=>fetch(r,{method:"POST",headers:{Authorization:`Bearer ${m}`,Accept:"text/event-stream","Content-Type":"application/json"},body:JSON.stringify(t),signal:a??AbortSignal.timeout(wd),...vd?{dispatcher:vd}:{}}),s;try{s=await this.fetchWithAuthRetry(n,a)}catch(m){throw this.isInfrastructureError(m)&&this.onInfrastructureError?.(),m}if(!s.ok)throw await this.buildHttpError(s);if(!(s.headers.get("content-type")||"").includes("text/event-stream")){let m=await s.text();return m?JSON.parse(m):void 0}try{return await(0,t2e.consumeEventStreamResult)(s)}catch(m){throw this.isInfrastructureError(m)&&this.onInfrastructureError?.(),m}}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 t=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:t.status==="success",data:t.data,error:t.error,tool:t.tool,stepResults:t.stepResults?.map(a=>({...a}))||[],...t.fileArtifacts&&t.fileArtifacts.length>0?{fileArtifacts:t.fileArtifacts}:{},...t.metadata?.warnings?.length?{warnings:t.metadata.warnings}:{}}}async runToolConfig(e){let t=e.createRun?"/v1/tools/run?createRun=true":"/v1/tools/run",a=await this.restRequest("POST",t,{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:a.status?a.status==="success":a.success??!1,data:a.data,error:a.error,tool:a.tool||e.tool,stepResults:a.stepResults?.map(r=>({...r}))||[],...a.fileArtifacts&&a.fileArtifacts.length>0?{fileArtifacts:a.fileArtifacts}:{},...a.metadata?.warnings?.length?{warnings:a.metadata.warnings}:{}}}async abortToolExecution(e){return{success:!0,runId:(await this.restRequest("POST",`/v1/runs/${encodeURIComponent(e)}/cancel`)).runId}}async executeStep({step:e,payload:t,files:a,previousResults:i,credentials:r,options:n,runId:s,systemIds:c,createRun:m,parentToolId:l,stepIndex:u,stepId:d,signal:g,stream:h}){let k={step:e,payload:t,files:a,previousResults:i,credentials:r,options:n,runId:s,systemIds:c,createRun:m,parentToolId:l,stepIndex:u,stepId:d};return h?this.streamRequest("/v1/tools/step/run",k,g):this.restRequest("POST","/v1/tools/step/run",k,void 0,g?{signal:g}:void 0)}async abortStep(e){return this.restRequest("POST","/v1/tools/step/abort",{runId:e})}async executeTransformOnly({outputTransform:e,outputSchema:t,inputSchema:a,payload:i,files:r,stepResults:n,options:s,runId:c,createRun:m,parentToolId:l,stepId:u,signal:d,stream:g}){let h={outputTransform:e,outputSchema:t,inputSchema:a,payload:i,files:r,stepResults:n,options:s,runId:c,createRun:m,parentToolId:l,stepId:u};return g?this.streamRequest("/v1/tools/transform/run",h,d):this.restRequest("POST","/v1/tools/transform/run",h,void 0,d?{signal:d}:void 0)}async createRun({toolId:e,toolConfig:t,toolResult:a,stepResults:i,toolPayload:r,status:n,error:s,startedAt:c,completedAt:m,executionKind:l,parentToolId:u,draftId:d}){return this.restRequest("POST","/v1/runs",{toolId:e,toolConfig:t,toolResult:a,stepResults:i,toolPayload:r,status:n,error:s,startedAt:(0,Lr.toUTCISOString)(c,"run.startedAt"),completedAt:(0,Lr.toUTCISOString)(m,"run.completedAt"),executionKind:l,parentToolId:u,draftId:d})}async checkRunLimit(){return(await this.restRequest("POST","/v1/runs/check-limit")).data}async extract({file:e,envelope:t}){if(!e)throw new Error("File must be provided for extract.");let a=new FormData;a.append("file",e);let i=t?"/v1/extract?envelope=true":"/v1/extract";return this.restRequest("POST",i,a)}mapOpenAPIRunToRun(e){let t={running:Tm.RunStatus.RUNNING,success:Tm.RunStatus.SUCCESS,failed:Tm.RunStatus.FAILED,aborted:Tm.RunStatus.ABORTED};return{runId:e.runId??e.id,toolId:e.toolId,tool:e.tool,systemIds:e.systemIds,status:t[e.status]??Tm.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??Tm.RunExecutionKind.FULL},fileArtifacts:e.fileArtifacts}}mapOpenAPIScheduleToToolSchedule(e){return{...e,lastRunAt:e.lastRunAt?(0,Lr.requireUTCDate)(e.lastRunAt,"schedule.lastRunAt"):void 0,nextRunAt:(0,Lr.requireUTCDate)(e.nextRunAt,"schedule.nextRunAt"),createdAt:(0,Lr.requireUTCDate)(e.createdAt,"schedule.createdAt"),updatedAt:(0,Lr.requireUTCDate)(e.updatedAt,"schedule.updatedAt")}}async listRuns(e={}){let t=(0,Mr.createSearchListQueryParams)(e);e.toolId!==void 0&&t.set("toolId",e.toolId),e.searchUserIds?.length&&t.set("searchUserIds",e.searchUserIds.join(",")),e.includeTotal!==void 0&&t.set("includeTotal",String(e.includeTotal)),e.startedAfter!==void 0&&t.set("startedAfter",e.startedAfter instanceof Date?(0,Lr.toUTCISOString)(e.startedAfter,"run.startedAfter"):e.startedAfter),e.statuses!==void 0?t.set("status",e.statuses.join(",")):e.status!==void 0&&t.set("status",e.status),e.requestSources!==void 0&&t.set("requestSources",e.requestSources.join(",")),e.executionKinds!==void 0&&t.set("executionKinds",e.executionKinds.join(",")),e.userId!==void 0&&t.set("userId",e.userId),e.systemId!==void 0&&t.set("systemId",e.systemId),e.systemIds!==void 0&&t.set("systemIds",e.systemIds.join(","));let a=t.size>0?`?${t.toString()}`:"",i=await this.restRequest("GET",`/v1/runs${a}`,void 0,void 0,{signal:e.signal});return{data:i.data.map(r=>this.mapOpenAPIRunToRun(r)),total:i.total,page:i.page,limit:i.limit,hasMore:i.hasMore}}async getActivityCounts(e){let t=new URLSearchParams;e?.from&&t.set("from",e.from instanceof Date?(0,Lr.toUTCISOString)(e.from,"activity.from"):e.from),e?.to&&t.set("to",e.to instanceof Date?(0,Lr.toUTCISOString)(e.to,"activity.to"):e.to);let a=t.toString();return(await this.restRequest("GET",`/v1/activity/counts${a?`?${a}`:""}`,void 0,void 0,{signal:e?.signal})).counts}async getRun(e){try{let t=await this.restRequest("GET",`/v1/runs/${encodeURIComponent(e)}`);return this.mapOpenAPIRunToRun(t)}catch(t){if(t.message?.includes("404")||t.message?.includes("not found"))return null;throw t}}async getTool(e){try{return await this.restRequest("GET",`/v1/tools/${encodeURIComponent(e)}`)}catch(t){if(t.message?.includes("404")||t.message?.includes("not found")||t.message?.includes("403")||t.message?.includes("not allowed"))return null;throw t}}async getToolState(e){return(await this.restRequest("GET",`/v1/tools/${encodeURIComponent(e)}/state`)).state}async setToolState(e,t){await this.restRequest("PUT",`/v1/tools/${encodeURIComponent(e)}/state`,{state:t})}async deleteToolState(e){return(await this.restRequest("DELETE",`/v1/tools/${encodeURIComponent(e)}/state`)).deletedKeys}async archiveTool(e,t=!0){return this.updateTool(e,{archived:t})}async bulkArchiveTools(e,t=!0){return this.restRequest("POST","/v1/tools/bulk/archive",{ids:e,archived:t})}async bulkDeleteTools(e){return this.restRequest("POST","/v1/tools/bulk/delete",{ids:e})}async listTools(e={}){let t=(0,Mr.createListQueryParams)(e);e.includeArchived!==void 0&&t.set("includeArchived",String(e.includeArchived));let a=t.size>0?`?${t.toString()}`:"";return this.restRequest("GET",`/v1/tools${a}`)}async listAllTools(e={}){return(0,Mr.listAllPages)((t,a)=>this.listTools({...e,page:t,limit:a}))}async createTool(e,t){return this.restRequest("POST","/v1/tools",{...t,id:e})}async updateTool(e,t){return this.restRequest("PUT",`/v1/tools/${encodeURIComponent(e)}`,t)}async deleteTool(e){try{return await this.restRequest("DELETE",`/v1/tools/${encodeURIComponent(e)}`),!0}catch(t){if(t.message?.includes("404"))return!1;throw t}}async renameTool(e,t){return this.restRequest("POST",`/v1/tools/${encodeURIComponent(e)}/rename`,{newId:t})}async getWorkflow(e){return this.getTool(e)}async archiveWorkflow(e,t=!0){return this.upsertWorkflow(e,{archived:t})}async createWorkflow(e,t){return this.createTool(e,t)}async updateWorkflow(e,t){return this.updateTool(e,t)}async upsertWorkflow(e,t){return await this.getTool(e)?this.updateTool(e,t):this.createTool(e,t)}async deleteWorkflow(e){return this.deleteTool(e)}async renameWorkflow(e,t){return this.renameTool(e,t)}async listSchedules(e={}){let t=(0,Mr.createListQueryParams)(e),a=t.size>0?`?${t.toString()}`:"",i=e.toolId?`/v1/tools/${encodeURIComponent(e.toolId)}/schedules${a}`:`/v1/schedules${a}`,r=await this.restRequest("GET",i);return{...r,data:r.data.map(n=>this.mapOpenAPIScheduleToToolSchedule(n))}}async listAllSchedules(e={}){return(0,Mr.listAllPages)((t,a)=>this.listSchedules({...e,page:t,limit:a}))}async getToolSchedule(e,t){try{let a=await this.restRequest("GET",`/v1/tools/${encodeURIComponent(e)}/schedules/${encodeURIComponent(t)}`);return this.mapOpenAPIScheduleToToolSchedule(a)}catch(a){if(a.message?.includes("404")||a.message?.includes("not found"))return null;throw a}}async createToolSchedule(e,t){let a=await this.restRequest("POST",`/v1/tools/${encodeURIComponent(e)}/schedules`,{...t,timezone:t.timezone||(0,i2e.getRuntimeTimezone)()});return this.mapOpenAPIScheduleToToolSchedule(a)}async updateToolSchedule(e,t,a){let i=await this.restRequest("PUT",`/v1/tools/${encodeURIComponent(e)}/schedules/${encodeURIComponent(t)}`,a);return this.mapOpenAPIScheduleToToolSchedule(i)}async deleteToolSchedule(e,t){return await this.restRequest("DELETE",`/v1/tools/${encodeURIComponent(e)}/schedules/${encodeURIComponent(t)}`),!0}async bulkSetSchedulesEnabled(e,t){return this.restRequest("POST","/v1/schedules/bulk/enable",{ids:e,enabled:t})}async bulkDeleteSchedules(e){return this.restRequest("POST","/v1/schedules/bulk/delete",{ids:e})}async listCredentials(e={}){let t=(0,Mr.createListQueryParams)(e);e.systemId!==void 0&&t.set("systemId",e.systemId);let a=t.size>0?`?${t.toString()}`:"";return this.restRequest("GET",`/v1/credentials${a}`)}async listAllCredentials(e={}){return(0,Mr.listAllPages)((t,a)=>this.listCredentials({...e,page:t,limit:a}))}async createCredentials(e){return(await this.restRequest("POST","/v1/credentials",e)).data}async replaceCredentials(e,t){return(await this.restRequest("PUT",`/v1/credentials/${encodeURIComponent(e)}`,{credentials:t})).data}async updateCredentials(e,t){return(await this.restRequest("PATCH",`/v1/credentials/${encodeURIComponent(e)}`,t)).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 t=(0,Mr.createListQueryParams)(e),a=t.size>0?`?${t.toString()}`:"";return this.restRequest("GET",`/v1/systems${a}`)}async listAllSystems(e={}){return(0,Mr.listAllPages)((t,a)=>this.listSystems({...e,page:t,limit:a}))}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,t){return(await this.restRequest("PATCH",`/v1/systems/${encodeURIComponent(e)}`,t)).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,t){return(await this.restRequest("POST",`/v1/oauth/exchanges/${encodeURIComponent(e)}/complete`,t)).data}async searchSystemDocumentation(e,t){return(await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/search`,{keywords:t})).data}async triggerSystemDocumentationScrapeJob(e,t){return(await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/scrape`,t)).data}async fetchOpenApiSpec(e,t,a){return(await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/openapi`,{url:t,link:a?.link})).data}async uploadSystemDocumentationFiles(e,t,a){let i=await this.uploadFiles(t,{process:!0}),r=i.flatMap(n=>n.status==="uploaded"?[n.id]:[]);if(r.length>0)try{await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/files`,{fileIds:r,link:a?.link!==!1})}catch(n){throw await Promise.all(r.map(s=>this.deleteFileUpload(s).catch(()=>{}))),n}if(!a?.settle){let n=i.filter(s=>s.status==="failed");if(n.length>0)throw new Error(n.map(s=>s.error).join("; "))}return i}async listSystemDocumentationFiles(e,t){let a=new URLSearchParams;t?.length&&a.set("fileIds",t.join(","));let i=a.size>0?`?${a.toString()}`:"";return(await this.restRequest("GET",`/v1/systems/${encodeURIComponent(e)}/documentation/files${i}`)).data}async getSystemDocumentationFileContent(e,t,a){return(await this.restRequest("GET",`/v1/systems/${encodeURIComponent(e)}/documentation/files/${encodeURIComponent(t)}/content?processed=${a.processed}`)).data}async deleteSystemDocumentationFile(e,t){await this.restRequest("DELETE",`/v1/systems/${encodeURIComponent(e)}/documentation/files/${encodeURIComponent(t)}`)}async generateCredentialsLink(e){try{return{success:!0,credentialsUrl:(await this.restRequest("POST","/v1/authenticate",e||{})).data.credentialsUrl}}catch(t){return{success:!1,error:t.message}}}};Rm.SuperglueClient=Mq});var WN=f(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.UnquotedKeyStrategy=ao.TripleQuoteStrategy=ao.TrailingCommaStrategy=ao.SingleQuoteStrategy=ao.PythonLiteralStrategy=ao.CommentStrategy=ao.ResilientJsonParser=ao.RepairStrategy=void 0;ao.parseJsonResilient=r2e;ao.parseJSON=n2e;ao.isValidJson=s2e;ao.prettyPrintJson=c2e;ao.minifyJson=m2e;var Ra=class{validate(e){try{return JSON.parse(e),!0}catch{return!1}}};ao.RepairStrategy=Ra;var Fb=class extends Ra{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,(t,a)=>{let i=a.trim();if(i.startsWith("{")&&i.endsWith("}")||i.startsWith("[")&&i.endsWith("]"))try{let n=JSON.parse(i);return JSON.stringify(n)}catch{return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`}return`"${a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`})}};ao.TripleQuoteStrategy=Fb;var $b=class extends Ra{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")}};ao.PythonLiteralStrategy=$b;var Hb=class extends Ra{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")}};ao.TrailingCommaStrategy=Hb;var Gb=class extends Ra{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 t=e.replace(/([{,]\s*)'([^']+)'(\s*:)/g,'$1"$2"$3');return t=t.replace(/(:\s*)'([^']+)'(\s*[,}])/g,'$1"$2"$3'),t}};ao.SingleQuoteStrategy=Gb;var Vb=class extends Ra{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')}};ao.UnquotedKeyStrategy=Vb;var Yb=class extends Ra{constructor(){super(...arguments),this.name="CommentRemoval",this.description="Removes JavaScript-style comments"}canApply(e){return/\/\/.*$|\/\*[\s\S]*?\*\//m.test(e)}apply(e){let t=e.replace(/\/\/.*$/gm,"");return t=t.replace(/\/\*[\s\S]*?\*\//g,""),t}};ao.CommentStrategy=Yb;var Lq=class extends Ra{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(t){let a=t.message||"";return a.includes("control character")||a.includes("Bad control")||a.includes("Unexpected token")&&/[\n\r\t]/.test(e)}}apply(e){let t="",a=!1,i=!1;for(let r=0;r<e.length;r++){let n=e[r],s=r>0?e[r-1]:"";if(i){t+=n,i=!1;continue}if(n==="\\"&&a){t+=n,i=!0;continue}if(n==='"'&&s!=="\\"){a=!a,t+=n;continue}if(a)switch(n){case`
1665
1665
  `:t+="\\n";break;case"\r":t+="\\r";break;case" ":t+="\\t";break;case"\b":t+="\\b";break;case"\f":t+="\\f";break;default:let c=n.charCodeAt(0);c<32?t+="\\u"+("0000"+c.toString(16)).slice(-4):t+=n}else t+=n}return t}},Pq=class extends Ra{constructor(){super(...arguments),this.name="TrailingCharactersRepair",this.description="Removes trailing characters after valid JSON structure"}canApply(e){let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return!1;let a=0,i=0,r=!1,n=!1;for(let s=0;s<t.length;s++){let c=t[s];if(r)n?n=!1:c==="\\"?n=!0:c==='"'&&(r=!1);else if(c==='"')r=!0;else if(c==="{")a++;else if(c==="}"){if(a--,a===0&&i===0&&s>0&&s<t.length-1)return!0}else if(c==="[")i++;else if(c==="]"&&(i--,i===0&&a===0&&s>0&&s<t.length-1))return!0}return!1}apply(e){let t=e.trim(),a=0,i=0,r=!1,n=!1,s=-1;for(let c=0;c<t.length;c++){let m=t[c];if(r)n?n=!1:m==="\\"?n=!0:m==='"'&&(r=!1);else if(m==='"')r=!0;else if(m==="{")a++;else if(m==="}"){if(a--,a===0&&i===0&&c>0){s=c;break}}else if(m==="[")i++;else if(m==="]"&&(i--,i===0&&a===0&&c>0)){s=c;break}}return s>0&&s<t.length-1?t.substring(0,s+1):e}},Nm=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 Fb,new Gb,new Lq,new Pq,new $b,new Hb,new Vb,new Yb]}parse(e){let t=Date.now();this.repairLog=[];let a=e instanceof Buffer?e.toString("utf8"):String(e);try{return{success:!0,data:JSON.parse(a),metadata:{parseTime:Date.now()-t,strategiesApplied:[]}}}catch(n){if(!this.options.attemptRepair)return{success:!1,error:`JSON parse error: ${n}`,metadata:{parseTime:Date.now()-t}}}let i=a,r=[];for(let n of this.strategies)if(n.canApply(i)){let s=i;if(i=n.apply(i),s!==i){r.push(n.name),this.repairLog.push(n.description),this.options.logRepairs&&console.log(`Applied ${n.name}: ${n.description}`);try{return{success:!0,data:JSON.parse(i),repairs:this.repairLog,metadata:{parseTime:Date.now()-t,strategiesApplied:r}}}catch{}}}try{return{success:!0,data:JSON.parse(i),repairs:this.repairLog,metadata:{parseTime:Date.now()-t,strategiesApplied:r}}}catch(n){let s=this.aggressiveFallback(i);return s.success?{...s,repairs:[...this.repairLog,"Applied aggressive fallback"],metadata:{parseTime:Date.now()-t,strategiesApplied:[...r,"AggressiveFallback"]}}:{success:!1,error:`Failed to parse JSON after applying ${r.length} strategies: ${n}`,repairs:this.repairLog,metadata:{parseTime:Date.now()-t,strategiesApplied:r}}}}aggressiveFallback(e){try{let t=e.indexOf("{"),a=e.indexOf("[");if(t===-1&&a===-1)return{success:!1,error:"No JSON-like structure found"};let i=t===-1?a:a===-1?t:Math.min(t,a),r=e.substring(i);for(let s of this.strategies)s.canApply(r)&&(r=s.apply(r));return{success:!0,data:JSON.parse(r)}}catch(t){return{success:!1,error:`Aggressive fallback failed: ${t}`}}}addStrategy(e){this.strategies.push(e)}removeStrategy(e){this.strategies=this.strategies.filter(t=>t.name!==e)}getStrategies(){return this.strategies.map(e=>e.name)}};ao.ResilientJsonParser=Nm;var JN=new Nm;function r2e(o,e){return(e?new Nm(e):JN).parse(o)}function n2e(o){let e=JN.parse(o);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 s2e(o){try{return JSON.parse(o),!0}catch{return!1}}function c2e(o,e=2){return JSON.stringify(o,null,e)}function m2e(o){let t=new Nm().parse(o);if(t.success)return JSON.stringify(t.data);throw new Error("Cannot minify invalid JSON")}});var Pt=f(oe=>{"use strict";var l2e=oe&&oe.__createBinding||(Object.create?(function(o,e,t,a){a===void 0&&(a=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(o,a,i)}):(function(o,e,t,a){a===void 0&&(a=t),o[a]=e[t]})),he=oe&&oe.__exportStar||function(o,e){for(var t in o)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&l2e(e,o,t)};Object.defineProperty(oe,"__esModule",{value:!0});oe.SSELogSubscriptionManager=oe.SuperglueHttpError=oe.SuperglueClient=void 0;he(NC(),oe);he(VC(),oe);he(u8(),oe);he(f8(),oe);he(A8(),oe);he(iu(),oe);he(M8(),oe);he(L8(),oe);he(P8(),oe);he(F8(),oe);he(xv(),oe);he(H8(),oe);he(G8(),oe);he(V8(),oe);he(Ev(),oe);he(W8(),oe);he(K8(),oe);he(X8(),oe);he(o3(),oe);he(Md(),oe);he(a3(),oe);he(i3(),oe);he(n3(),oe);he(m3(),oe);he(Cv(),oe);he(h3(),oe);he(b3(),oe);he(k3(),oe);he(A3(),oe);he(B3(),oe);he(_3(),oe);he(Fv(),oe);he(G3(),oe);he(Zv(),oe);he(W3(),oe);he(eQ(),oe);he(tQ(),oe);he(Ht(),oe);he(Fa(),oe);he(aQ(),oe);he(iQ(),oe);he(jh(),oe);he(zc(),oe);he(Lg(),oe);var ZN=YN();Object.defineProperty(oe,"SuperglueClient",{enumerable:!0,get:function(){return ZN.SuperglueClient}});Object.defineProperty(oe,"SuperglueHttpError",{enumerable:!0,get:function(){return ZN.SuperglueHttpError}});var u2e=ew();Object.defineProperty(oe,"SSELogSubscriptionManager",{enumerable:!0,get:function(){return u2e.SSELogSubscriptionManager}});he(WN(),oe)});var Cy=require("commander");var kt=pe(require("fs")),eO=pe(require("os")),Pr=pe(require("path")),xd=pe(Pt()),KN=new Set(["runner","builder","admin"]),XN={output:{mode:"stdout",directory:".superglue/output"},preset:"admin"};function Fr(o){let e=Pr.join(process.cwd(),".superglue"),t=eO.homedir();if(!t)return e;let a=Pr.join(t,".superglue");return o===!0?e:o===!1?a:kt.existsSync(Pr.join(e,"config.json"))?e:a}function Fq(o){return Pr.join(Fr(o),"config.json")}function Jb(o){let e=Fq(o);if(!kt.existsSync(e))return{};try{return JSON.parse(kt.readFileSync(e,"utf-8"))}catch{return{}}}function Om(o){let e=Jb(),t=o.apiKey||(0,xd.readProcessEnvironmentValue)("SUPERGLUE_API_KEY")||e.apiKey||"",a=o.endpoint||(0,xd.readProcessEnvironmentValue)("SUPERGLUE_API_ENDPOINT")||e.endpoint||"https://api.superglue.cloud",i=(0,xd.readProcessEnvironmentValue)("SUPERGLUE_WEB_ENDPOINT")||e.webEndpoint||a.replace(/:3002\b/,":3001").replace(/api\.superglue/,"app.superglue"),r=(0,xd.readProcessEnvironmentValue)("SUPERGLUE_CLI_PRESET"),n=r&&KN.has(r)?r:e.preset&&KN.has(e.preset)?e.preset:"admin";return{...XN,...e,apiKey:t,endpoint:a,webEndpoint:i,preset:n,output:{...XN.output,...e.output}}}function Wb(o,e){let t=Fr(e);kt.existsSync(t)||kt.mkdirSync(t,{recursive:!0}),kt.writeFileSync(Pr.join(t,"config.json"),JSON.stringify(o,null,2)+`
1666
- `,{mode:384})}function Zb(o,e){let t=Pr.join(Fr(e),"drafts");if(kt.existsSync(t)||kt.mkdirSync(t,{recursive:!0}),o.output.mode==="stdout+file"){let a=Pr.resolve(o.output.directory);kt.existsSync(a)||kt.mkdirSync(a,{recursive:!0})}}var Wq=pe(Pt());var $q=pe(require("readline"));var aO=require("child_process"),iO=require("util");var oO={name:"@superglue/cli",version:"1.1.105",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 g2e=(0,iO.promisify)(aO.exec),rt=oO.version;function tO(o){let e=o.match(/^(\d+)(?:-(.+))?$/);return e?{numeric:parseInt(e[1],10),prerelease:e[2]||null}:{numeric:0,prerelease:o}}function Xb(o,e){let t=o.split("."),a=e.split("."),i=Math.max(t.length,a.length);for(let r=0;r<i;r++){let n=tO(t[r]||"0"),s=tO(a[r]||"0");if(n.numeric<s.numeric)return-1;if(n.numeric>s.numeric||n.prerelease===null&&s.prerelease!==null)return 1;if(n.prerelease!==null&&s.prerelease===null)return-1;if(n.prerelease!==null&&s.prerelease!==null){if(n.prerelease<s.prerelease)return-1;if(n.prerelease>s.prerelease)return 1}}return 0}async function ey(){try{let o=await fetch("https://registry.npmjs.org/@superglue/cli/latest",{signal:AbortSignal.timeout(5e3)});return o.ok&&(await o.json()).version||null}catch{return null}}var Kb=null;function rO(){me()&&(Kb=ey())}async function nO(){if(!(!me()||!Kb)){try{let o=new Promise(t=>{setTimeout(()=>t(null),2e3).unref()}),e=await Promise.race([Kb,o]);e&&Xb(rt,e)<0&&(console.error(""),console.error(`${b.cyan}${b.bold} Update available: ${rt} \u2192 ${e}${b.reset}`),console.error(`${b.cyan} Run ${b.bold}sg update${b.reset}${b.cyan} to upgrade${b.reset}`),console.error(""))}catch{}Kb=null}}async function sO(){let o=await ey();if(!o)return{success:!1,message:"Could not fetch latest version from npm"};if(Xb(rt,o)>=0)return{success:!0,message:`Already on latest version (${rt})`};try{return await g2e("npm install -g @superglue/cli@latest"),{success:!0,message:`Updated from ${rt} to ${o}`}}catch(e){return{success:!1,message:`Update failed: ${e.message}. Try manually: npm install -g @superglue/cli@latest`}}}var me=()=>process.argv.includes("--table")&&process.stdout.isTTY,ya=()=>process.argv.includes("--full"),b={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 cO(o,e){let t=e||o;return`\x1B]8;;${o}\x07${b.underline}${b.cyan}${t}${b.reset}\x1B]8;;\x07`}function mO(){if(!me())return;let o=b.reset,e=b.dim,t="\x1B[47;30m",a=[" #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- "," =@@@- @@@@ "," @@@ @@% "," -@@ @@@@= @@@ @@@ @@@@@#@ @@@@@@@ @@@@@@@ @@@@@@ @@@ @@@ @@@ @@@@@@* %@@ "," @@ @@@ *@ @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @% @@@ @@@ @@@ @@* @@# "," #@@ @@@# @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @@@ @@@ @@@ @@* @@ "," @@- @@@@= @@@ @@@ @@@@@@@ @@@@@@ @@@@@@@ @@@ @@% @@@ @@@ @@@ @@@@@. @@."," #@% .@@@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* @@ "," @@ @ @@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* *@@ "," -@@ @@@@= @@@@@@ @@@ @@@@@@@ @@@ -@@ @@@@@@ @@@@@@% @@@@@@. @@@@@@* #@@ "," :@@* @@@ "," %@@@ =@@@. "," :@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@% "];console.log(""),a.forEach(i=>{let r=i.search(/\S/),n=i.length-[...i].reverse().join("").search(/\S/)-1;if(r===-1)return console.log(" "+i);let s=i.slice(0,r),c=i.slice(r,n+1).split("").map(l=>l===" "?" ":"\u2588").join(""),m=i.slice(n+1);console.log(` ${s}${t}${c}${o}${m}`)}),console.log(` ${e} CLI v${rt}${o}`),console.log("")}function eo(o){if(!me())return{stop:()=>{},update:()=>{},log:()=>{}};let e=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],t=0,a=o,i=()=>process.stdout.write("\r\x1B[2K"),r=()=>{process.stdout.write(`\r ${b.cyan}${e[t++%e.length]}${b.reset} ${a}`)},n=setInterval(r,80);return{update:s=>{a=s},log:s=>{i(),console.log(` ${b.dim}\u2502${b.reset} ${s}`),r()},stop:s=>{clearInterval(n),i(),s&&console.log(` ${s}`)}}}function te(o){me()?oy(o):console.log(JSON.stringify(o,null,2))}function qe(o,e){me()?(console.log(` ${b.green}\u2713${b.reset} ${o}`),e&&oy(e,4)):console.log(JSON.stringify({success:!0,message:o,...e&&typeof e=="object"?e:{data:e}}))}function I(o,e){me()?(console.error(` ${b.red}\u2717${b.reset} ${o}`),e&&oy(e,4)):console.error(JSON.stringify({success:!1,error:o,details:e}))}function lO(o){me()&&console.log(` ${b.yellow}\u26A0${b.reset} ${o}`)}function Yo(o){me()&&console.log(` ${b.dim}${o}${b.reset}`)}function $r(o){me()&&(console.log(`
1666
+ `,{mode:384})}function Zb(o,e){let t=Pr.join(Fr(e),"drafts");if(kt.existsSync(t)||kt.mkdirSync(t,{recursive:!0}),o.output.mode==="stdout+file"){let a=Pr.resolve(o.output.directory);kt.existsSync(a)||kt.mkdirSync(a,{recursive:!0})}}var Wq=pe(Pt());var $q=pe(require("readline"));var aO=require("child_process"),iO=require("util");var oO={name:"@superglue/cli",version:"1.1.107",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 g2e=(0,iO.promisify)(aO.exec),rt=oO.version;function tO(o){let e=o.match(/^(\d+)(?:-(.+))?$/);return e?{numeric:parseInt(e[1],10),prerelease:e[2]||null}:{numeric:0,prerelease:o}}function Xb(o,e){let t=o.split("."),a=e.split("."),i=Math.max(t.length,a.length);for(let r=0;r<i;r++){let n=tO(t[r]||"0"),s=tO(a[r]||"0");if(n.numeric<s.numeric)return-1;if(n.numeric>s.numeric||n.prerelease===null&&s.prerelease!==null)return 1;if(n.prerelease!==null&&s.prerelease===null)return-1;if(n.prerelease!==null&&s.prerelease!==null){if(n.prerelease<s.prerelease)return-1;if(n.prerelease>s.prerelease)return 1}}return 0}async function ey(){try{let o=await fetch("https://registry.npmjs.org/@superglue/cli/latest",{signal:AbortSignal.timeout(5e3)});return o.ok&&(await o.json()).version||null}catch{return null}}var Kb=null;function rO(){me()&&(Kb=ey())}async function nO(){if(!(!me()||!Kb)){try{let o=new Promise(t=>{setTimeout(()=>t(null),2e3).unref()}),e=await Promise.race([Kb,o]);e&&Xb(rt,e)<0&&(console.error(""),console.error(`${b.cyan}${b.bold} Update available: ${rt} \u2192 ${e}${b.reset}`),console.error(`${b.cyan} Run ${b.bold}sg update${b.reset}${b.cyan} to upgrade${b.reset}`),console.error(""))}catch{}Kb=null}}async function sO(){let o=await ey();if(!o)return{success:!1,message:"Could not fetch latest version from npm"};if(Xb(rt,o)>=0)return{success:!0,message:`Already on latest version (${rt})`};try{return await g2e("npm install -g @superglue/cli@latest"),{success:!0,message:`Updated from ${rt} to ${o}`}}catch(e){return{success:!1,message:`Update failed: ${e.message}. Try manually: npm install -g @superglue/cli@latest`}}}var me=()=>process.argv.includes("--table")&&process.stdout.isTTY,ya=()=>process.argv.includes("--full"),b={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 cO(o,e){let t=e||o;return`\x1B]8;;${o}\x07${b.underline}${b.cyan}${t}${b.reset}\x1B]8;;\x07`}function mO(){if(!me())return;let o=b.reset,e=b.dim,t="\x1B[47;30m",a=[" #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- "," =@@@- @@@@ "," @@@ @@% "," -@@ @@@@= @@@ @@@ @@@@@#@ @@@@@@@ @@@@@@@ @@@@@@ @@@ @@@ @@@ @@@@@@* %@@ "," @@ @@@ *@ @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @% @@@ @@@ @@@ @@* @@# "," #@@ @@@# @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @@@ @@@ @@@ @@* @@ "," @@- @@@@= @@@ @@@ @@@@@@@ @@@@@@ @@@@@@@ @@@ @@% @@@ @@@ @@@ @@@@@. @@."," #@% .@@@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* @@ "," @@ @ @@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* *@@ "," -@@ @@@@= @@@@@@ @@@ @@@@@@@ @@@ -@@ @@@@@@ @@@@@@% @@@@@@. @@@@@@* #@@ "," :@@* @@@ "," %@@@ =@@@. "," :@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@% "];console.log(""),a.forEach(i=>{let r=i.search(/\S/),n=i.length-[...i].reverse().join("").search(/\S/)-1;if(r===-1)return console.log(" "+i);let s=i.slice(0,r),c=i.slice(r,n+1).split("").map(l=>l===" "?" ":"\u2588").join(""),m=i.slice(n+1);console.log(` ${s}${t}${c}${o}${m}`)}),console.log(` ${e} CLI v${rt}${o}`),console.log("")}function eo(o){if(!me())return{stop:()=>{},update:()=>{},log:()=>{}};let e=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],t=0,a=o,i=()=>process.stdout.write("\r\x1B[2K"),r=()=>{process.stdout.write(`\r ${b.cyan}${e[t++%e.length]}${b.reset} ${a}`)},n=setInterval(r,80);return{update:s=>{a=s},log:s=>{i(),console.log(` ${b.dim}\u2502${b.reset} ${s}`),r()},stop:s=>{clearInterval(n),i(),s&&console.log(` ${s}`)}}}function te(o){me()?oy(o):console.log(JSON.stringify(o,null,2))}function qe(o,e){me()?(console.log(` ${b.green}\u2713${b.reset} ${o}`),e&&oy(e,4)):console.log(JSON.stringify({success:!0,message:o,...e&&typeof e=="object"?e:{data:e}}))}function I(o,e){me()?(console.error(` ${b.red}\u2717${b.reset} ${o}`),e&&oy(e,4)):console.error(JSON.stringify({success:!1,error:o,details:e}))}function lO(o){me()&&console.log(` ${b.yellow}\u26A0${b.reset} ${o}`)}function Yo(o){me()&&console.log(` ${b.dim}${o}${b.reset}`)}function $r(o){me()&&(console.log(`
1667
1667
  ${b.bold}${b.cyan}${o}${b.reset}`),console.log(` ${b.dim}${"\u2500".repeat(o.length)}${b.reset}`))}function ir(o,e,t){if(!me()){console.log(JSON.stringify({success:!0,total:t?.total??o.length,items:o}));return}if(o.length===0){console.log(`
1668
1668
  ${b.dim}0 results${b.reset}
1669
1669
  `);return}let a=e||Object.keys(o[0]),i=ya()?1/0:60,r=a.map(l=>Math.min(i,Math.max(l.length,...o.map(u=>String(u[l]??"").replace(/[\n\r]+/g," ").trim().length))));console.log("");let n=a.map((l,u)=>`${b.bold}${b.cyan}${l.toUpperCase().padEnd(r[u])}${b.reset}`).join(" ");console.log(` ${n}`);let s=r.map(l=>`${b.dim}${"\u2500".repeat(l)}${b.reset}`).join(`${b.dim}\u2500\u2500${b.reset}`);console.log(` ${s}`);for(let l of o){let u=a.map((d,g)=>{let h=String(l[d]??"").replace(/[\n\r]+/g," ").trim();if(h.length>i){let w=`\u2026 (${h.length})`;h=h.slice(0,Math.max(0,i-w.length))+`${b.dim}${w}${b.reset}`}return d==="status"?`${{success:b.green,running:b.yellow,failed:b.red,aborted:b.red,error:b.red,pending:b.dim}[h.toLowerCase()]||""}${h.padEnd(r[g])}${b.reset}`:h.padEnd(r[g])}).join(" ");console.log(` ${u}`)}let c=t?.total??o.length,m=c===o.length?`${o.length} result${o.length===1?"":"s"}`:`${o.length} of ${c} result${c===1?"":"s"}`;console.log(`
@@ -64,7 +64,7 @@ If a customer's system requires IP allowlisting for firewall rules, security gro
64
64
 
65
65
  Use this section as the source of truth for high-level web app navigation. Do not invent UI locations that are not listed here.
66
66
 
67
- Brain contains context-source setup, playbooks, artifacts, and file context. Capabilities contains project-attachable systems and tools. Credentials, MCP servers, and schedules configure execution but are not project members. Projects are managed separately and group selected context and capabilities without changing RBAC.
67
+ Brain contains context-source setup, playbooks, artifacts, and files. Capabilities contains project-attachable systems and tools. Credentials, MCP servers, and schedules configure execution but are not project members. Projects are managed separately and group selected context and capabilities without changing RBAC.
68
68
 
69
69
  The persistent left sidebar contains these top-level items:
70
70
 
@@ -74,7 +74,7 @@ The persistent left sidebar contains these top-level items:
74
74
  - **Setup** (`/brain`) — context-source connections that use only the current user's personal credentials.
75
75
  - **Playbooks** (`/playbooks`, detail at `/playbooks/{playbookId}`) — reusable guidance for recurring work. Built-in and custom playbooks share one grid; built-ins are labeled and can be duplicated.
76
76
  - **Artifacts** (`/artifacts`, detail at `/artifacts/{artifactId}`) — interactive outputs.
77
- - **File context** (`/files`) — uploaded source material.
77
+ - **Files** (`/files`) — uploaded source material.
78
78
  - **Capabilities** — expandable group for connected and executable resources:
79
79
  - **Tools** (`/tools`, detail at `/tools/{toolId}`) — saved tools; opens the tool playground for editing, testing, and running.
80
80
  - **Systems** (`/systems`, detail at `/systems/{systemId}`) — connected external systems with credentials and documentation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superglue/cli",
3
- "version": "1.1.105",
3
+ "version": "1.1.107",
4
4
  "bin": {
5
5
  "sg": "./dist/cli.js"
6
6
  },
@@ -64,7 +64,7 @@ If a customer's system requires IP allowlisting for firewall rules, security gro
64
64
 
65
65
  Use this section as the source of truth for high-level web app navigation. Do not invent UI locations that are not listed here.
66
66
 
67
- Brain contains context-source setup, playbooks, artifacts, and file context. Capabilities contains project-attachable systems and tools. Credentials, MCP servers, and schedules configure execution but are not project members. Projects are managed separately and group selected context and capabilities without changing RBAC.
67
+ Brain contains context-source setup, playbooks, artifacts, and files. Capabilities contains project-attachable systems and tools. Credentials, MCP servers, and schedules configure execution but are not project members. Projects are managed separately and group selected context and capabilities without changing RBAC.
68
68
 
69
69
  The persistent left sidebar contains these top-level items:
70
70
 
@@ -74,7 +74,7 @@ The persistent left sidebar contains these top-level items:
74
74
  - **Setup** (`/brain`) — context-source connections that use only the current user's personal credentials.
75
75
  - **Playbooks** (`/playbooks`, detail at `/playbooks/{playbookId}`) — reusable guidance for recurring work. Built-in and custom playbooks share one grid; built-ins are labeled and can be duplicated.
76
76
  - **Artifacts** (`/artifacts`, detail at `/artifacts/{artifactId}`) — interactive outputs.
77
- - **File context** (`/files`) — uploaded source material.
77
+ - **Files** (`/files`) — uploaded source material.
78
78
  - **Capabilities** — expandable group for connected and executable resources:
79
79
  - **Tools** (`/tools`, detail at `/tools/{toolId}`) — saved tools; opens the tool playground for editing, testing, and running.
80
80
  - **Systems** (`/systems`, detail at `/systems/{systemId}`) — connected external systems with credentials and documentation.