@superglue/cli 1.1.84 → 1.1.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/dist/cli.js +2 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "superglue",
|
|
3
3
|
"description": "Build, test, and manage superglue tools via the sg CLI. Use when working with superglue tools, systems, APIs, SDKs, or the sg command.",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.85",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "superglue",
|
|
7
7
|
"email": "hello@superglue.cloud"
|
package/dist/cli.js
CHANGED
|
@@ -427,7 +427,7 @@ Create the developer app from the Ramp dashboard's Developer area with an Admin
|
|
|
427
427
|
|
|
428
428
|
Token exchange is POST /developer/v1/token with form content, grant_type=client_credentials, and HTTP Basic auth using client_id:client_secret. Subsequent API calls use Authorization: Bearer <<access_token>>. Tokens are environment-bound and scope-bound; client-credentials tokens last 10 days.
|
|
429
429
|
|
|
430
|
-
For third-party or public multi-customer apps, use Ramp's authorization-code flow instead of Client Credentials: authorization endpoint https://api.ramp.com/v1/authorize and token endpoint https://api.ramp.com/developer/v1/token. Only users with Developer API authorization permissions, typically Admin or Business Owner users, can authorize apps. Sensitive scopes such as cards:read_vault require additional security review.`},remote:{name:"remote",apiUrl:"https://gateway.remote.com",regex:"^https?:\\/\\/(?:[^/]+\\.)*remote(?:-sandbox)?\\.com(?:[:/?#].*)?$",icon:"/logos/remote.svg",docsUrl:"https://developer.remote.com/docs/getting-started-with-remote",preferredAuthType:"api_key",keywords:["companies","employments","employees","contractors","countries","legal entities","expenses","payroll","onboarding","eligibility"],systemSpecificInstructions:"Remote customer API tokens are environment-specific: ra_live_ tokens work only with https://gateway.remote.com, while ra_test_ tokens work only with https://gateway.remote-sandbox.com. Company admins and owners generate tokens in Company Settings > Integrations & APIs > Integrations > Remote API. Send the token as Authorization: Bearer <token>; API routes begin with /v1/. This template targets customer API tokens; Remote partners may instead use OAuth flows."},xero:{name:"xero",apiUrl:"https://api.xero.com",regex:"^.*xero.*$",icon:"xero",docsUrl:"https://developer.xero.com/documentation/api/api-overview",openApiUrl:"https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/xero_accounting.yaml",preferredAuthType:"oauth2",oauth:{authUrl:"https://login.xero.com/identity/connect/authorize",tokenUrl:"https://identity.xero.com/connect/token",scopes:"accounting.transactions accounting.transactions.read accounting.reports.read accounting.journals.read accounting.settings accounting.settings.read accounting.contacts accounting.contacts.read accounting.attachments accounting.attachments.read payroll.employees payroll.payruns payroll.payslip payroll.timesheets payroll.settings"},keywords:["accounts","invoices","contacts","bills","credit notes","bank transactions","payments","receipts","journals","purchase orders","quotes","reports","tax rates","tracking categories","payroll","oauth"]},docusign:{name:"docusign",apiUrl:"https://api.docusign.com",regex:"^.*docusign.*$",icon:"/logos/docusign.svg",docsUrl:"https://developers.docusign.com/docs/esign-rest-api",openApiUrl:"https://raw.githubusercontent.com/docusign/OpenAPI-Specifications/refs/heads/master/esignature.rest.swagger-v2.1.json",preferredAuthType:"oauth2",oauth:{authUrl:"https://account.docusign.com/oauth/auth",tokenUrl:"https://account.docusign.com/oauth/token",scopes:"signature extended impersonation organization_read group_read permission_read user_read user_write account_read domain_read identity_provider_read user_data_redact asset_group_account_read asset_group_account_clone_write asset_group_account_clone_read"},keywords:["envelopes","documents","recipients","templates","signatures","tabs","brands","accounts","users","groups","powerforms","bulk send","connect","custom fields","oauth"]},deribit:{name:"deribit",apiUrl:"https://www.deribit.com/api/v2",regex:"^.*deribit.*$",icon:"deribit",docsUrl:"https://docs.deribit.com",preferredAuthType:"oauth2",oauth:{tokenUrl:"https://www.deribit.com/api/v2/public/auth",grant_type:"client_credentials",tokenContentType:"json"},keywords:["instruments","order_book","trades","orders","positions","accounts","wallet","deposits","withdrawals","market_data","options","futures","perpetuals"],systemSpecificInstructions:'Deribit uses a JSON-RPC 2.0 API over HTTPS. The token endpoint is /api/v2/public/auth \u2014 send client_id and client_secret as JSON body with grant_type: "client_credentials". Access tokens are Bearer tokens with a 900-second TTL; use /api/v2/public/auth with grant_type: "refresh_token" to renew. Deribit provides a testnet at https://test.deribit.com/api/v2 with separate credentials \u2014 register at test.deribit.com for a demo account.'},intercom:{name:"intercom",apiUrl:"https://api.intercom.io",regex:"^.*intercom.*$",icon:"intercom",docsUrl:"https://developers.intercom.com/intercom-api-reference",openApiUrl:"https://raw.githubusercontent.com/intercom/Intercom-OpenAPI/refs/heads/main/descriptions/2.9/api.intercom.io.yaml",preferredAuthType:"api_key",oauth:{authUrl:"https://app.intercom.com/oauth",tokenUrl:"https://api.intercom.io/auth/eagle/token",scopes:"inbox:read inbox:write users:read users:write companies:read companies:write contacts:read contacts:write conversations:read conversations:write help_center:read help_center:write teams:read teams:write tags:read tags:write segments:read events:write counts:read"},keywords:["contacts","conversations","messages","users","companies","events","tags","segments","articles","help center","teams","admins","inbox","notes","custom attributes","query","api key"]},asana:{name:"asana",apiUrl:"https://app.asana.com/api",regex:"^.*asana.*$",icon:"asana",docsUrl:"https://developers.asana.com/docs",openApiUrl:"https://raw.githubusercontent.com/Asana/openapi/master/defs/asana_oas.yaml",preferredAuthType:"api_key",oauth:{authUrl:"https://app.asana.com/-/oauth_authorize",tokenUrl:"https://app.asana.com/-/oauth_token",scopes:"default openid email profile",grant_type:"authorization_code",client_id:"1211466490919249"},keywords:["tasks","projects","workspaces","teams","portfolios","goals","sections","tags","custom fields","stories","attachments","followers","assignee","due dates","query","search","api key"]},trello:{name:"trello",apiUrl:"https://api.trello.com",regex:"^.*trello.*$",icon:"trello",docsUrl:"https://developer.atlassian.com/cloud/trello/rest",openApiUrl:"https://developer.atlassian.com/cloud/trello/swagger.v3.json",preferredAuthType:"api_key",keywords:["boards","lists","cards","members","labels","checklists","attachments","comments","actions","organizations","teams","power-ups","custom fields","stickers","api key"]},notion:{name:"notion",label:"Notion",apiUrl:"https://api.notion.com",regex:"^.*notion.*$",icon:"notion",docsUrl:"https://developers.notion.com",openApiUrl:"https://raw.githubusercontent.com/cameronking4/notion-openapi-chatgpt-action/refs/heads/main/public/notion-openapi.json",preferredAuthType:"oauth2",oauth:{authUrl:"https://api.notion.com/v1/oauth/authorize?owner=user",tokenUrl:"https://api.notion.com/v1/oauth/token",scopes:"read_content read_comments read_user",client_id:"2f4d872b-594c-805e-abdd-00375c12bae0",tokenAuthMethod:"basic_auth",tokenContentType:"json",extraHeaders:{"Notion-Version":"2022-06-28"}},systemSpecificInstructions:"Notion OAuth exposes only pages selected for the connection and their accessible children.",keywords:["pages","databases","blocks","users","workspaces","properties","rich text","search","comments","parent","children","query","filter","sort","api key"]},digitalocean:{name:"digitalocean",apiUrl:"https://api.digitalocean.com",regex:"^.*digitalocean.*$",icon:"digitalocean",docsUrl:"https://docs.digitalocean.com/reference/api",openApiUrl:"https://raw.githubusercontent.com/digitalocean/openapi/refs/heads/main/specification/DigitalOcean-public.v2.yaml",preferredAuthType:"api_key",oauth:{authUrl:"https://cloud.digitalocean.com/v1/oauth/authorize",tokenUrl:"https://cloud.digitalocean.com/v1/oauth/token",scopes:"read write admin"},keywords:["droplets","volumes","images","snapshots","regions","sizes","ssh_keys","domains","domain_records","certificates","firewalls","load_balancers","projects","tags","vpcs","api key"]},heroku:{name:"heroku",apiUrl:"https://api.heroku.com",regex:"^.*heroku.*$",icon:"/logos/heroku.svg",docsUrl:"https://devcenter.heroku.com/categories/platform-api",preferredAuthType:"api_key",oauth:{authUrl:"https://id.heroku.com/oauth/authorize",tokenUrl:"https://id.heroku.com/oauth/token",scopes:"global read write read-protected write-protected"},keywords:["apps","addons","builds","releases","config_vars","formations","dynos","buildpacks","domains","collaborators","keys","account","apps/~/addons","spaces","pipelines","api key"]},huggingface:{name:"huggingface",apiUrl:"https://huggingface.co",regex:"^.*huggingface.*$",icon:"huggingface",docsUrl:"https://huggingface.co/docs/hub/en/api",preferredAuthType:"api_key",keywords:["models","datasets","spaces","parameters","inference","fine-tuning","files","spaces","accounts","groups","api key"]},circleci:{name:"circleci",apiUrl:"https://circleci.com/api",regex:"^.*circleci.*$",icon:"circleci",docsUrl:"https://circleci.com/docs/api",openApiUrl:"https://circleci.com/api/v2/openapi.json",preferredAuthType:"api_key",keywords:["pipelines","workflows","jobs","projects","builds","artifacts","environment_variables","contexts","orbs","insights","schedules","checkouts","api key"]},travisci:{name:"travisci",apiUrl:"https://api.travis-ci.com",regex:"^.*(travis|travis-ci).*$",icon:"travisCI",docsUrl:"https://docs.travis-ci.com/api",preferredAuthType:"api_key",keywords:["builds","jobs","repositories","branches","requests","caches","env_vars","settings","logs","stages","beta_features","api key"]},wordpress:{name:"wordpress",apiUrl:"https://{your-site.com}/wp-json/wp/v2",regex:"^.*wordpress.*$",icon:"wordpress",docsUrl:"https://developer.wordpress.org/rest-api",openApiUrl:"https://developer.wordpress.com/docs/api/",preferredAuthType:"api_key",keywords:["posts","pages","media","users","categories","tags","comments","taxonomies","types","statuses","settings","themes","plugins","api key"]},cloudflare:{name:"cloudflare",apiUrl:"https://api.cloudflare.com",regex:"^.*cloudflare.*$",icon:"cloudflare",docsUrl:"https://developers.cloudflare.com/api",openApiUrl:"https://raw.githubusercontent.com/cloudflare/api-schemas/refs/heads/main/openapi.json",preferredAuthType:"api_key",keywords:["zones","dns_records","firewall_rules","page_rules","workers","certificates","load_balancers","rate_limits","waf","analytics","cache","ssl","api key"]},bigcommerce:{name:"bigcommerce",apiUrl:"https://api.bigcommerce.com",regex:"^.*bigcommerce.*$",icon:"bigcommerce",docsUrl:"https://developer.bigcommerce.com/docs/rest-management",preferredAuthType:"api_key",keywords:["products","categories","brands","orders","customers","carts","checkouts","coupons","price_lists","customer_groups","shipping","store_content","themes","api key"]},woocommerce:{name:"woocommerce",apiUrl:"https://{yourstore.com}/wp-json/wc/v3",regex:"^.*woocommerce.*$",icon:"woocommerce",docsUrl:"https://woocommerce.github.io/woocommerce-rest-api-docs",preferredAuthType:"api_key",keywords:["products","orders","customers","coupons","categories","shipping_classes","tax_classes","payment_gateways","shipping_zones","shipping_methods","product_variations","refunds","reports","api key"]},prestashop:{name:"prestashop",apiUrl:"https://{yourstore.com}/api",regex:"^.*prestashop.*$",icon:"prestashop",docsUrl:"https://devdocs.prestashop-project.org/8/webservice",preferredAuthType:"api_key",keywords:["products","categories","customers","addresses","carts","orders","carriers","countries","currencies","languages","manufacturers","suppliers","stocks","api key"]},squarespace:{name:"squarespace",apiUrl:"https://api.squarespace.com",regex:"^.*squarespace.*$",icon:"squarespace",docsUrl:"https://developers.squarespace.com/commerce-apis",preferredAuthType:"oauth2",oauth:{authUrl:"https://login.squarespace.com/api/1/login/oauth/provider/authorize",tokenUrl:"https://login.squarespace.com/api/1/login/oauth/provider/tokens",scopes:"website.products.read website.products.write website.orders.read website.orders.write website.inventory.read website.transactions.read website.store_settings.read email.campaigns.read email.campaigns.send"},keywords:["products","orders","inventory","transactions","profiles","store_pages","categories","discounts","gift_cards","abandoned_carts","webhooks","oauth"]},monday:{name:"monday",apiUrl:"https://api.monday.com/v2",regex:"^.*monday.*$",icon:"/logos/monday.svg",docsUrl:"https://developer.monday.com/api-reference/docs",preferredAuthType:"api_key",oauth:{authUrl:"https://auth.monday.com/oauth2/authorize",tokenUrl:"https://auth.monday.com/oauth2/token",scopes:"me:read users:read boards:read boards:write workspaces:read workspaces:write webhooks:write updates:read updates:write assets:read assets:write tags:read teams:read"},keywords:["boards","items","groups","columns","updates","users","workspaces","tags","files","activities","teams","subitems","graphql","mutations","query","api key"]},clickup:{name:"clickup",apiUrl:"https://api.clickup.com/api/v2",regex:"^.*clickup.*$",icon:"clickup",docsUrl:"https://clickup.com/api",openApiUrl:"https://developer.clickup.com/openapi/clickup-api-v2-reference.json",preferredAuthType:"api_key",oauth:{authUrl:"https://app.clickup.com/api",tokenUrl:"https://api.clickup.com/api/v2/oauth/token",scopes:"user:read user:write task:read task:write list:read list:write folder:read folder:write space:read space:write team:read team:write webhook:read webhook:write goal:read goal:write"},keywords:["tasks","lists","folders","spaces","teams","goals","views","statuses","priorities","tags","custom fields","time tracking","comments","checklists","dependencies","api key"]},typeform:{name:"typeform",apiUrl:"https://api.typeform.com",regex:"^.*typeform.*$",icon:"typeform",docsUrl:"https://developer.typeform.com",preferredAuthType:"oauth2",oauth:{authUrl:"https://api.typeform.com/oauth/authorize",tokenUrl:"https://api.typeform.com/oauth/token",scopes:"forms:read forms:write responses:read responses:write themes:read themes:write images:read images:write workspaces:read workspaces:write webhooks:read webhooks:write accounts:read offline"},keywords:["forms","responses","questions","fields","themes","images","workspaces","logic jumps","hidden fields","variables","calculations","insights","reports","oauth"]},figma:{name:"figma",apiUrl:"https://api.figma.com",regex:"^(.*\\.)?figma\\.com(/.*)?$",icon:"figma",docsUrl:"https://www.figma.com/developers/api",openApiUrl:"https://raw.githubusercontent.com/figma/rest-api-spec/refs/heads/main/openapi/openapi.yaml",preferredAuthType:"oauth2",oauth:{authUrl:"https://www.figma.com/oauth",tokenUrl:"https://www.figma.com/api/oauth/token",scopes:"file_read file_write file_dev_resources:read file_dev_resources:write webhooks:write"},keywords:["files","projects","teams","components","styles","nodes","frames","pages","images","comments","versions","branches","libraries","plugins","oauth"]},contentful:{name:"contentful",apiUrl:"https://api.contentful.com",regex:"^(.*\\.)?contentful\\.com(/.*)?$",icon:"contentful",docsUrl:"https://www.contentful.com/developers/docs/references/content-management-api",preferredAuthType:"api_key",keywords:["spaces","environments","content types","entries","assets","locales","tags","webhooks","roles","api keys","content model","publishing","preview","api key"]},creatio:{name:"creatio",apiUrl:"https://<<instance>>.creatio.com/0/odata",regex:"^(.*\\.)?creatio\\.com(/.*)?$",icon:"/logos/creatio.ico",docsUrl:"https://academy.creatio.com/docs/developer/integrations_and_api/data_services/odata/overview",preferredAuthType:"oauth2",oauth:{authUrl:"https://<<instance>>.creatio.com/0/connect/authorize",tokenUrl:"https://<<instance>>.creatio.com/0/connect/token",scopes:"offline_access",grant_type:"authorization_code"},systemSpecificInstructions:`Creatio uses OIDC-compliant OAuth endpoints. The standard /ServiceModel/AuthService.svc/Authorize and /rest/oauth/token endpoints are behind IIS session auth and will NOT work for OAuth flows \u2014 you MUST use the /0/connect/* OIDC endpoints instead.
|
|
430
|
+
For third-party or public multi-customer apps, use Ramp's authorization-code flow instead of Client Credentials: authorization endpoint https://api.ramp.com/v1/authorize and token endpoint https://api.ramp.com/developer/v1/token. Only users with Developer API authorization permissions, typically Admin or Business Owner users, can authorize apps. Sensitive scopes such as cards:read_vault require additional security review.`},remote:{name:"remote",apiUrl:"https://gateway.remote.com",regex:"^https?:\\/\\/(?:[^/]+\\.)*remote(?:-sandbox)?\\.com(?:[:/?#].*)?$",icon:"/logos/remote.svg",docsUrl:"https://developer.remote.com/docs/getting-started-with-remote",preferredAuthType:"api_key",keywords:["companies","employments","employees","contractors","countries","legal entities","expenses","payroll","onboarding","eligibility"],systemSpecificInstructions:"Remote customer API tokens are environment-specific: ra_live_ tokens work only with https://gateway.remote.com, while ra_test_ tokens work only with https://gateway.remote-sandbox.com. Company admins and owners generate tokens in Company Settings > Integrations & APIs > Integrations > Remote API. Send the token as Authorization: Bearer <token>; API routes begin with /v1/. This template targets customer API tokens; Remote partners may instead use OAuth flows."},xero:{name:"xero",apiUrl:"https://api.xero.com",regex:"^.*xero.*$",icon:"xero",docsUrl:"https://developer.xero.com/documentation/api/api-overview",openApiUrl:"https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/xero_accounting.yaml",preferredAuthType:"oauth2",oauth:{authUrl:"https://login.xero.com/identity/connect/authorize",tokenUrl:"https://identity.xero.com/connect/token",scopes:"accounting.transactions accounting.transactions.read accounting.reports.read accounting.journals.read accounting.settings accounting.settings.read accounting.contacts accounting.contacts.read accounting.attachments accounting.attachments.read payroll.employees payroll.payruns payroll.payslip payroll.timesheets payroll.settings"},keywords:["accounts","invoices","contacts","bills","credit notes","bank transactions","payments","receipts","journals","purchase orders","quotes","reports","tax rates","tracking categories","payroll","oauth"]},myob:{name:"myob",apiUrl:"https://api.myob.com/accountright",regex:"^.*myob.*$",icon:"simpleicons:myob",docsUrl:"https://developer.myob.com/api/myob-business-api/api-overview/",preferredAuthType:"oauth2",oauth:{authUrl:"https://secure.myob.com/oauth2/account/authorize",tokenUrl:"https://secure.myob.com/oauth2/v1/authorize",scopes:"sme-general-ledger sme-sales sme-timebilling sme-inventory sme-contacts-customer sme-contacts-supplier sme-contacts-personal sme-contacts-employee sme-banking sme-purchases sme-payroll sme-company-settings sme-company-file",tokenAuthMethod:"body",tokenContentType:"form"},keywords:["invoices","contacts","accounts","bank transactions","items","purchase orders","sale orders","payroll","employees","company files","general ledger","tax codes"],systemSpecificInstructions:"Every request needs three headers beyond the bearer token: x-myobapi-key (app's API key), x-myobapi-version: v2, and x-myobapi-cftoken (Base64 of company-file username:password, required even with OAuth \u2014 desktop AccountRight files have no OAuth and use only this header). After OAuth redirect, the businessId returned is the cf_uri (company file UID) that must prefix every subsequent request path under the accountright base. Register the app and get the API key/secret from the Developer tab at my.MYOB.com, not from api.myob.com itself."},docusign:{name:"docusign",apiUrl:"https://api.docusign.com",regex:"^.*docusign.*$",icon:"/logos/docusign.svg",docsUrl:"https://developers.docusign.com/docs/esign-rest-api",openApiUrl:"https://raw.githubusercontent.com/docusign/OpenAPI-Specifications/refs/heads/master/esignature.rest.swagger-v2.1.json",preferredAuthType:"oauth2",oauth:{authUrl:"https://account.docusign.com/oauth/auth",tokenUrl:"https://account.docusign.com/oauth/token",scopes:"signature extended impersonation organization_read group_read permission_read user_read user_write account_read domain_read identity_provider_read user_data_redact asset_group_account_read asset_group_account_clone_write asset_group_account_clone_read"},keywords:["envelopes","documents","recipients","templates","signatures","tabs","brands","accounts","users","groups","powerforms","bulk send","connect","custom fields","oauth"]},deribit:{name:"deribit",apiUrl:"https://www.deribit.com/api/v2",regex:"^.*deribit.*$",icon:"deribit",docsUrl:"https://docs.deribit.com",preferredAuthType:"oauth2",oauth:{tokenUrl:"https://www.deribit.com/api/v2/public/auth",grant_type:"client_credentials",tokenContentType:"json"},keywords:["instruments","order_book","trades","orders","positions","accounts","wallet","deposits","withdrawals","market_data","options","futures","perpetuals"],systemSpecificInstructions:'Deribit uses a JSON-RPC 2.0 API over HTTPS. The token endpoint is /api/v2/public/auth \u2014 send client_id and client_secret as JSON body with grant_type: "client_credentials". Access tokens are Bearer tokens with a 900-second TTL; use /api/v2/public/auth with grant_type: "refresh_token" to renew. Deribit provides a testnet at https://test.deribit.com/api/v2 with separate credentials \u2014 register at test.deribit.com for a demo account.'},intercom:{name:"intercom",apiUrl:"https://api.intercom.io",regex:"^.*intercom.*$",icon:"intercom",docsUrl:"https://developers.intercom.com/intercom-api-reference",openApiUrl:"https://raw.githubusercontent.com/intercom/Intercom-OpenAPI/refs/heads/main/descriptions/2.9/api.intercom.io.yaml",preferredAuthType:"api_key",oauth:{authUrl:"https://app.intercom.com/oauth",tokenUrl:"https://api.intercom.io/auth/eagle/token",scopes:"inbox:read inbox:write users:read users:write companies:read companies:write contacts:read contacts:write conversations:read conversations:write help_center:read help_center:write teams:read teams:write tags:read tags:write segments:read events:write counts:read"},keywords:["contacts","conversations","messages","users","companies","events","tags","segments","articles","help center","teams","admins","inbox","notes","custom attributes","query","api key"]},asana:{name:"asana",apiUrl:"https://app.asana.com/api",regex:"^.*asana.*$",icon:"asana",docsUrl:"https://developers.asana.com/docs",openApiUrl:"https://raw.githubusercontent.com/Asana/openapi/master/defs/asana_oas.yaml",preferredAuthType:"api_key",oauth:{authUrl:"https://app.asana.com/-/oauth_authorize",tokenUrl:"https://app.asana.com/-/oauth_token",scopes:"default openid email profile",grant_type:"authorization_code",client_id:"1211466490919249"},keywords:["tasks","projects","workspaces","teams","portfolios","goals","sections","tags","custom fields","stories","attachments","followers","assignee","due dates","query","search","api key"]},trello:{name:"trello",apiUrl:"https://api.trello.com",regex:"^.*trello.*$",icon:"trello",docsUrl:"https://developer.atlassian.com/cloud/trello/rest",openApiUrl:"https://developer.atlassian.com/cloud/trello/swagger.v3.json",preferredAuthType:"api_key",keywords:["boards","lists","cards","members","labels","checklists","attachments","comments","actions","organizations","teams","power-ups","custom fields","stickers","api key"]},notion:{name:"notion",label:"Notion",apiUrl:"https://api.notion.com",regex:"^.*notion.*$",icon:"notion",docsUrl:"https://developers.notion.com",openApiUrl:"https://raw.githubusercontent.com/cameronking4/notion-openapi-chatgpt-action/refs/heads/main/public/notion-openapi.json",preferredAuthType:"oauth2",oauth:{authUrl:"https://api.notion.com/v1/oauth/authorize?owner=user",tokenUrl:"https://api.notion.com/v1/oauth/token",scopes:"read_content read_comments read_user",client_id:"2f4d872b-594c-805e-abdd-00375c12bae0",tokenAuthMethod:"basic_auth",tokenContentType:"json",extraHeaders:{"Notion-Version":"2022-06-28"}},systemSpecificInstructions:"Notion OAuth exposes only pages selected for the connection and their accessible children.",keywords:["pages","databases","blocks","users","workspaces","properties","rich text","search","comments","parent","children","query","filter","sort","api key"]},digitalocean:{name:"digitalocean",apiUrl:"https://api.digitalocean.com",regex:"^.*digitalocean.*$",icon:"digitalocean",docsUrl:"https://docs.digitalocean.com/reference/api",openApiUrl:"https://raw.githubusercontent.com/digitalocean/openapi/refs/heads/main/specification/DigitalOcean-public.v2.yaml",preferredAuthType:"api_key",oauth:{authUrl:"https://cloud.digitalocean.com/v1/oauth/authorize",tokenUrl:"https://cloud.digitalocean.com/v1/oauth/token",scopes:"read write admin"},keywords:["droplets","volumes","images","snapshots","regions","sizes","ssh_keys","domains","domain_records","certificates","firewalls","load_balancers","projects","tags","vpcs","api key"]},heroku:{name:"heroku",apiUrl:"https://api.heroku.com",regex:"^.*heroku.*$",icon:"/logos/heroku.svg",docsUrl:"https://devcenter.heroku.com/categories/platform-api",preferredAuthType:"api_key",oauth:{authUrl:"https://id.heroku.com/oauth/authorize",tokenUrl:"https://id.heroku.com/oauth/token",scopes:"global read write read-protected write-protected"},keywords:["apps","addons","builds","releases","config_vars","formations","dynos","buildpacks","domains","collaborators","keys","account","apps/~/addons","spaces","pipelines","api key"]},huggingface:{name:"huggingface",apiUrl:"https://huggingface.co",regex:"^.*huggingface.*$",icon:"huggingface",docsUrl:"https://huggingface.co/docs/hub/en/api",preferredAuthType:"api_key",keywords:["models","datasets","spaces","parameters","inference","fine-tuning","files","spaces","accounts","groups","api key"]},circleci:{name:"circleci",apiUrl:"https://circleci.com/api",regex:"^.*circleci.*$",icon:"circleci",docsUrl:"https://circleci.com/docs/api",openApiUrl:"https://circleci.com/api/v2/openapi.json",preferredAuthType:"api_key",keywords:["pipelines","workflows","jobs","projects","builds","artifacts","environment_variables","contexts","orbs","insights","schedules","checkouts","api key"]},travisci:{name:"travisci",apiUrl:"https://api.travis-ci.com",regex:"^.*(travis|travis-ci).*$",icon:"travisCI",docsUrl:"https://docs.travis-ci.com/api",preferredAuthType:"api_key",keywords:["builds","jobs","repositories","branches","requests","caches","env_vars","settings","logs","stages","beta_features","api key"]},wordpress:{name:"wordpress",apiUrl:"https://{your-site.com}/wp-json/wp/v2",regex:"^.*wordpress.*$",icon:"wordpress",docsUrl:"https://developer.wordpress.org/rest-api",openApiUrl:"https://developer.wordpress.com/docs/api/",preferredAuthType:"api_key",keywords:["posts","pages","media","users","categories","tags","comments","taxonomies","types","statuses","settings","themes","plugins","api key"]},cloudflare:{name:"cloudflare",apiUrl:"https://api.cloudflare.com",regex:"^.*cloudflare.*$",icon:"cloudflare",docsUrl:"https://developers.cloudflare.com/api",openApiUrl:"https://raw.githubusercontent.com/cloudflare/api-schemas/refs/heads/main/openapi.json",preferredAuthType:"api_key",keywords:["zones","dns_records","firewall_rules","page_rules","workers","certificates","load_balancers","rate_limits","waf","analytics","cache","ssl","api key"]},bigcommerce:{name:"bigcommerce",apiUrl:"https://api.bigcommerce.com",regex:"^.*bigcommerce.*$",icon:"bigcommerce",docsUrl:"https://developer.bigcommerce.com/docs/rest-management",preferredAuthType:"api_key",keywords:["products","categories","brands","orders","customers","carts","checkouts","coupons","price_lists","customer_groups","shipping","store_content","themes","api key"]},woocommerce:{name:"woocommerce",apiUrl:"https://{yourstore.com}/wp-json/wc/v3",regex:"^.*woocommerce.*$",icon:"woocommerce",docsUrl:"https://woocommerce.github.io/woocommerce-rest-api-docs",preferredAuthType:"api_key",keywords:["products","orders","customers","coupons","categories","shipping_classes","tax_classes","payment_gateways","shipping_zones","shipping_methods","product_variations","refunds","reports","api key"]},prestashop:{name:"prestashop",apiUrl:"https://{yourstore.com}/api",regex:"^.*prestashop.*$",icon:"prestashop",docsUrl:"https://devdocs.prestashop-project.org/8/webservice",preferredAuthType:"api_key",keywords:["products","categories","customers","addresses","carts","orders","carriers","countries","currencies","languages","manufacturers","suppliers","stocks","api key"]},squarespace:{name:"squarespace",apiUrl:"https://api.squarespace.com",regex:"^.*squarespace.*$",icon:"squarespace",docsUrl:"https://developers.squarespace.com/commerce-apis",preferredAuthType:"oauth2",oauth:{authUrl:"https://login.squarespace.com/api/1/login/oauth/provider/authorize",tokenUrl:"https://login.squarespace.com/api/1/login/oauth/provider/tokens",scopes:"website.products.read website.products.write website.orders.read website.orders.write website.inventory.read website.transactions.read website.store_settings.read email.campaigns.read email.campaigns.send"},keywords:["products","orders","inventory","transactions","profiles","store_pages","categories","discounts","gift_cards","abandoned_carts","webhooks","oauth"]},monday:{name:"monday",apiUrl:"https://api.monday.com/v2",regex:"^.*monday.*$",icon:"/logos/monday.svg",docsUrl:"https://developer.monday.com/api-reference/docs",preferredAuthType:"api_key",oauth:{authUrl:"https://auth.monday.com/oauth2/authorize",tokenUrl:"https://auth.monday.com/oauth2/token",scopes:"me:read users:read boards:read boards:write workspaces:read workspaces:write webhooks:write updates:read updates:write assets:read assets:write tags:read teams:read"},keywords:["boards","items","groups","columns","updates","users","workspaces","tags","files","activities","teams","subitems","graphql","mutations","query","api key"]},clickup:{name:"clickup",apiUrl:"https://api.clickup.com/api/v2",regex:"^.*clickup.*$",icon:"clickup",docsUrl:"https://clickup.com/api",openApiUrl:"https://developer.clickup.com/openapi/clickup-api-v2-reference.json",preferredAuthType:"api_key",oauth:{authUrl:"https://app.clickup.com/api",tokenUrl:"https://api.clickup.com/api/v2/oauth/token",scopes:"user:read user:write task:read task:write list:read list:write folder:read folder:write space:read space:write team:read team:write webhook:read webhook:write goal:read goal:write"},keywords:["tasks","lists","folders","spaces","teams","goals","views","statuses","priorities","tags","custom fields","time tracking","comments","checklists","dependencies","api key"]},typeform:{name:"typeform",apiUrl:"https://api.typeform.com",regex:"^.*typeform.*$",icon:"typeform",docsUrl:"https://developer.typeform.com",preferredAuthType:"oauth2",oauth:{authUrl:"https://api.typeform.com/oauth/authorize",tokenUrl:"https://api.typeform.com/oauth/token",scopes:"forms:read forms:write responses:read responses:write themes:read themes:write images:read images:write workspaces:read workspaces:write webhooks:read webhooks:write accounts:read offline"},keywords:["forms","responses","questions","fields","themes","images","workspaces","logic jumps","hidden fields","variables","calculations","insights","reports","oauth"]},figma:{name:"figma",apiUrl:"https://api.figma.com",regex:"^(.*\\.)?figma\\.com(/.*)?$",icon:"figma",docsUrl:"https://www.figma.com/developers/api",openApiUrl:"https://raw.githubusercontent.com/figma/rest-api-spec/refs/heads/main/openapi/openapi.yaml",preferredAuthType:"oauth2",oauth:{authUrl:"https://www.figma.com/oauth",tokenUrl:"https://www.figma.com/api/oauth/token",scopes:"file_read file_write file_dev_resources:read file_dev_resources:write webhooks:write"},keywords:["files","projects","teams","components","styles","nodes","frames","pages","images","comments","versions","branches","libraries","plugins","oauth"]},contentful:{name:"contentful",apiUrl:"https://api.contentful.com",regex:"^(.*\\.)?contentful\\.com(/.*)?$",icon:"contentful",docsUrl:"https://www.contentful.com/developers/docs/references/content-management-api",preferredAuthType:"api_key",keywords:["spaces","environments","content types","entries","assets","locales","tags","webhooks","roles","api keys","content model","publishing","preview","api key"]},creatio:{name:"creatio",apiUrl:"https://<<instance>>.creatio.com/0/odata",regex:"^(.*\\.)?creatio\\.com(/.*)?$",icon:"/logos/creatio.ico",docsUrl:"https://academy.creatio.com/docs/developer/integrations_and_api/data_services/odata/overview",preferredAuthType:"oauth2",oauth:{authUrl:"https://<<instance>>.creatio.com/0/connect/authorize",tokenUrl:"https://<<instance>>.creatio.com/0/connect/token",scopes:"offline_access",grant_type:"authorization_code"},systemSpecificInstructions:`Creatio uses OIDC-compliant OAuth endpoints. The standard /ServiceModel/AuthService.svc/Authorize and /rest/oauth/token endpoints are behind IIS session auth and will NOT work for OAuth flows \u2014 you MUST use the /0/connect/* OIDC endpoints instead.
|
|
431
431
|
|
|
432
432
|
To discover the correct endpoints for any Creatio instance, fetch: https://<instance>.creatio.com/0/.well-known/openid-configuration
|
|
433
433
|
|
|
@@ -1417,7 +1417,7 @@ ${r}`;break;case"retry":D5(r)&&(t[i]=r);break;case"id":T5(r)&&(t[i]=r);break;cas
|
|
|
1417
1417
|
`);o.stack=t?`${t}
|
|
1418
1418
|
${r}`:i.stack}Q.exports.fetch=function(e,t=void 0){return cme(e,t).catch(a=>{throw G5?W5(a,G5):a&&typeof a=="object"&&Error.captureStackTrace(a,Q.exports.fetch),a})};Q.exports.Headers=Wr().Headers;Q.exports.Response=Fm().Response;Q.exports.Request=An().Request;Q.exports.FormData=hd().FormData;var{setGlobalOrigin:mme,getGlobalOrigin:lme}=qy();Q.exports.setGlobalOrigin=mme;Q.exports.getGlobalOrigin=lme;var{CacheStorage:ume}=Q9(),{kConstruct:dme}=ge();Q.exports.caches=new ume(dme);var{deleteCookie:gme,getCookies:pme,getSetCookies:hme,setCookie:fme,parseCookie:bme}=P9();Q.exports.deleteCookie=gme;Q.exports.getCookies=pme;Q.exports.getSetCookies=hme;Q.exports.setCookie=fme;Q.exports.parseCookie=bme;var{parseMIMEType:yme,serializeAMimeType:kme}=bt();Q.exports.parseMIMEType=yme;Q.exports.serializeAMimeType=kme;var{CloseEvent:Ame,ErrorEvent:wme,MessageEvent:vme}=Tg(),{WebSocket:xme,ping:zme}=v5();Q.exports.WebSocket=xme;Q.exports.CloseEvent=Ame;Q.exports.ErrorEvent=wme;Q.exports.MessageEvent=vme;Q.exports.ping=zme;Q.exports.WebSocketStream=B5().WebSocketStream;Q.exports.WebSocketError=ov().WebSocketError;Q.exports.request=el(Qn.request);Q.exports.stream=el(Qn.stream);Q.exports.pipeline=el(Qn.pipeline);Q.exports.connect=el(Qn.connect);Q.exports.upgrade=el(Qn.upgrade);Q.exports.MockClient=Jce;Q.exports.MockCallHistory=Kce;Q.exports.MockCallHistoryLog=Zce;Q.exports.MockPool=eme;Q.exports.MockAgent=Xce;Q.exports.SnapshotAgent=ome;Q.exports.mockErrors=tme;var{EventSource:qme}=H5();Q.exports.EventSource=qme;function Eme(){globalThis.fetch=Q.exports.fetch,globalThis.Headers=Q.exports.Headers,globalThis.Response=Q.exports.Response,globalThis.Request=Q.exports.Request,globalThis.FormData=Q.exports.FormData,globalThis.WebSocket=Q.exports.WebSocket,globalThis.CloseEvent=Q.exports.CloseEvent,globalThis.ErrorEvent=Q.exports.ErrorEvent,globalThis.MessageEvent=Q.exports.MessageEvent,globalThis.EventSource=Q.exports.EventSource}Q.exports.install=Eme});var K5=y(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.SuperglueClient=Dn.SuperglueHttpError=void 0;var Sn=rt(),$a=Jf(),Ime=wb(),Cme=mI(),jme=Zt(),Wa=Cs(),Bme=wu(),tl=14400*1e3,ol;if(typeof globalThis.process<"u"&&globalThis.process.versions?.node)try{let{Agent:o}=J5();ol=new o({headersTimeout:tl,bodyTimeout:tl})}catch{}var $g=class extends Error{constructor(e,t,a,i){super(e),this.status=t,this.code=a,this.details=i,this.name="SuperglueHttpError"}};Dn.SuperglueHttpError=$g;var nv=class{constructor({apiKey:e,apiEndpoint:t,onInfrastructureError:a,sseTokenProvider:i,tokenProvider:r}){if(!e&&!r)throw new Error("SuperglueClient requires either apiKey or tokenProvider");this.tokenProvider=r??(async()=>e),this.apiEndpoint=t??"https://api.superglue.cloud",this.sseManager=new Ime.SSELogSubscriptionManager(this.apiEndpoint,i??this.tokenProvider),this.onInfrastructureError=a}async getApiKey(){return this.tokenProvider()}isInfrastructureError(e){return(0,jme.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 n=await(await this.restResponse({method:e,path:t,body:a,extraHeaders:i,requestInit:r})).text();if(n)return JSON.parse(n)}async restResponse({method:e,path:t,body:a,extraHeaders:i,requestInit:r}){let s=`${this.apiEndpoint.replace(/\/$/,"")}${t}`,n=a!=null,c=typeof FormData<"u"&&a instanceof FormData,l={Authorization:`Bearer ${await this.getApiKey()}`,...i};n&&!c&&e!=="GET"&&(l["Content-Type"]="application/json");let u;try{u=await fetch(s,{...r,method:e,headers:l,body:n?c?a:JSON.stringify(a):void 0,signal:r?.signal??AbortSignal.timeout(tl),...ol?{dispatcher:ol}:{}})}catch(d){throw this.isInfrastructureError(d)&&this.onInfrastructureError?.(),d}if(!u.ok)throw await this.buildHttpError(u);return u}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 s=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(tl,l.expiresIn*1e3))});if(!g.ok)throw new Error(`Upload failed for ${d.fileName}: ${g.status} ${g.statusText}`);return l.id})),n=s.flatMap(l=>l.status==="fulfilled"?[l.value]:[]),c=new Map;if(n.length>0)try{let l=await this.restRequest("POST","/v1/files/uploads/complete",{fileIds:n});c=new Map(l.data.files.map(u=>[u.id,u]))}catch(l){c=new Map(n.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=s[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 s=JSON.parse(t);s&&typeof s=="object"&&!Array.isArray(s)&&(r=s),typeof s?.code=="string"&&(i=s.code);let n=s.error;typeof n=="string"?a=n:n&&typeof n=="object"&&(a=n.message||JSON.stringify(n))}catch{}return new $g(a,e.status,i,r)}async streamRequest(e,t,a){let i=e.includes("?")?"&":"?",r=`${this.apiEndpoint.replace(/\/$/,"")}${e}${i}stream=true`,n={Authorization:`Bearer ${await this.getApiKey()}`,Accept:"text/event-stream","Content-Type":"application/json"},c;try{c=await fetch(r,{method:"POST",headers:n,body:JSON.stringify(t),signal:a??AbortSignal.timeout(tl),...ol?{dispatcher:ol}:{}})}catch(l){throw this.isInfrastructureError(l)&&this.onInfrastructureError?.(),l}if(!c.ok)throw await this.buildHttpError(c);if(!(c.headers.get("content-type")||"").includes("text/event-stream")){let l=await c.text();return l?JSON.parse(l):void 0}try{return await(0,Cme.consumeEventStreamResult)(c)}catch(l){throw this.isInfrastructureError(l)&&this.onInfrastructureError?.(),l}}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:s,runId:n,systemIds:c,createRun:m,parentToolId:l,stepIndex:u,stepId:d,signal:g,stream:p}){let b={step:e,payload:t,files:a,previousResults:i,credentials:r,options:s,runId:n,systemIds:c,createRun:m,parentToolId:l,stepIndex:u,stepId:d};return p?this.streamRequest("/v1/tools/step/run",b,g):this.restRequest("POST","/v1/tools/step/run",b,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:s,options:n,runId:c,createRun:m,parentToolId:l,stepId:u,signal:d,stream:g}){let p={outputTransform:e,outputSchema:t,inputSchema:a,payload:i,files:r,stepResults:s,options:n,runId:c,createRun:m,parentToolId:l,stepId:u};return g?this.streamRequest("/v1/tools/transform/run",p,d):this.restRequest("POST","/v1/tools/transform/run",p,void 0,d?{signal:d}:void 0)}async createRun({toolId:e,toolConfig:t,toolResult:a,stepResults:i,toolPayload:r,status:s,error:n,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:s,error:n,startedAt:(0,Wa.toUTCISOString)(c,"run.startedAt"),completedAt:(0,Wa.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:Sn.RunStatus.RUNNING,success:Sn.RunStatus.SUCCESS,failed:Sn.RunStatus.FAILED,aborted:Sn.RunStatus.ABORTED};return{runId:e.runId??e.id,toolId:e.toolId,tool:e.tool,systemIds:e.systemIds,status:t[e.status]??Sn.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??Sn.RunExecutionKind.FULL},fileArtifacts:e.fileArtifacts}}mapOpenAPIScheduleToToolSchedule(e){return{...e,lastRunAt:e.lastRunAt?(0,Wa.requireUTCDate)(e.lastRunAt,"schedule.lastRunAt"):void 0,nextRunAt:(0,Wa.requireUTCDate)(e.nextRunAt,"schedule.nextRunAt"),createdAt:(0,Wa.requireUTCDate)(e.createdAt,"schedule.createdAt"),updatedAt:(0,Wa.requireUTCDate)(e.updatedAt,"schedule.updatedAt")}}async listRuns(e={}){let t=(0,$a.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,Wa.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,Wa.toUTCISOString)(e.from,"activity.from"):e.from),e?.to&&t.set("to",e.to instanceof Date?(0,Wa.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,$a.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,$a.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,$a.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(s=>this.mapOpenAPIScheduleToToolSchedule(s))}}async listAllSchedules(e={}){return(0,$a.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,Bme.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,$a.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,$a.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,$a.createListQueryParams)(e),a=t.size>0?`?${t.toString()}`:"";return this.restRequest("GET",`/v1/systems${a}`)}async listAllSystems(e={}){return(0,$a.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(s=>s.status==="uploaded"?[s.id]:[]);if(r.length>0)try{await this.restRequest("POST",`/v1/systems/${encodeURIComponent(e)}/documentation/files`,{fileIds:r,link:a?.link!==!1})}catch(s){throw await Promise.all(r.map(n=>this.deleteFileUpload(n).catch(()=>{}))),s}if(!a?.settle){let s=i.filter(n=>n.status==="failed");if(s.length>0)throw new Error(s.map(n=>n.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}}}};Dn.SuperglueClient=nv});var X5=y(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.UnquotedKeyStrategy=Ce.TripleQuoteStrategy=Ce.TrailingCommaStrategy=Ce.SingleQuoteStrategy=Ce.PythonLiteralStrategy=Ce.CommentStrategy=Ce.ResilientJsonParser=Ce.RepairStrategy=void 0;Ce.parseJsonResilient=Qme;Ce.parseJSON=Sme;Ce.isValidJson=Dme;Ce.prettyPrintJson=Tme;Ce.minifyJson=Rme;var Gt=class{validate(e){try{return JSON.parse(e),!0}catch{return!1}}};Ce.RepairStrategy=Gt;var Wg=class extends Gt{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 s=JSON.parse(i);return JSON.stringify(s)}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")}"`})}};Ce.TripleQuoteStrategy=Wg;var Jg=class extends Gt{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")}};Ce.PythonLiteralStrategy=Jg;var Kg=class extends Gt{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")}};Ce.TrailingCommaStrategy=Kg;var Zg=class extends Gt{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}};Ce.SingleQuoteStrategy=Zg;var Xg=class extends Gt{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')}};Ce.UnquotedKeyStrategy=Xg;var ep=class extends Gt{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}};Ce.CommentStrategy=ep;var cv=class extends Gt{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 s=e[r],n=r>0?e[r-1]:"";if(i){t+=s,i=!1;continue}if(s==="\\"&&a){t+=s,i=!0;continue}if(s==='"'&&n!=="\\"){a=!a,t+=s;continue}if(a)switch(s){case`
|
|
1419
1419
|
`: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=s.charCodeAt(0);c<32?t+="\\u"+("0000"+c.toString(16)).slice(-4):t+=s}else t+=s}return t}},mv=class extends Gt{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,s=!1;for(let n=0;n<t.length;n++){let c=t[n];if(r)s?s=!1:c==="\\"?s=!0:c==='"'&&(r=!1);else if(c==='"')r=!0;else if(c==="{")a++;else if(c==="}"){if(a--,a===0&&i===0&&n>0&&n<t.length-1)return!0}else if(c==="[")i++;else if(c==="]"&&(i--,i===0&&a===0&&n>0&&n<t.length-1))return!0}return!1}apply(e){let t=e.trim(),a=0,i=0,r=!1,s=!1,n=-1;for(let c=0;c<t.length;c++){let m=t[c];if(r)s?s=!1:m==="\\"?s=!0:m==='"'&&(r=!1);else if(m==='"')r=!0;else if(m==="{")a++;else if(m==="}"){if(a--,a===0&&i===0&&c>0){n=c;break}}else if(m==="[")i++;else if(m==="]"&&(i--,i===0&&a===0&&c>0)){n=c;break}}return n>0&&n<t.length-1?t.substring(0,n+1):e}},Tn=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 Wg,new Zg,new cv,new mv,new Jg,new Kg,new Xg,new ep]}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(s){if(!this.options.attemptRepair)return{success:!1,error:`JSON parse error: ${s}`,metadata:{parseTime:Date.now()-t}}}let i=a,r=[];for(let s of this.strategies)if(s.canApply(i)){let n=i;if(i=s.apply(i),n!==i){r.push(s.name),this.repairLog.push(s.description),this.options.logRepairs&&console.log(`Applied ${s.name}: ${s.description}`);try{return{success:!0,data:JSON.parse(i),repairs:this.repairLog,metadata:{parseTime:Date.now()-t,strategiesApplied:r}}}catch{}}}try{return{success:!0,data:JSON.parse(i),repairs:this.repairLog,metadata:{parseTime:Date.now()-t,strategiesApplied:r}}}catch(s){let n=this.aggressiveFallback(i);return n.success?{...n,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: ${s}`,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 n of this.strategies)n.canApply(r)&&(r=n.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)}};Ce.ResilientJsonParser=Tn;var Z5=new Tn;function Qme(o,e){return(e?new Tn(e):Z5).parse(o)}function Sme(o){let e=Z5.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 Dme(o){try{return JSON.parse(o),!0}catch{return!1}}function Tme(o,e=2){return JSON.stringify(o,null,e)}function Rme(o){let t=new Tn().parse(o);if(t.success)return JSON.stringify(t.data);throw new Error("Cannot minify invalid JSON")}});var tt=y(F=>{"use strict";var Nme=F&&F.__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]})),Z=F&&F.__exportStar||function(o,e){for(var t in o)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Nme(e,o,t)};Object.defineProperty(F,"__esModule",{value:!0});F.SSELogSubscriptionManager=F.SuperglueHttpError=F.SuperglueClient=void 0;Z(r1(),F);Z(h1(),F);Z(f1(),F);Z(w1(),F);Z(q1(),F);Z(Mc(),F);Z(H1(),F);Z(G1(),F);Z(Y1(),F);Z(V1(),F);Z(Jf(),F);Z(W1(),F);Z(J1(),F);Z(K1(),F);Z(X1(),F);Z(e2(),F);Z(t2(),F);Z(Al(),F);Z(i2(),F);Z(r2(),F);Z(n2(),F);Z(l2(),F);Z(d2(),F);Z(y2(),F);Z(A2(),F);Z(v2(),F);Z(x2(),F);Z(T2(),F);Z(N2(),F);Z(lb(),F);Z(J2(),F);Z(yb(),F);Z(eI(),F);Z(iI(),F);Z(sI(),F);Z(rt(),F);Z(Zt(),F);Z(nI(),F);Z(cI(),F);Z(Ru(),F);Z(Cs(),F);Z(wu(),F);var e6=K5();Object.defineProperty(F,"SuperglueClient",{enumerable:!0,get:function(){return e6.SuperglueClient}});Object.defineProperty(F,"SuperglueHttpError",{enumerable:!0,get:function(){return e6.SuperglueHttpError}});var Ume=wb();Object.defineProperty(F,"SSELogSubscriptionManager",{enumerable:!0,get:function(){return Ume.SSELogSubscriptionManager}});Z(X5(),F)});var Tp=require("commander");var Ro=W(require("fs")),a6=W(require("os")),Ja=W(require("path")),al=W(tt()),o6=new Set(["runner","builder","admin"]),t6={output:{mode:"stdout",directory:".superglue/output"},preset:"admin"};function Ka(o){let e=Ja.join(process.cwd(),".superglue"),t=a6.homedir();if(!t)return e;let a=Ja.join(t,".superglue");return o===!0?e:o===!1?a:Ro.existsSync(Ja.join(e,"config.json"))?e:a}function lv(o){return Ja.join(Ka(o),"config.json")}function op(o){let e=lv(o);if(!Ro.existsSync(e))return{};try{return JSON.parse(Ro.readFileSync(e,"utf-8"))}catch{return{}}}function Rn(o){let e=op(),t=o.apiKey||(0,al.readProcessEnvironmentValue)("SUPERGLUE_API_KEY")||e.apiKey||"",a=o.endpoint||(0,al.readProcessEnvironmentValue)("SUPERGLUE_API_ENDPOINT")||e.endpoint||"https://api.superglue.cloud",i=(0,al.readProcessEnvironmentValue)("SUPERGLUE_WEB_ENDPOINT")||e.webEndpoint||a.replace(/:3002\b/,":3001").replace(/api\.superglue/,"app.superglue"),r=(0,al.readProcessEnvironmentValue)("SUPERGLUE_CLI_PRESET"),s=r&&o6.has(r)?r:e.preset&&o6.has(e.preset)?e.preset:"admin";return{...t6,...e,apiKey:t,endpoint:a,webEndpoint:i,preset:s,output:{...t6.output,...e.output}}}function tp(o,e){let t=Ka(e);Ro.existsSync(t)||Ro.mkdirSync(t,{recursive:!0}),Ro.writeFileSync(Ja.join(t,"config.json"),JSON.stringify(o,null,2)+`
|
|
1420
|
-
`,{mode:384})}function ap(o,e){let t=Ja.join(Ka(e),"drafts");if(Ro.existsSync(t)||Ro.mkdirSync(t,{recursive:!0}),o.output.mode==="stdout+file"){let a=Ja.resolve(o.output.directory);Ro.existsSync(a)||Ro.mkdirSync(a,{recursive:!0})}}var bv=W(tt());var uv=W(require("readline"));var s6=require("child_process"),n6=require("util");var i6={name:"@superglue/cli",version:"1.1.
|
|
1420
|
+
`,{mode:384})}function ap(o,e){let t=Ja.join(Ka(e),"drafts");if(Ro.existsSync(t)||Ro.mkdirSync(t,{recursive:!0}),o.output.mode==="stdout+file"){let a=Ja.resolve(o.output.directory);Ro.existsSync(a)||Ro.mkdirSync(a,{recursive:!0})}}var bv=W(tt());var uv=W(require("readline"));var s6=require("child_process"),n6=require("util");var i6={name:"@superglue/cli",version:"1.1.85",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 Mme=(0,n6.promisify)(s6.exec),xo=i6.version;function r6(o){let e=o.match(/^(\d+)(?:-(.+))?$/);return e?{numeric:parseInt(e[1],10),prerelease:e[2]||null}:{numeric:0,prerelease:o}}function rp(o,e){let t=o.split("."),a=e.split("."),i=Math.max(t.length,a.length);for(let r=0;r<i;r++){let s=r6(t[r]||"0"),n=r6(a[r]||"0");if(s.numeric<n.numeric)return-1;if(s.numeric>n.numeric||s.prerelease===null&&n.prerelease!==null)return 1;if(s.prerelease!==null&&n.prerelease===null)return-1;if(s.prerelease!==null&&n.prerelease!==null){if(s.prerelease<n.prerelease)return-1;if(s.prerelease>n.prerelease)return 1}}return 0}async function sp(){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 ip=null;function c6(){G()&&(ip=sp())}async function m6(){if(!(!G()||!ip)){try{let o=new Promise(t=>{setTimeout(()=>t(null),2e3).unref()}),e=await Promise.race([ip,o]);e&&rp(xo,e)<0&&(console.error(""),console.error(`${h.cyan}${h.bold} Update available: ${xo} \u2192 ${e}${h.reset}`),console.error(`${h.cyan} Run ${h.bold}sg update${h.reset}${h.cyan} to upgrade${h.reset}`),console.error(""))}catch{}ip=null}}async function l6(){let o=await sp();if(!o)return{success:!1,message:"Could not fetch latest version from npm"};if(rp(xo,o)>=0)return{success:!0,message:`Already on latest version (${xo})`};try{return await Mme("npm install -g @superglue/cli@latest"),{success:!0,message:`Updated from ${xo} to ${o}`}}catch(e){return{success:!1,message:`Update failed: ${e.message}. Try manually: npm install -g @superglue/cli@latest`}}}var G=()=>process.argv.includes("--table")&&process.stdout.isTTY,Et=()=>process.argv.includes("--full"),h={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 u6(o,e){let t=e||o;return`\x1B]8;;${o}\x07${h.underline}${h.cyan}${t}${h.reset}\x1B]8;;\x07`}function d6(){if(!G())return;let o=h.reset,e=h.dim,t="\x1B[47;30m",a=[" #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- "," =@@@- @@@@ "," @@@ @@% "," -@@ @@@@= @@@ @@@ @@@@@#@ @@@@@@@ @@@@@@@ @@@@@@ @@@ @@@ @@@ @@@@@@* %@@ "," @@ @@@ *@ @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @% @@@ @@@ @@@ @@* @@# "," #@@ @@@# @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @@@ @@@ @@@ @@* @@ "," @@- @@@@= @@@ @@@ @@@@@@@ @@@@@@ @@@@@@@ @@@ @@% @@@ @@@ @@@ @@@@@. @@."," #@% .@@@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* @@ "," @@ @ @@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* *@@ "," -@@ @@@@= @@@@@@ @@@ @@@@@@@ @@@ -@@ @@@@@@ @@@@@@% @@@@@@. @@@@@@* #@@ "," :@@* @@@ "," %@@@ =@@@. "," :@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@% "];console.log(""),a.forEach(i=>{let r=i.search(/\S/),s=i.length-[...i].reverse().join("").search(/\S/)-1;if(r===-1)return console.log(" "+i);let n=i.slice(0,r),c=i.slice(r,s+1).split("").map(l=>l===" "?" ":"\u2588").join(""),m=i.slice(s+1);console.log(` ${n}${t}${c}${o}${m}`)}),console.log(` ${e} CLI v${xo}${o}`),console.log("")}function Ee(o){if(!G())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 ${h.cyan}${e[t++%e.length]}${h.reset} ${a}`)},s=setInterval(r,80);return{update:n=>{a=n},log:n=>{i(),console.log(` ${h.dim}\u2502${h.reset} ${n}`),r()},stop:n=>{clearInterval(s),i(),n&&console.log(` ${n}`)}}}function U(o){G()?np(o):console.log(JSON.stringify(o,null,2))}function re(o,e){G()?(console.log(` ${h.green}\u2713${h.reset} ${o}`),e&&np(e,4)):console.log(JSON.stringify({success:!0,message:o,...e&&typeof e=="object"?e:{data:e}}))}function z(o,e){G()?(console.error(` ${h.red}\u2717${h.reset} ${o}`),e&&np(e,4)):console.error(JSON.stringify({success:!1,error:o,details:e}))}function g6(o){G()&&console.log(` ${h.yellow}\u26A0${h.reset} ${o}`)}function go(o){G()&&console.log(` ${h.dim}${o}${h.reset}`)}function Za(o){G()&&(console.log(`
|
|
1421
1421
|
${h.bold}${h.cyan}${o}${h.reset}`),console.log(` ${h.dim}${"\u2500".repeat(o.length)}${h.reset}`))}function ha(o,e,t){if(!G()){console.log(JSON.stringify({success:!0,total:t?.total??o.length,items:o}));return}if(o.length===0){console.log(`
|
|
1422
1422
|
${h.dim}0 results${h.reset}
|
|
1423
1423
|
`);return}let a=e||Object.keys(o[0]),i=Et()?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 s=a.map((l,u)=>`${h.bold}${h.cyan}${l.toUpperCase().padEnd(r[u])}${h.reset}`).join(" ");console.log(` ${s}`);let n=r.map(l=>`${h.dim}${"\u2500".repeat(l)}${h.reset}`).join(`${h.dim}\u2500\u2500${h.reset}`);console.log(` ${n}`);for(let l of o){let u=a.map((d,g)=>{let p=String(l[d]??"").replace(/[\n\r]+/g," ").trim();if(p.length>i){let A=`\u2026 (${p.length})`;p=p.slice(0,Math.max(0,i-A.length))+`${h.dim}${A}${h.reset}`}return d==="status"?`${{success:h.green,running:h.yellow,failed:h.red,aborted:h.red,error:h.red,pending:h.dim}[p.toLowerCase()]||""}${p.padEnd(r[g])}${h.reset}`:p.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(`
|