@sazabi/cli 1.3.0-dev.g69f31b0 → 1.3.0-dev.g75025e4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8906,9 +8906,9 @@ Connect 1Password so Sazabi agents can work with your vaults and secrets through
|
|
|
8906
8906
|
|
|
8907
8907
|
- A 1Password account with permission to create a service account
|
|
8908
8908
|
- The 1Password CLI (\`op\`) sandbox preset, since no hosted MCP endpoint is available yet
|
|
8909
|
-
`.trim()});import{dirname as M9e,resolve as z9e}from"node:path";import{fileURLToPath as j9e}from"node:url";var U9e,tle,nle,F9e,ole,$9e,G9e,q9e,rle;var wN=h(()=>{Oe();oy();U9e=z9e(M9e(j9e(import.meta.url)),"../../../skills"),tle=["airbyte","agentcat","atlassian","attio","autumn","aws","axiom","better-stack","braintrust","calendly","cekura","checkly","circleback","clay","clerk","cloudflare","composio","context-dev","custom","datadog","deepwiki","elastic-cloud","exa","gcp","google-drive","grafana","granola","happenstance","herd","honeycomb","incident-io","intercom","langfuse","langsmith","linear","logfire","mercury","neon","notion","onepassword","paper","plug","posthog","plain","planetscale","pylon","railway","render","rentahuman","resend","respan","salesforce","secureframe","sentry","secureframe","signoz","slack","stripe","supabase","superhuman","the-context-company","vercel","x"],nle=a.enum(tle),F9e=a.object({readOnlyToolNames:a.array(a.string()).optional(),blockedToolNames:a.array(a.string()).optional(),defaultUnavailableReason:a.enum(ny).optional(),allowWriteTools:a.boolean().optional()}),ole=a.object({registrationEndpoint:a.string().url(),tokenEndpointAuthMethod:a.enum(ty).optional(),includeScopesInRegistration:a.boolean().optional()}),$9e=a.object({providerConfigKey:a.string().min(1),callbackPathSegment:a.string().min(1),authorizationUrl:a.string().url().optional(),tokenUrl:a.string().url().optional(),resourceUrl:a.string().url().optional(),useServerUrlAsResource:a.boolean().optional(),omitScopeFromAuthorizationUrl:a.boolean().optional(),authorizationUrlParams:a.record(a.string(),a.string()).optional(),defaultAccessTokenTtlSeconds:a.number().int().positive().optional(),dynamicClientRegistration:ole.optional()}),G9e=a.object({label:a.string().min(1),serverUrl:a.string().url(),authorizationUrl:a.string().url().optional(),tokenUrl:a.string().url().optional(),resourceUrl:a.string().url().optional(),dynamicClientRegistration:ole.optional()}),q9e=a.object({id:a.string().min(1),title:a.string().min(1),description:a.string().optional(),body:a.string().min(1),fieldKeys:a.array(a.string().min(1)).optional(),imageKeys:a.array(a.string().min(1)).optional()}),rle=a.object({id:a.string().min(1),label:a.string().min(1),iconKey:nle,defaultServerUrl:a.string().url().nullable(),serverUrlPathSuffixMaxSegments:a.number().int().positive().optional(),serverUrlHostnameSuffixes:a.array(a.string().min(2)).optional(),transport:a.enum(BB),authMode:a.enum(OB),availability:a.enum(nl),oauth:$9e.optional(),regions:a.array(G9e).optional(),capabilityOverrides:F9e.optional(),helpText:a.string().optional(),setupGroups:a.array(q9e).optional(),evidenceHints:a.array(a.string().min(1)).optional(),skill:a.string().min(1).optional(),setupSkill:a.string().min(1).optional(),scopesUserSelectable:a.boolean().optional()})});var U=(e)=>({...rle.parse(e),...e.getAvailableScopes?{getAvailableScopes:e.getAvailableScopes}:{},...e.getUrlConfiguration?{getUrlConfiguration:e.getUrlConfiguration}:{},...e.validateCredentials?{validateCredentials:e.validateCredentials}:{},...e.normalizeHeaders?{normalizeHeaders:e.normalizeHeaders}:{}});var de=h(()=>{wN()});var ile;var sle=h(()=>{de();ile=U({id:"agentcat",label:"AgentCat",iconKey:"agentcat",defaultServerUrl:"https://mcp.agentcat.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"agentcat",callbackPathSegment:"agentcat",authorizationUrl:"https://api.agentcat.com/oauth/authorize/",tokenUrl:"https://api.agentcat.com/oauth/token/",dynamicClientRegistration:{registrationEndpoint:"https://api.agentcat.com/oauth/register/",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"mcpcat:read",label:"Read",description:"Read AgentCat project, session, issue, and metric data."},{value:"mcpcat:write",label:"Write",description:"Create and update AgentCat issues and project data."}],capabilityOverrides:{allowWriteTools:!0},helpText:"Inspect agent usage analytics and debug AgentCat issues."})});var ale;var cle=h(()=>{de();ale=U({id:"airbyte",label:"Airbyte",iconKey:"airbyte",defaultServerUrl:"https://mcp.airbyte.ai/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"airbyte",callbackPathSegment:"airbyte",authorizationUrl:"https://mcp.airbyte.ai/authorize",tokenUrl:"https://mcp.airbyte.ai/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.airbyte.ai/register",tokenEndpointAuthMethod:"client_secret_post"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,capabilityOverrides:{defaultUnavailableReason:"write_blocked"},evidenceHints:["Airbyte Agent Engine usage (mcp.airbyte.ai) or embedded agent connectors","AIRBYTE_* environment variables or Airbyte agent/connector client code","README/docs naming Airbyte for agent connectors to CRM, support, or analytics platforms"],helpText:"Read and write records on the third-party platforms (CRM, support desk, analytics, billing, databases) you have connected in your Airbyte Agent Engine workspace. Requires an Airbyte Agent Engine workspace with connectors already configured.",skill:"airbyte",setupSkill:"airbyte-setup"})});var lle;var ule=h(()=>{de();lle=U({id:"atlassian",label:"Atlassian",iconKey:"atlassian",defaultServerUrl:"https://mcp.atlassian.com/v1/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"atlassian",callbackPathSegment:"atlassian",authorizationUrl:"https://mcp.atlassian.com/v1/authorize",tokenUrl:"https://cf.mcp.atlassian.com/v1/token",dynamicClientRegistration:{registrationEndpoint:"https://cf.mcp.atlassian.com/v1/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["atlassian.com, Jira, Confluence, Jira Service Management, Compass, or Bitbucket links","Jira or Confluence project keys, issue keys, or workspace documentation","ATLASSIAN_* environment variables or scripts that call Atlassian APIs"],helpText:"Search and manage Jira, Confluence, Jira Service Management, Compass, and Bitbucket. During authorization, pick the Atlassian site you want to connect.",skill:"atlassian",setupSkill:"atlassian-setup"})});var dle;var ple=h(()=>{de();dle=U({id:"attio",label:"Attio",iconKey:"attio",defaultServerUrl:"https://mcp.attio.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"attio",callbackPathSegment:"attio",authorizationUrl:"https://app.attio.com/oidc/authorize",tokenUrl:"https://app.attio.com/oidc/token",dynamicClientRegistration:{registrationEndpoint:"https://app.attio.com/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"mcp",label:"MCP access",description:"Read and manage Attio CRM records, lists, tasks, notes, and meetings."},{value:"openid",required:!0},{value:"offline_access",required:!0}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["attio.com links, Attio workspace docs, or ATTIO_* environment variables","CRM account/contact workflows that reference Attio objects, lists, or tasks","README/docs naming Attio as the CRM or customer system of record"],helpText:"Search and manage Attio CRM records, lists, tasks, notes, and meetings. During authorization, pick the Attio workspace you want to connect.",skill:"attio",setupSkill:"attio-setup"})});var gle;var mle=h(()=>{_t();de();gle=U({id:"autumn",label:"Autumn",iconKey:"autumn",defaultServerUrl:"https://mcp.useautumn.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["useautumn.com / autumn-js SDK usage, AUTUMN_SECRET_KEY (am_sk_) environment variables, or an api.useautumn.com base URL","Autumn billing/pricing calls such as attach, check, track, or entitlement gating in code","README/docs naming Autumn for pricing, plans, features, credits, or usage-based billing on top of Stripe"],helpText:"Manage Autumn billing and pricing — customers, plans, features, balances, usage, and subscriptions — using an Autumn secret key.",setupGroups:[{id:"api-key",title:"Create an Autumn secret key",description:"Copy the Autumn secret key Sazabi will send to Autumn's hosted MCP endpoint.",body:"In the [Autumn dashboard](https://app.useautumn.com), open **Developer > API Keys** and copy a secret key (`am_sk_...`). Use a sandbox key to explore and a production key for live billing data. Sazabi stores it securely and sends it as `Authorization: Bearer <key>` to Autumn's MCP endpoint.",fieldKeys:["apiKey"]}],validateCredentials:Gce,normalizeHeaders:Fce})});var iS,iLt,hle;var sS=h(()=>{de();iS=[{value:"us-east-1",label:"US East (N. Virginia) — us-east-1"},{value:"eu-central-1",label:"Europe (Frankfurt) — eu-central-1"}],iLt=new Set(iS.map((e)=>e.value)),hle=U({id:"aws",label:"AWS",iconKey:"aws",defaultServerUrl:"https://aws-mcp.us-east-1.api.aws/mcp",transport:"streamable-http",authMode:"aws-sigv4",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["AWS SDK usage, aws-cli, or AWS_* environment variables in code or config","CloudFormation/CDK/Terraform AWS resources, ECS/Lambda/S3/CloudWatch usage","README/runbooks naming AWS as the cloud platform"],helpText:"Query the AWS-managed AWS MCP server (AWS documentation and AWS API operations) using AWS IAM credentials. Sazabi signs each request with SigV4, so no local proxy is required.",setupGroups:[{id:"iam-credentials",title:"Create scoped IAM credentials",description:"Provide IAM credentials whose permissions match exactly what the agent should be able to do.",body:"In the AWS Console, create an IAM user or role with only the permissions Sazabi should use (for example read-only access via `ReadOnlyAccess`, or a scoped custom policy), then generate an access key. Paste the **Access key ID** and **Secret access key** below. For temporary credentials from an assumed role, also paste the **Session token**. Prefer short-lived, least-privilege credentials.",fieldKeys:["accessKeyId","secretAccessKey","sessionToken"]},{id:"region",title:"Choose the AWS region",description:"The AWS MCP server is region-scoped; pick the region to target.",body:"Select the region where AWS hosts the AWS MCP endpoint. AWS currently offers the AWS MCP server in **US East (N. Virginia) — us-east-1** and **Europe (Frankfurt) — eu-central-1** only. Sazabi builds the `https://aws-mcp.<region>.api.aws/mcp` server URL from your choice and scopes SigV4 signing to it. This is the endpoint region, not the AWS region your API operations target.",fieldKeys:["region"]}]})});var Ale;var fle=h(()=>{de();Ale=U({id:"axiom",label:"Axiom",iconKey:"axiom",defaultServerUrl:"https://mcp.axiom.co/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"axiom",callbackPathSegment:"axiom",authorizationUrl:"https://mcp.axiom.co/authorize",tokenUrl:"https://mcp.axiom.co/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.axiom.co/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,getUrlConfiguration:async()=>({docsUrl:"https://axiom.co/docs/console/intelligence/mcp-server",instructions:"Copy the hosted MCP server URL below. If you belong to more than one Axiom organization, append ?org-id=<id> to target a specific organization.",defaultServerUrl:"https://mcp.axiom.co/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Axiom datasets, APL queries, AXIOM_* environment variables, or axiom CLI usage","Log drains or dashboards documented in Axiom","README/docs naming Axiom as a log or event analytics backend"],helpText:"Query Axiom datasets and logs with APL to investigate production events and incidents."})});var yle;var ble=h(()=>{de();yle=U({id:"better-stack",label:"Better Stack",iconKey:"better-stack",defaultServerUrl:"https://mcp.betterstack.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"better-stack",callbackPathSegment:"better-stack",authorizationUrl:"https://betterstack.com/oauth/authorize",tokenUrl:"https://betterstack.com/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://betterstack.com/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"read",label:"Read",description:"Read Better Stack incidents, monitors, log sources, and telemetry."},{value:"write",label:"Write",description:"Acknowledge, resolve, and manage Better Stack incidents."}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Better Stack / Better Uptime monitors, heartbeats, or status pages","BETTERSTACK_* or LOGTAIL_* environment variables, or Logtail/Better Stack log drains","README/docs naming Better Stack for uptime monitoring, incidents, or log management"],helpText:"Browse Better Stack incidents, monitors, and log sources, build telemetry queries to investigate production issues, and acknowledge, resolve, and manage incidents."})});var Ile;var Sle=h(()=>{_t();de();Ile=U({id:"braintrust",label:"Braintrust",iconKey:"braintrust",defaultServerUrl:"https://api.braintrust.dev/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["braintrust or autoevals packages, or BRAINTRUST_API_KEY environment variables","Braintrust eval/logging/tracing usage in code or CI (e.g. braintrust eval)","README/docs naming Braintrust for LLM evals, prompt/experiment tracking, or observability"],helpText:"Query Braintrust experiments, datasets, prompts, and logs using a Braintrust API key.",setupGroups:[{id:"api-key",title:"Create a Braintrust API key",description:"Generate the Braintrust API key the hosted MCP server will use.",body:"In Braintrust, go to **Settings > API keys** (https://www.braintrust.dev/app/settings/api-keys) and create an API key. Copy the generated key.",fieldKeys:["apiKey"]},{id:"data-plane",title:"Choose your Braintrust data plane",description:"Pick the region where your Braintrust data lives so Sazabi connects to the matching endpoint.",body:"Select **US** (`https://api.braintrust.dev/mcp`) or **EU** (`https://api-eu.braintrust.dev/mcp`) to match where your Braintrust data lives.",fieldKeys:["dataPlane"]}],validateCredentials:xce,normalizeHeaders:kce})});var Cle;var vle=h(()=>{de();Cle=U({id:"calendly",label:"Calendly",iconKey:"calendly",defaultServerUrl:"https://mcp.calendly.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"calendly",callbackPathSegment:"calendly",authorizationUrl:"https://calendly.com/oauth/authorize",tokenUrl:"https://calendly.com/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://calendly.com/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["calendly.com scheduling links or Calendly webhook handlers","CALENDLY_* environment variables or API integrations","README/docs naming Calendly for customer calls, interviews, or demos"],helpText:"Check availability, create scheduling links, and manage meetings in Calendly."})});var wle;var Ele=h(()=>{_t();de();wle=U({id:"cekura",label:"Cekura",iconKey:"cekura",defaultServerUrl:"https://api.cekura.ai/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",evidenceHints:["Cekura workflow tests, monitor configs, or CEKURA_* environment variables","Agent evaluation or production monitor docs naming Cekura","Synthetic user-flow tests for AI agents"],helpText:"Test, monitor, and evaluate AI agent workflows with Cekura.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the API key Sazabi will send to Cekura's hosted MCP endpoint.",body:"In the Cekura dashboard, open **Settings > API Keys** and create or copy a project-scoped [API key](https://dashboard.cekura.ai/settings/org/api-key), then paste it below.",fieldKeys:["apiKey"]}],validateCredentials:Zce})});var kle;var xle=h(()=>{de();kle=U({id:"checkly",label:"Checkly MCP",iconKey:"checkly",defaultServerUrl:"https://api.checklyhq.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"checkly",callbackPathSegment:"checkly"},getAvailableScopes:async()=>[{value:"checkly:account:read"},{value:"checkly:account:invite"},{value:"checkly:checks:read"},{value:"checkly:checks:run"},{value:"checkly:incidents:read"},{value:"checkly:incidents:write"},{value:"checkly:environment-variables:read"},{value:"checkly:environment-variables:write"},{value:"checkly:status-pages:read"},{value:"checkly:rca:read"},{value:"checkly:rca:run"},{value:"checkly:test-sessions:read"},{value:"checkly:assets:read"}],scopesUserSelectable:!1,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["checkly.config.ts/js, __checks__ directories, @checkly/cli, or CHECKLY_* environment variables","README/docs naming Checkly for synthetic monitoring, API checks, or browser checks","Runbooks that inspect Checkly check results, test sessions, RCA, status pages, or incidents"],helpText:"Query Checkly synthetic monitoring (checks, check results, test sessions, RCA, status pages, and incidents) over Checkly's official OAuth MCP server. Disabled until Sazabi has a Checkly-approved OAuth client, because Checkly rejects Dynamic Client Registration."})});var Ple;var Rle=h(()=>{de();Ple=U({id:"circleback",label:"Circleback",iconKey:"circleback",defaultServerUrl:"https://circleback.ai/api/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"circleback",callbackPathSegment:"circleback",authorizationUrl:"https://circleback.ai/api/oauth/authorize",tokenUrl:"https://circleback.ai/api/oauth/access-token",dynamicClientRegistration:{registrationEndpoint:"https://circleback.ai/api/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["circleback.ai meeting links, Circleback notes exports, or CIRCLEBACK_* environment variables","Incident, customer-call, or product-feedback docs naming Circleback","Operational runbooks that refer to meeting notes or transcripts in Circleback"],helpText:"Search your Circleback meeting notes, transcripts, and action items."})});var Tle;var Ble=h(()=>{de();Tle=U({id:"clay",label:"Clay",iconKey:"clay",defaultServerUrl:"https://mcp.clay.earth/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"clay",callbackPathSegment:"clay",authorizationUrl:"https://mcp.clay.earth/authorize",tokenUrl:"https://mcp.clay.earth/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.clay.earth/register",tokenEndpointAuthMethod:"client_secret_post"}},getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"read",label:"Read access",description:"Read Clay contacts, interactions, notes, and workspace workflows."},{value:"write",label:"Write access",description:"Create and update Clay records and workspace workflows."}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Clay workflow URLs, clay.earth links, or CLAY_* environment variables","Outbound enrichment, lead routing, or contact workflow docs naming Clay","Code or scripts that sync contacts, notes, or workspace workflows with Clay"],helpText:"Search Clay contacts, interactions, notes, and workspace workflows, and create or update records and workflows."})});var Ole;var _le=h(()=>{de();Ole=U({id:"clerk",label:"Clerk",iconKey:"clerk",defaultServerUrl:"https://mcp.clerk.com/mcp",transport:"streamable-http",authMode:"none",availability:"enabled",capabilityOverrides:{readOnlyToolNames:["list_clerk_sdk_snippets","clerk_sdk_snippet"]},evidenceHints:["@clerk/* SDK imports, CLERK_SECRET_KEY / CLERK_PUBLISHABLE_KEY environment variables, or clerk.com URLs","Authentication, session, or organization/user management logic built on Clerk","README/docs naming Clerk for auth, sign-in flows, or user management"],helpText:"Search Clerk's public documentation and SDK implementation snippets via Clerk's hosted MCP server."})});var Dle;var Lle=h(()=>{de();Dle=U({id:"cloudflare",label:"Cloudflare",iconKey:"cloudflare",defaultServerUrl:"https://mcp.cloudflare.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"cloudflare",callbackPathSegment:"cloudflare",authorizationUrl:"https://mcp.cloudflare.com/authorize",tokenUrl:"https://mcp.cloudflare.com/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.cloudflare.com/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,regions:[{label:"Cloudflare API (all products, account-scoped)",serverUrl:"https://mcp.cloudflare.com/mcp"},{label:"Observability (Workers logs & analytics)",serverUrl:"https://observability.mcp.cloudflare.com/mcp",authorizationUrl:"https://observability.mcp.cloudflare.com/oauth/authorize",tokenUrl:"https://observability.mcp.cloudflare.com/token",dynamicClientRegistration:{registrationEndpoint:"https://observability.mcp.cloudflare.com/register",tokenEndpointAuthMethod:"none"}},{label:"Workers Bindings (D1, R2, KV, Workers)",serverUrl:"https://bindings.mcp.cloudflare.com/mcp",authorizationUrl:"https://bindings.mcp.cloudflare.com/oauth/authorize",tokenUrl:"https://bindings.mcp.cloudflare.com/token",dynamicClientRegistration:{registrationEndpoint:"https://bindings.mcp.cloudflare.com/register",tokenEndpointAuthMethod:"none"}},{label:"Workers Builds (CI/CD builds)",serverUrl:"https://builds.mcp.cloudflare.com/mcp",authorizationUrl:"https://builds.mcp.cloudflare.com/oauth/authorize",tokenUrl:"https://builds.mcp.cloudflare.com/token",dynamicClientRegistration:{registrationEndpoint:"https://builds.mcp.cloudflare.com/register",tokenEndpointAuthMethod:"none"}},{label:"Radar (Internet traffic insights)",serverUrl:"https://radar.mcp.cloudflare.com/mcp",authorizationUrl:"https://radar.mcp.cloudflare.com/oauth/authorize",tokenUrl:"https://radar.mcp.cloudflare.com/token",dynamicClientRegistration:{registrationEndpoint:"https://radar.mcp.cloudflare.com/register",tokenEndpointAuthMethod:"none"}}],capabilityOverrides:{allowWriteTools:!0},evidenceHints:["wrangler.toml / wrangler.jsonc, @cloudflare/* packages, or CLOUDFLARE_* environment variables","Cloudflare Workers, Pages, R2, D1, KV, or Durable Objects usage in code or config","README/runbooks naming Cloudflare as the CDN, edge, or Workers platform"],helpText:"By default, use Cloudflare's unified all-products API server (mcp.cloudflare.com), scoped by your account's permissions. Optionally pick a per-product server for observability logs and analytics, bindings (D1, R2, KV), builds, or Radar insights."})});var Qle;var Nle=h(()=>{_t();de();Qle=U({id:"cloudflare-api-token",label:"Cloudflare (API token)",iconKey:"cloudflare",defaultServerUrl:"https://mcp.cloudflare.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["wrangler.toml / wrangler.jsonc, @cloudflare/* packages, or CLOUDFLARE_* environment variables","Cloudflare Workers, Pages, R2, D1, KV, or Durable Objects usage in code or config","README/runbooks naming Cloudflare as the CDN, edge, or Workers platform"],helpText:"Query the Cloudflare API MCP server (Workers, DNS, zones, and more) using a Cloudflare API token instead of OAuth.",setupGroups:[{id:"api-token",title:"Create a Cloudflare API token",description:"Mint an API token scoped to exactly the products and permissions Sazabi should access.",body:"In the Cloudflare dashboard, go to **My Profile > API Tokens > Create Token**, then **Create Custom Token**. Under **Permissions**, add read access for the products you want the agent to use — for example **Account > Workers Observability > Read**, **Zone > DNS > Read**, and **Account > Account Settings > Read** — then copy the generated `cfut_...` token. Tokens with **Client IP Address Filtering** enabled are not supported by the hosted MCP server.",fieldKeys:["apiToken"]}],validateCredentials:Sce,normalizeHeaders:Ice})});var Mle;var zle=h(()=>{_t();de();Mle=U({id:"composio",label:"Composio",iconKey:"composio",defaultServerUrl:"https://connect.composio.dev/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Composio MCP, COMPOSIO_API_KEY, or Composio SDK usage","connect.composio.dev/mcp in MCP client configuration","README/docs naming Composio integrations, toolkits, or connected apps"],helpText:"Use tools from the Composio toolkits you have connected, through Composio's hosted Connect MCP server with a Composio API key.",setupGroups:[{id:"connect-toolkits",title:"Connect the toolkits you want to use",description:"Composio's MCP server only exposes tools for the apps you have connected in Composio.",body:"In the [Composio dashboard](https://dashboard.composio.dev), connect the apps (toolkits) you want the agent to use. Composio can also prompt to connect apps on demand at runtime, but connecting them first makes those tools available right away."},{id:"api-key",title:"Create an API key",description:"Create or copy the Composio API key Sazabi will send to Composio's hosted MCP endpoint.",body:"In the [Composio dashboard](https://dashboard.composio.dev), open **Settings > Project Settings** and copy your project API key from the **API Keys** section (or use the AI Clients page). Paste it below. Sazabi stores it securely and sends it as the `x-consumer-api-key` header to Composio's Connect MCP endpoint.",fieldKeys:["apiKey"]}],validateCredentials:Nce,normalizeHeaders:Qce})});var jle;var Ule=h(()=>{_t();de();jle=U({id:"context-dev",label:"Context.dev",iconKey:"context-dev",defaultServerUrl:"https://context-dev.stlmcp.com",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Context.dev SDK usage (context.dev on npm/PyPI/RubyGems), CONTEXT_DEV_API_KEY environment variables, or ctxt_secret_ API keys","context.dev-mcp usage or a context-dev.stlmcp.com server URL in MCP client config","README/docs naming Context.dev for brand intelligence, web scraping/crawling, or website change monitors"],helpText:"Resolve brand data, scrape and crawl websites into LLM-ready Markdown, extract structured data, and manage website-change monitors with Context.dev's hosted MCP server using your Context.dev API key.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the Context.dev API key Sazabi will send to Context.dev's hosted MCP endpoint.",body:"Create or copy an API key (`ctxt_secret_...`) from your [Context.dev dashboard](https://context.dev), then paste it below. Sazabi stores it securely and sends it as the `x-context-dev-api-key` header to Context.dev's MCP endpoint.",fieldKeys:["apiKey"]}],validateCredentials:Uce,normalizeHeaders:jce,skill:"context-dev",setupSkill:"context-dev-setup"})});var Fle;var $le=h(()=>{_t();de();Fle=U({id:"datadog",label:"Datadog",iconKey:"datadog",defaultServerUrl:"https://mcp.datadoghq.com/api/unstable/mcp-server/mcp?toolsets=core",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Datadog config, DD_* environment variables, or @datadog packages","datadog-agent, dd-trace, monitors, dashboards, or incident docs","README/docs naming Datadog for logs, metrics, traces, APM, or incidents"],helpText:"Browse Datadog metrics, logs, traces, and incidents using your Datadog site URL, API key, and Application Key.",setupGroups:[{id:"site",title:"Find your Datadog site",description:"Use the Datadog site URL for the region where your account lives.",body:"Copy the Datadog site URL from the top of your browser, such as `https://app.datadoghq.com` or `https://us3.datadoghq.com`. Sazabi uses this to build the matching hosted MCP endpoint.",fieldKeys:["siteUrl"]},{id:"keys",title:"Create API credentials",description:"Create or copy the two Datadog keys Sazabi needs for hosted MCP.",imageKeys:["mcp.datadog.api-keys-settings","mcp.datadog.application-keys-settings"],body:"In Datadog, go to **Organization Settings > Access > API Keys** to create or copy your API key. Then go to **Organization Settings > Access > Application Keys** to create or copy your Application Key. Note: an Application Key inherits the permissions of the user who creates it, so create it as a least-privilege user or scope the key down to only what the agent needs.",fieldKeys:["apiKey","applicationKey"]}],validateCredentials:bce,normalizeHeaders:fce})});var Gle;var qle=h(()=>{de();Gle=U({id:"deepwiki",label:"DeepWiki",iconKey:"deepwiki",defaultServerUrl:"https://mcp.deepwiki.com/mcp",transport:"streamable-http",authMode:"none",availability:"enabled",capabilityOverrides:{readOnlyToolNames:["read_wiki_structure","read_wiki_contents","ask_question"]},evidenceHints:["Questions about how a public GitHub repository or open-source dependency works","deepwiki.com URLs or references to DeepWiki-generated documentation","Investigations needing up-to-date docs/architecture for a third-party OSS project"],helpText:"Query public GitHub repository documentation and ask questions about open-source code via DeepWiki's hosted MCP server."})});var Hle;var Vle=h(()=>{_t();de();Hle=U({id:"elastic-cloud",label:"Elastic Cloud",iconKey:"elastic-cloud",defaultServerUrl:null,serverUrlHostnameSuffixes:[".elastic.cloud",".cloud.es.io",".elastic-cloud.com"],transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Elasticsearch, Kibana, Elastic Agent, Beats, or Logstash config","ELASTIC_* environment variables or elasticsearch client packages","README/docs naming Elastic Cloud, Elasticsearch, or Kibana"],helpText:"Search Elasticsearch indices and query Elastic Agent Builder tools using your Kibana MCP endpoint and an Elastic API key.",setupGroups:[{id:"deployment",title:"Open Kibana",description:"Find the Kibana URL for the Elastic deployment you want to connect.",body:"Go to [Elastic Cloud deployments](https://cloud.elastic.co/deployments), open the deployment you want to connect, then open Kibana and copy the Kibana base URL from the browser. If your Kibana URL contains `/s/<space>/`, keep that space value for the connect step.",fieldKeys:["kibanaUrl","kibanaSpace"]},{id:"api-key",title:"Create an API key",description:"Create the Elastic API key that the hosted MCP server will use.",body:"In Kibana, go to **Stack Management > API keys** and choose **Create API key**. Restrict its privileges to the Agent Builder MCP server: the `feature_agentBuilder.read` and `feature_actions.read` Kibana privileges, plus read access to the indices your tools query. Copy the generated key.",fieldKeys:["apiKey"]}],validateCredentials:yce,normalizeHeaders:Ace})});var Kle;var Yle=h(()=>{_t();de();Kle=U({id:"exa",label:"Exa",iconKey:"exa",defaultServerUrl:"https://mcp.exa.ai/mcp?tools=web_search_exa,web_fetch_exa,web_search_advanced_exa,agent_tools",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Exa search, EXA_API_KEY environment variables, or the exa-js / exa-py SDK","exa-mcp-server usage or a mcp.exa.ai server URL in MCP client config","README/docs naming Exa for web search, crawling, or research"],helpText:"Search the web, research companies, crawl pages, and run deep research with Exa's hosted MCP server using your Exa API key.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the Exa API key Sazabi will send to Exa's hosted MCP endpoint.",body:"Create or copy an API key from the [Exa dashboard](https://dashboard.exa.ai/api-keys), then paste it below. Sazabi stores it securely and sends it as the `x-api-key` header to Exa's MCP endpoint.",fieldKeys:["apiKey"]}],validateCredentials:Lce,normalizeHeaders:Dce,skill:"exa",setupSkill:"exa-setup"})});var Wle;var Jle=h(()=>{_t();de();Wle=U({id:"gcp",label:"Google Cloud (GCP)",iconKey:"gcp",defaultServerUrl:"https://logging.googleapis.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["GOOGLE_APPLICATION_CREDENTIALS, GCLOUD_PROJECT, or GOOGLE_CLOUD_PROJECT environment variables","gcloud config, app.yaml, cloudbuild.yaml, or @google-cloud/* packages","README/docs naming Google Cloud, GCP, Cloud Logging, Cloud Monitoring, BigQuery, Cloud Run, or GKE"],helpText:"Query Google Cloud (Cloud Logging, Monitoring, BigQuery, and more) using a Google OAuth 2.0 Bearer access token.",setupGroups:[{id:"server-url",title:"Choose the Google Cloud MCP endpoint",description:"Google exposes a separate remote MCP server per product at https://SERVICE.googleapis.com/mcp.",body:"Sazabi defaults to Cloud Logging (`https://logging.googleapis.com/mcp`). To use a different product, replace the server URL with its endpoint, such as `https://monitoring.googleapis.com/mcp` (Cloud Monitoring) or `https://bigquery.googleapis.com/mcp` (BigQuery). See the [supported products list](https://docs.cloud.google.com/mcp/supported-products)."},{id:"access-token",title:"Create a Google OAuth 2.0 access token",description:"Generate a Google access token scoped by IAM to the resources Sazabi should read.",body:"The hosted servers authenticate with a Google OAuth 2.0 Bearer access token. For a non-interactive token, install the [gcloud CLI](https://docs.cloud.google.com/mcp/authenticate-mcp), configure Application Default Credentials (a user login, service-account key, or impersonation), then run `gcloud auth application-default print-access-token` and copy the token. Paste the raw token into Sazabi — Sazabi adds the `Bearer ` prefix and sends it in the `Authorization` header. Google access tokens are short-lived, so refresh the token when it expires.",fieldKeys:["accessToken"]}],validateCredentials:Jce,normalizeHeaders:Wce})});var Zle;var Xle=h(()=>{de();Zle=U({id:"google-drive",label:"Google Drive",iconKey:"google-drive",defaultServerUrl:"https://drivemcp.googleapis.com/mcp/v1",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"google-drive",callbackPathSegment:"google-drive",authorizationUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",authorizationUrlParams:{access_type:"offline",prompt:"consent"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"https://www.googleapis.com/auth/drive.readonly",label:"Drive read",description:"Read files and metadata in the user's Google Drive through the hosted MCP server."}],setupGroups:[{id:"google-cloud-oauth-client",title:"Create an OAuth client in Google Cloud",description:"The Google Drive MCP server does not support automatic client registration. An admin must create an OAuth client in a Google Cloud project and provide its credentials to Sazabi.",body:["1. In the Google Cloud console, open **APIs & Services → OAuth consent screen** and configure the consent screen with the Drive scopes.","2. Under **APIs & Services → Credentials**, create an **OAuth client ID** of type **Web application**.","3. Add the Sazabi Google Drive MCP callback URL shown on this page as an **Authorized redirect URI**.","4. Enable both the **Google Drive API** and the **Google Drive MCP API** (`drivemcp.googleapis.com`) for the project. Both are required for the hosted MCP server to be reachable.","5. Provide the generated **Client ID** and **Client Secret** to your Sazabi deployment configuration."].join(`
|
|
8909
|
+
`.trim()});import{dirname as M9e,resolve as z9e}from"node:path";import{fileURLToPath as j9e}from"node:url";var U9e,tle,nle,F9e,ole,$9e,G9e,q9e,rle;var wN=h(()=>{Oe();oy();U9e=z9e(M9e(j9e(import.meta.url)),"../../../skills"),tle=["airbyte","agentcat","atlassian","attio","autumn","aws","axiom","better-stack","braintrust","calendly","cekura","checkly","circleback","clay","clerk","cloudflare","composio","context-dev","custom","datadog","deepwiki","elastic-cloud","exa","gcp","google-drive","grafana","granola","happenstance","herd","honeycomb","incident-io","intercom","langfuse","langsmith","linear","logfire","mercury","neon","notion","onepassword","paper","plug","posthog","plain","planetscale","pylon","railway","render","rentahuman","resend","respan","salesforce","secureframe","sentry","secureframe","signoz","slack","stripe","supabase","superhuman","the-context-company","vercel","x"],nle=a.enum(tle),F9e=a.object({readOnlyToolNames:a.array(a.string()).optional(),blockedToolNames:a.array(a.string()).optional(),defaultUnavailableReason:a.enum(ny).optional(),allowWriteTools:a.boolean().optional()}),ole=a.object({registrationEndpoint:a.string().url(),tokenEndpointAuthMethod:a.enum(ty).optional(),includeScopesInRegistration:a.boolean().optional()}),$9e=a.object({providerConfigKey:a.string().min(1),callbackPathSegment:a.string().min(1),authorizationUrl:a.string().url().optional(),tokenUrl:a.string().url().optional(),resourceUrl:a.string().url().optional(),useServerUrlAsResource:a.boolean().optional(),omitScopeFromAuthorizationUrl:a.boolean().optional(),authorizationUrlParams:a.record(a.string(),a.string()).optional(),defaultAccessTokenTtlSeconds:a.number().int().positive().optional(),dynamicClientRegistration:ole.optional()}),G9e=a.object({label:a.string().min(1),serverUrl:a.string().url(),authorizationUrl:a.string().url().optional(),tokenUrl:a.string().url().optional(),resourceUrl:a.string().url().optional(),dynamicClientRegistration:ole.optional()}),q9e=a.object({id:a.string().min(1),title:a.string().min(1),description:a.string().optional(),body:a.string().min(1),fieldKeys:a.array(a.string().min(1)).optional(),imageKeys:a.array(a.string().min(1)).optional()}),rle=a.object({id:a.string().min(1),label:a.string().min(1),iconKey:nle,defaultServerUrl:a.string().url().nullable(),serverUrlPathSuffixMaxSegments:a.number().int().positive().optional(),serverUrlHostnameSuffixes:a.array(a.string().min(2)).optional(),transport:a.enum(BB),authMode:a.enum(OB),availability:a.enum(nl),oauth:$9e.optional(),regions:a.array(G9e).optional(),capabilityOverrides:F9e.optional(),helpText:a.string().optional(),setupGroups:a.array(q9e).optional(),evidenceHints:a.array(a.string().min(1)).optional(),skill:a.string().min(1).optional(),setupSkill:a.string().min(1).optional(),scopesUserSelectable:a.boolean().optional()})});var U=(e)=>({...rle.parse(e),...e.getAvailableScopes?{getAvailableScopes:e.getAvailableScopes}:{},...e.getUrlConfiguration?{getUrlConfiguration:e.getUrlConfiguration}:{},...e.validateCredentials?{validateCredentials:e.validateCredentials}:{},...e.normalizeHeaders?{normalizeHeaders:e.normalizeHeaders}:{}});var de=h(()=>{wN()});var ile;var sle=h(()=>{de();ile=U({id:"agentcat",label:"AgentCat",iconKey:"agentcat",defaultServerUrl:"https://mcp.agentcat.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"agentcat",callbackPathSegment:"agentcat",authorizationUrl:"https://api.agentcat.com/oauth/authorize/",tokenUrl:"https://api.agentcat.com/oauth/token/",dynamicClientRegistration:{registrationEndpoint:"https://api.agentcat.com/oauth/register/",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"mcpcat:read",label:"Read",description:"Read AgentCat project, session, issue, and metric data."},{value:"mcpcat:write",label:"Write",description:"Create and update AgentCat issues and project data."}],capabilityOverrides:{allowWriteTools:!0},helpText:"Inspect agent usage analytics and debug AgentCat issues."})});var ale;var cle=h(()=>{de();ale=U({id:"airbyte",label:"Airbyte",iconKey:"airbyte",defaultServerUrl:"https://mcp.airbyte.ai/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"airbyte",callbackPathSegment:"airbyte",authorizationUrl:"https://mcp.airbyte.ai/authorize",tokenUrl:"https://mcp.airbyte.ai/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.airbyte.ai/register",tokenEndpointAuthMethod:"client_secret_post"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,capabilityOverrides:{defaultUnavailableReason:"write_blocked"},evidenceHints:["Airbyte Agent Engine usage (mcp.airbyte.ai) or embedded agent connectors","AIRBYTE_* environment variables or Airbyte agent/connector client code","README/docs naming Airbyte for agent connectors to CRM, support, or analytics platforms"],helpText:"Read and write records on the third-party platforms (CRM, support desk, analytics, billing, databases) you have connected in your Airbyte Agent Engine workspace. Requires an Airbyte Agent Engine workspace with connectors already configured.",skill:"airbyte",setupSkill:"airbyte-setup"})});var lle;var ule=h(()=>{de();lle=U({id:"atlassian",label:"Atlassian",iconKey:"atlassian",defaultServerUrl:"https://mcp.atlassian.com/v1/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"atlassian",callbackPathSegment:"atlassian",authorizationUrl:"https://mcp.atlassian.com/v1/authorize",tokenUrl:"https://cf.mcp.atlassian.com/v1/token",dynamicClientRegistration:{registrationEndpoint:"https://cf.mcp.atlassian.com/v1/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["atlassian.com, Jira, Confluence, Jira Service Management, Compass, or Bitbucket links","Jira or Confluence project keys, issue keys, or workspace documentation","ATLASSIAN_* environment variables or scripts that call Atlassian APIs"],helpText:"Search and manage Jira, Confluence, Jira Service Management, Compass, and Bitbucket. During authorization, pick the Atlassian site you want to connect.",skill:"atlassian",setupSkill:"atlassian-setup"})});var dle;var ple=h(()=>{de();dle=U({id:"attio",label:"Attio",iconKey:"attio",defaultServerUrl:"https://mcp.attio.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"attio",callbackPathSegment:"attio",authorizationUrl:"https://app.attio.com/oidc/authorize",tokenUrl:"https://app.attio.com/oidc/token",dynamicClientRegistration:{registrationEndpoint:"https://app.attio.com/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"mcp",label:"MCP access",description:"Read and manage Attio CRM records, lists, tasks, notes, and meetings."},{value:"openid",required:!0},{value:"offline_access",required:!0}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["attio.com links, Attio workspace docs, or ATTIO_* environment variables","CRM account/contact workflows that reference Attio objects, lists, or tasks","README/docs naming Attio as the CRM or customer system of record"],helpText:"Search and manage Attio CRM records, lists, tasks, notes, and meetings. During authorization, pick the Attio workspace you want to connect.",skill:"attio",setupSkill:"attio-setup"})});var gle;var mle=h(()=>{_t();de();gle=U({id:"autumn",label:"Autumn",iconKey:"autumn",defaultServerUrl:"https://mcp.useautumn.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["useautumn.com / autumn-js SDK usage, AUTUMN_SECRET_KEY (am_sk_) environment variables, or an api.useautumn.com base URL","Autumn billing/pricing calls such as attach, check, track, or entitlement gating in code","README/docs naming Autumn for pricing, plans, features, credits, or usage-based billing on top of Stripe"],helpText:"Manage Autumn billing and pricing — customers, plans, features, balances, usage, and subscriptions — using an Autumn secret key.",setupGroups:[{id:"api-key",title:"Create an Autumn secret key",description:"Copy the Autumn secret key Sazabi will send to Autumn's hosted MCP endpoint.",body:"In the [Autumn dashboard](https://app.useautumn.com), open **Developer > API Keys** and copy a secret key (`am_sk_...`). Use a sandbox key to explore and a production key for live billing data. Sazabi stores it securely and sends it as `Authorization: Bearer <key>` to Autumn's MCP endpoint.",fieldKeys:["apiKey"]}],validateCredentials:Gce,normalizeHeaders:Fce})});var iS,iLt,hle;var sS=h(()=>{de();iS=[{value:"us-east-1",label:"US East (N. Virginia) — us-east-1"},{value:"eu-central-1",label:"Europe (Frankfurt) — eu-central-1"}],iLt=new Set(iS.map((e)=>e.value)),hle=U({id:"aws",label:"AWS",iconKey:"aws",defaultServerUrl:"https://aws-mcp.us-east-1.api.aws/mcp",transport:"streamable-http",authMode:"aws-sigv4",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["AWS SDK usage, aws-cli, or AWS_* environment variables in code or config","CloudFormation/CDK/Terraform AWS resources, ECS/Lambda/S3/CloudWatch usage","README/runbooks naming AWS as the cloud platform"],helpText:"Query the AWS-managed AWS MCP server (AWS documentation and AWS API operations) using AWS IAM credentials. Sazabi signs each request with SigV4, so no local proxy is required.",setupGroups:[{id:"iam-credentials",title:"Create scoped IAM credentials",description:"Provide IAM credentials whose permissions match exactly what the agent should be able to do.",body:"In the AWS Console, create an IAM user or role with only the permissions Sazabi should use (for example read-only access via `ReadOnlyAccess`, or a scoped custom policy), then generate an access key. Paste the **Access key ID** and **Secret access key** below. For temporary credentials from an assumed role, also paste the **Session token**. Prefer short-lived, least-privilege credentials.",fieldKeys:["accessKeyId","secretAccessKey","sessionToken"]},{id:"region",title:"Choose the AWS region",description:"The AWS MCP server is region-scoped; pick the region to target.",body:"Select the region where AWS hosts the AWS MCP endpoint. AWS currently offers the AWS MCP server in **US East (N. Virginia) — us-east-1** and **Europe (Frankfurt) — eu-central-1** only. Sazabi builds the `https://aws-mcp.<region>.api.aws/mcp` server URL from your choice and scopes SigV4 signing to it. This is the endpoint region, not the AWS region your API operations target.",fieldKeys:["region"]}]})});var Ale;var fle=h(()=>{de();Ale=U({id:"axiom",label:"Axiom",iconKey:"axiom",defaultServerUrl:"https://mcp.axiom.co/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"axiom",callbackPathSegment:"axiom",authorizationUrl:"https://mcp.axiom.co/authorize",tokenUrl:"https://mcp.axiom.co/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.axiom.co/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,getUrlConfiguration:async()=>({docsUrl:"https://axiom.co/docs/console/intelligence/mcp-server",instructions:"Copy the hosted MCP server URL below. If you belong to more than one Axiom organization, append ?org-id=<id> to target a specific organization.",defaultServerUrl:"https://mcp.axiom.co/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Axiom datasets, APL queries, AXIOM_* environment variables, or axiom CLI usage","Log drains or dashboards documented in Axiom","README/docs naming Axiom as a log or event analytics backend"],helpText:"Query Axiom datasets and logs with APL to investigate production events and incidents."})});var yle;var ble=h(()=>{de();yle=U({id:"better-stack",label:"Better Stack",iconKey:"better-stack",defaultServerUrl:"https://mcp.betterstack.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"better-stack",callbackPathSegment:"better-stack",authorizationUrl:"https://betterstack.com/oauth/authorize",tokenUrl:"https://betterstack.com/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://betterstack.com/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"read",label:"Read",description:"Read Better Stack incidents, monitors, log sources, and telemetry."},{value:"write",label:"Write",description:"Acknowledge, resolve, and manage Better Stack incidents."}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Better Stack / Better Uptime monitors, heartbeats, or status pages","BETTERSTACK_* or LOGTAIL_* environment variables, or Logtail/Better Stack log drains","README/docs naming Better Stack for uptime monitoring, incidents, or log management"],helpText:"Browse Better Stack incidents, monitors, and log sources, build telemetry queries to investigate production issues, and acknowledge, resolve, and manage incidents."})});var Ile;var Sle=h(()=>{_t();de();Ile=U({id:"braintrust",label:"Braintrust",iconKey:"braintrust",defaultServerUrl:"https://api.braintrust.dev/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["braintrust or autoevals packages, or BRAINTRUST_API_KEY environment variables","Braintrust eval/logging/tracing usage in code or CI (e.g. braintrust eval)","README/docs naming Braintrust for LLM evals, prompt/experiment tracking, or observability"],helpText:"Query Braintrust experiments, datasets, prompts, and logs using a Braintrust API key.",setupGroups:[{id:"api-key",title:"Create a Braintrust API key",description:"Generate the Braintrust API key the hosted MCP server will use.",body:"In Braintrust, go to **Settings > API keys** (https://www.braintrust.dev/app/settings/api-keys) and create an API key. Copy the generated key.",fieldKeys:["apiKey"]},{id:"data-plane",title:"Choose your Braintrust data plane",description:"Pick the region where your Braintrust data lives so Sazabi connects to the matching endpoint.",body:"Select **US** (`https://api.braintrust.dev/mcp`) or **EU** (`https://api-eu.braintrust.dev/mcp`) to match where your Braintrust data lives.",fieldKeys:["dataPlane"]}],validateCredentials:xce,normalizeHeaders:kce})});var Cle;var vle=h(()=>{de();Cle=U({id:"calendly",label:"Calendly",iconKey:"calendly",defaultServerUrl:"https://mcp.calendly.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"calendly",callbackPathSegment:"calendly",authorizationUrl:"https://calendly.com/oauth/authorize",tokenUrl:"https://calendly.com/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://calendly.com/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["calendly.com scheduling links or Calendly webhook handlers","CALENDLY_* environment variables or API integrations","README/docs naming Calendly for customer calls, interviews, or demos"],helpText:"Check availability, create scheduling links, and manage meetings in Calendly."})});var wle;var Ele=h(()=>{_t();de();wle=U({id:"cekura",label:"Cekura",iconKey:"cekura",defaultServerUrl:"https://api.cekura.ai/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",evidenceHints:["Cekura workflow tests, monitor configs, or CEKURA_* environment variables","Agent evaluation or production monitor docs naming Cekura","Synthetic user-flow tests for AI agents"],helpText:"Test, monitor, and evaluate AI agent workflows with Cekura.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the API key Sazabi will send to Cekura's hosted MCP endpoint.",body:"In the Cekura dashboard, open **Settings > API Keys** and create or copy a project-scoped [API key](https://dashboard.cekura.ai/settings/org/api-key), then paste it below.",fieldKeys:["apiKey"]}],validateCredentials:Zce})});var kle;var xle=h(()=>{de();kle=U({id:"checkly",label:"Checkly MCP",iconKey:"checkly",defaultServerUrl:"https://api.checklyhq.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"checkly",callbackPathSegment:"checkly"},getAvailableScopes:async()=>[{value:"checkly:account:read"},{value:"checkly:account:invite"},{value:"checkly:checks:read"},{value:"checkly:checks:run"},{value:"checkly:incidents:read"},{value:"checkly:incidents:write"},{value:"checkly:environment-variables:read"},{value:"checkly:environment-variables:write"},{value:"checkly:status-pages:read"},{value:"checkly:rca:read"},{value:"checkly:rca:run"},{value:"checkly:test-sessions:read"},{value:"checkly:assets:read"}],scopesUserSelectable:!1,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["checkly.config.ts/js, __checks__ directories, @checkly/cli, or CHECKLY_* environment variables","README/docs naming Checkly for synthetic monitoring, API checks, or browser checks","Runbooks that inspect Checkly check results, test sessions, RCA, status pages, or incidents"],helpText:"Query Checkly synthetic monitoring (checks, check results, test sessions, RCA, status pages, and incidents) over Checkly's official OAuth MCP server. Disabled until Sazabi has a Checkly-approved OAuth client, because Checkly rejects Dynamic Client Registration."})});var Ple;var Rle=h(()=>{de();Ple=U({id:"circleback",label:"Circleback",iconKey:"circleback",defaultServerUrl:"https://circleback.ai/api/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"circleback",callbackPathSegment:"circleback",authorizationUrl:"https://circleback.ai/api/oauth/authorize",tokenUrl:"https://circleback.ai/api/oauth/access-token",dynamicClientRegistration:{registrationEndpoint:"https://circleback.ai/api/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["circleback.ai meeting links, Circleback notes exports, or CIRCLEBACK_* environment variables","Incident, customer-call, or product-feedback docs naming Circleback","Operational runbooks that refer to meeting notes or transcripts in Circleback"],helpText:"Search your Circleback meeting notes, transcripts, and action items."})});var Tle;var Ble=h(()=>{de();Tle=U({id:"clay",label:"Clay",iconKey:"clay",defaultServerUrl:"https://mcp.clay.earth/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"clay",callbackPathSegment:"clay",authorizationUrl:"https://mcp.clay.earth/authorize",tokenUrl:"https://mcp.clay.earth/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.clay.earth/register",tokenEndpointAuthMethod:"client_secret_post"}},getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"read",label:"Read access",description:"Read Clay contacts, interactions, notes, and workspace workflows."},{value:"write",label:"Write access",description:"Create and update Clay records and workspace workflows."}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Clay workflow URLs, clay.earth links, or CLAY_* environment variables","Outbound enrichment, lead routing, or contact workflow docs naming Clay","Code or scripts that sync contacts, notes, or workspace workflows with Clay"],helpText:"Search Clay contacts, interactions, notes, and workspace workflows, and create or update records and workflows."})});var Ole;var _le=h(()=>{de();Ole=U({id:"clerk",label:"Clerk",iconKey:"clerk",defaultServerUrl:"https://mcp.clerk.com/mcp",transport:"streamable-http",authMode:"none",availability:"enabled",capabilityOverrides:{readOnlyToolNames:["list_clerk_sdk_snippets","clerk_sdk_snippet"]},evidenceHints:["@clerk/* SDK imports, CLERK_SECRET_KEY / CLERK_PUBLISHABLE_KEY environment variables, or clerk.com URLs","Authentication, session, or organization/user management logic built on Clerk","README/docs naming Clerk for auth, sign-in flows, or user management"],helpText:"Search Clerk's public documentation and SDK implementation snippets via Clerk's hosted MCP server."})});var Dle;var Lle=h(()=>{de();Dle=U({id:"cloudflare",label:"Cloudflare",iconKey:"cloudflare",defaultServerUrl:"https://mcp.cloudflare.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"cloudflare",callbackPathSegment:"cloudflare",authorizationUrl:"https://mcp.cloudflare.com/authorize",tokenUrl:"https://mcp.cloudflare.com/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.cloudflare.com/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,regions:[{label:"Cloudflare API (all products, account-scoped)",serverUrl:"https://mcp.cloudflare.com/mcp"},{label:"Observability (Workers logs & analytics)",serverUrl:"https://observability.mcp.cloudflare.com/mcp",authorizationUrl:"https://observability.mcp.cloudflare.com/oauth/authorize",tokenUrl:"https://observability.mcp.cloudflare.com/token",dynamicClientRegistration:{registrationEndpoint:"https://observability.mcp.cloudflare.com/register",tokenEndpointAuthMethod:"none"}},{label:"Workers Bindings (D1, R2, KV, Workers)",serverUrl:"https://bindings.mcp.cloudflare.com/mcp",authorizationUrl:"https://bindings.mcp.cloudflare.com/oauth/authorize",tokenUrl:"https://bindings.mcp.cloudflare.com/token",dynamicClientRegistration:{registrationEndpoint:"https://bindings.mcp.cloudflare.com/register",tokenEndpointAuthMethod:"none"}},{label:"Workers Builds (CI/CD builds)",serverUrl:"https://builds.mcp.cloudflare.com/mcp",authorizationUrl:"https://builds.mcp.cloudflare.com/oauth/authorize",tokenUrl:"https://builds.mcp.cloudflare.com/token",dynamicClientRegistration:{registrationEndpoint:"https://builds.mcp.cloudflare.com/register",tokenEndpointAuthMethod:"none"}},{label:"Radar (Internet traffic insights)",serverUrl:"https://radar.mcp.cloudflare.com/mcp",authorizationUrl:"https://radar.mcp.cloudflare.com/oauth/authorize",tokenUrl:"https://radar.mcp.cloudflare.com/token",dynamicClientRegistration:{registrationEndpoint:"https://radar.mcp.cloudflare.com/register",tokenEndpointAuthMethod:"none"}}],capabilityOverrides:{allowWriteTools:!0},evidenceHints:["wrangler.toml / wrangler.jsonc, @cloudflare/* packages, or CLOUDFLARE_* environment variables","Cloudflare Workers, Pages, R2, D1, KV, or Durable Objects usage in code or config","README/runbooks naming Cloudflare as the CDN, edge, or Workers platform"],helpText:"By default, use Cloudflare's unified all-products API server (mcp.cloudflare.com), scoped by your account's permissions. Optionally pick a per-product server for observability logs and analytics, bindings (D1, R2, KV), builds, or Radar insights."})});var Qle;var Nle=h(()=>{_t();de();Qle=U({id:"cloudflare-api-token",label:"Cloudflare (API token)",iconKey:"cloudflare",defaultServerUrl:"https://mcp.cloudflare.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["wrangler.toml / wrangler.jsonc, @cloudflare/* packages, or CLOUDFLARE_* environment variables","Cloudflare Workers, Pages, R2, D1, KV, or Durable Objects usage in code or config","README/runbooks naming Cloudflare as the CDN, edge, or Workers platform"],helpText:"Query the Cloudflare API MCP server (Workers, DNS, zones, and more) using a Cloudflare API token instead of OAuth.",setupGroups:[{id:"api-token",title:"Create a Cloudflare API token",description:"Mint an API token scoped to exactly the products and permissions Sazabi should access.",body:"In the Cloudflare dashboard, go to **My Profile > API Tokens > Create Token**, then **Create Custom Token**. Under **Permissions**, add read access for the products you want the agent to use — for example **Account > Workers Observability > Read**, **Zone > DNS > Read**, and **Account > Account Settings > Read** — then copy the generated `cfut_...` token. Tokens with **Client IP Address Filtering** enabled are not supported by the hosted MCP server.",fieldKeys:["apiToken"]}],validateCredentials:Sce,normalizeHeaders:Ice})});var Mle;var zle=h(()=>{_t();de();Mle=U({id:"composio",label:"Composio",iconKey:"composio",defaultServerUrl:"https://connect.composio.dev/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Composio MCP, COMPOSIO_API_KEY, or Composio SDK usage","connect.composio.dev/mcp in MCP client configuration","README/docs naming Composio integrations, toolkits, or connected apps"],helpText:"Use tools from the Composio toolkits you have connected, through Composio's hosted Connect MCP server with a Composio API key.",setupGroups:[{id:"connect-toolkits",title:"Connect the toolkits you want to use",description:"Composio's MCP server only exposes tools for the apps you have connected in Composio.",body:"In the [Composio dashboard](https://dashboard.composio.dev), connect the apps (toolkits) you want the agent to use. Composio can also prompt to connect apps on demand at runtime, but connecting them first makes those tools available right away."},{id:"api-key",title:"Create an API key",description:"Create or copy the Composio API key Sazabi will send to Composio's hosted MCP endpoint.",body:"In the [Composio dashboard](https://dashboard.composio.dev), open **Settings > Project Settings** and copy your project API key from the **API Keys** section (or use the AI Clients page). Paste it below. Sazabi stores it securely and sends it as the `x-consumer-api-key` header to Composio's Connect MCP endpoint.",fieldKeys:["apiKey"]}],validateCredentials:Nce,normalizeHeaders:Qce})});var jle;var Ule=h(()=>{_t();de();jle=U({id:"context-dev",label:"Context.dev",iconKey:"context-dev",defaultServerUrl:"https://context-dev.stlmcp.com",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Context.dev SDK usage (context.dev on npm/PyPI/RubyGems), CONTEXT_DEV_API_KEY environment variables, or ctxt_secret_ API keys","context.dev-mcp usage or a context-dev.stlmcp.com server URL in MCP client config","README/docs naming Context.dev for brand intelligence, web scraping/crawling, or website change monitors"],helpText:"Resolve brand data, scrape and crawl websites into LLM-ready Markdown, extract structured data, and manage website-change monitors with Context.dev's hosted MCP server using your Context.dev API key.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the Context.dev API key Sazabi will send to Context.dev's hosted MCP endpoint.",body:"Create or copy an API key (`ctxt_secret_...`) from your [Context.dev dashboard](https://context.dev), then paste it below. Sazabi stores it securely and sends it as the `x-context-dev-api-key` header to Context.dev's MCP endpoint.",fieldKeys:["apiKey"]}],validateCredentials:Uce,normalizeHeaders:jce,skill:"context-dev",setupSkill:"context-dev-setup"})});var Fle;var $le=h(()=>{_t();de();Fle=U({id:"datadog",label:"Datadog",iconKey:"datadog",defaultServerUrl:"https://mcp.datadoghq.com/api/unstable/mcp-server/mcp?toolsets=core",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Datadog config, DD_* environment variables, or @datadog packages","datadog-agent, dd-trace, monitors, dashboards, or incident docs","README/docs naming Datadog for logs, metrics, traces, APM, or incidents"],helpText:"Browse Datadog metrics, logs, traces, and incidents using your Datadog site URL, API key, and Application Key.",setupGroups:[{id:"site",title:"Find your Datadog site",description:"Use the Datadog site URL for the region where your account lives.",body:"Copy the Datadog site URL from the top of your browser, such as `https://app.datadoghq.com` or `https://us3.datadoghq.com`. Sazabi uses this to build the matching hosted MCP endpoint.",fieldKeys:["siteUrl"]},{id:"keys",title:"Create API credentials",description:"Create or copy the two Datadog keys Sazabi needs for hosted MCP.",imageKeys:["mcp.datadog.api-keys-settings","mcp.datadog.application-keys-settings"],body:"In Datadog, go to **Organization Settings > Access > API Keys** to create or copy your API key. Then go to **Organization Settings > Access > Application Keys** to create or copy your Application Key. Note: an Application Key inherits the permissions of the user who creates it, so create it as a least-privilege user or scope the key down to only what the agent needs.",fieldKeys:["apiKey","applicationKey"]}],validateCredentials:bce,normalizeHeaders:fce})});var Gle;var qle=h(()=>{de();Gle=U({id:"deepwiki",label:"DeepWiki",iconKey:"deepwiki",defaultServerUrl:"https://mcp.deepwiki.com/mcp",transport:"streamable-http",authMode:"none",availability:"enabled",capabilityOverrides:{readOnlyToolNames:["read_wiki_structure","read_wiki_contents","ask_question"]},evidenceHints:["Questions about how a public GitHub repository or open-source dependency works","deepwiki.com URLs or references to DeepWiki-generated documentation","Investigations needing up-to-date docs/architecture for a third-party OSS project"],helpText:"Query public GitHub repository documentation and ask questions about open-source code via DeepWiki's hosted MCP server."})});var Hle;var Vle=h(()=>{_t();de();Hle=U({id:"elastic-cloud",label:"Elastic Cloud",iconKey:"elastic-cloud",defaultServerUrl:null,serverUrlHostnameSuffixes:[".elastic.cloud",".cloud.es.io",".elastic-cloud.com"],transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Elasticsearch, Kibana, Elastic Agent, Beats, or Logstash config","ELASTIC_* environment variables or elasticsearch client packages","README/docs naming Elastic Cloud, Elasticsearch, or Kibana"],helpText:"Search Elasticsearch indices and query Elastic Agent Builder tools using your Kibana MCP endpoint and an Elastic API key.",setupGroups:[{id:"deployment",title:"Open Kibana",description:"Find the Kibana URL for the Elastic deployment you want to connect.",body:"Go to [Elastic Cloud deployments](https://cloud.elastic.co/deployments), open the deployment you want to connect, then open Kibana and copy the Kibana base URL from the browser. If your Kibana URL contains `/s/<space>/`, keep that space value for the connect step.",fieldKeys:["kibanaUrl","kibanaSpace"]},{id:"api-key",title:"Create an API key",description:"Create the Elastic API key that the hosted MCP server will use.",body:"In Kibana, go to **Stack Management > API keys** and choose **Create API key**. Restrict its privileges to the Agent Builder MCP server: the `feature_agentBuilder.read` and `feature_actions.read` Kibana privileges, plus read access to the indices your tools query. Copy the generated key.",fieldKeys:["apiKey"]}],validateCredentials:yce,normalizeHeaders:Ace})});var Kle;var Yle=h(()=>{_t();de();Kle=U({id:"exa",label:"Exa",iconKey:"exa",defaultServerUrl:"https://mcp.exa.ai/mcp?tools=web_search_exa,web_fetch_exa,web_search_advanced_exa,agent_tools",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Exa search, EXA_API_KEY environment variables, or the exa-js / exa-py SDK","exa-mcp-server usage or a mcp.exa.ai server URL in MCP client config","README/docs naming Exa for web search, crawling, or research"],helpText:"Search the web, research companies, crawl pages, and run deep research with Exa's hosted MCP server using your Exa API key.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the Exa API key Sazabi will send to Exa's hosted MCP endpoint.",body:"Create or copy an API key from the [Exa dashboard](https://dashboard.exa.ai/api-keys), then paste it below. Sazabi stores it securely and sends it as the `x-api-key` header to Exa's MCP endpoint.",fieldKeys:["apiKey"]}],validateCredentials:Lce,normalizeHeaders:Dce,skill:"exa",setupSkill:"exa-setup"})});var Wle;var Jle=h(()=>{_t();de();Wle=U({id:"gcp",label:"Google Cloud (GCP)",iconKey:"gcp",defaultServerUrl:"https://logging.googleapis.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["GOOGLE_APPLICATION_CREDENTIALS, GCLOUD_PROJECT, or GOOGLE_CLOUD_PROJECT environment variables","gcloud config, app.yaml, cloudbuild.yaml, or @google-cloud/* packages","README/docs naming Google Cloud, GCP, Cloud Logging, Cloud Monitoring, BigQuery, Cloud Run, or GKE"],helpText:"Query Google Cloud (Cloud Logging, Monitoring, BigQuery, and more) using a Google OAuth 2.0 Bearer access token.",setupGroups:[{id:"server-url",title:"Choose the Google Cloud MCP endpoint",description:"Google exposes a separate remote MCP server per product at https://SERVICE.googleapis.com/mcp.",body:"Sazabi defaults to Cloud Logging (`https://logging.googleapis.com/mcp`). To use a different product, replace the server URL with its endpoint, such as `https://monitoring.googleapis.com/mcp` (Cloud Monitoring) or `https://bigquery.googleapis.com/mcp` (BigQuery). See the [supported products list](https://docs.cloud.google.com/mcp/supported-products).",fieldKeys:["serverUrl"]},{id:"access-token",title:"Create a Google OAuth 2.0 access token",description:"Generate a Google access token scoped by IAM to the resources Sazabi should read.",body:"The hosted servers authenticate with a Google OAuth 2.0 Bearer access token. For a non-interactive token, install the [gcloud CLI](https://docs.cloud.google.com/mcp/authenticate-mcp), configure Application Default Credentials (a user login, service-account key, or impersonation), then run `gcloud auth application-default print-access-token` and copy the token. Paste the raw token into Sazabi — Sazabi adds the `Bearer ` prefix and sends it in the `Authorization` header. Google access tokens are short-lived, so refresh the token when it expires.",fieldKeys:["accessToken"]}],validateCredentials:Jce,normalizeHeaders:Wce})});var Zle;var Xle=h(()=>{de();Zle=U({id:"google-drive",label:"Google Drive",iconKey:"google-drive",defaultServerUrl:"https://drivemcp.googleapis.com/mcp/v1",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"google-drive",callbackPathSegment:"google-drive",authorizationUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",authorizationUrlParams:{access_type:"offline",prompt:"consent"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"https://www.googleapis.com/auth/drive.readonly",label:"Drive read",description:"Read files and metadata in the user's Google Drive through the hosted MCP server."}],setupGroups:[{id:"google-cloud-oauth-client",title:"Create an OAuth client in Google Cloud",description:"The Google Drive MCP server does not support automatic client registration. An admin must create an OAuth client in a Google Cloud project and provide its credentials to Sazabi.",body:["1. In the Google Cloud console, open **APIs & Services → OAuth consent screen** and configure the consent screen with the Drive scopes.","2. Under **APIs & Services → Credentials**, create an **OAuth client ID** of type **Web application**.","3. Add the Sazabi Google Drive MCP callback URL shown on this page as an **Authorized redirect URI**.","4. Enable both the **Google Drive API** and the **Google Drive MCP API** (`drivemcp.googleapis.com`) for the project. Both are required for the hosted MCP server to be reachable.","5. Provide the generated **Client ID** and **Client Secret** to your Sazabi deployment configuration."].join(`
|
|
8910
8910
|
`)}],evidenceHints:["drive.google.com / docs.google.com links, or Google Drive file IDs in runbooks","googleapis / google-auth-library packages, or GOOGLE_* / GDRIVE_* environment variables","README/runbooks naming Google Drive as a document or asset store"],helpText:"Search and read files and metadata in a Google Drive through Google's hosted MCP server. Coming soon — requires a Sazabi-provisioned Google OAuth client and isn't self-serve connectable yet."})});var eue;var tue=h(()=>{de();eue=U({id:"grafana",label:"Grafana Cloud",iconKey:"grafana",defaultServerUrl:"https://mcp.grafana.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"grafana",callbackPathSegment:"grafana",authorizationUrl:"https://mcp.grafana.com/mcp/oauth/authorize",tokenUrl:"https://mcp.grafana.com/mcp/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.grafana.com/mcp/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"grafana:read",label:"Read",description:"Read Grafana dashboards, panels, metrics, logs, traces, alerts, and incidents."},{value:"grafana:write",label:"Write",description:"Create and modify Grafana resources. Write tools require explicit approval per your organization's tool policy."}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["grafana.net / grafana.com links, Grafana dashboards, or GRAFANA_* environment variables","Prometheus, Loki, Tempo, or Mimir data sources wired into Grafana","README/runbooks naming Grafana for dashboards, metrics, logs, traces, or alerts"],helpText:"Browse Grafana dashboards, metrics, logs, traces, and alerts across your Grafana Cloud stack."})});var nue;var oue=h(()=>{de();nue=U({id:"granola",label:"Granola",iconKey:"granola",defaultServerUrl:"https://mcp.granola.ai/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"granola",callbackPathSegment:"granola",authorizationUrl:"https://mcp-auth.granola.ai/oauth2/authorize",tokenUrl:"https://mcp-auth.granola.ai/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp-auth.granola.ai/oauth2/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"offline_access",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["granola.ai meeting links, Granola notes exports, or GRANOLA_* environment variables","Incident, customer-call, or product-feedback docs naming Granola","Operational runbooks that refer to meeting notes or transcripts in Granola"],helpText:"Search and browse Granola meeting notes, transcripts, and folders."})});var rue;var iue=h(()=>{de();rue=U({id:"happenstance",label:"Happenstance",iconKey:"happenstance",defaultServerUrl:"https://happenstance.ai/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"happenstance",callbackPathSegment:"happenstance",authorizationUrl:"https://happenstance.ai/oauth/authorize",tokenUrl:"https://clerk.happenstance.ai/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://clerk.happenstance.ai/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"profile",label:"Profile",description:"Read your Happenstance profile."},{value:"email",label:"Email",description:"Read the email associated with your Happenstance account."},{value:"offline_access",label:"Offline access",description:"Keep the connection alive by refreshing access without re-authentication."}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["happenstance.ai links or references to a Happenstance network/graph","HAPPENSTANCE_* environment variables or scripts calling Happenstance APIs","Docs naming Happenstance as the people/relationship search tool"],helpText:"Search your Happenstance network to find and get introduced to people."})});var sue;var aue=h(()=>{de();sue=U({id:"herd",label:"Herd",iconKey:"herd",defaultServerUrl:"https://mcp.herd.eco/v1",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"herd",callbackPathSegment:"herd",authorizationUrl:"https://mcp.herd.eco/api/auth/oauth2/authorize",tokenUrl:"https://mcp.herd.eco/api/auth/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.herd.eco/api/auth/oauth2/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"offline_access",required:!0},{value:"profile"},{value:"email"}],scopesUserSelectable:!1,capabilityOverrides:{allowWriteTools:!0},helpText:"Analyze contracts, transactions, wallets, and on-chain activity."})});var cue;var lue=h(()=>{de();cue=U({id:"honeycomb",label:"Honeycomb",iconKey:"honeycomb",defaultServerUrl:"https://mcp.honeycomb.io/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"honeycomb",callbackPathSegment:"honeycomb",authorizationUrl:"https://ui.honeycomb.io/oauth/authorize",tokenUrl:"https://ui.honeycomb.io/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://ui.honeycomb.io/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"mcp:read",label:"Read",description:"Query Honeycomb environments, datasets, columns, boards, triggers, SLOs, and run queries."},{value:"mcp:write",label:"Write",description:"Create and update Honeycomb boards, triggers, and other resources."}],scopesUserSelectable:!1,regions:[{label:"United States (US)",serverUrl:"https://mcp.honeycomb.io/mcp"},{label:"Europe (EU)",serverUrl:"https://mcp.eu1.honeycomb.io/mcp",authorizationUrl:"https://ui.eu1.honeycomb.io/oauth/authorize",tokenUrl:"https://ui.eu1.honeycomb.io/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://ui.eu1.honeycomb.io/oauth/register",tokenEndpointAuthMethod:"none"}}],capabilityOverrides:{allowWriteTools:!0},evidenceHints:["honeycomb.io URLs, HONEYCOMB_API_KEY / HONEYCOMB_DATASET environment variables, or honeycomb:// dataset URIs","libhoney, @honeycombio packages, or OpenTelemetry exporters pointed at api.honeycomb.io / api.eu1.honeycomb.io","README/runbooks naming Honeycomb as the observability or tracing provider"],helpText:"Query Honeycomb environments, datasets, columns, boards, and triggers, run queries, and create or update boards and triggers. Choose the US or EU region when connecting."})});var uue;var due=h(()=>{de();uue=U({id:"incident-io",label:"incident.io",iconKey:"incident-io",defaultServerUrl:"https://mcp.incident.io/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"incident-io",callbackPathSegment:"incident-io",authorizationUrl:"https://app.incident.io/auth/plugin/authorize",tokenUrl:"https://app.incident.io/auth/plugin/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.incident.io/mcp/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["incident.io alert-source URLs, escalation docs, or incident IDs","INCIDENT_IO_* environment variables or webhooks into incident.io","README/runbooks naming incident.io for incidents, alerts, or on-call"],helpText:"Browse incidents, alerts, and on-call.",skill:"incident-io",setupSkill:"incident-io-setup"})});var pue;var gue=h(()=>{_t();de();pue=U({id:"intercom",label:"Intercom",iconKey:"intercom",defaultServerUrl:"https://mcp.intercom.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Intercom config, INTERCOM_* environment variables, or intercom-client packages","Support inbox, conversations, help center, or customer messaging docs naming Intercom","README/docs naming Intercom for support threads or customer conversations"],helpText:"Read Intercom support conversations, contacts, and help center content using an Intercom API access token. US-hosted Intercom workspaces only.",setupGroups:[{id:"developer-app",title:"Open Intercom developer settings",description:"Use an Intercom app with an access token for the workspace you want to connect.",body:"In Intercom, go to **Settings > Integrations > Developer Hub**, open (or create) an app for your workspace, and confirm it has the permissions you want agents to use. The hosted MCP server lives at `https://mcp.intercom.com/mcp` and currently supports US-hosted Intercom workspaces only."},{id:"access-token",title:"Copy your access token",description:"Copy the Intercom API access token the hosted MCP server will use.",body:"From your Intercom app's **Authentication** section, copy the access token. Paste the raw token into Sazabi — Sazabi adds the `Bearer ` prefix and sends it in the `Authorization` header.",fieldKeys:["accessToken"]}],validateCredentials:Rce,normalizeHeaders:Pce})});var mue;var hue=h(()=>{_t();de();mue=U({id:"langfuse",label:"Langfuse",iconKey:"langfuse",defaultServerUrl:"https://us.cloud.langfuse.com/api/public/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",regions:[{label:"United States (US)",serverUrl:"https://us.cloud.langfuse.com/api/public/mcp"},{label:"Europe (EU)",serverUrl:"https://cloud.langfuse.com/api/public/mcp"},{label:"Asia Pacific (JP)",serverUrl:"https://jp.cloud.langfuse.com/api/public/mcp"}],capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Langfuse SDK usage (langfuse, langfuse-langchain) or @langfuse packages","LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY / LANGFUSE_HOST environment variables","README/docs naming Langfuse as the LLM tracing, evaluation, or observability provider"],helpText:"Query Langfuse traces, observations, metrics, scores, comments, and prompts using project API keys.",setupGroups:[{id:"region",title:"Pick your Langfuse Cloud region",description:"Select the Langfuse Cloud region that hosts your project (or use the custom connector for a self-hosted deployment).",body:"Langfuse Cloud is region-scoped: US (`https://us.cloud.langfuse.com`), EU (`https://cloud.langfuse.com`), or JP (`https://jp.cloud.langfuse.com`). Choose the region matching your Langfuse account; the hosted MCP server lives at `/api/public/mcp` on that host."},{id:"api-keys",title:"Create project API keys",description:"Generate the Langfuse project API key pair the hosted MCP server will use.",body:"In Langfuse, open **Project settings → API keys** and create a new key pair. Copy the Public key (`pk-lf-...`) and Secret key (`sk-lf-...`). Sazabi combines them into an HTTP Basic `Authorization` header (`Basic base64(publicKey:secretKey)`) and sends it to the MCP server. Paste the combined `Authorization` value into Sazabi.",fieldKeys:["authorization"]}],validateCredentials:qce,normalizeHeaders:$ce})});var Aue;var fue=h(()=>{de();Aue=U({id:"langsmith",label:"LangSmith",iconKey:"langsmith",defaultServerUrl:"https://api.smith.langchain.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"langsmith",callbackPathSegment:"langsmith",authorizationUrl:"https://api.smith.langchain.com/oauth/authorize",tokenUrl:"https://api.smith.langchain.com/oauth/token",resourceUrl:"https://api.smith.langchain.com/mcp",dynamicClientRegistration:{registrationEndpoint:"https://api.smith.langchain.com/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[],scopesUserSelectable:!1,regions:[{label:"GCP United States (US)",serverUrl:"https://api.smith.langchain.com/mcp"},{label:"GCP Europe (EU)",serverUrl:"https://eu.api.smith.langchain.com/mcp",authorizationUrl:"https://eu.api.smith.langchain.com/oauth/authorize",tokenUrl:"https://eu.api.smith.langchain.com/oauth/token",resourceUrl:"https://eu.api.smith.langchain.com/mcp",dynamicClientRegistration:{registrationEndpoint:"https://eu.api.smith.langchain.com/oauth/register",tokenEndpointAuthMethod:"none"}},{label:"GCP Asia Pacific (APAC)",serverUrl:"https://apac.api.smith.langchain.com/mcp",authorizationUrl:"https://apac.api.smith.langchain.com/oauth/authorize",tokenUrl:"https://apac.api.smith.langchain.com/oauth/token",resourceUrl:"https://apac.api.smith.langchain.com/mcp",dynamicClientRegistration:{registrationEndpoint:"https://apac.api.smith.langchain.com/oauth/register",tokenEndpointAuthMethod:"none"}},{label:"AWS United States (US)",serverUrl:"https://aws.api.smith.langchain.com/mcp",authorizationUrl:"https://aws.api.smith.langchain.com/oauth/authorize",tokenUrl:"https://aws.api.smith.langchain.com/oauth/token",resourceUrl:"https://aws.api.smith.langchain.com/mcp",dynamicClientRegistration:{registrationEndpoint:"https://aws.api.smith.langchain.com/oauth/register",tokenEndpointAuthMethod:"none"}}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["LANGSMITH_* or LANGCHAIN_* environment variables, or langsmith SDK usage","LangSmith tracing projects, runs, datasets, or evaluations","README/docs naming LangSmith for LLM tracing, evals, or observability"],helpText:"Query LangSmith tracing projects, runs, datasets, and evaluations to investigate LLM application behavior. Choose the region where your LangSmith organization lives when connecting."})});var yue;var bue=h(()=>{de();yue=U({id:"linear",label:"Linear",iconKey:"linear",defaultServerUrl:"https://mcp.linear.app/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"linear",callbackPathSegment:"linear",authorizationUrl:"https://mcp.linear.app/authorize",tokenUrl:"https://mcp.linear.app/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.linear.app/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"read",label:"Read",description:"Read Linear issues, projects, teams, comments, and related data."},{value:"write",label:"Write",description:"Create and update Linear issues, comments, and project data."}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},skill:"linear",setupSkill:"linear-setup",evidenceHints:["linear.app URLs, Linear issue keys, or team/project IDs in docs","LINEAR_* environment variables or scripts that call Linear APIs","README/runbooks naming Linear as the issue tracker or planning system"],helpText:"Browse and search Linear issues and projects, and create or update issues, comments, and project data."})});var Iue;var Sue=h(()=>{de();Iue=U({id:"logfire",label:"Pydantic Logfire",iconKey:"logfire",defaultServerUrl:"https://logfire-us.pydantic.dev/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"logfire",callbackPathSegment:"logfire",authorizationUrl:"https://logfire-us.pydantic.dev/api/oauth/authorize",tokenUrl:"https://logfire-us.pydantic.dev/api/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://logfire-us.pydantic.dev/api/oauth/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"organization:read_channel"},{value:"project:read"},{value:"project:read_alert"},{value:"project:read_dashboard"},{value:"project:read_variables"}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Pydantic Logfire config, LOGFIRE_* environment variables, or logfire SDK packages","Python/Pydantic observability docs naming Logfire","Alerts, dashboards, or traces hosted in Logfire"],helpText:"Query Pydantic Logfire traces, metrics, and exceptions, and browse projects, alerts, and dashboards. Hosted on Logfire's US region (logfire-us.pydantic.dev)."})});var Cue;var vue=h(()=>{de();Cue=U({id:"mercury",label:"Mercury",iconKey:"mercury",defaultServerUrl:"https://mcp.mercury.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"mercury",callbackPathSegment:"mercury",authorizationUrl:"https://mcp.mercury.com/authorize",tokenUrl:"https://mcp.mercury.com/token",resourceUrl:"https://mcp.mercury.com/mcp",omitScopeFromAuthorizationUrl:!0,dynamicClientRegistration:{registrationEndpoint:"https://mcp.mercury.com/register",tokenEndpointAuthMethod:"client_secret_basic",includeScopesInRegistration:!0}},getAvailableScopes:async()=>[{value:"read",label:"Read access",description:"Read Mercury accounts, cards, recipients, transactions, treasury, and organization data."},{value:"offline_access",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!1},skill:"mercury",setupSkill:"mercury-setup",evidenceHints:["Mercury dashboard links, mercury.com references, or Mercury API usage","MERCURY_* environment variables or docs mentioning Mercury banking","Treasury, card, account, recipient, or transaction workflows backed by Mercury"],helpText:"Search Mercury banking data including accounts, cards, recipients, transactions, treasury, and organization records. Read-only: this connection cannot move money or change your Mercury account."})});var wue;var Eue=h(()=>{de();wue=U({id:"neon",label:"Neon",iconKey:"neon",defaultServerUrl:"https://mcp.neon.tech/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"neon",callbackPathSegment:"neon",authorizationUrl:"https://mcp.neon.tech/api/authorize",tokenUrl:"https://mcp.neon.tech/api/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.neon.tech/api/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"read",label:"Read",description:"Read Neon projects, branches, databases, and run queries."},{value:"write",label:"Write",description:"Create and modify Neon projects, branches, and databases."},{value:"*",label:"Full access",description:"All access - read and manage every Neon resource the connected account can reach."}],getUrlConfiguration:async()=>({docsUrl:"https://neon.com/docs/ai/neon-mcp-server",instructions:"Copy the hosted MCP server URL below. Optional: to narrow access, append ?readonly=true, &projectId=<id>, and/or &category=<groups> (see the Neon MCP docs), then copy the edited URL.",defaultServerUrl:"https://mcp.neon.tech/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Neon connection strings, neon.tech hosts, or @neondatabase/serverless packages","DATABASE_URL/POSTGRES_URL values documented as Neon","README/docs naming Neon as the Postgres provider"],helpText:"Manage Neon projects, branches, databases, and run SQL queries."})});var kue;var xue=h(()=>{de();kue=U({id:"notion",label:"Notion",iconKey:"notion",defaultServerUrl:"https://mcp.notion.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"notion",callbackPathSegment:"notion",authorizationUrl:"https://mcp.notion.com/authorize",tokenUrl:"https://mcp.notion.com/token",resourceUrl:"https://mcp.notion.com/mcp",dynamicClientRegistration:{registrationEndpoint:"https://mcp.notion.com/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"default",label:"Default",description:"Access Notion pages, databases, and workspace content via MCP."}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},skill:"notion",setupSkill:"notion-setup",evidenceHints:["notion.so URLs, Notion page IDs, or database IDs in docs","NOTION_* environment variables or scripts that call Notion APIs","README/runbooks naming Notion as the wiki or knowledge base"],helpText:"Browse and manage Notion pages, databases, and workspace content. During authorization, choose which pages and databases to share with the connection."})});var Pue;var Rue=h(()=>{de();Pue=U({id:"1password",label:"1Password",iconKey:"onepassword",defaultServerUrl:"https://developer.1password.com/get-started/secure-ai-access",transport:"streamable-http",authMode:"none",availability:"disabled",getUrlConfiguration:async()=>null,evidenceHints:["1Password service-account tokens (ops_...), op CLI usage, or OP_SERVICE_ACCOUNT_TOKEN","1password.com / *.1password.com references, or op:// secret references","README/docs naming 1Password as the secrets manager or vault"],helpText:"Access 1Password via its documented secure AI access options. A general-purpose hosted MCP server is not available today; use the 1Password CLI (op) sandbox preset instead."})});var Tue;var Bue=h(()=>{de();Tue=U({id:"paper",label:"Paper MCP",iconKey:"paper",defaultServerUrl:"http://127.0.0.1:29979/mcp",transport:"streamable-http",authMode:"none",availability:"disabled",getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["paper.design URLs, Paper Desktop app references, or PAPER_* environment variables","Design files, component libraries, or design-system docs naming Paper","HTML-to-PDF slide or presentation workflows that reference Paper"],helpText:"Read and write Paper design files, including nodes, selections, text content, and design-system elements. Coming soon — Paper's MCP server runs on desktop localhost and can't be reached by hosted Sazabi agents yet."})});var Oue;var _ue=h(()=>{de();Oue=U({id:"plain",label:"Plain",iconKey:"plain",defaultServerUrl:"https://mcp.plain.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"plain",callbackPathSegment:"plain",authorizationUrl:"https://signin.auth.plain.com/oauth2/authorize",tokenUrl:"https://signin.auth.plain.com/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://signin.auth.plain.com/oauth2/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"offline_access",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["plain.com links, Plain customer/thread IDs, or PLAIN_* environment variables","Support inbox, customer thread, or tenant docs naming Plain","Code or scripts syncing customers, tenants, or support threads with Plain"],helpText:"Search and manage Plain support threads, customers, and tenants.",skill:"plain",setupSkill:"plain-setup"})});var Due;var Lue=h(()=>{de();Due=U({id:"planetscale",label:"PlanetScale",iconKey:"planetscale",defaultServerUrl:"https://mcp.pscale.dev/mcp/planetscale",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"planetscale",callbackPathSegment:"planetscale",authorizationUrl:"https://app.planetscale.com/oauth/authorize",tokenUrl:"https://auth.planetscale.com/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://auth.planetscale.com/oauth/registration",tokenEndpointAuthMethod:"client_secret_basic"}},getAvailableScopes:async()=>[{value:"read_databases"},{value:"read_user"},{value:"read_organization"},{value:"write_databases"},{value:"write_organization"}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["PlanetScale connection strings, pscale CLI config, or planetscale.com links","PLANETSCALE_* or DATABASE_URL values documented as PlanetScale","README/docs naming PlanetScale for MySQL, branching, or schema changes"],helpText:"Query PlanetScale databases, inspect schema, and browse Insights data.",skill:"planetscale",setupSkill:"planetscale-setup"})});var Que;var Nue=h(()=>{de();Que=U({id:"posthog",label:"PostHog",iconKey:"posthog",defaultServerUrl:"https://mcp.posthog.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"posthog",callbackPathSegment:"posthog",authorizationUrl:"https://oauth.posthog.com/oauth/authorize/",tokenUrl:"https://oauth.posthog.com/oauth/token/",dynamicClientRegistration:{registrationEndpoint:"https://oauth.posthog.com/oauth/register/",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"query:read"},{value:"insight:read"},{value:"insight:write"},{value:"feature_flag:read"},{value:"feature_flag:write"},{value:"experiment:read"},{value:"experiment:write"},{value:"dashboard:read"},{value:"dashboard:write"},{value:"event_definition:read"},{value:"event_definition:write"},{value:"person:read"},{value:"user:read",required:!0},{value:"user:write"},{value:"organization:read",required:!0},{value:"project:read",required:!0},{value:"project:write"},{value:"survey:read"},{value:"survey:write"},{value:"error_tracking:read"},{value:"logs:read"},{value:"tracing:read"},{value:"error_tracking:write"},{value:"session_recording:read"},{value:"session_recording_playlist:read"},{value:"alert:read"},{value:"activity_log:read"},{value:"annotation:read"},{value:"cohort:read"},{value:"hog_function:read"}],getUrlConfiguration:async()=>({docsUrl:"https://posthog.com/docs/model-context-protocol/faq",instructions:"Copy the hosted MCP server URL below. Optional: to expose only some tools, append ?features=<groups> or ?tools=<names> (see the PostHog MCP docs), then copy the edited URL.",defaultServerUrl:"https://mcp.posthog.com/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["posthog-js, posthog-node, POSTHOG_* or NEXT_PUBLIC_POSTHOG_* environment variables","Feature flag, experiment, session replay, or product analytics code using PostHog","README/docs naming PostHog for analytics, flags, experiments, logs, or tracing"],helpText:"Query PostHog analytics, feature flags, and experiments.",skill:"posthog",setupSkill:"posthog-setup"})});var Mue;var zue=h(()=>{de();Mue=U({id:"pylon",label:"Pylon",iconKey:"pylon",defaultServerUrl:"https://mcp.usepylon.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"pylon",callbackPathSegment:"pylon",authorizationUrl:"https://o.auth.usepylon.com/oauth2/authorize",tokenUrl:"https://o.auth.usepylon.com/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://o.auth.usepylon.com/oauth2/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"offline_access",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["usepylon.com links, Pylon issue/account IDs, or PYLON_* environment variables","Customer support workflows or account runbooks naming Pylon","Code or scripts syncing support issues, accounts, or contacts with Pylon"],helpText:"Search and manage Pylon support issues, accounts, and contacts.",skill:"pylon",setupSkill:"pylon-setup"})});var jue;var Uue=h(()=>{de();jue=U({id:"railway",label:"Railway",iconKey:"railway",defaultServerUrl:"https://mcp.railway.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"railway",callbackPathSegment:"railway",authorizationUrl:"https://backboard.railway.com/oauth/auth",tokenUrl:"https://backboard.railway.com/oauth/token",resourceUrl:"https://mcp.railway.com",dynamicClientRegistration:{registrationEndpoint:"https://backboard.railway.com/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"profile",required:!0},{value:"email",required:!0},{value:"offline_access",required:!0},{value:"workspace:member",label:"Workspace access",description:"Read and manage Railway projects, services, deployments, variables, and logs in the workspaces the connected account belongs to."}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},skill:"railway",setupSkill:"railway-setup",evidenceHints:["railway.app / railway.com links, RAILWAY_* environment variables, or a railway.json/railway.toml in the repo","Deploy workflows or runbooks naming Railway as the hosting/PaaS provider","Railway project/service/environment IDs referenced in docs or CI"],helpText:"Manage Railway projects, services, deployments, variables, and logs."})});var Fue;var $ue=h(()=>{_t();de();Fue=U({id:"render",label:"Render",iconKey:"render",defaultServerUrl:"https://mcp.render.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["render.com links, RENDER_* environment variables, or a render.yaml in the repo","Deploy workflows or runbooks naming Render as the hosting/PaaS provider","Render service/deploy IDs referenced in docs or CI"],helpText:"Manage Render services, deploys, environment variables, logs, and metrics.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the Render API key Sazabi will send to Render's hosted MCP endpoint.",body:"Create a Render [API key](https://dashboard.render.com/settings/api-keys) in **Account Settings > API Keys**, then paste it below. Note: a Render API key is account-wide and can manage and deploy every service in the account, so treat it as a powerful credential.",fieldKeys:["apiKey"]}],validateCredentials:Bce,normalizeHeaders:Tce})});var Gue;var que=h(()=>{_t();de();Gue=U({id:"rentahuman",label:"RentAHuman",iconKey:"rentahuman",defaultServerUrl:"https://rentahuman.ai/api/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["rentahuman.ai, RENTAHUMAN_API_KEY environment variables, or RentAHuman API keys","rentahuman-mcp usage or a rentahuman.ai/api/mcp server URL in MCP client config","README/docs naming RentAHuman for hiring humans or human-in-the-loop work"],helpText:"Hire and coordinate human workers for real-world tasks with RentAHuman's hosted MCP server using an API key.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the RentAHuman API key Sazabi will send to its hosted MCP endpoint.",body:"Create or copy an API key from the [RentAHuman API keys page](https://rentahuman.ai/account/api-keys), then paste it below. Sazabi stores it securely and sends it as the `X-API-Key` header. Note: this key can hire workers and trigger payments, so keep the per-connection read-only toggle on unless you intend the agent to act.",fieldKeys:["apiKey"]}],validateCredentials:zce,normalizeHeaders:Mce,skill:"rentahuman",setupSkill:"rentahuman-setup"})});var Hue;var Vue=h(()=>{_t();de();Hue=U({id:"resend",label:"Resend",iconKey:"resend",defaultServerUrl:"https://mcp.resend.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Resend email API usage, RESEND_API_KEY environment variables, or the resend SDK","resend-mcp usage or a mcp.resend.com server URL in MCP client config","README/docs naming Resend for transactional or marketing email"],helpText:"Send transactional emails and manage domains, contacts, and audiences with Resend's hosted MCP server using your Resend API key.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the Resend API key Sazabi will send to Resend's hosted MCP endpoint.",body:"Create or copy an API key from the [Resend dashboard](https://resend.com/api-keys), then paste it below. Choose the key's permission to match what you want the agent to do: **Sending access** (send emails only, the safer choice) or **Full access** (also manage domains, contacts, and audiences). Sazabi stores it securely and sends it as the `Authorization: Bearer` token to Resend's MCP endpoint (`https://mcp.resend.com/mcp`).",fieldKeys:["apiKey"]}],validateCredentials:Vce,normalizeHeaders:Hce,skill:"resend",setupSkill:"resend-setup"})});var Kue;var Yue=h(()=>{_t();de();Kue=U({id:"respan",label:"Respan",iconKey:"respan",defaultServerUrl:"https://mcp.respan.ai/api/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Respan / Keywords AI observability usage, RESPAN_API_KEY environment variables, or the respan-ai / keywordsai SDK","respan-mcp usage or a mcp.respan.ai server URL in MCP client config","README/docs naming Respan or Keywords AI for LLM logs, traces, or prompt management"],helpText:"Query LLM request logs, traces, prompts, and customer data from your Respan account using Respan's hosted MCP server and your Respan API key.",setupGroups:[{id:"api-key",title:"Create an API key",description:"Create or copy the Respan API key Sazabi will send to Respan's hosted MCP endpoint.",body:"Create or copy an API key from the [Respan dashboard](https://platform.respan.ai/platform/api/api-keys), then paste it below. Sazabi stores it securely and sends it as the `Authorization: Bearer` token to Respan's MCP endpoint (`https://mcp.respan.ai/api/mcp`).",fieldKeys:["apiKey"]}],validateCredentials:Yce,normalizeHeaders:Kce,skill:"respan",setupSkill:"respan-setup"})});var Wue;var Jue=h(()=>{de();Wue=U({id:"salesforce",label:"Salesforce",iconKey:"salesforce",defaultServerUrl:"https://api.salesforce.com/platform/mcp/v1/platform/sobject-all",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"salesforce",callbackPathSegment:"salesforce",authorizationUrl:"https://login.salesforce.com/services/oauth2/authorize",tokenUrl:"https://login.salesforce.com/services/oauth2/token"},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"mcp_api",label:"MCP API access",description:"Access Salesforce data and metadata (sObjects, Apex invocable actions, Flows) through the hosted MCP server. Salesforce hosted MCP External Client Apps require the MCP-specific `mcp_api` scope."},{value:"refresh_token",label:"Offline access",description:"Refresh the access token without requiring the user to re-authenticate.",required:!0}],capabilityOverrides:{allowWriteTools:!0},setupGroups:[{id:"external-client-app",title:"Register an External Client App in Salesforce",description:"Salesforce hosted MCP servers do not support automatic client registration. An admin must create an External Client App (ECA) in the org and enable it for the hosted MCP server.",body:["1. In Salesforce Setup, open **App Manager** and create a new **External Client App**.","2. Enable OAuth, add the **mcp_api** and **refresh_token (offline access)** scopes, and require PKCE.","3. Set the callback URL to the Sazabi Salesforce MCP callback URL shown on this page.","4. Enable the app for your hosted MCP server under **Setup → MCP Servers**.","5. Provide the generated **Consumer Key (Client ID)** and **Consumer Secret (Client Secret)** to your Sazabi deployment configuration."].join(`
|
|
8911
|
-
`)}],evidenceHints:["force.com / my.salesforce.com URLs, SALESFORCE_* or SFDC_* environment variables, or sf/sfdx CLI usage","jsforce, simple-salesforce, or @salesforce packages","README/runbooks naming Salesforce as the CRM or system of record"],helpText:"Query Salesforce data and metadata, and run Apex invocable actions and Flows exposed by a hosted MCP server. Coming soon — a Salesforce admin registers an External Client App in your org and Sazabi provisions its credentials, so it isn't self-serve connectable yet."})});var Zue;var Xue=h(()=>{de();Zue=U({id:"secureframe",label:"Secureframe",iconKey:"secureframe",defaultServerUrl:"https://mcp.secureframe.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"secureframe",callbackPathSegment:"secureframe",authorizationUrl:"https://mcp.secureframe.com/oauth/authorize",tokenUrl:"https://mcp.secureframe.com/oauth/token",resourceUrl:"https://mcp.secureframe.com",dynamicClientRegistration:{registrationEndpoint:"https://mcp.secureframe.com/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"mcp",label:"MCP Access",description:"Query and manage Secureframe compliance data, controls, tests, vendors, risks, and framework requirements."}],scopesUserSelectable:!1,regions:[{label:"United States (US)",serverUrl:"https://mcp.secureframe.com"},{label:"United Kingdom (UK)",serverUrl:"https://mcp-uk.secureframe.com",authorizationUrl:"https://mcp-uk.secureframe.com/oauth/authorize",tokenUrl:"https://mcp-uk.secureframe.com/oauth/token",resourceUrl:"https://mcp-uk.secureframe.com",dynamicClientRegistration:{registrationEndpoint:"https://mcp-uk.secureframe.com/register",tokenEndpointAuthMethod:"none"}}],capabilityOverrides:{allowWriteTools:!0},evidenceHints:["secureframe.com URLs, SECUREFRAME_API_KEY / SECUREFRAME_API_SECRET environment variables","SOC 2, ISO 27001, HIPAA, PCI DSS, GDPR, or NIST compliance frameworks and controls","README/docs or compliance runbooks naming Secureframe for automated compliance and continuous monitoring"],helpText:"Query and manage Secureframe compliance data, controls, automated tests, vendors, risks, and framework requirements. Choose the US or UK region when connecting.",skill:"secureframe",setupSkill:"secureframe-setup"})});var ede;var tde=h(()=>{de();ede=U({id:"sentry",label:"Sentry",iconKey:"sentry",defaultServerUrl:"https://mcp.sentry.dev/mcp",serverUrlPathSuffixMaxSegments:2,transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"sentry",callbackPathSegment:"sentry",authorizationUrl:"https://mcp.sentry.dev/oauth/authorize",tokenUrl:"https://mcp.sentry.dev/oauth/token",useServerUrlAsResource:!0,dynamicClientRegistration:{registrationEndpoint:"https://mcp.sentry.dev/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"org:read"},{value:"project:write"},{value:"team:write"},{value:"event:write"}],getUrlConfiguration:async()=>({docsUrl:"https://mcp.sentry.dev/",instructions:"Copy the hosted MCP server URL below. Optional: to scope this connection to one organization or project, copy a path-scoped URL from the Sentry MCP page (e.g. .../mcp/your-org).",defaultServerUrl:"https://mcp.sentry.dev/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["@sentry packages, sentry.properties, SENTRY_* environment variables, or sentry-cli usage","Sentry.init calls, release/deploy automation, or Sentry alert docs","README/docs naming Sentry as the error tracking provider"],helpText:"Browse Sentry organizations, teams, projects, and events."})});var nde;var ode=h(()=>{_t();de();nde=U({id:"signoz",label:"SigNoz",iconKey:"signoz",defaultServerUrl:"https://mcp.us.signoz.cloud/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["SigNoz config, SIGNOZ_* environment variables, or signoz.io links","OpenTelemetry Collector exporting to SigNoz, or a signoz docker-compose / self-hosted deployment","README/docs naming SigNoz for metrics, logs, traces, alerts, or dashboards"],helpText:"Query SigNoz metrics, logs, traces, alerts, and dashboards to investigate production issues.",setupGroups:[{id:"instance",title:"Find your SigNoz instance",description:"Point Sazabi at the SigNoz instance whose telemetry you want to query.",body:"For SigNoz Cloud, use the regional MCP endpoint for your account, such as `https://mcp.us.signoz.cloud/mcp` (replace the region as needed). For self-hosted SigNoz, use your instance's MCP endpoint and set the SigNoz base URL below so the server knows which instance to target.",fieldKeys:["signozUrl"]},{id:"api-key",title:"Create an API key",description:"Create or copy the SigNoz API key Sazabi will send to SigNoz's MCP endpoint.",body:"In SigNoz, go to **Settings > API Keys** and create or copy an API key. Alert, dashboard, and notification-channel tools require an admin-level key. Paste it below.",fieldKeys:["apiKey"]}],validateCredentials:_ce,normalizeHeaders:Oce})});var rde;var ide=h(()=>{de();rde=U({id:"slack",label:"Slack",iconKey:"slack",defaultServerUrl:"https://mcp.slack.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"slack",callbackPathSegment:"slack",authorizationUrl:"https://slack.com/oauth/v2_user/authorize",tokenUrl:"https://slack.com/api/oauth.v2.user.access"},getAvailableScopes:async()=>[{value:"search:read.public"},{value:"search:read.private"},{value:"search:read.mpim"},{value:"search:read.im"},{value:"search:read.files"},{value:"search:read.users"},{value:"canvases:read"},{value:"users:read"},{value:"users:read.email"}],getUrlConfiguration:async()=>null,capabilityOverrides:{defaultUnavailableReason:"write_blocked"},evidenceHints:["Slack app manifests, bot/webhook URLs, SLACK_* environment variables, or slack.com links","Runbooks that route incidents, alerts, or deploy notices through Slack","Code or docs naming Slack channels for operational triage"],helpText:"Browse Slack messages, files, and threads. Coming soon — requires backend OAuth plumbing for user_scope and isn't self-serve connectable yet.",skill:"slack",setupSkill:"slack-setup"})});var sde;var ade=h(()=>{de();sde=U({id:"stripe",label:"Stripe MCP",iconKey:"stripe",defaultServerUrl:"https://mcp.stripe.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"stripe",callbackPathSegment:"stripe",authorizationUrl:"https://access.stripe.com/mcp/oauth2/authorize",tokenUrl:"https://access.stripe.com/mcp/oauth2/token",resourceUrl:"https://mcp.stripe.com",dynamicClientRegistration:{registrationEndpoint:"https://access.stripe.com/mcp/oauth2/register",tokenEndpointAuthMethod:"none"},defaultAccessTokenTtlSeconds:21600},getAvailableScopes:async()=>[{value:"mcp",label:"MCP access",description:"Access the Stripe MCP server tools for the connected account.",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Stripe dashboard URLs, `sk_`/`rk_`/`pk_` API keys, or Stripe object IDs (cus_, pi_, ch_)","STRIPE_* environment variables or code that imports the `stripe` SDK","README/runbooks naming Stripe for billing, payments, or subscriptions"],helpText:"Query and manage Stripe payments, customers, and billing."})});var cde;var lde=h(()=>{de();cde=U({id:"supabase",label:"Supabase",iconKey:"supabase",defaultServerUrl:"https://mcp.supabase.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"supabase",callbackPathSegment:"supabase",authorizationUrl:"https://api.supabase.com/v1/oauth/authorize",tokenUrl:"https://api.supabase.com/v1/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://api.supabase.com/platform/oauth/apps/register",tokenEndpointAuthMethod:"client_secret_post"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"analytics:read"},{value:"auth:read"},{value:"auth:write"},{value:"database:read"},{value:"database:write"},{value:"domains:read"},{value:"domains:write"},{value:"edge_functions:read"},{value:"edge_functions:write"},{value:"environment:read"},{value:"environment:write"},{value:"organizations:read"},{value:"projects:read"},{value:"projects:write"},{value:"rest:read"},{value:"rest:write"},{value:"secrets:read"},{value:"secrets:write"},{value:"storage:read"}],getUrlConfiguration:async()=>({docsUrl:"https://supabase.com/docs/guides/getting-started/mcp#step-2-configure-your-ai-tool",instructions:"Choose your project and options in the Supabase configuration panel, then copy the generated Server URL.",defaultServerUrl:"https://mcp.supabase.com/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["supabase/ directory, supabase/config.toml, or @supabase packages","SUPABASE_* or NEXT_PUBLIC_SUPABASE_* environment variables","README/docs naming Supabase for Postgres, Auth, Storage, or Edge Functions"],helpText:"Manage Supabase organizations, projects, databases, and run SQL.",skill:"supabase",setupSkill:"supabase-setup"})});var ude;var dde=h(()=>{de();ude=U({id:"superhuman",label:"Superhuman",iconKey:"superhuman",defaultServerUrl:"https://mcp.mail.superhuman.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"superhuman",callbackPathSegment:"superhuman",authorizationUrl:"https://mcp.auth.mail.superhuman.com/oauth2/authorize",tokenUrl:"https://mcp.auth.mail.superhuman.com/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.auth.mail.superhuman.com/oauth2/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"email",required:!0},{value:"offline_access",required:!0},{value:"openid",required:!0},{value:"profile",required:!0}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Superhuman mail links, SUPERHUMAN_* environment variables, or support workflows naming Superhuman","Customer communication runbooks that depend on email search or drafting","Docs naming Superhuman Mail for sales, support, or founder-led customer comms"],helpText:"Search, draft, send, and triage emails in Superhuman Mail."})});var pde;var gde=h(()=>{_t();de();pde=U({id:"the-context-company",label:"The Context Company",iconKey:"the-context-company",defaultServerUrl:"https://api.thecontext.company/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!1},evidenceHints:["The Context Company, context company, or context observability references","insight_search, get_agent_runs, or get_agent_sessions tool usage","THE_CONTEXT_COMPANY_API_KEY or api.thecontext.company in MCP configuration"],helpText:"Query agent insights, runs, and sessions through The Context Company's read-only hosted MCP server.",setupGroups:[{id:"api-key",title:"Create a read-only API key",description:"Create the API key The Context Company's hosted MCP server will use.",body:"Generate a read-only API key on The Context Company's [Access Data page](https://www.thecontextcompany.com/prod/mcp-and-api), then paste the raw key below. Sazabi sends it as `Authorization: Bearer <key>` to `https://api.thecontext.company/mcp`.",fieldKeys:["apiKey"]}],validateCredentials:wce,normalizeHeaders:vce,skill:"the-context-company",setupSkill:"the-context-company-setup"})});var mde;var hde=h(()=>{de();mde=U({id:"vercel",label:"Vercel",iconKey:"vercel",defaultServerUrl:"https://mcp.vercel.com",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"vercel",callbackPathSegment:"vercel",authorizationUrl:"https://vercel.com/oauth/authorize",tokenUrl:"https://vercel.com/api/login/oauth/token",resourceUrl:"https://mcp.vercel.com",dynamicClientRegistration:{registrationEndpoint:"https://vercel.com/api/login/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"offline_access",required:!0}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["vercel.com links, VERCEL_* environment variables, or a vercel.json in the repo","Deploy workflows or runbooks naming Vercel as the frontend/hosting provider","Vercel project/deployment IDs or preview URLs referenced in docs or CI"],helpText:"Manage Vercel projects, deployments, and access Vercel platform documentation. Coming soon — Vercel's hosted MCP only authorizes allowlisted clients and Sazabi is pending approval, so it isn't connectable yet."})});var Ade;var fde=h(()=>{_t();de();Ade=U({id:"x",label:"X",iconKey:"x",defaultServerUrl:"https://api.x.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{readOnlyToolNames:["search_news","get_news","get_trends_by_woeid","get_posts_by_ids","get_posts_counts_recent","search_posts_all","get_posts_by_id","get_posts_liking_users","get_posts_quoted_posts","get_posts_reposted_by","get_users_by_usernames","get_users_by_username","get_users_me","search_users","get_users_by_id","get_users_bookmarks","get_users_bookmark_folders","get_users_bookmarks_by_folder_id","get_users_mentions","get_users_timeline","get_users_posts"]},evidenceHints:["X (Twitter) API usage, X_BEARER_TOKEN, or TWITTER_* environment variables","twitter-api-v2, tweepy, or other X/Twitter API client packages","README/docs naming the X API, X Developer Platform, or tweet automation"],helpText:"Search X posts and access real-time X data using your app's app-only Bearer Token.",setupGroups:[{id:"developer-app",title:"Open the X Developer Portal",description:"Use an X developer project/app with access to the X API v2.",body:"Go to the [X Developer Portal](https://developer.x.com/en/portal/dashboard), open the project and app you want Sazabi to use, and confirm the app has access to the API tiers you need. The hosted MCP server lives at `https://api.x.com/mcp`."},{id:"bearer-token",title:"Copy the app's Bearer Token",description:"Copy the app-only Bearer Token the hosted MCP server will use.",body:"In your app's **Keys and tokens**, find the app-only **Bearer Token** and copy it (regenerate it if you don't have it saved). This is the app-only token, not a user OAuth 2.0 access token. Paste the raw token into Sazabi — Sazabi adds the `Bearer ` prefix and sends it in the `Authorization` header.",fieldKeys:["accessToken"]}],validateCredentials:Ece,normalizeHeaders:Cce,skill:"x",setupSkill:"x-setup"})});var bde,D0t;var Ide=h(()=>{sle();cle();ule();ple();mle();sS();sS();fle();ble();Sle();vle();Ele();xle();Rle();Ble();_le();Lle();Nle();zle();Ule();$le();qle();Vle();Yle();Jle();Xle();tue();oue();iue();aue();lue();due();gue();hue();fue();bue();Sue();vue();Eue();xue();Rue();Bue();_ue();Lue();Nue();zue();Uue();$ue();que();Vue();Yue();Jue();Xue();tde();ode();ide();ade();lde();dde();gde();hde();fde();bde=[cde,Fle,Gle,ale,ile,lle,dle,gle,hle,Ale,yle,Ile,Cle,wle,kle,Tle,Ole,Dle,Qle,Ple,Mle,jle,Hle,Kle,Wle,Zle,eue,nue,rue,sue,cue,uue,pue,mue,Aue,yue,Iue,Cue,wue,kue,Pue,Tue,Oue,Due,Que,Mue,jue,Gue,Fue,Hue,Kue,Wue,Zue,ede,nde,rde,sde,ude,pde,mde,Ade],D0t=new Map(bde.map((e)=>[e.id,e]))});var Sde=()=>{};var Cde=()=>{};var vde=()=>{};var wde=()=>{};var Ede=()=>{};var kde=()=>{};var xde=()=>{};var Pde=()=>{};var Rde=()=>{};var Tde=()=>{};var Bde=()=>{};var Ode=()=>{};var _de=()=>{};var Dde=()=>{};var Lde=()=>{};var Qde=()=>{};var Nde=()=>{};var Mde=()=>{};var zde=()=>{};var jde=()=>{};var Ude=()=>{};var Fde=()=>{};var $de=()=>{};var Gde=()=>{};var qde=()=>{};var Hde=()=>{};var Vde=()=>{};var Kde=()=>{};var Yde=()=>{};var Wde=()=>{};var Jde=()=>{};var Zde=()=>{};var Xde=()=>{};var epe=()=>{};var tpe=()=>{};var npe=()=>{};var ope=()=>{};var rpe=()=>{};var ipe=()=>{};var spe=()=>{};var ape=()=>{};var cpe=()=>{};var lpe=()=>{};var upe=()=>{};var dpe=h(()=>{Sde();Cde();vde();wde();Ede();kde();xde();Pde();Rde();Tde();Bde();Ode();_de();Dde();Lde();Qde();Nde();Mde();zde();jde();Ude();Fde();$de();Gde();qde();Hde();Vde();Kde();Yde();Wde();Jde();Zde();Xde();epe();tpe();npe();ope();rpe();ipe();spe();ape();cpe();lpe();upe()});var ppe=h(()=>{sS()});var gpe=()=>{};var mpe=h(()=>{QW();oy();mce();_t();Xce();ele();Ide();wN();dpe();ppe();gpe()});var hpe,K9e,Ape,Y9e,fpe,EN,ype,bpe,Ss,Ipe,Spe,Cpe,Iu,vpe,wpe,Su,Epe,kpe,Cu,xpe,W9e,Ppe,aS,Rpe,Tpe,Bpe,Ope,vu,_pe,Dpe,wu,Lpe,Qpe,Eu,kN,xN,Npe,Mpe,ku,zpe,jpe,xu,Upe,J9e,Pu,Fpe,$pe,Ru,Gpe,qpe,Tu,Hpe,Vpe,Bu,Z9e;var PN=h(()=>{mpe();Oe();Ve();hpe=["configured","authorizing","connected","error"],K9e=a.enum(hpe),Ape=["preset","custom"],Y9e=a.enum(Ape),fpe=["streamable-http","sse"],EN=a.enum(fpe),ype=["none","headers","oauth","aws-sigv4"],bpe=a.enum(ype),Ss=a.object({connectionId:a.string().uuid().describe("Connection ID."),connectionKey:a.string().describe("Stable key used to reference this connector in tool calls."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),displayName:a.string().describe("Human-readable connector name."),source:Y9e.describe("Whether the connector is a built-in preset or a custom server."),installStatus:K9e.describe("Current connection lifecycle status."),authMode:bpe.describe("Authentication mode."),transport:EN.describe("Transport protocol."),serverUrl:a.string().describe("MCP server URL."),readOnly:a.boolean().describe("Whether the connector is restricted to read-only tools."),management:QB.describe("Lifecycle owner and supported connector mutations."),enabledToolCount:a.number().int().nonnegative().describe("Number of tools enabled and available for this connector."),connectedAt:a.string().datetime().nullable().describe("When the connector last became connected, if ever."),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),Ipe=a.object({name:a.string().describe("Tool name as invoked."),title:a.string().describe("Human-readable tool title."),description:a.string().describe("Tool description."),isReadOnly:a.boolean().describe("Whether the tool is considered read-only."),enabled:a.boolean().describe("Whether the tool is enabled and available given the connector config.")}),Spe=a.object({projectId:a.string().uuid().optional().describe("Project to list connectors for. Auto-filled from SDK context when omitted."),connectedOnly:a.union([a.boolean(),a.stringbool()]).optional().describe("When true, only return connectors that are connected.")}),Cpe=a.object({connectors:a.array(Ss)}),Iu=w({operationId:"mcpConnectors.list",summary:"List MCP connectors",description:"List configured MCP connectors within one project with provider, status, and enabled-tool count.",backend:"api",route:{method:"GET",path:"/mcp-connectors",tags:["MCP Connectors"]},input:Spe,output:Cpe,pagination:"none",async:"sync"}),vpe=a.object({connectionId:a.string().uuid().describe("Connection ID to fetch."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),wpe=a.object({connector:Ss}),Su=w({operationId:"mcpConnectors.get",summary:"Get an MCP connector",description:"Get one configured MCP connector by connection ID.",backend:"api",route:{method:"GET",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"]},input:vpe,output:wpe,pagination:"none",async:"sync"}),Epe=a.object({connectionId:a.string().uuid().describe("Connection ID to inspect."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),kpe=a.object({connector:Ss,tools:a.array(Ipe)}),Cu=w({operationId:"mcpConnectors.details",summary:"Inspect an MCP connector's tools",description:"Inspect one MCP connector's tool surface, including each tool's name, description, and read-only status.",backend:"api",route:{method:"GET",path:"/mcp-connectors/{connectionId}/details",tags:["MCP Connectors"]},input:Epe,output:kpe,pagination:"none",async:"sync"}),xpe=a.object({providerId:a.string().describe('Provider identifier, e.g. "linear".'),label:a.string().describe("Human-readable provider name."),authMode:bpe.describe("Authentication mode."),availability:a.enum(nl).describe("Whether the provider is enabled or coming soon."),setupSkill:a.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),W9e=a.object({}),Ppe=a.object({providers:a.array(xpe)}),aS=w({operationId:"mcpConnectors.listProviders",summary:"List MCP connector providers",description:"List all supported MCP connector providers with their auth mode and setup skill.",backend:"api",route:{method:"GET",path:"/mcp-connectors/providers",tags:["MCP Connectors"]},input:W9e,output:Ppe,pagination:"none",async:"sync"}),Rpe=a.object({connectionKey:a.string().describe("Stable key used to call this connector."),displayName:a.string().describe("Human-readable connector name."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),toolCount:a.number().int().nonnegative().describe("Number of executable tools on this connector.")}),Tpe=a.object({connectionKey:a.string().describe("Connector that exposes this tool."),toolName:a.string().describe("Tool name as invoked."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),displayName:a.string().describe("Human-readable connector name."),isReadOnly:a.boolean().describe("Whether the tool is considered read-only."),description:a.string().describe("Tool description from the stored snapshot."),score:a.number().describe("BM25 rank score. Zero when enumerating a namespace."),inputSchema:a.record(a.string(),a.unknown()).optional().describe("JSON Schema for the tool's arguments, when requested.")}),Bpe=a.object({projectId:a.string().uuid().optional().describe("Project to search connectors in. Auto-filled from SDK context when omitted."),query:a.string().optional().describe("Free-text query over tool names, titles, connector keys, and descriptions. Omit or empty to list connectors, or to enumerate one connector when namespace is set."),namespace:a.string().min(1).optional().describe("Restrict results to one connectionKey or providerId."),limit:a.coerce.number().int().min(1).max(100).default(10).describe("Maximum number of connectors or tool hits to return."),offset:a.coerce.number().int().min(0).default(0).describe("Number of connectors or tool hits to skip."),includeInputSchema:a.union([a.boolean(),a.stringbool()]).optional().describe("Load one exact tool's inputSchema. Requires a connectionKey namespace and non-empty query; accepts either toolName or the hit's copy-paste name.")}).superRefine((e,t)=>{if(e.includeInputSchema===!0&&(!e.namespace?.trim()||!e.query?.trim()))t.addIssue({code:"custom",path:["includeInputSchema"],message:"Schema detail requires namespace and a non-empty exact tool name."})}),Ope=a.object({kind:a.enum(["connectors","tools"]).describe("connectors when the query is empty and no namespace is set; tools otherwise."),total:a.number().int().nonnegative().describe("Total matches before limit and offset."),connectors:a.array(Rpe).describe("Connector index. Empty when kind is tools."),tools:a.array(Tpe).describe("Ranked or enumerated tool hits. Empty when kind is connectors.")}),vu=w({operationId:"mcpConnectors.search",summary:"Search MCP connector tools",description:"Search executable third-party MCP connector tools by free-text query. Empty query lists connectors; empty query plus namespace enumerates that connector. Hits omit input schemas unless includeInputSchema is true, which requires one exact namespaced tool and always returns at most one hit.",backend:"api",route:{method:"GET",path:"/mcp-connectors/tools/search",tags:["MCP Connectors"]},input:Bpe,output:Ope,pagination:"none",async:"sync"}),_pe=a.object({projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),connectionKey:a.string().min(1).describe("Connector key from search or mcpConnectors.list."),toolName:a.string().min(1).describe("Tool name as invoked.")}),Dpe=a.object({connectionKey:a.string().describe("Connector that exposes this tool."),toolName:a.string().describe("Tool name as invoked."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),displayName:a.string().describe("Human-readable connector name."),title:a.string().describe("Human-readable tool title."),description:a.string().describe("Tool description from the stored snapshot."),isReadOnly:a.boolean().describe("Whether the tool is considered read-only."),inputSchema:a.record(a.string(),a.unknown()).describe("JSON Schema for the tool's arguments.")}),wu=w({operationId:"mcpConnectors.describe",summary:"Describe an MCP connector tool",description:"Load one executable third-party MCP connector tool, including its input schema.",backend:"api",route:{method:"GET",path:"/mcp-connectors/tools/describe",tags:["MCP Connectors"]},input:_pe,output:Dpe,pagination:"none",async:"sync"}),Lpe=a.object({projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),connectionKey:a.string().min(1).describe("Connector key from search or mcpConnectors.list."),toolName:a.string().min(1).describe("Tool name as invoked."),arguments:a.record(a.string(),a.unknown()).optional().describe("Arguments matching the tool's input schema.")}),Qpe=a.discriminatedUnion("ok",[a.object({ok:a.literal(!0),connectionKey:a.string().describe("Connector that ran the tool."),toolName:a.string().describe("Tool name as invoked."),result:a.unknown().describe("Vendor tool result payload."),structuredContent:a.unknown().optional().describe("Structured content from the vendor when present."),content:a.array(a.record(a.string(),a.unknown())).describe("Raw MCP content parts from the vendor."),text:a.string().nullable().describe("Concatenated text content, if any.")}),a.object({ok:a.literal(!1),code:a.enum(["TOOL_NOT_ENABLED","READ_ONLY","MCP_ERROR"]).describe("Why the tool did not run."),message:a.string().describe("Caller-facing error message.")})]),Eu=w({operationId:"mcpConnectors.call",summary:"Call an MCP connector tool",description:"Invoke one executable third-party MCP connector tool using that connection's stored credential.",backend:"api",route:{method:"POST",path:"/mcp-connectors/tools/call",tags:["MCP Connectors"]},input:Lpe,output:Qpe,pagination:"none",async:"sync"}),kN=a.object({id:a.string().min(1).describe("Stable ID for this header (must be unique within the connector)."),name:a.string().trim().min(1).describe("HTTP header name."),value:a.string().min(1).describe("HTTP header value (passed verbatim).")}),xN=a.object({accessKeyId:a.string().trim().min(1).describe("AWS access key ID."),secretAccessKey:a.string().min(1).describe("AWS secret access key."),sessionToken:a.string().min(1).optional().describe("Optional session token for temporary credentials."),region:a.string().trim().min(1).describe("AWS region.")}),Npe=a.object({projectId:a.string().uuid().optional().describe("Project to create the connector in. Auto-filled from SDK context when omitted."),serverUrl:a.string().url().describe("MCP server URL (must be https)."),transport:EN.describe("Transport protocol."),headers:a.array(kN).optional().describe("HTTP headers to send with each request."),awsSigV4:xN.optional().describe("AWS SigV4 credentials for AWS MCP servers."),providerId:a.string().min(1).describe("Built-in preset provider ID (for example, linear or datadog)."),readOnly:a.boolean().optional().describe("Restrict the connector to read-only tools. Defaults to false.")}),Mpe=a.object({connector:Ss}),ku=w({operationId:"mcpConnectors.create",summary:"Create an MCP connector",description:"Create a preset MCP connector with header-based or AWS SigV4 authentication. The server URL must match the selected provider's supported endpoints. Connects immediately and returns the connector with its discovered tool snapshot.",backend:"api",route:{method:"POST",path:"/mcp-connectors",tags:["MCP Connectors"],successStatus:201},input:Npe,output:Mpe,pagination:"none",async:"sync"}),zpe=a.object({connectionId:a.string().uuid().describe("Connection ID to update."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),serverUrl:a.string().url().optional().describe("New MCP server URL."),transport:EN.optional().describe("New transport protocol."),headers:a.array(kN).optional().describe("Complete replacement header set. Replaces all existing headers."),awsSigV4:xN.optional().describe("Replacement AWS SigV4 credentials. Mutually exclusive with headers.")}),jpe=a.object({connector:Ss}),xu=w({operationId:"mcpConnectors.update",summary:"Update an MCP connector",description:"Deprecated. Preset MCP connector updates are no longer supported via the public API; disconnect and reconnect instead.",backend:"api",route:{method:"PATCH",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"]},input:zpe,output:jpe,pagination:"none",async:"sync"}),Upe=a.object({connectionId:a.string().uuid().describe("Connection ID to disconnect."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),J9e=a.void(),Pu=w({operationId:"mcpConnectors.disconnect",summary:"Disconnect an MCP connector",description:"Disconnect and permanently remove an MCP connector.",backend:"api",route:{method:"DELETE",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"],successStatus:204},input:Upe,output:J9e,pagination:"none",async:"sync"}),Fpe=a.object({connectionId:a.string().uuid().describe("Connection ID to update."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),readOnly:a.boolean().describe("True to restrict to read-only tools; false to allow all enabled tools.")}),$pe=a.object({connector:Ss}),Ru=w({operationId:"mcpConnectors.setReadOnly",summary:"Toggle an MCP connector's read-only mode",description:"Toggle the read-only restriction on an MCP connector.",backend:"api",route:{method:"PATCH",path:"/mcp-connectors/{connectionId}/read-only",tags:["MCP Connectors"]},input:Fpe,output:$pe,pagination:"none",async:"sync"}),Gpe=a.object({projectId:a.string().uuid().optional().describe("Project to install into. Auto-filled from SDK context when omitted."),providerId:a.string().min(1).describe('Provider ID to install, e.g. "linear".'),requestedScopes:a.array(a.string()).optional().describe("Scopes to request. Defaults to the provider's recommended scope set."),serverUrl:a.string().url().optional().describe("Server URL for multi-region providers; defaults to the provider's primary server."),readOnly:a.boolean().optional().describe("Restrict the connector to read-only tools after install. Defaults to false."),returnTo:a.string().optional().describe("Path to redirect the user to after OAuth completes.")}),qpe=a.object({authorizationUrl:a.string().describe("Authorization URL to open in the user's browser."),connectionId:a.string().uuid().describe("Connection ID to poll for completion via getMcpOAuthInstallAttempt."),expiresAt:a.string().datetime().describe("When the OAuth authorization attempt expires.")}),Tu=w({operationId:"mcpConnectors.beginOAuthInstall",summary:"Begin an MCP connector OAuth install",description:"Begin an OAuth browser flow to install a preset MCP connector. Opens an authorization URL in the user's browser; poll getMcpOAuthInstallAttempt with the returned connectionId to check completion.",backend:"api",route:{method:"POST",path:"/mcp-connectors/oauth/begin",tags:["MCP Connectors"],successStatus:201},input:Gpe,output:qpe,pagination:"none",async:"sync"}),Hpe=a.object({connectionId:a.string().uuid().describe("Connection ID returned by beginMcpOAuthInstall."),projectId:a.string().uuid().optional().describe("Project the connection belongs to. Auto-filled from SDK context when omitted.")}),Vpe=a.object({status:a.enum(["authorizing","connected","error"]).describe("Current install status."),connector:Ss.optional().describe("Connector details once connected or in error state.")}),Bu=w({operationId:"mcpConnectors.getOAuthInstallAttempt",summary:"Get an MCP connector OAuth install attempt",description:"Poll the status of an in-progress OAuth MCP connector install. Returns authorizing while the user completes the browser flow, connected on success, or error on failure.",backend:"api",route:{method:"GET",path:"/mcp-connectors/oauth/attempts/{connectionId}",tags:["MCP Connectors"]},input:Hpe,output:Vpe,pagination:"none",async:"sync"}),Z9e={list:Iu.contract,get:Su.contract,details:Cu.contract,listProviders:aS.contract,search:vu.contract,describe:wu.contract,call:Eu.contract,create:ku.contract,update:xu.contract,disconnect:Pu.contract,setReadOnly:Ru.contract,beginOAuthInstall:Tu.contract,getOAuthInstallAttempt:Bu.contract}});var Cs,X9e,e6e,t6e,n6e,o6e,r6e,i6e,RN,CFt;var cS=h(()=>{Oe();Ve();Cs=a.enum(["admin","member"]),X9e=a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional(),role:Cs}),e6e=a.object({id:a.string().min(1),name:a.string().nullable(),email:a.string().email()}),t6e=a.object({credentialType:a.literal("user"),user:e6e,authorizedOrganizationId:a.string().min(1).nullable(),authorizedProjectId:a.string().min(1).nullable(),organizations:a.array(X9e).describe("Organizations the user belongs to, including membership role.")}),n6e=a.object({credentialType:a.literal("secret"),organization:a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional()}),keyName:a.string()}),o6e=a.object({credentialType:a.literal("partner"),superorganization:a.object({id:a.string().uuid(),name:a.string()})}),r6e=a.object({}),i6e=a.discriminatedUnion("credentialType",[t6e,n6e,o6e]),RN=w({operationId:"me.get",summary:"Get the current credential",description:"Return the identity and available context for the current credential.",backend:"api",route:{method:"GET",path:"/me",tags:["Auth"]},input:r6e,output:i6e,pagination:"none",async:"sync"}),CFt=RN.contract});var Kpe,Ype,Wpe,s6e,a6e,c6e,l6e,u6e,d6e,TN,BN,ON,p6e,g6e,m6e,h6e,A6e,f6e,_N,DN,LN,xFt;var Jpe=h(()=>{Oe();Ve();cS();Kpe=a.object({membershipId:a.string().min(1).describe("Organization membership record ID."),userId:a.string().min(1).describe("User ID for the organization member."),name:a.string().nullable().describe("Display name for the member, when available."),email:a.string().email().describe("Email address for the member."),imageUrl:a.string().nullable().describe("Profile image URL for the member, when available."),role:Cs.describe("Organization role."),createdAt:a.string().datetime().describe("When the membership was created.")}),Ype=a.object({id:a.string().min(1).describe("Invitation ID."),email:a.string().email().describe("Invited email address."),role:Cs.describe("Role the invitee will receive when they accept."),status:a.string().min(1).describe('Invitation status (e.g. "pending").'),createdAt:a.string().datetime().describe("When the invitation was created."),expiresAt:a.string().datetime().describe("When the invitation expires.")}),Wpe=a.string().min(1).describe("A user ID, or a URL-encoded email address, of the member."),s6e=a.object({organizationId:a.string().min(1).optional().describe("Organization to list members for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),a6e=a.object({members:a.array(Kpe).describe("Members visible within the selected organization.")}),c6e=a.object({organizationId:a.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),member:Wpe.describe("User ID, or URL-encoded email address, of the member to update."),role:Cs.describe("Role to assign.")}),l6e=a.object({member:Kpe.describe("Updated organization member.")}),u6e=a.object({params:a.object({member:Wpe.describe("User ID, or URL-encoded email address, of the member to remove.")}),query:a.object({organizationId:a.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")})}).transform(({params:e,query:t})=>({...t,...e})),d6e=a.object({removedUserId:a.string().min(1).describe("User ID removed from the organization.")}),TN=w({operationId:"members.list",summary:"List members",description:"List members in an organization.",backend:"api",route:{method:"GET",path:"/members",tags:["Members"]},input:s6e,output:a6e,pagination:"none",async:"sync",examples:[{name:"organization-members",input:{organizationId:"organization-123"},output:{members:[{membershipId:"membership-123",userId:"user-123",name:"Alex Admin",email:"alex@example.com",imageUrl:null,role:"admin",createdAt:"2026-01-01T00:00:00.000Z"}]}}]}),BN=w({operationId:"members.updateRole",summary:"Update a member's role",description:"Update a member's organization role.",backend:"api",route:{method:"PATCH",path:"/members/{member}/role",tags:["Members"]},input:c6e,output:l6e,pagination:"none",async:"sync",examples:[{name:"promote-member",input:{organizationId:"organization-123",member:"user-456",role:"admin"},output:{member:{membershipId:"membership-456",userId:"user-456",name:"Mina Member",email:"mina@example.com",imageUrl:null,role:"admin",createdAt:"2026-01-01T00:00:00.000Z"}}}]}),ON=w({operationId:"members.remove",summary:"Remove a member",description:"Remove a member from an organization.",backend:"api",route:{method:"DELETE",path:"/members/{member}",tags:["Members"],inputStructure:"detailed"},input:u6e,output:d6e,pagination:"none",async:"sync"}),p6e=a.object({organizationId:a.string().min(1).optional().describe("Organization to invite into. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),email:a.string().email().describe("Email address to invite."),role:Cs.optional().default("member").describe('Role to grant on acceptance. Defaults to "member".')}),g6e=a.object({invitation:Ype.describe("The created pending invitation.")}),m6e=a.object({organizationId:a.string().min(1).optional().describe("Organization to list invitations for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),h6e=a.object({invitations:a.array(Ype).describe("Pending invitations visible within the selected organization.")}),A6e=a.object({params:a.object({invitationId:a.string().min(1).describe("ID of the invitation to revoke.")}),query:a.object({organizationId:a.string().min(1).optional().describe("Organization containing the invitation. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")})}).transform(({params:e,query:t})=>({...t,...e})),f6e=a.object({revokedInvitationId:a.string().min(1).describe("ID of the revoked invitation.")}),_N=w({operationId:"members.invite",summary:"Invite a member",description:"Invite a person to the organization by email.",backend:"api",route:{method:"POST",path:"/members/invitations",tags:["Members"],successStatus:201},input:p6e,output:g6e,pagination:"none",async:"sync",examples:[{name:"invite-member",input:{organizationId:"organization-123",email:"newhire@example.com",role:"member"},output:{invitation:{id:"invitation-123",email:"newhire@example.com",role:"member",status:"pending",createdAt:"2026-01-01T00:00:00.000Z",expiresAt:"2026-01-08T00:00:00.000Z"}}}]}),DN=w({operationId:"members.listInvitations",summary:"List invitations",description:"List pending invitations for an organization.",backend:"api",route:{method:"GET",path:"/members/invitations",tags:["Members"]},input:m6e,output:h6e,pagination:"none",async:"sync",examples:[{name:"organization-invitations",input:{organizationId:"organization-123"},output:{invitations:[{id:"invitation-123",email:"newhire@example.com",role:"member",status:"pending",createdAt:"2026-01-01T00:00:00.000Z",expiresAt:"2026-01-08T00:00:00.000Z"}]}}]}),LN=w({operationId:"members.revokeInvitation",summary:"Revoke an invitation",description:"Revoke a pending invitation.",backend:"api",route:{method:"DELETE",path:"/members/invitations/{invitationId}",tags:["Members"],inputStructure:"detailed"},input:A6e,output:f6e,pagination:"none",async:"sync"}),xFt={list:TN.contract,updateRole:BN.contract,remove:ON.contract,invite:_N.contract,listInvitations:DN.contract,revokeInvitation:LN.contract}});var Xpe,ege,lS,tge,uS,Zpe=4194304,QN,NN,y6e=(e)=>{let t=e.split(",").map((r)=>r.trim()).filter(Boolean),n=a.array(lS).safeParse(t);if(!n.success)throw Error("Kind filter must be a comma-separated list of note, runbook, or change.");return n.data},gm,MN,zN,nge,oge,rge,ige,sge,age,cge,lge,uge,dge,pge,gge,Ou,_u,Du,Lu,Qu,b6e;var jN=h(()=>{Oe();Ve();Xpe=["note","runbook"],ege=["note","runbook","change"],lS=a.enum(ege),tge=a.enum(Xpe),uS=a.string().min(1).max(512).refine((e)=>!e.startsWith("/"),{message:"Path must be relative without a leading slash."}).describe("Relative memory path, for example AGENTS.md or notes/architecture.md."),QN=a.string().min(1).refine((e)=>new TextEncoder().encode(e).length<=Zpe,{message:`Memory body must be at most ${Zpe} bytes (4 MiB).`}).describe("Document body stored in project memory."),NN=a.string().regex(/^(\d+)(s|m|h|d)$/u,"Duration must use s, m, h, or d units, for example 7d or 30m.").describe("Relative time window, for example 7d or 30m."),gm=a.string().min(1).transform(y6e).describe("Comma-separated kinds, for example note,runbook."),MN=a.object({id:a.string().uuid(),projectId:a.string().uuid(),kind:lS,managed:a.boolean(),path:a.string().nullable(),title:a.string().nullable(),contentHash:a.string(),attrs:a.record(a.string(),a.unknown()),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),zN=MN.extend({body:QN}),nge=a.object({projectId:a.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),path:uS.describe("Relative path for the curated document."),body:QN,kind:tge.default("note").describe("Curated document kind. Only note and runbook may be written through the API."),title:a.string().max(500).optional().describe("Optional display title. Defaults to the path basename.")}),oge=a.object({document:zN}),rge=a.object({projectId:a.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),id:a.string().uuid().optional().describe("Document id."),path:uS.optional().describe("Relative curated path.")}).superRefine((e,t)=>{let n=e.id!==void 0,r=e.path!==void 0;if(n===r)t.addIssue({code:"custom",message:"Provide exactly one of id or path."})}),ige=a.object({document:zN}),sge=a.object({projectId:a.string().uuid().optional().describe("Project to list memory for. Auto-filled from CLI and SDK context when omitted."),kind:gm.optional(),since:NN.optional().describe("Only return documents updated within this window, for example 7d."),service:a.string().min(1).optional().describe("Filter to documents whose attrs.services contains this value."),pathPrefix:a.string().min(1).optional().describe("Filter to paths starting with this prefix."),managed:a.coerce.boolean().optional(),cursor:a.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of documents to return per page.")}),age=a.object({documents:a.array(MN),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),cge=a.object({documentId:a.string().uuid(),kind:lS,managed:a.boolean(),path:a.string().nullable(),title:a.string().nullable(),snippet:a.string(),score:a.number()}),lge=a.object({calibrated:a.literal(!0),minScoreThreshold:a.number(),queryTerms:a.array(a.string()),message:a.string()}),uge=a.object({projectId:a.string().uuid().optional().describe("Project to search memory for. Auto-filled from CLI and SDK context when omitted."),query:a.string().trim().min(1).max(500).describe("Natural-language search query."),kind:gm.optional(),since:NN.optional(),service:a.string().min(1).optional(),pathPrefix:a.string().min(1).optional(),managed:a.coerce.boolean().optional(),limit:a.coerce.number().int().min(1).max(50).default(10).describe("Maximum ranked search hits to return.")}),dge=a.object({hits:a.array(cge),emptyVerdict:lge.nullable()}),pge=a.object({projectId:a.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),id:a.string().uuid().optional().describe("Document id."),path:uS.optional()}).superRefine((e,t)=>{let n=e.id!==void 0,r=e.path!==void 0;if(n===r)t.addIssue({code:"custom",message:"Provide exactly one of id or path."})}),gge=a.void(),Ou=w({operationId:"memory.put",summary:"Create or replace a memory document",description:"Create or replace a curated project memory document. Embeds on success.",backend:"api",route:{method:"PUT",path:"/memory",tags:["Memory"]},input:nge,output:oge,pagination:"none",async:"sync"}),_u=w({operationId:"memory.get",summary:"Get a memory document",description:"Get one project memory document by id or path.",backend:"api",route:{method:"GET",path:"/memory/document",tags:["Memory"]},input:rge,output:ige,pagination:"none",async:"sync"}),Du=w({operationId:"memory.list",summary:"List memory documents",description:"List project memory catalog rows without embedding search.",backend:"api",route:{method:"GET",path:"/memory",tags:["Memory"]},input:sge,output:age,pagination:"cursor",async:"sync"}),Lu=w({operationId:"memory.search",summary:"Search project memory",description:"Hybrid semantic and keyword search over project memory documents.",backend:"api",route:{method:"POST",path:"/memory/search",tags:["Memory"]},input:uge,output:dge,pagination:"none",async:"sync"}),Qu=w({operationId:"memory.delete",summary:"Delete a memory document",description:"Soft-delete a curated project memory document by id or path.",backend:"api",route:{method:"DELETE",path:"/memory/document",successStatus:204,tags:["Memory"]},input:pge,output:gge,pagination:"none",async:"sync"}),b6e={put:Ou.contract,get:_u.contract,list:Du.contract,search:Lu.contract,delete:Qu.contract}});var mge,hge,I6e,S6e,C6e,v6e,w6e,mm,E6e,k6e,x6e,UN,FN,$N,GN,DFt;var dS=h(()=>{Oe();Ve();mge=a.enum(["processing","completed","aborted","error"]),hge=a.object({id:a.string().uuid(),threadId:a.string().uuid(),userMessageId:a.string().uuid().nullable(),assistantMessageId:a.string().uuid().nullable(),workflowRunId:a.string().nullable(),status:mge,source:a.enum(["app","api","mcp","slack","teams","linear","github","agent","cli","web","sdk","bitbucket","system"]),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),completedAt:a.string().datetime().nullable()}),I6e=a.object({projectId:a.string().uuid().optional().describe("Project ID to list runs for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:a.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),S6e=a.object({runs:a.array(hge),nextCursor:a.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),C6e=a.object({threadId:a.string().uuid().describe("Thread ID to list runs for."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:a.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),v6e=a.object({runs:a.array(hge),nextCursor:a.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),w6e=a.object({runId:a.string().uuid().describe("Run ID returned by a deferred operation.")}),mm=a.object({completed:a.boolean().describe("Whether the run has reached a terminal status."),threadId:a.string().uuid().describe("Thread ID associated with the run."),runId:a.string().uuid().describe("Run ID for subsequent polling."),messageId:a.string().uuid().optional().describe("ID of the user message that triggered this run."),status:mge.describe("Current run lifecycle status."),response:a.string().nullable().describe("Assistant response text when the run has completed.")}),E6e=mm.describe("Current run state and, when complete, the assistant response."),k6e=a.object({runId:a.string().uuid().describe("Run ID of the in-flight run to request cancellation for.")}),x6e=a.object({success:a.literal(!0).describe("Always true when the cancellation request was accepted.")}),UN=w({operationId:"runs.list",summary:"List runs",description:"List deferred runs within one project.",backend:"api",route:{method:"GET",path:"/runs",tags:["Runs"]},input:I6e,output:S6e,pagination:"cursor",async:"sync"}),FN=w({operationId:"runs.listForThread",summary:"List runs for a thread",description:"List deferred runs for one thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/runs",tags:["Runs"]},input:C6e,output:v6e,pagination:"cursor",async:"sync"}),$N=w({operationId:"runs.get",summary:"Get a run",description:"Get the current result for a deferred run by run ID.",backend:"api",route:{method:"GET",path:"/runs/{runId}",tags:["Runs"]},input:w6e,output:E6e,pagination:"none",async:"sync",examples:[{name:"processing-run",input:{runId:"33333333-3333-4333-8333-333333333333"},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]}),GN=w({operationId:"runs.cancel",summary:"Cancel a run",description:"Request cancellation of an in-flight run. Idempotent and best-effort: returns success even when the run has already reached a terminal status.",backend:"api",route:{method:"POST",path:"/runs/{runId}/cancel",tags:["Runs"]},input:k6e,output:x6e,pagination:"none",async:"sync",examples:[{name:"cancel-processing-run",input:{runId:"33333333-3333-4333-8333-333333333333"},output:{success:!0}}]}),DFt={list:UN.contract,listForThread:FN.contract,get:$N.contract,cancel:GN.contract}});var pS=(e,t,n)=>{let r=t?20000:1e4;if(e.length>r)n.addIssue({code:"too_big",maximum:r,type:"string",inclusive:!0,message:`Message cannot exceed ${r} characters`,origin:"string",path:["message"]})},gS=(e,t,n)=>{if(e&&!t)n.addIssue({code:"custom",message:"ambientServiceRun requires an automationId",path:["ambientServiceRun"]})};var Age,hm,P6e,R6e,T6e,B6e,O6e,_6e,D6e,L6e,Q6e,qN,N6e,M6e,z6e,j6e,U6e,F6e,$6e,G6e,q6e,H6e,V6e,K6e,HN,VN,KN,YN,WN,JN,fge,Y6e,W6e,J6e,Z6e,yge,X6e,e5e,t5e,n5e,o5e,r5e,$a="22222222-2222-4222-8222-222222222222",bge="11111111-1111-4111-8111-111111111111",i5e="44444444-4444-4444-8444-444444444444",Ige="55555555-5555-4555-8555-555555555555",ZN,XN,e0,t0,n0,UFt;var o0=h(()=>{Oe();Ve();dS();Age=a.enum(["slack","teams","linear","github","app","mcp","agent","api","cli","web","sdk","bitbucket","system"]),hm=a.object({id:a.string().uuid(),projectId:a.string().uuid(),title:a.string().nullable(),status:a.enum(["regular","archived"]),source:Age.nullable(),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),P6e=a.object({type:a.literal("message"),message:a.string()}),R6e=a.object({type:a.literal("reasoning"),reasoning:a.string(),status:a.enum(["in_progress","complete"]).optional()}),T6e=a.object({type:a.literal("tool_call"),name:a.string(),params:a.any().optional(),result:a.any().optional(),status:a.enum(["in_progress","success","error","unknown"]).optional(),toolCallId:a.string().optional(),durationMs:a.number().nonnegative().optional()}),B6e=a.object({type:a.literal("artifact"),name:a.enum(["timeseries","table","log_detail","integration_required","alert_card","issue_card","mdx"]),data:a.any(),toolCallId:a.string().optional()}),O6e=a.object({type:a.literal("fork"),sourceThreadId:a.string(),sourceMessageId:a.string(),sourceThreadTitle:a.string().nullable()}),_6e=a.object({type:a.literal("summary"),summary:a.string()}),D6e=a.object({type:a.literal("slack_context"),channelId:a.string(),isTruncated:a.boolean().optional(),messages:a.array(a.object({timestamp:a.string(),slackUserId:a.string().optional(),displayName:a.string(),text:a.string(),isBot:a.boolean(),files:a.array(a.object({name:a.string(),mimetype:a.string(),size:a.number().optional(),attachmentId:a.string().uuid().optional(),ingestionStatus:a.enum(["attached","unsupported","oversized","skipped","unavailable"]).optional()})).optional()}))}),L6e=a.object({type:a.literal("teams_context"),conversationId:a.string(),isTruncated:a.boolean().optional(),messages:a.array(a.object({activityId:a.string().optional(),displayName:a.string(),text:a.string(),isBot:a.boolean(),createdDateTime:a.string().optional()}))}),Q6e=a.union([P6e,R6e,T6e,B6e,O6e,_6e,D6e,L6e]),qN=a.object({id:a.string().uuid(),role:a.enum(["user","assistant"]),content:a.array(Q6e),source:Age,createdAt:a.string().datetime()}),N6e=a.object({projectId:a.string().uuid().optional().describe("Project to list threads for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of threads to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:a.enum(["regular","archived"]).optional().describe("Filter by thread status. 'regular' returns active threads, 'archived' returns archived threads.")}),M6e=a.object({threads:a.array(hm).describe("The page of threads matching the query."),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),z6e=a.object({threadId:a.string().uuid().describe("Thread ID returned by threads.list or threads.create.")}),j6e=a.object({thread:hm.describe("The requested thread."),messages:a.array(qN).describe("Messages currently stored on the thread in chronological order.")}),U6e=a.object({projectId:a.string().uuid().optional().describe("Project to create the thread in. Auto-filled from CLI and SDK context when omitted."),message:a.string().min(1,"Message cannot be empty").describe("Initial user message that starts the thread."),wait:a.boolean().default(!0).describe("Whether the server should wait for the agent run before responding."),timeoutSeconds:a.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling."),automationId:a.string().uuid().optional().describe("Internal automation context. Set by the Sazabi CLI when an automation script starts an agent run."),ambientServiceRun:a.literal(!0).optional().describe("Internal marker for scheduler-originated ambient service work. Honored only for system secret-key requests with matching automation context.")}).superRefine((e,t)=>{pS(e.message,e.automationId,t),gS(e.ambientServiceRun,e.automationId,t)}),F6e=mm.describe("Deferred run result for creating a thread."),$6e=a.object({threadId:a.string().uuid().describe("Thread ID whose current processing status should be returned.")}),G6e=a.object({status:a.enum(["idle","processing"]),lastRunStatus:a.enum(["error"]).nullable()}),q6e=a.object({threadId:a.string().uuid().describe("Thread ID whose active run should be stopped.")}),H6e=a.object({success:a.literal(!0).describe("Always true when the stop request was accepted.")}),V6e=a.object({threadId:a.string().uuid().describe("Thread ID of the thread to update."),status:a.enum(["regular","archived"]).describe("New status for the thread. 'archived' hides the thread from the sidebar.")}),K6e=a.object({thread:hm.describe("The updated thread.")}),HN=w({operationId:"threads.list",summary:"List threads",description:"List threads in a project, optionally filtered by status.",backend:"api",route:{method:"GET",path:"/threads",tags:["Threads"]},input:N6e,output:M6e,pagination:"cursor",async:"sync",examples:[{name:"active-threads",input:{projectId:"11111111-1111-4111-8111-111111111111",status:"regular",limit:10},output:{threads:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"API returning 500s",status:"regular",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:05:00.000Z"}],nextCursor:null}}]}),VN=w({operationId:"threads.get",summary:"Get a thread",description:"Get a thread and its messages.",backend:"api",route:{method:"GET",path:"/threads/{threadId}",tags:["Threads"]},input:z6e,output:j6e,pagination:"none",async:"sync"}),KN=w({operationId:"threads.getStatus",summary:"Get a thread's status",description:"Get the current processing status for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/status",tags:["Threads"]},input:$6e,output:G6e,pagination:"none",async:"sync",examples:[{name:"processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{status:"processing",lastRunStatus:null}}]}),YN=w({operationId:"threads.stop",summary:"Stop a thread's run",description:"Stop a thread's in-flight run. Idempotent and best-effort: returns success even when the thread has no active run.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/stop",tags:["Threads"]},input:q6e,output:H6e,pagination:"none",async:"sync",examples:[{name:"stop-processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{success:!0}}]}),WN=w({operationId:"threads.create",summary:"Create a thread",description:"Create a thread with an initial message and optionally wait for the agent response.",backend:"api",route:{method:"POST",path:"/threads",tags:["Threads"],successStatus:201},input:U6e,output:F6e,pagination:"none",async:"deferred",examples:[{name:"async-handoff",input:{projectId:"11111111-1111-4111-8111-111111111111",message:"Investigate elevated 500s in production.",wait:!1,timeoutSeconds:20},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]}),JN=w({operationId:"threads.update",summary:"Update a thread",description:"Update a thread's status.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}",tags:["Threads"]},input:V6e,output:K6e,pagination:"none",async:"sync",examples:[{name:"archive-thread",input:{threadId:"22222222-2222-4222-8222-222222222222",status:"archived"},output:{thread:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"API returning 500s",status:"archived",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:10:00.000Z"}}}]}),fge=a.enum(["private","organization"]),Y6e=a.object({threadId:a.string().uuid().describe("Thread ID of the source thread to fork."),messageId:a.string().uuid().describe("Message ID in the source thread to fork from. The new thread copies messages up to and including this message.")}),W6e=a.object({thread:hm.describe("The newly created forked thread.")}),J6e=a.object({threadId:a.string().uuid().describe("Thread ID of the thread to update."),visibility:fge.describe("New visibility. 'private' restricts the thread to its owner; 'organization' shares it with the organization.")}),Z6e=a.object({thread:hm.describe("The updated thread."),visibility:fge.describe("The thread's resulting visibility.")}),yge=a.object({shareId:a.string().uuid().describe("Unique identifier for the snapshot."),threadId:a.string().uuid().describe("Thread the snapshot was taken from."),url:a.string().describe("Public read-only URL for the snapshot."),createdAt:a.string().datetime()}),X6e=a.object({threadId:a.string().uuid().describe("Thread ID to create a public read-only snapshot for.")}),e5e=a.object({share:yge.describe("The created share link.")}),t5e=a.object({threadId:a.string().uuid().describe("Thread ID the snapshot belongs to."),shareId:a.string().uuid().describe("Snapshot ID to revoke.")}),n5e=a.void(),o5e=a.object({threadId:a.string().uuid().describe("Thread ID to list public snapshots for.")}),r5e=a.object({shares:a.array(yge).describe("Active share links for the thread.")}),ZN=w({operationId:"threads.fork",summary:"Fork a thread",description:"Fork a thread from a specific message, creating a new thread that copies messages up to that point.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/fork",tags:["Threads"],successStatus:201},input:Y6e,output:W6e,pagination:"none",async:"sync",examples:[{name:"fork-from-message",input:{threadId:$a,messageId:i5e},output:{thread:{id:"66666666-6666-4666-8666-666666666666",projectId:bge,title:"API returning 500s (fork)",status:"regular",source:"api",createdAt:"2026-01-01T00:20:00.000Z",updatedAt:"2026-01-01T00:20:00.000Z"}}}]}),XN=w({operationId:"threads.setVisibility",summary:"Set a thread's visibility",description:"Set a thread's visibility to private or organization.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}/visibility",tags:["Threads"]},input:J6e,output:Z6e,pagination:"none",async:"sync",examples:[{name:"make-private",input:{threadId:$a,visibility:"private"},output:{thread:{id:$a,projectId:bge,title:"API returning 500s",status:"regular",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:30:00.000Z"},visibility:"private"}}]}),e0=w({operationId:"threads.createShareLink",summary:"Create a thread share link",description:"Create a public read-only share link for a thread's current messages.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/share",tags:["Threads"],successStatus:201},input:X6e,output:e5e,pagination:"none",async:"sync",examples:[{name:"create-share-link",input:{threadId:$a},output:{share:{shareId:Ige,threadId:$a,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}}}]}),t0=w({operationId:"threads.listShareLinks",summary:"List thread share links",description:"List active public share links for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/share",tags:["Threads"]},input:o5e,output:r5e,pagination:"none",async:"sync",examples:[{name:"list-share-links",input:{threadId:$a},output:{shares:[{shareId:Ige,threadId:$a,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}]}}]}),n0=w({operationId:"threads.revokeShareLink",summary:"Revoke a thread share link",description:"Revoke a public share link for a thread.",backend:"api",route:{method:"DELETE",path:"/threads/{threadId}/share/{shareId}",successStatus:204,tags:["Threads"]},input:t5e,output:n5e,pagination:"none",async:"sync"}),UFt={list:HN.contract,get:VN.contract,getStatus:KN.contract,stop:YN.contract,create:WN.contract,update:JN.contract,fork:ZN.contract,setVisibility:XN.contract,createShareLink:e0.contract,listShareLinks:t0.contract,revokeShareLink:n0.contract}});var s5e,a5e,c5e,l5e,Sge,Cge;var vge=h(()=>{Oe();Ve();dS();o0();s5e=a.object({threadId:a.string().uuid().describe("Thread ID to list messages for."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of messages to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),a5e=a.object({messages:a.array(qN),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),c5e=a.object({threadId:a.string().uuid().describe("Thread ID to append the message to."),message:a.string().min(1,"Message cannot be empty").describe("Message body to append to the thread."),wait:a.boolean().default(!0).describe("Whether the server should wait for the appended message run before responding."),timeoutSeconds:a.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling."),automationId:a.string().uuid().optional().describe("Internal automation context. Set by the Sazabi CLI when an automation script starts an agent run."),ambientServiceRun:a.literal(!0).optional().describe("Internal marker for scheduler-originated ambient service work. Honored only for system secret-key requests with matching automation context.")}).superRefine((e,t)=>{pS(e.message,e.automationId,t),gS(e.ambientServiceRun,e.automationId,t)}),l5e=mm.describe("Deferred run result for appending a message to an existing thread."),Sge=w({operationId:"messages.list",summary:"List messages in a thread",description:"List messages in a thread with cursor pagination.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/messages",tags:["Messages"]},input:s5e,output:a5e,pagination:"cursor",async:"sync",examples:[{name:"thread-messages",input:{threadId:"22222222-2222-4222-8222-222222222222",limit:2},output:{messages:[{id:"33333333-3333-4333-8333-333333333333",role:"user",content:[{type:"message",message:"What changed in the intake pipeline?"}],source:"api",createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),Cge=w({operationId:"messages.append",summary:"Append a message to a thread",description:"Append a user message to an existing thread and trigger a deferred run.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/messages",successStatus:201,tags:["Messages"]},input:c5e,output:l5e,pagination:"none",async:"deferred",examples:[{name:"append-processing",input:{threadId:"22222222-2222-4222-8222-222222222222",message:"Follow up on the intake backlog.",wait:!1,timeoutSeconds:20},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]})});var ho,Ege,r0,Nu,i0,mS,vs,kge,wge;var Am=h(()=>{Oe();ho={IN_APP:"in_app",SLACK:"slack",SLACK_CHANNEL:"slack_channel",MICROSOFT_TEAMS_CHANNEL:"teams_channel",EMAIL:"email",SMS:"sms",INCIDENT_IO:"incident_io",PAGERDUTY:"pagerduty",ROOTLY:"rootly",WEBHOOK:"webhook"},Ege=[ho.IN_APP,ho.SLACK,ho.EMAIL,ho.SMS],r0=[ho.SLACK_CHANNEL,ho.MICROSOFT_TEAMS_CHANNEL,ho.INCIDENT_IO,ho.PAGERDUTY,ho.ROOTLY,ho.WEBHOOK],Nu=Object.values(ho),i0=[...Nu,"victorops"],mS=a.enum(Nu),vs=a.enum(r0),kge=[{channel:"in_app",name:"In-app",description:"Show notifications in your Sazabi notification feed.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/notifications"},{channel:"email",name:"Email",description:"Send notifications to your account email address.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/notifications"},{channel:"sms",name:"SMS",description:"Send notifications to your verified phone number.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/account?phone-number=add"},{channel:"slack",name:"Slack DMs",description:"Send personal notifications by Slack DM.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/connected-accounts/slack"},{channel:"slack_channel",name:"Slack",description:"Post this project's alerts to selected Slack channels.",scope:"project",destinationManagement:"slack_channels",projectIntegrationPath:"slack"},{channel:"teams_channel",name:"Microsoft Teams",description:"Post this project's alerts to selected Microsoft Teams channels.",scope:"project",destinationManagement:"teams_channels",projectIntegrationPath:"teams"},{channel:"incident_io",name:"incident.io",description:"Route this project's alerts to incident.io.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"incident-io"},{channel:"pagerduty",name:"PagerDuty",description:"Route this project's alerts to PagerDuty.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"pagerduty"},{channel:"rootly",name:"Rootly",description:"Route this project's alerts to Rootly.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"rootly"},{channel:"webhook",name:"Webhooks",description:"Send this project's alerts to configured HTTPS endpoints.",scope:"project",destinationManagement:"webhook_endpoints",projectSettingsPath:"webhooks"}],wge=new Set(kge.map(({channel:e})=>e));if(wge.size!==Nu.length||Nu.some((e)=>!wge.has(e)))throw Error("Notification channel definitions must represent every channel")});var xge,u5e=(e,t)=>e.value===t.value&&e.label===t.label&&e.scope===t.scope&&e.role===t.role&&e.defaultOff===t.defaultOff&&(e.defaultOffChannels??[]).join(",")===(t.defaultOffChannels??[]).join(",")&&e.email?.template===t.email?.template&&e.email?.ctaLabel===t.email?.ctaLabel&&(e.deliveryConditions??[]).join(",")===(t.deliveryConditions??[]).join(","),Nn=(e)=>{for(let t of Object.values(e)){let n=xge.get(t.value);if(n&&!u5e(n,t))throw Error(`Notification type registered twice with conflicting definitions: ${t.value}`);if(t.role!==void 0&&t.scope!=="org")throw Error(`Notification type role restrictions require org scope: ${t.value}`);if(t.label.trim().length===0)throw Error(`Notification type needs a display label: ${t.value}`);if(t.email&&t.email.ctaLabel.trim().length===0)throw Error(`Notification email presentation needs a CTA label: ${t.value}`);if(t.defaultOff&&t.defaultOffChannels)throw Error(`Notification type declares both defaultOff and defaultOffChannels: ${t.value}`);xge.set(t.value,t)}return e};var pi=h(()=>{xge=new Map});var Pge;var Rge=h(()=>{pi();Pge=Nn({AUTOMATION_FINISHED:{value:"automation_finished",label:"Automation completed",scope:"project",defaultOff:!0},AUTOMATION_RUN_FAILED:{value:"automation_run_failed",label:"Automation run failed",scope:"project"}})});var hS;var s0=h(()=>{pi();hS=Nn({BILLING_PLAN_UPGRADE_APPLIED:{value:"billing_plan_upgrade_applied",label:"Billing upgrade applied",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_PLAN_DOWNGRADE_SCHEDULED:{value:"billing_plan_downgrade_scheduled",label:"Billing downgrade scheduled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_PLAN_DOWNGRADE_APPLIED:{value:"billing_plan_downgrade_applied",label:"Billing downgrade applied",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_CREDIT_BALANCE_LOW:{value:"billing_credit_balance_low",label:"Billing credits low",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage credits"}},BILLING_CREDIT_BALANCE_DEPLETED:{value:"billing_credit_balance_depleted",label:"Billing credits depleted",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage credits"}},BILLING_AUTO_TOP_UP_SETTINGS_CHANGED:{value:"billing_auto_top_up_settings_changed",label:"Billing auto top-up changed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage auto top-up"}},BILLING_AUTO_TOP_UP_FAILED:{value:"billing_auto_top_up_failed",label:"Billing auto top-up failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage payment method"}},BILLING_INVOICE_PAID:{value:"billing_invoice_paid",label:"Billing invoice paid",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View invoice"}},BILLING_INVOICE_PAYMENT_FAILED:{value:"billing_invoice_payment_failed",label:"Billing invoice payment failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Update payment method"}},BILLING_SUBSCRIPTION_CANCELLATION_SCHEDULED:{value:"billing_subscription_cancellation_scheduled",label:"Billing cancellation scheduled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage subscription"}},BILLING_SUBSCRIPTION_CANCELED:{value:"billing_subscription_canceled",label:"Billing subscription canceled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View billing"}},BILLING_PAYMENT_METHOD_EXPIRING:{value:"billing_payment_method_expiring",label:"Billing payment method expiring",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Update payment method"}},BILLING_PAYMENT_METHOD_CHANGED:{value:"billing_payment_method_changed",label:"Billing payment method changed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Review payment method"}},BILLING_NEGATIVE_BALANCE_COLLECTED:{value:"billing_negative_balance_collected",label:"Billing outstanding balance charged",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View billing"}},BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED:{value:"billing_negative_balance_collection_failed",label:"Billing outstanding balance charge failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage payment method"}}})});var Tge;var Bge=h(()=>{pi();Tge=Nn({INTEGRATION_CONNECTED:{value:"integration_connected",label:"Integration connected",scope:"org",defaultOff:!0},INTEGRATION_DISCONNECTED:{value:"integration_disconnected",label:"Integration disconnected",scope:"org"}})});var Oge;var _ge=h(()=>{pi();Oge=Nn({ISSUE_TRIGGERED:{value:"issue_triggered",label:"Issue triggered",scope:"project",deliveryConditions:["component","severity"]},ISSUE_RESOLVED:{value:"issue_resolved",label:"Issue resolved",scope:"project",defaultOffChannels:["email"],deliveryConditions:["component","severity"]},ISSUE_IGNORED:{value:"issue_ignored",label:"Issue ignored",scope:"project",defaultOffChannels:["email"],deliveryConditions:["component","severity"]}})});var Dge;var Lge=h(()=>{pi();Dge=Nn({PROJECT_CREATED:{value:"project_created",label:"Project created",scope:"org",defaultOff:!0},PROJECT_DELETED:{value:"project_deleted",label:"Project deleted",scope:"org",defaultOff:!0},MEMBER_INVITED:{value:"member_invited",label:"Member invited",scope:"org",defaultOff:!0},USER_REMOVED:{value:"user_removed",label:"Member removed",scope:"org",defaultOff:!0},MCP_CONNECTOR_ADDED:{value:"mcp_connector_added",label:"MCP connector added",scope:"org",defaultOff:!0},MCP_CONNECTOR_REMOVED:{value:"mcp_connector_removed",label:"MCP connector removed",scope:"org",defaultOff:!0},SECRET_KEY_CREATED:{value:"secret_key_created",label:"Secret key created",scope:"org",defaultOff:!0},SECRET_KEY_DELETED:{value:"secret_key_deleted",label:"Secret key deleted",scope:"org",defaultOff:!0}})});var Qge;var Nge=h(()=>{pi();Qge=Nn({SANDBOX_CREATED:{value:"sandbox_created",label:"Sandbox connected",scope:"project",defaultOff:!0},SANDBOX_DELETED:{value:"sandbox_deleted",label:"Sandbox disconnected",scope:"project",defaultOff:!0},LOG_SOURCE_CONNECTED:{value:"log_source_connected",label:"Log source connected",scope:"project",defaultOff:!0},LOG_SOURCE_DISCONNECTED:{value:"log_source_disconnected",label:"Log source disconnected",scope:"project"},GITHUB_CONNECTED:{value:"github_connected",label:"GitHub connected",scope:"project",defaultOff:!0},GITHUB_DISCONNECTED:{value:"github_disconnected",label:"GitHub disconnected",scope:"project"},CODE_REPO_CONNECTED:{value:"code_repo_connected",label:"Code repository connected",scope:"project",defaultOff:!0},CODE_REPO_DISCONNECTED:{value:"code_repo_disconnected",label:"Code repository disconnected",scope:"project"},PUBLIC_KEY_DEACTIVATED:{value:"public_key_deactivated",label:"Public key deactivated",scope:"project"}})});var Mge;var zge=h(()=>{pi();Mge=Nn({SECURITY_ALERT:{value:"security_alert",label:"Security alert",scope:"org",role:"admin"}})});var a0,Pt,p5e,c0=(e)=>{let t=p5e.get(e)?.label;if(t)return t;let n=e.replace(/_/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):e};var fm=h(()=>{Rge();s0();s0();Bge();_ge();Lge();Nge();zge();pi();a0={...Mge,...Dge,...Tge,...Pge,...Oge,...Qge,...hS},Pt=Object.fromEntries(Object.entries(a0).map(([e,t])=>[e,t.value])),p5e=new Map(Object.values(a0).map((e)=>[e.value,e]))});var AS,Uge,v$t,Nr,w$t;var Ga=h(()=>{fm();Am();Am();AS=Object.values(Pt),Uge=[Pt.BILLING_PLAN_UPGRADE_APPLIED,Pt.BILLING_PLAN_DOWNGRADE_SCHEDULED,Pt.BILLING_PLAN_DOWNGRADE_APPLIED,Pt.BILLING_CREDIT_BALANCE_LOW,Pt.BILLING_CREDIT_BALANCE_DEPLETED,Pt.BILLING_AUTO_TOP_UP_SETTINGS_CHANGED,Pt.BILLING_AUTO_TOP_UP_FAILED,Pt.BILLING_INVOICE_PAID,Pt.BILLING_NEGATIVE_BALANCE_COLLECTED,Pt.BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED,Pt.BILLING_INVOICE_PAYMENT_FAILED,Pt.BILLING_SUBSCRIPTION_CANCELLATION_SCHEDULED,Pt.BILLING_SUBSCRIPTION_CANCELED,Pt.BILLING_PAYMENT_METHOD_EXPIRING,Pt.BILLING_PAYMENT_METHOD_CHANGED],v$t=new Set(Uge),Nr=[Pt.ISSUE_TRIGGERED,Pt.ISSUE_RESOLVED,Pt.ISSUE_IGNORED,Pt.AUTOMATION_RUN_FAILED],w$t=new Set(Nr)});var ym,Fge,$ge=(e)=>typeof e==="string"&&(e in Fge)?Fge[e]:e,m5e;var Gge=h(()=>{Am();Oe();Ga();ym=a.enum(AS),Fge={data_source_connected:"log_source_connected",data_source_disconnected:"log_source_disconnected"},m5e=a.preprocess($ge,ym)});var h5e;var qge=h(()=>{fm();Ga();h5e=Nr.map((e)=>({notificationType:e,label:c0(e)}))});var Hge=h(()=>{fm();Ga()});var Vge=h(()=>{Am();fm();Ga();Gge();qge();Hge()});var Kge=()=>{};var Yge=h(()=>{Ga()});var Wge=h(()=>{Ga()});var l0=h(()=>{Kge();Yge();Wge();Vge()});var b5e,I5e,S5e,C5e,v5e,w5e,E5e,u0,j1t;var Jge=h(()=>{l0();Oe();Ve();b5e=a.enum(["ready","missing","degraded","unavailable"]),I5e=a.object({id:a.string(),label:a.string(),status:a.enum(["active","inactive","degraded"]),statusLabel:a.string()}),S5e=a.object({channel:mS,name:a.string(),description:a.string(),scope:a.enum(["personal","project"]),enabled:a.boolean().nullable(),preferenceId:a.string().nullable(),prerequisite:a.object({status:b5e,statusLabel:a.string(),message:a.string()}),action:a.object({label:a.string(),href:a.string()}).nullable(),destinations:a.array(I5e),destinationManagement:a.enum(["none","slack_channels","teams_channels","integration_connections","webhook_endpoints"]),canCreateDestinations:a.boolean(),supportedNotificationTypes:a.array(ym)}),C5e=a.object({channel:vs,enabled:a.boolean(),preferenceId:a.string().nullable()}),v5e=a.object({channel:vs,notificationType:ym,enabled:a.boolean(),preferenceId:a.string()}),w5e=a.object({projectId:a.string().uuid().optional().describe("Project to inspect. Auto-filled from CLI and SDK context when omitted.")}),E5e=a.object({channelCards:a.array(S5e).length(10),channels:a.array(C5e),notificationTypePreferences:a.array(v5e),issueNotificationMinSeverity:a.enum(["low","medium","high","critical"])}),u0=w({operationId:"notificationChannels.getProject",summary:"List project notification channels",description:"List a project's notification channels with preferences, prerequisites, connection state, configured destinations, and supported notification types.",backend:"api",route:{method:"GET",path:"/notification-channels",tags:["Notification channels"]},input:w5e,output:E5e,pagination:"none",async:"sync"}),j1t={getProject:u0.contract}});var Zge,p0,Xge,g0,q1t,H1t,m0,h0=(e,t)=>{if((e.componentIds?.length||e.componentId)&&"componentIds"in e.condition&&e.condition.componentIds?.length)t.addIssue({code:"custom",path:["condition","componentIds"],message:"Use componentIds instead of legacy condition.componentIds."});if(e.componentIds?.length&&e.componentId)t.addIssue({code:"custom",path:["componentId"],message:"Use componentIds instead of componentId."})},V1t,eme,d0,A0,bm,tme,k5e,x5e,P5e,R5e,T5e,B5e,O5e,_5e,D5e,f0,y0,b0,I0,S0,K1t;var nme=h(()=>{l0();Oe();Ve();Zge=a.enum(["low","medium","high","critical"]),p0=a.object({severities:a.array(Zge).min(1).optional()}).strict(),Xge=a.object({componentIds:a.array(a.string().uuid()).min(1).optional(),severities:a.array(Zge).min(1).optional()}).strict(),g0=a.object({channel:vs,destinationKey:a.string().min(1)}),q1t=a.object({destinations:a.array(g0).min(1),notificationTypes:a.array(a.enum(Nr)).min(1),componentIds:a.array(a.string().uuid()).min(1).optional().describe("Stable component registry IDs matched by this rule."),includeDescendants:a.boolean().default(!1).describe("Whether the rule also matches descendant components."),condition:p0}),H1t=a.object({destinations:a.array(g0).min(1),notificationTypes:a.array(a.enum(Nr)).min(1),condition:Xge}),m0=a.object({destinations:a.array(g0).min(1),notificationTypes:a.array(a.enum(Nr)).min(1),componentIds:a.array(a.string().uuid()).min(1).optional().describe("Stable component registry IDs matched by this rule."),componentId:a.string().uuid().optional().describe("Deprecated single-component compatibility input."),includeDescendants:a.boolean().default(!1).describe("Whether the rule also matches descendant components."),condition:a.union([p0,Xge])}),V1t=m0.superRefine(h0),eme=a.object({id:a.string(),channel:vs,destinationKey:a.string(),displayName:a.string()}),d0=a.object({id:a.string().uuid(),label:a.string(),lifecycle:a.enum(["active","inactive","merged"])}),A0=a.object({id:a.string().uuid(),projectId:a.string().uuid(),notificationTypes:a.array(a.enum(Nr)),destinations:a.array(eme),condition:p0,component:d0.nullable(),componentId:a.string().uuid().nullable(),includeDescendants:a.boolean(),suspendedAt:a.string().datetime().nullable(),suspensionReason:a.string().nullable(),components:a.array(d0),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),bm=a.object({projectId:a.string().uuid().optional().describe("Project whose notification delivery rules are being managed.")}),tme=a.string().uuid().describe("Logical notification delivery rule ID."),k5e=bm,x5e=a.object({rules:a.array(A0)}),P5e=a.object({destinations:a.array(eme),notificationTypes:a.array(a.object({notificationType:a.enum(Nr),label:a.string(),conditions:a.array(a.enum(["component","severity"]))})),components:a.array(d0)}),R5e=bm.extend(m0.shape).superRefine(h0),T5e=A0,B5e=bm.extend({...m0.shape,ruleId:tme}).superRefine(h0),O5e=A0,_5e=bm.extend({ruleId:tme}),D5e=a.object({removed:a.boolean()}),f0=w({operationId:"notificationDeliveryRules.list",summary:"List delivery rules",description:"List the positive delivery rules for a project.",backend:"api",route:{method:"GET",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:k5e,output:x5e,pagination:"none",async:"sync"}),y0=w({operationId:"notificationDeliveryRules.options",summary:"Get delivery rule options",description:"List available destinations, events, and conditions for project delivery rules.",backend:"api",route:{method:"GET",path:"/notification-delivery-rules/options",tags:["Notification delivery rules"]},input:bm,output:P5e,pagination:"none",async:"sync"}),b0=w({operationId:"notificationDeliveryRules.create",summary:"Create a delivery rule",description:"Create a positive project notification delivery rule.",backend:"api",route:{method:"POST",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:R5e,output:T5e,pagination:"none",async:"sync"}),I0=w({operationId:"notificationDeliveryRules.update",summary:"Update a delivery rule",description:"Replace a positive delivery rule atomically.",backend:"api",route:{method:"PUT",path:"/notification-delivery-rules/{ruleId}",tags:["Notification delivery rules"]},input:B5e,output:O5e,pagination:"none",async:"sync"}),S0=w({operationId:"notificationDeliveryRules.delete",summary:"Delete a delivery rule",description:"Delete a positive delivery rule without deleting its reusable destinations.",backend:"api",route:{method:"DELETE",path:"/notification-delivery-rules/{ruleId}",tags:["Notification delivery rules"]},input:_5e,output:D5e,pagination:"none",async:"sync"}),K1t={list:f0.contract,options:y0.contract,create:b0.contract,update:I0.contract,delete:S0.contract}});var C0,L5e,Q5e,N5e,M5e,z5e,j5e,v0,U5e,F5e,w0,$5e,G5e,E0,q5e,H5e,k0,V5e,K5e,x0,Z1t;var ome=h(()=>{Oe();Ve();C0=a.enum(["verify-email","accept-invite","create-organization","billing","configure-project","connect-github-account","install-github-app","configure-code-search","install-slack-app","configure-slack-notifications","trigger-issue","confirm-issue","finish"]),L5e=a.enum(["needs-onboarding","blocked","ready"]),Q5e=a.enum(["incomplete","complete","skipped"]),N5e=a.object({invitationId:a.string(),organizationId:a.string(),organizationName:a.string(),organizationSlug:a.string(),organizationImageUrl:a.string().nullable(),inviterName:a.string().nullable()}),M5e=a.object({gate:L5e,canonicalStep:C0.nullable(),organizationId:a.string().nullable(),projectId:a.string().nullable(),completionByStep:a.record(C0,Q5e),githubSkipped:a.boolean(),githubAppSkipped:a.boolean(),slackSkipped:a.boolean(),sampleIssueId:a.string().nullable(),actorRole:a.enum(["admin","member"]).nullable(),requiredStep:a.union([C0,a.literal("select-organization")]).nullable(),isCompleted:a.boolean(),onboardingRecommendationsThreadId:a.string().nullable(),hasOrganizations:a.boolean(),hasPaidBillingSubscription:a.boolean(),billingStepEnabled:a.boolean(),pendingInvitations:a.array(N5e)}),z5e=a.object({organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project whose onboarding state to bind (sample-issue attempt and project-scoped facts). Auto-filled from CLI and SDK context when omitted.")}),j5e=a.object({onboarding:M5e}),v0=w({operationId:"onboarding.getState",summary:"Get onboarding state",description:"Read onboarding progress for the authenticated user.",backend:"api",route:{method:"GET",path:"/onboarding/state",tags:["Onboarding"]},input:z5e,output:j5e,pagination:"none",async:"sync"}),U5e=a.object({integration:a.enum(["github","slack"]).describe("Integration onboarding step to skip."),organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project used to resolve the organization whose onboarding state is written. Without it, the credential's active organization is used — which for CLI user tokens is the server session's organization, not the CLI's selected one.")}),F5e=a.object({skipped:a.literal(!0)}),w0=w({operationId:"onboarding.skipIntegration",summary:"Skip an integration step",description:"Skip a GitHub or Slack integration step during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-integration",tags:["Onboarding"]},input:U5e,output:F5e,pagination:"none",async:"sync"}),$5e=a.object({organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project used to resolve the organization whose onboarding state is written. Without it, the credential's active organization is used — which for CLI user tokens is the server session's organization, not the CLI's selected one.")}),G5e=a.object({skipped:a.literal(!0)}),E0=w({operationId:"onboarding.skipGithubAppInstallation",summary:"Skip GitHub App installation",description:"Skip GitHub App installation during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-github-app",tags:["Onboarding"]},input:$5e,output:G5e,pagination:"none",async:"sync"}),q5e=a.object({organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project used to resolve the organization whose onboarding state is written. Without it, the credential's active organization is used — which for CLI user tokens is the server session's organization, not the CLI's selected one.")}),H5e=a.object({skipped:a.literal(!0)}),k0=w({operationId:"onboarding.skipSampleIssue",summary:"Skip the test issue",description:"Skip the optional test issue during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-sample-issue",tags:["Onboarding"]},input:q5e,output:H5e,pagination:"none",async:"sync"}),V5e=a.object({projectId:a.string().uuid().describe("Project that completed onboarding.")}),K5e=a.object({completed:a.boolean()}),x0=w({operationId:"onboarding.finish",summary:"Finish onboarding",description:"Mark onboarding complete when all prerequisites are satisfied.",backend:"api",route:{method:"POST",path:"/onboarding/finish",tags:["Onboarding"]},input:V5e,output:K5e,pagination:"none",async:"sync"}),Z1t={getState:v0.contract,skipIntegration:w0.contract,skipGithubAppInstallation:E0.contract,skipSampleIssue:k0.contract,finish:x0.contract}});var fS,Y5e,W5e,J5e,Z5e,X5e,eXe,tXe,nXe,oXe,rXe,P0,R0,T0,B0,o2t;var rme=h(()=>{Oe();Ve();cS();fS=a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional()}),Y5e=fS.extend({role:Cs.optional()}),W5e=a.object({}),J5e=a.object({organizations:a.array(Y5e).describe("Organizations available to the current credential.")}),Z5e=a.object({organizationId:a.string().min(1).describe("Organization ID to fetch.")}),X5e=a.object({organization:fS}),eXe=a.object({organizationId:a.string().min(1).describe("Organization ID to update. SDK and CLI callers can auto-fill this before dispatch."),name:a.string().trim().min(1).max(100).describe("New organization name.")}),tXe=a.object({organization:fS.describe("Updated organization.")}),nXe=a.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(/^[\p{L}\p{N} _-]+$/u,"Name can only contain letters, numbers, spaces, hyphens, and underscores"),oXe=a.object({name:nXe.describe("Organization display name.")}),rXe=a.object({organization:fS}),P0=w({operationId:"organizations.create",summary:"Create an organization",description:"Create an organization for the authenticated user.",backend:"api",route:{method:"POST",path:"/organizations",tags:["Organizations"],successStatus:201},input:oXe,output:rXe,pagination:"none",async:"sync"}),R0=w({operationId:"organizations.list",summary:"List organizations",description:"List organizations available to the current credential.",backend:"api",route:{method:"GET",path:"/organizations",tags:["Organizations"]},input:W5e,output:J5e,pagination:"none",async:"sync"}),T0=w({operationId:"organizations.get",summary:"Get an organization",description:"Get one organization by ID.",backend:"api",route:{method:"GET",path:"/organizations/{organizationId}",tags:["Organizations"]},input:Z5e,output:X5e,pagination:"none",async:"sync"}),B0=w({operationId:"organizations.update",summary:"Update an organization",description:"Update one organization.",backend:"api",route:{method:"PATCH",path:"/organizations/{organizationId}",tags:["Organizations"]},input:eXe,output:tXe,pagination:"none",async:"sync",examples:[{name:"rename-organization",input:{organizationId:"organization-123",name:"Observed Platform"},output:{organization:{id:"organization-123",name:"Observed Platform",slug:"acme",logo:null}}}]}),o2t={list:R0.contract,get:T0.contract,create:P0.contract,update:B0.contract}});var Mu,Im,ime,sme,ame,cme,lme,ume,dme,yS,bS,IS,pme,gme,SS,mme,hme,CS,iXe;var O0=h(()=>{Oe();Ve();Mu=a.enum(["us-east-1","us-east-2","us-west-1","us-west-2","eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3"]),Im=a.object({id:a.string().uuid(),organizationId:a.string().min(1),name:a.string(),region:Mu}),ime=a.object({organizationId:a.string().min(1).optional().describe("Organization to list projects for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),sme=a.object({projects:a.array(Im).describe("Projects visible within the selected organization.")}),ame=a.object({projectId:a.string().uuid().describe("Project ID to fetch.")}),cme=a.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(/^[\p{L}\p{N} _-]+$/u,"Name can only contain letters, numbers, spaces, hyphens, and underscores"),lme=a.object({organizationId:a.string().min(1).optional().describe("Organization to create the project under. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),name:cme.describe("Project name."),region:Mu.optional().default("us-west-2").describe("AWS region where the new project should be created.")}),ume=a.object({project:Im}),dme=a.object({project:Im}),yS=w({operationId:"projects.list",summary:"List projects",description:"List projects in an organization.",backend:"api",route:{method:"GET",path:"/projects",tags:["Projects"]},input:ime,output:sme,pagination:"none",async:"sync"}),bS=w({operationId:"projects.get",summary:"Get a project",description:"Get one project by ID.",backend:"api",route:{method:"GET",path:"/projects/{projectId}",tags:["Projects"]},input:ame,output:dme,pagination:"none",async:"sync"}),IS=w({operationId:"projects.create",summary:"Create a project",description:"Create one project in an organization.",backend:"api",route:{method:"POST",path:"/projects",successStatus:201,tags:["Projects"]},input:lme,output:ume,pagination:"none",async:"sync"}),pme=a.object({projectId:a.string().uuid().describe("Project ID to update."),name:cme.optional().describe("New project name.")}),gme=a.object({project:Im}),SS=w({operationId:"projects.update",summary:"Update a project",description:"Update (rename) one project by ID. User credentials require the `settings:write` organization permission (admin or owner role).",backend:"api",route:{method:"PATCH",path:"/projects/{projectId}",tags:["Projects"]},input:pme,output:gme,pagination:"none",async:"sync"}),mme=a.object({projectId:a.string().uuid().describe("Project ID to delete.")}),hme=a.void(),CS=w({operationId:"projects.delete",summary:"Delete a project",description:"Delete one project by ID. User credentials require the `settings:write` organization permission (admin or owner role).",backend:"api",route:{method:"DELETE",path:"/projects/{projectId}",successStatus:204,tags:["Projects"]},input:mme,output:hme,pagination:"none",async:"sync"}),iXe={list:yS.contract,get:bS.contract,create:IS.contract,update:SS.contract,delete:CS.contract}});var Ame,sXe,aXe,cXe,lXe,uXe,_0,u2t;var fme=h(()=>{Oe();Ve();Ame=a.enum(["open","merged","closed"]),sXe=a.enum(["review_required","approved","changes_requested"]),aXe=a.enum(["passing","failing","pending"]),cXe=a.object({id:a.string().uuid(),projectId:a.string().uuid(),repositoryFullName:a.string(),pullRequestId:a.string().describe("Provider-native pull request identifier (GitHub PR number or Bitbucket PR id), serialized as a string."),githubPullRequestId:a.number().int().describe("Deprecated: use pullRequestId. Numeric form of the provider-native pull request identifier; kept for backward compatibility."),title:a.string().nullable(),url:a.string().nullable(),status:Ame.nullable(),reviewState:sXe.nullable(),checksState:aXe.nullable(),requestedByUserId:a.string().nullable(),authorLogin:a.string().nullable().describe("Forge login that authored the pull request (often the Sazabi app identity)."),githubAuthorLogin:a.string().nullable().describe("Deprecated: use authorLogin. Kept for backward compatibility."),threadId:a.string().uuid().nullable(),runId:a.string().uuid().nullable(),createdAt:a.string().datetime(),mergedAt:a.string().datetime().nullable(),closedAt:a.string().datetime().nullable()}),lXe=a.object({projectId:a.string().uuid().optional().describe("Project to list pull requests for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of pull requests to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:Ame.optional().describe("Filter by pull request status (open, merged, or closed)."),repositoryFullName:a.string().trim().optional().describe("Filter by repository full name, for example owner/repo. Case-insensitive."),requestedByUserId:a.string().trim().optional().describe("Filter by the Sazabi user who requested the pull request. Pass 'me' to filter to the authenticated user.")}),uXe=a.object({pullRequests:a.array(cXe),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),_0=w({operationId:"pullRequests.list",summary:"List pull requests",description:"List pull requests that Sazabi opened, optionally filtered by status, repository, and requesting user.",backend:"api",route:{method:"GET",path:"/pull-requests",tags:["Pull Requests"]},input:lXe,output:uXe,pagination:"cursor",async:"sync"}),u2t={list:_0.contract}});var yme,bme,Ime,Sme,Cme,Sm;var D0=h(()=>{Oe();Ve();yme=a.enum(["log_source","mcp_connector","sandbox_cli","integration"]),bme=a.enum(["connected","recommended"]),Ime=a.object({kind:yme.describe("What the recommendation targets: a log source, MCP connector, sandbox CLI, or integration."),targetId:a.string().describe("Exact catalog id for the kind (log source type, MCP provider id, sandbox CLI preset type, or integration provider id)."),status:bme.describe("Resolved live against current connections: connected (already set up) or recommended (suggested, not yet connected)."),roiScore:a.number().int().min(0).max(100).describe("Intrinsic ROI score, 0–100 — a normalized blend of how valuable, how easy to connect, and how proven the item is. A pure function of the item; computed live on read, never stored."),priority:a.number().int().min(1).describe("1-based rank within this list, sorted by roiScore (best first). Items are already returned in priority order; the field lets consumers recover the rank without trusting array position.")}),Sme=a.object({projectId:a.string().uuid().optional().describe("Project to list recommendations for. Auto-filled from CLI and SDK context when omitted.")}),Cme=a.object({recommendations:a.array(Ime).describe("The project's configuration recommendations, deduped by (kind, targetId), with status resolved live and each item's ROI score. Returned in priority order (highest roiScore first).")}),Sm=w({operationId:"recommendations.list",summary:"List recommendations",description:"List a project's configuration recommendations (data sources, MCP connectors, sandbox CLIs, and integrations) with each item's live connection status.",backend:"api",route:{method:"GET",path:"/recommendations",tags:["Recommendations"]},input:Sme,output:Cme,pagination:"none",async:"sync"})});var vme,L0,wme,Eme,kme,xme,Pme,Rme,Cm,vm,wm;var Q0=h(()=>{Oe();Ve();vme=a.enum(["github","bitbucket"]),L0=a.object({id:a.string().uuid().describe("Repository row id — stable across access sources; use it as the path id for repos.remove."),accessSourceId:a.string().uuid().describe("Access source granting this view of the repository (GitHub App installation, personal connection, or integration). Pass to repos.add to link the repository through this source."),source:a.enum(["githubApp","personal","integration"]).describe("Kind of access source granting this view: an organization GitHub App installation, the caller's personal forge connection, or an organization integration."),sourceLabel:a.string().describe('Display label for the access source (e.g. "GitHub app", "Personal").'),provider:vme.describe("Forge hosting the repository."),owner:a.string().describe("Repository owner (user or organization)."),name:a.string().describe("Repository name without the owner."),fullName:a.string().describe("Full name in owner/name form."),defaultBranch:a.string().nullable().describe("Default branch, when the forge reports one."),isPrivate:a.boolean().describe("Whether the repository is private."),linked:a.boolean().describe("Whether the repository is already linked to the project.")}),wme=a.object({projectId:a.string().uuid().optional().describe("Project to list repositories for. Auto-filled from CLI and SDK context when omitted.")}),Eme=a.object({repos:a.array(L0).describe("Every repository available to the project's organization (from GitHub App installations, the caller's personal forge connections, and integrations), with `linked` marking the ones already linked to the project.")}),kme=a.object({projectId:a.string().uuid().optional().describe("Project to link the repositories to. Auto-filled from CLI and SDK context when omitted."),accessSourceIds:a.array(a.string().uuid()).min(1).describe("Access source ids (from repos.list) to link. Select only one access source per repository.")}),xme=a.object({repos:a.array(L0).describe("The now-linked repositories.")}),Pme=a.object({id:a.string().uuid().describe("Repository row id (from repos.list) to unlink."),projectId:a.string().uuid().optional().describe("Project to unlink the repository from. Auto-filled from CLI and SDK context when omitted.")}),Rme=a.void(),Cm=w({operationId:"repos.list",summary:"List repositories",description:"List the repositories available to a project — every repository reachable through the organization's GitHub App installations, the caller's personal forge connections, and integrations — with each one's linked status.",backend:"api",route:{method:"GET",path:"/repos",tags:["Repos"]},input:wme,output:Eme,pagination:"none",async:"sync"}),vm=w({operationId:"repos.add",summary:"Link repositories to a project",description:"Link repositories to a project by access source id. Select only one access source per repository; re-linking an already-linked repository refreshes its selected access source.",backend:"api",route:{method:"POST",path:"/repos",tags:["Repos"]},input:kme,output:xme,pagination:"none",async:"sync"}),wm=w({operationId:"repos.remove",summary:"Unlink a repository from a project",description:"Unlink a repository from a project by repository row id.",backend:"api",route:{method:"DELETE",path:"/repos/{id}",successStatus:204,tags:["Repos"]},input:Pme,output:Rme,pagination:"none",async:"sync"})});var Tme,dXe,Bme,vS,Ome,_me,Dme,Lme,zu,N0,Qme,Nme,ju,Mme,zme,Uu,jme,Ume,Fu,pXe;var M0=h(()=>{Oe();Ve();Tme=a.object({type:a.string().describe("Preset type identifier."),label:a.string().describe("Human-readable display name."),executableNames:a.array(a.string()).describe("CLI binary names installed by this preset."),envVarKeys:a.array(a.string()).describe("Environment variables required for authentication."),setupSkill:a.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),dXe=a.object({}),Bme=a.object({types:a.array(Tme)}),vS=w({operationId:"sandboxPresets.listTypes",summary:"List CLI types",description:"List all supported sandbox CLI types with their environment variable requirements and setup skills.",backend:"api",route:{method:"GET",path:"/sandbox-presets/types",tags:["Sandbox Presets"]},input:dXe,output:Bme,pagination:"none",async:"sync"}),Ome=a.enum(["github_app","bitbucket_integration","personal_access_token","stored_credentials"]),_me=a.object({presetType:a.string().describe("Preset type identifier."),credentialSource:Ome.describe("Authoritative credential source for the preset."),isSystemManaged:a.boolean().describe("Whether the connection follows an integration lifecycle."),fallbackConfigured:a.boolean().describe("Whether user-provided fallback credentials are stored for this preset."),envVarKeys:a.array(a.string()).describe("Stored environment variable names. Secret values are omitted.")}),Dme=a.object({projectId:a.string().uuid().optional().describe("Project to inspect. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted.")}),Lme=a.object({connections:a.array(_me)}),zu=w({operationId:"sandboxPresets.listConnections",summary:"List CLI connections",description:"List a project's stored and integration-backed sandbox CLI connections without returning secret values.",backend:"api",route:{method:"GET",path:"/sandbox-presets/connections",tags:["Sandbox Presets"]},input:Dme,output:Lme,pagination:"none",async:"sync"}),N0=a.object({key:a.string().min(1).max(256).regex(/^[A-Za-z_][A-Za-z0-9_]*$/,"Environment variable keys must match /^[A-Za-z_][A-Za-z0-9_]*$/.").describe("Environment variable name (e.g. KUBECONFIG_CONTENTS)."),value:a.string().max(10240).describe("Secret value. Encrypted at rest; never returned by any API response.")}),Qme=a.object({projectId:a.string().uuid().optional().describe("Project to configure. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:a.string().min(1).describe("Preset type identifier (e.g. kubectl, aws, github)."),environmentVariables:a.array(N0).max(100).describe("Full set of env vars for this preset. Replaces any previously stored values for the preset.")}),Nme=a.object({projectId:a.string().uuid().describe("Project the preset was written to."),presetType:a.string().describe("Preset type that was upserted."),envVarKeys:a.array(a.string()).describe("Env var key names now stored for this preset. Values are never returned.")}),ju=w({operationId:"sandboxPresets.upsertPreset",summary:"Upsert CLI connection",description:"Set or replace a project's CLI connection credentials (e.g. the kubectl CLI's KUBECONFIG_CONTENTS). Values are encrypted server-side and never returned. Requires write access to the target project.",backend:"api",route:{method:"POST",path:"/sandbox-presets/config",successStatus:200,tags:["Sandbox Presets"]},input:Qme,output:Nme,pagination:"none",async:"sync"}),Mme=a.object({projectId:a.string().uuid().optional().describe("Project to update. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:a.string().min(1).describe("Preset type identifier.")}),zme=a.object({projectId:a.string().uuid().describe("Project the CLI connection belonged to."),presetType:a.string().describe("Preset type that was disconnected."),deleted:a.boolean().describe("Whether a stored CLI connection was deleted.")}),Uu=w({operationId:"sandboxPresets.deletePreset",summary:"Disconnect CLI",description:"Delete a project's stored CLI connection. Integration-managed access remains available until its owning integration is disconnected.",backend:"api",route:{method:"DELETE",path:"/sandbox-presets/config/{presetType}",tags:["Sandbox Presets"]},input:Mme,output:zme,pagination:"none",async:"sync"}),jme=a.object({projectId:a.string().uuid().optional().describe("Project to test from. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:a.string().min(1).describe("Preset type identifier."),environmentVariables:a.array(N0).max(100).describe("Unsaved credentials to validate in a readonly sandbox.")}),Ume=a.object({status:a.enum(["success","failed"]),message:a.string().nullable(),stdout:a.string().describe("Truncated command output with submitted credentials redacted."),stderr:a.string().describe("Truncated command errors with submitted credentials redacted.")}),Fu=w({operationId:"sandboxPresets.testPreset",summary:"Test CLI connection",description:"Validate unsaved CLI credentials in a read-only ephemeral sandbox without persisting them.",backend:"api",route:{method:"POST",path:"/sandbox-presets/test",tags:["Sandbox Presets"]},input:jme,output:Ume,pagination:"none",async:"sync"}),pXe={deletePreset:Uu.contract,listConnections:zu.contract,listTypes:vS.contract,testPreset:Fu.contract,upsertPreset:ju.contract}});var wS,Fme=1048576,z0,$me,j0,gXe,mXe,hXe,AXe,fXe,yXe,bXe,IXe,SXe,CXe,U0,F0,$0,G0,q0,v2t;var Gme=h(()=>{Oe();Ve();wS=a.string().min(1).max(64).regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/,"Name must start with a letter or digit and contain only letters, digits, underscores, and hyphens (max 64 characters).").describe("Script name. Must be unique within the project among non-deleted scripts."),z0=a.string().min(1).refine((e)=>new TextEncoder().encode(e).length<=Fme,{message:`Script content must be at most ${Fme} bytes (1 MiB).`}).describe("Bash script body materialized as /home/sazabi/scripts/<name>.sh in the sandbox."),$me=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),description:a.string().nullable(),contentHash:a.string().describe("sha256 hex digest of the script content."),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),j0=$me.extend({content:z0}),gXe=a.object({projectId:a.string().uuid().optional().describe("Project to list scripts for. Auto-filled from CLI and SDK context when omitted."),search:a.string().optional().describe("Case-insensitive partial match on script name."),cursor:a.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of scripts to return per page.")}),mXe=a.object({scripts:a.array($me),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),hXe=a.object({name:wS.describe("Script name to fetch."),projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted.")}),AXe=a.object({script:j0}),fXe=a.object({projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted."),name:wS.describe("Script name. Must be unique within the project among non-deleted scripts."),content:z0,description:a.string().max(500).nullable().optional().describe("Optional human-readable description.")}),yXe=a.object({script:j0}),bXe=a.object({name:wS.describe("Script to update."),projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted."),content:z0.optional().describe("New script body. Omit to leave content unchanged."),description:a.string().max(500).nullable().optional().describe("New description, or null to clear it. Omit to leave unchanged.")}),IXe=a.object({script:j0}),SXe=a.object({name:wS.describe("Script to delete."),projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted.")}),CXe=a.void(),U0=w({operationId:"scripts.list",summary:"List scripts",description:"List durable bash scripts stored for a project.",backend:"api",route:{method:"GET",path:"/scripts",tags:["Scripts"]},input:gXe,output:mXe,pagination:"cursor",async:"sync"}),F0=w({operationId:"scripts.get",summary:"Get a script",description:"Get a single project script by name, including its body.",backend:"api",route:{method:"GET",path:"/scripts/{name}",tags:["Scripts"]},input:hXe,output:AXe,pagination:"none",async:"sync"}),$0=w({operationId:"scripts.create",summary:"Create a script",description:"Create a durable bash script for a project.",backend:"api",route:{method:"POST",path:"/scripts",successStatus:201,tags:["Scripts"]},input:fXe,output:yXe,pagination:"none",async:"sync"}),G0=w({operationId:"scripts.update",summary:"Update a script",description:"Update a project script's body and/or description.",backend:"api",route:{method:"PATCH",path:"/scripts/{name}",tags:["Scripts"]},input:bXe,output:IXe,pagination:"none",async:"sync"}),q0=w({operationId:"scripts.delete",summary:"Delete a script",description:"Soft-delete a project script by name.",backend:"api",route:{method:"DELETE",path:"/scripts/{name}",successStatus:204,tags:["Scripts"]},input:SXe,output:CXe,pagination:"none",async:"sync"}),v2t={list:U0.contract,get:F0.contract,create:$0.contract,update:G0.contract,delete:q0.contract}});var H0,qme,Hme,Vme,Kme,$u,Gu,vXe;var V0=h(()=>{Oe();Ve();H0=a.object({projectId:a.string().uuid().optional().describe("Project to search within. Auto-filled from CLI and SDK context when omitted."),query:a.string().trim().min(1,"Query must be at least 1 character").max(500,"Query must be at most 500 characters"),limit:a.coerce.number().min(1).max(100).default(20).describe("Maximum number of search results to return."),page:a.coerce.number().min(1).default(1).describe("One-based page number.")}),qme=H0.extend({status:a.enum(["regular","archived"]).optional().describe("Optional thread status filter.")}),Hme=H0.extend({threadId:a.string().uuid().optional().describe("Optional thread restriction for message search."),role:a.enum(["user","assistant"]).optional().describe("Optional message role filter.")}),Vme=a.object({threads:a.array(a.object({id:a.string().uuid(),projectId:a.string().uuid().optional(),title:a.string(),status:a.enum(["regular","archived"]),labels:a.array(a.string()),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),highlights:a.array(a.string()),score:a.number().optional()})),pagination:a.object({page:a.number(),limit:a.number(),totalResults:a.number(),totalPages:a.number()}).describe("Page-based pagination metadata for the current search result.")}),Kme=a.object({messages:a.array(a.object({id:a.string().uuid(),threadId:a.string().uuid(),threadTitle:a.string(),role:a.enum(["user","assistant"]),content:a.string(),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),highlights:a.array(a.string()),score:a.number().optional()})),pagination:a.object({page:a.number(),limit:a.number(),totalResults:a.number(),totalPages:a.number()}).describe("Page-based pagination metadata for the current search result.")}),$u=w({operationId:"search.threads",summary:"Search threads",description:"Search threads within one project.",backend:"api",route:{method:"GET",path:"/search/threads",tags:["Search"]},input:qme,output:Vme,pagination:"page",async:"sync",examples:[{name:"search-open-incidents",input:{projectId:"11111111-1111-4111-8111-111111111111",query:"payment timeout",status:"regular",limit:10,page:1},output:{threads:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"Payment timeout in us-west-2",status:"regular",labels:["payments","timeout"],createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-02T00:00:00.000Z",highlights:["payment timeout"],score:123.45}],pagination:{page:1,limit:10,totalResults:1,totalPages:1}}}]}),Gu=w({operationId:"search.messages",summary:"Search messages",description:"Search messages within one project.",backend:"api",route:{method:"GET",path:"/search/messages",tags:["Search"]},input:Hme,output:Kme,pagination:"page",async:"sync",examples:[{name:"search-assistant-messages",input:{projectId:"11111111-1111-4111-8111-111111111111",query:"rollback",role:"assistant",limit:10,page:1},output:{messages:[{id:"33333333-3333-4333-8333-333333333333",threadId:"22222222-2222-4222-8222-222222222222",threadTitle:"Deployment rollback guidance",role:"assistant",content:"Rollback the ingestion deployment and confirm queue depth.",createdAt:"2026-01-02T00:00:00.000Z",updatedAt:"2026-01-02T00:00:00.000Z",highlights:["Rollback the ingestion deployment"],score:98.76}],pagination:{page:1,limit:10,totalResults:1,totalPages:1}}}]}),vXe={threads:$u.contract,messages:Gu.contract}});var ES,Yme,K0,Em,wXe,EXe,kXe,xXe,PXe,RXe,TXe,BXe,OXe,_Xe,Y0,W0,J0,Z0,X0,DXe,LXe,eM,T2t;var Wme=h(()=>{Oe();Ve();ES=a.string().uuid().describe("Signal definition ID."),Yme=a.string().min(1).max(200).describe("Human-readable expression name."),K0=a.string().min(1).max(8192).describe("CEL expression evaluated against ingested log events."),Em=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),expression:K0,enabled:a.boolean(),compiledVersion:a.number().int(),linkedAutomationIds:a.array(a.string().uuid()).optional().describe("Automations bound to this expression. Included on list/get when available."),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),wXe=a.object({projectId:a.string().uuid().optional().describe("Project to list signal definitions for. Auto-filled from CLI and SDK context when omitted.")}),EXe=a.object({signalDefinitions:a.array(Em)}),kXe=a.object({signalDefinitionId:ES,projectId:a.string().uuid().optional().describe("Project that owns the signal definition. Auto-filled from CLI and SDK context when omitted.")}),xXe=a.object({signalDefinition:Em}),PXe=a.object({projectId:a.string().uuid().optional().describe("Project to create the expression in. Auto-filled from CLI and SDK context when omitted."),name:Yme,expression:K0,enabled:a.boolean().optional().describe("Whether the expression starts enabled. Defaults to true.")}),RXe=a.object({signalDefinition:Em}),TXe=a.object({signalDefinitionId:ES,projectId:a.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted."),name:Yme.optional(),expression:K0.optional(),enabled:a.boolean().optional().describe("Whether the expression is enabled.")}),BXe=a.object({signalDefinition:Em}),OXe=a.object({signalDefinitionId:ES,projectId:a.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted.")}),_Xe=a.object({signalDefinition:Em}),Y0=w({operationId:"signalDefinitions.list",summary:"List signal definitions",description:"List signal definitions in a project.",backend:"api",route:{method:"GET",path:"/signal-definitions",tags:["Signal definitions"]},input:wXe,output:EXe,pagination:"none",async:"sync"}),W0=w({operationId:"signalDefinitions.get",summary:"Get a signal definition",description:"Get a single signal definition by ID.",backend:"api",route:{method:"GET",path:"/signal-definitions/{signalDefinitionId}",tags:["Signal definitions"]},input:kXe,output:xXe,pagination:"none",async:"sync"}),J0=w({operationId:"signalDefinitions.create",summary:"Create a signal definition",description:"Create a CEL signal definition for a project.",backend:"api",route:{method:"POST",path:"/signal-definitions",successStatus:201,tags:["Signal definitions"]},input:PXe,output:RXe,pagination:"none",async:"sync"}),Z0=w({operationId:"signalDefinitions.update",summary:"Update a signal definition",description:"Update a signal definition's name, CEL body, or enabled state.",backend:"api",route:{method:"PATCH",path:"/signal-definitions/{signalDefinitionId}",tags:["Signal definitions"]},input:TXe,output:BXe,pagination:"none",async:"sync"}),X0=w({operationId:"signalDefinitions.disable",summary:"Disable a signal definition",description:"Disable a signal definition so it stops matching logs.",backend:"api",route:{method:"POST",path:"/signal-definitions/{signalDefinitionId}/disable",tags:["Signal definitions"]},input:OXe,output:_Xe,pagination:"none",async:"sync"}),DXe=a.object({signalDefinitionId:ES,projectId:a.string().uuid().optional().describe("Project that owns the signal definition. Auto-filled from CLI and SDK context when omitted.")}),LXe=a.void(),eM=w({operationId:"signalDefinitions.delete",summary:"Delete a signal definition",description:"Permanently delete a signal definition.",backend:"api",route:{method:"DELETE",path:"/signal-definitions/{signalDefinitionId}",successStatus:204,tags:["Signal definitions"]},input:DXe,output:LXe,pagination:"none",async:"sync"}),T2t={list:Y0.contract,get:W0.contract,create:J0.contract,update:Z0.contract,disable:X0.contract,delete:eM.contract}});var Jme;var Zme=h(()=>{Jme=["onboarding","setup"]});var Xme,ehe,the,nhe,km;var tM=h(()=>{Zme();Oe();Ve();Xme=a.enum(Jme),ehe=a.object({id:a.string().describe("Unique task identifier (e.g. install_github_app)."),label:a.string().describe("Short human-readable task name."),description:a.string().describe("Explanation of what needs to be completed to satisfy this task."),instructions:a.string().describe("Step-by-step instructions for completing this task."),completed:a.boolean().describe("Whether the task has been completed."),completedAt:a.string().datetime().nullable().describe("ISO 8601 timestamp of when the task was completed, or null."),category:Xme.describe("Task category: onboarding (core setup steps) or setup (additional configuration).")}),the=a.object({projectId:a.string().uuid().optional().describe("Project to list tasks for. Auto-filled from CLI and SDK context when omitted.")}),nhe=a.object({tasks:a.array(ehe).describe("All onboarding and setup tasks with their current completion status.")}),km=w({operationId:"tasks.list",summary:"List tasks",description:"List all onboarding and setup tasks for a project, including their current completion status and a description of what is required to complete each task.",backend:"api",route:{method:"GET",path:"/tasks",tags:["Tasks"]},input:the,output:nhe,pagination:"none",async:"sync"})});var QXe,NXe,qa,MXe,zXe,jXe,UXe,FXe,$Xe,GXe,qXe,HXe,VXe,KXe,YXe,WXe,JXe,nM,oM,rM,iM,sM,aM,cM,z2t;var ohe=h(()=>{Oe();Ve();QXe=a.object({id:a.string().uuid().describe("Team ID."),name:a.string().describe("Team name, unique among the org's active teams."),description:a.string().nullable().describe("Optional team description."),createdAt:a.string().datetime().describe("When the team was created."),memberCount:a.number().int().nonnegative().describe("Number of active members in the team.")}),NXe=a.object({userId:a.string().min(1).describe("User ID of the team member."),name:a.string().nullable().describe("Display name for the member, when available."),email:a.string().email().describe("Email address for the member."),addedAt:a.string().datetime().describe("When the member was added to the team.")}),qa=a.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),MXe=a.object({organizationId:qa}),zXe=a.object({teams:a.array(QXe).describe("Active teams in the organization.")}),jXe=a.object({organizationId:qa,name:a.string().trim().min(1).describe("Team name."),description:a.string().trim().min(1).optional().describe("Optional team description.")}),UXe=a.object({id:a.string().uuid().describe("ID of the created team.")}),FXe=a.object({organizationId:qa,teamId:a.string().uuid().describe("Team to update."),name:a.string().trim().min(1).optional().describe("New team name."),description:a.string().trim().min(1).nullable().optional().describe("New team description; null clears it.")}),$Xe=a.object({id:a.string().uuid().describe("ID of the updated team.")}),GXe=a.object({params:a.object({teamId:a.string().uuid().describe("Team to delete.")}),query:a.object({organizationId:qa})}).transform(({params:e,query:t})=>({...t,...e})),qXe=a.object({success:a.literal(!0).describe("The team and its memberships were removed.")}),HXe=a.object({organizationId:qa,teamId:a.string().uuid().describe("Team to add the member to."),userId:a.string().min(1).describe("User ID of an active organization member to add.")}),VXe=a.object({id:a.string().uuid().describe("ID of the team membership.")}),KXe=a.object({params:a.object({teamId:a.string().uuid().describe("Team to remove the member from."),userId:a.string().min(1).describe("User ID of the member to remove.")}),query:a.object({organizationId:qa})}).transform(({params:e,query:t})=>({...t,...e})),YXe=a.object({success:a.literal(!0).describe("The membership was removed.")}),WXe=a.object({organizationId:qa,teamId:a.string().uuid().describe("Team to list members for.")}),JXe=a.object({members:a.array(NXe).describe("Active members of the team.")}),nM=w({operationId:"teams.list",summary:"List teams",description:"List teams in an organization.",backend:"api",route:{method:"GET",path:"/teams",tags:["Teams"]},input:MXe,output:zXe,pagination:"none",async:"sync",examples:[{name:"organization-teams",input:{organizationId:"organization-123"},output:{teams:[{id:"5c0f9866-31ab-4237-94cc-a1d0ba2f6de2",name:"Payments",description:"Owns checkout and billing components.",createdAt:"2026-01-01T00:00:00.000Z",memberCount:4}]}}]}),oM=w({operationId:"teams.create",summary:"Create a team",description:"Create a team in an organization.",backend:"api",route:{method:"POST",path:"/teams",tags:["Teams"],successStatus:201},input:jXe,output:UXe,pagination:"none",async:"sync"}),rM=w({operationId:"teams.update",summary:"Update a team",description:"Rename a team or update its description.",backend:"api",route:{method:"PATCH",path:"/teams/{teamId}",tags:["Teams"]},input:FXe,output:$Xe,pagination:"none",async:"sync"}),iM=w({operationId:"teams.delete",summary:"Delete a team",description:"Delete a team, its memberships, and its component-ownership assignments.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}",tags:["Teams"],inputStructure:"detailed"},input:GXe,output:qXe,pagination:"none",async:"sync"}),sM=w({operationId:"teams.addMember",summary:"Add a team member",description:"Add an active organization member to a team.",backend:"api",route:{method:"POST",path:"/teams/{teamId}/members",tags:["Teams"],successStatus:201},input:HXe,output:VXe,pagination:"none",async:"sync"}),aM=w({operationId:"teams.removeMember",summary:"Remove a team member",description:"Remove a member from a team.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}/members/{userId}",tags:["Teams"],inputStructure:"detailed"},input:KXe,output:YXe,pagination:"none",async:"sync"}),cM=w({operationId:"teams.listMembers",summary:"List team members",description:"List a team's active members.",backend:"api",route:{method:"GET",path:"/teams/{teamId}/members",tags:["Teams"]},input:WXe,output:JXe,pagination:"none",async:"sync"}),z2t={list:nM.contract,create:oM.contract,update:rM.contract,delete:iM.contract,addMember:sM.contract,removeMember:aM.contract,listMembers:cM.contract}});var ZXe,XXe,e8e,lM,t8e,n8e,uM,o8e,r8e,dM,$2t;var rhe=h(()=>{Oe();Ve();ZXe=a.object({kind:a.enum(["user","workspace"]),name:a.string().optional(),email:a.string().optional()}),XXe=a.object({container:a.string().min(1).describe("The container to create the work item in: its id, short key (e.g. a Linear team key like ENG), or display name."),title:a.string().min(1),bodyMarkdown:a.string().optional(),state:a.string().optional(),itemType:a.string().optional(),organizationId:a.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Omitting it currently falls back to the session's active organization for user tokens (deprecated); a future release will require it for user-token callers."),clientRequestId:a.string().min(1).optional().describe("Optional caller-supplied idempotency key. When provided, retrying the same logical create with the same clientRequestId reuses the original result instead of creating a duplicate external work item.")}).strict(),e8e=a.object({identifier:a.string(),title:a.string(),url:a.string(),state:a.string(),attribution:ZXe.optional(),reused:a.boolean()}),lM=w({operationId:"work-items.create",summary:"Create a work item",description:"Create a work item (e.g. a Linear issue) in a connected issue tracker, attributing the write to the requesting user.",backend:"api",route:{method:"POST",path:"/work-items",tags:["Work Items"],successStatus:201},input:XXe,output:e8e,pagination:"none",async:"sync"}),t8e=a.object({itemId:a.string().min(1).describe("The work item to comment on."),bodyMarkdown:a.string().min(1),organizationId:a.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Omitting it currently falls back to the session's active organization for user tokens (deprecated); a future release will require it for user-token callers.")}).strict(),n8e=a.object({identifier:a.string(),url:a.string()}),uM=w({operationId:"work-items.comment",summary:"Comment on a work item",description:"Add a comment to an existing work item.",backend:"api",route:{method:"POST",path:"/work-items/{itemId}/comment",tags:["Work Items"]},input:t8e,output:n8e,pagination:"none",async:"sync"}),o8e=a.object({itemId:a.string().min(1).describe("The work item to transition."),state:a.string().min(1).describe("The target workflow state."),organizationId:a.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Omitting it currently falls back to the session's active organization for user tokens (deprecated); a future release will require it for user-token callers.")}).strict(),r8e=a.object({identifier:a.string(),title:a.string(),url:a.string(),state:a.string(),changed:a.boolean()}),dM=w({operationId:"work-items.transition",summary:"Transition a work item",description:"Move a work item to a target workflow state.",backend:"api",route:{method:"POST",path:"/work-items/{itemId}/transition",tags:["Work Items"]},input:o8e,output:r8e,pagination:"none",async:"sync"}),$2t={create:lM.contract,comment:uM.contract,transition:dM.contract}});var pM;var ihe=h(()=>{e2();a2();lR();hR();L2();WR();XR();Jf();oW();TB();PN();cS();Jpe();jN();vge();Jge();nme();ome();rme();O0();fme();D0();Q0();dS();M0();Gme();V0();Wme();tM();ohe();o0();rhe();pM={me:RN.contract,automations:{list:fR.contract,get:yR.contract,create:bR.contract,update:IR.contract,enable:SR.contract,disable:CR.contract,runs:{list:vR.contract,get:wR.contract,logs:ER.contract}},logs:{query:Wc.contract,search:Jc.contract,schema:Zc.contract,volume:Xc.contract,patterns:el.contract,nativeQuery:tl.contract},logSources:{listProviders:Vf.contract,list:Vc.contract,create:Kc.contract,get:Kf.contract,update:Yf.contract,delete:Wf.contract},logStreams:{list:AB.contract,create:fB.contract,volumeStats:yB.contract,get:bB.contract,update:IB.contract,delete:SB.contract,reassign:CB.contract},connectedAccounts:{beginConnect:dR.contract,getConnectAttempt:pR.contract,list:gR.contract,disconnect:mR.contract},integrations:{listProviders:l2.contract,listConnections:u2.contract,getConnection:d2.contract,getLinearAutomationConfiguration:R2.contract,createConnection:p2.contract,beginConnect:g2.contract,getConnectAttempt:m2.contract,disconnectConnection:h2.contract,updateConnectionCredentials:A2.contract,updateLinearAutomationConfiguration:T2.contract,getOrganizationExternalIdentityJitPolicy:b2.contract,updateOrganizationExternalIdentityJitPolicy:I2.contract,getConnectionExternalIdentityJitPolicy:S2.contract,updateConnectionExternalIdentityJitPolicy:C2.contract,getSlackConfiguration:w2.contract,updateSlackConfiguration:E2.contract,listSlackChannelProjectMappings:O2.contract,setSlackChannelProjectMapping:_2.contract,deleteSlackChannelProjectMapping:D2.contract},notificationChannels:{getProject:u0.contract},notificationDeliveryRules:{list:f0.contract,options:y0.contract,create:b0.contract,update:I0.contract,delete:S0.contract},mcpConnectors:{listProviders:aS.contract,list:Iu.contract,get:Su.contract,details:Cu.contract,search:vu.contract,describe:wu.contract,call:Eu.contract,create:ku.contract,update:xu.contract,disconnect:Pu.contract,setReadOnly:Ru.contract,beginOAuthInstall:Tu.contract,getOAuthInstallAttempt:Bu.contract},sandboxPresets:{deletePreset:Uu.contract,listConnections:zu.contract,listTypes:vS.contract,testPreset:Fu.contract,upsertPreset:ju.contract},scripts:{list:U0.contract,get:F0.contract,create:$0.contract,update:G0.contract,delete:q0.contract},signalDefinitions:{list:Y0.contract,get:W0.contract,create:J0.contract,update:Z0.contract,disable:X0.contract,delete:eM.contract},memory:{put:Ou.contract,get:_u.contract,list:Du.contract,search:Lu.contract,delete:Qu.contract},onboarding:{getState:v0.contract,skipIntegration:w0.contract,skipGithubAppInstallation:E0.contract,skipSampleIssue:k0.contract,finish:x0.contract},organizations:{list:R0.contract,get:T0.contract,create:P0.contract,update:B0.contract},members:{list:TN.contract,updateRole:BN.contract,remove:ON.contract,invite:_N.contract,listInvitations:DN.contract,revokeInvitation:LN.contract},teams:{list:nM.contract,create:oM.contract,update:rM.contract,delete:iM.contract,addMember:sM.contract,removeMember:aM.contract,listMembers:cM.contract},publicKeys:{list:Uc.contract,get:Fc.contract,ensureLogForwarding:$c.contract,update:Gc.contract,deactivate:qc.contract},secretKeys:{list:Mf.contract,get:zf.contract,create:jf.contract,update:Uf.contract,delete:Ff.contract},projects:{list:yS.contract,get:bS.contract,create:IS.contract,update:SS.contract,delete:CS.contract},search:{threads:$u.contract,messages:Gu.contract},messages:{list:Sge.contract,append:Cge.contract},threads:{list:HN.contract,get:VN.contract,getStatus:KN.contract,stop:YN.contract,create:WN.contract,update:JN.contract,fork:ZN.contract,setVisibility:XN.contract,createShareLink:e0.contract,listShareLinks:t0.contract,revokeShareLink:n0.contract},runs:{list:UN.contract,listForThread:FN.contract,get:$N.contract,cancel:GN.contract},pullRequests:{list:_0.contract},issues:{count:xf.contract,create:jc.contract,list:Ef.contract,search:kf.contract,get:Pf.contract,resolve:Rf.contract,ignore:Tf.contract,reopen:Bf.contract,reassignAndReopen:Of.contract,mute:_f.contract,unmute:Df.contract},workItems:{create:lM.contract,comment:uM.contract,transition:dM.contract},billing:{getSummary:xR.contract,getUsage:PR.contract,getAccruedUsageCharges:HR.contract,listUsageInvoices:qR.contract,listTransactions:RR.contract,getAutoTopUp:OR.contract,updateAutoTopUp:_R.contract,purchaseCredits:DR.contract,listPlans:LR.contract,previewPlanChange:QR.contract,previewSubscriptionCancellation:FR.contract,scheduleSubscriptionCancellation:$R.contract,resumeSubscriptionCancellation:GR.contract,changePlan:NR.contract,createCheckoutSession:MR.contract,getCheckoutSessionStatus:zR.contract,createPortalSession:jR.contract,getPaymentMethod:UR.contract},tasks:{list:km.contract},recommendations:{list:Sm.contract},repos:{list:Cm.contract,add:vm.contract,remove:wm.contract},components:{list:of.contract,get:rf.contract,register:zc.contract,deregister:sf.contract,rename:af.contract,assignTeam:cf.contract,reactivationPreview:lf.contract,reactivate:uf.contract,mergePreview:Af.contract,merge:ff.contract,relationships:{list:df.contract,preview:pf.contract,add:gf.contract,remove:mf.contract},incidents:{list:yf.contract},timeline:bf.contract}}});var Ha=h(()=>{H$();lR();hR();ihe();WR();XR();Jf();TB();PN();jN();O0();D0();Q0();M0();V0();tM()});var i8e="https://api.sazabi.com",s8e="x-sazabi-client-source",ahe=(e)=>({streamRun:async(t)=>she({options:e,path:`/runs/${encodeURIComponent(t.runId)}/stream`,cursor:t.cursor,signal:t.signal}),streamThread:async(t)=>she({options:e,path:`/threads/${encodeURIComponent(t.threadId)}/stream`,cursor:t.cursor,signal:t.signal})}),she=async(e)=>{let t=e.options.fetch??globalThis.fetch;if(!t)throw Error("Fetch transport is not available in this runtime.");let n=await e.options.credentialProvider.getToken(),r=a8e(e.options.apiBaseUrl,e.path,e.cursor);return l8e({url:r,token:n,clientSource:e.options.clientSource,initialCursor:e.cursor,signal:e.signal,fetch:t})},a8e=(e,t,n)=>{let r=c8e(e??i8e),o=new URL(`${r}${t}`);if(n)o.searchParams.set(YP,n);return o.toString()},c8e=(e)=>{let t=e.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},l8e=async(e)=>{let t=[],n=[],r=!1,o=!1,i,s=e.initialCursor,c=new AbortController,l=(f)=>{if(r)return;r=!0,i=f;while(n.length>0)n.shift()?.({value:void 0,done:!0})},u=(f)=>{let S=n.shift();if(S){S({value:f,done:!1});return}t.push(f)},d=(f)=>{if(f.event===JP){let v=m8e(f.data);if(v!==void 0)s=v;return}if(f.data===ZP){o=!0,c.abort(),l();return}let S=h8e(f.data);if(S)u(S)},p=()=>{o=!0,c.abort(),l()};if(e.signal)if(e.signal.aborted)o=!0,c.abort();else e.signal.addEventListener("abort",p,{once:!0});let g={[Symbol.asyncIterator](){return g},get cursor(){return s},next:async()=>{if(t.length>0)return{value:t.shift(),done:!1};if(r){if(i)throw i;return{value:void 0,done:!0}}return new Promise((f)=>{n.push(f)}).then((f)=>{if(f.done&&i)throw i;return f})},return:async()=>(o=!0,c.abort(),l(),{value:void 0,done:!0}),throw:async(f)=>{throw o=!0,c.abort(),l(f instanceof Error?f:Error(String(f))),f},close:async()=>{o=!0,c.abort(),l()}};if(o)return l(),g;let m=await e.fetch(e.url,{method:WP,headers:u8e(e.token,e.clientSource),signal:c.signal});if(await d8e(m))l();else p8e(m,d).then(()=>l()).catch((f)=>{if(f8e(f)||o||e.signal?.aborted){l();return}l(y8e(f))});return g},u8e=(e,t)=>({accept:"text/event-stream",authorization:`Bearer ${e}`,...t?{[s8e]:t}:{}}),d8e=async(e)=>{if(e.status===204)return!0;if(e.ok&&e.body)return!1;let t=await A8e(e);if(e.status===401)throw Error("Authentication failed. Check your credential.");if(e.status===403)throw Error(`Forbidden (403): ${t||"Credential may not have access to this resource"}`);if(e.status===404)throw Error(`Not found (404): ${t||"Run or thread not found"}`);if(e.status===400)throw Error(`Invalid stream cursor (400): ${t||"The provided cursor was rejected"}`);if(e.status>=400&&e.status<500&&e.status!==429)throw Error(`Client error (${e.status}): ${t}`);if(!e.body)throw Error("Agent stream response did not include a body.");throw Error(e.status===429?`Rate limited (429): ${t}`:`Server error (${e.status}): ${t}`)},p8e=async(e,t)=>{let n=e.body?.getReader();if(!n)throw Error("Agent stream response did not include a body.");let r=new TextDecoder,o="",i=g8e(t);try{while(!0){let s=await n.read();if(s.done)break;o+=r.decode(s.value,{stream:!0});let c=o.split(/\r\n|\r|\n/);o=c.pop()??"";for(let l of c)i.line(l)}if(o+=r.decode(),o)for(let s of o.split(/\r\n|\r|\n/))i.line(s);i.flush()}finally{n.releaseLock()}},g8e=(e)=>{let t="message",n=[],r=()=>{t="message",n=[]},o=()=>{if(n.length===0){r();return}e({event:t,data:n.join(`
|
|
8911
|
+
`)}],evidenceHints:["force.com / my.salesforce.com URLs, SALESFORCE_* or SFDC_* environment variables, or sf/sfdx CLI usage","jsforce, simple-salesforce, or @salesforce packages","README/runbooks naming Salesforce as the CRM or system of record"],helpText:"Query Salesforce data and metadata, and run Apex invocable actions and Flows exposed by a hosted MCP server. Coming soon — a Salesforce admin registers an External Client App in your org and Sazabi provisions its credentials, so it isn't self-serve connectable yet."})});var Zue;var Xue=h(()=>{de();Zue=U({id:"secureframe",label:"Secureframe",iconKey:"secureframe",defaultServerUrl:"https://mcp.secureframe.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"secureframe",callbackPathSegment:"secureframe",authorizationUrl:"https://mcp.secureframe.com/oauth/authorize",tokenUrl:"https://mcp.secureframe.com/oauth/token",resourceUrl:"https://mcp.secureframe.com",dynamicClientRegistration:{registrationEndpoint:"https://mcp.secureframe.com/register",tokenEndpointAuthMethod:"none"}},getAvailableScopes:async()=>[{value:"mcp",label:"MCP Access",description:"Query and manage Secureframe compliance data, controls, tests, vendors, risks, and framework requirements."}],scopesUserSelectable:!1,regions:[{label:"United States (US)",serverUrl:"https://mcp.secureframe.com"},{label:"United Kingdom (UK)",serverUrl:"https://mcp-uk.secureframe.com",authorizationUrl:"https://mcp-uk.secureframe.com/oauth/authorize",tokenUrl:"https://mcp-uk.secureframe.com/oauth/token",resourceUrl:"https://mcp-uk.secureframe.com",dynamicClientRegistration:{registrationEndpoint:"https://mcp-uk.secureframe.com/register",tokenEndpointAuthMethod:"none"}}],capabilityOverrides:{allowWriteTools:!0},evidenceHints:["secureframe.com URLs, SECUREFRAME_API_KEY / SECUREFRAME_API_SECRET environment variables","SOC 2, ISO 27001, HIPAA, PCI DSS, GDPR, or NIST compliance frameworks and controls","README/docs or compliance runbooks naming Secureframe for automated compliance and continuous monitoring"],helpText:"Query and manage Secureframe compliance data, controls, automated tests, vendors, risks, and framework requirements. Choose the US or UK region when connecting.",skill:"secureframe",setupSkill:"secureframe-setup"})});var ede;var tde=h(()=>{de();ede=U({id:"sentry",label:"Sentry",iconKey:"sentry",defaultServerUrl:"https://mcp.sentry.dev/mcp",serverUrlPathSuffixMaxSegments:2,transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"sentry",callbackPathSegment:"sentry",authorizationUrl:"https://mcp.sentry.dev/oauth/authorize",tokenUrl:"https://mcp.sentry.dev/oauth/token",useServerUrlAsResource:!0,dynamicClientRegistration:{registrationEndpoint:"https://mcp.sentry.dev/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"org:read"},{value:"project:write"},{value:"team:write"},{value:"event:write"}],getUrlConfiguration:async()=>({docsUrl:"https://mcp.sentry.dev/",instructions:"Copy the hosted MCP server URL below. Optional: to scope this connection to one organization or project, copy a path-scoped URL from the Sentry MCP page (e.g. .../mcp/your-org).",defaultServerUrl:"https://mcp.sentry.dev/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["@sentry packages, sentry.properties, SENTRY_* environment variables, or sentry-cli usage","Sentry.init calls, release/deploy automation, or Sentry alert docs","README/docs naming Sentry as the error tracking provider"],helpText:"Browse Sentry organizations, teams, projects, and events."})});var nde;var ode=h(()=>{_t();de();nde=U({id:"signoz",label:"SigNoz",iconKey:"signoz",defaultServerUrl:"https://mcp.us.signoz.cloud/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!0},evidenceHints:["SigNoz config, SIGNOZ_* environment variables, or signoz.io links","OpenTelemetry Collector exporting to SigNoz, or a signoz docker-compose / self-hosted deployment","README/docs naming SigNoz for metrics, logs, traces, alerts, or dashboards"],helpText:"Query SigNoz metrics, logs, traces, alerts, and dashboards to investigate production issues.",setupGroups:[{id:"instance",title:"Find your SigNoz instance",description:"Point Sazabi at the SigNoz instance whose telemetry you want to query.",body:"For SigNoz Cloud, use the regional MCP endpoint for your account, such as `https://mcp.us.signoz.cloud/mcp` (replace the region as needed). For self-hosted SigNoz, use your instance's MCP endpoint and set the SigNoz base URL below so the server knows which instance to target.",fieldKeys:["signozUrl"]},{id:"api-key",title:"Create an API key",description:"Create or copy the SigNoz API key Sazabi will send to SigNoz's MCP endpoint.",body:"In SigNoz, go to **Settings > API Keys** and create or copy an API key. Alert, dashboard, and notification-channel tools require an admin-level key. Paste it below.",fieldKeys:["apiKey"]}],validateCredentials:_ce,normalizeHeaders:Oce})});var rde;var ide=h(()=>{de();rde=U({id:"slack",label:"Slack",iconKey:"slack",defaultServerUrl:"https://mcp.slack.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"slack",callbackPathSegment:"slack",authorizationUrl:"https://slack.com/oauth/v2_user/authorize",tokenUrl:"https://slack.com/api/oauth.v2.user.access"},getAvailableScopes:async()=>[{value:"search:read.public"},{value:"search:read.private"},{value:"search:read.mpim"},{value:"search:read.im"},{value:"search:read.files"},{value:"search:read.users"},{value:"canvases:read"},{value:"users:read"},{value:"users:read.email"}],getUrlConfiguration:async()=>null,capabilityOverrides:{defaultUnavailableReason:"write_blocked"},evidenceHints:["Slack app manifests, bot/webhook URLs, SLACK_* environment variables, or slack.com links","Runbooks that route incidents, alerts, or deploy notices through Slack","Code or docs naming Slack channels for operational triage"],helpText:"Browse Slack messages, files, and threads. Coming soon — requires backend OAuth plumbing for user_scope and isn't self-serve connectable yet.",skill:"slack",setupSkill:"slack-setup"})});var sde;var ade=h(()=>{de();sde=U({id:"stripe",label:"Stripe MCP",iconKey:"stripe",defaultServerUrl:"https://mcp.stripe.com",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"stripe",callbackPathSegment:"stripe",authorizationUrl:"https://access.stripe.com/mcp/oauth2/authorize",tokenUrl:"https://access.stripe.com/mcp/oauth2/token",resourceUrl:"https://mcp.stripe.com",dynamicClientRegistration:{registrationEndpoint:"https://access.stripe.com/mcp/oauth2/register",tokenEndpointAuthMethod:"none"},defaultAccessTokenTtlSeconds:21600},getAvailableScopes:async()=>[{value:"mcp",label:"MCP access",description:"Access the Stripe MCP server tools for the connected account.",required:!0}],scopesUserSelectable:!1,getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Stripe dashboard URLs, `sk_`/`rk_`/`pk_` API keys, or Stripe object IDs (cus_, pi_, ch_)","STRIPE_* environment variables or code that imports the `stripe` SDK","README/runbooks naming Stripe for billing, payments, or subscriptions"],helpText:"Query and manage Stripe payments, customers, and billing."})});var cde;var lde=h(()=>{de();cde=U({id:"supabase",label:"Supabase",iconKey:"supabase",defaultServerUrl:"https://mcp.supabase.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"supabase",callbackPathSegment:"supabase",authorizationUrl:"https://api.supabase.com/v1/oauth/authorize",tokenUrl:"https://api.supabase.com/v1/oauth/token",dynamicClientRegistration:{registrationEndpoint:"https://api.supabase.com/platform/oauth/apps/register",tokenEndpointAuthMethod:"client_secret_post"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"analytics:read"},{value:"auth:read"},{value:"auth:write"},{value:"database:read"},{value:"database:write"},{value:"domains:read"},{value:"domains:write"},{value:"edge_functions:read"},{value:"edge_functions:write"},{value:"environment:read"},{value:"environment:write"},{value:"organizations:read"},{value:"projects:read"},{value:"projects:write"},{value:"rest:read"},{value:"rest:write"},{value:"secrets:read"},{value:"secrets:write"},{value:"storage:read"}],getUrlConfiguration:async()=>({docsUrl:"https://supabase.com/docs/guides/getting-started/mcp#step-2-configure-your-ai-tool",instructions:"Choose your project and options in the Supabase configuration panel, then copy the generated Server URL.",defaultServerUrl:"https://mcp.supabase.com/mcp",optional:!0}),capabilityOverrides:{allowWriteTools:!0},evidenceHints:["supabase/ directory, supabase/config.toml, or @supabase packages","SUPABASE_* or NEXT_PUBLIC_SUPABASE_* environment variables","README/docs naming Supabase for Postgres, Auth, Storage, or Edge Functions"],helpText:"Manage Supabase organizations, projects, databases, and run SQL.",skill:"supabase",setupSkill:"supabase-setup"})});var ude;var dde=h(()=>{de();ude=U({id:"superhuman",label:"Superhuman",iconKey:"superhuman",defaultServerUrl:"https://mcp.mail.superhuman.com/mcp",transport:"streamable-http",authMode:"oauth",availability:"enabled",oauth:{providerConfigKey:"superhuman",callbackPathSegment:"superhuman",authorizationUrl:"https://mcp.auth.mail.superhuman.com/oauth2/authorize",tokenUrl:"https://mcp.auth.mail.superhuman.com/oauth2/token",dynamicClientRegistration:{registrationEndpoint:"https://mcp.auth.mail.superhuman.com/oauth2/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"email",required:!0},{value:"offline_access",required:!0},{value:"openid",required:!0},{value:"profile",required:!0}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["Superhuman mail links, SUPERHUMAN_* environment variables, or support workflows naming Superhuman","Customer communication runbooks that depend on email search or drafting","Docs naming Superhuman Mail for sales, support, or founder-led customer comms"],helpText:"Search, draft, send, and triage emails in Superhuman Mail."})});var pde;var gde=h(()=>{_t();de();pde=U({id:"the-context-company",label:"The Context Company",iconKey:"the-context-company",defaultServerUrl:"https://api.thecontext.company/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{allowWriteTools:!1},evidenceHints:["The Context Company, context company, or context observability references","insight_search, get_agent_runs, or get_agent_sessions tool usage","THE_CONTEXT_COMPANY_API_KEY or api.thecontext.company in MCP configuration"],helpText:"Query agent insights, runs, and sessions through The Context Company's read-only hosted MCP server.",setupGroups:[{id:"api-key",title:"Create a read-only API key",description:"Create the API key The Context Company's hosted MCP server will use.",body:"Generate a read-only API key on The Context Company's [Access Data page](https://www.thecontextcompany.com/prod/mcp-and-api), then paste the raw key below. Sazabi sends it as `Authorization: Bearer <key>` to `https://api.thecontext.company/mcp`.",fieldKeys:["apiKey"]}],validateCredentials:wce,normalizeHeaders:vce,skill:"the-context-company",setupSkill:"the-context-company-setup"})});var mde;var hde=h(()=>{de();mde=U({id:"vercel",label:"Vercel",iconKey:"vercel",defaultServerUrl:"https://mcp.vercel.com",transport:"streamable-http",authMode:"oauth",availability:"disabled",oauth:{providerConfigKey:"vercel",callbackPathSegment:"vercel",authorizationUrl:"https://vercel.com/oauth/authorize",tokenUrl:"https://vercel.com/api/login/oauth/token",resourceUrl:"https://mcp.vercel.com",dynamicClientRegistration:{registrationEndpoint:"https://vercel.com/api/login/oauth/register",tokenEndpointAuthMethod:"none"}},scopesUserSelectable:!1,getAvailableScopes:async()=>[{value:"openid",required:!0},{value:"offline_access",required:!0}],getUrlConfiguration:async()=>null,capabilityOverrides:{allowWriteTools:!0},evidenceHints:["vercel.com links, VERCEL_* environment variables, or a vercel.json in the repo","Deploy workflows or runbooks naming Vercel as the frontend/hosting provider","Vercel project/deployment IDs or preview URLs referenced in docs or CI"],helpText:"Manage Vercel projects, deployments, and access Vercel platform documentation. Coming soon — Vercel's hosted MCP only authorizes allowlisted clients and Sazabi is pending approval, so it isn't connectable yet."})});var Ade;var fde=h(()=>{_t();de();Ade=U({id:"x",label:"X",iconKey:"x",defaultServerUrl:"https://api.x.com/mcp",transport:"streamable-http",authMode:"headers",availability:"enabled",capabilityOverrides:{readOnlyToolNames:["search_news","get_news","get_trends_by_woeid","get_posts_by_ids","get_posts_counts_recent","search_posts_all","get_posts_by_id","get_posts_liking_users","get_posts_quoted_posts","get_posts_reposted_by","get_users_by_usernames","get_users_by_username","get_users_me","search_users","get_users_by_id","get_users_bookmarks","get_users_bookmark_folders","get_users_bookmarks_by_folder_id","get_users_mentions","get_users_timeline","get_users_posts"]},evidenceHints:["X (Twitter) API usage, X_BEARER_TOKEN, or TWITTER_* environment variables","twitter-api-v2, tweepy, or other X/Twitter API client packages","README/docs naming the X API, X Developer Platform, or tweet automation"],helpText:"Search X posts and access real-time X data using your app's app-only Bearer Token.",setupGroups:[{id:"developer-app",title:"Open the X Developer Portal",description:"Use an X developer project/app with access to the X API v2.",body:"Go to the [X Developer Portal](https://developer.x.com/en/portal/dashboard), open the project and app you want Sazabi to use, and confirm the app has access to the API tiers you need. The hosted MCP server lives at `https://api.x.com/mcp`."},{id:"bearer-token",title:"Copy the app's Bearer Token",description:"Copy the app-only Bearer Token the hosted MCP server will use.",body:"In your app's **Keys and tokens**, find the app-only **Bearer Token** and copy it (regenerate it if you don't have it saved). This is the app-only token, not a user OAuth 2.0 access token. Paste the raw token into Sazabi — Sazabi adds the `Bearer ` prefix and sends it in the `Authorization` header.",fieldKeys:["accessToken"]}],validateCredentials:Ece,normalizeHeaders:Cce,skill:"x",setupSkill:"x-setup"})});var bde,D0t;var Ide=h(()=>{sle();cle();ule();ple();mle();sS();sS();fle();ble();Sle();vle();Ele();xle();Rle();Ble();_le();Lle();Nle();zle();Ule();$le();qle();Vle();Yle();Jle();Xle();tue();oue();iue();aue();lue();due();gue();hue();fue();bue();Sue();vue();Eue();xue();Rue();Bue();_ue();Lue();Nue();zue();Uue();$ue();que();Vue();Yue();Jue();Xue();tde();ode();ide();ade();lde();dde();gde();hde();fde();bde=[cde,Fle,Gle,ale,ile,lle,dle,gle,hle,Ale,yle,Ile,Cle,wle,kle,Tle,Ole,Dle,Qle,Ple,Mle,jle,Hle,Kle,Wle,Zle,eue,nue,rue,sue,cue,uue,pue,mue,Aue,yue,Iue,Cue,wue,kue,Pue,Tue,Oue,Due,Que,Mue,jue,Gue,Fue,Hue,Kue,Wue,Zue,ede,nde,rde,sde,ude,pde,mde,Ade],D0t=new Map(bde.map((e)=>[e.id,e]))});var Sde=()=>{};var Cde=()=>{};var vde=()=>{};var wde=()=>{};var Ede=()=>{};var kde=()=>{};var xde=()=>{};var Pde=()=>{};var Rde=()=>{};var Tde=()=>{};var Bde=()=>{};var Ode=()=>{};var _de=()=>{};var Dde=()=>{};var Lde=()=>{};var Qde=()=>{};var Nde=()=>{};var Mde=()=>{};var zde=()=>{};var jde=()=>{};var Ude=()=>{};var Fde=()=>{};var $de=()=>{};var Gde=()=>{};var qde=()=>{};var Hde=()=>{};var Vde=()=>{};var Kde=()=>{};var Yde=()=>{};var Wde=()=>{};var Jde=()=>{};var Zde=()=>{};var Xde=()=>{};var epe=()=>{};var tpe=()=>{};var npe=()=>{};var ope=()=>{};var rpe=()=>{};var ipe=()=>{};var spe=()=>{};var ape=()=>{};var cpe=()=>{};var lpe=()=>{};var upe=()=>{};var dpe=h(()=>{Sde();Cde();vde();wde();Ede();kde();xde();Pde();Rde();Tde();Bde();Ode();_de();Dde();Lde();Qde();Nde();Mde();zde();jde();Ude();Fde();$de();Gde();qde();Hde();Vde();Kde();Yde();Wde();Jde();Zde();Xde();epe();tpe();npe();ope();rpe();ipe();spe();ape();cpe();lpe();upe()});var ppe=h(()=>{sS()});var gpe=()=>{};var mpe=h(()=>{QW();oy();mce();_t();Xce();ele();Ide();wN();dpe();ppe();gpe()});var hpe,K9e,Ape,Y9e,fpe,EN,ype,bpe,Ss,Ipe,Spe,Cpe,Iu,vpe,wpe,Su,Epe,kpe,Cu,xpe,W9e,Ppe,aS,Rpe,Tpe,Bpe,Ope,vu,_pe,Dpe,wu,Lpe,Qpe,Eu,kN,xN,Npe,Mpe,ku,zpe,jpe,xu,Upe,J9e,Pu,Fpe,$pe,Ru,Gpe,qpe,Tu,Hpe,Vpe,Bu,Z9e;var PN=h(()=>{mpe();Oe();Ve();hpe=["configured","authorizing","connected","error"],K9e=a.enum(hpe),Ape=["preset","custom"],Y9e=a.enum(Ape),fpe=["streamable-http","sse"],EN=a.enum(fpe),ype=["none","headers","oauth","aws-sigv4"],bpe=a.enum(ype),Ss=a.object({connectionId:a.string().uuid().describe("Connection ID."),connectionKey:a.string().describe("Stable key used to reference this connector in tool calls."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),displayName:a.string().describe("Human-readable connector name."),source:Y9e.describe("Whether the connector is a built-in preset or a custom server."),installStatus:K9e.describe("Current connection lifecycle status."),authMode:bpe.describe("Authentication mode."),transport:EN.describe("Transport protocol."),serverUrl:a.string().describe("MCP server URL."),readOnly:a.boolean().describe("Whether the connector is restricted to read-only tools."),management:QB.describe("Lifecycle owner and supported connector mutations."),enabledToolCount:a.number().int().nonnegative().describe("Number of tools enabled and available for this connector."),connectedAt:a.string().datetime().nullable().describe("When the connector last became connected, if ever."),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),Ipe=a.object({name:a.string().describe("Tool name as invoked."),title:a.string().describe("Human-readable tool title."),description:a.string().describe("Tool description."),isReadOnly:a.boolean().describe("Whether the tool is considered read-only."),enabled:a.boolean().describe("Whether the tool is enabled and available given the connector config.")}),Spe=a.object({projectId:a.string().uuid().optional().describe("Project to list connectors for. Auto-filled from SDK context when omitted."),connectedOnly:a.union([a.boolean(),a.stringbool()]).optional().describe("When true, only return connectors that are connected.")}),Cpe=a.object({connectors:a.array(Ss)}),Iu=w({operationId:"mcpConnectors.list",summary:"List MCP connectors",description:"List configured MCP connectors within one project with provider, status, and enabled-tool count.",backend:"api",route:{method:"GET",path:"/mcp-connectors",tags:["MCP Connectors"]},input:Spe,output:Cpe,pagination:"none",async:"sync"}),vpe=a.object({connectionId:a.string().uuid().describe("Connection ID to fetch."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),wpe=a.object({connector:Ss}),Su=w({operationId:"mcpConnectors.get",summary:"Get an MCP connector",description:"Get one configured MCP connector by connection ID.",backend:"api",route:{method:"GET",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"]},input:vpe,output:wpe,pagination:"none",async:"sync"}),Epe=a.object({connectionId:a.string().uuid().describe("Connection ID to inspect."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),kpe=a.object({connector:Ss,tools:a.array(Ipe)}),Cu=w({operationId:"mcpConnectors.details",summary:"Inspect an MCP connector's tools",description:"Inspect one MCP connector's tool surface, including each tool's name, description, and read-only status.",backend:"api",route:{method:"GET",path:"/mcp-connectors/{connectionId}/details",tags:["MCP Connectors"]},input:Epe,output:kpe,pagination:"none",async:"sync"}),xpe=a.object({providerId:a.string().describe('Provider identifier, e.g. "linear".'),label:a.string().describe("Human-readable provider name."),authMode:bpe.describe("Authentication mode."),availability:a.enum(nl).describe("Whether the provider is enabled or coming soon."),setupSkill:a.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),W9e=a.object({}),Ppe=a.object({providers:a.array(xpe)}),aS=w({operationId:"mcpConnectors.listProviders",summary:"List MCP connector providers",description:"List all supported MCP connector providers with their auth mode and setup skill.",backend:"api",route:{method:"GET",path:"/mcp-connectors/providers",tags:["MCP Connectors"]},input:W9e,output:Ppe,pagination:"none",async:"sync"}),Rpe=a.object({connectionKey:a.string().describe("Stable key used to call this connector."),displayName:a.string().describe("Human-readable connector name."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),toolCount:a.number().int().nonnegative().describe("Number of executable tools on this connector.")}),Tpe=a.object({connectionKey:a.string().describe("Connector that exposes this tool."),toolName:a.string().describe("Tool name as invoked."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),displayName:a.string().describe("Human-readable connector name."),isReadOnly:a.boolean().describe("Whether the tool is considered read-only."),description:a.string().describe("Tool description from the stored snapshot."),score:a.number().describe("BM25 rank score. Zero when enumerating a namespace."),inputSchema:a.record(a.string(),a.unknown()).optional().describe("JSON Schema for the tool's arguments, when requested.")}),Bpe=a.object({projectId:a.string().uuid().optional().describe("Project to search connectors in. Auto-filled from SDK context when omitted."),query:a.string().optional().describe("Free-text query over tool names, titles, connector keys, and descriptions. Omit or empty to list connectors, or to enumerate one connector when namespace is set."),namespace:a.string().min(1).optional().describe("Restrict results to one connectionKey or providerId."),limit:a.coerce.number().int().min(1).max(100).default(10).describe("Maximum number of connectors or tool hits to return."),offset:a.coerce.number().int().min(0).default(0).describe("Number of connectors or tool hits to skip."),includeInputSchema:a.union([a.boolean(),a.stringbool()]).optional().describe("Load one exact tool's inputSchema. Requires a connectionKey namespace and non-empty query; accepts either toolName or the hit's copy-paste name.")}).superRefine((e,t)=>{if(e.includeInputSchema===!0&&(!e.namespace?.trim()||!e.query?.trim()))t.addIssue({code:"custom",path:["includeInputSchema"],message:"Schema detail requires namespace and a non-empty exact tool name."})}),Ope=a.object({kind:a.enum(["connectors","tools"]).describe("connectors when the query is empty and no namespace is set; tools otherwise."),total:a.number().int().nonnegative().describe("Total matches before limit and offset."),connectors:a.array(Rpe).describe("Connector index. Empty when kind is tools."),tools:a.array(Tpe).describe("Ranked or enumerated tool hits. Empty when kind is connectors.")}),vu=w({operationId:"mcpConnectors.search",summary:"Search MCP connector tools",description:"Search executable third-party MCP connector tools by free-text query. Empty query lists connectors; empty query plus namespace enumerates that connector. Hits omit input schemas unless includeInputSchema is true, which requires one exact namespaced tool and always returns at most one hit.",backend:"api",route:{method:"GET",path:"/mcp-connectors/tools/search",tags:["MCP Connectors"]},input:Bpe,output:Ope,pagination:"none",async:"sync"}),_pe=a.object({projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),connectionKey:a.string().min(1).describe("Connector key from search or mcpConnectors.list."),toolName:a.string().min(1).describe("Tool name as invoked.")}),Dpe=a.object({connectionKey:a.string().describe("Connector that exposes this tool."),toolName:a.string().describe("Tool name as invoked."),providerId:a.string().describe('Provider identifier, e.g. "linear".'),displayName:a.string().describe("Human-readable connector name."),title:a.string().describe("Human-readable tool title."),description:a.string().describe("Tool description from the stored snapshot."),isReadOnly:a.boolean().describe("Whether the tool is considered read-only."),inputSchema:a.record(a.string(),a.unknown()).describe("JSON Schema for the tool's arguments.")}),wu=w({operationId:"mcpConnectors.describe",summary:"Describe an MCP connector tool",description:"Load one executable third-party MCP connector tool, including its input schema.",backend:"api",route:{method:"GET",path:"/mcp-connectors/tools/describe",tags:["MCP Connectors"]},input:_pe,output:Dpe,pagination:"none",async:"sync"}),Lpe=a.object({projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),connectionKey:a.string().min(1).describe("Connector key from search or mcpConnectors.list."),toolName:a.string().min(1).describe("Tool name as invoked."),arguments:a.record(a.string(),a.unknown()).optional().describe("Arguments matching the tool's input schema.")}),Qpe=a.discriminatedUnion("ok",[a.object({ok:a.literal(!0),connectionKey:a.string().describe("Connector that ran the tool."),toolName:a.string().describe("Tool name as invoked."),result:a.unknown().describe("Vendor tool result payload."),structuredContent:a.unknown().optional().describe("Structured content from the vendor when present."),content:a.array(a.record(a.string(),a.unknown())).describe("Raw MCP content parts from the vendor."),text:a.string().nullable().describe("Concatenated text content, if any.")}),a.object({ok:a.literal(!1),code:a.enum(["TOOL_NOT_ENABLED","READ_ONLY","MCP_ERROR"]).describe("Why the tool did not run."),message:a.string().describe("Caller-facing error message.")})]),Eu=w({operationId:"mcpConnectors.call",summary:"Call an MCP connector tool",description:"Invoke one executable third-party MCP connector tool using that connection's stored credential.",backend:"api",route:{method:"POST",path:"/mcp-connectors/tools/call",tags:["MCP Connectors"]},input:Lpe,output:Qpe,pagination:"none",async:"sync"}),kN=a.object({id:a.string().min(1).describe("Stable ID for this header (must be unique within the connector)."),name:a.string().trim().min(1).describe("HTTP header name."),value:a.string().min(1).describe("HTTP header value (passed verbatim).")}),xN=a.object({accessKeyId:a.string().trim().min(1).describe("AWS access key ID."),secretAccessKey:a.string().min(1).describe("AWS secret access key."),sessionToken:a.string().min(1).optional().describe("Optional session token for temporary credentials."),region:a.string().trim().min(1).describe("AWS region.")}),Npe=a.object({projectId:a.string().uuid().optional().describe("Project to create the connector in. Auto-filled from SDK context when omitted."),serverUrl:a.string().url().describe("MCP server URL (must be https)."),transport:EN.describe("Transport protocol."),headers:a.array(kN).optional().describe("HTTP headers to send with each request."),awsSigV4:xN.optional().describe("AWS SigV4 credentials for AWS MCP servers."),providerId:a.string().min(1).describe("Built-in preset provider ID (for example, linear or datadog)."),readOnly:a.boolean().optional().describe("Restrict the connector to read-only tools. Defaults to false.")}),Mpe=a.object({connector:Ss}),ku=w({operationId:"mcpConnectors.create",summary:"Create an MCP connector",description:"Create a preset MCP connector with header-based or AWS SigV4 authentication. The server URL must match the selected provider's supported endpoints. Connects immediately and returns the connector with its discovered tool snapshot.",backend:"api",route:{method:"POST",path:"/mcp-connectors",tags:["MCP Connectors"],successStatus:201},input:Npe,output:Mpe,pagination:"none",async:"sync"}),zpe=a.object({connectionId:a.string().uuid().describe("Connection ID to update."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),serverUrl:a.string().url().optional().describe("New MCP server URL."),transport:EN.optional().describe("New transport protocol."),headers:a.array(kN).optional().describe("Complete replacement header set. Replaces all existing headers."),awsSigV4:xN.optional().describe("Replacement AWS SigV4 credentials. Mutually exclusive with headers.")}),jpe=a.object({connector:Ss}),xu=w({operationId:"mcpConnectors.update",summary:"Update an MCP connector",description:"Deprecated. Preset MCP connector updates are no longer supported via the public API; disconnect and reconnect instead.",backend:"api",route:{method:"PATCH",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"]},input:zpe,output:jpe,pagination:"none",async:"sync"}),Upe=a.object({connectionId:a.string().uuid().describe("Connection ID to disconnect."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted.")}),J9e=a.void(),Pu=w({operationId:"mcpConnectors.disconnect",summary:"Disconnect an MCP connector",description:"Disconnect and permanently remove an MCP connector.",backend:"api",route:{method:"DELETE",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"],successStatus:204},input:Upe,output:J9e,pagination:"none",async:"sync"}),Fpe=a.object({connectionId:a.string().uuid().describe("Connection ID to update."),projectId:a.string().uuid().optional().describe("Project the connector belongs to. Auto-filled from SDK context when omitted."),readOnly:a.boolean().describe("True to restrict to read-only tools; false to allow all enabled tools.")}),$pe=a.object({connector:Ss}),Ru=w({operationId:"mcpConnectors.setReadOnly",summary:"Toggle an MCP connector's read-only mode",description:"Toggle the read-only restriction on an MCP connector.",backend:"api",route:{method:"PATCH",path:"/mcp-connectors/{connectionId}/read-only",tags:["MCP Connectors"]},input:Fpe,output:$pe,pagination:"none",async:"sync"}),Gpe=a.object({projectId:a.string().uuid().optional().describe("Project to install into. Auto-filled from SDK context when omitted."),providerId:a.string().min(1).describe('Provider ID to install, e.g. "linear".'),requestedScopes:a.array(a.string()).optional().describe("Scopes to request. Defaults to the provider's recommended scope set."),serverUrl:a.string().url().optional().describe("Server URL for multi-region providers; defaults to the provider's primary server."),readOnly:a.boolean().optional().describe("Restrict the connector to read-only tools after install. Defaults to false."),returnTo:a.string().optional().describe("Path to redirect the user to after OAuth completes.")}),qpe=a.object({authorizationUrl:a.string().describe("Authorization URL to open in the user's browser."),connectionId:a.string().uuid().describe("Connection ID to poll for completion via getMcpOAuthInstallAttempt."),expiresAt:a.string().datetime().describe("When the OAuth authorization attempt expires.")}),Tu=w({operationId:"mcpConnectors.beginOAuthInstall",summary:"Begin an MCP connector OAuth install",description:"Begin an OAuth browser flow to install a preset MCP connector. Opens an authorization URL in the user's browser; poll getMcpOAuthInstallAttempt with the returned connectionId to check completion.",backend:"api",route:{method:"POST",path:"/mcp-connectors/oauth/begin",tags:["MCP Connectors"],successStatus:201},input:Gpe,output:qpe,pagination:"none",async:"sync"}),Hpe=a.object({connectionId:a.string().uuid().describe("Connection ID returned by beginMcpOAuthInstall."),projectId:a.string().uuid().optional().describe("Project the connection belongs to. Auto-filled from SDK context when omitted.")}),Vpe=a.object({status:a.enum(["authorizing","connected","error"]).describe("Current install status."),connector:Ss.optional().describe("Connector details once connected or in error state.")}),Bu=w({operationId:"mcpConnectors.getOAuthInstallAttempt",summary:"Get an MCP connector OAuth install attempt",description:"Poll the status of an in-progress OAuth MCP connector install. Returns authorizing while the user completes the browser flow, connected on success, or error on failure.",backend:"api",route:{method:"GET",path:"/mcp-connectors/oauth/attempts/{connectionId}",tags:["MCP Connectors"]},input:Hpe,output:Vpe,pagination:"none",async:"sync"}),Z9e={list:Iu.contract,get:Su.contract,details:Cu.contract,listProviders:aS.contract,search:vu.contract,describe:wu.contract,call:Eu.contract,create:ku.contract,update:xu.contract,disconnect:Pu.contract,setReadOnly:Ru.contract,beginOAuthInstall:Tu.contract,getOAuthInstallAttempt:Bu.contract}});var Cs,X9e,e6e,t6e,n6e,o6e,r6e,i6e,RN,CFt;var cS=h(()=>{Oe();Ve();Cs=a.enum(["admin","member"]),X9e=a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional(),role:Cs}),e6e=a.object({id:a.string().min(1),name:a.string().nullable(),email:a.string().email()}),t6e=a.object({credentialType:a.literal("user"),user:e6e,authorizedOrganizationId:a.string().min(1).nullable(),authorizedProjectId:a.string().min(1).nullable(),organizations:a.array(X9e).describe("Organizations the user belongs to, including membership role.")}),n6e=a.object({credentialType:a.literal("secret"),organization:a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional()}),keyName:a.string()}),o6e=a.object({credentialType:a.literal("partner"),superorganization:a.object({id:a.string().uuid(),name:a.string()})}),r6e=a.object({}),i6e=a.discriminatedUnion("credentialType",[t6e,n6e,o6e]),RN=w({operationId:"me.get",summary:"Get the current credential",description:"Return the identity and available context for the current credential.",backend:"api",route:{method:"GET",path:"/me",tags:["Auth"]},input:r6e,output:i6e,pagination:"none",async:"sync"}),CFt=RN.contract});var Kpe,Ype,Wpe,s6e,a6e,c6e,l6e,u6e,d6e,TN,BN,ON,p6e,g6e,m6e,h6e,A6e,f6e,_N,DN,LN,xFt;var Jpe=h(()=>{Oe();Ve();cS();Kpe=a.object({membershipId:a.string().min(1).describe("Organization membership record ID."),userId:a.string().min(1).describe("User ID for the organization member."),name:a.string().nullable().describe("Display name for the member, when available."),email:a.string().email().describe("Email address for the member."),imageUrl:a.string().nullable().describe("Profile image URL for the member, when available."),role:Cs.describe("Organization role."),createdAt:a.string().datetime().describe("When the membership was created.")}),Ype=a.object({id:a.string().min(1).describe("Invitation ID."),email:a.string().email().describe("Invited email address."),role:Cs.describe("Role the invitee will receive when they accept."),status:a.string().min(1).describe('Invitation status (e.g. "pending").'),createdAt:a.string().datetime().describe("When the invitation was created."),expiresAt:a.string().datetime().describe("When the invitation expires.")}),Wpe=a.string().min(1).describe("A user ID, or a URL-encoded email address, of the member."),s6e=a.object({organizationId:a.string().min(1).optional().describe("Organization to list members for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),a6e=a.object({members:a.array(Kpe).describe("Members visible within the selected organization.")}),c6e=a.object({organizationId:a.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),member:Wpe.describe("User ID, or URL-encoded email address, of the member to update."),role:Cs.describe("Role to assign.")}),l6e=a.object({member:Kpe.describe("Updated organization member.")}),u6e=a.object({params:a.object({member:Wpe.describe("User ID, or URL-encoded email address, of the member to remove.")}),query:a.object({organizationId:a.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")})}).transform(({params:e,query:t})=>({...t,...e})),d6e=a.object({removedUserId:a.string().min(1).describe("User ID removed from the organization.")}),TN=w({operationId:"members.list",summary:"List members",description:"List members in an organization.",backend:"api",route:{method:"GET",path:"/members",tags:["Members"]},input:s6e,output:a6e,pagination:"none",async:"sync",examples:[{name:"organization-members",input:{organizationId:"organization-123"},output:{members:[{membershipId:"membership-123",userId:"user-123",name:"Alex Admin",email:"alex@example.com",imageUrl:null,role:"admin",createdAt:"2026-01-01T00:00:00.000Z"}]}}]}),BN=w({operationId:"members.updateRole",summary:"Update a member's role",description:"Update a member's organization role.",backend:"api",route:{method:"PATCH",path:"/members/{member}/role",tags:["Members"]},input:c6e,output:l6e,pagination:"none",async:"sync",examples:[{name:"promote-member",input:{organizationId:"organization-123",member:"user-456",role:"admin"},output:{member:{membershipId:"membership-456",userId:"user-456",name:"Mina Member",email:"mina@example.com",imageUrl:null,role:"admin",createdAt:"2026-01-01T00:00:00.000Z"}}}]}),ON=w({operationId:"members.remove",summary:"Remove a member",description:"Remove a member from an organization.",backend:"api",route:{method:"DELETE",path:"/members/{member}",tags:["Members"],inputStructure:"detailed"},input:u6e,output:d6e,pagination:"none",async:"sync"}),p6e=a.object({organizationId:a.string().min(1).optional().describe("Organization to invite into. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),email:a.string().email().describe("Email address to invite."),role:Cs.optional().default("member").describe('Role to grant on acceptance. Defaults to "member".')}),g6e=a.object({invitation:Ype.describe("The created pending invitation.")}),m6e=a.object({organizationId:a.string().min(1).optional().describe("Organization to list invitations for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),h6e=a.object({invitations:a.array(Ype).describe("Pending invitations visible within the selected organization.")}),A6e=a.object({params:a.object({invitationId:a.string().min(1).describe("ID of the invitation to revoke.")}),query:a.object({organizationId:a.string().min(1).optional().describe("Organization containing the invitation. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")})}).transform(({params:e,query:t})=>({...t,...e})),f6e=a.object({revokedInvitationId:a.string().min(1).describe("ID of the revoked invitation.")}),_N=w({operationId:"members.invite",summary:"Invite a member",description:"Invite a person to the organization by email.",backend:"api",route:{method:"POST",path:"/members/invitations",tags:["Members"],successStatus:201},input:p6e,output:g6e,pagination:"none",async:"sync",examples:[{name:"invite-member",input:{organizationId:"organization-123",email:"newhire@example.com",role:"member"},output:{invitation:{id:"invitation-123",email:"newhire@example.com",role:"member",status:"pending",createdAt:"2026-01-01T00:00:00.000Z",expiresAt:"2026-01-08T00:00:00.000Z"}}}]}),DN=w({operationId:"members.listInvitations",summary:"List invitations",description:"List pending invitations for an organization.",backend:"api",route:{method:"GET",path:"/members/invitations",tags:["Members"]},input:m6e,output:h6e,pagination:"none",async:"sync",examples:[{name:"organization-invitations",input:{organizationId:"organization-123"},output:{invitations:[{id:"invitation-123",email:"newhire@example.com",role:"member",status:"pending",createdAt:"2026-01-01T00:00:00.000Z",expiresAt:"2026-01-08T00:00:00.000Z"}]}}]}),LN=w({operationId:"members.revokeInvitation",summary:"Revoke an invitation",description:"Revoke a pending invitation.",backend:"api",route:{method:"DELETE",path:"/members/invitations/{invitationId}",tags:["Members"],inputStructure:"detailed"},input:A6e,output:f6e,pagination:"none",async:"sync"}),xFt={list:TN.contract,updateRole:BN.contract,remove:ON.contract,invite:_N.contract,listInvitations:DN.contract,revokeInvitation:LN.contract}});var Xpe,ege,lS,tge,uS,Zpe=4194304,QN,NN,y6e=(e)=>{let t=e.split(",").map((r)=>r.trim()).filter(Boolean),n=a.array(lS).safeParse(t);if(!n.success)throw Error("Kind filter must be a comma-separated list of note, runbook, or change.");return n.data},gm,MN,zN,nge,oge,rge,ige,sge,age,cge,lge,uge,dge,pge,gge,Ou,_u,Du,Lu,Qu,b6e;var jN=h(()=>{Oe();Ve();Xpe=["note","runbook"],ege=["note","runbook","change"],lS=a.enum(ege),tge=a.enum(Xpe),uS=a.string().min(1).max(512).refine((e)=>!e.startsWith("/"),{message:"Path must be relative without a leading slash."}).describe("Relative memory path, for example AGENTS.md or notes/architecture.md."),QN=a.string().min(1).refine((e)=>new TextEncoder().encode(e).length<=Zpe,{message:`Memory body must be at most ${Zpe} bytes (4 MiB).`}).describe("Document body stored in project memory."),NN=a.string().regex(/^(\d+)(s|m|h|d)$/u,"Duration must use s, m, h, or d units, for example 7d or 30m.").describe("Relative time window, for example 7d or 30m."),gm=a.string().min(1).transform(y6e).describe("Comma-separated kinds, for example note,runbook."),MN=a.object({id:a.string().uuid(),projectId:a.string().uuid(),kind:lS,managed:a.boolean(),path:a.string().nullable(),title:a.string().nullable(),contentHash:a.string(),attrs:a.record(a.string(),a.unknown()),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),zN=MN.extend({body:QN}),nge=a.object({projectId:a.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),path:uS.describe("Relative path for the curated document."),body:QN,kind:tge.default("note").describe("Curated document kind. Only note and runbook may be written through the API."),title:a.string().max(500).optional().describe("Optional display title. Defaults to the path basename.")}),oge=a.object({document:zN}),rge=a.object({projectId:a.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),id:a.string().uuid().optional().describe("Document id."),path:uS.optional().describe("Relative curated path.")}).superRefine((e,t)=>{let n=e.id!==void 0,r=e.path!==void 0;if(n===r)t.addIssue({code:"custom",message:"Provide exactly one of id or path."})}),ige=a.object({document:zN}),sge=a.object({projectId:a.string().uuid().optional().describe("Project to list memory for. Auto-filled from CLI and SDK context when omitted."),kind:gm.optional(),since:NN.optional().describe("Only return documents updated within this window, for example 7d."),service:a.string().min(1).optional().describe("Filter to documents whose attrs.services contains this value."),pathPrefix:a.string().min(1).optional().describe("Filter to paths starting with this prefix."),managed:a.coerce.boolean().optional(),cursor:a.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of documents to return per page.")}),age=a.object({documents:a.array(MN),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),cge=a.object({documentId:a.string().uuid(),kind:lS,managed:a.boolean(),path:a.string().nullable(),title:a.string().nullable(),snippet:a.string(),score:a.number()}),lge=a.object({calibrated:a.literal(!0),minScoreThreshold:a.number(),queryTerms:a.array(a.string()),message:a.string()}),uge=a.object({projectId:a.string().uuid().optional().describe("Project to search memory for. Auto-filled from CLI and SDK context when omitted."),query:a.string().trim().min(1).max(500).describe("Natural-language search query."),kind:gm.optional(),since:NN.optional(),service:a.string().min(1).optional(),pathPrefix:a.string().min(1).optional(),managed:a.coerce.boolean().optional(),limit:a.coerce.number().int().min(1).max(50).default(10).describe("Maximum ranked search hits to return.")}),dge=a.object({hits:a.array(cge),emptyVerdict:lge.nullable()}),pge=a.object({projectId:a.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),id:a.string().uuid().optional().describe("Document id."),path:uS.optional()}).superRefine((e,t)=>{let n=e.id!==void 0,r=e.path!==void 0;if(n===r)t.addIssue({code:"custom",message:"Provide exactly one of id or path."})}),gge=a.void(),Ou=w({operationId:"memory.put",summary:"Create or replace a memory document",description:"Create or replace a curated project memory document. Embeds on success.",backend:"api",route:{method:"PUT",path:"/memory",tags:["Memory"]},input:nge,output:oge,pagination:"none",async:"sync"}),_u=w({operationId:"memory.get",summary:"Get a memory document",description:"Get one project memory document by id or path.",backend:"api",route:{method:"GET",path:"/memory/document",tags:["Memory"]},input:rge,output:ige,pagination:"none",async:"sync"}),Du=w({operationId:"memory.list",summary:"List memory documents",description:"List project memory catalog rows without embedding search.",backend:"api",route:{method:"GET",path:"/memory",tags:["Memory"]},input:sge,output:age,pagination:"cursor",async:"sync"}),Lu=w({operationId:"memory.search",summary:"Search project memory",description:"Hybrid semantic and keyword search over project memory documents.",backend:"api",route:{method:"POST",path:"/memory/search",tags:["Memory"]},input:uge,output:dge,pagination:"none",async:"sync"}),Qu=w({operationId:"memory.delete",summary:"Delete a memory document",description:"Soft-delete a curated project memory document by id or path.",backend:"api",route:{method:"DELETE",path:"/memory/document",successStatus:204,tags:["Memory"]},input:pge,output:gge,pagination:"none",async:"sync"}),b6e={put:Ou.contract,get:_u.contract,list:Du.contract,search:Lu.contract,delete:Qu.contract}});var mge,hge,I6e,S6e,C6e,v6e,w6e,mm,E6e,k6e,x6e,UN,FN,$N,GN,DFt;var dS=h(()=>{Oe();Ve();mge=a.enum(["processing","completed","aborted","error"]),hge=a.object({id:a.string().uuid(),threadId:a.string().uuid(),userMessageId:a.string().uuid().nullable(),assistantMessageId:a.string().uuid().nullable(),workflowRunId:a.string().nullable(),status:mge,source:a.enum(["app","api","mcp","slack","teams","linear","github","agent","cli","web","sdk","bitbucket","system"]),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),completedAt:a.string().datetime().nullable()}),I6e=a.object({projectId:a.string().uuid().optional().describe("Project ID to list runs for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:a.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),S6e=a.object({runs:a.array(hge),nextCursor:a.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),C6e=a.object({threadId:a.string().uuid().describe("Thread ID to list runs for."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of runs to return per page."),cursor:a.string().datetime().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),v6e=a.object({runs:a.array(hge),nextCursor:a.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),w6e=a.object({runId:a.string().uuid().describe("Run ID returned by a deferred operation.")}),mm=a.object({completed:a.boolean().describe("Whether the run has reached a terminal status."),threadId:a.string().uuid().describe("Thread ID associated with the run."),runId:a.string().uuid().describe("Run ID for subsequent polling."),messageId:a.string().uuid().optional().describe("ID of the user message that triggered this run."),status:mge.describe("Current run lifecycle status."),response:a.string().nullable().describe("Assistant response text when the run has completed.")}),E6e=mm.describe("Current run state and, when complete, the assistant response."),k6e=a.object({runId:a.string().uuid().describe("Run ID of the in-flight run to request cancellation for.")}),x6e=a.object({success:a.literal(!0).describe("Always true when the cancellation request was accepted.")}),UN=w({operationId:"runs.list",summary:"List runs",description:"List deferred runs within one project.",backend:"api",route:{method:"GET",path:"/runs",tags:["Runs"]},input:I6e,output:S6e,pagination:"cursor",async:"sync"}),FN=w({operationId:"runs.listForThread",summary:"List runs for a thread",description:"List deferred runs for one thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/runs",tags:["Runs"]},input:C6e,output:v6e,pagination:"cursor",async:"sync"}),$N=w({operationId:"runs.get",summary:"Get a run",description:"Get the current result for a deferred run by run ID.",backend:"api",route:{method:"GET",path:"/runs/{runId}",tags:["Runs"]},input:w6e,output:E6e,pagination:"none",async:"sync",examples:[{name:"processing-run",input:{runId:"33333333-3333-4333-8333-333333333333"},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]}),GN=w({operationId:"runs.cancel",summary:"Cancel a run",description:"Request cancellation of an in-flight run. Idempotent and best-effort: returns success even when the run has already reached a terminal status.",backend:"api",route:{method:"POST",path:"/runs/{runId}/cancel",tags:["Runs"]},input:k6e,output:x6e,pagination:"none",async:"sync",examples:[{name:"cancel-processing-run",input:{runId:"33333333-3333-4333-8333-333333333333"},output:{success:!0}}]}),DFt={list:UN.contract,listForThread:FN.contract,get:$N.contract,cancel:GN.contract}});var pS=(e,t,n)=>{let r=t?20000:1e4;if(e.length>r)n.addIssue({code:"too_big",maximum:r,type:"string",inclusive:!0,message:`Message cannot exceed ${r} characters`,origin:"string",path:["message"]})},gS=(e,t,n)=>{if(e&&!t)n.addIssue({code:"custom",message:"ambientServiceRun requires an automationId",path:["ambientServiceRun"]})};var Age,hm,P6e,R6e,T6e,B6e,O6e,_6e,D6e,L6e,Q6e,qN,N6e,M6e,z6e,j6e,U6e,F6e,$6e,G6e,q6e,H6e,V6e,K6e,HN,VN,KN,YN,WN,JN,fge,Y6e,W6e,J6e,Z6e,yge,X6e,e5e,t5e,n5e,o5e,r5e,$a="22222222-2222-4222-8222-222222222222",bge="11111111-1111-4111-8111-111111111111",i5e="44444444-4444-4444-8444-444444444444",Ige="55555555-5555-4555-8555-555555555555",ZN,XN,e0,t0,n0,UFt;var o0=h(()=>{Oe();Ve();dS();Age=a.enum(["slack","teams","linear","github","app","mcp","agent","api","cli","web","sdk","bitbucket","system"]),hm=a.object({id:a.string().uuid(),projectId:a.string().uuid(),title:a.string().nullable(),status:a.enum(["regular","archived"]),source:Age.nullable(),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),P6e=a.object({type:a.literal("message"),message:a.string()}),R6e=a.object({type:a.literal("reasoning"),reasoning:a.string(),status:a.enum(["in_progress","complete"]).optional()}),T6e=a.object({type:a.literal("tool_call"),name:a.string(),params:a.any().optional(),result:a.any().optional(),status:a.enum(["in_progress","success","error","unknown"]).optional(),toolCallId:a.string().optional(),durationMs:a.number().nonnegative().optional()}),B6e=a.object({type:a.literal("artifact"),name:a.enum(["timeseries","table","log_detail","integration_required","alert_card","issue_card","mdx"]),data:a.any(),toolCallId:a.string().optional()}),O6e=a.object({type:a.literal("fork"),sourceThreadId:a.string(),sourceMessageId:a.string(),sourceThreadTitle:a.string().nullable()}),_6e=a.object({type:a.literal("summary"),summary:a.string()}),D6e=a.object({type:a.literal("slack_context"),channelId:a.string(),isTruncated:a.boolean().optional(),messages:a.array(a.object({timestamp:a.string(),slackUserId:a.string().optional(),displayName:a.string(),text:a.string(),isBot:a.boolean(),files:a.array(a.object({name:a.string(),mimetype:a.string(),size:a.number().optional(),attachmentId:a.string().uuid().optional(),ingestionStatus:a.enum(["attached","unsupported","oversized","skipped","unavailable"]).optional()})).optional()}))}),L6e=a.object({type:a.literal("teams_context"),conversationId:a.string(),isTruncated:a.boolean().optional(),messages:a.array(a.object({activityId:a.string().optional(),displayName:a.string(),text:a.string(),isBot:a.boolean(),createdDateTime:a.string().optional()}))}),Q6e=a.union([P6e,R6e,T6e,B6e,O6e,_6e,D6e,L6e]),qN=a.object({id:a.string().uuid(),role:a.enum(["user","assistant"]),content:a.array(Q6e),source:Age,createdAt:a.string().datetime()}),N6e=a.object({projectId:a.string().uuid().optional().describe("Project to list threads for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of threads to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:a.enum(["regular","archived"]).optional().describe("Filter by thread status. 'regular' returns active threads, 'archived' returns archived threads.")}),M6e=a.object({threads:a.array(hm).describe("The page of threads matching the query."),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),z6e=a.object({threadId:a.string().uuid().describe("Thread ID returned by threads.list or threads.create.")}),j6e=a.object({thread:hm.describe("The requested thread."),messages:a.array(qN).describe("Messages currently stored on the thread in chronological order.")}),U6e=a.object({projectId:a.string().uuid().optional().describe("Project to create the thread in. Auto-filled from CLI and SDK context when omitted."),message:a.string().min(1,"Message cannot be empty").describe("Initial user message that starts the thread."),wait:a.boolean().default(!0).describe("Whether the server should wait for the agent run before responding."),timeoutSeconds:a.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling."),automationId:a.string().uuid().optional().describe("Internal automation context. Set by the Sazabi CLI when an automation script starts an agent run."),ambientServiceRun:a.literal(!0).optional().describe("Internal marker for scheduler-originated ambient service work. Honored only for system secret-key requests with matching automation context.")}).superRefine((e,t)=>{pS(e.message,e.automationId,t),gS(e.ambientServiceRun,e.automationId,t)}),F6e=mm.describe("Deferred run result for creating a thread."),$6e=a.object({threadId:a.string().uuid().describe("Thread ID whose current processing status should be returned.")}),G6e=a.object({status:a.enum(["idle","processing"]),lastRunStatus:a.enum(["error"]).nullable()}),q6e=a.object({threadId:a.string().uuid().describe("Thread ID whose active run should be stopped.")}),H6e=a.object({success:a.literal(!0).describe("Always true when the stop request was accepted.")}),V6e=a.object({threadId:a.string().uuid().describe("Thread ID of the thread to update."),status:a.enum(["regular","archived"]).describe("New status for the thread. 'archived' hides the thread from the sidebar.")}),K6e=a.object({thread:hm.describe("The updated thread.")}),HN=w({operationId:"threads.list",summary:"List threads",description:"List threads in a project, optionally filtered by status.",backend:"api",route:{method:"GET",path:"/threads",tags:["Threads"]},input:N6e,output:M6e,pagination:"cursor",async:"sync",examples:[{name:"active-threads",input:{projectId:"11111111-1111-4111-8111-111111111111",status:"regular",limit:10},output:{threads:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"API returning 500s",status:"regular",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:05:00.000Z"}],nextCursor:null}}]}),VN=w({operationId:"threads.get",summary:"Get a thread",description:"Get a thread and its messages.",backend:"api",route:{method:"GET",path:"/threads/{threadId}",tags:["Threads"]},input:z6e,output:j6e,pagination:"none",async:"sync"}),KN=w({operationId:"threads.getStatus",summary:"Get a thread's status",description:"Get the current processing status for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/status",tags:["Threads"]},input:$6e,output:G6e,pagination:"none",async:"sync",examples:[{name:"processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{status:"processing",lastRunStatus:null}}]}),YN=w({operationId:"threads.stop",summary:"Stop a thread's run",description:"Stop a thread's in-flight run. Idempotent and best-effort: returns success even when the thread has no active run.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/stop",tags:["Threads"]},input:q6e,output:H6e,pagination:"none",async:"sync",examples:[{name:"stop-processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{success:!0}}]}),WN=w({operationId:"threads.create",summary:"Create a thread",description:"Create a thread with an initial message and optionally wait for the agent response.",backend:"api",route:{method:"POST",path:"/threads",tags:["Threads"],successStatus:201},input:U6e,output:F6e,pagination:"none",async:"deferred",examples:[{name:"async-handoff",input:{projectId:"11111111-1111-4111-8111-111111111111",message:"Investigate elevated 500s in production.",wait:!1,timeoutSeconds:20},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]}),JN=w({operationId:"threads.update",summary:"Update a thread",description:"Update a thread's status.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}",tags:["Threads"]},input:V6e,output:K6e,pagination:"none",async:"sync",examples:[{name:"archive-thread",input:{threadId:"22222222-2222-4222-8222-222222222222",status:"archived"},output:{thread:{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"API returning 500s",status:"archived",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:10:00.000Z"}}}]}),fge=a.enum(["private","organization"]),Y6e=a.object({threadId:a.string().uuid().describe("Thread ID of the source thread to fork."),messageId:a.string().uuid().describe("Message ID in the source thread to fork from. The new thread copies messages up to and including this message.")}),W6e=a.object({thread:hm.describe("The newly created forked thread.")}),J6e=a.object({threadId:a.string().uuid().describe("Thread ID of the thread to update."),visibility:fge.describe("New visibility. 'private' restricts the thread to its owner; 'organization' shares it with the organization.")}),Z6e=a.object({thread:hm.describe("The updated thread."),visibility:fge.describe("The thread's resulting visibility.")}),yge=a.object({shareId:a.string().uuid().describe("Unique identifier for the snapshot."),threadId:a.string().uuid().describe("Thread the snapshot was taken from."),url:a.string().describe("Public read-only URL for the snapshot."),createdAt:a.string().datetime()}),X6e=a.object({threadId:a.string().uuid().describe("Thread ID to create a public read-only snapshot for.")}),e5e=a.object({share:yge.describe("The created share link.")}),t5e=a.object({threadId:a.string().uuid().describe("Thread ID the snapshot belongs to."),shareId:a.string().uuid().describe("Snapshot ID to revoke.")}),n5e=a.void(),o5e=a.object({threadId:a.string().uuid().describe("Thread ID to list public snapshots for.")}),r5e=a.object({shares:a.array(yge).describe("Active share links for the thread.")}),ZN=w({operationId:"threads.fork",summary:"Fork a thread",description:"Fork a thread from a specific message, creating a new thread that copies messages up to that point.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/fork",tags:["Threads"],successStatus:201},input:Y6e,output:W6e,pagination:"none",async:"sync",examples:[{name:"fork-from-message",input:{threadId:$a,messageId:i5e},output:{thread:{id:"66666666-6666-4666-8666-666666666666",projectId:bge,title:"API returning 500s (fork)",status:"regular",source:"api",createdAt:"2026-01-01T00:20:00.000Z",updatedAt:"2026-01-01T00:20:00.000Z"}}}]}),XN=w({operationId:"threads.setVisibility",summary:"Set a thread's visibility",description:"Set a thread's visibility to private or organization.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}/visibility",tags:["Threads"]},input:J6e,output:Z6e,pagination:"none",async:"sync",examples:[{name:"make-private",input:{threadId:$a,visibility:"private"},output:{thread:{id:$a,projectId:bge,title:"API returning 500s",status:"regular",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:30:00.000Z"},visibility:"private"}}]}),e0=w({operationId:"threads.createShareLink",summary:"Create a thread share link",description:"Create a public read-only share link for a thread's current messages.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/share",tags:["Threads"],successStatus:201},input:X6e,output:e5e,pagination:"none",async:"sync",examples:[{name:"create-share-link",input:{threadId:$a},output:{share:{shareId:Ige,threadId:$a,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}}}]}),t0=w({operationId:"threads.listShareLinks",summary:"List thread share links",description:"List active public share links for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/share",tags:["Threads"]},input:o5e,output:r5e,pagination:"none",async:"sync",examples:[{name:"list-share-links",input:{threadId:$a},output:{shares:[{shareId:Ige,threadId:$a,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}]}}]}),n0=w({operationId:"threads.revokeShareLink",summary:"Revoke a thread share link",description:"Revoke a public share link for a thread.",backend:"api",route:{method:"DELETE",path:"/threads/{threadId}/share/{shareId}",successStatus:204,tags:["Threads"]},input:t5e,output:n5e,pagination:"none",async:"sync"}),UFt={list:HN.contract,get:VN.contract,getStatus:KN.contract,stop:YN.contract,create:WN.contract,update:JN.contract,fork:ZN.contract,setVisibility:XN.contract,createShareLink:e0.contract,listShareLinks:t0.contract,revokeShareLink:n0.contract}});var s5e,a5e,c5e,l5e,Sge,Cge;var vge=h(()=>{Oe();Ve();dS();o0();s5e=a.object({threadId:a.string().uuid().describe("Thread ID to list messages for."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of messages to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),a5e=a.object({messages:a.array(qN),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),c5e=a.object({threadId:a.string().uuid().describe("Thread ID to append the message to."),message:a.string().min(1,"Message cannot be empty").describe("Message body to append to the thread."),wait:a.boolean().default(!0).describe("Whether the server should wait for the appended message run before responding."),timeoutSeconds:a.coerce.number().int().min(1).max(20).default(20).describe("Maximum seconds to wait when wait is true before handing off to polling."),automationId:a.string().uuid().optional().describe("Internal automation context. Set by the Sazabi CLI when an automation script starts an agent run."),ambientServiceRun:a.literal(!0).optional().describe("Internal marker for scheduler-originated ambient service work. Honored only for system secret-key requests with matching automation context.")}).superRefine((e,t)=>{pS(e.message,e.automationId,t),gS(e.ambientServiceRun,e.automationId,t)}),l5e=mm.describe("Deferred run result for appending a message to an existing thread."),Sge=w({operationId:"messages.list",summary:"List messages in a thread",description:"List messages in a thread with cursor pagination.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/messages",tags:["Messages"]},input:s5e,output:a5e,pagination:"cursor",async:"sync",examples:[{name:"thread-messages",input:{threadId:"22222222-2222-4222-8222-222222222222",limit:2},output:{messages:[{id:"33333333-3333-4333-8333-333333333333",role:"user",content:[{type:"message",message:"What changed in the intake pipeline?"}],source:"api",createdAt:"2026-01-01T00:00:00.000Z"}],nextCursor:null}}]}),Cge=w({operationId:"messages.append",summary:"Append a message to a thread",description:"Append a user message to an existing thread and trigger a deferred run.",backend:"api",route:{method:"POST",path:"/threads/{threadId}/messages",successStatus:201,tags:["Messages"]},input:c5e,output:l5e,pagination:"none",async:"deferred",examples:[{name:"append-processing",input:{threadId:"22222222-2222-4222-8222-222222222222",message:"Follow up on the intake backlog.",wait:!1,timeoutSeconds:20},output:{completed:!1,threadId:"22222222-2222-4222-8222-222222222222",runId:"33333333-3333-4333-8333-333333333333",status:"processing",response:null}}]})});var ho,Ege,r0,Nu,i0,mS,vs,kge,wge;var Am=h(()=>{Oe();ho={IN_APP:"in_app",SLACK:"slack",SLACK_CHANNEL:"slack_channel",MICROSOFT_TEAMS_CHANNEL:"teams_channel",EMAIL:"email",SMS:"sms",INCIDENT_IO:"incident_io",PAGERDUTY:"pagerduty",ROOTLY:"rootly",WEBHOOK:"webhook"},Ege=[ho.IN_APP,ho.SLACK,ho.EMAIL,ho.SMS],r0=[ho.SLACK_CHANNEL,ho.MICROSOFT_TEAMS_CHANNEL,ho.INCIDENT_IO,ho.PAGERDUTY,ho.ROOTLY,ho.WEBHOOK],Nu=Object.values(ho),i0=[...Nu,"victorops"],mS=a.enum(Nu),vs=a.enum(r0),kge=[{channel:"in_app",name:"In-app",description:"Show notifications in your Sazabi notification feed.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/notifications"},{channel:"email",name:"Email",description:"Send notifications to your account email address.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/notifications"},{channel:"sms",name:"SMS",description:"Send notifications to your verified phone number.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/account?phone-number=add"},{channel:"slack",name:"Slack DMs",description:"Send personal notifications by Slack DM.",scope:"personal",destinationManagement:"none",personalSettingsPath:"/settings/connected-accounts/slack"},{channel:"slack_channel",name:"Slack",description:"Post this project's alerts to selected Slack channels.",scope:"project",destinationManagement:"slack_channels",projectIntegrationPath:"slack"},{channel:"teams_channel",name:"Microsoft Teams",description:"Post this project's alerts to selected Microsoft Teams channels.",scope:"project",destinationManagement:"teams_channels",projectIntegrationPath:"teams"},{channel:"incident_io",name:"incident.io",description:"Route this project's alerts to incident.io.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"incident-io"},{channel:"pagerduty",name:"PagerDuty",description:"Route this project's alerts to PagerDuty.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"pagerduty"},{channel:"rootly",name:"Rootly",description:"Route this project's alerts to Rootly.",scope:"project",destinationManagement:"integration_connections",projectIntegrationPath:"rootly"},{channel:"webhook",name:"Webhooks",description:"Send this project's alerts to configured HTTPS endpoints.",scope:"project",destinationManagement:"webhook_endpoints",projectSettingsPath:"webhooks"}],wge=new Set(kge.map(({channel:e})=>e));if(wge.size!==Nu.length||Nu.some((e)=>!wge.has(e)))throw Error("Notification channel definitions must represent every channel")});var xge,u5e=(e,t)=>e.value===t.value&&e.label===t.label&&e.scope===t.scope&&e.role===t.role&&e.defaultOff===t.defaultOff&&(e.defaultOffChannels??[]).join(",")===(t.defaultOffChannels??[]).join(",")&&e.email?.template===t.email?.template&&e.email?.ctaLabel===t.email?.ctaLabel&&(e.deliveryConditions??[]).join(",")===(t.deliveryConditions??[]).join(","),Nn=(e)=>{for(let t of Object.values(e)){let n=xge.get(t.value);if(n&&!u5e(n,t))throw Error(`Notification type registered twice with conflicting definitions: ${t.value}`);if(t.role!==void 0&&t.scope!=="org")throw Error(`Notification type role restrictions require org scope: ${t.value}`);if(t.label.trim().length===0)throw Error(`Notification type needs a display label: ${t.value}`);if(t.email&&t.email.ctaLabel.trim().length===0)throw Error(`Notification email presentation needs a CTA label: ${t.value}`);if(t.defaultOff&&t.defaultOffChannels)throw Error(`Notification type declares both defaultOff and defaultOffChannels: ${t.value}`);xge.set(t.value,t)}return e};var pi=h(()=>{xge=new Map});var Pge;var Rge=h(()=>{pi();Pge=Nn({AUTOMATION_FINISHED:{value:"automation_finished",label:"Automation completed",scope:"project",defaultOff:!0},AUTOMATION_RUN_FAILED:{value:"automation_run_failed",label:"Automation run failed",scope:"project"}})});var hS;var s0=h(()=>{pi();hS=Nn({BILLING_PLAN_UPGRADE_APPLIED:{value:"billing_plan_upgrade_applied",label:"Billing upgrade applied",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_PLAN_DOWNGRADE_SCHEDULED:{value:"billing_plan_downgrade_scheduled",label:"Billing downgrade scheduled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_PLAN_DOWNGRADE_APPLIED:{value:"billing_plan_downgrade_applied",label:"Billing downgrade applied",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage billing"}},BILLING_CREDIT_BALANCE_LOW:{value:"billing_credit_balance_low",label:"Billing credits low",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage credits"}},BILLING_CREDIT_BALANCE_DEPLETED:{value:"billing_credit_balance_depleted",label:"Billing credits depleted",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage credits"}},BILLING_AUTO_TOP_UP_SETTINGS_CHANGED:{value:"billing_auto_top_up_settings_changed",label:"Billing auto top-up changed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage auto top-up"}},BILLING_AUTO_TOP_UP_FAILED:{value:"billing_auto_top_up_failed",label:"Billing auto top-up failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage payment method"}},BILLING_INVOICE_PAID:{value:"billing_invoice_paid",label:"Billing invoice paid",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View invoice"}},BILLING_INVOICE_PAYMENT_FAILED:{value:"billing_invoice_payment_failed",label:"Billing invoice payment failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Update payment method"}},BILLING_SUBSCRIPTION_CANCELLATION_SCHEDULED:{value:"billing_subscription_cancellation_scheduled",label:"Billing cancellation scheduled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage subscription"}},BILLING_SUBSCRIPTION_CANCELED:{value:"billing_subscription_canceled",label:"Billing subscription canceled",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View billing"}},BILLING_PAYMENT_METHOD_EXPIRING:{value:"billing_payment_method_expiring",label:"Billing payment method expiring",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Update payment method"}},BILLING_PAYMENT_METHOD_CHANGED:{value:"billing_payment_method_changed",label:"Billing payment method changed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Review payment method"}},BILLING_NEGATIVE_BALANCE_COLLECTED:{value:"billing_negative_balance_collected",label:"Billing outstanding balance charged",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"View billing"}},BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED:{value:"billing_negative_balance_collection_failed",label:"Billing outstanding balance charge failed",scope:"org",role:"admin",email:{template:"billing",ctaLabel:"Manage payment method"}}})});var Tge;var Bge=h(()=>{pi();Tge=Nn({INTEGRATION_CONNECTED:{value:"integration_connected",label:"Integration connected",scope:"org",defaultOff:!0},INTEGRATION_DISCONNECTED:{value:"integration_disconnected",label:"Integration disconnected",scope:"org"}})});var Oge;var _ge=h(()=>{pi();Oge=Nn({ISSUE_TRIGGERED:{value:"issue_triggered",label:"Issue triggered",scope:"project",deliveryConditions:["component","severity"]},ISSUE_RESOLVED:{value:"issue_resolved",label:"Issue resolved",scope:"project",defaultOffChannels:["email"],deliveryConditions:["component","severity"]},ISSUE_IGNORED:{value:"issue_ignored",label:"Issue ignored",scope:"project",defaultOffChannels:["email"],deliveryConditions:["component","severity"]}})});var Dge;var Lge=h(()=>{pi();Dge=Nn({PROJECT_CREATED:{value:"project_created",label:"Project created",scope:"org",defaultOff:!0},PROJECT_DELETED:{value:"project_deleted",label:"Project deleted",scope:"org",defaultOff:!0},MEMBER_INVITED:{value:"member_invited",label:"Member invited",scope:"org",defaultOff:!0},USER_REMOVED:{value:"user_removed",label:"Member removed",scope:"org",defaultOff:!0},MCP_CONNECTOR_ADDED:{value:"mcp_connector_added",label:"MCP connector added",scope:"org",defaultOff:!0},MCP_CONNECTOR_REMOVED:{value:"mcp_connector_removed",label:"MCP connector removed",scope:"org",defaultOff:!0},SECRET_KEY_CREATED:{value:"secret_key_created",label:"Secret key created",scope:"org",defaultOff:!0},SECRET_KEY_DELETED:{value:"secret_key_deleted",label:"Secret key deleted",scope:"org",defaultOff:!0}})});var Qge;var Nge=h(()=>{pi();Qge=Nn({SANDBOX_CREATED:{value:"sandbox_created",label:"Sandbox connected",scope:"project",defaultOff:!0},SANDBOX_DELETED:{value:"sandbox_deleted",label:"Sandbox disconnected",scope:"project",defaultOff:!0},LOG_SOURCE_CONNECTED:{value:"log_source_connected",label:"Log source connected",scope:"project",defaultOff:!0},LOG_SOURCE_DISCONNECTED:{value:"log_source_disconnected",label:"Log source disconnected",scope:"project"},GITHUB_CONNECTED:{value:"github_connected",label:"GitHub connected",scope:"project",defaultOff:!0},GITHUB_DISCONNECTED:{value:"github_disconnected",label:"GitHub disconnected",scope:"project"},CODE_REPO_CONNECTED:{value:"code_repo_connected",label:"Code repository connected",scope:"project",defaultOff:!0},CODE_REPO_DISCONNECTED:{value:"code_repo_disconnected",label:"Code repository disconnected",scope:"project"},PUBLIC_KEY_DEACTIVATED:{value:"public_key_deactivated",label:"Public key deactivated",scope:"project"}})});var Mge;var zge=h(()=>{pi();Mge=Nn({SECURITY_ALERT:{value:"security_alert",label:"Security alert",scope:"org",role:"admin"}})});var a0,Pt,p5e,c0=(e)=>{let t=p5e.get(e)?.label;if(t)return t;let n=e.replace(/_/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):e};var fm=h(()=>{Rge();s0();s0();Bge();_ge();Lge();Nge();zge();pi();a0={...Mge,...Dge,...Tge,...Pge,...Oge,...Qge,...hS},Pt=Object.fromEntries(Object.entries(a0).map(([e,t])=>[e,t.value])),p5e=new Map(Object.values(a0).map((e)=>[e.value,e]))});var AS,Uge,v$t,Nr,w$t;var Ga=h(()=>{fm();Am();Am();AS=Object.values(Pt),Uge=[Pt.BILLING_PLAN_UPGRADE_APPLIED,Pt.BILLING_PLAN_DOWNGRADE_SCHEDULED,Pt.BILLING_PLAN_DOWNGRADE_APPLIED,Pt.BILLING_CREDIT_BALANCE_LOW,Pt.BILLING_CREDIT_BALANCE_DEPLETED,Pt.BILLING_AUTO_TOP_UP_SETTINGS_CHANGED,Pt.BILLING_AUTO_TOP_UP_FAILED,Pt.BILLING_INVOICE_PAID,Pt.BILLING_NEGATIVE_BALANCE_COLLECTED,Pt.BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED,Pt.BILLING_INVOICE_PAYMENT_FAILED,Pt.BILLING_SUBSCRIPTION_CANCELLATION_SCHEDULED,Pt.BILLING_SUBSCRIPTION_CANCELED,Pt.BILLING_PAYMENT_METHOD_EXPIRING,Pt.BILLING_PAYMENT_METHOD_CHANGED],v$t=new Set(Uge),Nr=[Pt.ISSUE_TRIGGERED,Pt.ISSUE_RESOLVED,Pt.ISSUE_IGNORED,Pt.AUTOMATION_RUN_FAILED],w$t=new Set(Nr)});var ym,Fge,$ge=(e)=>typeof e==="string"&&(e in Fge)?Fge[e]:e,m5e;var Gge=h(()=>{Am();Oe();Ga();ym=a.enum(AS),Fge={data_source_connected:"log_source_connected",data_source_disconnected:"log_source_disconnected"},m5e=a.preprocess($ge,ym)});var h5e;var qge=h(()=>{fm();Ga();h5e=Nr.map((e)=>({notificationType:e,label:c0(e)}))});var Hge=h(()=>{fm();Ga()});var Vge=h(()=>{Am();fm();Ga();Gge();qge();Hge()});var Kge=()=>{};var Yge=h(()=>{Ga()});var Wge=h(()=>{Ga()});var l0=h(()=>{Kge();Yge();Wge();Vge()});var b5e,I5e,S5e,C5e,v5e,w5e,E5e,u0,j1t;var Jge=h(()=>{l0();Oe();Ve();b5e=a.enum(["ready","missing","degraded","unavailable"]),I5e=a.object({id:a.string(),label:a.string(),status:a.enum(["active","inactive","degraded"]),statusLabel:a.string()}),S5e=a.object({channel:mS,name:a.string(),description:a.string(),scope:a.enum(["personal","project"]),enabled:a.boolean().nullable(),preferenceId:a.string().nullable(),prerequisite:a.object({status:b5e,statusLabel:a.string(),message:a.string()}),action:a.object({label:a.string(),href:a.string()}).nullable(),destinations:a.array(I5e),destinationManagement:a.enum(["none","slack_channels","teams_channels","integration_connections","webhook_endpoints"]),canCreateDestinations:a.boolean(),supportedNotificationTypes:a.array(ym)}),C5e=a.object({channel:vs,enabled:a.boolean(),preferenceId:a.string().nullable()}),v5e=a.object({channel:vs,notificationType:ym,enabled:a.boolean(),preferenceId:a.string()}),w5e=a.object({projectId:a.string().uuid().optional().describe("Project to inspect. Auto-filled from CLI and SDK context when omitted.")}),E5e=a.object({channelCards:a.array(S5e).length(10),channels:a.array(C5e),notificationTypePreferences:a.array(v5e),issueNotificationMinSeverity:a.enum(["low","medium","high","critical"])}),u0=w({operationId:"notificationChannels.getProject",summary:"List project notification channels",description:"List a project's notification channels with preferences, prerequisites, connection state, configured destinations, and supported notification types.",backend:"api",route:{method:"GET",path:"/notification-channels",tags:["Notification channels"]},input:w5e,output:E5e,pagination:"none",async:"sync"}),j1t={getProject:u0.contract}});var Zge,p0,Xge,g0,q1t,H1t,m0,h0=(e,t)=>{if((e.componentIds?.length||e.componentId)&&"componentIds"in e.condition&&e.condition.componentIds?.length)t.addIssue({code:"custom",path:["condition","componentIds"],message:"Use componentIds instead of legacy condition.componentIds."});if(e.componentIds?.length&&e.componentId)t.addIssue({code:"custom",path:["componentId"],message:"Use componentIds instead of componentId."})},V1t,eme,d0,A0,bm,tme,k5e,x5e,P5e,R5e,T5e,B5e,O5e,_5e,D5e,f0,y0,b0,I0,S0,K1t;var nme=h(()=>{l0();Oe();Ve();Zge=a.enum(["low","medium","high","critical"]),p0=a.object({severities:a.array(Zge).min(1).optional()}).strict(),Xge=a.object({componentIds:a.array(a.string().uuid()).min(1).optional(),severities:a.array(Zge).min(1).optional()}).strict(),g0=a.object({channel:vs,destinationKey:a.string().min(1)}),q1t=a.object({destinations:a.array(g0).min(1),notificationTypes:a.array(a.enum(Nr)).min(1),componentIds:a.array(a.string().uuid()).min(1).optional().describe("Stable component registry IDs matched by this rule."),includeDescendants:a.boolean().default(!1).describe("Whether the rule also matches descendant components."),condition:p0}),H1t=a.object({destinations:a.array(g0).min(1),notificationTypes:a.array(a.enum(Nr)).min(1),condition:Xge}),m0=a.object({destinations:a.array(g0).min(1),notificationTypes:a.array(a.enum(Nr)).min(1),componentIds:a.array(a.string().uuid()).min(1).optional().describe("Stable component registry IDs matched by this rule."),componentId:a.string().uuid().optional().describe("Deprecated single-component compatibility input."),includeDescendants:a.boolean().default(!1).describe("Whether the rule also matches descendant components."),condition:a.union([p0,Xge])}),V1t=m0.superRefine(h0),eme=a.object({id:a.string(),channel:vs,destinationKey:a.string(),displayName:a.string()}),d0=a.object({id:a.string().uuid(),label:a.string(),lifecycle:a.enum(["active","inactive","merged"])}),A0=a.object({id:a.string().uuid(),projectId:a.string().uuid(),notificationTypes:a.array(a.enum(Nr)),destinations:a.array(eme),condition:p0,component:d0.nullable(),componentId:a.string().uuid().nullable(),includeDescendants:a.boolean(),suspendedAt:a.string().datetime().nullable(),suspensionReason:a.string().nullable(),components:a.array(d0),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),bm=a.object({projectId:a.string().uuid().optional().describe("Project whose notification delivery rules are being managed.")}),tme=a.string().uuid().describe("Logical notification delivery rule ID."),k5e=bm,x5e=a.object({rules:a.array(A0)}),P5e=a.object({destinations:a.array(eme),notificationTypes:a.array(a.object({notificationType:a.enum(Nr),label:a.string(),conditions:a.array(a.enum(["component","severity"]))})),components:a.array(d0)}),R5e=bm.extend(m0.shape).superRefine(h0),T5e=A0,B5e=bm.extend({...m0.shape,ruleId:tme}).superRefine(h0),O5e=A0,_5e=bm.extend({ruleId:tme}),D5e=a.object({removed:a.boolean()}),f0=w({operationId:"notificationDeliveryRules.list",summary:"List delivery rules",description:"List the positive delivery rules for a project.",backend:"api",route:{method:"GET",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:k5e,output:x5e,pagination:"none",async:"sync"}),y0=w({operationId:"notificationDeliveryRules.options",summary:"Get delivery rule options",description:"List available destinations, events, and conditions for project delivery rules.",backend:"api",route:{method:"GET",path:"/notification-delivery-rules/options",tags:["Notification delivery rules"]},input:bm,output:P5e,pagination:"none",async:"sync"}),b0=w({operationId:"notificationDeliveryRules.create",summary:"Create a delivery rule",description:"Create a positive project notification delivery rule.",backend:"api",route:{method:"POST",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:R5e,output:T5e,pagination:"none",async:"sync"}),I0=w({operationId:"notificationDeliveryRules.update",summary:"Update a delivery rule",description:"Replace a positive delivery rule atomically.",backend:"api",route:{method:"PUT",path:"/notification-delivery-rules/{ruleId}",tags:["Notification delivery rules"]},input:B5e,output:O5e,pagination:"none",async:"sync"}),S0=w({operationId:"notificationDeliveryRules.delete",summary:"Delete a delivery rule",description:"Delete a positive delivery rule without deleting its reusable destinations.",backend:"api",route:{method:"DELETE",path:"/notification-delivery-rules/{ruleId}",tags:["Notification delivery rules"]},input:_5e,output:D5e,pagination:"none",async:"sync"}),K1t={list:f0.contract,options:y0.contract,create:b0.contract,update:I0.contract,delete:S0.contract}});var C0,L5e,Q5e,N5e,M5e,z5e,j5e,v0,U5e,F5e,w0,$5e,G5e,E0,q5e,H5e,k0,V5e,K5e,x0,Z1t;var ome=h(()=>{Oe();Ve();C0=a.enum(["verify-email","accept-invite","create-organization","billing","configure-project","connect-github-account","install-github-app","configure-code-search","install-slack-app","configure-slack-notifications","trigger-issue","confirm-issue","finish"]),L5e=a.enum(["needs-onboarding","blocked","access-denied","ready"]),Q5e=a.enum(["incomplete","complete","skipped"]),N5e=a.object({invitationId:a.string(),organizationId:a.string(),organizationName:a.string(),organizationSlug:a.string(),organizationImageUrl:a.string().nullable(),inviterName:a.string().nullable()}),M5e=a.object({gate:L5e,canonicalStep:C0.nullable(),organizationId:a.string().nullable(),projectId:a.string().nullable(),completionByStep:a.record(C0,Q5e),githubSkipped:a.boolean(),githubAppSkipped:a.boolean(),slackSkipped:a.boolean(),sampleIssueId:a.string().nullable(),actorRole:a.enum(["admin","member"]).nullable(),requiredStep:a.union([C0,a.literal("select-organization")]).nullable(),isCompleted:a.boolean(),onboardingRecommendationsThreadId:a.string().nullable(),hasOrganizations:a.boolean(),hasPaidBillingSubscription:a.boolean(),billingStepEnabled:a.boolean(),pendingInvitations:a.array(N5e)}),z5e=a.object({organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project whose onboarding state to bind (sample-issue attempt and project-scoped facts). Auto-filled from CLI and SDK context when omitted.")}),j5e=a.object({onboarding:M5e}),v0=w({operationId:"onboarding.getState",summary:"Get onboarding state",description:"Read onboarding progress for the authenticated user.",backend:"api",route:{method:"GET",path:"/onboarding/state",tags:["Onboarding"]},input:z5e,output:j5e,pagination:"none",async:"sync"}),U5e=a.object({integration:a.enum(["github","slack"]).describe("Integration onboarding step to skip."),organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project used to resolve the organization whose onboarding state is written. Without it, the credential's active organization is used — which for CLI user tokens is the server session's organization, not the CLI's selected one.")}),F5e=a.object({skipped:a.literal(!0)}),w0=w({operationId:"onboarding.skipIntegration",summary:"Skip an integration step",description:"Skip a GitHub or Slack integration step during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-integration",tags:["Onboarding"]},input:U5e,output:F5e,pagination:"none",async:"sync"}),$5e=a.object({organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project used to resolve the organization whose onboarding state is written. Without it, the credential's active organization is used — which for CLI user tokens is the server session's organization, not the CLI's selected one.")}),G5e=a.object({skipped:a.literal(!0)}),E0=w({operationId:"onboarding.skipGithubAppInstallation",summary:"Skip GitHub App installation",description:"Skip GitHub App installation during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-github-app",tags:["Onboarding"]},input:$5e,output:G5e,pagination:"none",async:"sync"}),q5e=a.object({organizationId:a.string().min(1).optional().describe("Organization to resolve onboarding state for. User credentials must belong to it. Defaults to the credential's organization context. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),projectId:a.string().uuid().optional().describe("Project used to resolve the organization whose onboarding state is written. Without it, the credential's active organization is used — which for CLI user tokens is the server session's organization, not the CLI's selected one.")}),H5e=a.object({skipped:a.literal(!0)}),k0=w({operationId:"onboarding.skipSampleIssue",summary:"Skip the test issue",description:"Skip the optional test issue during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-sample-issue",tags:["Onboarding"]},input:q5e,output:H5e,pagination:"none",async:"sync"}),V5e=a.object({projectId:a.string().uuid().describe("Project that completed onboarding.")}),K5e=a.object({completed:a.boolean()}),x0=w({operationId:"onboarding.finish",summary:"Finish onboarding",description:"Mark onboarding complete when all prerequisites are satisfied.",backend:"api",route:{method:"POST",path:"/onboarding/finish",tags:["Onboarding"]},input:V5e,output:K5e,pagination:"none",async:"sync"}),Z1t={getState:v0.contract,skipIntegration:w0.contract,skipGithubAppInstallation:E0.contract,skipSampleIssue:k0.contract,finish:x0.contract}});var fS,Y5e,W5e,J5e,Z5e,X5e,eXe,tXe,nXe,oXe,rXe,P0,R0,T0,B0,o2t;var rme=h(()=>{Oe();Ve();cS();fS=a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional()}),Y5e=fS.extend({role:Cs.optional()}),W5e=a.object({}),J5e=a.object({organizations:a.array(Y5e).describe("Organizations available to the current credential.")}),Z5e=a.object({organizationId:a.string().min(1).describe("Organization ID to fetch.")}),X5e=a.object({organization:fS}),eXe=a.object({organizationId:a.string().min(1).describe("Organization ID to update. SDK and CLI callers can auto-fill this before dispatch."),name:a.string().trim().min(1).max(100).describe("New organization name.")}),tXe=a.object({organization:fS.describe("Updated organization.")}),nXe=a.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(/^[\p{L}\p{N} _-]+$/u,"Name can only contain letters, numbers, spaces, hyphens, and underscores"),oXe=a.object({name:nXe.describe("Organization display name.")}),rXe=a.object({organization:fS}),P0=w({operationId:"organizations.create",summary:"Create an organization",description:"Create an organization for the authenticated user.",backend:"api",route:{method:"POST",path:"/organizations",tags:["Organizations"],successStatus:201},input:oXe,output:rXe,pagination:"none",async:"sync"}),R0=w({operationId:"organizations.list",summary:"List organizations",description:"List organizations available to the current credential.",backend:"api",route:{method:"GET",path:"/organizations",tags:["Organizations"]},input:W5e,output:J5e,pagination:"none",async:"sync"}),T0=w({operationId:"organizations.get",summary:"Get an organization",description:"Get one organization by ID.",backend:"api",route:{method:"GET",path:"/organizations/{organizationId}",tags:["Organizations"]},input:Z5e,output:X5e,pagination:"none",async:"sync"}),B0=w({operationId:"organizations.update",summary:"Update an organization",description:"Update one organization.",backend:"api",route:{method:"PATCH",path:"/organizations/{organizationId}",tags:["Organizations"]},input:eXe,output:tXe,pagination:"none",async:"sync",examples:[{name:"rename-organization",input:{organizationId:"organization-123",name:"Observed Platform"},output:{organization:{id:"organization-123",name:"Observed Platform",slug:"acme",logo:null}}}]}),o2t={list:R0.contract,get:T0.contract,create:P0.contract,update:B0.contract}});var Mu,Im,ime,sme,ame,cme,lme,ume,dme,yS,bS,IS,pme,gme,SS,mme,hme,CS,iXe;var O0=h(()=>{Oe();Ve();Mu=a.enum(["us-east-1","us-east-2","us-west-1","us-west-2","eu-central-1","eu-central-2","eu-north-1","eu-south-1","eu-south-2","eu-west-1","eu-west-2","eu-west-3"]),Im=a.object({id:a.string().uuid(),organizationId:a.string().min(1),name:a.string(),region:Mu}),ime=a.object({organizationId:a.string().min(1).optional().describe("Organization to list projects for. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies).")}),sme=a.object({projects:a.array(Im).describe("Projects visible within the selected organization.")}),ame=a.object({projectId:a.string().uuid().describe("Project ID to fetch.")}),cme=a.string().trim().min(1,"Name is required").max(100,"Name must be 100 characters or less").regex(/^[\p{L}\p{N} _-]+$/u,"Name can only contain letters, numbers, spaces, hyphens, and underscores"),lme=a.object({organizationId:a.string().min(1).optional().describe("Organization to create the project under. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),name:cme.describe("Project name."),region:Mu.optional().default("us-west-2").describe("AWS region where the new project should be created.")}),ume=a.object({project:Im}),dme=a.object({project:Im}),yS=w({operationId:"projects.list",summary:"List projects",description:"List projects in an organization.",backend:"api",route:{method:"GET",path:"/projects",tags:["Projects"]},input:ime,output:sme,pagination:"none",async:"sync"}),bS=w({operationId:"projects.get",summary:"Get a project",description:"Get one project by ID.",backend:"api",route:{method:"GET",path:"/projects/{projectId}",tags:["Projects"]},input:ame,output:dme,pagination:"none",async:"sync"}),IS=w({operationId:"projects.create",summary:"Create a project",description:"Create one project in an organization.",backend:"api",route:{method:"POST",path:"/projects",successStatus:201,tags:["Projects"]},input:lme,output:ume,pagination:"none",async:"sync"}),pme=a.object({projectId:a.string().uuid().describe("Project ID to update."),name:cme.optional().describe("New project name.")}),gme=a.object({project:Im}),SS=w({operationId:"projects.update",summary:"Update a project",description:"Update (rename) one project by ID. User credentials require the `settings:write` organization permission (admin or owner role).",backend:"api",route:{method:"PATCH",path:"/projects/{projectId}",tags:["Projects"]},input:pme,output:gme,pagination:"none",async:"sync"}),mme=a.object({projectId:a.string().uuid().describe("Project ID to delete.")}),hme=a.void(),CS=w({operationId:"projects.delete",summary:"Delete a project",description:"Delete one project by ID. User credentials require the `settings:write` organization permission (admin or owner role).",backend:"api",route:{method:"DELETE",path:"/projects/{projectId}",successStatus:204,tags:["Projects"]},input:mme,output:hme,pagination:"none",async:"sync"}),iXe={list:yS.contract,get:bS.contract,create:IS.contract,update:SS.contract,delete:CS.contract}});var Ame,sXe,aXe,cXe,lXe,uXe,_0,u2t;var fme=h(()=>{Oe();Ve();Ame=a.enum(["open","merged","closed"]),sXe=a.enum(["review_required","approved","changes_requested"]),aXe=a.enum(["passing","failing","pending"]),cXe=a.object({id:a.string().uuid(),projectId:a.string().uuid(),repositoryFullName:a.string(),pullRequestId:a.string().describe("Provider-native pull request identifier (GitHub PR number or Bitbucket PR id), serialized as a string."),githubPullRequestId:a.number().int().describe("Deprecated: use pullRequestId. Numeric form of the provider-native pull request identifier; kept for backward compatibility."),title:a.string().nullable(),url:a.string().nullable(),status:Ame.nullable(),reviewState:sXe.nullable(),checksState:aXe.nullable(),requestedByUserId:a.string().nullable(),authorLogin:a.string().nullable().describe("Forge login that authored the pull request (often the Sazabi app identity)."),githubAuthorLogin:a.string().nullable().describe("Deprecated: use authorLogin. Kept for backward compatibility."),threadId:a.string().uuid().nullable(),runId:a.string().uuid().nullable(),createdAt:a.string().datetime(),mergedAt:a.string().datetime().nullable(),closedAt:a.string().datetime().nullable()}),lXe=a.object({projectId:a.string().uuid().optional().describe("Project to list pull requests for. Auto-filled from CLI and SDK context when omitted."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of pull requests to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),status:Ame.optional().describe("Filter by pull request status (open, merged, or closed)."),repositoryFullName:a.string().trim().optional().describe("Filter by repository full name, for example owner/repo. Case-insensitive."),requestedByUserId:a.string().trim().optional().describe("Filter by the Sazabi user who requested the pull request. Pass 'me' to filter to the authenticated user.")}),uXe=a.object({pullRequests:a.array(cXe),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),_0=w({operationId:"pullRequests.list",summary:"List pull requests",description:"List pull requests that Sazabi opened, optionally filtered by status, repository, and requesting user.",backend:"api",route:{method:"GET",path:"/pull-requests",tags:["Pull Requests"]},input:lXe,output:uXe,pagination:"cursor",async:"sync"}),u2t={list:_0.contract}});var yme,bme,Ime,Sme,Cme,Sm;var D0=h(()=>{Oe();Ve();yme=a.enum(["log_source","mcp_connector","sandbox_cli","integration"]),bme=a.enum(["connected","recommended"]),Ime=a.object({kind:yme.describe("What the recommendation targets: a log source, MCP connector, sandbox CLI, or integration."),targetId:a.string().describe("Exact catalog id for the kind (log source type, MCP provider id, sandbox CLI preset type, or integration provider id)."),status:bme.describe("Resolved live against current connections: connected (already set up) or recommended (suggested, not yet connected)."),roiScore:a.number().int().min(0).max(100).describe("Intrinsic ROI score, 0–100 — a normalized blend of how valuable, how easy to connect, and how proven the item is. A pure function of the item; computed live on read, never stored."),priority:a.number().int().min(1).describe("1-based rank within this list, sorted by roiScore (best first). Items are already returned in priority order; the field lets consumers recover the rank without trusting array position.")}),Sme=a.object({projectId:a.string().uuid().optional().describe("Project to list recommendations for. Auto-filled from CLI and SDK context when omitted.")}),Cme=a.object({recommendations:a.array(Ime).describe("The project's configuration recommendations, deduped by (kind, targetId), with status resolved live and each item's ROI score. Returned in priority order (highest roiScore first).")}),Sm=w({operationId:"recommendations.list",summary:"List recommendations",description:"List a project's configuration recommendations (data sources, MCP connectors, sandbox CLIs, and integrations) with each item's live connection status.",backend:"api",route:{method:"GET",path:"/recommendations",tags:["Recommendations"]},input:Sme,output:Cme,pagination:"none",async:"sync"})});var vme,L0,wme,Eme,kme,xme,Pme,Rme,Cm,vm,wm;var Q0=h(()=>{Oe();Ve();vme=a.enum(["github","bitbucket"]),L0=a.object({id:a.string().uuid().describe("Repository row id — stable across access sources; use it as the path id for repos.remove."),accessSourceId:a.string().uuid().describe("Access source granting this view of the repository (GitHub App installation, personal connection, or integration). Pass to repos.add to link the repository through this source."),source:a.enum(["githubApp","personal","integration"]).describe("Kind of access source granting this view: an organization GitHub App installation, the caller's personal forge connection, or an organization integration."),sourceLabel:a.string().describe('Display label for the access source (e.g. "GitHub app", "Personal").'),provider:vme.describe("Forge hosting the repository."),owner:a.string().describe("Repository owner (user or organization)."),name:a.string().describe("Repository name without the owner."),fullName:a.string().describe("Full name in owner/name form."),defaultBranch:a.string().nullable().describe("Default branch, when the forge reports one."),isPrivate:a.boolean().describe("Whether the repository is private."),linked:a.boolean().describe("Whether the repository is already linked to the project.")}),wme=a.object({projectId:a.string().uuid().optional().describe("Project to list repositories for. Auto-filled from CLI and SDK context when omitted.")}),Eme=a.object({repos:a.array(L0).describe("Every repository available to the project's organization (from GitHub App installations, the caller's personal forge connections, and integrations), with `linked` marking the ones already linked to the project.")}),kme=a.object({projectId:a.string().uuid().optional().describe("Project to link the repositories to. Auto-filled from CLI and SDK context when omitted."),accessSourceIds:a.array(a.string().uuid()).min(1).describe("Access source ids (from repos.list) to link. Select only one access source per repository.")}),xme=a.object({repos:a.array(L0).describe("The now-linked repositories.")}),Pme=a.object({id:a.string().uuid().describe("Repository row id (from repos.list) to unlink."),projectId:a.string().uuid().optional().describe("Project to unlink the repository from. Auto-filled from CLI and SDK context when omitted.")}),Rme=a.void(),Cm=w({operationId:"repos.list",summary:"List repositories",description:"List the repositories available to a project — every repository reachable through the organization's GitHub App installations, the caller's personal forge connections, and integrations — with each one's linked status.",backend:"api",route:{method:"GET",path:"/repos",tags:["Repos"]},input:wme,output:Eme,pagination:"none",async:"sync"}),vm=w({operationId:"repos.add",summary:"Link repositories to a project",description:"Link repositories to a project by access source id. Select only one access source per repository; re-linking an already-linked repository refreshes its selected access source.",backend:"api",route:{method:"POST",path:"/repos",tags:["Repos"]},input:kme,output:xme,pagination:"none",async:"sync"}),wm=w({operationId:"repos.remove",summary:"Unlink a repository from a project",description:"Unlink a repository from a project by repository row id.",backend:"api",route:{method:"DELETE",path:"/repos/{id}",successStatus:204,tags:["Repos"]},input:Pme,output:Rme,pagination:"none",async:"sync"})});var Tme,dXe,Bme,vS,Ome,_me,Dme,Lme,zu,N0,Qme,Nme,ju,Mme,zme,Uu,jme,Ume,Fu,pXe;var M0=h(()=>{Oe();Ve();Tme=a.object({type:a.string().describe("Preset type identifier."),label:a.string().describe("Human-readable display name."),executableNames:a.array(a.string()).describe("CLI binary names installed by this preset."),envVarKeys:a.array(a.string()).describe("Environment variables required for authentication."),setupSkill:a.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),dXe=a.object({}),Bme=a.object({types:a.array(Tme)}),vS=w({operationId:"sandboxPresets.listTypes",summary:"List CLI types",description:"List all supported sandbox CLI types with their environment variable requirements and setup skills.",backend:"api",route:{method:"GET",path:"/sandbox-presets/types",tags:["Sandbox Presets"]},input:dXe,output:Bme,pagination:"none",async:"sync"}),Ome=a.enum(["github_app","bitbucket_integration","personal_access_token","stored_credentials"]),_me=a.object({presetType:a.string().describe("Preset type identifier."),credentialSource:Ome.describe("Authoritative credential source for the preset."),isSystemManaged:a.boolean().describe("Whether the connection follows an integration lifecycle."),fallbackConfigured:a.boolean().describe("Whether user-provided fallback credentials are stored for this preset."),envVarKeys:a.array(a.string()).describe("Stored environment variable names. Secret values are omitted.")}),Dme=a.object({projectId:a.string().uuid().optional().describe("Project to inspect. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted.")}),Lme=a.object({connections:a.array(_me)}),zu=w({operationId:"sandboxPresets.listConnections",summary:"List CLI connections",description:"List a project's stored and integration-backed sandbox CLI connections without returning secret values.",backend:"api",route:{method:"GET",path:"/sandbox-presets/connections",tags:["Sandbox Presets"]},input:Dme,output:Lme,pagination:"none",async:"sync"}),N0=a.object({key:a.string().min(1).max(256).regex(/^[A-Za-z_][A-Za-z0-9_]*$/,"Environment variable keys must match /^[A-Za-z_][A-Za-z0-9_]*$/.").describe("Environment variable name (e.g. KUBECONFIG_CONTENTS)."),value:a.string().max(10240).describe("Secret value. Encrypted at rest; never returned by any API response.")}),Qme=a.object({projectId:a.string().uuid().optional().describe("Project to configure. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:a.string().min(1).describe("Preset type identifier (e.g. kubectl, aws, github)."),environmentVariables:a.array(N0).max(100).describe("Full set of env vars for this preset. Replaces any previously stored values for the preset.")}),Nme=a.object({projectId:a.string().uuid().describe("Project the preset was written to."),presetType:a.string().describe("Preset type that was upserted."),envVarKeys:a.array(a.string()).describe("Env var key names now stored for this preset. Values are never returned.")}),ju=w({operationId:"sandboxPresets.upsertPreset",summary:"Upsert CLI connection",description:"Set or replace a project's CLI connection credentials (e.g. the kubectl CLI's KUBECONFIG_CONTENTS). Values are encrypted server-side and never returned. Requires write access to the target project.",backend:"api",route:{method:"POST",path:"/sandbox-presets/config",successStatus:200,tags:["Sandbox Presets"]},input:Qme,output:Nme,pagination:"none",async:"sync"}),Mme=a.object({projectId:a.string().uuid().optional().describe("Project to update. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:a.string().min(1).describe("Preset type identifier.")}),zme=a.object({projectId:a.string().uuid().describe("Project the CLI connection belonged to."),presetType:a.string().describe("Preset type that was disconnected."),deleted:a.boolean().describe("Whether a stored CLI connection was deleted.")}),Uu=w({operationId:"sandboxPresets.deletePreset",summary:"Disconnect CLI",description:"Delete a project's stored CLI connection. Integration-managed access remains available until its owning integration is disconnected.",backend:"api",route:{method:"DELETE",path:"/sandbox-presets/config/{presetType}",tags:["Sandbox Presets"]},input:Mme,output:zme,pagination:"none",async:"sync"}),jme=a.object({projectId:a.string().uuid().optional().describe("Project to test from. Required for organization-scoped keys; auto-filled from a project-scoped key when omitted."),presetType:a.string().min(1).describe("Preset type identifier."),environmentVariables:a.array(N0).max(100).describe("Unsaved credentials to validate in a readonly sandbox.")}),Ume=a.object({status:a.enum(["success","failed"]),message:a.string().nullable(),stdout:a.string().describe("Truncated command output with submitted credentials redacted."),stderr:a.string().describe("Truncated command errors with submitted credentials redacted.")}),Fu=w({operationId:"sandboxPresets.testPreset",summary:"Test CLI connection",description:"Validate unsaved CLI credentials in a read-only ephemeral sandbox without persisting them.",backend:"api",route:{method:"POST",path:"/sandbox-presets/test",tags:["Sandbox Presets"]},input:jme,output:Ume,pagination:"none",async:"sync"}),pXe={deletePreset:Uu.contract,listConnections:zu.contract,listTypes:vS.contract,testPreset:Fu.contract,upsertPreset:ju.contract}});var wS,Fme=1048576,z0,$me,j0,gXe,mXe,hXe,AXe,fXe,yXe,bXe,IXe,SXe,CXe,U0,F0,$0,G0,q0,v2t;var Gme=h(()=>{Oe();Ve();wS=a.string().min(1).max(64).regex(/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/,"Name must start with a letter or digit and contain only letters, digits, underscores, and hyphens (max 64 characters).").describe("Script name. Must be unique within the project among non-deleted scripts."),z0=a.string().min(1).refine((e)=>new TextEncoder().encode(e).length<=Fme,{message:`Script content must be at most ${Fme} bytes (1 MiB).`}).describe("Bash script body materialized as /home/sazabi/scripts/<name>.sh in the sandbox."),$me=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),description:a.string().nullable(),contentHash:a.string().describe("sha256 hex digest of the script content."),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),j0=$me.extend({content:z0}),gXe=a.object({projectId:a.string().uuid().optional().describe("Project to list scripts for. Auto-filled from CLI and SDK context when omitted."),search:a.string().optional().describe("Case-insensitive partial match on script name."),cursor:a.string().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of scripts to return per page.")}),mXe=a.object({scripts:a.array($me),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),hXe=a.object({name:wS.describe("Script name to fetch."),projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted.")}),AXe=a.object({script:j0}),fXe=a.object({projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted."),name:wS.describe("Script name. Must be unique within the project among non-deleted scripts."),content:z0,description:a.string().max(500).nullable().optional().describe("Optional human-readable description.")}),yXe=a.object({script:j0}),bXe=a.object({name:wS.describe("Script to update."),projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted."),content:z0.optional().describe("New script body. Omit to leave content unchanged."),description:a.string().max(500).nullable().optional().describe("New description, or null to clear it. Omit to leave unchanged.")}),IXe=a.object({script:j0}),SXe=a.object({name:wS.describe("Script to delete."),projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted.")}),CXe=a.void(),U0=w({operationId:"scripts.list",summary:"List scripts",description:"List durable bash scripts stored for a project.",backend:"api",route:{method:"GET",path:"/scripts",tags:["Scripts"]},input:gXe,output:mXe,pagination:"cursor",async:"sync"}),F0=w({operationId:"scripts.get",summary:"Get a script",description:"Get a single project script by name, including its body.",backend:"api",route:{method:"GET",path:"/scripts/{name}",tags:["Scripts"]},input:hXe,output:AXe,pagination:"none",async:"sync"}),$0=w({operationId:"scripts.create",summary:"Create a script",description:"Create a durable bash script for a project.",backend:"api",route:{method:"POST",path:"/scripts",successStatus:201,tags:["Scripts"]},input:fXe,output:yXe,pagination:"none",async:"sync"}),G0=w({operationId:"scripts.update",summary:"Update a script",description:"Update a project script's body and/or description.",backend:"api",route:{method:"PATCH",path:"/scripts/{name}",tags:["Scripts"]},input:bXe,output:IXe,pagination:"none",async:"sync"}),q0=w({operationId:"scripts.delete",summary:"Delete a script",description:"Soft-delete a project script by name.",backend:"api",route:{method:"DELETE",path:"/scripts/{name}",successStatus:204,tags:["Scripts"]},input:SXe,output:CXe,pagination:"none",async:"sync"}),v2t={list:U0.contract,get:F0.contract,create:$0.contract,update:G0.contract,delete:q0.contract}});var H0,qme,Hme,Vme,Kme,$u,Gu,vXe;var V0=h(()=>{Oe();Ve();H0=a.object({projectId:a.string().uuid().optional().describe("Project to search within. Auto-filled from CLI and SDK context when omitted."),query:a.string().trim().min(1,"Query must be at least 1 character").max(500,"Query must be at most 500 characters"),limit:a.coerce.number().min(1).max(100).default(20).describe("Maximum number of search results to return."),page:a.coerce.number().min(1).default(1).describe("One-based page number.")}),qme=H0.extend({status:a.enum(["regular","archived"]).optional().describe("Optional thread status filter.")}),Hme=H0.extend({threadId:a.string().uuid().optional().describe("Optional thread restriction for message search."),role:a.enum(["user","assistant"]).optional().describe("Optional message role filter.")}),Vme=a.object({threads:a.array(a.object({id:a.string().uuid(),projectId:a.string().uuid().optional(),title:a.string(),status:a.enum(["regular","archived"]),labels:a.array(a.string()),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),highlights:a.array(a.string()),score:a.number().optional()})),pagination:a.object({page:a.number(),limit:a.number(),totalResults:a.number(),totalPages:a.number()}).describe("Page-based pagination metadata for the current search result.")}),Kme=a.object({messages:a.array(a.object({id:a.string().uuid(),threadId:a.string().uuid(),threadTitle:a.string(),role:a.enum(["user","assistant"]),content:a.string(),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),highlights:a.array(a.string()),score:a.number().optional()})),pagination:a.object({page:a.number(),limit:a.number(),totalResults:a.number(),totalPages:a.number()}).describe("Page-based pagination metadata for the current search result.")}),$u=w({operationId:"search.threads",summary:"Search threads",description:"Search threads within one project.",backend:"api",route:{method:"GET",path:"/search/threads",tags:["Search"]},input:qme,output:Vme,pagination:"page",async:"sync",examples:[{name:"search-open-incidents",input:{projectId:"11111111-1111-4111-8111-111111111111",query:"payment timeout",status:"regular",limit:10,page:1},output:{threads:[{id:"22222222-2222-4222-8222-222222222222",projectId:"11111111-1111-4111-8111-111111111111",title:"Payment timeout in us-west-2",status:"regular",labels:["payments","timeout"],createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-02T00:00:00.000Z",highlights:["payment timeout"],score:123.45}],pagination:{page:1,limit:10,totalResults:1,totalPages:1}}}]}),Gu=w({operationId:"search.messages",summary:"Search messages",description:"Search messages within one project.",backend:"api",route:{method:"GET",path:"/search/messages",tags:["Search"]},input:Hme,output:Kme,pagination:"page",async:"sync",examples:[{name:"search-assistant-messages",input:{projectId:"11111111-1111-4111-8111-111111111111",query:"rollback",role:"assistant",limit:10,page:1},output:{messages:[{id:"33333333-3333-4333-8333-333333333333",threadId:"22222222-2222-4222-8222-222222222222",threadTitle:"Deployment rollback guidance",role:"assistant",content:"Rollback the ingestion deployment and confirm queue depth.",createdAt:"2026-01-02T00:00:00.000Z",updatedAt:"2026-01-02T00:00:00.000Z",highlights:["Rollback the ingestion deployment"],score:98.76}],pagination:{page:1,limit:10,totalResults:1,totalPages:1}}}]}),vXe={threads:$u.contract,messages:Gu.contract}});var ES,Yme,K0,Em,wXe,EXe,kXe,xXe,PXe,RXe,TXe,BXe,OXe,_Xe,Y0,W0,J0,Z0,X0,DXe,LXe,eM,T2t;var Wme=h(()=>{Oe();Ve();ES=a.string().uuid().describe("Signal definition ID."),Yme=a.string().min(1).max(200).describe("Human-readable expression name."),K0=a.string().min(1).max(8192).describe("CEL expression evaluated against ingested log events."),Em=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),expression:K0,enabled:a.boolean(),compiledVersion:a.number().int(),linkedAutomationIds:a.array(a.string().uuid()).optional().describe("Automations bound to this expression. Included on list/get when available."),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),wXe=a.object({projectId:a.string().uuid().optional().describe("Project to list signal definitions for. Auto-filled from CLI and SDK context when omitted.")}),EXe=a.object({signalDefinitions:a.array(Em)}),kXe=a.object({signalDefinitionId:ES,projectId:a.string().uuid().optional().describe("Project that owns the signal definition. Auto-filled from CLI and SDK context when omitted.")}),xXe=a.object({signalDefinition:Em}),PXe=a.object({projectId:a.string().uuid().optional().describe("Project to create the expression in. Auto-filled from CLI and SDK context when omitted."),name:Yme,expression:K0,enabled:a.boolean().optional().describe("Whether the expression starts enabled. Defaults to true.")}),RXe=a.object({signalDefinition:Em}),TXe=a.object({signalDefinitionId:ES,projectId:a.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted."),name:Yme.optional(),expression:K0.optional(),enabled:a.boolean().optional().describe("Whether the expression is enabled.")}),BXe=a.object({signalDefinition:Em}),OXe=a.object({signalDefinitionId:ES,projectId:a.string().uuid().optional().describe("Project that owns the expression. Auto-filled from CLI and SDK context when omitted.")}),_Xe=a.object({signalDefinition:Em}),Y0=w({operationId:"signalDefinitions.list",summary:"List signal definitions",description:"List signal definitions in a project.",backend:"api",route:{method:"GET",path:"/signal-definitions",tags:["Signal definitions"]},input:wXe,output:EXe,pagination:"none",async:"sync"}),W0=w({operationId:"signalDefinitions.get",summary:"Get a signal definition",description:"Get a single signal definition by ID.",backend:"api",route:{method:"GET",path:"/signal-definitions/{signalDefinitionId}",tags:["Signal definitions"]},input:kXe,output:xXe,pagination:"none",async:"sync"}),J0=w({operationId:"signalDefinitions.create",summary:"Create a signal definition",description:"Create a CEL signal definition for a project.",backend:"api",route:{method:"POST",path:"/signal-definitions",successStatus:201,tags:["Signal definitions"]},input:PXe,output:RXe,pagination:"none",async:"sync"}),Z0=w({operationId:"signalDefinitions.update",summary:"Update a signal definition",description:"Update a signal definition's name, CEL body, or enabled state.",backend:"api",route:{method:"PATCH",path:"/signal-definitions/{signalDefinitionId}",tags:["Signal definitions"]},input:TXe,output:BXe,pagination:"none",async:"sync"}),X0=w({operationId:"signalDefinitions.disable",summary:"Disable a signal definition",description:"Disable a signal definition so it stops matching logs.",backend:"api",route:{method:"POST",path:"/signal-definitions/{signalDefinitionId}/disable",tags:["Signal definitions"]},input:OXe,output:_Xe,pagination:"none",async:"sync"}),DXe=a.object({signalDefinitionId:ES,projectId:a.string().uuid().optional().describe("Project that owns the signal definition. Auto-filled from CLI and SDK context when omitted.")}),LXe=a.void(),eM=w({operationId:"signalDefinitions.delete",summary:"Delete a signal definition",description:"Permanently delete a signal definition.",backend:"api",route:{method:"DELETE",path:"/signal-definitions/{signalDefinitionId}",successStatus:204,tags:["Signal definitions"]},input:DXe,output:LXe,pagination:"none",async:"sync"}),T2t={list:Y0.contract,get:W0.contract,create:J0.contract,update:Z0.contract,disable:X0.contract,delete:eM.contract}});var Jme;var Zme=h(()=>{Jme=["onboarding","setup"]});var Xme,ehe,the,nhe,km;var tM=h(()=>{Zme();Oe();Ve();Xme=a.enum(Jme),ehe=a.object({id:a.string().describe("Unique task identifier (e.g. install_github_app)."),label:a.string().describe("Short human-readable task name."),description:a.string().describe("Explanation of what needs to be completed to satisfy this task."),instructions:a.string().describe("Step-by-step instructions for completing this task."),completed:a.boolean().describe("Whether the task has been completed."),completedAt:a.string().datetime().nullable().describe("ISO 8601 timestamp of when the task was completed, or null."),category:Xme.describe("Task category: onboarding (core setup steps) or setup (additional configuration).")}),the=a.object({projectId:a.string().uuid().optional().describe("Project to list tasks for. Auto-filled from CLI and SDK context when omitted.")}),nhe=a.object({tasks:a.array(ehe).describe("All onboarding and setup tasks with their current completion status.")}),km=w({operationId:"tasks.list",summary:"List tasks",description:"List all onboarding and setup tasks for a project, including their current completion status and a description of what is required to complete each task.",backend:"api",route:{method:"GET",path:"/tasks",tags:["Tasks"]},input:the,output:nhe,pagination:"none",async:"sync"})});var QXe,NXe,qa,MXe,zXe,jXe,UXe,FXe,$Xe,GXe,qXe,HXe,VXe,KXe,YXe,WXe,JXe,nM,oM,rM,iM,sM,aM,cM,z2t;var ohe=h(()=>{Oe();Ve();QXe=a.object({id:a.string().uuid().describe("Team ID."),name:a.string().describe("Team name, unique among the org's active teams."),description:a.string().nullable().describe("Optional team description."),createdAt:a.string().datetime().describe("When the team was created."),memberCount:a.number().int().nonnegative().describe("Number of active members in the team.")}),NXe=a.object({userId:a.string().min(1).describe("User ID of the team member."),name:a.string().nullable().describe("Display name for the member, when available."),email:a.string().email().describe("Email address for the member."),addedAt:a.string().datetime().describe("When the member was added to the team.")}),qa=a.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted. User tokens must supply it unless the credential's fixed scope resolves it; secret keys may omit it (the key's organization applies)."),MXe=a.object({organizationId:qa}),zXe=a.object({teams:a.array(QXe).describe("Active teams in the organization.")}),jXe=a.object({organizationId:qa,name:a.string().trim().min(1).describe("Team name."),description:a.string().trim().min(1).optional().describe("Optional team description.")}),UXe=a.object({id:a.string().uuid().describe("ID of the created team.")}),FXe=a.object({organizationId:qa,teamId:a.string().uuid().describe("Team to update."),name:a.string().trim().min(1).optional().describe("New team name."),description:a.string().trim().min(1).nullable().optional().describe("New team description; null clears it.")}),$Xe=a.object({id:a.string().uuid().describe("ID of the updated team.")}),GXe=a.object({params:a.object({teamId:a.string().uuid().describe("Team to delete.")}),query:a.object({organizationId:qa})}).transform(({params:e,query:t})=>({...t,...e})),qXe=a.object({success:a.literal(!0).describe("The team and its memberships were removed.")}),HXe=a.object({organizationId:qa,teamId:a.string().uuid().describe("Team to add the member to."),userId:a.string().min(1).describe("User ID of an active organization member to add.")}),VXe=a.object({id:a.string().uuid().describe("ID of the team membership.")}),KXe=a.object({params:a.object({teamId:a.string().uuid().describe("Team to remove the member from."),userId:a.string().min(1).describe("User ID of the member to remove.")}),query:a.object({organizationId:qa})}).transform(({params:e,query:t})=>({...t,...e})),YXe=a.object({success:a.literal(!0).describe("The membership was removed.")}),WXe=a.object({organizationId:qa,teamId:a.string().uuid().describe("Team to list members for.")}),JXe=a.object({members:a.array(NXe).describe("Active members of the team.")}),nM=w({operationId:"teams.list",summary:"List teams",description:"List teams in an organization.",backend:"api",route:{method:"GET",path:"/teams",tags:["Teams"]},input:MXe,output:zXe,pagination:"none",async:"sync",examples:[{name:"organization-teams",input:{organizationId:"organization-123"},output:{teams:[{id:"5c0f9866-31ab-4237-94cc-a1d0ba2f6de2",name:"Payments",description:"Owns checkout and billing components.",createdAt:"2026-01-01T00:00:00.000Z",memberCount:4}]}}]}),oM=w({operationId:"teams.create",summary:"Create a team",description:"Create a team in an organization.",backend:"api",route:{method:"POST",path:"/teams",tags:["Teams"],successStatus:201},input:jXe,output:UXe,pagination:"none",async:"sync"}),rM=w({operationId:"teams.update",summary:"Update a team",description:"Rename a team or update its description.",backend:"api",route:{method:"PATCH",path:"/teams/{teamId}",tags:["Teams"]},input:FXe,output:$Xe,pagination:"none",async:"sync"}),iM=w({operationId:"teams.delete",summary:"Delete a team",description:"Delete a team, its memberships, and its component-ownership assignments.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}",tags:["Teams"],inputStructure:"detailed"},input:GXe,output:qXe,pagination:"none",async:"sync"}),sM=w({operationId:"teams.addMember",summary:"Add a team member",description:"Add an active organization member to a team.",backend:"api",route:{method:"POST",path:"/teams/{teamId}/members",tags:["Teams"],successStatus:201},input:HXe,output:VXe,pagination:"none",async:"sync"}),aM=w({operationId:"teams.removeMember",summary:"Remove a team member",description:"Remove a member from a team.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}/members/{userId}",tags:["Teams"],inputStructure:"detailed"},input:KXe,output:YXe,pagination:"none",async:"sync"}),cM=w({operationId:"teams.listMembers",summary:"List team members",description:"List a team's active members.",backend:"api",route:{method:"GET",path:"/teams/{teamId}/members",tags:["Teams"]},input:WXe,output:JXe,pagination:"none",async:"sync"}),z2t={list:nM.contract,create:oM.contract,update:rM.contract,delete:iM.contract,addMember:sM.contract,removeMember:aM.contract,listMembers:cM.contract}});var ZXe,XXe,e8e,lM,t8e,n8e,uM,o8e,r8e,dM,$2t;var rhe=h(()=>{Oe();Ve();ZXe=a.object({kind:a.enum(["user","workspace"]),name:a.string().optional(),email:a.string().optional()}),XXe=a.object({container:a.string().min(1).describe("The container to create the work item in: its id, short key (e.g. a Linear team key like ENG), or display name."),title:a.string().min(1),bodyMarkdown:a.string().optional(),state:a.string().optional(),itemType:a.string().optional(),organizationId:a.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Omitting it currently falls back to the session's active organization for user tokens (deprecated); a future release will require it for user-token callers."),clientRequestId:a.string().min(1).optional().describe("Optional caller-supplied idempotency key. When provided, retrying the same logical create with the same clientRequestId reuses the original result instead of creating a duplicate external work item.")}).strict(),e8e=a.object({identifier:a.string(),title:a.string(),url:a.string(),state:a.string(),attribution:ZXe.optional(),reused:a.boolean()}),lM=w({operationId:"work-items.create",summary:"Create a work item",description:"Create a work item (e.g. a Linear issue) in a connected issue tracker, attributing the write to the requesting user.",backend:"api",route:{method:"POST",path:"/work-items",tags:["Work Items"],successStatus:201},input:XXe,output:e8e,pagination:"none",async:"sync"}),t8e=a.object({itemId:a.string().min(1).describe("The work item to comment on."),bodyMarkdown:a.string().min(1),organizationId:a.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Omitting it currently falls back to the session's active organization for user tokens (deprecated); a future release will require it for user-token callers.")}).strict(),n8e=a.object({identifier:a.string(),url:a.string()}),uM=w({operationId:"work-items.comment",summary:"Comment on a work item",description:"Add a comment to an existing work item.",backend:"api",route:{method:"POST",path:"/work-items/{itemId}/comment",tags:["Work Items"]},input:t8e,output:n8e,pagination:"none",async:"sync"}),o8e=a.object({itemId:a.string().min(1).describe("The work item to transition."),state:a.string().min(1).describe("The target workflow state."),organizationId:a.string().min(1).optional().describe("Optional organization ID to scope the request to. User credentials must belong to it; a secret key may only reference its own organization. Omitting it currently falls back to the session's active organization for user tokens (deprecated); a future release will require it for user-token callers.")}).strict(),r8e=a.object({identifier:a.string(),title:a.string(),url:a.string(),state:a.string(),changed:a.boolean()}),dM=w({operationId:"work-items.transition",summary:"Transition a work item",description:"Move a work item to a target workflow state.",backend:"api",route:{method:"POST",path:"/work-items/{itemId}/transition",tags:["Work Items"]},input:o8e,output:r8e,pagination:"none",async:"sync"}),$2t={create:lM.contract,comment:uM.contract,transition:dM.contract}});var pM;var ihe=h(()=>{e2();a2();lR();hR();L2();WR();XR();Jf();oW();TB();PN();cS();Jpe();jN();vge();Jge();nme();ome();rme();O0();fme();D0();Q0();dS();M0();Gme();V0();Wme();tM();ohe();o0();rhe();pM={me:RN.contract,automations:{list:fR.contract,get:yR.contract,create:bR.contract,update:IR.contract,enable:SR.contract,disable:CR.contract,runs:{list:vR.contract,get:wR.contract,logs:ER.contract}},logs:{query:Wc.contract,search:Jc.contract,schema:Zc.contract,volume:Xc.contract,patterns:el.contract,nativeQuery:tl.contract},logSources:{listProviders:Vf.contract,list:Vc.contract,create:Kc.contract,get:Kf.contract,update:Yf.contract,delete:Wf.contract},logStreams:{list:AB.contract,create:fB.contract,volumeStats:yB.contract,get:bB.contract,update:IB.contract,delete:SB.contract,reassign:CB.contract},connectedAccounts:{beginConnect:dR.contract,getConnectAttempt:pR.contract,list:gR.contract,disconnect:mR.contract},integrations:{listProviders:l2.contract,listConnections:u2.contract,getConnection:d2.contract,getLinearAutomationConfiguration:R2.contract,createConnection:p2.contract,beginConnect:g2.contract,getConnectAttempt:m2.contract,disconnectConnection:h2.contract,updateConnectionCredentials:A2.contract,updateLinearAutomationConfiguration:T2.contract,getOrganizationExternalIdentityJitPolicy:b2.contract,updateOrganizationExternalIdentityJitPolicy:I2.contract,getConnectionExternalIdentityJitPolicy:S2.contract,updateConnectionExternalIdentityJitPolicy:C2.contract,getSlackConfiguration:w2.contract,updateSlackConfiguration:E2.contract,listSlackChannelProjectMappings:O2.contract,setSlackChannelProjectMapping:_2.contract,deleteSlackChannelProjectMapping:D2.contract},notificationChannels:{getProject:u0.contract},notificationDeliveryRules:{list:f0.contract,options:y0.contract,create:b0.contract,update:I0.contract,delete:S0.contract},mcpConnectors:{listProviders:aS.contract,list:Iu.contract,get:Su.contract,details:Cu.contract,search:vu.contract,describe:wu.contract,call:Eu.contract,create:ku.contract,update:xu.contract,disconnect:Pu.contract,setReadOnly:Ru.contract,beginOAuthInstall:Tu.contract,getOAuthInstallAttempt:Bu.contract},sandboxPresets:{deletePreset:Uu.contract,listConnections:zu.contract,listTypes:vS.contract,testPreset:Fu.contract,upsertPreset:ju.contract},scripts:{list:U0.contract,get:F0.contract,create:$0.contract,update:G0.contract,delete:q0.contract},signalDefinitions:{list:Y0.contract,get:W0.contract,create:J0.contract,update:Z0.contract,disable:X0.contract,delete:eM.contract},memory:{put:Ou.contract,get:_u.contract,list:Du.contract,search:Lu.contract,delete:Qu.contract},onboarding:{getState:v0.contract,skipIntegration:w0.contract,skipGithubAppInstallation:E0.contract,skipSampleIssue:k0.contract,finish:x0.contract},organizations:{list:R0.contract,get:T0.contract,create:P0.contract,update:B0.contract},members:{list:TN.contract,updateRole:BN.contract,remove:ON.contract,invite:_N.contract,listInvitations:DN.contract,revokeInvitation:LN.contract},teams:{list:nM.contract,create:oM.contract,update:rM.contract,delete:iM.contract,addMember:sM.contract,removeMember:aM.contract,listMembers:cM.contract},publicKeys:{list:Uc.contract,get:Fc.contract,ensureLogForwarding:$c.contract,update:Gc.contract,deactivate:qc.contract},secretKeys:{list:Mf.contract,get:zf.contract,create:jf.contract,update:Uf.contract,delete:Ff.contract},projects:{list:yS.contract,get:bS.contract,create:IS.contract,update:SS.contract,delete:CS.contract},search:{threads:$u.contract,messages:Gu.contract},messages:{list:Sge.contract,append:Cge.contract},threads:{list:HN.contract,get:VN.contract,getStatus:KN.contract,stop:YN.contract,create:WN.contract,update:JN.contract,fork:ZN.contract,setVisibility:XN.contract,createShareLink:e0.contract,listShareLinks:t0.contract,revokeShareLink:n0.contract},runs:{list:UN.contract,listForThread:FN.contract,get:$N.contract,cancel:GN.contract},pullRequests:{list:_0.contract},issues:{count:xf.contract,create:jc.contract,list:Ef.contract,search:kf.contract,get:Pf.contract,resolve:Rf.contract,ignore:Tf.contract,reopen:Bf.contract,reassignAndReopen:Of.contract,mute:_f.contract,unmute:Df.contract},workItems:{create:lM.contract,comment:uM.contract,transition:dM.contract},billing:{getSummary:xR.contract,getUsage:PR.contract,getAccruedUsageCharges:HR.contract,listUsageInvoices:qR.contract,listTransactions:RR.contract,getAutoTopUp:OR.contract,updateAutoTopUp:_R.contract,purchaseCredits:DR.contract,listPlans:LR.contract,previewPlanChange:QR.contract,previewSubscriptionCancellation:FR.contract,scheduleSubscriptionCancellation:$R.contract,resumeSubscriptionCancellation:GR.contract,changePlan:NR.contract,createCheckoutSession:MR.contract,getCheckoutSessionStatus:zR.contract,createPortalSession:jR.contract,getPaymentMethod:UR.contract},tasks:{list:km.contract},recommendations:{list:Sm.contract},repos:{list:Cm.contract,add:vm.contract,remove:wm.contract},components:{list:of.contract,get:rf.contract,register:zc.contract,deregister:sf.contract,rename:af.contract,assignTeam:cf.contract,reactivationPreview:lf.contract,reactivate:uf.contract,mergePreview:Af.contract,merge:ff.contract,relationships:{list:df.contract,preview:pf.contract,add:gf.contract,remove:mf.contract},incidents:{list:yf.contract},timeline:bf.contract}}});var Ha=h(()=>{H$();lR();hR();ihe();WR();XR();Jf();TB();PN();jN();O0();D0();Q0();M0();V0();tM()});var i8e="https://api.sazabi.com",s8e="x-sazabi-client-source",ahe=(e)=>({streamRun:async(t)=>she({options:e,path:`/runs/${encodeURIComponent(t.runId)}/stream`,cursor:t.cursor,signal:t.signal}),streamThread:async(t)=>she({options:e,path:`/threads/${encodeURIComponent(t.threadId)}/stream`,cursor:t.cursor,signal:t.signal})}),she=async(e)=>{let t=e.options.fetch??globalThis.fetch;if(!t)throw Error("Fetch transport is not available in this runtime.");let n=await e.options.credentialProvider.getToken(),r=a8e(e.options.apiBaseUrl,e.path,e.cursor);return l8e({url:r,token:n,clientSource:e.options.clientSource,initialCursor:e.cursor,signal:e.signal,fetch:t})},a8e=(e,t,n)=>{let r=c8e(e??i8e),o=new URL(`${r}${t}`);if(n)o.searchParams.set(YP,n);return o.toString()},c8e=(e)=>{let t=e.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},l8e=async(e)=>{let t=[],n=[],r=!1,o=!1,i,s=e.initialCursor,c=new AbortController,l=(f)=>{if(r)return;r=!0,i=f;while(n.length>0)n.shift()?.({value:void 0,done:!0})},u=(f)=>{let S=n.shift();if(S){S({value:f,done:!1});return}t.push(f)},d=(f)=>{if(f.event===JP){let v=m8e(f.data);if(v!==void 0)s=v;return}if(f.data===ZP){o=!0,c.abort(),l();return}let S=h8e(f.data);if(S)u(S)},p=()=>{o=!0,c.abort(),l()};if(e.signal)if(e.signal.aborted)o=!0,c.abort();else e.signal.addEventListener("abort",p,{once:!0});let g={[Symbol.asyncIterator](){return g},get cursor(){return s},next:async()=>{if(t.length>0)return{value:t.shift(),done:!1};if(r){if(i)throw i;return{value:void 0,done:!0}}return new Promise((f)=>{n.push(f)}).then((f)=>{if(f.done&&i)throw i;return f})},return:async()=>(o=!0,c.abort(),l(),{value:void 0,done:!0}),throw:async(f)=>{throw o=!0,c.abort(),l(f instanceof Error?f:Error(String(f))),f},close:async()=>{o=!0,c.abort(),l()}};if(o)return l(),g;let m=await e.fetch(e.url,{method:WP,headers:u8e(e.token,e.clientSource),signal:c.signal});if(await d8e(m))l();else p8e(m,d).then(()=>l()).catch((f)=>{if(f8e(f)||o||e.signal?.aborted){l();return}l(y8e(f))});return g},u8e=(e,t)=>({accept:"text/event-stream",authorization:`Bearer ${e}`,...t?{[s8e]:t}:{}}),d8e=async(e)=>{if(e.status===204)return!0;if(e.ok&&e.body)return!1;let t=await A8e(e);if(e.status===401)throw Error("Authentication failed. Check your credential.");if(e.status===403)throw Error(`Forbidden (403): ${t||"Credential may not have access to this resource"}`);if(e.status===404)throw Error(`Not found (404): ${t||"Run or thread not found"}`);if(e.status===400)throw Error(`Invalid stream cursor (400): ${t||"The provided cursor was rejected"}`);if(e.status>=400&&e.status<500&&e.status!==429)throw Error(`Client error (${e.status}): ${t}`);if(!e.body)throw Error("Agent stream response did not include a body.");throw Error(e.status===429?`Rate limited (429): ${t}`:`Server error (${e.status}): ${t}`)},p8e=async(e,t)=>{let n=e.body?.getReader();if(!n)throw Error("Agent stream response did not include a body.");let r=new TextDecoder,o="",i=g8e(t);try{while(!0){let s=await n.read();if(s.done)break;o+=r.decode(s.value,{stream:!0});let c=o.split(/\r\n|\r|\n/);o=c.pop()??"";for(let l of c)i.line(l)}if(o+=r.decode(),o)for(let s of o.split(/\r\n|\r|\n/))i.line(s);i.flush()}finally{n.releaseLock()}},g8e=(e)=>{let t="message",n=[],r=()=>{t="message",n=[]},o=()=>{if(n.length===0){r();return}e({event:t,data:n.join(`
|
|
8912
8912
|
`)}),r()};return{line:(i)=>{if(i===""){o();return}if(i.startsWith(":"))return;let s=i.indexOf(":"),c=s===-1?i:i.slice(0,s),l=s===-1?"":i.slice(s+1),u=l.startsWith(" ")?l.slice(1):l;if(c==="event"){t=u||"message";return}if(c==="data")n.push(u)},flush:o}},m8e=(e)=>{try{let t=KP.safeParse(JSON.parse(e));return t.success?t.data.streamNextOffset:void 0}catch{return}},h8e=(e)=>{try{let t=VP.safeParse(JSON.parse(e));return t.success?t.data:void 0}catch{return}},A8e=async(e)=>{try{return await e.text()}catch{return""}},f8e=(e)=>e instanceof Error&&e.name==="AbortError",y8e=(e)=>e instanceof Error?e:Error(String(e));var che=h(()=>{Ha()});var gM,mM,hM,lhe;var uhe=h(()=>{Oe();gM=a.object({severities:a.array(a.string()).optional().describe("Limit results to the listed severities."),services:a.array(a.string()).optional().describe("Limit results to the listed service names."),environments:a.array(a.string()).optional().describe("Limit results to the listed deployment environments."),searchTerm:a.string().optional().describe("Case-insensitive substring match against the log body."),traceId:a.string().optional().describe("Limit results to one trace ID."),attributes:a.record(a.string(),a.string()).optional().describe("Limit results to logs whose attributes contain every listed key with an exactly equal value.")}),mM=a.object({service:a.string(),namespace:a.string(),environment:a.string(),host:a.string(),container:a.string(),pod:a.string()}),hM=a.object({id:a.string(),timestamp:a.string().datetime(),severity:a.string(),body:a.string(),service:a.string(),traceId:a.string(),spanId:a.string(),attributes:a.record(a.string(),a.string()),resource:mM}),lhe=a.object({type:a.literal("logs"),timestamp:a.string().datetime(),data:a.array(hM)})});var b8e="https://{region}.intake.sazabi.com",I8e="https://{region}.tail.sazabi.com",ghe=500,S8e=5000,mhe="sazabi.public_key",C8e="x-sazabi-internal-log-forwarding-secret",v8e="x-sazabi-internal-log-forwarding-source",w8e=(e)=>e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e,hhe=(e)=>{let t=w8e(e);return t==="localhost"||t==="127.0.0.1"||t==="::1"},E8e,k8e,x8e,Ahe=(e)=>{let t=new Map;return{tail:async(n)=>{let r=await z8e(e.credentialProvider,n.projectId,"logs.tail"),o=await j8e(e,t,r,n.region,"logs.tail"),i=T8e({projectId:r,region:o,filters:n.filters,apiBaseUrl:e.apiBaseUrl,tailBaseUrl:e.tailBaseUrl}),s=await e.credentialProvider.getToken(),c=e.fetch??globalThis.fetch;if(!c)throw Error("Fetch transport is not available in this runtime.");return F8e({token:s,url:i,signal:n.signal,fetch:c})},forward:async(n)=>{let r=await U8e(e,t,n.projectId??await e.credentialProvider.getProjectId?.(),n.region,"logs.forward"),o=D8e(r,e.intakeBaseUrl),i=e.fetch??globalThis.fetch,s=Q8e(n.logs,n.publicKey),c=W8e(s);return await Y8e(i,o,s,M8e(n.sazabiInternalForwarding)),{forwardedCount:c,failedCount:0}}}},P8e="3010",R8e,T8e=(e)=>{let t=(e.tailBaseUrl??B8e({region:e.region,apiBaseUrl:e.apiBaseUrl})).replace("{region}",e.region),n=O8e(t);n.searchParams.set("projectId",e.projectId);let r=_8e(e.filters);if(r)n.searchParams.set("filters",r);return n.toString()},B8e=(e)=>{if(e.apiBaseUrl)try{let t=new URL(e.apiBaseUrl).hostname;if(t.endsWith(".sazabi.dev")){let n=t.includes(".staging.")?"staging.sazabi.dev":"development.sazabi.dev";return`https://${e.region}.tail.${n}`}}catch{}return I8e.replace("{region}",e.region)},O8e=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)throw Error(`Invalid tail base URL: ${e}`);if(hhe(t.hostname)){if(t.protocol="http:",!t.port||R8e.has(t.port))t.port=P8e;return t.pathname="/v1/tail",t.search="",t.hash="",t}if(t.protocol==="ws:"||t.protocol==="wss:")t.protocol=t.protocol==="wss:"?"https:":"http:";if(t.protocol!=="http:"&&t.protocol!=="https:")throw Error(`Invalid tail base URL protocol: ${t.protocol}. Expected http:, https:, ws:, or wss:.`);return t.pathname="/v1/tail",t.search="",t.hash="",t},_8e=(e)=>{if(!e)return;let t=Object.entries(e).filter(([,n])=>n!==void 0&&(!Array.isArray(n)||n.length>0)&&(typeof n!=="object"||Array.isArray(n)||n===null||Object.keys(n).length>0)&&n!=="");if(t.length===0)return;return JSON.stringify(Object.fromEntries(t))},D8e=(e,t)=>{let n=(t??b8e).replace("{region}",e),r=n.endsWith("/")?n.slice(0,-1):n,o=L8e(r);if(o)return o;let i=r.match(/^https:\/\/([a-z0-9-]+)\.intake\.([a-z0-9.]+)$/);return`${i?`https://otlp.${i[1]}.intake.${i[2]}`:r}/v1/logs`},L8e=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)return;if(!hhe(t.hostname))return;return t.pathname="/adapters/otlp",t.toString()},Q8e=(e,t)=>{let n=e.resourceLogs;if(!n||n.length===0)return{...e,resourceLogs:[{resource:{attributes:[fhe(t)]},scopeLogs:[]}]};return{...e,resourceLogs:n.map((r)=>({...r,resource:{...r.resource,attributes:N8e(r.resource?.attributes,t)}}))}},N8e=(e,t)=>[...(e??[]).filter((r)=>r?.key!==mhe),fhe(t)],fhe=(e)=>({key:mhe,value:{stringValue:e}}),M8e=(e)=>{if(!e?.secret)return{};return{[C8e]:e.secret,...e.source?{[v8e]:e.source}:{}}},z8e=async(e,t,n)=>{let r=t??await e.getProjectId?.();if(r)return r;throw Ihe(n,"Project ID is required",["projectId"])},j8e=async(e,t,n,r,o)=>r??await yhe(e,t,n),U8e=async(e,t,n,r,o)=>{if(r)return r;if(!n)throw Ihe(o,"Project ID is required",["projectId"]);return yhe(e,t,n)},yhe=async(e,t,n)=>{let r=t.get(n);if(r)return r;let o=e.raw.projects.get({projectId:n}).then((i)=>i.project.region);t.set(n,o);try{return await o}catch(i){throw t.delete(n),i}},F8e=async(e)=>{let t=[],n=[],r=!1,o=!1,i,s=0,c,l,u=(S)=>{if(r)return;r=!0,i=S;while(n.length>0){let v=n.shift();if(v)v({value:void 0,done:!0})}},d=(S)=>{let v=n.shift();if(v){v({value:S,done:!1});return}t.push(S)},p=()=>{l?.abort()},g=(S)=>{if(S.event!=="log"){if(S.id)c=S.id;return}let v=V8e(S.data);for(let R of v)d(R);if(S.id)c=S.id},m=async(S)=>{let v=!1;while(!r&&!o){let R=new AbortController,O=()=>R.abort();l=R;let K=!1;e.signal?.addEventListener("abort",O,{once:!0});try{let M=await e.fetch($8e(e.url,c),{method:"GET",headers:{accept:"text/event-stream",authorization:`Bearer ${e.token}`},signal:R.signal});await G8e(M),s=0,v=!0,S(),await q8e(M,g),K=!0}catch(M){if(phe(M)||e.signal?.aborted)break;let le=dhe(M);if(!v||K8e(le))throw le;K=!0}finally{if(e.signal?.removeEventListener("abort",O),l===R)l=void 0}if(r||o||e.signal?.aborted)break;if(!K)continue;s+=1,await bhe(Math.min(ghe*2**(s-1),S8e),e.signal)}};if(e.signal?.addEventListener("abort",()=>{o=!0,p(),u()},{once:!0}),e.signal?.aborted)o=!0,p(),u();await new Promise((S,v)=>{let R=!1;m(()=>{if(!R)R=!0,S()}).catch((K)=>{let M=dhe(K);if(!R){R=!0,v(M);return}if(!phe(K))u(M)})});let f={[Symbol.asyncIterator](){return f},next:async()=>{if(t.length>0)return{value:t.shift(),done:!1};if(r){if(i)throw i;return{value:void 0,done:!0}}return new Promise((S)=>{n.push(S)}).then((S)=>{if(S.done&&i)throw i;return S})},return:async()=>(o=!0,p(),u(),{value:void 0,done:!0}),throw:async(S)=>{throw o=!0,p(),u(S instanceof Error?S:Error(String(S))),S}};return f},$8e=(e,t)=>{if(!t)return e;let n=new URL(e);return n.searchParams.set("cursor",t),n.toString()},G8e=async(e)=>{if(e.ok&&e.body)return;let t=await e.text();if(e.status===401)throw Error("Authentication failed. Check your credential.");if(e.status===403){if(/not served by this region/i.test(t))throw Error(`Wrong region (403): ${t||"Project is not served by this region"}`);throw Error(`Forbidden (403): ${t||"Credential may not have access to this project"}`)}if(e.status>=400&&e.status<500&&e.status!==429)throw Error(`Client error (${e.status}): ${t}`);if(!e.body)throw Error("Tail stream response did not include a body.");throw Error(e.status===429?`Rate limited (429): ${t}`:`Server error (${e.status}): ${t}`)},q8e=async(e,t)=>{let n=e.body?.getReader();if(!n)throw Error("Tail stream response did not include a body.");let r=new TextDecoder,o="",i=H8e(t);try{while(!0){let s=await n.read();if(s.done)break;o+=r.decode(s.value,{stream:!0});let c=o.split(/\r\n|\r|\n/);o=c.pop()??"";for(let l of c)i.line(l)}if(o+=r.decode(),o){let s=o.split(/\r\n|\r|\n/);for(let c of s)i.line(c)}i.flush()}finally{n.releaseLock()}},H8e=(e)=>{let t="message",n,r=[],o=()=>{t="message",n=void 0,r=[]},i=()=>{if(r.length===0&&!n){o();return}e({event:t,data:r.join(`
|
|
8913
8913
|
`),...n?{id:n}:{}}),o()};return{line:(s)=>{if(s===""){i();return}if(s.startsWith(":"))return;let c=s.indexOf(":"),l=c===-1?s:s.slice(0,c),u=c===-1?"":s.slice(c+1),d=u.startsWith(" ")?u.slice(1):u;if(l==="event"){t=d||"message";return}if(l==="data"){r.push(d);return}if(l==="id"&&!d.includes("\x00"))n=d},flush:i}},V8e=(e)=>{try{let t=lhe.safeParse(JSON.parse(e));if(!t.success)return[];return t.data.data}catch{return[]}},dhe=(e)=>e instanceof Error?e:Error(String(e)),phe=(e)=>e instanceof Error&&e.name==="AbortError",K8e=(e)=>e.message.startsWith("Authentication failed")||e.message.startsWith("Forbidden (")||e.message.startsWith("Wrong region (")||e.message.startsWith("Client error ("),Y8e=async(e,t,n,r={},o=3,i=1e4)=>{let s;for(let c=0;c<=o;c+=1){let l=new AbortController,u=globalThis.setTimeout(()=>l.abort(),i);try{let d=await e(t,{method:"POST",headers:{"content-type":"application/json",...r},body:JSON.stringify(n),signal:l.signal});if(d.ok)return;let p=await d.text();if(d.status===401||d.status===403)throw Error("Authentication failed. Check your public key.");if(d.status>=400&&d.status<500&&d.status!==429)throw Error(`Client error (${d.status}): ${p}`);s=Error(d.status===429?`Rate limited (429): ${p}`:`Server error (${d.status}): ${p}`)}catch(d){let p=d instanceof Error?d.message:String(d);if(p.startsWith("Authentication failed")||p.startsWith("Client error ("))throw d instanceof Error?d:Error(p);s=d instanceof Error&&d.name==="AbortError"?Error("Request timed out"):d instanceof Error?d:Error(String(d))}finally{globalThis.clearTimeout(u)}if(c<o)await bhe(ghe*2**c)}throw Error(`Failed after ${o+1} attempts: ${s?.message??"Unknown error"}`)},W8e=(e)=>e.resourceLogs?.reduce((t,n)=>t+(n.scopeLogs?.reduce((r,o)=>r+(o.logRecords?.length??0),0)??0),0)??0,bhe=async(e,t)=>{if(t?.aborted)return;await new Promise((n)=>{let r=globalThis.setTimeout(n,e);t?.addEventListener("abort",()=>{globalThis.clearTimeout(r),n()},{once:!0})})},Ihe=(e,t,n)=>new en("BAD_REQUEST",{message:t,data:{operationId:e,missingContext:n}});var AM=h(()=>{sc();uhe();Oe();E8e=a.object({projectId:a.string().uuid().optional().describe("Project to tail logs for. Auto-filled from CLI and SDK context when omitted."),filters:gM.optional().describe("Optional filters applied by the tail SSE service.")}),k8e=a.object({publicKey:a.string().min(1).describe("Public key for intake auth. Create or list one via the public key endpoints."),logs:a.custom((e)=>typeof e==="object"&&e!==null).describe("OTLP logs export request payload to send to the intake service.")}),x8e=a.object({forwardedCount:a.number().int().nonnegative().describe("Number of log records accepted by the intake request."),failedCount:a.number().int().nonnegative().describe("Number of log records rejected by the intake request.")}),R8e=new Set(["15006","3010"])});var fM="https://api.sazabi.com",vhe="https://api.platform.sazabi.com",whe="sazabi-cli",J8e="urn:ietf:params:oauth:grant-type:device_code",Ehe=(e)=>{let t=NC(new WC(pM,{url:Z8e(e.apiBaseUrl??fM),headers:async()=>{let o=new Headers({authorization:`Bearer ${await e.credentialProvider.getToken()}`});if(e.clientSource)o.set("x-sazabi-client-source",e.clientSource);if(e.sandboxActorDescriptor)o.set("x-sazabi-sandbox-actor",e.sandboxActorDescriptor);return o},fetch:e.fetch,customErrorResponseBodyDecoder:(o,i)=>{let s=i7e(o);if(!s)return null;return new en(s.code,{message:s.message,status:i.status,data:{operationId:s.operationId,missingContext:s.missingContext,...s.reason!==void 0?{reason:s.reason}:{},...s.retryAfterSeconds!==void 0?{retryAfterSeconds:s.retryAfterSeconds}:{}}})}})),n=Ahe({raw:t,credentialProvider:e.credentialProvider,fetch:e.fetch,apiBaseUrl:e.apiBaseUrl??fM,intakeBaseUrl:e.intakeBaseUrl,tailBaseUrl:e.tailBaseUrl}),r=ahe({credentialProvider:e.credentialProvider,fetch:e.fetch,apiBaseUrl:e.apiBaseUrl??fM,clientSource:e.clientSource});return{raw:t,me:async()=>t.me({}),automations:{list:async(o={})=>t.automations.list(await ne(e.credentialProvider,o,"automations.list")),get:async(o)=>t.automations.get(await ne(e.credentialProvider,o,"automations.get")),create:async(o)=>t.automations.create(await ne(e.credentialProvider,o,"automations.create")),update:async(o)=>t.automations.update(await ne(e.credentialProvider,o,"automations.update")),enable:async(o)=>t.automations.enable(await ne(e.credentialProvider,o,"automations.enable")),disable:async(o)=>t.automations.disable(await ne(e.credentialProvider,o,"automations.disable")),runs:{list:async(o)=>t.automations.runs.list(await ne(e.credentialProvider,o,"automations.runs.list")),get:async(o)=>t.automations.runs.get(await ne(e.credentialProvider,o,"automations.runs.get")),logs:async(o)=>t.automations.runs.logs(await ne(e.credentialProvider,o,"automations.runs.logs"))}},logs:{...n,query:async(o={})=>t.logs.query(await ne(e.credentialProvider,o,Wc.operationId)),search:async(o)=>t.logs.search(await ne(e.credentialProvider,o,Jc.operationId)),schema:async(o={})=>t.logs.schema(await ne(e.credentialProvider,o,Zc.operationId)),volume:async(o)=>t.logs.volume(await ne(e.credentialProvider,o,Xc.operationId)),patterns:async(o={})=>t.logs.patterns(await ne(e.credentialProvider,o,el.operationId)),nativeQuery:async(o)=>t.logs.nativeQuery(await ne(e.credentialProvider,o,tl.operationId))},onboarding:{getState:async(o={})=>t.onboarding.getState(await She(e.credentialProvider,await e7e(e.credentialProvider,o))),skipSampleIssue:async(o)=>t.onboarding.skipSampleIssue(await She(e.credentialProvider,o??{})),finish:async(o)=>t.onboarding.finish(o)},organizations:{list:async()=>t.organizations.list({}),get:async(o)=>t.organizations.get(o),create:async(o)=>t.organizations.create(o),update:async(o)=>t.organizations.update(await Ce(e.credentialProvider,o,"organizations.update"))},members:{list:async(o={})=>t.members.list(await Ce(e.credentialProvider,o,"members.list")),updateRole:async(o)=>t.members.updateRole(await Ce(e.credentialProvider,o,"members.updateRole")),remove:async(o)=>{let i=await Ce(e.credentialProvider,o,"members.remove");return t.members.remove({params:{member:i.member},query:{organizationId:i.organizationId}})},invite:async(o)=>t.members.invite(await Ce(e.credentialProvider,o,"members.invite")),listInvitations:async(o={})=>t.members.listInvitations(await Ce(e.credentialProvider,o,"members.listInvitations")),revokeInvitation:async(o)=>{let i=await Ce(e.credentialProvider,o,"members.revokeInvitation");return t.members.revokeInvitation({params:{invitationId:i.invitationId},query:{organizationId:i.organizationId}})}},teams:{list:async(o={})=>t.teams.list(await Ce(e.credentialProvider,o,"teams.list")),create:async(o)=>t.teams.create(await Ce(e.credentialProvider,o,"teams.create")),update:async(o)=>t.teams.update(await Ce(e.credentialProvider,o,"teams.update")),delete:async(o)=>{let i=await Ce(e.credentialProvider,o,"teams.delete");return t.teams.delete({params:{teamId:i.teamId},query:{organizationId:i.organizationId}})},addMember:async(o)=>t.teams.addMember(await Ce(e.credentialProvider,o,"teams.addMember")),removeMember:async(o)=>{let i=await Ce(e.credentialProvider,o,"teams.removeMember");return t.teams.removeMember({params:{teamId:i.teamId,userId:i.userId},query:{organizationId:i.organizationId}})},listMembers:async(o)=>t.teams.listMembers(await Ce(e.credentialProvider,o,"teams.listMembers"))},publicKeys:{list:async(o={})=>t.publicKeys.list(await ne(e.credentialProvider,o,Uc.operationId)),get:async(o)=>t.publicKeys.get(await ne(e.credentialProvider,o,Fc.operationId)),ensureLogForwarding:async(o={})=>t.publicKeys.ensureLogForwarding(await ne(e.credentialProvider,o,$c.operationId)),update:async(o)=>t.publicKeys.update(await ne(e.credentialProvider,o,Gc.operationId)),deactivate:async(o)=>{let i=await ne(e.credentialProvider,o,qc.operationId);return t.publicKeys.deactivate({params:{keyId:i.keyId},query:{projectId:i.projectId}})}},secretKeys:{list:async(o={})=>t.secretKeys.list(await Ce(e.credentialProvider,o,"secretKeys.list")),get:async(o)=>t.secretKeys.get(await Ce(e.credentialProvider,o,"secretKeys.get")),create:async(o)=>t.secretKeys.create(await Ce(e.credentialProvider,o,"secretKeys.create")),update:async(o)=>t.secretKeys.update(await Ce(e.credentialProvider,o,"secretKeys.update")),delete:async(o)=>{let{organizationId:i}=await Ce(e.credentialProvider,o,"secretKeys.delete");await t.secretKeys.delete({params:{keyId:o.keyId},query:{organizationId:i}})}},search:{threads:async(o)=>t.search.threads(await ne(e.credentialProvider,o,$u.operationId)),messages:async(o)=>t.search.messages(await ne(e.credentialProvider,o,Gu.operationId))},projects:{list:async(o={})=>t.projects.list(await X8e(e.credentialProvider,o)),get:async(o)=>t.projects.get(o),create:async(o)=>t.projects.create(await Ce(e.credentialProvider,o,"projects.create"))},messages:{list:async(o)=>t.messages.list(o),append:async(o)=>Che(t,await t.messages.append(r7e(o)))},threads:{list:async(o={})=>t.threads.list(await t7e(e.credentialProvider,o)),get:async(o)=>t.threads.get(o),getStatus:async(o)=>t.threads.getStatus(o),stop:async(o)=>t.threads.stop(o),create:async(o)=>Che(t,await t.threads.create(await o7e(e.credentialProvider,o))),update:async(o)=>t.threads.update(o),fork:async(o)=>t.threads.fork(o),setVisibility:async(o)=>t.threads.setVisibility(o),createShareLink:async(o)=>t.threads.createShareLink(o),listShareLinks:async(o)=>t.threads.listShareLinks(o),revokeShareLink:async(o)=>t.threads.revokeShareLink(o),stream:async(o)=>r.streamThread(o)},runs:{list:async(o={})=>t.runs.list(await n7e(e.credentialProvider,o)),listForThread:async(o)=>t.runs.listForThread(o),get:async(o)=>t.runs.get(o),cancel:async(o)=>t.runs.cancel(o),stream:async(o)=>r.streamRun(o)},logSources:{listProviders:async()=>t.logSources.listProviders({}),list:async(o={})=>t.logSources.list(await ne(e.credentialProvider,o,Vc.operationId)),get:async(o)=>t.logSources.get(o),create:async(o)=>t.logSources.create(await ne(e.credentialProvider,o,Kc.operationId)),update:async(o)=>t.logSources.update(o),delete:async(o)=>t.logSources.delete(o)},logStreams:{list:async(o)=>t.logStreams.list(o),get:async(o)=>t.logStreams.get(o),create:async(o)=>t.logStreams.create(o),update:async(o)=>t.logStreams.update(o),delete:async(o)=>t.logStreams.delete(o),reassign:async(o)=>t.logStreams.reassign(o)},connectedAccounts:{beginConnect:async(o)=>t.connectedAccounts.beginConnect(await Ce(e.credentialProvider,o,"connectedAccounts.beginConnect")),getConnectAttempt:async(o)=>t.connectedAccounts.getConnectAttempt(await Ce(e.credentialProvider,o,"connectedAccounts.getConnectAttempt")),list:async(o={})=>t.connectedAccounts.list(await Ce(e.credentialProvider,o,"connectedAccounts.list")),disconnect:async(o)=>t.connectedAccounts.disconnect(await Ce(e.credentialProvider,o,"connectedAccounts.disconnect"))},integrations:{listProviders:async(o={})=>t.integrations.listProviders(await Ce(e.credentialProvider,o,"integrations.listProviders")),listConnections:async(o={})=>t.integrations.listConnections(await Ce(e.credentialProvider,o,"integrations.listConnections")),getConnection:async(o)=>t.integrations.getConnection(await Ce(e.credentialProvider,o,"integrations.getConnection")),createConnection:async(o)=>t.integrations.createConnection(await Ce(e.credentialProvider,o,"integrations.createConnection")),beginConnect:async(o)=>t.integrations.beginConnect(await Ce(e.credentialProvider,o,"integrations.beginConnect")),getConnectAttempt:async(o)=>t.integrations.getConnectAttempt(await Ce(e.credentialProvider,o,"integrations.getConnectAttempt")),disconnectConnection:async(o)=>t.integrations.disconnectConnection(await Ce(e.credentialProvider,o,"integrations.disconnectConnection")),updateConnectionCredentials:async(o)=>t.integrations.updateConnectionCredentials(await Ce(e.credentialProvider,o,"integrations.updateConnectionCredentials"))},mcpConnectors:{list:async(o={})=>t.mcpConnectors.list(await ne(e.credentialProvider,o,Iu.operationId)),get:async(o)=>t.mcpConnectors.get(await ne(e.credentialProvider,o,Su.operationId)),details:async(o)=>t.mcpConnectors.details(await ne(e.credentialProvider,o,Cu.operationId)),listProviders:async()=>t.mcpConnectors.listProviders({}),search:async(o={})=>t.mcpConnectors.search(await ne(e.credentialProvider,o,vu.operationId)),describe:async(o)=>t.mcpConnectors.describe(await ne(e.credentialProvider,o,wu.operationId)),call:async(o)=>t.mcpConnectors.call(await ne(e.credentialProvider,o,Eu.operationId)),create:async(o)=>t.mcpConnectors.create(await ne(e.credentialProvider,o,ku.operationId)),update:async(o)=>t.mcpConnectors.update(await ne(e.credentialProvider,o,xu.operationId)),disconnect:async(o)=>{await t.mcpConnectors.disconnect(await ne(e.credentialProvider,o,Pu.operationId))},setReadOnly:async(o)=>t.mcpConnectors.setReadOnly(await ne(e.credentialProvider,o,Ru.operationId)),beginOAuthInstall:async(o)=>t.mcpConnectors.beginOAuthInstall(await ne(e.credentialProvider,o,Tu.operationId)),getOAuthInstallAttempt:async(o)=>t.mcpConnectors.getOAuthInstallAttempt(await ne(e.credentialProvider,o,Bu.operationId))},sandboxPresets:{delete:async(o)=>t.sandboxPresets.deletePreset(await ne(e.credentialProvider,o,Uu.operationId)),listConnections:async(o={})=>t.sandboxPresets.listConnections(await ne(e.credentialProvider,o,zu.operationId)),listTypes:async()=>t.sandboxPresets.listTypes({}),test:async(o)=>t.sandboxPresets.testPreset(await ne(e.credentialProvider,o,Fu.operationId)),upsert:async(o)=>t.sandboxPresets.upsertPreset(await ne(e.credentialProvider,o,ju.operationId))},memory:{list:async(o={})=>t.memory.list(await ne(e.credentialProvider,o,Du.operationId)),get:async(o)=>t.memory.get(await ne(e.credentialProvider,o,_u.operationId)),put:async(o)=>t.memory.put(await ne(e.credentialProvider,o,Ou.operationId)),search:async(o)=>t.memory.search(await ne(e.credentialProvider,o,Lu.operationId)),delete:async(o)=>t.memory.delete(await ne(e.credentialProvider,o,Qu.operationId))},signalDefinitions:{list:async(o={})=>t.signalDefinitions.list(await ne(e.credentialProvider,o,"signalDefinitions.list")),get:async(o)=>t.signalDefinitions.get(await ne(e.credentialProvider,o,"signalDefinitions.get")),create:async(o)=>t.signalDefinitions.create(await ne(e.credentialProvider,o,"signalDefinitions.create")),update:async(o)=>t.signalDefinitions.update(await ne(e.credentialProvider,o,"signalDefinitions.update")),disable:async(o)=>t.signalDefinitions.disable(await ne(e.credentialProvider,o,"signalDefinitions.disable"))},scripts:{list:async(o={})=>t.scripts.list(await ne(e.credentialProvider,o,"scripts.list")),get:async(o)=>t.scripts.get(await ne(e.credentialProvider,o,"scripts.get")),create:async(o)=>t.scripts.create(await ne(e.credentialProvider,o,"scripts.create")),update:async(o)=>t.scripts.update(await ne(e.credentialProvider,o,"scripts.update")),delete:async(o)=>t.scripts.delete(await ne(e.credentialProvider,o,"scripts.delete"))},issues:{count:async(o={})=>t.issues.count(await ne(e.credentialProvider,o,"issues.count")),create:async(o)=>t.issues.create(await ne(e.credentialProvider,o,jc.operationId)),list:async(o={})=>t.issues.list(await ne(e.credentialProvider,o,"issues.list")),search:async(o={})=>t.issues.search(await ne(e.credentialProvider,o,"issues.search")),get:async(o)=>t.issues.get(o),resolve:async(o)=>t.issues.resolve(o),ignore:async(o)=>t.issues.ignore(o),reopen:async(o)=>t.issues.reopen(o),mute:async(o)=>t.issues.mute(o),unmute:async(o)=>t.issues.unmute(o)},workItems:{create:async(o)=>t.workItems.create(await Ce(e.credentialProvider,o,"work-items.create")),comment:async(o)=>t.workItems.comment(await Ce(e.credentialProvider,o,"work-items.comment")),transition:async(o)=>t.workItems.transition(await Ce(e.credentialProvider,o,"work-items.transition"))},pullRequests:{list:async(o={})=>t.pullRequests.list(await ne(e.credentialProvider,o,"pullRequests.list"))},components:{list:async(o={})=>t.components.list(await ne(e.credentialProvider,o,"components.list")),get:async(o)=>t.components.get(o),register:async(o)=>t.components.register(await ne(e.credentialProvider,o,zc.operationId)),deregister:async(o)=>t.components.deregister(o),rename:async(o)=>t.components.rename(o),assignTeam:async(o)=>t.components.assignTeam(o),reactivationPreview:async(o)=>t.components.reactivationPreview(o),reactivate:async(o)=>t.components.reactivate(o),mergePreview:async(o)=>t.components.mergePreview(await ne(e.credentialProvider,o,"components.mergePreview")),merge:async(o)=>t.components.merge(await ne(e.credentialProvider,o,"components.merge")),relationships:{list:async(o={})=>t.components.relationships.list(await ne(e.credentialProvider,o,"components.relationships.list")),preview:async(o)=>t.components.relationships.preview(await ne(e.credentialProvider,o,"components.relationships.preview")),add:async(o)=>t.components.relationships.add(await ne(e.credentialProvider,o,"components.relationships.add")),remove:async(o)=>t.components.relationships.remove(await ne(e.credentialProvider,o,"components.relationships.remove"))},incidents:{list:async(o={})=>t.components.incidents.list(await ne(e.credentialProvider,o,"components.incidents.list"))},timeline:async(o)=>t.components.timeline(o)},billing:{getSummary:async(o={})=>t.billing.getSummary(await Ce(e.credentialProvider,o,"billing.getSummary")),getUsage:async(o={})=>t.billing.getUsage(await Ce(e.credentialProvider,o,"billing.getUsage")),getAccruedUsageCharges:async(o={})=>t.billing.getAccruedUsageCharges(await Ce(e.credentialProvider,o,"billing.getAccruedUsageCharges")),listUsageInvoices:async(o={})=>t.billing.listUsageInvoices(await Ce(e.credentialProvider,o,"billing.listUsageInvoices")),listTransactions:async(o={})=>t.billing.listTransactions(await Ce(e.credentialProvider,o,"billing.listTransactions")),previewSubscriptionCancellation:async(o={})=>t.billing.previewSubscriptionCancellation(await Ce(e.credentialProvider,o,"billing.previewSubscriptionCancellation")),scheduleSubscriptionCancellation:async(o={})=>t.billing.scheduleSubscriptionCancellation(await Ce(e.credentialProvider,o,"billing.scheduleSubscriptionCancellation")),resumeSubscriptionCancellation:async(o={})=>t.billing.resumeSubscriptionCancellation(await Ce(e.credentialProvider,o,"billing.resumeSubscriptionCancellation")),getAutoTopUp:async(o={})=>t.billing.getAutoTopUp(await Ce(e.credentialProvider,o,"billing.getAutoTopUp")),updateAutoTopUp:async(o)=>t.billing.updateAutoTopUp(await Ce(e.credentialProvider,o,"billing.updateAutoTopUp")),purchaseCredits:async(o)=>t.billing.purchaseCredits(await Ce(e.credentialProvider,o,"billing.purchaseCredits")),listPlans:async(o={})=>t.billing.listPlans(await Ce(e.credentialProvider,o,"billing.listPlans")),previewPlanChange:async(o)=>t.billing.previewPlanChange(await Ce(e.credentialProvider,o,"billing.previewPlanChange")),changePlan:async(o)=>t.billing.changePlan(await Ce(e.credentialProvider,o,"billing.changePlan")),createCheckoutSession:async(o)=>t.billing.createCheckoutSession(await Ce(e.credentialProvider,o,"billing.createCheckoutSession")),getCheckoutSessionStatus:async(o)=>t.billing.getCheckoutSessionStatus(await Ce(e.credentialProvider,o,"billing.getCheckoutSessionStatus")),createPortalSession:async(o={})=>t.billing.createPortalSession(await Ce(e.credentialProvider,o,"billing.createPortalSession")),getPaymentMethod:async(o={})=>t.billing.getPaymentMethod(await Ce(e.credentialProvider,o,"billing.getPaymentMethod"))},tasks:{list:async(o={})=>t.tasks.list(await ne(e.credentialProvider,o,km.operationId))},recommendations:{list:async(o={})=>t.recommendations.list(await ne(e.credentialProvider,o,Sm.operationId))},repos:{list:async(o={})=>t.repos.list(await ne(e.credentialProvider,o,Cm.operationId)),add:async(o)=>t.repos.add(await ne(e.credentialProvider,o,vm.operationId)),remove:async(o)=>t.repos.remove(await ne(e.credentialProvider,o,wm.operationId))},notificationDeliveryRules:{list:async(o={})=>t.notificationDeliveryRules.list(await ne(e.credentialProvider,o,"notificationDeliveryRules.list")),options:async(o={})=>t.notificationDeliveryRules.options(await ne(e.credentialProvider,o,"notificationDeliveryRules.options")),create:async(o)=>t.notificationDeliveryRules.create(await ne(e.credentialProvider,o,"notificationDeliveryRules.create")),update:async(o)=>t.notificationDeliveryRules.update(await ne(e.credentialProvider,o,"notificationDeliveryRules.update")),delete:async(o)=>t.notificationDeliveryRules.delete(await ne(e.credentialProvider,o,"notificationDeliveryRules.delete"))},notificationChannels:{getProject:async(o={})=>t.notificationChannels.getProject(await ne(e.credentialProvider,o,"notificationChannels.getProject"))}}},bM=async(e={})=>{let t=await Phe(e.fetch)(khe(e.apiBaseUrl??vhe,"/device/code"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:e.clientId??whe,...e.scope?{scope:e.scope}:{}})}),n=await t.json();if(!t.ok)throw s7e(n,t.status);let r=n;return{deviceCode:qu(r.device_code,"device_code"),userCode:qu(r.user_code,"user_code"),verificationUri:qu(r.verification_uri,"verification_uri"),verificationUriComplete:qu(r.verification_uri_complete,"verification_uri_complete"),expiresIn:yM(r.expires_in,"expires_in"),interval:yM(r.interval,"interval")}},IM=async(e)=>{let t=await Phe(e.fetch)(khe(e.apiBaseUrl??vhe,"/device/token"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:J8e,device_code:e.deviceCode,client_id:e.clientId??whe})}),n=await t.json();if(t.ok){let o=n;return{status:"authorized",accessToken:qu(o.access_token,"access_token"),tokenType:qu(o.token_type,"token_type"),expiresIn:yM(o.expires_in,"expires_in"),scope:typeof o.scope==="string"?o.scope:""}}let r=xhe(n);if(!r)throw Error(`Device authorization failed with status ${t.status}`);if(r.error==="authorization_pending")return{status:"pending"};if(r.error==="slow_down")return{status:"pending",interval:10};if(r.error==="access_denied")return{status:"denied",message:r.errorDescription};if(r.error==="expired_token"||r.error==="invalid_grant")return{status:"expired",message:r.errorDescription};throw Error(r.errorDescription)},Z8e=(e)=>{let t=e.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},khe=(e,t)=>`${e.replace(/\/+$/,"")}/api/auth${t}`,X8e=async(e,t)=>Ce(e,t,"projects.list"),She=async(e,t)=>{let n=t.organizationId??await e.getOrganizationId?.();return n?{...t,organizationId:n}:t},Ce=async(e,t,n)=>{let r=t.organizationId??await e.getOrganizationId?.();if(!r)throw new en("BAD_REQUEST",{message:"Organization ID is required",data:{operationId:n,missingContext:["organizationId"]},status:400});return{...t,organizationId:r}},e7e=async(e,t)=>{let n=t.projectId??await e.getProjectId?.();return n?{...t,projectId:n}:t},ne=async(e,t,n)=>{let r=t.projectId??await e.getProjectId?.();if(!r)throw new en("BAD_REQUEST",{message:"Project ID is required",data:{operationId:n,missingContext:["projectId"]},status:400});return{...t,projectId:r}},t7e=async(e,t)=>{let n=t.projectId??await e.getProjectId?.();return n?{...t,projectId:n}:t},n7e=async(e,t)=>{let n=t.projectId??await e.getProjectId?.();return n?{...t,projectId:n}:t},o7e=async(e,t)=>{let n=t.projectId??await e.getProjectId?.();return n?{...t,projectId:n}:t},r7e=(e)=>({threadId:e.threadId,message:e.message,wait:e.wait??!0,timeoutSeconds:e.timeoutSeconds??20,...e.automationId!==void 0?{automationId:e.automationId}:{}}),i7e=(e)=>{if(!e||typeof e!=="object")return null;let t=e;if(typeof t.code!=="string"||typeof t.message!=="string"||typeof t.operationId!=="string")return null;return{code:t.code,message:t.message,operationId:t.operationId,missingContext:Array.isArray(t.missingContext)?t.missingContext.filter((n)=>typeof n==="string"):[],...typeof t.reason==="string"?{reason:t.reason}:{},...typeof t.retryAfterSeconds==="number"?{retryAfterSeconds:t.retryAfterSeconds}:{}}},xhe=(e)=>{if(!e||typeof e!=="object")return null;let t=e;if(typeof t.error!=="string"||typeof t.error_description!=="string")return null;return{error:t.error,errorDescription:t.error_description}},s7e=(e,t)=>{let n=xhe(e);return Error(n?.errorDescription??`Device authorization failed with status ${t}`)},Phe=(e)=>e??globalThis.fetch,Che=(e,t)=>({result:t,poll:()=>e.runs.get({runId:t.runId}),waitForCompletion:async(n={})=>a7e(e,t,n)}),a7e=async(e,t,n)=>{if(t.completed)return t;let r=n.intervalMs??2000,o=Date.now(),i=t;while(!i.completed){if(n.timeoutMs!==void 0&&Date.now()-o>=n.timeoutMs)return i;await c7e(r),i=await e.runs.get({runId:i.runId})}return i},c7e=async(e)=>{await new Promise((t)=>globalThis.setTimeout(t,e))},qu=(e,t)=>{if(typeof e==="string")return e;throw Error(`Expected '${t}' to be a string.`)},yM=(e,t)=>{if(typeof e==="number")return e;throw Error(`Expected '${t}' to be a number.`)};var SM=h(()=>{sc();$j();Ha();che();AM();AM()});var Ct=(e)=>({success:!0,value:e}),ft=(e,t,n)=>({success:!1,error:e,...t!==void 0&&{statusCode:t},...n!==void 0&&{errorPayload:n}}),l7e=(e)=>{if(e===void 0)return"NETWORK_ERROR";if(e===401)return"UNAUTHORIZED";if(e===403)return"FORBIDDEN";if(e===404)return"NOT_FOUND";if(e===429)return"TOO_MANY_REQUESTS";if(e>=500)return"SERVER_ERROR";return"REQUEST_FAILED"},I=(e,t,n)=>{if(!e.success){let r=`${t}: ${e.error}`;if(n)return b(e.errorPayload??{code:l7e(e.statusCode),message:r,operationId:null});return y(r)}return e.value};var ce=h(()=>{oe()});var u7e="https://api.sazabi.com",CM,d7e=30,p7e=(e)=>new Promise((t)=>setTimeout(t,e)),P=async(e)=>{for(let t=0;;t+=1)try{return Ct(await e())}catch(n){let r=g7e(n),o=m7e(n),i=r?.retryAfterSeconds;if(o===429&&t===0&&i!==void 0&&i<=d7e&&process.env.SAZABI_NO_RETRY!=="1"){process.stderr.write(`Rate limited; retrying in ~${i}s…
|
|
8914
8914
|
`),await p7e(i*1000);continue}let s=n instanceof Error?n.message:String(n);if(i!==void 0)s+=` Retry in ~${i}s.`;return ft(s,o,r)}},g7e=(e)=>{if(!e||typeof e!=="object")return;let t=e;if(typeof t.code!=="string"||typeof t.message!=="string"||!t.data||typeof t.data!=="object")return;let n=t.data;if(typeof n.operationId!=="string")return;return{code:t.code,message:t.message,operationId:n.operationId,...typeof n.reason==="string"?{reason:n.reason}:{},...typeof n.retryAfterSeconds==="number"?{retryAfterSeconds:n.retryAfterSeconds}:{},...Array.isArray(n.missingContext)?{missingContext:n.missingContext.filter((r)=>typeof r==="string")}:{}}},m7e=(e)=>{if(!e||typeof e!=="object")return;let t=e;return typeof t.status==="number"?t.status:void 0},gi=(e)=>{let t=Ehe({apiBaseUrl:e.baseUrl??u7e,clientSource:"cli",sandboxActorDescriptor:e.sandboxActorDescriptor,credentialProvider:{getToken:()=>e.token,getOrganizationId:()=>e.organizationId,getProjectId:()=>e.projectId},intakeBaseUrl:e.intakeBaseUrl,tailBaseUrl:e.tailBaseUrl});return{me:()=>{let n=`${e.token}::${e.baseUrl??""}`,r=CM.get(n);if(r)return r;let o=P(()=>t.me()).then((i)=>{if(!i.success)CM.delete(n);return i});return CM.set(n,o),o},automations:{list:(n={})=>P(()=>t.automations.list(n)),get:(n)=>P(()=>t.automations.get({automationId:n})),create:(n)=>P(()=>t.automations.create(n)),update:(n)=>P(()=>t.automations.update(n)),enable:(n)=>P(()=>t.automations.enable({automationId:n})),disable:(n)=>P(()=>t.automations.disable({automationId:n})),runs:{list:(n,r={})=>P(()=>t.automations.runs.list({automationId:n,...r})),get:(n,r)=>P(()=>t.automations.runs.get({automationId:n,runId:r})),logs:(n,r)=>P(()=>t.automations.runs.logs({automationId:n,runId:r}))}},logs:{tail:(n)=>P(()=>t.logs.tail(n)),forward:(n)=>P(()=>t.logs.forward(n)),query:(n={})=>P(()=>t.logs.query(n)),search:(n)=>P(()=>t.logs.search(n)),schema:(n={})=>P(()=>t.logs.schema(n)),volume:(n)=>P(()=>t.logs.volume(n)),patterns:(n={})=>P(()=>t.logs.patterns(n)),nativeQuery:(n)=>P(()=>t.logs.nativeQuery(n))},organizations:{list:()=>P(()=>t.organizations.list()),get:(n)=>P(()=>t.organizations.get({organizationId:n})),create:(n)=>P(()=>t.organizations.create({name:n})),rename:(n,r)=>P(()=>t.organizations.update({organizationId:r,name:n}))},members:{list:(n={})=>P(()=>t.members.list(n)),updateRole:(n,r,o)=>P(()=>t.members.updateRole({organizationId:o,member:n,role:r})),remove:(n,r)=>P(()=>t.members.remove({organizationId:r,member:n})),invite:(n)=>P(()=>t.members.invite({organizationId:n.organizationId,email:n.email,role:n.role})),listInvitations:(n)=>P(()=>t.members.listInvitations({organizationId:n})),revokeInvitation:(n)=>P(()=>t.members.revokeInvitation({organizationId:n.organizationId,invitationId:n.invitationId}))},teams:{list:(n={})=>P(()=>t.teams.list(n)),create:(n,r,o)=>P(()=>t.teams.create({organizationId:o,name:n,...r!==void 0?{description:r}:{}})),update:(n,r,o)=>P(()=>t.teams.update({organizationId:o,teamId:n,...r.name!==void 0?{name:r.name}:{},...r.description!==void 0?{description:r.description}:{}})),delete:(n,r)=>P(()=>t.teams.delete({organizationId:r,teamId:n})),addMember:(n,r,o)=>P(()=>t.teams.addMember({organizationId:o,teamId:n,userId:r})),removeMember:(n,r,o)=>P(()=>t.teams.removeMember({organizationId:o,teamId:n,userId:r})),listMembers:(n,r)=>P(()=>t.teams.listMembers({organizationId:r,teamId:n}))},projects:{list:(n={})=>P(()=>t.projects.list(n)),get:(n)=>P(()=>t.projects.get({projectId:n})),create:(n)=>P(()=>t.projects.create(n))},threads:{list:(n={})=>P(()=>t.threads.list(n)),get:(n)=>P(()=>t.threads.get({threadId:n})),create:(n)=>P(()=>t.threads.create(n)),getStatus:(n)=>P(()=>t.threads.getStatus({threadId:n})),update:(n,r)=>P(()=>t.threads.update({threadId:n,status:r})),fork:(n,r)=>P(()=>t.threads.fork({threadId:n,messageId:r})),setVisibility:(n,r)=>P(()=>t.threads.setVisibility({threadId:n,visibility:r})),createShareLink:(n)=>P(()=>t.threads.createShareLink({threadId:n})),listShareLinks:(n)=>P(()=>t.threads.listShareLinks({threadId:n})),revokeShareLink:(n,r)=>P(()=>t.threads.revokeShareLink({threadId:n,shareId:r})),stop:(n)=>P(()=>t.threads.stop({threadId:n})),stream:(n)=>P(()=>t.threads.stream(n))},messages:{list:(n,r={})=>P(()=>t.messages.list({threadId:n,...r})),append:(n,r,o,i,s,c)=>P(()=>t.messages.append({threadId:n,message:r,wait:o,timeoutSeconds:i,...s!==void 0?{automationId:s}:{},...c?{ambientServiceRun:c}:{}}))},runs:{get:(n)=>P(()=>t.runs.get({runId:n})),cancel:(n)=>P(()=>t.runs.cancel({runId:n})),stream:(n)=>P(()=>t.runs.stream(n))},search:{threads:(n)=>P(()=>t.search.threads(n)),messages:(n)=>P(()=>t.search.messages(n))},publicKeys:{list:(n)=>P(()=>t.publicKeys.list(n)),get:(n,r)=>P(()=>t.publicKeys.get(r?{keyId:n,projectId:r}:{keyId:n})),ensureLogForwarding:(n)=>P(()=>t.publicKeys.ensureLogForwarding(n)),update:(n)=>P(()=>t.publicKeys.update(n)),deactivate:(n)=>P(()=>t.publicKeys.deactivate(n))},secretKeys:{list:(n)=>P(()=>t.secretKeys.list(n)),get:(n)=>P(()=>t.secretKeys.get({keyId:n})),create:(n)=>P(()=>t.secretKeys.create(n)),update:(n)=>P(()=>t.secretKeys.update(n)),delete:(n)=>P(()=>t.secretKeys.delete(n))},issues:{count:(n={})=>P(()=>t.issues.count(n)),create:(n)=>P(()=>t.issues.create(n)),list:(n={})=>P(()=>t.issues.list(n)),search:(n={})=>P(()=>t.issues.search(n)),get:(n)=>P(()=>t.issues.get({issueId:n})),resolve:(n)=>P(()=>t.issues.resolve({issueId:n})),ignore:(n)=>P(()=>t.issues.ignore({issueId:n})),reopen:(n)=>P(()=>t.issues.reopen({issueId:n})),mute:(n)=>P(()=>t.issues.mute({issueId:n})),unmute:(n)=>P(()=>t.issues.unmute({issueId:n}))},pullRequests:{list:(n={})=>P(()=>t.pullRequests.list(n))},workItems:{create:(n)=>P(()=>t.workItems.create(n)),comment:(n)=>P(()=>t.workItems.comment(n)),transition:(n)=>P(()=>t.workItems.transition(n))},components:{list:(n={})=>P(()=>t.components.list(n)),get:(n)=>P(()=>t.components.get({componentId:n})),register:(n)=>P(()=>t.components.register(n)),deregister:(n)=>P(()=>t.components.deregister(n)),rename:(n)=>P(()=>t.components.rename(n)),reactivationPreview:(n)=>P(()=>t.components.reactivationPreview(n)),reactivate:(n)=>P(()=>t.components.reactivate(n)),mergePreview:(n)=>P(()=>t.components.mergePreview(n)),merge:(n)=>P(()=>t.components.merge(n)),relationships:{list:(n={})=>P(()=>t.components.relationships.list(n)),preview:(n)=>P(()=>t.components.relationships.preview(n)),add:(n)=>P(()=>t.components.relationships.add(n)),remove:(n)=>P(()=>t.components.relationships.remove(n))},incidents:{list:(n={})=>P(()=>t.components.incidents.list(n))},timeline:(n)=>P(()=>t.components.timeline(n))},billing:{getSummary:(n={})=>P(()=>t.billing.getSummary(n)),getUsage:(n={})=>P(()=>t.billing.getUsage(n)),getAccruedUsageCharges:(n={})=>P(()=>t.billing.getAccruedUsageCharges(n)),listUsageInvoices:(n={})=>P(()=>t.billing.listUsageInvoices(n)),listTransactions:(n={})=>P(()=>t.billing.listTransactions(n)),previewSubscriptionCancellation:()=>P(()=>t.billing.previewSubscriptionCancellation()),scheduleSubscriptionCancellation:()=>P(()=>t.billing.scheduleSubscriptionCancellation()),resumeSubscriptionCancellation:()=>P(()=>t.billing.resumeSubscriptionCancellation()),getAutoTopUp:(n={})=>P(()=>t.billing.getAutoTopUp(n)),updateAutoTopUp:(n)=>P(()=>t.billing.updateAutoTopUp(n)),purchaseCredits:(n)=>P(()=>t.billing.purchaseCredits(n)),listPlans:(n={})=>P(()=>t.billing.listPlans(n)),previewPlanChange:(n)=>P(()=>t.billing.previewPlanChange(n)),changePlan:(n)=>P(()=>t.billing.changePlan(n)),createCheckoutSession:(n)=>P(()=>t.billing.createCheckoutSession(n)),getCheckoutSessionStatus:(n)=>P(()=>t.billing.getCheckoutSessionStatus(n)),createPortalSession:(n={})=>P(()=>t.billing.createPortalSession(n)),getPaymentMethod:(n={})=>P(()=>t.billing.getPaymentMethod(n))},tasks:{list:(n={})=>P(()=>t.tasks.list(n))},recommendations:{list:(n={})=>P(()=>t.recommendations.list(n))},repos:{list:(n={})=>P(()=>t.repos.list(n)),add:(n)=>P(()=>t.repos.add(n)),remove:(n)=>P(()=>t.repos.remove(n))},onboarding:{getState:(n={})=>P(()=>t.onboarding.getState(n)),skipSampleIssue:(n)=>P(()=>t.onboarding.skipSampleIssue(n)),finish:(n)=>P(()=>t.onboarding.finish(n))},notificationDeliveryRules:{list:()=>P(()=>t.notificationDeliveryRules.list()),options:()=>P(()=>t.notificationDeliveryRules.options()),create:(n)=>P(()=>t.notificationDeliveryRules.create(n)),update:(n)=>P(()=>t.notificationDeliveryRules.update(n)),delete:(n)=>P(()=>t.notificationDeliveryRules.delete({ruleId:n}))},notificationChannels:{getProject:()=>P(()=>t.notificationChannels.getProject())},logSources:{listProviders:()=>P(()=>t.logSources.listProviders()),list:(n)=>P(()=>t.logSources.list(n)),get:(n)=>P(()=>t.logSources.get({logSourceId:n})),create:(n)=>P(()=>t.logSources.create(n)),update:(n)=>P(()=>t.logSources.update(n)),delete:(n)=>P(()=>t.logSources.delete({logSourceId:n}))},logStreams:{list:(n)=>P(()=>t.logStreams.list({logSourceId:n})),get:(n)=>P(()=>t.logStreams.get({streamId:n})),create:(n)=>P(()=>t.logStreams.create(n)),update:(n)=>P(()=>t.logStreams.update(n)),delete:(n)=>P(()=>t.logStreams.delete({streamId:n})),reassign:(n)=>P(()=>t.logStreams.reassign(n))},integrations:{listProviders:()=>P(()=>t.integrations.listProviders()),listConnections:(n)=>P(()=>t.integrations.listConnections(n)),getConnection:(n)=>P(()=>t.integrations.getConnection({connectionId:n})),createConnection:(n)=>P(()=>t.integrations.createConnection(n)),beginConnect:(n)=>P(()=>t.integrations.beginConnect(n)),getConnectAttempt:(n)=>P(()=>t.integrations.getConnectAttempt({attemptId:n})),disconnectConnection:(n)=>P(()=>t.integrations.disconnectConnection({connectionId:n})),updateConnectionCredentials:(n)=>P(()=>t.integrations.updateConnectionCredentials(n))},connectedAccounts:{beginConnect:(n)=>P(()=>t.connectedAccounts.beginConnect(n)),getConnectAttempt:(n)=>P(()=>t.connectedAccounts.getConnectAttempt({attemptId:n})),list:()=>P(()=>t.connectedAccounts.list({})),disconnect:(n)=>P(()=>t.connectedAccounts.disconnect(n))},mcpConnectors:{list:(n)=>P(()=>t.mcpConnectors.list(n)),get:(n)=>P(()=>t.mcpConnectors.get(n)),details:(n)=>P(()=>t.mcpConnectors.details(n)),listProviders:()=>P(()=>t.mcpConnectors.listProviders()),search:(n)=>P(()=>t.mcpConnectors.search(n)),call:(n)=>P(()=>t.mcpConnectors.call(n)),beginOAuthInstall:(n)=>P(()=>t.mcpConnectors.beginOAuthInstall(n)),getOAuthInstallAttempt:(n)=>P(()=>t.mcpConnectors.getOAuthInstallAttempt(n)),disconnect:(n)=>P(()=>t.mcpConnectors.disconnect(n)),update:(n)=>P(()=>t.mcpConnectors.update(n))},sandboxPresets:{delete:(n)=>P(()=>t.sandboxPresets.delete(n)),listConnections:(n)=>P(()=>t.sandboxPresets.listConnections(n)),listTypes:()=>P(()=>t.sandboxPresets.listTypes()),test:(n)=>P(()=>t.sandboxPresets.test(n)),upsert:(n)=>P(()=>t.sandboxPresets.upsert(n))},memory:{list:(n={})=>P(()=>t.memory.list(n)),get:(n)=>P(()=>t.memory.get(n)),search:(n)=>P(()=>t.memory.search(n)),put:(n)=>P(()=>t.memory.put({kind:"note",...n})),delete:(n)=>P(()=>t.memory.delete(n))},signalDefinitions:{list:(n={})=>P(()=>t.signalDefinitions.list(n)),get:(n)=>P(()=>t.signalDefinitions.get({signalDefinitionId:n})),create:(n)=>P(()=>t.signalDefinitions.create(n)),update:(n,r={})=>P(()=>t.signalDefinitions.update({signalDefinitionId:n,...r})),disable:(n)=>P(()=>t.signalDefinitions.disable({signalDefinitionId:n}))},scripts:{list:(n={})=>P(()=>t.scripts.list(n)),get:(n)=>P(()=>t.scripts.get({name:n})),create:(n)=>P(()=>t.scripts.create(n)),update:(n,r={})=>P(()=>t.scripts.update({name:n,...r})),delete:(n)=>P(()=>t.scripts.delete({name:n}))}}};var xm=h(()=>{SM();ce();CM=new Map});var Rhe;var The=h(()=>{Rhe={version:2,activeProfile:"default",profiles:{default:{}}}});import*as mi from"node:fs";import*as Bhe from"node:os";import*as EM from"node:path";var wn=(e)=>{if(e===void 0||e===null)return;if(typeof e==="string")return e.length>0?e:void 0;return},h7e=(e)=>{if(typeof e!=="object"||e===null||Array.isArray(e))return;let t={};for(let[n,r]of Object.entries(e)){if(!Array.isArray(r))continue;let o=r.filter((i)=>typeof i==="string"&&i.length>0);if(o.length>0)t[n]=o}return Object.keys(t).length>0?t:void 0},vM,Hu,A7e=()=>{if(!mi.existsSync(vM))mi.mkdirSync(vM,{recursive:!0,mode:448})},wM,Ohe=(e)=>{wM=e},_he=(e)=>({token:wn(e.token),activeOrganizationId:wn(e.activeOrganizationId??e.organizationId),organizationName:wn(e.organizationName),activeProjectId:wn(e.activeProjectId??e.defaultProjectId),apiBaseUrl:wn(e.apiBaseUrl),authBaseUrl:wn(e.authBaseUrl),webBaseUrl:wn(e.webBaseUrl),intakeBaseUrl:wn(e.intakeBaseUrl),tailBaseUrl:wn(e.tailBaseUrl),apiDomain:wn(e.apiDomain),webDomain:wn(e.webDomain),intakeDomain:wn(e.intakeDomain),tailDomain:wn(e.tailDomain),forwardPublicKey:wn(e.forwardPublicKey),forwardPublicKeyProjectId:wn(e.forwardPublicKeyProjectId),skippedOnboardingSteps:h7e(e.skippedOnboardingSteps)}),f7e=(e)=>({version:2,activeProfile:"default",profiles:{default:_he(e)}}),y7e=(e)=>{let t=wn(e.activeProfile)??"default",n=typeof e.profiles==="object"&&e.profiles!==null?e.profiles:{},r={};for(let[o,i]of Object.entries(n)){if(typeof i!=="object"||i===null)continue;r[o]=_he(i)}if(!r[t])r[t]={};return{version:2,activeProfile:t,profiles:r}},Ye=()=>{try{if(!mi.existsSync(Hu))return Ct(Rhe);let e=mi.readFileSync(Hu,"utf-8"),t=JSON.parse(e),n=typeof t.version==="number"?t.version:void 0;if(n!==void 0&&n>2)return ft("Settings file requires a newer CLI version. Upgrade with 'npm install -g @sazabi/cli@latest'.");if(n===2)return Ct(y7e(t));let r=f7e(t),o=yt(r);if(!o.success)return o;return Ct(r)}catch(e){let t=e instanceof Error?e.message:String(e);return ft(t)}},yt=(e)=>{try{return A7e(),mi.writeFileSync(Hu,JSON.stringify(e,null,2),{encoding:"utf-8",mode:384}),Ct(void 0)}catch(t){let n=t instanceof Error?t.message:String(t);return ft(n)}},Mo=(e,t)=>{if(t)return t;if(wM)return wM;let n=process.env.SAZABI_PROFILE?.trim();if(n)return n;return e.activeProfile??"default"},Wt=(e,t)=>{let n=Mo(e,t),r=e.profiles[n];if(r)return Ct(r);if(n==="default")return Ct({});return ft(`Profile '${n}' does not exist. Run 'sazabi profiles create ${n}' first.`)},lr=()=>{let e=Ye();if(!e.success)return e;return Wt(e.value)},Jt=(e,t,n)=>{let r=Mo(e,n);if(!e.profiles[r])return ft(`Profile '${r}' does not exist. Run 'sazabi profiles create ${r}' first.`);return Ct({...e,profiles:{...e.profiles,[r]:{...e.profiles[r],...t}}})},Dhe=(e,t)=>e?.skippedOnboardingSteps?.[t]??[],Lhe=(e,t,n,r)=>{let o=Wt(e,r);if(!o.success)return o;let i={...o.value.skippedOnboardingSteps},s=i[t]??[];if(!s.includes(n))i[t]=[...s,n];return Jt(e,{skippedOnboardingSteps:i},r)},Qhe=(e,t,n)=>{let r=Wt(e,n);if(!r.success)return r;let{[t]:o,...i}=r.value.skippedOnboardingSteps??{};return Jt(e,{skippedOnboardingSteps:Object.keys(i).length>0?i:void 0},n)},zo=(e)=>{if(!e?.forwardPublicKey&&!e?.forwardPublicKeyProjectId)return{};return{forwardPublicKey:void 0,forwardPublicKeyProjectId:void 0}};var En=h(()=>{The();ce();vM=EM.join(Bhe.homedir(),".sazabi"),Hu=EM.join(vM,"settings.json")});var Mr=(e)=>{let{cliFlag:t,globalUrl:n,globalDomain:r,buildUrlFromDomain:o,defaultUrl:i}=e;if(t)return t;let s=process.env.SAZABI_API_URL?.trim();if(s)return s;if(n)return n;if(r)return o(r);return i},Q=(e)=>{let{tokenFlag:t,organizationIdFlag:n,projectIdFlag:r,jsonMode:o}=e,i=t?.trim(),s=process.env.SAZABI_TOKEN?.trim(),c=process.env.SAZABI_ORGANIZATION_ID?.trim(),l=process.env.SAZABI_PROJECT_ID?.trim(),u=I(lr(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",o),d=u.token?.trim(),p=(i&&i.length>0?i:void 0)||(s&&s.length>0?s:void 0)||d,g=i&&i.length>0?"flag":s&&s.length>0?"environment":"settings";if(!p||p.length===0){if(o)return b("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.");return y("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.")}let m,A;if(n)m=n,A="flag";else if(c&&c.length>0)m=c,A="environment";else if(u.activeOrganizationId)m=u.activeOrganizationId,A="settings";let f,S;if(r)f=r,S="flag";else if(l&&l.length>0)f=l,S="environment";else if(u.activeProjectId)f=u.activeProjectId,S="settings";return{token:p,type:"token",projectId:f,organizationId:m,tokenSource:g,organizationSource:A,projectSource:S}},Pm=(e)=>{let t=I(lr(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",e?.jsonMode);return Mr({cliFlag:e?.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(n)=>`https://api.${n}`,defaultUrl:"https://api.sazabi.com"})},N=(e)=>{let t=e.apiBaseUrl??Pm({apiBaseUrlFlag:e.apiBaseUrlFlag,jsonMode:e.jsonMode});return gi({token:e.token,baseUrl:t,organizationId:e.organizationId,projectId:e.projectId,sandboxActorDescriptor:process.env.SAZABI_SANDBOX_ACTOR})},Nhe,kM,xS=async(e)=>{let t=I(lr(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",e.jsonMode),n=Mr({cliFlag:e.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(l)=>`https://api.${l}`,defaultUrl:"https://api.sazabi.com"}),r=`${e.token}@${n}@${e.projectId??""}`,o=Nhe.get(r);if(o)return o;let i=kM.get(r);if(i)return i;if(!e.projectId){if(e.jsonMode)return b("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.");return y("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.")}let s=e.projectId,c=(async()=>{let u=await gi({token:e.token,baseUrl:n,projectId:s}).projects.get(s),p=I(u,"Couldn't fetch project info (run 'sazabi projects list' to verify the project ID)",e.jsonMode).project;return Nhe.set(r,p),p})();kM.set(r,c);try{return await c}finally{kM.delete(r)}},kS=(e)=>{let t=e.trim().toLowerCase(),n=/^[a-z][a-z0-9+.-]*:\/\//.test(t)?t:`https://${t}`,r=t;try{r=new URL(n).hostname.toLowerCase()}catch{r=t.replace(/^[a-z][a-z0-9+.-]*:\/\//,"").replace(/[/?#].*$/,"").replace(/:\d+$/,"")}return`https://app.${r.replace(/^(?:app\.)+/,"")}`},b7e=(e)=>{try{let t=new URL(e),n=t.hostname.toLowerCase();if(!n.startsWith("api."))return null;return`${t.protocol}//app.${n.slice(4)}`}catch{return null}},zr=(e)=>{let t=(r)=>r.replace(/\/+$/,"");if(e)return t(e);let n=I(lr(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)");if(n.webBaseUrl)return t(n.webBaseUrl);if(n.webDomain)return kS(n.webDomain);if(n.apiDomain)return kS(n.apiDomain);if(n.apiBaseUrl){let r=b7e(n.apiBaseUrl);if(r)return r}return"https://app.sazabi.com"},Xn=(e,t)=>{if(e&&e.length>0)return e;let n="No project selected. Pass --project-id, set SAZABI_PROJECT_ID, or run 'sazabi projects use <project-id>'.";if(t)return b(n);return y(n)},ws=(e,t)=>`${zr(t)}/projects/${e}`,zt=(e,t,n,r)=>{let o=`${zr(n)}/projects/${e}/threads/${t}`;return r?`${o}?messageId=${encodeURIComponent(r)}`:o},Mhe=(e,t,n,r)=>zt(e,t,n,r),zhe=(e,t,n)=>`${ws(e,n)}/issues/${t}`,jhe=(e,t,n)=>`${ws(e,n)}/automations/${t}`,Uhe=(e,t)=>`${ws(e,t)}/status`,Fhe=(e,t,n)=>`${ws(e,n)}/settings/log-source-providers/${t}`,$he=(e,t,n)=>`${ws(e,n)}/settings/mcp-connectors/${t}`,PS=(e,t,n)=>`${ws(e,n)}/settings/sandbox/catalog/${t}`,Ghe=(e,t)=>`https://otlp.${t}.intake.${e}`;var ye=h(()=>{oe();xm();ce();En();Nhe=new Map,kM=new Map});var rC,lIe=(e)=>{rC.set(e.name,e)},iC=(e)=>rC.get(e),th=()=>Array.from(rC.values()),uIe=(e)=>rC.has(e);var $z=h(()=>{rC=new Map});async function Kz(e){let t=await e.publicKeys.list({limit:20});if(!t.success)return[];return t.value.publicKeys.map((n)=>({value:n.id,description:n.name}))}async function Yz(e){let t=await e.secretKeys.list({limit:20});if(!t.success)return[];return t.value.secretKeys.map((n)=>({value:n.id,description:n.name}))}async function oh(e){let t=await e.logSources.list();if(!t.success)return[];return t.value.logSources.map((n)=>({value:n.id,description:n.name??n.provider}))}async function pIe(e){let t=await e.members.list();if(!t.success)return[];return t.value.members.map((n)=>({value:n.userId,description:n.name??n.email}))}var Hct=3000,Vct,gIe=async(e,t,n)=>{try{let r=Vct[e]?.[t];if(!r)return[];let o=lr();if(!o.success)return[];let i=o.value,s=process.env.SAZABI_TOKEN?.trim()||i.token?.trim();if(!s)return[];let c=Mr({globalUrl:i.apiBaseUrl,globalDomain:i.apiDomain,buildUrlFromDomain:(d)=>`https://api.${d}`,defaultUrl:"https://api.sazabi.com"}),l=gi({token:s,baseUrl:c,organizationId:i.activeOrganizationId,projectId:i.activeProjectId});return(await Promise.race([r(l),new Promise((d)=>setTimeout(()=>d([]),Hct))])).filter((d)=>d.value.startsWith(n))}catch{return[]}};var mIe=h(()=>{xm();ye();En();Vct={threads:{get:async(e)=>{let t=await e.threads.list({limit:20});if(!t.success)return[];return t.value.threads.map((n)=>({value:n.id,description:n.title??void 0}))}},projects:{use:async(e)=>{let t=await e.projects.list();if(!t.success)return[];return t.value.projects.map((n)=>({value:n.id,description:n.name}))}},organizations:{use:async(e)=>{let t=await e.organizations.list();if(!t.success)return[];return t.value.organizations.map((n)=>({value:n.id,description:n.name}))},rename:async(e)=>{let t=await e.organizations.list();if(!t.success)return[];return t.value.organizations.map((n)=>({value:n.id,description:n.name}))}},"public-keys":{get:Kz,update:Kz,deactivate:Kz},"secret-keys":{get:Yz,update:Yz,delete:Yz},"log-sources":{get:oh,enable:oh,disable:oh,delete:oh,remove:oh},members:{"update-role":pIe,remove:pIe}}});var AIe={};dr(AIe,{getCompletions:()=>Jct,parseCompletionContext:()=>Wct});var Kct,Yct,Wct=(e)=>{let t=e.length>0?e:[""],n=t.length-1,r=t[n]??"";return{words:t,currentIndex:n,partial:r}},Jct=async(e)=>{let{words:t,currentIndex:n,partial:r}=e,o=t[n-1];if(o==="--profile")return tlt(r);let i=elt(t),s=Math.max(0,i.length-(t.length-n));if(s===0)return Zct(r);let c=i[0]??"",l=iC(c);if(!l)return[];if(s===1&&l.subcommands){if(r.startsWith("-"))return hIe(l.options,i);return Xct(l,r)}let u=l.subcommands?i[1]:void 0,p=(u?l.subcommands?.[u]:void 0)?.options??l.options;if(r.startsWith("-"))return hIe(p,i);if(o?.startsWith("--")){let g=o.slice(2);if(p?.[g]?.type==="string"){let A=`${c}:${u??""}`,f=Yct[A]?.[g]??Kct[g];if(f)return f.filter((S)=>S.startsWith(r)).map((S)=>({value:S}));return[]}}return gIe(c,u??"",r)},Zct=(e)=>{let n=th().filter((o)=>o.name.startsWith(e)).map((o)=>({value:o.name,description:o.description})),r=[{value:"--help",description:"Show help"},{value:"--version",description:"Show version"},{value:"--profile",description:"Use a named profile"}];for(let o of r)if(o.value.startsWith(e))n.push(o);return n},Xct=(e,t)=>{if(!e.subcommands)return[];return Object.values(e.subcommands).filter((n)=>n.name.startsWith(t)).map((n)=>({value:n.name,description:n.description}))},hIe=(e,t)=>{let n=t[t.length-1]??"",r=new Set(t.filter((i)=>i.startsWith("--")).map((i)=>i.replace(/=.*/,""))),o=[];if(!r.has("--help")&&"--help".startsWith(n))o.push({value:"--help",description:"Show help"});if(!r.has("--profile")&&"--profile".startsWith(n))o.push({value:"--profile",description:"Use a named profile"});if(!e)return o;for(let[i,s]of Object.entries(e)){let c=`--${i}`;if(r.has(c))continue;if(!c.startsWith(n))continue;o.push({value:c,description:s.description})}return o},elt=(e)=>{let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(r==="--profile"&&n+1<e.length)n++;else if(r.startsWith("--profile="));else t.push(r)}return t},tlt=(e)=>{try{let t=Ye();if(!t.success)return[];return Object.keys(t.value.profiles).filter((n)=>n.startsWith(e)).map((n)=>({value:n,description:n===t.value.activeProfile?"active":void 0}))}catch{return[]}};var fIe=h(()=>{$z();En();mIe();Kct={status:["regular","archived"],format:["json","text"]},Yct={"members:update-role":{role:["admin","member"]},"messages:search":{role:["user","assistant"]},"messages:list":{role:["user","assistant"]}}});oe();oe();oe();import{parseArgs as lj}from"node:util";var E=(e,t,n={})=>{let r=Object.hasOwn(t,"json")&&e.includes("--json"),o=(d,p)=>{if(r)b({code:d,message:p,operationId:null});throw y(p),Error("Unreachable")},i=(()=>{try{return lj({args:e,options:t,allowPositionals:Boolean(n.allowPositionals),strict:!1,tokens:!0})}catch(d){let p=new Set(Object.keys(t)),g=new Set(Object.values(t).map((A)=>A.short).filter((A)=>Boolean(A)));try{let A=lj({args:e,options:t,allowPositionals:!0,strict:!1,tokens:!0}),f=[...new Set((A.tokens??[]).flatMap((S)=>S.kind==="option"?[S]:[]).filter((S)=>!p.has(S.name)&&!(S.name.length===1&&g.has(S.name))).map((S)=>S.name.length>1?`--${S.name}`:`-${S.name}`))];if(f.length>0)return o("UNEXPECTED_ARGUMENT",`Unknown option${f.length>1?"s":""}: ${f.join(", ")}. Run the command with -h for usage.`)}catch{}let m=d instanceof Error?d.message:"Invalid arguments.";return o("INVALID_ARGUMENT",`${m.endsWith(".")?m:`${m}.`} Run the command with -h for usage.`)}})(),s=Object.hasOwn(t,"json")&&i.values.json===!0,c=new Set(Object.keys(t)),l=new Set(Object.entries(t).map(([,d])=>d.short).filter((d)=>Boolean(d))),u=[];if(Array.isArray(i.tokens))for(let d of i.tokens){if(d.kind!=="option")continue;let p=d.name,g=p.length>1;if(!(c.has(p)||!g&&l.has(p))){let A=g?`--${p}`:`-${p}`;if(!u.includes(A))u.push(A)}}for(let d of Object.keys(i.values))if(!c.has(d)){let p=d.length>1?`--${d}`:`-${d}`;if(!u.includes(p))u.push(p)}if(u.length>0){let d=`Unknown option${u.length>1?"s":""}: ${u.join(", ")}. Run the command with -h for usage.`;if(s)b({code:"UNEXPECTED_ARGUMENT",message:d,operationId:null});y(d)}for(let[d,p]of Object.entries(t))if(p.type==="string"&&i.values[d]===!0){let g=d.length===1?`-${d}`:`--${d}`,m=`Option ${g} requires a value. Use '${g} <value>'.`;o("INVALID_ARGUMENT",m)}for(let[d,p]of Object.entries(t)){let g=i.values[d];if(p.type==="string"&&typeof g==="string"){if(g.length===0){let A=d.length===1?`-${d}`:`--${d}`;o("INVALID_ARGUMENT",`Option ${A} requires a non-empty value.`)}if(g.startsWith("--")||g.length===2&&g[0]==="-"&&/[a-zA-Z]/.test(g.charAt(1))){let f=`Option ${d.length===1?`-${d}`:`--${d}`} received "${g}" as its value. Did you forget to provide a value?`;o("INVALID_ARGUMENT",f)}}}if(!n.allowPositionals&&i.positionals.length>0)o("UNEXPECTED_ARGUMENT",`Unexpected argument${i.positionals.length>1?"s":""}: ${i.positionals.join(", ")}. Run the command with -h for usage.`);return{values:i.values,positionals:i.positionals}};var uh=(e,t)=>{if(e?.json?.type!=="boolean")throw Error(`${t} must include a boolean --json option (enforced by CommandBuilder)`)};class uj{name;description;handler;subcommands;options;examples;positionalArgs;allowNoJson=!1;constructor(e,t,n){this.name=e,this.description=t,this.handler=n}withOptions(e){return this.options=e,this}withSubcommands(e){return this.subcommands=e,this}withExamples(e){return this.examples=e,this}withPositionalArgs(e){return this.positionalArgs=e,this}build(){if(!this.handler&&!this.subcommands)throw Error(`Subcommand "${this.name}" must have either a handler or subcommands`);if(!this.allowNoJson&&this.handler)uh(this.options,`Subcommand "${this.name}"`);if(!this.allowNoJson&&this.subcommands){for(let[e,t]of Object.entries(this.subcommands))if(!t.subcommands)uh(t.options,`Subcommand "${this.name} ${e}"`)}return{name:this.name,description:this.description,handler:this.handler,subcommands:this.subcommands,options:this.options,examples:this.examples,positionalArgs:this.positionalArgs}}allowWithoutJson(){return this.allowNoJson=!0,this}}class dj{name;description;handler;subcommands;options;examples;positionalArgs;allowNoJson=!1;constructor(e,t){this.name=e,this.description=t}withHandler(e){return this.handler=e,this}withSubcommands(e){return this.subcommands=e,this}withOptions(e){return this.options=e,this}withExamples(e){return this.examples=e,this}withPositionalArgs(e){return this.positionalArgs=e,this}build(){if(!this.handler&&!this.subcommands)throw Error(`Command "${this.name}" must have either a handler or subcommands`);if(!this.allowNoJson){if(this.handler)uh(this.options,`Command "${this.name}"`);if(this.subcommands)for(let[e,t]of Object.entries(this.subcommands)){if(t.subcommands)continue;uh(t.options,`Subcommand "${this.name} ${e}"`)}}return{name:this.name,description:this.description,handler:this.handler,subcommands:this.subcommands,options:this.options,examples:this.examples,positionalArgs:this.positionalArgs}}allowWithoutJson(){return this.allowNoJson=!0,this}}var ie=(e,t)=>new dj(e,t),C=(e,t,n)=>new uj(e,t,n);oe();var An=(e,t,n,r,o)=>{let i=Number.parseInt(e,10);if(Number.isNaN(i)||i<t||i>n){let s=`${r} must be between ${t} and ${n}.`;if(o)return b(s);return y(s)}return i},no=(e,t,n,r)=>{if(!t.includes(e)){let o=t.map((s)=>`"${s}"`).join(" or "),i=`${n} must be ${o}.`;if(r)return b(i);return y(i)}return e};oe();ye();ce();var PM=(e)=>{let t=[];for(let n of e){let r=0;for(let o of n.content){if(o.type!=="artifact")continue;t.push({id:`${n.id}:${r}`,messageId:n.id,name:o.name,toolCallId:o.toolCallId??null,createdAt:n.createdAt,data:o.data}),r+=1}}return t},Hhe=(e)=>{let t=e.lastIndexOf(":");if(t<=0||t===e.length-1)return null;let n=e.slice(0,t),r=e.slice(t+1);if(!/^\d+$/.test(r))return null;return{messageId:n,index:Number.parseInt(r,10)}},Vhe=(e,t)=>PM(e).find((n)=>n.id===t),xM=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),qhe=(e)=>{let t=e===null||e===void 0?"":typeof e==="object"?JSON.stringify(e):String(e);if(/[",\n\r]/.test(t))return`"${t.replace(/"/g,'""')}"`;return t},I7e=(e)=>{if(Array.isArray(e)&&e.every(xM))return e;if(xM(e))for(let t of["rows","data","items","points"]){let n=e[t];if(Array.isArray(n)&&n.every(xM))return n}return null},Khe=(e)=>{let t=I7e(e);if(!t||t.length===0)return null;let n=[];for(let o of t)for(let i of Object.keys(o))if(!n.includes(i))n.push(i);if(n.length===0)return null;let r=[n.map(qhe).join(",")];for(let o of t)r.push(n.map((i)=>qhe(o[i])).join(","));return r.join(`
|
|
@@ -8963,7 +8963,7 @@ _sazabi() {
|
|
|
8963
8963
|
complete -F _sazabi sazabi
|
|
8964
8964
|
`.trim();var ptt=async(e)=>{let{values:t}=E(e,{json:{type:"boolean"}}),n=jAe();if(t.json){j({shell:"zsh",script:n});return}console.log(n)},gtt=async(e)=>{let{values:t}=E(e,{json:{type:"boolean"}}),n=UAe();if(t.json){j({shell:"bash",script:n});return}console.log(n)},FAe=ie("completions","Shell completion scripts").withSubcommands({zsh:C("zsh","Output zsh completion script",ptt).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(['eval "$(sazabi completions zsh)" # Add to .zshrc']).build(),bash:C("bash","Output bash completion script",gtt).withOptions({json:{type:"boolean",description:"Output as JSON"}}).withExamples(['eval "$(sazabi completions bash)" # Add to .bashrc']).build()}).withExamples(['eval "$(sazabi completions zsh)" # Enable zsh completions','eval "$(sazabi completions bash)" # Enable bash completions']).build();oe();ye();ce();oe();ye();import*as bi from"node:fs";import*as eo from"node:path";var mtt=["services","apps","packages"],htt=["docker-compose.yml","docker-compose.yaml","compose.yml","compose.yaml"],$Ae=(e)=>{try{let t=JSON.parse(bi.readFileSync(e,"utf8"));return typeof t==="object"&&t!==null&&!Array.isArray(t)?t:void 0}catch{return}},UM=(e)=>{let n=$Ae(eo.join(e,"package.json"))?.name;return typeof n==="string"&&n.trim().length>0?n.trim():void 0},Att=(e)=>{try{return bi.statSync(e).isDirectory()}catch{return!1}},DS=(e)=>{try{return bi.statSync(e).isFile()}catch{return!1}},GAe=(e)=>{try{return bi.readdirSync(e,{withFileTypes:!0}).filter((t)=>t.isDirectory()&&!t.name.startsWith(".")).map((t)=>t.name).sort()}catch{return[]}},ftt=(e,t)=>{let n=t.trim().replace(/\/+$/,"");if(n.length===0||n.startsWith("!"))return[];if(n.endsWith("/*")){let r=n.slice(0,-2);if(r.includes("*"))return[];return GAe(eo.join(e,r)).map((o)=>eo.join(r,o))}if(n.includes("*"))return[];return Att(eo.join(e,n))?[n]:[]},ytt=(e)=>{let t=e?.workspaces;if(Array.isArray(t))return t.filter((n)=>typeof n==="string");if(typeof t==="object"&&t!==null){let n=t.packages;if(Array.isArray(n))return n.filter((r)=>typeof r==="string")}return[]},btt=(e)=>{let t=eo.join(e,"pnpm-workspace.yaml");if(!DS(t))return[];let n;try{n=bi.readFileSync(t,"utf8")}catch{return[]}let r=[],o=!1;for(let i of n.split(`
|
|
8965
8965
|
`)){if(/^packages\s*:/.test(i)){o=!0;continue}if(o){let s=i.match(/^\s+-\s+["']?([^"'#\n]+?)["']?\s*$/);if(s?.[1]){r.push(s[1]);continue}if(/^\S/.test(i))o=!1}}return r},Itt=(e,t)=>{let n=[];for(let r of t)for(let o of ftt(e,r)){let i=UM(eo.join(e,o));if(!i)continue;n.push({name:i,description:"workspace package",dir:o})}return n},Stt=(e)=>{let t=[];for(let n of mtt)for(let r of GAe(eo.join(e,n))){let o=eo.join(n,r),i=eo.join(e,o);if(!(DS(eo.join(i,"package.json"))||DS(eo.join(i,"Dockerfile"))))continue;t.push({name:UM(i)??r,description:"service directory",dir:o})}return t},Ctt=(e)=>{let t=htt.map((s)=>eo.join(e,s)).find(DS);if(!t)return[];let n;try{n=bi.readFileSync(t,"utf8")}catch{return[]}let r=[],o=!1,i;for(let s of n.split(`
|
|
8966
|
-
`)){if(/^services\s*:\s*(#.*)?$/.test(s)){o=!0,i=void 0;continue}if(!o)continue;if(/^\S/.test(s)){o=!1;continue}let c=s.match(/^(\s+)([A-Za-z0-9_.-]+)\s*:\s*(#.*)?$/);if(!c)continue;let l=c[1].length;if(i??=l,l!==i)continue;r.push({name:c[2],description:"docker compose service",dir:"."})}return r},FM=(e)=>{let t=$Ae(eo.join(e,"package.json")),n=[...ytt(t),...btt(e)],r=[...Itt(e,n),...Stt(e),...Ctt(e)],o=n.length===0?UM(e):void 0;if(o)r.push({name:o,description:"root package",dir:"."});let i=new Set;return r.filter((s)=>{if(i.has(s.name))return!1;return i.add(s.name),!0})};ce();var vtt={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},origin:{label:"Origin",type:{kind:"string"}},lifecycle:{label:"Lifecycle",type:{kind:"string"}}},wtt={schema:vtt,columns:["id","name","origin","lifecycle"],header:"Registered components",emptyMessage:"No components registered."},$M=async(e)=>{let{client:t,json:n}=e,r=e.rootDir??process.cwd(),o=FM(r);if(o.length===0)return Fo("No component candidates detected. Register one with 'sazabi components register --name <name>'."),[];let i=await Bm({message:"Select the components to register",choices:o.map((c)=>({label:c.name,value:c,hint:`${c.description}, ${c.dir}`,preselected:!0}))});if(i.length===0)return q("Nothing selected. No components registered."),[];let s=[];for(let c of i){let l=I(await t.components.register({name:c.name,description:c.description}),`Failed to register component ${c.name}`,n);z(`Component ${l.component.name} registered.`),s.push({id:l.component.id,name:l.component.name,origin:l.component.origin,lifecycle:l.component.lifecycle})}return H(wtt,s,{json:n}),s},Ett=async(e)=>{let{values:t}=E(e,{...L,dir:{type:"string"}}),n=t.json,r=t.dir??process.cwd();if(n||!yi()){j({candidates:FM(r)});return}let o=Q({jsonMode:n}),i=N({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t["api-base-url"],jsonMode:n});await $M({client:i,rootDir:r,json:n})},qAe=C("scan","Detect component candidates in the working tree (propose-only)",Ett).withOptions({..._,dir:{type:"string",description:"Directory to scan (default: current directory)"}}).withExamples(["sazabi components scan # Detect candidates and confirm which to register","sazabi components scan --json # Print candidates only, register nothing"]).build();var VAe={id:{label:"ID",type:{kind:"string"}},projectId:{label:"Project",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},currentStatus:{label:"Status",type:{kind:"string"}},description:{label:"Description",type:{kind:"nullable-string"}},origin:{label:"Origin",type:{kind:"string"}},lifecycle:{label:"Lifecycle",type:{kind:"string"}},observationState:{label:"Observation",type:{kind:"string"}},registryRevision:{label:"Revision",type:{kind:"number"}},canonicalComponentId:{label:"Canonical component",type:{kind:"id"}},mergedIntoComponentId:{label:"Merged into",type:{kind:"nullable-string"}},firstSeenAt:{label:"Created at",type:{kind:"date"}},lastSeenAt:{label:"Last seen",type:{kind:"date"}},deletedAt:{label:"Deleted at",type:{kind:"nullable-date"}},inactiveAt:{label:"Inactive at",type:{kind:"nullable-date"}},inactiveReason:{label:"Inactive reason",type:{kind:"nullable-string"}},legacyStateUnknown:{label:"Legacy inactive",type:{kind:"boolean"}}},ktt={schema:VAe,columns:["id","name","lifecycle","observationState","currentStatus"],jsonFields:["id","projectId","name","currentStatus","description","origin","lifecycle","observationState","registryRevision","canonicalComponentId","mergedIntoComponentId","firstSeenAt","lastSeenAt","deletedAt","inactiveAt","inactiveReason","legacyStateUnknown"],emptyMessage:"No components found. Register one with 'sazabi components register --name <name>'."},qM={layout:"field-list",schema:VAe,fields:["id","projectId","name","currentStatus","description","origin","lifecycle","observationState","registryRevision","canonicalComponentId","mergedIntoComponentId","firstSeenAt","lastSeenAt","deletedAt","inactiveAt","inactiveReason","legacyStateUnknown"],title:"Component"},xtt={status:{label:"Status",type:{kind:"string"}},componentId:{label:"Component ID",type:{kind:"id"}},sourceType:{label:"Source type",type:{kind:"string"}},withdrawn:{label:"Withdrawn",type:{kind:"boolean"}}},Ptt={layout:"field-list",schema:xtt,fields:["status","componentId","sourceType","withdrawn"],title:"Component observation"},Rtt=(e)=>{let t=e,n=Object.values(t.counts).reduce((r,o)=>r+o,0);return`${t.canonicalComponentName} (${t.canonicalComponentId}); ${t.affectedComponentIds.length} component(s), ${n} dependent(s); no changes applied`},Ttt={status:{label:"Status",type:{kind:"string"}},preview:{label:"Deregistration preview",type:{kind:"custom",render:Rtt,serialize:(e)=>e}}},Btt={layout:"field-list",schema:Ttt,fields:["status","preview"],title:"Deregistration confirmation required"},_m=(e,t,n)=>{if(e===void 0)return;try{let r=JSON.parse(e);if(!r||typeof r!=="object"||Array.isArray(r))throw Error("must be a JSON object");return r}catch(r){let o=`${t} must be valid JSON: ${r instanceof Error?r.message:String(r)}`;if(n)return b(o);return y(o)}},GM=(e)=>e?e.split(",").map((t)=>t.trim()).filter(Boolean):[],HM={kind:"custom",render:(e)=>JSON.stringify(e,null,2),serialize:(e)=>e},Ott={preview:{label:"Preview",type:HM}},_tt={layout:"field-list",schema:Ott,fields:["preview"],title:"Component operation preview"},Dtt={result:{label:"Result",type:HM}},Ltt={layout:"field-list",schema:Dtt,fields:["result"],title:"Component operation result"},VM=(e,t)=>G(_tt,e,{json:t}),NS=(e,t)=>G(Ltt,e,{json:t}),Qtt=async(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json}),n=N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=I(await n.components.list({limit:e.limit,cursor:e.cursor,includeDeleted:e.includeDeleted}),"Couldn't list components (check the active project and try again)",e.json);H(ktt,r.components,{json:e.json,nextCursor:r.nextCursor})},Ntt=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.components.get(e),"Couldn't get component (run 'sazabi components list' to see component IDs)",t.json);G(qM,o.component,{json:t.json})},Mtt=async(e)=>{let t=e.name?.trim(),n=e.description?.trim(),r=e.origin?.trim();if(!t){if(e.json)return b("Name is required.");return y("Name is required.")}if(e.description!==void 0&&!n){if(e.json)return b("Description cannot be empty.");return y("Description cannot be empty.")}if(r!==void 0&&r!=="code_detected"&&r!=="log_observed"){if(e.json)return b("Invalid origin. Use 'code_detected' (inferred from code) or 'log_observed' (inferred from telemetry).");return y("Invalid origin. Use 'code_detected' (inferred from code) or 'log_observed' (inferred from telemetry).")}let o=Q({tokenFlag:e.token,jsonMode:e.json}),i=N({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),s=I(await i.components.register({name:t,...n?{description:n}:{},...r?{origin:r}:{}}),"Failed to register component",e.json);G(qM,s.component,{json:e.json})},ztt=async(e,t)=>{let n=t.reason?.trim();if(t.reason!==void 0&&!n){if(t.json)return b("Reason cannot be empty.");return y("Reason cannot be empty.")}let r=Q({tokenFlag:t.token,jsonMode:t.json}),o=N({token:r.token,organizationId:r.organizationId,projectId:r.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),i=_m(t.confirmPreviewRevision,"Confirm preview revision",t.json);if(i&&(!t.requestId||!n)){if(t.json)return b("Commit requires --request-id and --reason with --confirm-preview-revision.");return y("Commit requires --request-id and --reason with --confirm-preview-revision.")}let s=I(await o.components.deregister(i&&t.requestId&&n?{componentId:e,requestId:t.requestId,reason:n,componentRevisions:i,confirmCanonicalGroup:t.confirmCanonicalGroup??!1}:{componentId:e,confirmCanonicalGroup:t.confirmCanonicalGroup??!1,...n!==void 0?{reason:n}:{}}),"Failed to deregister component; refresh the preview if it changed",t.json);if(s.status==="observation_withdrawn"){G(Ptt,s,{json:t.json});return}if(s.status==="deregistration_confirmation_required"){G(Btt,s,{json:t.json});return}NS(s,t.json)},Dm=(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json});return N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json})},jtt=async(e,t)=>{let n=t.name?.trim(),r=t.reason?.trim();if(!n){if(t.json)return b("Name is required.");return y("Name is required.")}if(!t.requestId){if(t.json)return b("Request ID is required.");return y("Request ID is required.")}if(!r){if(t.json)return b("Reason is required.");return y("Reason is required.")}let o=Dm(t),i=I(await o.components.rename({componentId:e,name:n,requestId:t.requestId,reason:r}),"Failed to rename component",t.json);G(qM,i.component,{json:t.json})},Utt=async(e,t)=>{let n=Dm(t),r=_m(t.confirmPreviewRevision,"Confirm preview revision",t.json);if(!r){let s=I(await n.components.reactivationPreview({componentId:e,...t.deregistrationOperationId?{deregistrationOperationId:t.deregistrationOperationId}:{}}),"Failed to preview component reactivation",t.json);VM(s,t.json);return}let o=t.reason?.trim();if(!t.requestId||!t.deregistrationOperationId||!o){if(t.json)return b("Commit requires --request-id, --deregistration-operation-id, and --reason with --confirm-preview-revision.");return y("Commit requires --request-id, --deregistration-operation-id, and --reason with --confirm-preview-revision.")}let i=I(await n.components.reactivate({componentId:e,deregistrationOperationId:t.deregistrationOperationId,requestId:t.requestId,reason:o,componentRevisions:r,selections:{notificationRuleIds:GM(t.notificationRuleIds),automationBindingIds:GM(t.automationBindingIds),recommendationScopeIds:[],relationshipIds:GM(t.relationshipIds)}}),"Failed to reactivate component; refresh the preview if it changed",t.json);NS(i,t.json)},Ftt=async(e)=>{if(!e.sourceComponentId||!e.targetComponentId){if(e.json)return b("Source and target component IDs are required.");return y("Source and target component IDs are required.")}let t=Dm(e),n={sourceComponentId:e.sourceComponentId,targetComponentId:e.targetComponentId},r=_m(e.confirmPreviewRevision,"Confirm preview revision",e.json);if(!r){let c=I(await t.components.mergePreview(n),"Failed to preview component consolidation",e.json);VM(c,e.json);return}let o=e.reason?.trim(),i=_m(e.policyDispositions,"Policy dispositions",e.json);if(!e.requestId||!o||!i){if(e.json)return b("Commit requires --request-id, --reason, and --policy-dispositions with --confirm-preview-revision.");return y("Commit requires --request-id, --reason, and --policy-dispositions with --confirm-preview-revision.")}let s=I(await t.components.merge({...n,requestId:e.requestId,reason:o,componentRevisions:r,policyDispositions:i,confirmPolicyImpact:e.confirmPolicyImpact??!1}),"Failed to consolidate component; refresh the preview if it changed",e.json);NS(s,e.json)},$tt=async(e)=>{let t=Dm(e),n=I(await t.components.relationships.list({includeHistorical:e.includeHistorical}),"Failed to list component relationships",e.json);G({layout:"field-list",schema:{relationships:{label:"Relationships",type:HM}},fields:["relationships"],title:"Component relationships"},n,{json:e.json})},Gtt=async(e,t)=>{if(!t.sourceComponentId||!t.targetComponentId||t.relationshipType!=="part_of"&&t.relationshipType!=="depends_on"){if(t.json)return b("Source, target, and relationship type (part_of or depends_on) are required.");return y("Source, target, and relationship type (part_of or depends_on) are required.")}let n=Dm(t),r={action:e,sourceComponentId:t.sourceComponentId,targetComponentId:t.targetComponentId,relationshipType:t.relationshipType},o=_m(t.confirmPreviewRevision,"Confirm preview revision",t.json);if(!o){let l=I(await n.components.relationships.preview(r),"Failed to preview component relationship",t.json);VM(l,t.json);return}let i=t.reason?.trim();if(!t.requestId||!i){if(t.json)return b("Commit requires --request-id and --reason with --confirm-preview-revision.");return y("Commit requires --request-id and --reason with --confirm-preview-revision.")}let s={sourceComponentId:r.sourceComponentId,targetComponentId:r.targetComponentId,relationshipType:r.relationshipType,requestId:t.requestId,reason:i,componentRevisions:o,confirmPolicyImpact:t.confirmPolicyImpact??!1},c=I(e==="add"?await n.components.relationships.add(s):await n.components.relationships.remove(s),`Failed to ${e} component relationship; refresh the preview if it changed`,t.json);NS(c,t.json)},LS={...L,"confirm-preview-revision":{type:"string"},"request-id":{type:"string"},reason:{type:"string"}},QS={..._,"confirm-preview-revision":{type:"string",description:"Exact componentRevisions JSON from the preview; omit to preview only"},"request-id":{type:"string",description:"Project-scoped UUID idempotency key required for commit"},reason:{type:"string",description:"Audit reason required for commit"}},HAe=(e)=>C(e,`${e==="add"?"Add":"End"} a component relationship`,async(t)=>{let{values:n}=E(t,{...LS,source:{type:"string"},target:{type:"string"},type:{type:"string"},"confirm-policy-impact":{type:"boolean"}});await Gtt(e,{token:n.token,json:n.json,apiBaseUrl:n["api-base-url"],sourceComponentId:n.source,targetComponentId:n.target,relationshipType:n.type,confirmPreviewRevision:n["confirm-preview-revision"],requestId:n["request-id"],reason:n.reason,confirmPolicyImpact:n["confirm-policy-impact"]})}).withOptions({...QS,source:{type:"string",description:"Source component ID"},target:{type:"string",description:"Target component ID"},type:{type:"string",description:"Relationship type: part_of or depends_on"},"confirm-policy-impact":{type:"boolean",description:"Confirm the policy-scope delta shown by the preview"}}).withExamples([`sazabi components relationships ${e} --source <component-id> --target <component-id> --type part_of # Preview a parent-child topology change`]).build(),qtt=ie("relationships","Inspect and edit component topology").withSubcommands({list:C("list","List component relationships",async(e)=>{let{values:t}=E(e,{...L,"include-historical":{type:"boolean"}});await $tt({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],includeHistorical:t["include-historical"]})}).withOptions({..._,"include-historical":{type:"boolean",description:"Include historically ended relationships"}}).build(),add:HAe("add"),remove:HAe("remove")}).build(),KAe=ie("components","Manage status page components").withSubcommands({list:C("list","List components in the active project",async(e)=>{let{values:t}=E(e,{...L,limit:{type:"string"},cursor:{type:"string"},"include-deleted":{type:"boolean"}});await Qtt({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],limit:t.limit?Number(t.limit):void 0,cursor:t.cursor,includeDeleted:t["include-deleted"]})}).withOptions({..._,limit:{type:"string",description:"Maximum number of components to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"},"include-deleted":{type:"boolean",description:"Include deregistered components"}}).withExamples(["sazabi components list # List all components","sazabi components list --include-deleted # Include deregistered components"]).build(),get:C("get","Get one component by ID",async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await Ntt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<component-id>").withOptions(_).withExamples(["sazabi components get <component-id> # Get one component"]).build(),scan:qAe,register:C("register","Register or refresh a component",async(e)=>{let{values:t}=E(e,{...L,name:{type:"string"},description:{type:"string"},origin:{type:"string"}});await Mtt({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],name:t.name,description:t.description,origin:t.origin})}).withOptions({..._,name:{type:"string",description:"Component name to register"},description:{type:"string",description:"Optional component description"},origin:{type:"string",description:"Machine provenance: 'code_detected' (inferred from code) or 'log_observed' (inferred from telemetry, the default)"}}).withExamples(['sazabi components register --name "API Gateway" # Register a component','sazabi components register --name "Checkout" --description "Checkout API and workflow" # Register with description','sazabi components register --name "intake-consumer" --origin code_detected # Register a component inferred from repository analysis']).build(),deregister:C("deregister","Withdraw an observation, or preview and confirm a deregistration",async(e)=>{let{values:t,positionals:n}=E(e,{...LS,"confirm-canonical-group":{type:"boolean"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await ztt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],reason:t.reason,confirmPreviewRevision:t["confirm-preview-revision"],requestId:t["request-id"],confirmCanonicalGroup:t["confirm-canonical-group"]})}).withPositionalArgs("<component-id>").withOptions({...QS,reason:{type:"string",description:"Deregistration reason; optional for withdrawal and preview, required for commit"},"confirm-canonical-group":{type:"boolean",description:"Confirm the complete canonical group"}}).withExamples(["sazabi components deregister <component-id> # Withdraw an observation or preview the impact",`sazabi components deregister <component-id> --confirm-preview-revision '{"<component-id>":7}' --request-id <uuid> --reason "replaced by the worker service" # Commit the deregistration`]).build(),rename:C("rename","Rename an active component",async(e)=>{let{values:t,positionals:n}=E(e,{...L,name:{type:"string"},"request-id":{type:"string"},reason:{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await jtt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],name:t.name,requestId:t["request-id"],reason:t.reason})}).withPositionalArgs("<component-id>").withOptions({..._,name:{type:"string",description:"New component name"},"request-id":{type:"string",description:"Project-scoped UUID idempotency key"},reason:{type:"string",description:"Audit reason for the rename"}}).build(),reactivate:C("reactivate","Preview or confirm component reactivation",async(e)=>{let{values:t,positionals:n}=E(e,{...LS,"deregistration-operation-id":{type:"string"},"notification-rule-ids":{type:"string"},"automation-binding-ids":{type:"string"},"relationship-ids":{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await Utt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],confirmPreviewRevision:t["confirm-preview-revision"],requestId:t["request-id"],reason:t.reason,deregistrationOperationId:t["deregistration-operation-id"],notificationRuleIds:t["notification-rule-ids"],automationBindingIds:t["automation-binding-ids"],relationshipIds:t["relationship-ids"]})}).withPositionalArgs("<component-id>").withOptions({...QS,"deregistration-operation-id":{type:"string",description:"Deregistration operation ID returned by the preview"},"notification-rule-ids":{type:"string",description:"Comma-separated eligible notification rule IDs"},"automation-binding-ids":{type:"string",description:"Comma-separated eligible automation binding IDs"},"relationship-ids":{type:"string",description:"Comma-separated eligible relationship IDs"}}).build(),merge:C("merge","Preview or confirm present-day component consolidation",async(e)=>{let{values:t}=E(e,{...LS,source:{type:"string"},target:{type:"string"},"policy-dispositions":{type:"string"},"confirm-policy-impact":{type:"boolean"}});await Ftt({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],sourceComponentId:t.source,targetComponentId:t.target,confirmPreviewRevision:t["confirm-preview-revision"],requestId:t["request-id"],reason:t.reason,policyDispositions:t["policy-dispositions"],confirmPolicyImpact:t["confirm-policy-impact"]})}).withOptions({...QS,source:{type:"string",description:"Source component ID"},target:{type:"string",description:"Target component ID"},"policy-dispositions":{type:"string",description:"Exact non-equivalent policy disposition JSON"},"confirm-policy-impact":{type:"boolean",description:"Confirm every previewed policy-scope change"}}).withExamples(["sazabi components merge --source <component-id> --target <component-id> # Preview only"]).build(),relationships:qtt}).withExamples(["sazabi components list # List all components","sazabi components get <component-id> # Get one component",'sazabi components register --name "API Gateway" # Register a component',"sazabi components deregister <component-id> # Deregister a component"]).build();oe();Ha();ye();ce();var JAe={provider:{label:"Provider",type:{kind:"string"}},externalName:{label:"Name",type:{kind:"nullable-string"}},externalLogin:{label:"Login",type:{kind:"nullable-string"}},connectedAt:{label:"Connected",type:{kind:"nullable-date"}},authMode:{label:"Auth mode",type:{kind:"nullable-string"}},needsReconnect:{label:"Needs reconnect",type:{kind:"custom",render:(e)=>e?"yes":"no",serialize:(e)=>Boolean(e)}}},Htt={schema:JAe,columns:["provider","externalName","externalLogin","connectedAt","needsReconnect"],header:"Connected accounts",emptyMessage:"No connected accounts found."},Vtt={layout:"field-list",schema:JAe,fields:["provider","externalName","externalLogin","connectedAt","authMode","needsReconnect"],title:"Connected account"},Ktt={provider:{label:"Provider",type:{kind:"string"}}},Ytt={schema:Ktt,columns:["provider"],header:"Connected account providers",emptyMessage:"No providers found."},Lm=(e)=>{let t=e.json,n=Q({tokenFlag:e.token,jsonMode:t});return{client:N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:t}),json:t}},Wtt=3000,Jtt={vendor_denied:"The authorization was declined in the provider.",not_authorized:"The browser was not signed in to the Sazabi dashboard as your user. Sign in with the same account and run connect again.",state_expired:"The browser flow took too long and expired. Run connect again."},YAe=async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Provider is required.");return y("Provider is required. Available: github, google, microsoft, linear, bitbucket, slack")}let{client:i}=Lm(t),s=I(await i.connectedAccounts.beginConnect({provider:r}),`Couldn't start the ${r} connect flow`,o);if(!o)Ae(`Connect ${r}`),q("Complete the authorization in a browser where you're signed in to the Sazabi dashboard as the same user."),q(`Opening ${Z.info(s.url)}`);if(fi(s.url),!o)q("Waiting for the browser flow to complete...");let c=new Date(s.expiresAt).getTime()+15000;while(Date.now()<c){await jr(Wtt);let u=I(await i.connectedAccounts.getConnectAttempt(s.attemptId),"Couldn't poll the connect attempt (try again)",o);if(u.status==="pending")continue;if(u.status==="completed"){if(!o)z(`Connected ${r}.`);if(o)j({status:"completed",provider:r});return}if(u.status==="failed"){let d=u.errorCode??"unknown",p=Jtt[d],g=p?`Connect did not complete (${d}). ${p}`:`Connect failed (${d}). Run the command again.`;if(o)return b(g);return y(g)}break}let l="The browser flow didn't complete in time. Run the command again.";if(o)return b(l);return y(l)},Ztt=async(e)=>{let{values:t}=E(e,L),{client:n,json:r}=Lm(t),{accounts:o}=I(await n.connectedAccounts.list(),"Couldn't list connected accounts (try again)",r);H(Htt,o,{json:r})},Xtt=async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Provider is required.");return y("Provider is required. Run 'sazabi connected-accounts list' to see connected providers.")}let{client:i}=Lm(t);if(I(await i.connectedAccounts.disconnect({provider:r}),"Couldn't disconnect the connected account",o),o){j({success:!0});return}z(`Disconnected ${r}.`)},WAe=async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Provider is required.");return y("Provider is required. Run 'sazabi connected-accounts list' to see connected providers.")}let{client:i}=Lm(t),{accounts:s}=I(await i.connectedAccounts.list(),"Couldn't list connected accounts (try again)",o),c=s.find((l)=>l.provider===r);if(!c){let l=`No connected account found for provider '${r}'.`;if(o)return b(l);return y(l)}G(Vtt,c,{json:o})},ent=async(e)=>{let{values:t}=E(e,L),{json:n}=Lm(t),r=If.map((o)=>({provider:o}));H(Ytt,r,{json:n})},ZAe=ie("connected-accounts","Manage personal connected accounts (GitHub, Google, Microsoft, Linear, Bitbucket, Slack)").withSubcommands({connect:C("connect","Connect a personal account via a browser OAuth flow",YAe).withPositionalArgs("<provider>").withOptions(_).withExamples(["sazabi connected-accounts connect github # Connect GitHub","sazabi connected-accounts connect google # Connect Google","sazabi connected-accounts connect slack # Connect Slack"]).build(),list:C("list","List connected accounts for the organization",Ztt).withOptions(_).withExamples(["sazabi connected-accounts list # List connected accounts","sazabi connected-accounts list --json # Machine-readable output"]).build(),get:C("get","Get one connected account by provider",WAe).withPositionalArgs("<provider>").withOptions(_).withExamples(["sazabi connected-accounts get github # Show GitHub connected account","sazabi connected-accounts get slack --json # Machine-readable output"]).build(),details:C("details","Show details for one connected account",WAe).withPositionalArgs("<provider>").withOptions(_).withExamples(["sazabi connected-accounts details github # Show GitHub connected account detail"]).build(),providers:C("providers","List supported connected account providers",ent).withOptions(_).withExamples(["sazabi connected-accounts providers # List all providers","sazabi connected-accounts providers --json # Machine-readable output"]).build(),disconnect:C("disconnect","Disconnect a personal connected account",Xtt).withPositionalArgs("<provider>").withOptions(_).withExamples(["sazabi connected-accounts disconnect github # Disconnect GitHub"]).build(),"update-credentials":C("update-credentials","Reconnect a provider to refresh its OAuth token",YAe).withPositionalArgs("<provider>").withOptions(_).withExamples(["sazabi connected-accounts update-credentials github # Re-run the GitHub OAuth flow","sazabi connected-accounts update-credentials slack # Refresh Slack token"]).build()}).withExamples(["sazabi connected-accounts list # List connected accounts","sazabi connected-accounts get github # Show GitHub account","sazabi connected-accounts providers # List available providers","sazabi connected-accounts connect github # Connect GitHub via browser","sazabi connected-accounts disconnect github # Disconnect GitHub","sazabi connected-accounts update-credentials github # Refresh GitHub token"]).build();oe();ye();ce();var tnt={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},authType:{label:"Auth",type:{kind:"string"}},capabilities:{label:"Capabilities",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"",serialize:(e)=>e??[]}},connectionCount:{label:"Connections",type:{kind:"number"}},browserConnectSupported:{label:"Browser connect",type:{kind:"custom",render:(e)=>e?"yes":"no",serialize:(e)=>Boolean(e)}},credentialFields:{label:"Credential fields",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.map((t)=>t.name).join(", "):"",serialize:(e)=>e??null}}},nnt={schema:tnt,columns:["id","name","authType","capabilities","connectionCount"],jsonFields:["id","name","authType","capabilities","connectionCount","browserConnectSupported","credentialFields"],header:"Integration providers",emptyMessage:"No integration providers found."},tfe={id:{label:"ID",type:{kind:"string"}},provider:{label:"Provider",type:{kind:"string"}},displayName:{label:"Name",type:{kind:"nullable-string"}},status:{label:"Status",type:{kind:"string"}},healthStatus:{label:"Health",type:{kind:"string"}},metadata:{label:"Metadata",type:{kind:"custom",render:(e)=>e==null?"":JSON.stringify(e),serialize:(e)=>e??null}},healthMessage:{label:"Health detail",type:{kind:"nullable-string"}},healthCheckedAt:{label:"Health checked",type:{kind:"nullable-date"}},healthConsecutiveFailures:{label:"Health failures",type:{kind:"number"}},connectedBy:{label:"Connected by",type:{kind:"nullable-string"}},createdAt:{label:"Created",type:{kind:"date"}},updatedAt:{label:"Updated",type:{kind:"date"}}},ont={schema:tfe,columns:["id","provider","displayName","status","healthStatus"],header:"Integration connections",emptyMessage:"No integration connections found."},KM={layout:"field-list",schema:tfe,fields:["id","provider","displayName","status","metadata","healthStatus","healthMessage","healthCheckedAt","healthConsecutiveFailures","connectedBy","createdAt","updatedAt"],title:"Integration connection"},Yu=(e)=>{let t=e.json,n=Q({tokenFlag:e.token,jsonMode:t});return{client:N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:t}),json:t}},rnt=async(e)=>{let{values:t}=E(e,L),{client:n,json:r}=Yu(t),{providers:o}=I(await n.integrations.listProviders(),"Couldn't list integration providers (try again)",r),i=[...o].sort((s,c)=>s.name.localeCompare(c.name));H(nnt,i,{json:r})},int=async(e)=>{let{values:t}=E(e,{...L,provider:{type:"string"}}),{client:n,json:r}=Yu(t),{connections:o}=I(await n.integrations.listConnections({provider:t.provider}),"Couldn't list integration connections (check your organization access and try again)",r);H(ont,o,{json:r})},XAe=async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Connection ID is required.");return y("Connection ID is required.")}let{client:o,json:i}=Yu(t),{connection:s}=I(await o.integrations.getConnection(r),"Couldn't get integration connection (run 'sazabi integrations list' to see connection IDs)",i);G(KM,s,{json:i})},snt=3000,efe={installation_requested:"The install needs approval from a GitHub organization admin. The connection will appear once they approve — no need to rerun connect.",vendor_denied:"The authorization was declined in the provider.",not_authorized:"The browser wasn't signed in to the Sazabi dashboard as your user. Sign in with the same account and run connect again.",state_expired:"The browser flow took too long and expired. Run connect again."},ant=(e)=>e.map((t)=>` ${t.name}${t.required?"":" (optional)"} — ${t.label}`).join(`
|
|
8966
|
+
`)){if(/^services\s*:\s*(#.*)?$/.test(s)){o=!0,i=void 0;continue}if(!o)continue;if(/^\S/.test(s)){o=!1;continue}let c=s.match(/^(\s+)([A-Za-z0-9_.-]+)\s*:\s*(#.*)?$/);if(!c)continue;let l=c[1].length;if(i??=l,l!==i)continue;r.push({name:c[2],description:"docker compose service",dir:"."})}return r},FM=(e)=>{let t=$Ae(eo.join(e,"package.json")),n=[...ytt(t),...btt(e)],r=[...Itt(e,n),...Stt(e),...Ctt(e)],o=n.length===0?UM(e):void 0;if(o)r.push({name:o,description:"root package",dir:"."});let i=new Set;return r.filter((s)=>{if(i.has(s.name))return!1;return i.add(s.name),!0})};ce();var vtt={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},origin:{label:"Origin",type:{kind:"string"}},lifecycle:{label:"Lifecycle",type:{kind:"string"}}},wtt={schema:vtt,columns:["id","name","origin","lifecycle"],header:"Registered components",emptyMessage:"No components registered."},$M=async(e)=>{let{client:t,json:n}=e,r=e.rootDir??process.cwd(),o=FM(r);if(o.length===0)return Fo("No component candidates detected. Register one with 'sazabi components register --name <name>'."),[];let i=await Bm({message:"Select the components to register",choices:o.map((c)=>({label:c.name,value:c,hint:`${c.description}, ${c.dir}`,preselected:!0}))});if(i.length===0)return q("Nothing selected. No components registered."),[];let s=[];for(let c of i){let l=I(await t.components.register({name:c.name,description:c.description}),`Failed to register component ${c.name}`,n);z(`Component ${l.component.name} registered.`),s.push({id:l.component.id,name:l.component.name,origin:l.component.origin,lifecycle:l.component.lifecycle})}return H(wtt,s,{json:n}),s},Ett=async(e)=>{let{values:t}=E(e,{...L,dir:{type:"string"}}),n=t.json,r=t.dir??process.cwd();if(n||!yi()){j({candidates:FM(r)});return}let o=Q({jsonMode:n}),i=N({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:t["api-base-url"],jsonMode:n});await $M({client:i,rootDir:r,json:n})},qAe=C("scan","Detect component candidates in the working tree (propose-only)",Ett).withOptions({..._,dir:{type:"string",description:"Directory to scan (default: current directory)"}}).withExamples(["sazabi components scan # Detect candidates and confirm which to register","sazabi components scan --json # Print candidates only, register nothing"]).build();var VAe={id:{label:"ID",type:{kind:"string"}},projectId:{label:"Project",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},currentStatus:{label:"Status",type:{kind:"string"}},description:{label:"Description",type:{kind:"nullable-string"}},origin:{label:"Origin",type:{kind:"string"}},lifecycle:{label:"Lifecycle",type:{kind:"string"}},observationState:{label:"Observation",type:{kind:"string"}},registryRevision:{label:"Revision",type:{kind:"number"}},canonicalComponentId:{label:"Canonical component",type:{kind:"id"}},mergedIntoComponentId:{label:"Merged into",type:{kind:"nullable-string"}},firstSeenAt:{label:"Created at",type:{kind:"date"}},lastSeenAt:{label:"Last seen",type:{kind:"date"}},deletedAt:{label:"Deleted at",type:{kind:"nullable-date"}},inactiveAt:{label:"Inactive at",type:{kind:"nullable-date"}},inactiveReason:{label:"Inactive reason",type:{kind:"nullable-string"}},legacyStateUnknown:{label:"Legacy inactive",type:{kind:"boolean"}}},ktt={schema:VAe,columns:["id","name","lifecycle","observationState","currentStatus"],jsonFields:["id","projectId","name","currentStatus","description","origin","lifecycle","observationState","registryRevision","canonicalComponentId","mergedIntoComponentId","firstSeenAt","lastSeenAt","deletedAt","inactiveAt","inactiveReason","legacyStateUnknown"],emptyMessage:"No components found. Register one with 'sazabi components register --name <name>'."},qM={layout:"field-list",schema:VAe,fields:["id","projectId","name","currentStatus","description","origin","lifecycle","observationState","registryRevision","canonicalComponentId","mergedIntoComponentId","firstSeenAt","lastSeenAt","deletedAt","inactiveAt","inactiveReason","legacyStateUnknown"],title:"Component"},xtt={status:{label:"Status",type:{kind:"string"}},componentId:{label:"Component ID",type:{kind:"id"}},sourceType:{label:"Source type",type:{kind:"string"}},withdrawn:{label:"Withdrawn",type:{kind:"boolean"}}},Ptt={layout:"field-list",schema:xtt,fields:["status","componentId","sourceType","withdrawn"],title:"Component observation"},Rtt=(e)=>{let t=e,n=Object.values(t.counts).reduce((r,o)=>r+o,0);return`${t.canonicalComponentName} (${t.canonicalComponentId}); ${t.affectedComponentIds.length} component(s), ${n} dependent(s); no changes applied`},Ttt={status:{label:"Status",type:{kind:"string"}},preview:{label:"Deregistration preview",type:{kind:"custom",render:Rtt,serialize:(e)=>e}}},Btt={layout:"field-list",schema:Ttt,fields:["status","preview"],title:"Deregistration confirmation required"},_m=(e,t,n)=>{if(e===void 0)return;try{let r=JSON.parse(e);if(!r||typeof r!=="object"||Array.isArray(r))throw Error("must be a JSON object");return r}catch(r){let o=`${t} must be valid JSON: ${r instanceof Error?r.message:String(r)}`;if(n)return b(o);return y(o)}},GM=(e)=>e?e.split(",").map((t)=>t.trim()).filter(Boolean):[],HM={kind:"custom",render:(e)=>JSON.stringify(e,null,2),serialize:(e)=>e},Ott={preview:{label:"Preview",type:HM}},_tt={layout:"field-list",schema:Ott,fields:["preview"],title:"Component operation preview"},Dtt={result:{label:"Result",type:HM}},Ltt={layout:"field-list",schema:Dtt,fields:["result"],title:"Component operation result"},VM=(e,t)=>G(_tt,e,{json:t}),NS=(e,t)=>G(Ltt,e,{json:t}),Qtt=async(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json}),n=N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=I(await n.components.list({limit:e.limit,cursor:e.cursor,includeDeleted:e.includeDeleted}),"Couldn't list components (check the active project and try again)",e.json);H(ktt,r.components,{json:e.json,nextCursor:r.nextCursor})},Ntt=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.components.get(e),"Couldn't get component (run 'sazabi components list' to see component IDs)",t.json);G(qM,o.component,{json:t.json})},Mtt=async(e)=>{let t=e.name?.trim(),n=e.description?.trim(),r=e.origin?.trim();if(!t){if(e.json)return b("Name is required.");return y("Name is required.")}if(e.description!==void 0&&!n){if(e.json)return b("Description cannot be empty.");return y("Description cannot be empty.")}if(r!==void 0&&r!=="code_detected"&&r!=="log_observed"){if(e.json)return b("Invalid origin. Use 'code_detected' (inferred from code) or 'log_observed' (inferred from telemetry).");return y("Invalid origin. Use 'code_detected' (inferred from code) or 'log_observed' (inferred from telemetry).")}let o=Q({tokenFlag:e.token,jsonMode:e.json}),i=N({token:o.token,organizationId:o.organizationId,projectId:o.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),s=I(await i.components.register({name:t,...n?{description:n}:{},...r?{origin:r}:{}}),"Failed to register component",e.json);G(qM,s.component,{json:e.json})},ztt=async(e,t)=>{let n=t.reason?.trim();if(t.reason!==void 0&&!n){if(t.json)return b("Reason cannot be empty.");return y("Reason cannot be empty.")}let r=Q({tokenFlag:t.token,jsonMode:t.json}),o=N({token:r.token,organizationId:r.organizationId,projectId:r.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),i=_m(t.confirmPreviewRevision,"Confirm preview revision",t.json);if(i&&(!t.requestId||!n)){if(t.json)return b("Commit requires --request-id and --reason with --confirm-preview-revision.");return y("Commit requires --request-id and --reason with --confirm-preview-revision.")}let s=I(await o.components.deregister(i&&t.requestId&&n?{componentId:e,requestId:t.requestId,reason:n,componentRevisions:i,confirmCanonicalGroup:t.confirmCanonicalGroup??!1}:{componentId:e,confirmCanonicalGroup:t.confirmCanonicalGroup??!1,...n!==void 0?{reason:n}:{}}),"Failed to deregister component; refresh the preview if it changed",t.json);if(s.status==="observation_withdrawn"){G(Ptt,s,{json:t.json});return}if(s.status==="deregistration_confirmation_required"){G(Btt,s,{json:t.json});return}NS(s,t.json)},Dm=(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json});return N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json})},jtt=async(e,t)=>{let n=t.name?.trim(),r=t.reason?.trim();if(!n){if(t.json)return b("Name is required.");return y("Name is required.")}if(!t.requestId){if(t.json)return b("Request ID is required.");return y("Request ID is required.")}if(!r){if(t.json)return b("Reason is required.");return y("Reason is required.")}let o=Dm(t),i=I(await o.components.rename({componentId:e,name:n,requestId:t.requestId,reason:r}),"Failed to rename component",t.json);G(qM,i.component,{json:t.json})},Utt=async(e,t)=>{let n=Dm(t),r=_m(t.confirmPreviewRevision,"Confirm preview revision",t.json);if(!r){let s=I(await n.components.reactivationPreview({componentId:e,...t.deregistrationOperationId?{deregistrationOperationId:t.deregistrationOperationId}:{}}),"Failed to preview component reactivation",t.json);VM(s,t.json);return}let o=t.reason?.trim();if(!t.requestId||!t.deregistrationOperationId||!o){if(t.json)return b("Commit requires --request-id, --deregistration-operation-id, and --reason with --confirm-preview-revision.");return y("Commit requires --request-id, --deregistration-operation-id, and --reason with --confirm-preview-revision.")}let i=I(await n.components.reactivate({componentId:e,deregistrationOperationId:t.deregistrationOperationId,requestId:t.requestId,reason:o,componentRevisions:r,selections:{notificationRuleIds:GM(t.notificationRuleIds),automationBindingIds:GM(t.automationBindingIds),recommendationScopeIds:[],relationshipIds:GM(t.relationshipIds)}}),"Failed to reactivate component; refresh the preview if it changed",t.json);NS(i,t.json)},Ftt=async(e)=>{if(!e.sourceComponentId||!e.targetComponentId){if(e.json)return b("Source and target component IDs are required.");return y("Source and target component IDs are required.")}let t=Dm(e),n={sourceComponentId:e.sourceComponentId,targetComponentId:e.targetComponentId},r=_m(e.confirmPreviewRevision,"Confirm preview revision",e.json);if(!r){let c=I(await t.components.mergePreview(n),"Failed to preview component consolidation",e.json);VM(c,e.json);return}let o=e.reason?.trim(),i=_m(e.policyDispositions,"Policy dispositions",e.json);if(!e.requestId||!o||!i){if(e.json)return b("Commit requires --request-id, --reason, and --policy-dispositions with --confirm-preview-revision.");return y("Commit requires --request-id, --reason, and --policy-dispositions with --confirm-preview-revision.")}let s=I(await t.components.merge({...n,requestId:e.requestId,reason:o,componentRevisions:r,policyDispositions:i,confirmPolicyImpact:e.confirmPolicyImpact??!1}),"Failed to consolidate component; refresh the preview if it changed",e.json);NS(s,e.json)},$tt=async(e)=>{let t=Dm(e),n=I(await t.components.relationships.list({includeHistorical:e.includeHistorical}),"Failed to list component relationships",e.json);G({layout:"field-list",schema:{relationships:{label:"Relationships",type:HM}},fields:["relationships"],title:"Component relationships"},n,{json:e.json})},Gtt=async(e,t)=>{if(!t.sourceComponentId||!t.targetComponentId||t.relationshipType!=="part_of"&&t.relationshipType!=="depends_on"){if(t.json)return b("Source, target, and relationship type (part_of or depends_on) are required.");return y("Source, target, and relationship type (part_of or depends_on) are required.")}let n=Dm(t),r={action:e,sourceComponentId:t.sourceComponentId,targetComponentId:t.targetComponentId,relationshipType:t.relationshipType},o=_m(t.confirmPreviewRevision,"Confirm preview revision",t.json);if(!o){let l=I(await n.components.relationships.preview(r),"Failed to preview component relationship",t.json);VM(l,t.json);return}let i=t.reason?.trim();if(!t.requestId||!i){if(t.json)return b("Commit requires --request-id and --reason with --confirm-preview-revision.");return y("Commit requires --request-id and --reason with --confirm-preview-revision.")}let s={sourceComponentId:r.sourceComponentId,targetComponentId:r.targetComponentId,relationshipType:r.relationshipType,requestId:t.requestId,reason:i,componentRevisions:o,confirmPolicyImpact:t.confirmPolicyImpact??!1},c=I(e==="add"?await n.components.relationships.add(s):await n.components.relationships.remove(s),`Failed to ${e} component relationship; refresh the preview if it changed`,t.json);NS(c,t.json)},LS={...L,"confirm-preview-revision":{type:"string"},"request-id":{type:"string"},reason:{type:"string"}},QS={..._,"confirm-preview-revision":{type:"string",description:"Exact componentRevisions JSON from the preview; omit to preview only"},"request-id":{type:"string",description:"Project-scoped UUID idempotency key required for commit"},reason:{type:"string",description:"Audit reason required for commit"}},HAe=(e)=>C(e,`${e==="add"?"Add":"End"} a component relationship`,async(t)=>{let{values:n}=E(t,{...LS,source:{type:"string"},target:{type:"string"},type:{type:"string"},"confirm-policy-impact":{type:"boolean"}});await Gtt(e,{token:n.token,json:n.json,apiBaseUrl:n["api-base-url"],sourceComponentId:n.source,targetComponentId:n.target,relationshipType:n.type,confirmPreviewRevision:n["confirm-preview-revision"],requestId:n["request-id"],reason:n.reason,confirmPolicyImpact:n["confirm-policy-impact"]})}).withOptions({...QS,source:{type:"string",description:"Source component ID"},target:{type:"string",description:"Target component ID"},type:{type:"string",description:"Relationship type: part_of or depends_on"},"confirm-policy-impact":{type:"boolean",description:"Confirm the policy-scope delta shown by the preview"}}).withExamples([`sazabi components relationships ${e} --source <component-id> --target <component-id> --type part_of # Preview a parent-child topology change`]).build(),qtt=ie("relationships","Inspect and edit component topology").withSubcommands({list:C("list","List component relationships",async(e)=>{let{values:t}=E(e,{...L,"include-historical":{type:"boolean"}});await $tt({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],includeHistorical:t["include-historical"]})}).withOptions({..._,"include-historical":{type:"boolean",description:"Include historically ended relationships"}}).build(),add:HAe("add"),remove:HAe("remove")}).build(),KAe=ie("components","Manage status page components").withSubcommands({list:C("list","List components in the active project",async(e)=>{let{values:t}=E(e,{...L,limit:{type:"string"},cursor:{type:"string"},"include-deleted":{type:"boolean"}});await Qtt({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],limit:t.limit?Number(t.limit):void 0,cursor:t.cursor,includeDeleted:t["include-deleted"]})}).withOptions({..._,limit:{type:"string",description:"Maximum number of components to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"},"include-deleted":{type:"boolean",description:"Include deregistered components"}}).withExamples(["sazabi components list # List all components","sazabi components list --include-deleted # Include deregistered components"]).build(),get:C("get","Get one component by ID",async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await Ntt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<component-id>").withOptions(_).withExamples(["sazabi components get <component-id> # Get one component"]).build(),scan:qAe,register:C("register","Register or refresh a component",async(e)=>{let{values:t}=E(e,{...L,name:{type:"string"},description:{type:"string"},origin:{type:"string"}});await Mtt({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],name:t.name,description:t.description,origin:t.origin})}).withOptions({..._,name:{type:"string",description:"Component name to register"},description:{type:"string",description:"Optional component description"},origin:{type:"string",description:"Machine provenance: 'code_detected' (inferred from code) or 'log_observed' (inferred from telemetry, the default)"}}).withExamples(['sazabi components register --name "API Gateway" # Register a component','sazabi components register --name "Checkout" --description "Checkout API and workflow" # Register with description','sazabi components register --name "intake-consumer" --origin code_detected # Register a component inferred from repository analysis']).build(),deregister:C("deregister","Withdraw an observation, or preview and confirm a deregistration",async(e)=>{let{values:t,positionals:n}=E(e,{...LS,"confirm-canonical-group":{type:"boolean"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await ztt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],reason:t.reason,confirmPreviewRevision:t["confirm-preview-revision"],requestId:t["request-id"],confirmCanonicalGroup:t["confirm-canonical-group"]})}).withPositionalArgs("<component-id>").withOptions({...QS,reason:{type:"string",description:"Deregistration reason; optional for withdrawal and preview, required for commit"},"confirm-canonical-group":{type:"boolean",description:"Confirm the complete canonical group"}}).withExamples(["sazabi components deregister <component-id> # Withdraw an observation or preview the impact",`sazabi components deregister <component-id> --confirm-preview-revision '{"<component-id>":7}' --request-id <uuid> --reason "replaced by the worker service" # Commit the deregistration`]).build(),rename:C("rename","Rename an active component",async(e)=>{let{values:t,positionals:n}=E(e,{...L,name:{type:"string"},"request-id":{type:"string"},reason:{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await jtt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],name:t.name,requestId:t["request-id"],reason:t.reason})}).withPositionalArgs("<component-id>").withOptions({..._,name:{type:"string",description:"New component name"},"request-id":{type:"string",description:"Project-scoped UUID idempotency key"},reason:{type:"string",description:"Audit reason for the rename"}}).build(),reactivate:C("reactivate","Preview or confirm component reactivation",async(e)=>{let{values:t,positionals:n}=E(e,{...LS,"deregistration-operation-id":{type:"string"},"notification-rule-ids":{type:"string"},"automation-binding-ids":{type:"string"},"relationship-ids":{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return y("Component ID is required.")}await Utt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],confirmPreviewRevision:t["confirm-preview-revision"],requestId:t["request-id"],reason:t.reason,deregistrationOperationId:t["deregistration-operation-id"],notificationRuleIds:t["notification-rule-ids"],automationBindingIds:t["automation-binding-ids"],relationshipIds:t["relationship-ids"]})}).withPositionalArgs("<component-id>").withOptions({...QS,"deregistration-operation-id":{type:"string",description:"Deregistration operation ID returned by the preview"},"notification-rule-ids":{type:"string",description:"Comma-separated eligible notification rule IDs"},"automation-binding-ids":{type:"string",description:"Comma-separated eligible automation binding IDs"},"relationship-ids":{type:"string",description:"Comma-separated eligible relationship IDs"}}).build(),merge:C("merge","Preview or confirm present-day component consolidation",async(e)=>{let{values:t}=E(e,{...LS,source:{type:"string"},target:{type:"string"},"policy-dispositions":{type:"string"},"confirm-policy-impact":{type:"boolean"}});await Ftt({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],sourceComponentId:t.source,targetComponentId:t.target,confirmPreviewRevision:t["confirm-preview-revision"],requestId:t["request-id"],reason:t.reason,policyDispositions:t["policy-dispositions"],confirmPolicyImpact:t["confirm-policy-impact"]})}).withOptions({...QS,source:{type:"string",description:"Source component ID"},target:{type:"string",description:"Target component ID"},"policy-dispositions":{type:"string",description:"Exact non-equivalent policy disposition JSON"},"confirm-policy-impact":{type:"boolean",description:"Confirm every previewed policy-scope change"}}).withExamples(["sazabi components merge --source <component-id> --target <component-id> # Preview only"]).build(),relationships:qtt}).withExamples(["sazabi components list # List all components","sazabi components get <component-id> # Get one component",'sazabi components register --name "API Gateway" # Register a component',"sazabi components deregister <component-id> # Deregister a component"]).build();oe();Ha();ye();ce();var JAe={provider:{label:"Provider",type:{kind:"string"}},externalName:{label:"Name",type:{kind:"nullable-string"}},externalLogin:{label:"Login",type:{kind:"nullable-string"}},connectedAt:{label:"Connected",type:{kind:"nullable-date"}},authMode:{label:"Auth mode",type:{kind:"nullable-string"}},needsReconnect:{label:"Needs reconnect",type:{kind:"custom",render:(e)=>e?"yes":"no",serialize:(e)=>Boolean(e)}}},Htt={schema:JAe,columns:["provider","externalName","externalLogin","connectedAt","needsReconnect"],header:"Connected accounts",emptyMessage:"No connected accounts found."},Vtt={layout:"field-list",schema:JAe,fields:["provider","externalName","externalLogin","connectedAt","authMode","needsReconnect"],title:"Connected account"},Ktt={provider:{label:"Provider",type:{kind:"string"}}},Ytt={schema:Ktt,columns:["provider"],header:"Connected account providers",emptyMessage:"No providers found."},Lm=(e)=>{let t=e.json,n=Q({tokenFlag:e.token,jsonMode:t});return{client:N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:t}),json:t}},Wtt=3000,Jtt={vendor_denied:"The authorization was declined in the provider.",not_authorized:"The browser was not signed in to the Sazabi dashboard as your user. Sign in with the same account and run connect again.",state_expired:"The browser flow took too long and expired. Run connect again."},YAe=async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Provider is required.");return y("Provider is required. Available: github, google, microsoft, linear, bitbucket, slack")}let{client:i}=Lm(t),s=I(await i.connectedAccounts.beginConnect({provider:r}),`Couldn't start the ${r} connect flow`,o);if(!o)Ae(`Connect ${r}`),q("Complete the authorization in a browser where you're signed in to the Sazabi dashboard as the same user."),q(`Opening ${Z.info(s.url)}`);if(fi(s.url),!o)q("Waiting for the browser flow to complete...");let c=new Date(s.expiresAt).getTime()+15000,l=!1;while(Date.now()<c){await jr(Wtt);let d=I(await i.connectedAccounts.getConnectAttempt(s.attemptId),"Couldn't poll the connect attempt (try again)",o);if(d.status==="pending")continue;if(d.status==="completed"){if(!o)z(`Connected ${r}.`);if(o)j({status:"completed",provider:r});return}if(d.status==="failed"){if(d.errorCode==="identity_conflict"){if(!l&&!o)q(`This ${r} account is already connected to another Sazabi account. Choose what to do in the browser tab...`);l=!0;continue}let p=d.errorCode??"unknown",g=Jtt[p],m=g?`Connect did not complete (${p}). ${g}`:`Connect failed (${p}). Run the command again.`;if(o)return b(m);return y(m)}break}let u=l?`The ${r} account stayed connected to the other Sazabi account. Run the command again to retry.`:"The browser flow didn't complete in time. Run the command again.";if(o)return b(u);return y(u)},Ztt=async(e)=>{let{values:t}=E(e,L),{client:n,json:r}=Lm(t),{accounts:o}=I(await n.connectedAccounts.list(),"Couldn't list connected accounts (try again)",r);H(Htt,o,{json:r})},Xtt=async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Provider is required.");return y("Provider is required. Run 'sazabi connected-accounts list' to see connected providers.")}let{client:i}=Lm(t);if(I(await i.connectedAccounts.disconnect({provider:r}),"Couldn't disconnect the connected account",o),o){j({success:!0});return}z(`Disconnected ${r}.`)},WAe=async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Provider is required.");return y("Provider is required. Run 'sazabi connected-accounts list' to see connected providers.")}let{client:i}=Lm(t),{accounts:s}=I(await i.connectedAccounts.list(),"Couldn't list connected accounts (try again)",o),c=s.find((l)=>l.provider===r);if(!c){let l=`No connected account found for provider '${r}'.`;if(o)return b(l);return y(l)}G(Vtt,c,{json:o})},ent=async(e)=>{let{values:t}=E(e,L),{json:n}=Lm(t),r=If.map((o)=>({provider:o}));H(Ytt,r,{json:n})},ZAe=ie("connected-accounts","Manage personal connected accounts (GitHub, Google, Microsoft, Linear, Bitbucket, Slack)").withSubcommands({connect:C("connect","Connect a personal account via a browser OAuth flow",YAe).withPositionalArgs("<provider>").withOptions(_).withExamples(["sazabi connected-accounts connect github # Connect GitHub","sazabi connected-accounts connect google # Connect Google","sazabi connected-accounts connect slack # Connect Slack"]).build(),list:C("list","List connected accounts for the organization",Ztt).withOptions(_).withExamples(["sazabi connected-accounts list # List connected accounts","sazabi connected-accounts list --json # Machine-readable output"]).build(),get:C("get","Get one connected account by provider",WAe).withPositionalArgs("<provider>").withOptions(_).withExamples(["sazabi connected-accounts get github # Show GitHub connected account","sazabi connected-accounts get slack --json # Machine-readable output"]).build(),details:C("details","Show details for one connected account",WAe).withPositionalArgs("<provider>").withOptions(_).withExamples(["sazabi connected-accounts details github # Show GitHub connected account detail"]).build(),providers:C("providers","List supported connected account providers",ent).withOptions(_).withExamples(["sazabi connected-accounts providers # List all providers","sazabi connected-accounts providers --json # Machine-readable output"]).build(),disconnect:C("disconnect","Disconnect a personal connected account",Xtt).withPositionalArgs("<provider>").withOptions(_).withExamples(["sazabi connected-accounts disconnect github # Disconnect GitHub"]).build(),"update-credentials":C("update-credentials","Reconnect a provider to refresh its OAuth token",YAe).withPositionalArgs("<provider>").withOptions(_).withExamples(["sazabi connected-accounts update-credentials github # Re-run the GitHub OAuth flow","sazabi connected-accounts update-credentials slack # Refresh Slack token"]).build()}).withExamples(["sazabi connected-accounts list # List connected accounts","sazabi connected-accounts get github # Show GitHub account","sazabi connected-accounts providers # List available providers","sazabi connected-accounts connect github # Connect GitHub via browser","sazabi connected-accounts disconnect github # Disconnect GitHub","sazabi connected-accounts update-credentials github # Refresh GitHub token"]).build();oe();ye();ce();var tnt={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},authType:{label:"Auth",type:{kind:"string"}},capabilities:{label:"Capabilities",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.join(", "):"",serialize:(e)=>e??[]}},connectionCount:{label:"Connections",type:{kind:"number"}},browserConnectSupported:{label:"Browser connect",type:{kind:"custom",render:(e)=>e?"yes":"no",serialize:(e)=>Boolean(e)}},credentialFields:{label:"Credential fields",type:{kind:"custom",render:(e)=>Array.isArray(e)?e.map((t)=>t.name).join(", "):"",serialize:(e)=>e??null}}},nnt={schema:tnt,columns:["id","name","authType","capabilities","connectionCount"],jsonFields:["id","name","authType","capabilities","connectionCount","browserConnectSupported","credentialFields"],header:"Integration providers",emptyMessage:"No integration providers found."},tfe={id:{label:"ID",type:{kind:"string"}},provider:{label:"Provider",type:{kind:"string"}},displayName:{label:"Name",type:{kind:"nullable-string"}},status:{label:"Status",type:{kind:"string"}},healthStatus:{label:"Health",type:{kind:"string"}},metadata:{label:"Metadata",type:{kind:"custom",render:(e)=>e==null?"":JSON.stringify(e),serialize:(e)=>e??null}},healthMessage:{label:"Health detail",type:{kind:"nullable-string"}},healthCheckedAt:{label:"Health checked",type:{kind:"nullable-date"}},healthConsecutiveFailures:{label:"Health failures",type:{kind:"number"}},connectedBy:{label:"Connected by",type:{kind:"nullable-string"}},createdAt:{label:"Created",type:{kind:"date"}},updatedAt:{label:"Updated",type:{kind:"date"}}},ont={schema:tfe,columns:["id","provider","displayName","status","healthStatus"],header:"Integration connections",emptyMessage:"No integration connections found."},KM={layout:"field-list",schema:tfe,fields:["id","provider","displayName","status","metadata","healthStatus","healthMessage","healthCheckedAt","healthConsecutiveFailures","connectedBy","createdAt","updatedAt"],title:"Integration connection"},Yu=(e)=>{let t=e.json,n=Q({tokenFlag:e.token,jsonMode:t});return{client:N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:t}),json:t}},rnt=async(e)=>{let{values:t}=E(e,L),{client:n,json:r}=Yu(t),{providers:o}=I(await n.integrations.listProviders(),"Couldn't list integration providers (try again)",r),i=[...o].sort((s,c)=>s.name.localeCompare(c.name));H(nnt,i,{json:r})},int=async(e)=>{let{values:t}=E(e,{...L,provider:{type:"string"}}),{client:n,json:r}=Yu(t),{connections:o}=I(await n.integrations.listConnections({provider:t.provider}),"Couldn't list integration connections (check your organization access and try again)",r);H(ont,o,{json:r})},XAe=async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Connection ID is required.");return y("Connection ID is required.")}let{client:o,json:i}=Yu(t),{connection:s}=I(await o.integrations.getConnection(r),"Couldn't get integration connection (run 'sazabi integrations list' to see connection IDs)",i);G(KM,s,{json:i})},snt=3000,efe={installation_requested:"The install needs approval from a GitHub organization admin. The connection will appear once they approve — no need to rerun connect.",vendor_denied:"The authorization was declined in the provider.",not_authorized:"The browser wasn't signed in to the Sazabi dashboard as your user. Sign in with the same account and run connect again.",state_expired:"The browser flow took too long and expired. Run connect again."},ant=(e)=>e.map((t)=>` ${t.name}${t.required?"":" (optional)"} — ${t.label}`).join(`
|
|
8967
8967
|
`),nfe=(e,t,n,r)=>{let o=n.length?`
|
|
8968
8968
|
${t} credential fields:
|
|
8969
8969
|
${ant(n)}`:"";if(!e){let i=`--credentials is required for ${t} (JSON object).${o}`;if(r)b(i);else y(i);return}try{let i=JSON.parse(e);if(typeof i!=="object"||i===null||Array.isArray(i))throw Error("not an object");return i}catch{let i=`--credentials must be a JSON object, e.g. '{"apiToken":"..."}'.${o}`;if(r)b(i);else y(i);return}},Qm=async(e)=>{let{client:t,provider:n,displayName:r,credentialsFlag:o,projectId:i,json:s}=e,{providers:c}=I(await t.integrations.listProviders(),"Couldn't load the integration provider catalog (try again)",s),l=c.find((g)=>g.id===n);if(!l){let g=c.map((A)=>A.id).join(", "),m=`Unknown integration provider "${n}". Available: ${g}`;if(s)return b(m);return y(m)}if(l.authType==="api_key"){let g=nfe(o,l.name,l.credentialFields??[],s);if(!g)return null;let{connection:m}=I(await t.integrations.createConnection({provider:n,displayName:r,credentials:g}),`Couldn't connect ${l.name} (check the credentials and try again)`,s);if(!s)z(`Connected ${l.name}.`);return m}if(!l.browserConnectSupported){let g=`${l.name} can't be connected from the CLI yet. Connect it from the dashboard integration settings.`;if(s)return b(g);return y(g)}if(o){let g=`${l.name} connects through a browser flow — --credentials does not apply.`;if(s)return b(g);return y(g)}let u=I(await t.integrations.beginConnect({provider:n,displayName:r,projectId:i}),`Couldn't start the ${l.name} connect flow`,s);if(!s)Ae(`Connect ${l.name}`),q("Complete the authorization in a browser where you're signed in to the Sazabi dashboard as the same user."),q(`Opening ${Z.info(u.url)}`);if(fi(u.url),!s)q("Waiting for the browser flow to complete...");let d=new Date(u.expiresAt).getTime()+15000;while(Date.now()<d){await jr(snt);let g=I(await t.integrations.getConnectAttempt(u.attemptId),"Couldn't poll the connect attempt (try again)",s);if(g.status==="pending")continue;if(g.status==="completed"&&g.connection){if(!s)z(`Connected ${l.name}.`);return g.connection}if(g.status==="failed"){let m=g.errorCode??"unknown",A=efe[m],f=A?`Connect did not complete (${m}). ${A}`:`Connect failed (${m}). Run the command again.`;if(s)return b(f);return y(f)}if(g.status==="not_connected"){let m=g.errorCode??void 0,f=(m?efe[m]:void 0)??"Not connected yet — the flow finished but the connection isn't live (it may be awaiting approval). It'll appear once approved.";if(s)return j({status:"not_connected",...m?{reason:m}:{},message:f}),null;return q(f),null}break}let p="The browser flow didn't complete in time. Run the command again.";if(s)return b(p);return y(p)},cnt=async(e)=>{let{values:t,positionals:n}=E(e,{...L,credentials:{type:"string"},"display-name":{type:"string"},project:{type:"string"}},{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Provider is required.");return y("Provider is required. Run 'sazabi integrations providers' to see options.")}let{client:i}=Yu(t),s=await Qm({client:i,provider:r,displayName:t["display-name"],credentialsFlag:t.credentials,projectId:t.project,json:o});if(!s)return;G(KM,s,{json:o})},lnt=async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Connection ID is required.");return y("Connection ID is required. Run 'sazabi integrations list' to see connection IDs.")}let{client:i}=Yu(t);if(I(await i.integrations.disconnectConnection(r),"Couldn't disconnect the integration connection",o),o){j({success:!0});return}z("Integration connection disconnected.")},unt=async(e)=>{let{values:t,positionals:n}=E(e,{...L,credentials:{type:"string"}},{allowPositionals:!0}),r=n[0],o=t.json;if(!r){if(o)return b("Connection ID is required.");return y("Connection ID is required. Run 'sazabi integrations list' to see connection IDs.")}let i=nfe(t.credentials,"this connection",[],o);if(!i)return;let{client:s}=Yu(t),{connection:c}=I(await s.integrations.updateConnectionCredentials({connectionId:r,credentials:i}),"Couldn't update the connection credentials (check the values and try again)",o);if(!o)z("Connection credentials updated.");G(KM,c,{json:o})},ofe=ie("integrations","Connect and inspect integrations").withSubcommands({providers:C("providers","List supported integration providers",rnt).withOptions(_).withExamples(["sazabi integrations providers # List providers and connection counts","sazabi integrations providers --json # Machine-readable output"]).build(),connect:C("connect","Connect an integration (API-key credentials or a browser flow)",cnt).withPositionalArgs("<provider>").withOptions({..._,credentials:{type:"string",description:'Vendor credentials as JSON for api_key providers, e.g. \'{"apiToken":"..."}\' (see credentialFields in `integrations providers --json`)'},"display-name":{type:"string",description:"Optional display name for the connection"},project:{type:"string",description:"Project the completed connection defaults its routing to (browser flows)"}}).withExamples([`sazabi integrations connect pagerduty --credentials '{"apiToken":"..."}' # API-key connect`,"sazabi integrations connect jira # Browser OAuth connect","sazabi integrations connect github # GitHub App install"]).build(),disconnect:C("disconnect","Disconnect an integration connection",lnt).withPositionalArgs("<connection-id>").withOptions(_).withExamples(["sazabi integrations disconnect <connection-id> # Soft-delete the connection"]).build(),"update-credentials":C("update-credentials","Replace an api_key connection's credentials (reconnect path)",unt).withPositionalArgs("<connection-id>").withOptions({..._,credentials:{type:"string",description:"Replacement vendor credentials as JSON"}}).withExamples([`sazabi integrations update-credentials <connection-id> --credentials '{"apiToken":"..."}' # Replace stored credentials`]).build(),list:C("list","List integration connections for the organization",int).withOptions({..._,provider:{type:"string",description:"Filter by provider (e.g. slack, github, pagerduty)"}}).withExamples(["sazabi integrations list # All connections","sazabi integrations list --provider slack # Filter by provider"]).build(),get:C("get","Get one integration connection by ID",XAe).withPositionalArgs("<connection-id>").withOptions(_).withExamples(["sazabi integrations get <connection-id> # Connection detail"]).build(),details:C("details","Show details for one integration connection",XAe).withPositionalArgs("<connection-id>").withOptions(_).withExamples(["sazabi integrations details <connection-id> # Connection detail"]).build()}).withExamples(["sazabi integrations providers # List providers","sazabi integrations connect pagerduty --credentials '{...}' # Connect an integration","sazabi integrations list # List connections","sazabi integrations get <connection-id> # Connection detail"]).build();oe();Ha();import{readFile as dnt}from"node:fs/promises";ye();ce();var YM={id:{label:"ID",type:{kind:"string"}},projectId:{label:"Project",type:{kind:"string"}},url:{label:"URL",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},severity:{label:"Severity",type:{kind:"severity"}},componentId:{label:"Component",type:{kind:"nullable-string"}},createdAt:{label:"Created",type:{kind:"date"}},resolvedAt:{label:"Resolved",type:{kind:"nullable-date"}},mutedAt:{label:"Muted",type:{kind:"nullable-date"}},muteHitCount:{label:"Mute hits",type:{kind:"number"}},lastActivityAt:{label:"Last activity",type:{kind:"nullable-date"}},lastDeliveredAt:{label:"Last delivered",type:{kind:"nullable-date"}},description:{label:"Description",type:{kind:"nullable-string"}},delivery:{label:"Delivery",type:{kind:"custom",render:(e)=>e==null?"(none)":JSON.stringify(e,null,2),serialize:(e)=>e??null}}},pnt={...YM,duplicateIssueId:{label:"Reused issue",type:{kind:"nullable-string"}}},ife=["id","projectId","url","name","status","severity","componentId","createdAt","resolvedAt","mutedAt","muteHitCount","lastActivityAt","lastDeliveredAt","description"],sfe={schema:YM,columns:["id","name","status","severity","createdAt","mutedAt","url"],jsonFields:ife,header:"Issues",emptyMessage:"No issues found."},gnt={...sfe,jsonFields:[...ife,"delivery"]},Ii={layout:"sections",schema:YM,primary:{title:"Issue",fields:["id","url","name","status","severity","createdAt","resolvedAt","mutedAt","muteHitCount","lastActivityAt","lastDeliveredAt","componentId"]},secondary:[{title:"Description",field:"description"}]},Ur=(e)=>({...e,url:zhe(e.projectId,e.id)}),mnt={...Ii,schema:pnt,secondary:[{title:"Reused existing issue",field:"duplicateIssueId"},...Ii.secondary??[]]},hnt={layout:"field-list",title:"Issue counts",schema:{total:{label:"Total",type:{kind:"number"}},byStatus:{label:"By status",type:{kind:"custom",render:(e)=>JSON.stringify(e),serialize:(e)=>e}},bySeverity:{label:"By severity",type:{kind:"custom",render:(e)=>JSON.stringify(e),serialize:(e)=>e}},filters:{label:"Filters",type:{kind:"custom",render:(e)=>JSON.stringify(e),serialize:(e)=>e},get:(e)=>e.filters}},fields:["total","byStatus","bySeverity","filters"]},Ant=vf.partial(),fnt={contentMdx:"contentMdx cannot be empty. Provide the issue body via --content-mdx or the contentMdx field in --from-json.",componentId:"componentId is required. Run `sazabi components list --json`, pick the matching component, and pass --component <id> (or componentId in --from-json)."},ynt=3000,bnt=90000,rfe=async(e)=>{let t=Date.now()+bnt;while(Date.now()<t){await jr(ynt);let n=await e.onboarding.getState();if(!n.success)return!1;if(n.value.onboarding.completionByStep["trigger-issue"]==="complete")return!0}return!1},WM=async(e)=>{let{client:t,json:n}=e,r=I(await t.issues.create({sample:!0}),"Failed to create test issue",n);if(n){let i=await rfe(t);return{issue:r.issue,delivered:i}}G(Ii,Ur(r.issue),{json:n}),q("Waiting for the alert to reach your alert channels...");let o=await rfe(t);if(o)z("Delivered to your alert channels.");else q("Delivery pending. Check progress with 'sazabi onboarding progress'.");return{issue:r.issue,delivered:o}},Int=async(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json}),n=N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),{issue:r,delivered:o}=await WM({client:n,json:e.json});if(e.json){j({issue:Ur(r),delivered:o});return}if(o)q(`Resolve it to complete the loop: sazabi issues resolve ${r.id}`)},Snt=async(e)=>{if(e.sample){let s=[["--name",e.name!==void 0],["--content-mdx",e.contentMdx!==void 0],["--severity",e.severity!==void 0],["--component",e.componentId!==void 0],["--from-json",e.fromJson!==void 0]].filter(([,c])=>c).map(([c])=>c);if(s.length>0){let c=`--sample uses the curated sample payload and cannot combine with ${s.join(", ")}. Remove those flags and try again.`;if(e.json)return b(c);return y(c)}return Int(e)}let t=await Bnt(e);if(!t.ok){if(e.json)return b(t.message);return y(t.message)}let n=Q({tokenFlag:e.token,jsonMode:e.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),o=I(await r.issues.create(t.input),"Failed to create issue",e.json);G(mnt,{...o.issue,duplicateIssueId:o.duplicateIssueId??null},{json:e.json})},Cnt=async(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json}),n=N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=I(await n.issues.list({status:e.status,severity:e.severity,componentId:e.componentId,limit:e.limit,cursor:e.cursor}),"Couldn't list issues (check the active project and try again)",e.json);H(sfe,r.issues.map(Ur),{json:e.json,nextCursor:r.nextCursor})},vnt=async(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json}),n=N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=I(await n.issues.search({name:e.name,status:e.status,severity:e.severity,componentId:e.componentId,limit:e.limit,cursor:e.cursor,includeDeliveryMetadata:e.includeDeliveryMetadata}),"Couldn't search issues (check the active project and try again)",e.json);H(gnt,r.issues.map(Ur),{json:e.json,nextCursor:r.nextCursor})},wnt=async(e)=>{let t=Q({tokenFlag:e.token,jsonMode:e.json}),n=N({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=I(await n.issues.count({name:e.name,status:e.status,severity:e.severity,componentId:e.componentId}),"Couldn't count issues (check the active project and try again)",e.json);G(hnt,r,{json:e.json})},Ent=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.issues.get(e),"Couldn't get issue (run 'sazabi issues list' to see issue IDs)",t.json);G(Ii,Ur(o.issue),{json:t.json})},knt=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.issues.resolve(e),"Failed to resolve issue",t.json);G(Ii,Ur(o.issue),{json:t.json})},xnt=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.issues.reopen(e),"Failed to reopen issue",t.json);G(Ii,Ur(o.issue),{json:t.json})},Pnt=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.issues.ignore(e),"Failed to ignore issue",t.json);G(Ii,Ur(o.issue),{json:t.json})},Rnt=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.issues.mute(e),"Failed to mute issue",t.json);G(Ii,Ur(o.issue),{json:t.json})},Tnt=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.issues.unmute(e),"Failed to unmute issue",t.json);G(Ii,Ur(o.issue),{json:t.json})},Bnt=async(e)=>{let t=e.fromJson?await Ont(e.fromJson):{ok:!0,input:{}};if(!t.ok)return t;let n={...t.input,...e.name!==void 0?{name:e.name}:{},...e.contentMdx!==void 0?{contentMdx:e.contentMdx}:{},...e.severity!==void 0?{severity:e.severity}:{},...e.componentId!==void 0?{componentId:e.componentId}:{}},r=wf.safeParse(n);if(!r.success)return{ok:!1,message:afe(r.error)};return{ok:!0,input:r.data}},Ont=async(e)=>{let t;try{t=e==="-"?await _nt():await dnt(e,"utf8")}catch(o){return{ok:!1,message:`Couldn't read issue input (check that the --from-json path exists and is readable): ${o instanceof Error?o.message:String(o)}`}}let n;try{n=JSON.parse(t)}catch(o){return{ok:!1,message:`Couldn't parse issue input JSON (fix the JSON syntax and try again): ${o instanceof Error?o.message:String(o)}`}}let r=Ant.safeParse(n);if(!r.success)return{ok:!1,message:afe(r.error)};return{ok:!0,input:r.data}},_nt=async()=>{let e=[];process.stdin.setEncoding("utf8");for await(let t of process.stdin)e.push(String(t));return e.join("")},afe=(e)=>{let t=e.issues[0];if(!t)return"Invalid issue input.";let n=t.path[0];if(n&&(t.code==="invalid_type"||t.message===`${String(n)} is required`))return fnt[n]??t.message;return t.message},cfe=ie("issues","Manage issues").withSubcommands({create:C("create","Create an issue, reusing an existing open issue when one matches",async(e)=>{let{values:t}=E(e,{...L,name:{type:"string"},"content-mdx":{type:"string"},severity:{type:"string"},component:{type:"string"},"from-json":{type:"string"},sample:{type:"boolean"}});await Snt({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],name:t.name,contentMdx:t["content-mdx"],severity:t.severity,componentId:t.component,fromJson:t["from-json"],sample:t.sample})}).withOptions({..._,name:{type:"string",description:"Stable issue name for indexing and mute matching"},"content-mdx":{type:"string",description:"Safe Sazabi MDX document for the issue body (impact, root cause, remediation, evidence)"},severity:{type:"string",description:"Issue severity: low, medium, high, or critical (default: medium)"},component:{type:"string",description:"Required component ID. List with `sazabi components list` first; register one if none fits"},"from-json":{type:"string",description:"Read issue fields from a JSON file, or '-' for stdin"},sample:{type:"boolean",description:"Create the onboarding test issue with the curated payload and watch its alert delivery (no content flags)"}}).withExamples(['sazabi issues create --content-mdx "Checkout is returning 500s due to pool exhaustion." --component "$COMPONENT_ID" # Create an issue from MDX content',"sazabi issues create --from-json issue.json # Create an issue from a JSON file with contentMdx","cat issue.json | sazabi issues create --from-json - --json # Create an issue from stdin","sazabi issues create --sample # Create the onboarding test issue and watch alert delivery"]).build(),list:C("list","List issues in the active project",async(e)=>{let{values:t}=E(e,{...L,status:{type:"string"},severity:{type:"string"},component:{type:"string"},limit:{type:"string"},cursor:{type:"string"}}),n=["open","resolved","ignored"];if(t.status&&!n.includes(t.status)){let i=`Invalid --status "${t.status}". Must be one of: ${n.join(", ")}.`;if(t.json)return b(i);return y(i)}let r=["low","medium","high","critical"];if(t.severity&&!r.includes(t.severity)){let i=`Invalid --severity "${t.severity}". Must be one of: ${r.join(", ")}.`;if(t.json)return b(i);return y(i)}let o=t.limit?Number(t.limit):void 0;if(o!==void 0&&(Number.isNaN(o)||o<1||o>100)){if(t.json)return b("Invalid --limit. Must be an integer between 1 and 100.");return y("Invalid --limit. Must be an integer between 1 and 100.")}await Cnt({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],status:t.status,severity:t.severity,componentId:t.component,limit:o,cursor:t.cursor})}).withOptions({..._,status:{type:"string",description:"Filter by status: open, resolved, or ignored"},severity:{type:"string",description:"Filter by severity: low, medium, high, or critical"},component:{type:"string",description:"Filter by component ID"},limit:{type:"string",description:"Maximum number of issues to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples(["sazabi issues list # List all issues","sazabi issues list --status open # List open issues only","sazabi issues list --component <component-id> # List issues for a component"]).build(),search:C("search","Search issues by name and filters",async(e)=>{let{values:t,positionals:n}=E(e,{...L,name:{type:"string"},status:{type:"string"},severity:{type:"string"},component:{type:"string"},limit:{type:"string"},cursor:{type:"string"},"include-delivery-metadata":{type:"boolean"}},{allowPositionals:!0}),r=["open","resolved","ignored"];if(t.status&&!r.includes(t.status)){let c=`Invalid --status "${t.status}". Must be one of: ${r.join(", ")}.`;if(t.json)return b(c);return y(c)}let o=["low","medium","high","critical"];if(t.severity&&!o.includes(t.severity)){let c=`Invalid --severity "${t.severity}". Must be one of: ${o.join(", ")}.`;if(t.json)return b(c);return y(c)}let i=t.limit?Number(t.limit):void 0;if(i!==void 0&&(Number.isNaN(i)||i<1||i>100)){if(t.json)return b("Invalid --limit. Must be an integer between 1 and 100.");return y("Invalid --limit. Must be an integer between 1 and 100.")}let s=n.join(" ").trim();await vnt({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],name:t.name??(s||void 0),status:t.status,severity:t.severity,componentId:t.component,limit:i,cursor:t.cursor,includeDeliveryMetadata:t["include-delivery-metadata"]})}).withPositionalArgs("[name]").withOptions({..._,name:{type:"string",description:"Case-insensitive partial issue name match"},status:{type:"string",description:"Filter by status: open, resolved, or ignored"},severity:{type:"string",description:"Filter by severity: low, medium, high, or critical"},component:{type:"string",description:"Filter by component ID"},limit:{type:"string",description:"Maximum number of issues to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"},"include-delivery-metadata":{type:"boolean",description:"Include delivery metadata in JSON output"}}).withExamples(['sazabi issues search "checkout" --status open # Search open issues by name',"sazabi issues search --severity critical --json # Machine-readable search"]).build(),count:C("count","Count issues by status and severity",async(e)=>{let{values:t,positionals:n}=E(e,{...L,name:{type:"string"},status:{type:"string"},severity:{type:"string"},component:{type:"string"}},{allowPositionals:!0}),r=["open","resolved","ignored"];if(t.status&&!r.includes(t.status)){let s=`Invalid --status "${t.status}". Must be one of: ${r.join(", ")}.`;if(t.json)return b(s);return y(s)}let o=["low","medium","high","critical"];if(t.severity&&!o.includes(t.severity)){let s=`Invalid --severity "${t.severity}". Must be one of: ${o.join(", ")}.`;if(t.json)return b(s);return y(s)}let i=n.join(" ").trim();await wnt({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],name:t.name??(i||void 0),status:t.status,severity:t.severity,componentId:t.component})}).withPositionalArgs("[name]").withOptions({..._,name:{type:"string",description:"Case-insensitive partial issue name match"},status:{type:"string",description:"Filter by status: open, resolved, or ignored"},severity:{type:"string",description:"Filter by severity: low, medium, high, or critical"},component:{type:"string",description:"Filter by component ID"}}).withExamples(["sazabi issues count --status open # Count open issues",'sazabi issues count "checkout" --json # Count matching issues']).build(),get:C("get","Get one issue by ID",async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Issue ID is required.");return y("Issue ID is required.")}await Ent(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(_).withExamples(["sazabi issues get <issue-id> # Get one issue"]).build(),resolve:C("resolve","Resolve an open issue",async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Issue ID is required.");return y("Issue ID is required.")}await knt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(_).withExamples(["sazabi issues resolve <issue-id> # Resolve an issue"]).build(),ignore:C("ignore","Ignore an issue",async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Issue ID is required.");return y("Issue ID is required.")}await Pnt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(_).withExamples(["sazabi issues ignore <issue-id> # Ignore an issue"]).build(),reopen:C("reopen","Reopen a resolved or ignored issue",async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Issue ID is required.");return y("Issue ID is required.")}await xnt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(_).withExamples(["sazabi issues reopen <issue-id> # Reopen a resolved or ignored issue"]).build(),mute:C("mute","Mute an issue",async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Issue ID is required.");return y("Issue ID is required.")}await Rnt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(_).withExamples(["sazabi issues mute <issue-id> # Mute an issue"]).build(),unmute:C("unmute","Unmute an issue",async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Issue ID is required.");return y("Issue ID is required.")}await Tnt(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<issue-id>").withOptions(_).withExamples(["sazabi issues unmute <issue-id> # Unmute an issue"]).build()}).withExamples(["sazabi issues create --from-json issue.json # Create an issue","sazabi issues list # List all issues","sazabi issues search checkout # Search issues","sazabi issues count --status open # Count issues","sazabi issues get <issue-id> # Get one issue","sazabi issues resolve <issue-id> # Resolve an issue","sazabi issues ignore <issue-id> # Ignore an issue","sazabi issues mute <issue-id> # Mute an issue","sazabi issues unmute <issue-id> # Unmute an issue"]).build();oe();ye();ce();var Dnt=async(e,t)=>{let n=Q({tokenFlag:t.token,projectIdFlag:e==="public"?t.projectId:void 0,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:e==="public"?n.projectId:void 0,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json});if(e==="public"){let i=I(await r.publicKeys.list({projectId:n.projectId,limit:t.limit,cursor:t.cursor}),"Couldn't list public keys (check the active project and try again)",t.json);H(lfe(e),i.publicKeys.map((s)=>ks(e,s)),{json:t.json,nextCursor:i.nextCursor});return}let o=I(await r.secretKeys.list({limit:t.limit,cursor:t.cursor}),"Couldn't list secret keys (check your organization access and try again)",t.json);H(lfe(e),o.secretKeys.map((i)=>ks(e,i)),{json:t.json,nextCursor:o.nextCursor})},Lnt=async(e,t,n)=>{let r=Q({tokenFlag:n.token,projectIdFlag:e==="public"?n.projectId:void 0,jsonMode:n.json}),o=N({token:r.token,organizationId:r.organizationId,projectId:e==="public"?r.projectId:void 0,apiBaseUrlFlag:n.apiBaseUrl,jsonMode:n.json});if(e==="public"){let s=I(await o.publicKeys.get(t,r.projectId),"Couldn't get public key (run 'sazabi public-keys list' to see key IDs)",n.json);G(Wu(e),ks(e,s.publicKey),{json:n.json});return}let i=I(await o.secretKeys.get(t),"Couldn't get secret key (run 'sazabi secret-keys list' to see key IDs)",n.json);G(Wu(e),ks(e,i.secretKey),{json:n.json})},Qnt=async(e,t)=>{let r=Q({tokenFlag:t.token,projectIdFlag:void 0,jsonMode:t.json}),o=N({token:r.token,organizationId:r.organizationId,projectId:void 0,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),i={name:e,...t.expiresAt?{expiresAt:t.expiresAt}:{}},s=I(await o.secretKeys.create(i),"Failed to create secret key",t.json);if(t.json){j(s);return}z(`Secret key ${s.secretKey.name} created.`),ke({Value:s.secretKey.value}),G(Wu("secret"),{...ks("secret",s.secretKey)})},Nnt=async(e,t,n)=>{if(n.name===void 0&&n.expiresAt===void 0&&!n.clearExpiresAt){if(n.json)return b("At least one update is required. Pass --name, --expires-at, or --clear-expires-at.");return y("At least one update is required. Pass --name, --expires-at, or --clear-expires-at.")}if(n.expiresAt&&n.clearExpiresAt){if(n.json)return b("Use either --expires-at or --clear-expires-at, not both.");return y("Use either --expires-at or --clear-expires-at, not both.")}let r=Q({tokenFlag:n.token,projectIdFlag:e==="public"?n.projectId:void 0,jsonMode:n.json}),o=N({token:r.token,organizationId:r.organizationId,projectId:e==="public"?r.projectId:void 0,apiBaseUrlFlag:n.apiBaseUrl,jsonMode:n.json}),i=n.clearExpiresAt?null:n.expiresAt!==void 0?n.expiresAt:void 0;if(e==="public"){let l={projectId:r.projectId,keyId:t,...n.name!==void 0?{name:n.name}:{},...i!==void 0?{expiresAt:i}:{}},u=I(await o.publicKeys.update(l),"Failed to update public key",n.json);G(Wu(e),ks(e,u.publicKey),{json:n.json});return}let s={keyId:t,...n.name!==void 0?{name:n.name}:{},...i!==void 0?{expiresAt:i}:{}},c=I(await o.secretKeys.update(s),"Failed to update secret key",n.json);G(Wu(e),ks(e,c.secretKey),{json:n.json})},Mnt=async(e,t)=>{let n=Q({tokenFlag:t.token,projectIdFlag:t.projectId,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=I(await r.publicKeys.deactivate({projectId:n.projectId,keyId:e}),"Failed to deactivate public key",t.json);if(!t.json)z(`Public key ${e} deactivated.`);G(Wu("public"),ks("public",o.publicKey),{json:t.json})},znt=async(e,t)=>{let n=Q({tokenFlag:t.token,jsonMode:t.json}),r=N({token:n.token,organizationId:n.organizationId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json});if(I(await r.secretKeys.delete({keyId:e}),"Failed to delete secret key",t.json),t.json){j({deleted:!0,keyId:e});return}z(`Secret key ${e} deleted.`)},ufe=(e)=>{let t=jnt(e),n=JM(e),r=e==="secret",o=r?"the organization":"the active project",i={token:{type:"string"},"project-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},l=r?{token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}:{token:{type:"string",description:"Override token"},"project-id":{type:"string",description:"Override project selection"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}};return ie(t,`Manage ${e} keys`).withSubcommands({list:C("list",`List ${e} keys in ${o}`,async(u)=>{let{values:d,positionals:p}=E(u,{...i,limit:{type:"string"},cursor:{type:"string"}},{allowPositionals:!0});if(p.length>0){let g=p.join(", ");if(d.json)return b(`Unexpected arguments: ${g}.`);return y(`Unexpected arguments: ${g}.`)}await Dnt(e,{token:d.token,projectId:d["project-id"],limit:d.limit?Number(d.limit):void 0,cursor:d.cursor,json:d.json,apiBaseUrl:d["api-base-url"]})}).withOptions({...l,limit:{type:"string",description:"Maximum number of keys to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples([`sazabi ${t} list # List ${e} keys in ${o}`]).build(),get:C("get",`Get one ${e} key by ID`,async(u)=>{let{values:d,positionals:p}=E(u,i,{allowPositionals:!0}),g=p[0];if(!g){let m=`${n} key ID is required.`;if(d.json)return b(m);return y(m)}await Lnt(e,g,{token:d.token,projectId:d["project-id"],json:d.json,apiBaseUrl:d["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions(l).withExamples([`sazabi ${t} get <key-id> # Get one ${e} key`]).build(),...r?{create:C("create",`Create one ${e} key in ${o}`,async(u)=>{let{values:d,positionals:p}=E(u,{...i,"expires-at":{type:"string"}},{allowPositionals:!0}),g=p.join(" ");if(!g){let m=`${n} key name is required.`;if(d.json)return b(m);return y(m)}await Qnt(g,{token:d.token,projectId:d["project-id"],expiresAt:d["expires-at"],json:d.json,apiBaseUrl:d["api-base-url"]})}).withPositionalArgs("<name>").withOptions({...l,"expires-at":{type:"string",description:"Optional ISO timestamp when the key should expire"}}).withExamples([`sazabi ${t} create "CI agent" # Create one ${e} key`]).build()}:{},update:C("update",`Update one ${e} key in ${o}`,async(u)=>{let{values:d,positionals:p}=E(u,{...i,name:{type:"string"},"expires-at":{type:"string"},"clear-expires-at":{type:"boolean"}},{allowPositionals:!0}),g=p[0];if(!g){let m=`${n} key ID is required.`;if(d.json)return b(m);return y(m)}await Nnt(e,g,{token:d.token,projectId:d["project-id"],name:d.name,expiresAt:d["expires-at"],clearExpiresAt:d["clear-expires-at"],json:d.json,apiBaseUrl:d["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions({...l,name:{type:"string",description:`New ${e} key name`},"expires-at":{type:"string",description:"New ISO timestamp when the key should expire"},"clear-expires-at":{type:"boolean",description:"Clear any configured expiration"}}).withExamples([`sazabi ${t} update <key-id> --name "Renamed key" # Update one ${e} key`]).build(),...e==="public"?{deactivate:C("deactivate",`Deactivate one public key in ${o}`,async(u)=>{let{values:d,positionals:p}=E(u,i,{allowPositionals:!0}),g=p[0];if(!g){if(d.json)return b("Public key ID is required.");return y("Public key ID is required.")}await Mnt(g,{token:d.token,projectId:d["project-id"],json:d.json,apiBaseUrl:d["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions(l).withExamples([`sazabi ${t} deactivate <key-id> # Deactivate one public key`]).build()}:{delete:C("delete",`Delete one secret key from ${o}`,async(u)=>{let{values:d,positionals:p}=E(u,i,{allowPositionals:!0}),g=p[0];if(!g){if(d.json)return b("Secret key ID is required.");return y("Secret key ID is required.")}await znt(g,{token:d.token,json:d.json,apiBaseUrl:d["api-base-url"]})}).withPositionalArgs("<key-id>").withOptions(l).withExamples([`sazabi ${t} delete <key-id> # Delete one secret key`]).build()}}).withExamples([`sazabi ${t} list # List ${e} keys in ${o}`,...r?[`sazabi ${t} create "CI agent" # Create one ${e} key`]:[]]).build()},dfe={keyType:{label:"Type",type:{kind:"string"}},id:{label:"ID",type:{kind:"string"}},projectId:{label:"Project ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},expiresAt:{label:"Expires",type:{kind:"nullable-date"}},lastUsedAt:{label:"Last used",type:{kind:"nullable-date"}},createdAt:{label:"Created",type:{kind:"date"}}},lfe=(e)=>({schema:dfe,columns:e==="public"?["id","name","status","expiresAt","lastUsedAt","createdAt"]:["id","name","expiresAt","lastUsedAt","createdAt"],header:`${JM(e)} keys`,emptyMessage:`No ${e} keys found.`}),Wu=(e)=>({layout:"field-list",schema:dfe,fields:e==="public"?["keyType","id","projectId","name","status","expiresAt","lastUsedAt","createdAt"]:["keyType","id","name","expiresAt","lastUsedAt","createdAt"]}),jnt=(e)=>e==="public"?"public-keys":"secret-keys",JM=(e)=>e==="public"?"Public":"Secret",ks=(e,t)=>{let n=e==="public"&&"deactivatedAt"in t&&t.deactivatedAt!==null;return{...t,keyType:`${JM(e)} key`,status:n?"Deactivated":"Active"}},pfe=ufe("public"),gfe=ufe("secret");oe();ye();ce();oe();ye();ce();var hfe={id:{label:"ID",type:{kind:"string"}},displayName:{label:"Name",type:{kind:"nullable-string"}},logSourceId:{label:"Log source",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},enabled:{label:"Enabled",type:{kind:"boolean"}},errorMessage:{label:"Error",type:{kind:"nullable-string"}},createdAt:{label:"Created",type:{kind:"date"}}},ZM={schema:hfe,columns:["id","displayName","status","enabled","errorMessage","createdAt"],header:"Log streams",emptyMessage:"No log streams found for this log source."},Unt={layout:"field-list",schema:hfe,fields:["id","logSourceId","displayName","status","enabled","errorMessage","createdAt"],title:"Log stream"},MS=(e)=>{for(let t of e){let n={};if(t.kind==="url"&&t.url)n[t.label??"Endpoint"]=t.url;else if(t.kind==="hostPort"&&t.host){if(n[t.label??"Host"]=t.port!==void 0?`${t.host}:${t.port}`:t.host,t.extraCredential)n[t.extraCredential.label]=t.extraCredential.value}if(Object.keys(n).length>0){if(ke(n),t.description)q(t.description)}}},to=(e)=>{let t=e.json,n=Q({tokenFlag:e.token,jsonMode:t});return{client:N({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:t}),json:t,projectId:n.projectId}},zS=(e,t)=>{let n=e[0];if(!n){if(t)b("Log stream ID is required.");else y("Log stream ID is required. Run 'sazabi log-streams list --log-source-id <id>' to see log stream IDs.");return null}return n},Fnt=async(e)=>{let{values:t}=E(e,{...L,"log-source-id":{type:"string"}});if(!t["log-source-id"]){if(t.json)return b("--log-source-id is required.");return y("--log-source-id is required. Run 'sazabi log-sources list' to see log source IDs.")}let{client:n,json:r}=to(t),{streams:o}=I(await n.logStreams.list(t["log-source-id"]),"Couldn't list log streams (run 'sazabi log-sources list' to see log source IDs)",r);H(ZM,o,{json:r})},$nt=async(e)=>{let{values:t}=E(e,{...L,"log-source-id":{type:"string"},config:{type:"string"}});if(!t["log-source-id"]){if(t.json)return b("--log-source-id is required.");return y("--log-source-id is required.")}let n={};if(t.config)try{n=JSON.parse(t.config)}catch{if(t.json)return b("--config must be valid JSON.");return y("--config must be valid JSON.")}let{client:r,json:o}=to(t),i=I(await r.logStreams.create({logSourceId:t["log-source-id"],config:n}),"Failed to create log stream",o);if(o){j(i);return}z("Log stream created. Provisioning started."),ke({"Log stream ID":i.streamId})},Gnt=async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=zS(n,t.json);if(!r)return;let{client:o,json:i}=to(t),{stream:s}=I(await o.logStreams.get(r),"Couldn't get log stream (run 'sazabi log-streams list --log-source-id <id>' to see log stream IDs)",i);if(i){j({stream:s});return}if(G(Unt,s,{json:i}),s.endpointCards&&s.endpointCards.length>0)q("Point your sender at:"),MS(s.endpointCards)},mfe=async(e,t)=>{let{values:n,positionals:r}=E(e,L,{allowPositionals:!0}),o=zS(r,n.json);if(!o)return;let{client:i,json:s}=to(n),c=I(await i.logStreams.update({streamId:o,enabled:t}),t?"Failed to enable log stream":"Failed to disable log stream",s);if(s){j(c);return}z(t?"Log stream enabled. It resumes ingesting.":"Log stream disabled. It stops ingesting until re-enabled.")},qnt=async(e)=>{let{values:t,positionals:n}=E(e,{...L,"to-log-source-id":{type:"string"}},{allowPositionals:!0}),r=zS(n,t.json);if(!r)return;let o=t["to-log-source-id"];if(!o){if(t.json)return b("--to-log-source-id is required.");return y("--to-log-source-id is required. Run 'sazabi log-sources list' to see log source IDs.")}let{client:i,json:s}=to(t),{stream:c}=I(await i.logStreams.get(r),"Couldn't get log stream (run 'sazabi log-streams list --log-source-id <id>' to see log stream IDs)",s),{logSource:l}=I(await i.logSources.get(c.logSourceId),"Couldn't get the log stream's current log source",s),{logSource:u}=I(await i.logSources.get(o),"Couldn't get the target log source (run 'sazabi log-sources list' to see log source IDs)",s),d=I(await i.logStreams.reassign({streamId:r,targetLogSourceId:o}),"Failed to reassign log stream",s);if(s){j(d);return}if(z("Log stream reassigned."),ke({"Log stream ID":d.stream.id,From:`${l.name} (${l.provider})`,To:`${u.name} (${u.provider})`}),l.provider!==u.provider)q(`The log stream keeps its intake key, but future data is now processed as ${u.provider} format — make sure the sender emits that format. Already-ingested data is unaffected.`)},Hnt=async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=zS(n,t.json);if(!r)return;let{client:o,json:i}=to(t),s=I(await o.logStreams.delete(r),"Failed to delete log stream",i);if(i){j(s);return}z("Log stream deleted.")},Afe=ie("log-streams","Manage log streams").withSubcommands({list:C("list","List log streams for a log source",Fnt).withOptions({..._,"log-source-id":{type:"string",description:"Log source ID (required)"}}).withExamples(["sazabi log-streams list --log-source-id <id> # List log streams"]).build(),get:C("get","Get one log stream (check provisioning status)",Gnt).withPositionalArgs("<stream-id>").withOptions(_).withExamples(["sazabi log-streams get <id> # Check log stream status"]).build(),create:C("create","Create a log stream under a managed log source",$nt).withOptions({..._,"log-source-id":{type:"string",description:"Log source ID (required)"},config:{type:"string",description:"JSON stream config"}}).withExamples([`sazabi log-streams create --log-source-id <id> --config '{"foo":"bar"}' # Create log stream`]).build(),enable:C("enable","Resume ingestion for a log stream",(e)=>mfe(e,!0)).withPositionalArgs("<stream-id>").withOptions(_).withExamples(["sazabi log-streams enable <id> # Resume ingestion"]).build(),disable:C("disable","Pause ingestion for a log stream",(e)=>mfe(e,!1)).withPositionalArgs("<stream-id>").withOptions(_).withExamples(["sazabi log-streams disable <id> # Pause ingestion"]).build(),reassign:C("reassign","Move a log stream to a different connectionless log source",qnt).withPositionalArgs("<stream-id>").withOptions({..._,"to-log-source-id":{type:"string",description:"Target log source ID (required)"}}).withExamples(["sazabi log-streams reassign <id> --to-log-source-id <id> # Move a log stream"]).build(),delete:C("delete","Delete a log stream",Hnt).withPositionalArgs("<stream-id>").withOptions(_).withExamples(["sazabi log-streams delete <id> # Delete a log stream"]).build()}).withExamples(["sazabi log-streams list --log-source-id <id> # List log streams","sazabi log-streams get <id> # Log stream detail and endpoint","sazabi log-streams reassign <id> --to-log-source-id <id> # Move a log stream","sazabi log-streams delete <id> # Delete a log stream"]).build();var Vnt={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},modes:{label:"Modes",type:{kind:"string"}}},Knt={schema:Vnt,columns:["id","name","modes"],header:"Log source providers",emptyMessage:"No log source providers found."},Ife={id:{label:"ID",type:{kind:"string"}},provider:{label:"Provider",type:{kind:"string"}},mode:{label:"Mode",type:{kind:"string"}},name:{label:"Name",type:{kind:"nullable-string"}},streamCount:{label:"Streams",type:{kind:"number"}},url:{label:"URL",type:{kind:"nullable-string"}},createdAt:{label:"Created",type:{kind:"date"}}},Ynt={schema:Ife,columns:["id","provider","mode","name","streamCount","createdAt"],header:"Log sources",emptyMessage:"No log sources found."},Wnt={layout:"field-list",schema:Ife,fields:["id","provider","mode","name","streamCount","url","createdAt"],title:"Log source"},Jnt=(e,t)=>({...e,url:t?Fhe(t,e.provider):void 0}),XM=(e,t)=>{let n=e[0];if(!n){if(t)b("Log source ID is required.");else y("Log source ID is required. Run 'sazabi log-sources list' to see log source IDs.");return null}return n},Znt=async(e)=>{let{values:t}=E(e,L),{client:n,json:r}=to(t),{providers:o}=I(await n.logSources.listProviders(),"Couldn't list log source providers (try again)",r),i=[...o].sort((s,c)=>s.name.localeCompare(c.name)).map((s)=>({id:s.id,name:s.name,modes:s.modes.join(", ")}));H(Knt,i,{json:r})},Xnt=async(e)=>{let{values:t}=E(e,{...L,provider:{type:"string"},"project-id":{type:"string"}}),{client:n,json:r}=to(t),{logSources:o}=I(await n.logSources.list({projectId:t["project-id"],provider:t.provider}),"Couldn't list log sources (check the active project and try again)",r);H(Ynt,o,{json:r})},Nm=async(e)=>I(await e.client.logSources.create({provider:e.provider,metadata:e.metadata,mode:e.mode,projectId:e.projectId}),"Failed to create log source",e.json),eot=async(e)=>{let{values:t,positionals:n}=E(e,{...L,metadata:{type:"string"},mode:{type:"string"},"project-id":{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Log source provider is required.");return y("Log source provider is required. Use 'sazabi log-sources providers' to see available providers.")}if(t.mode&&t.mode!=="managed"&&t.mode!=="connectionless"){if(t.json)return b("--mode must be 'managed' or 'connectionless'.");return y("--mode must be 'managed' or 'connectionless'.")}let o;if(t.metadata)try{o=JSON.parse(t.metadata)}catch{if(t.json)return b("--metadata must be valid JSON.");return y("--metadata must be valid JSON.")}let{client:i,json:s}=to(t),c=await Nm({client:i,provider:r,metadata:o,mode:t.mode,projectId:t["project-id"],json:s});if(s){j(c);return}if(z("Log source created."),ke({"Log source ID":c.logSource.id,...c.logSource.name?{Name:c.logSource.name}:{},Provider:c.logSource.provider,Mode:c.logSource.mode,...c.streamId?{"Log stream ID":c.streamId}:{},...c.publicKey?{"Public key":c.publicKey}:{}}),c.endpointCards&&c.endpointCards.length>0)q("Point your sender at:"),MS(c.endpointCards);if(c.publicKey)Kt("Store the public key securely — it is only shown once.")},tot=async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=XM(n,t.json);if(!r)return;let{client:o,json:i,projectId:s}=to(t),{logSource:c}=I(await o.logSources.get(r),"Couldn't get log source (run 'sazabi log-sources list' to see log source IDs)",i);if(i){j({logSource:c});return}if(G(Wnt,Jnt({id:c.id,provider:c.provider,mode:c.mode,name:c.name,streamCount:c.streamCount,createdAt:c.createdAt},s),{json:i}),c.streams.length>0){H(ZM,c.streams,{json:i});for(let l of c.streams)if(l.endpointCards&&l.endpointCards.length>0)q(`Endpoint for log stream "${l.displayName??l.id}":`),MS(l.endpointCards)}},ffe=async(e,t)=>{let{values:n,positionals:r}=E(e,L,{allowPositionals:!0}),o=XM(r,n.json);if(!o)return;let{client:i,json:s}=to(n),c=I(await i.logSources.update({logSourceId:o,enabled:t}),t?"Failed to enable log source":"Failed to disable log source",s);if(s){j(c);return}z(t?"Log source enabled. Its log streams resume ingesting.":"Log source disabled. Its log streams stop ingesting until re-enabled.")},not=async(e)=>{let{values:t,positionals:n}=E(e,L,{allowPositionals:!0}),r=XM(n,t.json);if(!r)return;let{client:o,json:i}=to(t),s=I(await o.logSources.delete(r),"Failed to delete log source",i);if(i){j(s);return}if(s.teardownError){Kt(`Log source deleted, but remote cleanup failed (remove the remote resources manually): ${s.teardownError}`);return}z("Log source deleted.")},oot=async(e)=>{let{values:t}=E(e,{...L,provider:{type:"string"}});if(!t.provider){if(t.json)return b("--provider is required.");return y("--provider is required. Use 'sazabi log-sources providers' to see providers with skills.")}let{client:n,json:r}=to(t),{providers:o}=I(await n.logSources.listProviders(),"Couldn't list log source providers (try again)",r),i=o.find((s)=>s.id===t.provider);if(!i){let s=`Unknown log source provider: '${t.provider}'. Use 'sazabi log-sources providers' to see available providers.`;if(r)return b(s);return y(s)}if(!i.setupSkill){if(r)return b(`No setup skill available for ${t.provider}.`);return y(`No setup skill available for ${t.provider}. This log source provider does not have an agent-ready skill yet.`)}if(r){j({provider:t.provider,setupSkill:i.setupSkill});return}q(i.setupSkill)},yfe=C("list","List log sources",Xnt).withOptions({..._,provider:{type:"string",description:"Filter by log source provider"},"project-id":{type:"string",description:"Project ID"}}).withExamples(["sazabi log-sources list # List all log sources","sazabi log-sources list --provider vercel # Filter by provider"]).build(),bfe=C("delete","Delete a log source",not).withPositionalArgs("<log-source-id>").withOptions(_).withExamples(["sazabi log-sources delete <id> # Delete a log source and deactivate its keys"]).build(),Sfe=ie("log-sources","Manage log sources").withSubcommands({providers:C("providers","List supported log source providers",Znt).withOptions(_).withExamples(["sazabi log-sources providers # List all providers","sazabi log-sources providers --json # Output as JSON"]).build(),list:yfe,ls:yfe,create:C("create","Create a log source",eot).withPositionalArgs("<provider>").withOptions({..._,metadata:{type:"string",description:"JSON credentials for managed setup"},mode:{type:"string",description:"Setup mode: managed or connectionless (inferred from --metadata when omitted)"},"project-id":{type:"string",description:"Project ID"}}).withExamples(["sazabi log-sources create otel # Connectionless: mints a keyed endpoint",`sazabi log-sources create fly_io --metadata '{"apiToken":"..."}' # Managed: connects with credentials`]).build(),get:C("get","Get one log source",tot).withPositionalArgs("<log-source-id>").withOptions(_).withExamples(["sazabi log-sources get <id> # Log source details, log streams, and endpoints"]).build(),enable:C("enable","Resume ingestion for a log source's log streams",(e)=>ffe(e,!0)).withPositionalArgs("<log-source-id>").withOptions(_).withExamples(["sazabi log-sources enable <id> # Resume ingestion"]).build(),disable:C("disable","Pause ingestion for a log source's log streams",(e)=>ffe(e,!1)).withPositionalArgs("<log-source-id>").withOptions(_).withExamples(["sazabi log-sources disable <id> # Pause ingestion"]).build(),delete:bfe,remove:bfe,skill:C("skill","Show setup skill for a log source provider",oot).withOptions({..._,provider:{type:"string",description:"Log source provider (required)"}}).withExamples(["sazabi log-sources skill --provider gcp # Show GCP setup skill","sazabi log-sources skill --provider fly_io # Show Fly.io setup skill"]).build()}).withExamples(["sazabi log-sources providers # List available providers","sazabi log-sources list # List log sources","sazabi log-sources create otel # Connectionless: mints a keyed endpoint",`sazabi log-sources create fly_io --metadata '{"apiToken":"..."}' # Managed: connects with credentials`,"sazabi log-sources skill --provider gcp # Show agent setup skill"]).build();oe();oe();Ha();xm();ye();import*as Fr from"node:fs";import*as jS from"node:readline";var Mm=(e)=>new Promise((t)=>setTimeout(t,e));var rot=(e)=>`${e.getTime()*1e6}`,iot=(e)=>Object.entries(e).map(([t,n])=>({key:t,value:{stringValue:n}})),sot=[{pattern:/\b(?:fatal|critical|crit)\b/i,severityNumber:21,severityText:"FATAL"},{pattern:/\b(?:error|err)\b/i,severityNumber:17,severityText:"ERROR"},{pattern:/\b(?:warn|warning)\b/i,severityNumber:13,severityText:"WARN"},{pattern:/\bdebug\b/i,severityNumber:5,severityText:"DEBUG"},{pattern:/\btrace\b/i,severityNumber:1,severityText:"TRACE"}],aot={severityNumber:9,severityText:"INFO"},cot=(e)=>{let t=null;for(let{pattern:n,severityNumber:r,severityText:o}of sot){let i=n.exec(e);if(i&&(t===null||i.index<t.index))t={index:i.index,severityNumber:r,severityText:o}}return t?{severityNumber:t.severityNumber,severityText:t.severityText}:aot},Cfe=(e,t,n={})=>{let o=rot(new Date),i=n.serviceName??"sazabi-cli",s=iot(n.attributes??{}),c=e.filter((l)=>l.trim().length>0).map((l)=>({timeUnixNano:o,observedTimeUnixNano:o,...cot(l),body:{stringValue:l},attributes:s}));return{resourceLogs:[{resource:{attributes:[{key:"service.name",value:{stringValue:i}},{key:"sazabi.public_key",value:{stringValue:t}}]},scopeLogs:[{scope:{name:"sazabi-cli-forward",version:"1.0.0"},logRecords:c}]}]}};function lot(e,t,n){return e===1?t:n??`${t}s`}function yo(e,t,n){return`${e} ${lot(e,t,n)}`}ce();En();var uot="15003",dot="SAZABI_INTERNAL_LOG_FORWARDING_SECRET",pot="SAZABI_INTERNAL_LOG_FORWARDING_SOURCE",got="sazabi.source",mot="sazabi.internal.source",hot=(e)=>e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e,Aot=(e)=>{let t=hot(e);return t==="localhost"||t==="127.0.0.1"||t==="::1"},fot=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)return;if(!Aot(t.hostname))return;return t.protocol="http:",t.port=uot,t.pathname="",t.search="",t.hash="",t.toString()},ez=async(e,t)=>{if(!t)q("Ensuring public key exists...");let n=await e.publicKeys.ensureLogForwarding({});if(!n.success){if(!t)$o(`Failed to ensure public key: ${n.error}. Pass --public-key <value> or check your project access and try again.`);return null}if(!t)z(`Using public key: ${n.value.publicKey.name}`);return{value:n.value.publicKey.value,projectId:n.value.publicKey.projectId,createdAt:n.value.publicKey.createdAt}},yot=({explicitPublicKey:e,cachedPublicKey:t,cachedPublicKeyProjectId:n,activeProjectId:r})=>{let o=e?.trim();if(o)return o;let i=t?.trim();if(!i)return;return n?.trim()===r?i:void 0},bot=(e)=>{if(!e||e.length===0)return{success:!0,value:{}};let t={};for(let n of e){let r=n.indexOf("=");if(r<=0)return{success:!1,error:`Invalid attribute "${n}". Use key=value.`};let o=n.slice(0,r).trim();if(!o)return{success:!1,error:`Invalid attribute "${n}". Attribute key is required.`};t[o]=n.slice(r+1)}return{success:!0,value:t}},Iot=(e)=>{let t=process.env[dot]?.trim();if(!t)return;let n=process.env[pot]?.trim()||e[mot]?.trim()||e[got]?.trim()||void 0;return{secret:t,...n?{source:n}:{}}},tz=(e,t,n,r,o,i,s,c,l,u,d)=>async()=>{if(e.length===0)return;let p=Cfe(e,r,c),g=wot(p);if(e.length=0,g===0)return;if(!u)q(`Forwarding ${yo(g,"log")}...`);let m=await n.logs.forward({publicKey:r,logs:p,region:i,...s?{projectId:s}:{},...l?{sazabiInternalForwarding:l}:{}});while(!m.success&&Pot(m)&&Rot(o)){if(!u)q("Public key is still propagating to intake (usually under a minute); retrying...");await Mm(xot),m=await n.logs.forward({publicKey:r,logs:p,region:i,...s?{projectId:s}:{},...l?{sazabiInternalForwarding:l}:{}})}if(!m.success){if(Eot(m)){I(m,"Failed to forward logs",u);return}if(t.totalFailed+=g,u)process.stderr.write(`Failed to forward logs: ${m.error}
|