@sazabi/cli 0.17.0-dev.gd92ec3e → 0.17.0

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.
Files changed (2) hide show
  1. package/dist/index.js +63 -63
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6840,7 +6840,7 @@ log_user_prompt = true
6840
6840
 
6841
6841
  [otel.exporter.otlp-http]
6842
6842
  endpoint = "https://\${context.ingestHost}/v1/logs"
6843
- protocol = "binary"`}],notes:[{text:"`log_user_prompt = true` exports raw prompt text (including anything you paste). Set it to `false` to keep prompts private while still tracking tool calls and API usage.",variant:"requirement"},{text:"Codex requires the full logs URL in `endpoint` — it does not append the `/v1/logs` path itself."},{text:"Codex metrics are not ingested yet — leave `metrics_exporter` at its default; pointing it at Sazabi only ships traffic that intake discards."}]}]},{id:"restart",section:"verify",title:"Restart Codex",actions:[{instruction:"Configuration loads at startup — telemetry begins with your next Codex session, not the current one. Restart Codex now."}]}]}});var uN;var gN=g(()=>{lN();uN={id:"codex",name:"Codex",searchAliases:["openai","codex-cli","openai codex","coding agent"],capabilities:["connectionless"],auth:[],delivery:["push"],intake:[{id:"codex",label:"Codex",transform:"otlp-passthrough"}],lifecycleSkipReason:"Manual Codex config.toml setup is not exercised by automated lifecycle tests yet.",subtitle:"Ship Codex CLI session telemetry — prompts, tool calls, and model API requests — to Sazabi via Codex's built-in OTLP exporter.",features:["Prompt and tool-call events","Model API request metadata","Session and user attribution","No code changes required"],evidenceHints:["~/.codex/config.toml or .codex/ project configuration","Codex CLI installed and in active use","AGENTS.md files authored for Codex"],setupSkill:W,dashboard:{slug:"codex",iconKey:"codex",intakeSourceId:"codex"}}});var gv,dv,yv;var dN=g(()=>{$t();gv={kind:"multi-step",steps:[{id:"credentials",title:"Enter access token",actions:[{kind:"instruction",instruction:"Create a team access token in your [Convex dashboard team settings](https://dashboard.convex.dev)."},{id:"token",kind:"secret",label:"Team access token",instruction:"Enter your Team access token below.",placeholder:"eyJ..."}]},{id:"team",title:"Choose team",actions:[{id:"team",kind:"select",label:"Team",instruction:"Select the Convex team whose deployments Sazabi should list.",placeholder:"Select a team",optionsAction:"options",optionsInput:{token:"$token"},optionValueField:"id",optionLabelField:"name",optionDescriptionField:"slug"}]}],submit:{metadata:{accessToken:"$token",teamId:"$team.id",teamName:"$team.name"},displayName:"$team.name",button:Ue}},dv={groups:[{id:"open-log-streams",section:"config",title:"Open Log Streams",notes:[{variant:"requirement",text:"**Convex log streams require the Pro plan.** Free/Starter teams cannot configure log streams."}],actions:[{instruction:"In your [Convex dashboard](https://dashboard.convex.dev), open the deployment you want to forward, then go to **Settings > Integrations** and configure a **Webhook** log stream.",notes:[{text:"Log streams are **per deployment** — repeat this setup for each deployment you want to forward. To onboard many deployments at once, connect your Convex account instead and Sazabi creates the log streams for you."}]}]},{id:"endpoint",section:"config",title:"Set webhook URL",actions:[{instruction:"Paste your Sazabi intake URL (above) into the webhook configuration."}]},{id:"verify",section:"verify",title:"Save and verify",actions:[{instruction:"Save the log stream, then trigger activity — run a Convex function or hit a deployed endpoint. Logs appear in Sazabi within a few minutes."}]}],docsUrl:"https://docs.sazabi.com/data/sources/endpoint/convex"},yv={content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:[{field:"name",header:"Name"},{field:"slug",header:"Slug",width:"w-48",cell:"muted"}],searchPlaceholder:"Search deployments...",searchFields:["name"],dedupeByConfigField:"deploymentId",emptyState:{noMatches:"No deployments found.",allConfigured:"All deployments already have log streams configured."},toStreamItem:{displayName:"$item.name",config:{deploymentId:"$item.id",deploymentName:"$item.name"}}}}});var k7,v7,yN;var bN=g(()=>{dN();k7=["accessToken"],v7={id:"convex",label:"Convex",transform:"convex-webhook"},yN={id:"convex",name:"Convex",capabilities:["connectionless","managed"],auth:["apiToken"],delivery:["push"],lifecycleEligible:!0,sensitiveFields:k7,intake:[v7],subtitle:"Forward your Convex deployment logs directly to Sazabi for serverless observability.",features:["Function logs","Database mutations","Scheduled job monitoring"],evidenceHints:["convex/ directory, convex.json, or convex package imports","CONVEX_* or NEXT_PUBLIC_CONVEX_URL environment variables","README/docs naming Convex for serverless functions or database state"],setupSkill:W,dashboard:{iconKey:"convex",intakeSourceId:"convex",streamSelectorLayout:"sidepanel",actions:{list:{options:{procedure:"convex.listTeams",itemsField:"teams",sensitiveInputFields:["token"]},list:{procedure:"convex.listDeployments",itemsField:"deployments",sensitiveInputFields:["token"]}}}}}});var bv;var mN=g(()=>{bv={perStreamInstructions:!0,groups:[{id:"configure",section:"config",title:"Configure the Datadog Agent",actions:[{instruction:"Choose how this Datadog Agent should ship logs to Sazabi, then apply the matching configuration.",payloads:[{kind:"options",options:[{id:"datadog-yaml-dual-ship",label:"`datadog.yaml` dual-ship",description:"Keep the Agent's Datadog API key and add Sazabi as an additional logs endpoint.",payloads:[{kind:"copyable",label:"Intake host",value:"${context.ingestHost}",copyLabel:"Datadog intake host",description:"Use this host in `logs_config.additional_endpoints`."},{kind:"code",language:"yaml",copyLabel:"datadog.yaml dual-ship configuration",value:`# Enable logs collection if it is not already enabled.
6843
+ protocol = "binary"`}],notes:[{text:"`log_user_prompt = true` exports raw prompt text (including anything you paste). Set it to `false` to keep prompts private while still tracking tool calls and API usage.",variant:"requirement"},{text:"Codex requires the full logs URL in `endpoint` — it does not append the `/v1/logs` path itself."},{text:"Codex metrics are not ingested yet — leave `metrics_exporter` at its default; pointing it at Sazabi only ships traffic that intake discards."}]}]},{id:"restart",section:"verify",title:"Restart Codex",actions:[{instruction:"Configuration loads at startup — telemetry begins with your next Codex session, not the current one. Restart Codex now."}]}]}});var uN;var gN=g(()=>{lN();uN={id:"codex",name:"Codex",searchAliases:["openai","codex-cli","openai codex","coding agent"],capabilities:["connectionless"],auth:[],delivery:["push"],intake:[{id:"codex",label:"Codex",transform:"otlp-passthrough"}],lifecycleSkipReason:"Manual Codex config.toml setup is not exercised by automated lifecycle tests yet.",subtitle:"Ship Codex CLI session telemetry — prompts, tool calls, and model API requests — to Sazabi via Codex's built-in OTLP exporter.",features:["Prompt and tool-call events","Model API request metadata","Session and user attribution","No code changes required"],evidenceHints:["~/.codex/config.toml or .codex/ project configuration","Codex CLI installed and in active use","AGENTS.md files authored for Codex"],setupSkill:W,dashboard:{slug:"codex",iconKey:"codex",intakeSourceId:"codex"}}});var gv,dv,yv;var dN=g(()=>{$t();gv={kind:"multi-step",steps:[{id:"credentials",title:"Enter access token",actions:[{kind:"instruction",instruction:"Create a team access token in your [Convex dashboard team settings](https://dashboard.convex.dev)."},{id:"token",kind:"secret",label:"Team access token",instruction:"Enter your team access token below.",placeholder:"eyJ..."}]},{id:"team",title:"Choose team",actions:[{id:"team",kind:"select",label:"Team",instruction:"Select the Convex team whose deployments Sazabi should list.",placeholder:"Select a team",optionsAction:"options",optionsInput:{token:"$token"},optionValueField:"id",optionLabelField:"name",optionDescriptionField:"slug"}]}],submit:{metadata:{accessToken:"$token",teamId:"$team.id",teamName:"$team.name"},displayName:"$team.name",button:Ue}},dv={groups:[{id:"open-log-streams",section:"config",title:"Open Log Streams",notes:[{variant:"requirement",text:"**Convex log streams require the Pro plan.** Free/Starter teams cannot configure log streams."}],actions:[{instruction:"In your [Convex dashboard](https://dashboard.convex.dev), open the deployment you want to forward, then go to **Settings > Integrations** and configure a **Webhook** log stream.",notes:[{text:"Log streams are **per deployment** — repeat this setup for each deployment you want to forward. To onboard many deployments at once, connect your Convex account instead and Sazabi creates the log streams for you."}]}]},{id:"endpoint",section:"config",title:"Set webhook URL",actions:[{instruction:"Paste your Sazabi intake URL (above) into the webhook configuration."}]},{id:"verify",section:"verify",title:"Save and verify",actions:[{instruction:"Save the log stream, then trigger activity — run a Convex function or hit a deployed endpoint. Logs appear in Sazabi within a few minutes."}]}],docsUrl:"https://docs.sazabi.com/data/sources/endpoint/convex"},yv={content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:[{field:"name",header:"Name"},{field:"slug",header:"Slug",width:"w-48",cell:"muted"}],searchPlaceholder:"Search deployments...",searchFields:["name"],dedupeByConfigField:"deploymentId",emptyState:{noMatches:"No deployments found.",allConfigured:"All deployments already have log streams configured."},toStreamItem:{displayName:"$item.name",config:{deploymentId:"$item.id",deploymentName:"$item.name"}}}}});var k7,v7,yN;var bN=g(()=>{dN();k7=["accessToken"],v7={id:"convex",label:"Convex",transform:"convex-webhook"},yN={id:"convex",name:"Convex",capabilities:["connectionless","managed"],auth:["apiToken"],delivery:["push"],lifecycleEligible:!0,sensitiveFields:k7,intake:[v7],subtitle:"Forward your Convex deployment logs directly to Sazabi for serverless observability.",features:["Function logs","Database mutations","Scheduled job monitoring"],evidenceHints:["convex/ directory, convex.json, or convex package imports","CONVEX_* or NEXT_PUBLIC_CONVEX_URL environment variables","README/docs naming Convex for serverless functions or database state"],setupSkill:W,dashboard:{iconKey:"convex",intakeSourceId:"convex",streamSelectorLayout:"sidepanel",actions:{list:{options:{procedure:"convex.listTeams",itemsField:"teams",sensitiveInputFields:["token"]},list:{procedure:"convex.listDeployments",itemsField:"deployments",sensitiveInputFields:["token"]}}}}}});var bv;var mN=g(()=>{bv={perStreamInstructions:!0,groups:[{id:"configure",section:"config",title:"Configure the Datadog Agent",actions:[{instruction:"Choose how this Datadog Agent should ship logs to Sazabi, then apply the matching configuration.",payloads:[{kind:"options",options:[{id:"datadog-yaml-dual-ship",label:"`datadog.yaml` dual-ship",description:"Keep the Agent's Datadog API key and add Sazabi as an additional logs endpoint.",payloads:[{kind:"copyable",label:"Intake host",value:"${context.ingestHost}",copyLabel:"Datadog intake host",description:"Use this host in `logs_config.additional_endpoints`."},{kind:"code",language:"yaml",copyLabel:"datadog.yaml dual-ship configuration",value:`# Enable logs collection if it is not already enabled.
6844
6844
  logs_enabled: true
6845
6845
 
6846
6846
  # Send a copy of logs to Sazabi while the primary Agent config
@@ -7471,14 +7471,14 @@ sinks:
7471
7471
  codec: otlp`}]}]}]},{id:"wire-sources",section:"config",title:"Wire sources",actions:[{instruction:'Replace `inputs: ["*"]` on the `remap` transform with your specific source or transform IDs in production. `["*"]` also matches `internal_metrics` and other unrelated components.',notes:[{variant:"requirement",text:"The sink's `otlp` codec doesn't build the OTLP envelope on its own. If you wire raw sources straight into it, Vector drops every event."},{text:"Sazabi indexes logs and traces from Vector. It accepts metrics at the intake but silently drops them."}]}]},{id:"traces",section:"config",title:"Forward traces (optional)",actions:[{instruction:'Add a second `opentelemetry` sink with `uri` ending in `/v1/traces` and explicit `inputs` referencing an already-OTLP-shaped source, typically an `opentelemetry` Vector source with `use_otlp_decoding.traces: true` (use `inputs: ["otlp_in.traces"]`).',notes:[{text:"No remap is needed for traces."},{variant:"requirement",text:'Do not wire `["*"]` into a traces sink.'}]}]}]}});var nx;var ox=g(()=>{tx();nx={id:"vector",name:"Vector",capabilities:["connectionless"],auth:[],delivery:["push"],lifecycleSkipReason:"Manual agent setup is not exercised by automated lifecycle tests yet.",intake:[{id:"vector",label:"Vector",transform:"otlp-passthrough"}],subtitle:"Forward logs and traces from your infrastructure to Sazabi using the Vector observability pipeline.",features:["Kubernetes DaemonSet","High-throughput pipeline","Built-in transforms","Multiple source types"],evidenceHints:["vector.toml/yaml/json, vector.dev Helm values, or Vector sidecars","VECTOR_* environment variables or VRL transform config","README/docs naming Vector as the observability pipeline"],setupSkill:W,dashboard:{iconKey:"vector",intakeSourceId:"vector"}}});var cS,sS,aS,hS;var rx=g(()=>{$t();cS={kind:"multi-step",steps:[{id:"prepare",title:"Create token",actions:[{kind:"instruction",instruction:"Create a full-access API token in your [Vercel account settings](https://vercel.com/account/tokens). For team accounts, create the token while scoped to the correct team.",notes:[{text:"A token gets the same permissions as your account."}]}]},{id:"credentials",title:"Enter token",actions:[{id:"token",kind:"secret",label:"API token",instruction:"Enter your Vercel API token below.",placeholder:"Enter your Vercel API token"}]}],submit:{actions:[{kind:"validate",action:"validate",input:{token:"$token"},resultAs:"validate"}],metadata:{vercelApiToken:"$token",vercelTeamId:"$validate.teamId",vercelTeamName:"$validate.teamName"},button:Ue}},sS={groups:[{id:"open-drains",section:"config",title:"Open Drains",notes:[{variant:"requirement",text:"**Vercel Drains require the Pro or Enterprise plan.** Hobby and Pro Trial teams cannot create drains."}],actions:[{instruction:"In your [Vercel dashboard](https://vercel.com/dashboard), go to **Team Settings > Drains** and create a new drain."},{instruction:"Choose **Logs** as the data to deliver.",notes:[{text:"This path covers logs only — to send traces or Web Analytics events, connect your Vercel account instead and Sazabi creates those drains for you."}]}]},{id:"endpoint",section:"config",title:"Set the endpoint",actions:[{instruction:"Paste your Sazabi intake URL (above) into the drain's endpoint field."}]},{id:"delivery-settings",section:"config",title:"Set delivery options",actions:[{instruction:"Set the delivery format to **JSON**.",notes:[{text:"Sazabi does not parse NDJSON on this endpoint."}]},{instruction:"Pick the projects, environments, and log sources to send.",notes:[{text:"Sazabi accepts every Vercel log source (Static, Lambda, Edge, Build, External, Firewall, Redirect)."}]}]},{id:"verify",section:"verify",title:"Save and verify",actions:[{instruction:"Save the drain, then send some traffic — push a deployment or hit an application route. Logs show up in Sazabi within a few minutes."}]}],docsUrl:"https://docs.sazabi.com/data/sources/endpoint/vercel"},aS=[{field:"name",header:"Project"},{field:"framework",header:"Framework",width:"w-32",cell:"badge",transform:"fallback:Unspecified"}],hS={content:{kind:"tabs",tabs:[{id:"logs",label:"Logs",content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:aS,searchPlaceholder:"Search projects...",searchFields:["name","framework"],dedupeByConfigField:"vercelProjectId",dedupeExtraMatch:{drainType:"logs"},emptyState:{noMatches:"No projects found.",allConfigured:"All projects already have logs drains configured."},toStreamItem:{displayName:"$item.name (Logs)",config:{vercelProjectId:"$item.id",vercelProjectName:"$item.name",drainType:"logs"}}}},{id:"traces",label:"Traces",content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:aS,searchPlaceholder:"Search projects...",searchFields:["name","framework"],dedupeByConfigField:"vercelProjectId",dedupeExtraMatch:{drainType:"traces"},emptyState:{noMatches:"No projects found.",allConfigured:"All projects already have traces drains configured."},toStreamItem:{displayName:"$item.name (Traces)",config:{vercelProjectId:"$item.id",vercelProjectName:"$item.name",drainType:"traces"}}}},{id:"analytics",label:"Analytics",content:{kind:"list",listAction:"list",listInput:{connectionId:"${context.connectionId}"},columns:aS,searchPlaceholder:"Search projects...",searchFields:["name","framework"],dedupeByConfigField:"vercelProjectId",dedupeExtraMatch:{drainType:"analytics"},emptyState:{noMatches:"No projects found.",allConfigured:"All projects already have analytics drains configured."},toStreamItem:{displayName:"$item.name (Analytics)",config:{vercelProjectId:"$item.id",vercelProjectName:"$item.name",drainType:"analytics"}}}}]}}});var G7,J7,H7,ix;var ax=g(()=>{rx();G7=["vercelApiToken"],J7={id:"vercel",label:"Vercel",transform:"vercel-drain"},H7={id:"vercel-analytics",label:"Vercel Analytics",transform:"vercel-analytics-drain"},ix={id:"vercel",name:"Vercel",capabilities:["connectionless","managed"],auth:["apiToken"],delivery:["push"],lifecycleEligible:!0,sensitiveFields:G7,intake:[J7,H7],subtitle:"Forward your Vercel deployment logs, traces, and Web Analytics events directly to Sazabi for real-time analysis and alerting.",features:["Log forwarding","Trace forwarding","Web Analytics forwarding","Real-time streaming"],evidenceHints:["vercel.json, .vercel/, or Vercel build/deploy scripts","@vercel packages, VERCEL_* environment variables, or GitHub Actions that run vercel","README/docs naming Vercel as the deployment host"],setupSkill:W,dashboard:{iconKey:"vercel",intakeSourceId:"vercel",streamSelectorLayout:"sidepanel",streamTableColumns:[{kind:"config-enum-badge",header:"Type",width:"w-24",configField:"drainType",values:[{value:"logs",label:"Logs"},{value:"traces",label:"Traces"},{value:"analytics",label:"Analytics"}],fallbackLabel:"N/A"}],actions:{submit:{validate:{kind:"source-action",actionId:"validate-token"}},list:{list:{kind:"source-action",actionId:"list-projects",itemsField:"projects"}}}}}});var lS;var cx=g(()=>{lS={perStreamInstructions:!0,groups:[{id:"endpoint",section:"config",title:"Send events",actions:[{instruction:"Send an HTTP `POST` with a JSON body to your webhook URL (above).",notes:[{text:"A single JSON object is stored as one event; a JSON array of objects is stored as one event per element."},{text:"You can append any path — for example `/deploys` — to record the event's origin; the path is passed through and stored as `webhook.path`."}]}]},{id:"configure-vendor",section:"config",title:"Paste the URL into your vendor",actions:[{instruction:"Open your vendor's webhook or outbound-event settings, add a new endpoint, and paste the URL above. Choose JSON as the payload format if the vendor offers a choice.",notes:[{text:"Sazabi reads the time, severity, and message from common field names when present, and stores every field of the payload under `webhook.*` either way. There is nothing to map or declare."}]}]},{id:"verify",section:"verify",title:"Send a test event and verify",actions:[{instruction:"Trigger a test event from your vendor — most webhook settings pages have a “Send test” button — or POST a sample event yourself, then watch for it below.",payloads:[{kind:"code",label:"Send a test event",language:"bash",copyLabel:"curl test event",value:`curl -X POST \\
7472
7472
  https://\${context.ingestHost}/test \\
7473
7473
  -H 'content-type: application/json' \\
7474
- -d '{"event":"hello.world","level":"info","message":"first webhook event"}'`}]}]}]}});var sx;var hx=g(()=>{cx();sx={id:"webhook_events",name:"Webhook Events",searchAliases:["webhook","webhooks","json events","http events","generic webhook","event stream"],capabilities:["connectionless"],auth:[],delivery:["push"],intake:[{id:"webhook-events",label:"Webhook Events",transform:"webhook-events"}],lifecycleSkipReason:"Manual webhook setup is not exercised by automated lifecycle tests yet.",subtitle:"Point any vendor's webhooks at Sazabi. Arbitrary JSON events land as searchable log records with zero vendor-specific configuration.",features:["Any JSON event stream","One keyed URL per endpoint","Full payload preserved as attributes","No schema or field mapping"],evidenceHints:["A vendor that emits plain JSON webhooks without a dedicated Sazabi source","An internal service, deploy bot, or cron that POSTs JSON events","Existing outbound webhook configuration with no other Sazabi destination"],setupSkill:W,dashboard:{slug:"webhook-events",iconKey:"webhook-events",intakeSourceId:"webhook-events"}}});var Kl,lx,eNe,tNe,lo,nNe,oNe,B7,W7,Z7,rNe;var ux=g(()=>{eN();oN();aN();hN();gN();bN();wN();vN();$N();TN();CN();_N();xN();MN();qN();HN();ZN();YN();e1();o1();a1();h1();g1();b1();w1();v1();$1();T1();C1();_1();x1();M1();q1();H1();Z1();Y1();ex();ox();ax();hx();Kl=[Vj,nN,iN,sN,uN,yN,pN,kN,PN,LN,AN,zN,NN,UN,EN,JN,WN,XN,VN,n1,i1,s1,u1,y1,p1,k1,P1,L1,A1,z1,N1,U1,J1,E1,W1,X1,V1,nx,ix,sx],lx=Kl,eNe=Object.fromEntries(lx.map((e)=>[e.id,e.sensitiveFields??[]])),tNe=Object.fromEntries(lx.flatMap((e)=>[...Object.values(e.dashboard?.actions?.submit??{}),...Object.values(e.dashboard?.actions?.list??{}),...Object.values(e.dashboard?.actions?.prefetch??{})].flatMap((t)=>{let n=t.sensitiveInputFields??[];if(n.length===0)return[];return[["procedure"in t?t.procedure:`${e.id}.${t.actionId}`,n]]}))),lo=["vercel","cloudflare","railway","render","fly_io","netlify","supabase","digital_ocean","inngest","trigger_dev","temporal","mastra","neon","langchain","daytona","e2b","cloudwatch","convex","datadog","sentry","sentry_platform","openrouter","posthog","posthog_sdk","gcp","otel","otel_metrics","fluent_bit","vector","grafana_alloy","otel_collector","cloudflare_workers","elastic_cloud","porter","respan","plain","prometheus","webhook_events","claude_code","codex"],nNe=Kl.map((e)=>({id:e.id,name:e.name,capabilities:e.capabilities})),oNe=Object.fromEntries(Kl.map((e)=>[e.id,{name:e.name,setupSkill:e.setupSkill}])),B7={cloudflare:tv,cloudwatch:sv,convex:gv,digital_ocean:pv,fly_io:Pv,gcp:Lv,plain:Mv,posthog:Gv,render:Fv,sentry_platform:eS,vercel:cS},W7={cloudflare:nv,cloudwatch:hv,convex:yv,digital_ocean:fv,fly_io:Iv,gcp:Tv,plain:Ev,posthog:Jv,render:Yv,vercel:hS},Z7={cloudflare:ov,cloudflare_workers:rv,cloudwatch:lv,convex:dv,datadog:bv,daytona:mv,digital_ocean:wv,fluent_bit:Sv,fly_io:$v,grafana_alloy:Av,e2b:kv,elastic_cloud:vv,gcp:Ov,inngest:Cv,langchain:Dv,mastra:zv,neon:_v,netlify:jv,openrouter:Nv,otel:xv,otel_collector:Rv,otel_metrics:Uv,plain:Kv,posthog:Hv,posthog_sdk:Bv,porter:qv,prometheus:Wv,railway:Zv,render:Xv,respan:Qv,sentry:Vv,sentry_platform:tS,supabase:nS,temporal:oS,trigger_dev:rS,vector:iS,vercel:sS,webhook_events:lS,claude_code:ev,codex:uv},rNe=Kl.map((e)=>({sourceId:e.id,name:e.name,capabilities:e.capabilities,setupAuthModes:e.auth,deliveryModes:e.delivery,hasDashboardMetadata:Boolean(e.dashboard),hasManagedFlow:Boolean(B7[e.id]),hasConnectionlessFlow:Boolean(Z7[e.id]),hasStreamSelector:Boolean(W7[e.id]),lifecycleEligible:e.lifecycleEligible??!1,lifecycleSkipReason:e.lifecycleSkipReason}))});var gx=g(()=>{ux()});var El=g(()=>{Yj();gx()});var dx,uS,F7,ql,X7,yx,gS,oc,rc,bx,mx,px,Gl,wx,fx,Zr,kx,vx,Fr,Sx,Px,Jl,$x,Ix,Hl,Lx,Tx,Bl,Ox,Ax,Wl,Cx,Dx,Zl,zx,_x,Fl,jx,Nx,Xl,xx,Rx,Yl,Y7;var dS=g(()=>{El();be();Le();dx=lo,uS=a.enum(dx),F7=a.enum(["pending","provisioning","active","error"]),ql=a.enum(["managed","connectionless"]),X7=a.object({name:a.string().describe("Field name used as the JSON key in metadata."),type:a.string().describe('Zod type name, e.g. "string", "boolean", "enum".'),required:a.boolean().describe("Whether the field is required."),sensitive:a.boolean().describe("Whether the field contains a secret and will be encrypted."),description:a.string().nullable().describe("Human-readable description of the field.")}),yx=a.object({id:a.string().describe("Data source type identifier."),name:a.string().describe("Human-readable display name."),modes:a.array(ql).describe("Setup modes this source supports. `managed` sources take vendor credentials; `connectionless` sources mint a keyed intake endpoint."),metadataFields:a.array(X7).describe("Fields required in the metadata object when creating a managed instance. Empty for connectionless-only sources."),setupSkill:a.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),gS=a.object({kind:a.enum(["url","hostPort"]).describe("Card shape. `url` = a complete keyed URL whose hostname authenticates; `hostPort` = a non-keyed listener host + port whose credential travels separately."),label:a.string().optional().describe("Card label. Present when a source exposes several endpoints (e.g. separate logs and traces destinations)."),url:a.string().optional().describe("The complete keyed intake URL. Present when kind is `url`."),host:a.string().optional().describe("The regional listener hostname (no scheme). Present when kind is `hostPort`."),port:a.number().int().optional().describe("The listener port. Present when kind is `hostPort`."),description:a.string().optional().describe("Vendor-specific guidance rendered under the value."),extraCredential:a.object({label:a.string(),value:a.string(),description:a.string().optional()}).optional().describe("The credential the sender must attach when the hostname alone does not authenticate. Present when kind is `hostPort`.")}),oc=a.object({id:a.string().uuid(),instanceId:a.string().uuid().describe("Root instance ID. Every stream roots on exactly one data source instance."),displayName:a.string(),config:a.record(a.string(),a.unknown()),status:F7,errorMessage:a.string().nullable(),enabled:a.boolean().describe("Whether the stream is currently ingesting. Independent of provisioning status: a paused stream stays configured but stops accepting new data."),createdAt:a.string().datetime(),endpointCards:a.array(gS).optional().describe("Server-computed endpoint card(s) for this stream's delivery key — where to point the sender. Present only for streams that carry their own intake key.")}),rc=a.object({id:a.string().uuid(),dataSourceType:uS,mode:ql,name:a.string().nullable().describe("Display name. For connectionless instances this falls back to the stream's name when no explicit name is set."),streamCount:a.number().int(),createdAt:a.string().datetime()}),bx=rc.extend({streams:a.array(oc).describe("The instance's live streams, newest first.")}),mx=a.object({}),px=a.object({types:a.array(yx)}),Gl=P({operationId:"dataSources.listTypes",description:"List all supported data source types with their setup modes and metadata requirements.",backend:"api",route:{method:"GET",path:"/data-sources/types",tags:["Data Sources"]},input:mx,output:px,pagination:"none",async:"sync"}),wx=a.object({projectId:a.string().uuid().optional().describe("Project to list instances for. Auto-filled from SDK context when omitted."),dataSourceType:uS.optional().describe("Filter instances by data source type.")}),fx=a.object({instances:a.array(rc)}),Zr=P({operationId:"dataSources.listInstances",description:"List data source instances within one project.",backend:"api",route:{method:"GET",path:"/data-sources/instances",tags:["Data Sources"]},input:wx,output:fx,pagination:"none",async:"sync"}),kx=a.object({projectId:a.string().uuid().optional().describe("Project to create the instance in. Auto-filled from SDK context when omitted."),dataSourceType:uS.describe("Data source type identifier."),mode:ql.optional().describe("Setup mode. Defaults to `managed` when metadata is provided, otherwise `connectionless`. Must be a mode the source supports (see `modes` on the type catalog)."),name:a.string().optional().describe("Optional human-readable name for this instance."),metadata:a.record(a.string(),a.unknown()).optional().describe("Vendor credentials and configuration for managed setup. Fields vary by data source type (see `metadataFields` on the type catalog). Required for managed mode; must be omitted for connectionless mode.")}),vx=a.object({instance:rc.describe("The created instance."),streamId:a.string().uuid().optional().describe("ID of the stream created alongside the instance. Present for connectionless instances (which always mint their keyed stream) and for managed sources that auto-provision a default stream."),publicKey:a.string().optional().describe("Intake key minted for the instance. Store this securely — it is only shown once. Present for connectionless instances and for managed sources that ingest through a Sazabi endpoint."),endpointCards:a.array(gS).optional().describe("Server-computed endpoint card(s) for the minted key — where to point the sender. Present for connectionless instances.")}),Fr=P({operationId:"dataSources.createInstance",description:"Create a data source instance. Managed mode takes vendor credentials in `metadata`, validates them, and provisions delivery behind the instance. Connectionless mode mints the instance plus a keyed stream and returns the intake key and endpoint card(s) to point the sender at.",backend:"api",route:{method:"POST",path:"/data-sources/instances",successStatus:201,tags:["Data Sources"]},input:kx,output:vx,pagination:"none",async:"sync"}),Sx=a.object({instanceId:a.string().uuid().describe("Instance ID to fetch.")}),Px=a.object({instance:bx}),Jl=P({operationId:"dataSources.getInstance",description:"Get one data source instance by ID, including its streams and their endpoint card(s).",backend:"api",route:{method:"GET",path:"/data-sources/instances/{instanceId}",tags:["Data Sources"]},input:Sx,output:Px,pagination:"none",async:"sync"}),$x=a.object({instanceId:a.string().uuid().describe("Instance ID to update."),name:a.string().min(1).optional().describe("New display name for the instance."),enabled:a.boolean().optional().describe("Pause (`false`) or resume (`true`) ingestion for all of the instance's streams. Reversible; never deletes anything.")}),Ix=a.object({instance:rc}),Hl=P({operationId:"dataSources.updateInstance",description:"Update a data source instance: rename it and/or pause or resume ingestion across its streams.",backend:"api",route:{method:"PATCH",path:"/data-sources/instances/{instanceId}",tags:["Data Sources"]},input:$x,output:Ix,pagination:"none",async:"sync"}),Lx=a.object({instanceId:a.string().uuid().describe("Instance ID to delete.")}),Tx=a.object({success:a.boolean(),teardownError:a.string().nullable().describe("Null when vendor-side cleanup succeeded or was not needed; error message when remote cleanup failed and must be finished manually.")}),Bl=P({operationId:"dataSources.deleteInstance",description:"Delete a data source instance. Tombstones the instance and its streams, deactivates their intake keys (already-ingested data is preserved with its attribution), and runs vendor-side cleanup for managed instances when the source supports it.",backend:"api",route:{method:"DELETE",path:"/data-sources/instances/{instanceId}",successStatus:200,tags:["Data Sources"]},input:Lx,output:Tx,pagination:"none",async:"sync"}),Ox=a.object({instanceId:a.string().uuid().describe("Instance ID to list streams for."),enabled:a.boolean().optional().describe("Optional filter on stream ingestion state. Omit to list all streams; pass true for only enabled streams or false for only paused streams.")}),Ax=a.object({streams:a.array(oc)}),Wl=P({operationId:"dataSources.listStreams",description:"List the streams that belong to a data source instance.",backend:"api",route:{method:"GET",path:"/data-sources/instances/{instanceId}/streams",tags:["Data Sources"]},input:Ox,output:Ax,pagination:"none",async:"sync"}),Cx=a.object({instanceId:a.string().uuid().describe("Instance ID to create the stream under."),displayName:a.string().min(1).describe("Resource name, e.g. service or app name."),config:a.record(a.string(),a.unknown()).optional().describe("Platform-specific stream configuration.")}),Dx=a.object({streamId:a.string().uuid().describe("ID of the created stream.")}),Zl=P({operationId:"dataSources.createStream",description:"Create a new stream under a managed data source instance. Triggers async provisioning; poll the stream to track it. Connectionless instances are single-stream — create another instance instead.",backend:"api",route:{method:"POST",path:"/data-sources/instances/{instanceId}/streams",successStatus:201,tags:["Data Sources"]},input:Cx,output:Dx,pagination:"none",async:"sync"}),zx=a.object({streamId:a.string().uuid().describe("Stream ID to fetch.")}),_x=a.object({stream:oc}),Fl=P({operationId:"dataSources.getStream",description:"Get one data source stream by ID. Use to poll provisioning status.",backend:"api",route:{method:"GET",path:"/data-sources/streams/{streamId}",tags:["Data Sources"]},input:zx,output:_x,pagination:"none",async:"sync"}),jx=a.object({streamId:a.string().uuid().describe("Stream ID to update."),displayName:a.string().min(1).optional().describe("New display name for the stream."),enabled:a.boolean().optional().describe("Pause (`false`) or resume (`true`) ingestion for this stream. Reversible; never deletes anything.")}),Nx=a.object({stream:oc}),Xl=P({operationId:"dataSources.updateStream",description:"Update a data source stream: rename it and/or pause or resume its ingestion.",backend:"api",route:{method:"PATCH",path:"/data-sources/streams/{streamId}",tags:["Data Sources"]},input:jx,output:Nx,pagination:"none",async:"sync"}),xx=a.object({streamId:a.string().uuid().describe("Stream ID to delete.")}),Rx=a.object({success:a.boolean()}),Yl=P({operationId:"dataSources.deleteStream",description:"Delete a data source stream. Tombstones the stream and deactivates its intake key. Deleting a connectionless instance's only stream tombstones the instance too.",backend:"api",route:{method:"DELETE",path:"/data-sources/streams/{streamId}",successStatus:204,tags:["Data Sources"]},input:xx,output:Rx,pagination:"none",async:"sync"}),Y7={listTypes:Gl.contract,listInstances:Zr.contract,createInstance:Fr.contract,getInstance:Jl.contract,updateInstance:Hl.contract,deleteInstance:Bl.contract,listStreams:Wl.contract,createStream:Zl.contract,getStream:Fl.contract,updateStream:Xl.contract,deleteStream:Yl.contract}});var Ux,yS,Q7,Ql,V7,Mx,bS,ic,ac,Kx,Ex,qx,Vl,Gx,Jx,Xr,Hx,Bx,Yr,Wx,Zx,eu,Fx,Xx,tu,Yx,Qx,nu,Vx,eR,ou,tR,nR,ru,oR,rR,iu,iR,aR,au,cR,sR,cu,e2;var mS=g(()=>{El();be();Le();Ux=lo,yS=a.enum(Ux),Q7=a.enum(["pending","provisioning","active","error"]),Ql=a.enum(["managed","connectionless"]),V7=a.object({name:a.string().describe("Field name used as the JSON key in metadata."),type:a.string().describe('Zod type name, e.g. "string", "boolean", "enum".'),required:a.boolean().describe("Whether the field is required."),sensitive:a.boolean().describe("Whether the field contains a secret and will be encrypted."),description:a.string().nullable().describe("Human-readable description of the field.")}),Mx=a.object({id:a.string().describe("Log source provider identifier."),name:a.string().describe("Human-readable display name."),modes:a.array(Ql).describe("Setup modes this provider supports. `managed` log sources take vendor credentials; `connectionless` log sources mint a keyed intake endpoint."),metadataFields:a.array(V7).describe("Fields required in the metadata object when creating a managed log source. Empty for connectionless-only providers."),setupSkill:a.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),bS=a.object({kind:a.enum(["url","hostPort"]).describe("Card shape. `url` = a complete keyed URL whose hostname authenticates; `hostPort` = a non-keyed listener host + port whose credential travels separately."),label:a.string().optional().describe("Card label. Present when a log source exposes several endpoints (e.g. separate logs and traces destinations)."),url:a.string().optional().describe("The complete keyed intake URL. Present when kind is `url`."),host:a.string().optional().describe("The regional listener hostname (no scheme). Present when kind is `hostPort`."),port:a.number().int().optional().describe("The listener port. Present when kind is `hostPort`."),description:a.string().optional().describe("Vendor-specific guidance rendered under the value."),extraCredential:a.object({label:a.string(),value:a.string(),description:a.string().optional()}).optional().describe("The credential the sender must attach when the hostname alone does not authenticate. Present when kind is `hostPort`.")}),ic=a.object({id:a.string().uuid(),logSourceId:a.string().uuid().describe("Root log source ID. Every log stream roots on exactly one log source."),displayName:a.string(),config:a.record(a.string(),a.unknown()),status:Q7,errorMessage:a.string().nullable(),enabled:a.boolean().describe("Whether the log stream is currently ingesting. Independent of provisioning status: a paused log stream stays configured but stops accepting new data."),createdAt:a.string().datetime(),endpointCards:a.array(bS).optional().describe("Server-computed endpoint card(s) for this log stream's delivery key — where to point the sender. Present only for log streams that carry their own intake key.")}),ac=a.object({id:a.string().uuid(),provider:yS,mode:Ql,name:a.string().nullable().describe("Display name. For connectionless log sources this falls back to the log stream's name when no explicit name is set."),streamCount:a.number().int(),createdAt:a.string().datetime()}),Kx=ac.extend({streams:a.array(ic).describe("The log source's live log streams, newest first.")}),Ex=a.object({}),qx=a.object({providers:a.array(Mx)}),Vl=P({operationId:"logSources.listProviders",description:"List all supported log source providers with their setup modes and metadata requirements.",backend:"api",route:{method:"GET",path:"/log-sources/providers",tags:["Log Sources"]},input:Ex,output:qx,pagination:"none",async:"sync"}),Gx=a.object({projectId:a.string().uuid().optional().describe("Project to list log sources for. Auto-filled from SDK context when omitted."),provider:yS.optional().describe("Filter log sources by provider.")}),Jx=a.object({logSources:a.array(ac)}),Xr=P({operationId:"logSources.list",description:"List log sources within one project.",backend:"api",route:{method:"GET",path:"/log-sources",tags:["Log Sources"]},input:Gx,output:Jx,pagination:"none",async:"sync"}),Hx=a.object({projectId:a.string().uuid().optional().describe("Project to create the log source in. Auto-filled from SDK context when omitted."),provider:yS.describe("Log source provider identifier."),mode:Ql.optional().describe("Setup mode. Defaults to `managed` when metadata is provided, otherwise `connectionless`. Must be a mode the provider supports (see `modes` on the provider catalog)."),name:a.string().optional().describe("Optional human-readable name for this log source."),metadata:a.record(a.string(),a.unknown()).optional().describe("Vendor credentials and configuration for managed setup. Fields vary by provider (see `metadataFields` on the provider catalog). Required for managed mode; must be omitted for connectionless mode.")}),Bx=a.object({logSource:ac.describe("The created log source."),streamId:a.string().uuid().optional().describe("ID of the log stream created alongside the log source. Present for connectionless log sources (which always mint their keyed log stream) and for managed providers that auto-provision a default log stream."),publicKey:a.string().optional().describe("Intake key minted for the log source. Store this securely — it is only shown once. Present for connectionless log sources and for managed providers that ingest through a Sazabi endpoint."),endpointCards:a.array(bS).optional().describe("Server-computed endpoint card(s) for the minted key — where to point the sender. Present for connectionless log sources.")}),Yr=P({operationId:"logSources.create",description:"Create a log source. Managed mode takes vendor credentials in `metadata`, validates them, and provisions delivery behind the log source. Connectionless mode mints the log source plus a keyed log stream and returns the intake key and endpoint card(s) to point the sender at.",backend:"api",route:{method:"POST",path:"/log-sources",successStatus:201,tags:["Log Sources"]},input:Hx,output:Bx,pagination:"none",async:"sync"}),Wx=a.object({logSourceId:a.string().uuid().describe("Log source ID to fetch.")}),Zx=a.object({logSource:Kx}),eu=P({operationId:"logSources.get",description:"Get one log source by ID, including its log streams and their endpoint card(s).",backend:"api",route:{method:"GET",path:"/log-sources/{logSourceId}",tags:["Log Sources"]},input:Wx,output:Zx,pagination:"none",async:"sync"}),Fx=a.object({logSourceId:a.string().uuid().describe("Log source ID to update."),name:a.string().min(1).optional().describe("New display name for the log source."),enabled:a.boolean().optional().describe("Pause (`false`) or resume (`true`) ingestion for all of the log source's log streams. Reversible; never deletes anything.")}),Xx=a.object({logSource:ac}),tu=P({operationId:"logSources.update",description:"Update a log source: rename it and/or pause or resume ingestion across its log streams.",backend:"api",route:{method:"PATCH",path:"/log-sources/{logSourceId}",tags:["Log Sources"]},input:Fx,output:Xx,pagination:"none",async:"sync"}),Yx=a.object({logSourceId:a.string().uuid().describe("Log source ID to delete.")}),Qx=a.object({success:a.boolean(),teardownError:a.string().nullable().describe("Null when vendor-side cleanup succeeded or was not needed; error message when remote cleanup failed and must be finished manually.")}),nu=P({operationId:"logSources.delete",description:"Delete a log source. Tombstones the log source and its log streams, deactivates their intake keys (already-ingested data is preserved with its attribution), and runs vendor-side cleanup for managed log sources when the provider supports it.",backend:"api",route:{method:"DELETE",path:"/log-sources/{logSourceId}",successStatus:200,tags:["Log Sources"]},input:Yx,output:Qx,pagination:"none",async:"sync"}),Vx=a.object({logSourceId:a.string().uuid().describe("Log source ID to list log streams for."),enabled:a.boolean().optional().describe("Optional filter on log stream ingestion state. Omit to list all log streams; pass true for only enabled log streams or false for only paused log streams.")}),eR=a.object({streams:a.array(ic)}),ou=P({operationId:"logSources.listStreams",description:"List the log streams that belong to a log source.",backend:"api",route:{method:"GET",path:"/log-sources/{logSourceId}/streams",tags:["Log Sources"]},input:Vx,output:eR,pagination:"none",async:"sync"}),tR=a.object({logSourceId:a.string().uuid().describe("Log source ID to create the log stream under."),displayName:a.string().min(1).describe("Resource name, e.g. service or app name."),config:a.record(a.string(),a.unknown()).optional().describe("Platform-specific log stream configuration.")}),nR=a.object({streamId:a.string().uuid().describe("ID of the created log stream.")}),ru=P({operationId:"logSources.createStream",description:"Create a new log stream under a managed log source. Triggers async provisioning; poll the log stream to track it. Connectionless log sources are single-stream — create another log source instead.",backend:"api",route:{method:"POST",path:"/log-sources/{logSourceId}/streams",successStatus:201,tags:["Log Sources"]},input:tR,output:nR,pagination:"none",async:"sync"}),oR=a.object({streamId:a.string().uuid().describe("Log stream ID to fetch.")}),rR=a.object({stream:ic}),iu=P({operationId:"logSources.getStream",description:"Get one log stream by ID. Use to poll provisioning status.",backend:"api",route:{method:"GET",path:"/log-sources/streams/{streamId}",tags:["Log Sources"]},input:oR,output:rR,pagination:"none",async:"sync"}),iR=a.object({streamId:a.string().uuid().describe("Log stream ID to update."),displayName:a.string().min(1).optional().describe("New display name for the log stream."),enabled:a.boolean().optional().describe("Pause (`false`) or resume (`true`) ingestion for this log stream. Reversible; never deletes anything.")}),aR=a.object({stream:ic}),au=P({operationId:"logSources.updateStream",description:"Update a log stream: rename it and/or pause or resume its ingestion.",backend:"api",route:{method:"PATCH",path:"/log-sources/streams/{streamId}",tags:["Log Sources"]},input:iR,output:aR,pagination:"none",async:"sync"}),cR=a.object({streamId:a.string().uuid().describe("Log stream ID to delete.")}),sR=a.object({success:a.boolean()}),cu=P({operationId:"logSources.deleteStream",description:"Delete a log stream. Tombstones the log stream and deactivates its intake key. Deleting a connectionless log source's only log stream tombstones the log source too.",backend:"api",route:{method:"DELETE",path:"/log-sources/streams/{streamId}",successStatus:200,tags:["Log Sources"]},input:cR,output:sR,pagination:"none",async:"sync"}),e2={listProviders:Vl.contract,list:Xr.contract,create:Yr.contract,get:eu.contract,update:tu.contract,delete:nu.contract,listStreams:ou.contract,createStream:ru.contract,getStream:iu.contract,updateStream:au.contract,deleteStream:cu.contract}});var hR,lR,uR,gR,dR,yR,bR,cc,mR,pR,wR,pS,fR,kR,vR,SR,PR,$R,IR,LR,TR,OR,t2,AR,CR,Qr,Vr,ei,ti,ni,su,n2;var wS=g(()=>{be();Le();hR=a.enum(["eq","neq","in","contains","starts_with","gt","gte","lt","lte","between","exists"]).describe("Filter operator: 'eq' (equals), 'neq' (not equals), 'in' (in array), 'contains' (substring), 'starts_with' (prefix), 'gt' (greater than), 'gte' (greater than or equal), 'lt' (less than), 'lte' (less than or equal), 'between' (range), 'exists' (field exists)"),lR=a.enum(["any","all","phrase"]).describe("Search mode: 'any' (match any token), 'all' (match all tokens), 'phrase' (exact phrase match)"),uR=a.object({query:a.string().min(1,"Search query must be at least 1 character").max(500,"Search query must be at most 500 characters").describe("Search query text (1-500 characters)"),fields:a.array(a.string()).optional().describe("Fields to search in (defaults to backend allowlist)"),mode:lR.optional().default("all").describe("Token matching mode")}),gR=a.object({field:a.string().describe("Field name to filter on"),op:hR.describe("Filter operator"),value:a.union([a.string(),a.number(),a.boolean(),a.array(a.union([a.string(),a.number()])),a.object({from:a.string(),to:a.string()})]).describe("Filter value (type depends on operator)")}).superRefine((e,t)=>{if(e.op==="in"&&!Array.isArray(e.value))t.addIssue({code:a.ZodIssueCode.custom,message:"Value must be an array when op is 'in'",path:["value"]});if(e.op==="between"){let n=e.value;if(!(typeof n==="object"&&n!==null&&("from"in n)&&("to"in n)))t.addIssue({code:a.ZodIssueCode.custom,message:"Value must be an object with from/to when op is 'between'",path:["value"]})}if(e.op==="exists"&&typeof e.value!=="boolean")t.addIssue({code:a.ZodIssueCode.custom,message:"Value must be boolean when op is 'exists'",path:["value"]})}),dR=a.object({field:a.string().describe("Field name to sort by"),direction:a.enum(["asc","desc"]).default("desc").describe("Sort direction: 'asc' for ascending, 'desc' for descending")}),yR=a.object({limit:a.number().int().min(1,"Limit must be at least 1").max(1000,"Limit must be at most 1000").default(50).describe("Maximum number of rows to return"),cursor:a.string().optional().describe("Opaque cursor from previous response for pagination")}),bR=a.object({projectId:a.string().uuid().optional().describe("Project to query logs for. Auto-filled from CLI and SDK context when omitted."),search:uR.optional().describe("Full-text search configuration"),filters:a.array(gR).optional().describe("Structured filter clauses (ANDed together). When no `timestamp` filter is provided, queries default to a 24h look-back window; pass an explicit `timestamp` filter to query a different range."),select:a.array(a.string()).optional().describe("Fields to return (defaults to backend default set)"),sort:dR.optional().describe("Sort configuration (defaults to timestamp desc)"),pagination:yR.optional().describe("Pagination configuration")}),cc=a.enum(["clickhouse","better-stack","datadog","gcp","axiom","cloudwatch","sentry","posthog","mezmo"]),mR=a.enum(["native","external"]),pR=a.object({projectId:a.string().uuid().optional().describe("Project to inspect. Auto-filled from CLI and SDK context when omitted.")}),wR=a.object({backend:a.object({id:cc,name:a.string(),kind:mR}).describe("Active log backend for the project"),features:a.array(a.string()).describe("Backend features registered on the server"),commands:a.array(a.enum(["schema","query","volume","patterns","nativeQuery"])).describe("CLI/API commands available for this backend"),queryableFields:a.array(a.string()).describe("Fields accepted by the normalized logs.query contract"),searchableFields:a.array(a.string()).describe("Fields accepted by logs.query full-text search"),observedServiceNames:a.array(a.string()).describe("Recently observed service names for this project"),observedAttributeKeys:a.array(a.string()).describe("Recently observed log attribute keys for this project"),schemaContext:a.record(a.string(),a.any()).optional().describe("Backend-specific schema guidance and examples")}),pS=a.enum(["1m","5m","15m","1h"]),fR=a.enum(["service_name","severity_text","environment"]),kR=a.object({projectId:a.string().uuid().optional().describe("Project to query. Auto-filled from CLI and SDK context when omitted."),startDate:a.string().datetime({offset:!0}),endDate:a.string().datetime({offset:!0}),interval:pS.optional().describe("Aggregation bucket size for the volume series"),groupBy:fR.optional().describe("Optional field to split volume series by"),filters:a.object({service_name:a.string().optional(),severity_text:a.string().optional(),environment:a.string().optional()}).optional()}).refine((e)=>new Date(e.startDate)<new Date(e.endDate),{message:"startDate must be before endDate",path:["endDate"]}),vR=a.object({total:a.number().nonnegative(),startDate:a.string().datetime({offset:!0}),endDate:a.string().datetime({offset:!0}),interval:pS,series:a.array(a.object({group:a.string(),total:a.number().nonnegative(),points:a.array(a.object({bucket:a.string(),count:a.number().nonnegative()}))}))}),SR=a.object({projectId:a.string().uuid().optional().describe("Project to query. Auto-filled from CLI and SDK context when omitted."),query:a.string().min(1).max(500).optional().describe("Optional text to match against normalized log patterns"),severity:a.string().optional().describe("Optional severity_text value, for example ERROR"),startDate:a.string().datetime({offset:!0}).optional().describe("Optional earliest last-seen timestamp"),endDate:a.string().datetime({offset:!0}).optional().describe("Optional latest last-seen timestamp"),limit:a.number().int().min(1).max(100).default(25).describe("Maximum number of log patterns to return")}).refine((e)=>!e.startDate||!e.endDate||new Date(e.startDate)<new Date(e.endDate),{message:"startDate must be before endDate",path:["endDate"]}),PR=a.object({serviceName:a.string().nullable(),fingerprint:a.string(),pattern:a.string(),severity:a.string().nullable(),occurrences:a.number().nonnegative(),firstSeen:a.string().nullable(),lastSeen:a.string().nullable(),representativeId:a.string().nullable()}),$R=a.object({patterns:a.array(PR),meta:a.object({backendId:cc,count:a.number().int().nonnegative(),took:a.number().nonnegative()})}),IR=a.object({projectId:a.string().uuid().optional().describe("Project to query. Auto-filled from CLI and SDK context when omitted."),query:a.string().min(1,"Query cannot be empty").max(1e4,"Query must be 10000 characters or less")}),LR=a.object({result:a.string().describe("Backend-formatted query result"),format:a.literal("text"),meta:a.object({backendId:cc,took:a.number().nonnegative(),truncated:a.boolean()})}),TR=a.object({projectId:a.string().uuid().optional().describe("Project to query. Auto-filled from CLI and SDK context when omitted."),query:a.string().min(1,"Query must be at least 1 character long.").max(4000,"Query must be at most 4000 characters").describe("Natural-language logs question. Examples: 'api request failures in the last day', 'timeouts in intake', 'top ERROR patterns for public-api'.")}),OR=a.object({answer:a.string().describe("Evidence-backed natural-language answer to the logs question"),steps:a.number().int().nonnegative().describe("Number of nested model steps used"),toolCalls:a.number().int().nonnegative().describe("Number of nested tool calls used"),compacted:a.boolean().describe("Whether nested messages were compacted during the search"),meta:a.object({backendId:cc,took:a.number().nonnegative(),modelProvider:a.string().optional(),modelId:a.string().optional()})}),t2=a.object({cursor:a.string().nullable().describe("Cursor for next page (null if no more results)"),hasMore:a.boolean().describe("Whether more results are available")}),AR=a.object({count:a.number().int().nonnegative().describe("Number of log rows returned in this response"),took:a.number().nonnegative().describe("Query execution time in milliseconds")}),CR=a.object({data:a.array(a.record(a.string(),a.any())).describe("Array of log rows with selected fields"),nextCursor:a.string().nullable().describe("Pass as 'cursor' in the next query to fetch the next page. Null when there are no more results."),meta:AR.describe("Query execution metadata")}),Qr=P({operationId:"logs.query",description:"Query logs within one project.",backend:"api",route:{method:"POST",path:"/logs/query",tags:["Logs"]},input:bR,output:CR,pagination:"cursor",async:"sync"}),Vr=P({operationId:"logs.schema",description:"Describe the active log backend, supported commands, query fields, and schema context.",backend:"api",route:{method:"POST",path:"/logs/schema",tags:["Logs"]},input:pR,output:wR,pagination:"none",async:"sync"}),ei=P({operationId:"logs.volume",description:"Query pre-aggregated log volume for one project.",backend:"api",route:{method:"POST",path:"/logs/volume",tags:["Logs"]},input:kR,output:vR,pagination:"none",async:"sync"}),ti=P({operationId:"logs.patterns",description:"Query normalized log patterns for discovery workflows.",backend:"api",route:{method:"POST",path:"/logs/patterns",tags:["Logs"]},input:SR,output:$R,pagination:"none",async:"sync"}),ni=P({operationId:"logs.nativeQuery",description:"Run a read-only query in the log store's native query language, with server-side guardrails.",backend:"api",route:{method:"POST",path:"/logs/native-query",tags:["Logs"]},input:IR,output:LR,pagination:"none",async:"sync"}),su=P({operationId:"logs.searchNatural",summary:"Natural Language Log Search",description:"Search project logs by asking a natural-language question. Experimental.",backend:"api",route:{method:"POST",path:"/logs/search-natural",tags:["Logs"]},input:TR,output:OR,pagination:"none",async:"sync"}),n2={query:Qr.contract,schema:Vr.contract,volume:ei.contract,patterns:ti.contract,nativeQuery:ni.contract,searchNatural:su.contract}});var DR=g(()=>{wl()});var fS=g(()=>{DR()});var _R=()=>{};var kS,vS,hu,o2,r2,oi,lu,jR,NR,SS,xR,RR,i2,UR,PS,a2,c2,s2,h2,l2,u2,g2,d2,y2,b2,m2,p2,w2,$S,MR,KR,f2,IS;var uu=g(()=>{be();kS=["streamable-http","sse"],vS=["none","headers","oauth","aws-sigv4"],hu=["none","client_secret_basic","client_secret_post"],o2=["preset","custom"],r2=["configured","authorizing","connected","error"],oi=["enabled","disabled","custom-only"],lu=["enabled","write_blocked","disabled"],jR=a.enum(kS),NR=a.enum(vS),SS=a.enum(hu),xR=a.enum(o2),RR=a.enum(r2),i2=a.enum(oi),UR=a.enum(lu),PS=a.object({id:a.string().min(1),name:a.string().min(1),value:a.string().min(1)}),a2=a.object({id:a.string().min(1),name:a.string().min(1),maskedValue:a.string().min(1)}),c2=a.object({authMode:a.literal("none")}),s2=a.object({tokenUrl:a.string().url(),clientId:a.string().min(1),clientSecret:a.string().min(1).optional(),tokenEndpointAuthMethod:SS.optional(),refreshToken:a.string().min(1),headerName:a.string().min(1).default("Authorization"),headerValuePrefix:a.string().default("Bearer "),expiresAt:a.string().datetime().optional()}),h2=a.object({authMode:a.literal("headers"),headers:a.array(PS),refreshCredentials:s2.optional()}),l2=a.object({authMode:a.literal("aws-sigv4"),accessKeyId:a.string().min(1),secretAccessKey:a.string().min(1),sessionToken:a.string().min(1).optional(),region:a.string().min(1),service:a.string().min(1).default("aws-mcp")}),u2=a.preprocess((e)=>{if(typeof e!=="string")return;let t=e.trim();return t.length>0?t:void 0},a.string().min(1).optional()).optional(),g2=a.object({accessToken:a.string().min(1),refreshToken:a.string().min(1).optional(),tokenType:a.string().min(1).optional(),scope:u2,expiresAt:a.string().datetime().optional()}).transform(({scope:e,...t})=>{return e===void 0?t:{...t,scope:e}}),d2=a.object({authMode:a.literal("oauth"),providerId:a.string().min(1),tokens:g2,headers:a.array(PS).optional()}),y2=a.discriminatedUnion("authMode",[c2,h2,d2,l2]),b2=a.string().min(1).regex(/^enc:v1:/,"Encrypted auth config must use enc:v1 format."),m2=a.object({codeVerifier:a.string().min(1),clientId:a.string().min(1),clientSecret:a.string().min(1).optional(),tokenEndpointAuthMethod:SS.optional(),tokenUrl:a.string().url().optional(),resourceUrl:a.string().url().optional(),projectId:a.string().uuid().optional(),returnTo:a.string().min(1).max(2000).optional(),messageId:a.string().min(1).max(240).optional(),scopes:a.array(a.string().min(1)).optional()}),p2=a.object({type:a.string().optional(),properties:a.record(a.string(),a.unknown()).optional(),required:a.array(a.string()).optional(),additionalProperties:a.boolean().optional()}).catchall(a.unknown()),w2=a.object({supportsOAuth:a.boolean().default(!1),supportsCustomHeaders:a.boolean().default(!0),supportsToolDiscovery:a.boolean().default(!0),readOnlyToolNames:a.array(a.string()).default([])}),$S=a.object({name:a.string().min(1),title:a.string().min(1),description:a.string().min(1),inputSchema:p2,annotations:a.record(a.string(),a.unknown()).default({}),availability:UR,isReadOnly:a.boolean()}),MR=a.object({discoveredAt:a.string().datetime(),tools:a.array($S)}),KR=a.object({mode:a.enum(["user","system"]),managedBy:a.object({type:a.literal("integration"),id:a.string().min(1),displayName:a.string().min(1),iconKey:a.string().min(1)}).nullable(),capabilities:a.object({canRename:a.boolean(),canEditCredentials:a.boolean(),canSetReadOnly:a.boolean(),canConfigureTools:a.boolean(),canDisconnect:a.boolean()})}),f2=a.object({id:a.string().uuid(),organizationId:a.string().min(1),projectId:a.string().uuid(),providerId:a.string().min(1),source:xR,displayName:a.string().min(1),connectionKey:a.string().min(1),serverUrl:a.string().url(),transport:jR,authMode:NR,installStatus:RR,installedByUserId:a.string().nullable(),connectedAt:a.string().datetime().nullable(),toolSnapshot:MR.nullable(),enabledToolNames:a.array(a.string()),readOnly:a.boolean().default(!1),version:a.number().int().nonnegative(),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),deletedAt:a.string().datetime().nullable()}),IS=KR});var TS=G((w1e,yu)=>{var ER,qR,GR,JR,HR,BR,WR,ZR,FR,XR,YR,QR,VR,gu,LS,e4,t4,n4,ri,o4,r4,i4,a4,c4,s4,h4,l4,u4,du,g4,d4,y4;(function(e){var t=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd)define("tslib",["exports"],function(r){e(n(t,n(r)))});else if(typeof yu==="object"&&typeof w1e==="object")e(n(t,n(w1e)));else e(n(t));function n(r,o){if(r!==t)if(typeof Object.create==="function")Object.defineProperty(r,"__esModule",{value:!0});else r.__esModule=!0;return function(i,c){return r[i]=o?o(i,c):c}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,c){i.__proto__=c}||function(i,c){for(var s in c)if(Object.prototype.hasOwnProperty.call(c,s))i[s]=c[s]};ER=function(i,c){if(typeof c!=="function"&&c!==null)throw TypeError("Class extends value "+String(c)+" is not a constructor or null");t(i,c);function s(){this.constructor=i}i.prototype=c===null?Object.create(c):(s.prototype=c.prototype,new s)},qR=Object.assign||function(i){for(var c,s=1,h=arguments.length;s<h;s++){c=arguments[s];for(var l in c)if(Object.prototype.hasOwnProperty.call(c,l))i[l]=c[l]}return i},GR=function(i,c){var s={};for(var h in i)if(Object.prototype.hasOwnProperty.call(i,h)&&c.indexOf(h)<0)s[h]=i[h];if(i!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var l=0,h=Object.getOwnPropertySymbols(i);l<h.length;l++)if(c.indexOf(h[l])<0&&Object.prototype.propertyIsEnumerable.call(i,h[l]))s[h[l]]=i[h[l]]}return s},JR=function(i,c,s,h){var l=arguments.length,u=l<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,s):h,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")u=Reflect.decorate(i,c,s,h);else for(var y=i.length-1;y>=0;y--)if(d=i[y])u=(l<3?d(u):l>3?d(c,s,u):d(c,s))||u;return l>3&&u&&Object.defineProperty(c,s,u),u},HR=function(i,c){return function(s,h){c(s,h,i)}},BR=function(i,c,s,h,l,u){function d(we){if(we!==void 0&&typeof we!=="function")throw TypeError("Function expected");return we}var y=h.kind,p=y==="getter"?"get":y==="setter"?"set":"value",f=!c&&i?h.static?i:i.prototype:null,k=c||(f?Object.getOwnPropertyDescriptor(f,h.name):{}),L,A=!1;for(var K=s.length-1;K>=0;K--){var x={};for(var Y in h)x[Y]=Y==="access"?{}:h[Y];for(var Y in h.access)x.access[Y]=h.access[Y];x.addInitializer=function(we){if(A)throw TypeError("Cannot add initializers after decoration has completed");u.push(d(we||null))};var E=(0,s[K])(y==="accessor"?{get:k.get,set:k.set}:k[p],x);if(y==="accessor"){if(E===void 0)continue;if(E===null||typeof E!=="object")throw TypeError("Object expected");if(L=d(E.get))k.get=L;if(L=d(E.set))k.set=L;if(L=d(E.init))l.unshift(L)}else if(L=d(E))if(y==="field")l.unshift(L);else k[p]=L}if(f)Object.defineProperty(f,h.name,k);A=!0},WR=function(i,c,s){var h=arguments.length>2;for(var l=0;l<c.length;l++)s=h?c[l].call(i,s):c[l].call(i);return h?s:void 0},ZR=function(i){return typeof i==="symbol"?i:"".concat(i)},FR=function(i,c,s){if(typeof c==="symbol")c=c.description?"[".concat(c.description,"]"):"";return Object.defineProperty(i,"name",{configurable:!0,value:s?"".concat(s," ",c):c})},XR=function(i,c){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(i,c)},YR=function(i,c,s,h){function l(u){return u instanceof s?u:new s(function(d){d(u)})}return new(s||(s=Promise))(function(u,d){function y(k){try{f(h.next(k))}catch(L){d(L)}}function p(k){try{f(h.throw(k))}catch(L){d(L)}}function f(k){k.done?u(k.value):l(k.value).then(y,p)}f((h=h.apply(i,c||[])).next())})},QR=function(i,c){var s={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},h,l,u,d=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return d.next=y(0),d.throw=y(1),d.return=y(2),typeof Symbol==="function"&&(d[Symbol.iterator]=function(){return this}),d;function y(f){return function(k){return p([f,k])}}function p(f){if(h)throw TypeError("Generator is already executing.");while(d&&(d=0,f[0]&&(s=0)),s)try{if(h=1,l&&(u=f[0]&2?l.return:f[0]?l.throw||((u=l.return)&&u.call(l),0):l.next)&&!(u=u.call(l,f[1])).done)return u;if(l=0,u)f=[f[0]&2,u.value];switch(f[0]){case 0:case 1:u=f;break;case 4:return s.label++,{value:f[1],done:!1};case 5:s.label++,l=f[1],f=[0];continue;case 7:f=s.ops.pop(),s.trys.pop();continue;default:if((u=s.trys,!(u=u.length>0&&u[u.length-1]))&&(f[0]===6||f[0]===2)){s=0;continue}if(f[0]===3&&(!u||f[1]>u[0]&&f[1]<u[3])){s.label=f[1];break}if(f[0]===6&&s.label<u[1]){s.label=u[1],u=f;break}if(u&&s.label<u[2]){s.label=u[2],s.ops.push(f);break}if(u[2])s.ops.pop();s.trys.pop();continue}f=c.call(i,s)}catch(k){f=[6,k],l=0}finally{h=u=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},VR=function(i,c){for(var s in i)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(c,s))du(c,i,s)},du=Object.create?function(i,c,s,h){if(h===void 0)h=s;var l=Object.getOwnPropertyDescriptor(c,s);if(!l||("get"in l?!c.__esModule:l.writable||l.configurable))l={enumerable:!0,get:function(){return c[s]}};Object.defineProperty(i,h,l)}:function(i,c,s,h){if(h===void 0)h=s;i[h]=c[s]},gu=function(i){var c=typeof Symbol==="function"&&Symbol.iterator,s=c&&i[c],h=0;if(s)return s.call(i);if(i&&typeof i.length==="number")return{next:function(){if(i&&h>=i.length)i=void 0;return{value:i&&i[h++],done:!i}}};throw TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")},LS=function(i,c){var s=typeof Symbol==="function"&&i[Symbol.iterator];if(!s)return i;var h=s.call(i),l,u=[],d;try{while((c===void 0||c-- >0)&&!(l=h.next()).done)u.push(l.value)}catch(y){d={error:y}}finally{try{if(l&&!l.done&&(s=h.return))s.call(h)}finally{if(d)throw d.error}}return u},e4=function(){for(var i=[],c=0;c<arguments.length;c++)i=i.concat(LS(arguments[c]));return i},t4=function(){for(var i=0,c=0,s=arguments.length;c<s;c++)i+=arguments[c].length;for(var h=Array(i),l=0,c=0;c<s;c++)for(var u=arguments[c],d=0,y=u.length;d<y;d++,l++)h[l]=u[d];return h},n4=function(i,c,s){if(s||arguments.length===2){for(var h=0,l=c.length,u;h<l;h++)if(u||!(h in c)){if(!u)u=Array.prototype.slice.call(c,0,h);u[h]=c[h]}}return i.concat(u||Array.prototype.slice.call(c))},ri=function(i){return this instanceof ri?(this.v=i,this):new ri(i)},o4=function(i,c,s){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var h=s.apply(i,c||[]),l,u=[];return l=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),y("next"),y("throw"),y("return",d),l[Symbol.asyncIterator]=function(){return this},l;function d(K){return function(x){return Promise.resolve(x).then(K,L)}}function y(K,x){if(h[K]){if(l[K]=function(Y){return new Promise(function(E,we){u.push([K,Y,E,we])>1||p(K,Y)})},x)l[K]=x(l[K])}}function p(K,x){try{f(h[K](x))}catch(Y){A(u[0][3],Y)}}function f(K){K.value instanceof ri?Promise.resolve(K.value.v).then(k,L):A(u[0][2],K)}function k(K){p("next",K)}function L(K){p("throw",K)}function A(K,x){if(K(x),u.shift(),u.length)p(u[0][0],u[0][1])}},r4=function(i){var c,s;return c={},h("next"),h("throw",function(l){throw l}),h("return"),c[Symbol.iterator]=function(){return this},c;function h(l,u){c[l]=i[l]?function(d){return(s=!s)?{value:ri(i[l](d)),done:!1}:u?u(d):d}:u}},i4=function(i){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var c=i[Symbol.asyncIterator],s;return c?c.call(i):(i=typeof gu==="function"?gu(i):i[Symbol.iterator](),s={},h("next"),h("throw"),h("return"),s[Symbol.asyncIterator]=function(){return this},s);function h(u){s[u]=i[u]&&function(d){return new Promise(function(y,p){d=i[u](d),l(y,p,d.done,d.value)})}}function l(u,d,y,p){Promise.resolve(p).then(function(f){u({value:f,done:y})},d)}},a4=function(i,c){if(Object.defineProperty)Object.defineProperty(i,"raw",{value:c});else i.raw=c;return i};var n=Object.create?function(i,c){Object.defineProperty(i,"default",{enumerable:!0,value:c})}:function(i,c){i.default=c},r=function(i){return r=Object.getOwnPropertyNames||function(c){var s=[];for(var h in c)if(Object.prototype.hasOwnProperty.call(c,h))s[s.length]=h;return s},r(i)};c4=function(i){if(i&&i.__esModule)return i;var c={};if(i!=null){for(var s=r(i),h=0;h<s.length;h++)if(s[h]!=="default")du(c,i,s[h])}return n(c,i),c},s4=function(i){return i&&i.__esModule?i:{default:i}},h4=function(i,c,s,h){if(s==="a"&&!h)throw TypeError("Private accessor was defined without a getter");if(typeof c==="function"?i!==c||!h:!c.has(i))throw TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?h:s==="a"?h.call(i):h?h.value:c.get(i)},l4=function(i,c,s,h,l){if(h==="m")throw TypeError("Private method is not writable");if(h==="a"&&!l)throw TypeError("Private accessor was defined without a setter");if(typeof c==="function"?i!==c||!l:!c.has(i))throw TypeError("Cannot write private member to an object whose class did not declare it");return h==="a"?l.call(i,s):l?l.value=s:c.set(i,s),s},u4=function(i,c){if(c===null||typeof c!=="object"&&typeof c!=="function")throw TypeError("Cannot use 'in' operator on non-object");return typeof i==="function"?c===i:i.has(c)},g4=function(i,c,s){if(c!==null&&c!==void 0){if(typeof c!=="object"&&typeof c!=="function")throw TypeError("Object expected.");var h,l;if(s){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");h=c[Symbol.asyncDispose]}if(h===void 0){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");if(h=c[Symbol.dispose],s)l=h}if(typeof h!=="function")throw TypeError("Object not disposable.");if(l)h=function(){try{l.call(this)}catch(u){return Promise.reject(u)}};i.stack.push({value:c,dispose:h,async:s})}else if(s)i.stack.push({async:!0});return c};var o=typeof SuppressedError==="function"?SuppressedError:function(i,c,s){var h=Error(s);return h.name="SuppressedError",h.error=i,h.suppressed=c,h};d4=function(i){function c(u){i.error=i.hasError?new o(u,i.error,"An error was suppressed during disposal."):u,i.hasError=!0}var s,h=0;function l(){while(s=i.stack.pop())try{if(!s.async&&h===1)return h=0,i.stack.push(s),Promise.resolve().then(l);if(s.dispose){var u=s.dispose.call(s.value);if(s.async)return h|=2,Promise.resolve(u).then(l,function(d){return c(d),l()})}else h|=1}catch(d){c(d)}if(h===1)return i.hasError?Promise.reject(i.error):Promise.resolve();if(i.hasError)throw i.error}return l()},y4=function(i,c){if(typeof i==="string"&&/^\.\.?\//.test(i))return i.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(s,h,l,u,d){return h?c?".jsx":".js":l&&(!u||!d)?s:l+u+"."+d.toLowerCase()+"js"});return i},e("__extends",ER),e("__assign",qR),e("__rest",GR),e("__decorate",JR),e("__param",HR),e("__esDecorate",BR),e("__runInitializers",WR),e("__propKey",ZR),e("__setFunctionName",FR),e("__metadata",XR),e("__awaiter",YR),e("__generator",QR),e("__exportStar",VR),e("__createBinding",du),e("__values",gu),e("__read",LS),e("__spread",e4),e("__spreadArrays",t4),e("__spreadArray",n4),e("__await",ri),e("__asyncGenerator",o4),e("__asyncDelegator",r4),e("__asyncValues",i4),e("__makeTemplateObject",a4),e("__importStar",c4),e("__importDefault",s4),e("__classPrivateFieldGet",h4),e("__classPrivateFieldSet",l4),e("__classPrivateFieldIn",u4),e("__addDisposableResource",g4),e("__disposeResources",d4),e("__rewriteRelativeImportExtension",y4)})});var OS=G((b4)=>{Object.defineProperty(b4,"__esModule",{value:!0});b4.MAX_HASHABLE_LENGTH=b4.INIT=b4.KEY=b4.DIGEST_LENGTH=b4.BLOCK_SIZE=void 0;b4.BLOCK_SIZE=64;b4.DIGEST_LENGTH=32;b4.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);b4.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];b4.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1});var f4=G((p4)=>{Object.defineProperty(p4,"__esModule",{value:!0});p4.RawSha256=void 0;var Wt=OS(),$2=function(){function e(){this.state=Int32Array.from(Wt.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(t){if(this.finished)throw Error("Attempted to update an already finished hash.");var n=0,r=t.byteLength;if(this.bytesHashed+=r,this.bytesHashed*8>Wt.MAX_HASHABLE_LENGTH)throw Error("Cannot hash more than 2^53 - 1 bits");while(r>0)if(this.buffer[this.bufferLength++]=t[n++],r--,this.bufferLength===Wt.BLOCK_SIZE)this.hashBuffer(),this.bufferLength=0},e.prototype.digest=function(){if(!this.finished){var t=this.bytesHashed*8,n=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),r=this.bufferLength;if(n.setUint8(this.bufferLength++,128),r%Wt.BLOCK_SIZE>=Wt.BLOCK_SIZE-8){for(var o=this.bufferLength;o<Wt.BLOCK_SIZE;o++)n.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(var o=this.bufferLength;o<Wt.BLOCK_SIZE-8;o++)n.setUint8(o,0);n.setUint32(Wt.BLOCK_SIZE-8,Math.floor(t/4294967296),!0),n.setUint32(Wt.BLOCK_SIZE-4,t),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(Wt.DIGEST_LENGTH);for(var o=0;o<8;o++)i[o*4]=this.state[o]>>>24&255,i[o*4+1]=this.state[o]>>>16&255,i[o*4+2]=this.state[o]>>>8&255,i[o*4+3]=this.state[o]>>>0&255;return i},e.prototype.hashBuffer=function(){var t=this,n=t.buffer,r=t.state,o=r[0],i=r[1],c=r[2],s=r[3],h=r[4],l=r[5],u=r[6],d=r[7];for(var y=0;y<Wt.BLOCK_SIZE;y++){if(y<16)this.temp[y]=(n[y*4]&255)<<24|(n[y*4+1]&255)<<16|(n[y*4+2]&255)<<8|n[y*4+3]&255;else{var p=this.temp[y-2],f=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10;p=this.temp[y-15];var k=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3;this.temp[y]=(f+this.temp[y-7]|0)+(k+this.temp[y-16]|0)}var L=(((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&l^~h&u)|0)+(d+(Wt.KEY[y]+this.temp[y]|0)|0)|0,A=((o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+(o&i^o&c^i&c)|0;d=u,u=l,l=h,h=s+L|0,s=c,c=i,i=o,o=L+A|0}r[0]+=o,r[1]+=i,r[2]+=c,r[3]+=s,r[4]+=h,r[5]+=l,r[6]+=u,r[7]+=d},e}();p4.RawSha256=$2});var S4=G((v1e,v4)=>{var{defineProperty:bu,getOwnPropertyDescriptor:I2,getOwnPropertyNames:L2}=Object,T2=Object.prototype.hasOwnProperty,O2=(e,t)=>bu(e,"name",{value:t,configurable:!0}),A2=(e,t)=>{for(var n in t)bu(e,n,{get:t[n],enumerable:!0})},C2=(e,t,n,r)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let o of L2(t))if(!T2.call(e,o)&&o!==n)bu(e,o,{get:()=>t[o],enumerable:!(r=I2(t,o))||r.enumerable})}return e},D2=(e)=>C2(bu({},"__esModule",{value:!0}),e),k4={};A2(k4,{isArrayBuffer:()=>z2});v4.exports=D2(k4);var z2=O2((e)=>typeof ArrayBuffer==="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]","isArrayBuffer")});var L4=G((S1e,I4)=>{var{defineProperty:mu,getOwnPropertyDescriptor:_2,getOwnPropertyNames:j2}=Object,N2=Object.prototype.hasOwnProperty,P4=(e,t)=>mu(e,"name",{value:t,configurable:!0}),x2=(e,t)=>{for(var n in t)mu(e,n,{get:t[n],enumerable:!0})},R2=(e,t,n,r)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let o of j2(t))if(!N2.call(e,o)&&o!==n)mu(e,o,{get:()=>t[o],enumerable:!(r=_2(t,o))||r.enumerable})}return e},U2=(e)=>R2(mu({},"__esModule",{value:!0}),e),$4={};x2($4,{fromArrayBuffer:()=>K2,fromString:()=>E2});I4.exports=U2($4);var M2=S4(),AS=tT("buffer"),K2=P4((e,t=0,n=e.byteLength-t)=>{if(!(0,M2.isArrayBuffer)(e))throw TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return AS.Buffer.from(e,t,n)},"fromArrayBuffer"),E2=P4((e,t)=>{if(typeof e!=="string")throw TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?AS.Buffer.from(e,t):AS.Buffer.from(e)},"fromString")});var D4=G((P1e,C4)=>{var{defineProperty:pu,getOwnPropertyDescriptor:q2,getOwnPropertyNames:G2}=Object,J2=Object.prototype.hasOwnProperty,CS=(e,t)=>pu(e,"name",{value:t,configurable:!0}),H2=(e,t)=>{for(var n in t)pu(e,n,{get:t[n],enumerable:!0})},B2=(e,t,n,r)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let o of G2(t))if(!J2.call(e,o)&&o!==n)pu(e,o,{get:()=>t[o],enumerable:!(r=q2(t,o))||r.enumerable})}return e},W2=(e)=>B2(pu({},"__esModule",{value:!0}),e),T4={};H2(T4,{fromUtf8:()=>A4,toUint8Array:()=>Z2,toUtf8:()=>F2});C4.exports=W2(T4);var O4=L4(),A4=CS((e)=>{let t=(0,O4.fromString)(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),Z2=CS((e)=>{if(typeof e==="string")return A4(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(e)},"toUint8Array"),F2=CS((e)=>{if(typeof e==="string")return e;if(typeof e!=="object"||typeof e.byteOffset!=="number"||typeof e.byteLength!=="number")throw Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return(0,O4.fromArrayBuffer)(e.buffer,e.byteOffset,e.byteLength).toString("utf8")},"toUtf8")});var j4=G((z4)=>{Object.defineProperty(z4,"__esModule",{value:!0});z4.convertToBuffer=void 0;var X2=D4(),Y2=typeof Buffer<"u"&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:X2.fromUtf8;function Q2(e){if(e instanceof Uint8Array)return e;if(typeof e==="string")return Y2(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(e)}z4.convertToBuffer=Q2});var R4=G((N4)=>{Object.defineProperty(N4,"__esModule",{value:!0});N4.isEmptyData=void 0;function V2(e){if(typeof e==="string")return e.length===0;return e.byteLength===0}N4.isEmptyData=V2});var K4=G((U4)=>{Object.defineProperty(U4,"__esModule",{value:!0});U4.numToUint8=void 0;function eee(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}U4.numToUint8=eee});var G4=G((E4)=>{Object.defineProperty(E4,"__esModule",{value:!0});E4.uint32ArrayFrom=void 0;function tee(e){if(!Uint32Array.from){var t=new Uint32Array(e.length),n=0;while(n<e.length)t[n]=e[n],n+=1;return t}return Uint32Array.from(e)}E4.uint32ArrayFrom=tee});var J4=G((ii)=>{Object.defineProperty(ii,"__esModule",{value:!0});ii.uint32ArrayFrom=ii.numToUint8=ii.isEmptyData=ii.convertToBuffer=void 0;var nee=j4();Object.defineProperty(ii,"convertToBuffer",{enumerable:!0,get:function(){return nee.convertToBuffer}});var oee=R4();Object.defineProperty(ii,"isEmptyData",{enumerable:!0,get:function(){return oee.isEmptyData}});var ree=K4();Object.defineProperty(ii,"numToUint8",{enumerable:!0,get:function(){return ree.numToUint8}});var iee=G4();Object.defineProperty(ii,"uint32ArrayFrom",{enumerable:!0,get:function(){return iee.uint32ArrayFrom}})});var Z4=G((B4)=>{Object.defineProperty(B4,"__esModule",{value:!0});B4.Sha256=void 0;var H4=TS(),fu=OS(),wu=f4(),DS=J4(),cee=function(){function e(t){this.secret=t,this.hash=new wu.RawSha256,this.reset()}return e.prototype.update=function(t){if((0,DS.isEmptyData)(t)||this.error)return;try{this.hash.update((0,DS.convertToBuffer)(t))}catch(n){this.error=n}},e.prototype.digestSync=function(){if(this.error)throw this.error;if(this.outer){if(!this.outer.finished)this.outer.update(this.hash.digest());return this.outer.digest()}return this.hash.digest()},e.prototype.digest=function(){return H4.__awaiter(this,void 0,void 0,function(){return H4.__generator(this,function(t){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new wu.RawSha256,this.secret){this.outer=new wu.RawSha256;var t=see(this.secret),n=new Uint8Array(fu.BLOCK_SIZE);n.set(t);for(var r=0;r<fu.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(var r=0;r<t.byteLength;r++)t[r]=0}},e}();B4.Sha256=cee;function see(e){var t=(0,DS.convertToBuffer)(e);if(t.byteLength>fu.BLOCK_SIZE){var n=new wu.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(fu.BLOCK_SIZE);return r.set(t),r}});var F4=G((zS)=>{Object.defineProperty(zS,"__esModule",{value:!0});var hee=TS();hee.__exportStar(Z4(),zS)});var ku=()=>{};var X4="io.modelcontextprotocol/related-task",Su="2.0",He,Y4,Q4,N1e,lee,uee,_S,Nt,Pu,tt,Zt,Ft,nt,$u,gee,dee,V4,sc,eU,tU,x1e,jS,yee,NS,bee,hc,ai,nU,mee,pee,wee,fee,kee,vee,See,Pee,oU,$ee,xS,Iee,Lee,RS,Tee,lc,uc,Oee,gc,Iu,Aee,US,MS,KS,ES,R1e,qS,GS,JS,Cee,rU,iU,HS,aU,dc,ci,cU,Dee,zee,sU,_ee,hU,BS,jee,Nee,lU,uU,xee,Ree,Uee,Mee,Kee,Eee,qee,Gee,Jee,gU,Hee,Bee,WS,ZS,FS,Wee,Zee,Fee,XS,Xee,dU,yU,Yee,Qee,bU,Vee,mU,Lu,U1e,ete,tte,pU,nte,wU,ote,rte,ite,ate,cte,ste,hte,lte,ute,vu,gte,dte,fU,kU,vU,yte,bte,mte,pte,wte,fte,kte,vte,Ste,Pte,$te,Ite,Lte,Tte,Ote,SU,Ate,Cte,PU,Dte,zte,_te,jte,$U,Nte,xte,Rte,Ute,M1e,K1e,E1e,q1e,G1e,J1e;var qo=g(()=>{fS();He=pl((e)=>e!==null&&(typeof e==="object"||typeof e==="function")),Y4=De([v(),me().int()]),Q4=v(),N1e=Ee({ttl:me().optional(),pollInterval:me().optional()}),lee=Z({ttl:me().optional()}),uee=Z({taskId:v()}),_S=Ee({progressToken:Y4.optional(),[X4]:uee.optional()}),Nt=Z({_meta:_S.optional()}),Pu=Nt.extend({task:lee.optional()}),tt=Z({method:v(),params:Nt.loose().optional()}),Zt=Z({_meta:_S.optional()}),Ft=Z({method:v(),params:Zt.loose().optional()}),nt=Ee({_meta:_S.optional()}),$u=De([v(),me().int()]),gee=Z({jsonrpc:V(Su),id:$u,...tt.shape}).strict(),dee=Z({jsonrpc:V(Su),...Ft.shape}).strict(),V4=Z({jsonrpc:V(Su),id:$u,result:nt}).strict();(function(e){e[e.ConnectionClosed=-32000]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(sc||(sc={}));eU=Z({jsonrpc:V(Su),id:$u.optional(),error:Z({code:me().int(),message:v(),data:Ce().optional()})}).strict(),tU=De([gee,dee,V4,eU]),x1e=De([V4,eU]),jS=nt.strict(),yee=Zt.extend({requestId:$u.optional(),reason:v().optional()}),NS=Ft.extend({method:V("notifications/cancelled"),params:yee}),bee=Z({src:v(),mimeType:v().optional(),sizes:B(v()).optional(),theme:et(["light","dark"]).optional()}),hc=Z({icons:B(bee).optional()}),ai=Z({name:v(),title:v().optional()}),nU=ai.extend({...ai.shape,...hc.shape,version:v(),websiteUrl:v().optional(),description:v().optional()}),mee=Er(Z({applyDefaults:Ie().optional()}),Te(v(),Ce())),pee=Va((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.keys(e).length===0)return{form:{}}}return e},Er(Z({form:mee.optional(),url:He.optional()}),Te(v(),Ce()).optional())),wee=Ee({list:He.optional(),cancel:He.optional(),requests:Ee({sampling:Ee({createMessage:He.optional()}).optional(),elicitation:Ee({create:He.optional()}).optional()}).optional()}),fee=Ee({list:He.optional(),cancel:He.optional(),requests:Ee({tools:Ee({call:He.optional()}).optional()}).optional()}),kee=Z({experimental:Te(v(),He).optional(),sampling:Z({context:He.optional(),tools:He.optional()}).optional(),elicitation:pee.optional(),roots:Z({listChanged:Ie().optional()}).optional(),tasks:wee.optional(),extensions:Te(v(),He).optional()}),vee=Nt.extend({protocolVersion:v(),capabilities:kee,clientInfo:nU}),See=tt.extend({method:V("initialize"),params:vee}),Pee=Z({experimental:Te(v(),He).optional(),logging:He.optional(),completions:He.optional(),prompts:Z({listChanged:Ie().optional()}).optional(),resources:Z({subscribe:Ie().optional(),listChanged:Ie().optional()}).optional(),tools:Z({listChanged:Ie().optional()}).optional(),tasks:fee.optional(),extensions:Te(v(),He).optional()}),oU=nt.extend({protocolVersion:v(),capabilities:Pee,serverInfo:nU,instructions:v().optional()}),$ee=Ft.extend({method:V("notifications/initialized"),params:Zt.optional()}),xS=tt.extend({method:V("ping"),params:Nt.optional()}),Iee=Z({progress:me(),total:je(me()),message:je(v())}),Lee=Z({...Zt.shape,...Iee.shape,progressToken:Y4}),RS=Ft.extend({method:V("notifications/progress"),params:Lee}),Tee=Nt.extend({cursor:Q4.optional()}),lc=tt.extend({params:Tee.optional()}),uc=nt.extend({nextCursor:Q4.optional()}),Oee=et(["working","input_required","completed","failed","cancelled"]),gc=Z({taskId:v(),status:Oee,ttl:De([me(),Ba()]),createdAt:v(),lastUpdatedAt:v(),pollInterval:je(me()),statusMessage:je(v())}),Iu=nt.extend({task:gc}),Aee=Zt.merge(gc),US=Ft.extend({method:V("notifications/tasks/status"),params:Aee}),MS=tt.extend({method:V("tasks/get"),params:Nt.extend({taskId:v()})}),KS=nt.merge(gc),ES=tt.extend({method:V("tasks/result"),params:Nt.extend({taskId:v()})}),R1e=nt.loose(),qS=lc.extend({method:V("tasks/list")}),GS=uc.extend({tasks:B(gc)}),JS=tt.extend({method:V("tasks/cancel"),params:Nt.extend({taskId:v()})}),Cee=nt.merge(gc),rU=Z({uri:v(),mimeType:je(v()),_meta:Te(v(),Ce()).optional()}),iU=rU.extend({text:v()}),HS=v().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),aU=rU.extend({blob:HS}),dc=et(["user","assistant"]),ci=Z({audience:B(dc).optional(),priority:me().min(0).max(1).optional(),lastModified:ho.datetime({offset:!0}).optional()}),cU=Z({...ai.shape,...hc.shape,uri:v(),description:je(v()),mimeType:je(v()),size:je(me()),annotations:ci.optional(),_meta:je(Ee({}))}),Dee=Z({...ai.shape,...hc.shape,uriTemplate:v(),description:je(v()),mimeType:je(v()),annotations:ci.optional(),_meta:je(Ee({}))}),zee=lc.extend({method:V("resources/list")}),sU=uc.extend({resources:B(cU)}),_ee=lc.extend({method:V("resources/templates/list")}),hU=uc.extend({resourceTemplates:B(Dee)}),BS=Nt.extend({uri:v()}),jee=BS,Nee=tt.extend({method:V("resources/read"),params:jee}),lU=nt.extend({contents:B(De([iU,aU]))}),uU=Ft.extend({method:V("notifications/resources/list_changed"),params:Zt.optional()}),xee=BS,Ree=tt.extend({method:V("resources/subscribe"),params:xee}),Uee=BS,Mee=tt.extend({method:V("resources/unsubscribe"),params:Uee}),Kee=Zt.extend({uri:v()}),Eee=Ft.extend({method:V("notifications/resources/updated"),params:Kee}),qee=Z({name:v(),description:je(v()),required:je(Ie())}),Gee=Z({...ai.shape,...hc.shape,description:je(v()),arguments:je(B(qee)),_meta:je(Ee({}))}),Jee=lc.extend({method:V("prompts/list")}),gU=uc.extend({prompts:B(Gee)}),Hee=Nt.extend({name:v(),arguments:Te(v(),v()).optional()}),Bee=tt.extend({method:V("prompts/get"),params:Hee}),WS=Z({type:V("text"),text:v(),annotations:ci.optional(),_meta:Te(v(),Ce()).optional()}),ZS=Z({type:V("image"),data:HS,mimeType:v(),annotations:ci.optional(),_meta:Te(v(),Ce()).optional()}),FS=Z({type:V("audio"),data:HS,mimeType:v(),annotations:ci.optional(),_meta:Te(v(),Ce()).optional()}),Wee=Z({type:V("tool_use"),name:v(),id:v(),input:Te(v(),Ce()),_meta:Te(v(),Ce()).optional()}),Zee=Z({type:V("resource"),resource:De([iU,aU]),annotations:ci.optional(),_meta:Te(v(),Ce()).optional()}),Fee=cU.extend({type:V("resource_link")}),XS=De([WS,ZS,FS,Fee,Zee]),Xee=Z({role:dc,content:XS}),dU=nt.extend({description:v().optional(),messages:B(Xee)}),yU=Ft.extend({method:V("notifications/prompts/list_changed"),params:Zt.optional()}),Yee=Z({title:v().optional(),readOnlyHint:Ie().optional(),destructiveHint:Ie().optional(),idempotentHint:Ie().optional(),openWorldHint:Ie().optional()}),Qee=Z({taskSupport:et(["required","optional","forbidden"]).optional()}),bU=Z({...ai.shape,...hc.shape,description:v().optional(),inputSchema:Z({type:V("object"),properties:Te(v(),He).optional(),required:B(v()).optional()}).catchall(Ce()),outputSchema:Z({type:V("object"),properties:Te(v(),He).optional(),required:B(v()).optional()}).catchall(Ce()).optional(),annotations:Yee.optional(),execution:Qee.optional(),_meta:Te(v(),Ce()).optional()}),Vee=lc.extend({method:V("tools/list")}),mU=uc.extend({tools:B(bU)}),Lu=nt.extend({content:B(XS).default([]),structuredContent:Te(v(),Ce()).optional(),isError:Ie().optional()}),U1e=Lu.or(nt.extend({toolResult:Ce()})),ete=Pu.extend({name:v(),arguments:Te(v(),Ce()).optional()}),tte=tt.extend({method:V("tools/call"),params:ete}),pU=Ft.extend({method:V("notifications/tools/list_changed"),params:Zt.optional()}),nte=Z({autoRefresh:Ie().default(!0),debounceMs:me().int().nonnegative().default(300)}),wU=et(["debug","info","notice","warning","error","critical","alert","emergency"]),ote=Nt.extend({level:wU}),rte=tt.extend({method:V("logging/setLevel"),params:ote}),ite=Zt.extend({level:wU,logger:v().optional(),data:Ce()}),ate=Ft.extend({method:V("notifications/message"),params:ite}),cte=Z({name:v().optional()}),ste=Z({hints:B(cte).optional(),costPriority:me().min(0).max(1).optional(),speedPriority:me().min(0).max(1).optional(),intelligencePriority:me().min(0).max(1).optional()}),hte=Z({mode:et(["auto","required","none"]).optional()}),lte=Z({type:V("tool_result"),toolUseId:v().describe("The unique identifier for the corresponding tool call."),content:B(XS).default([]),structuredContent:Z({}).loose().optional(),isError:Ie().optional(),_meta:Te(v(),Ce()).optional()}),ute=Xa("type",[WS,ZS,FS]),vu=Xa("type",[WS,ZS,FS,Wee,lte]),gte=Z({role:dc,content:De([vu,B(vu)]),_meta:Te(v(),Ce()).optional()}),dte=Pu.extend({messages:B(gte),modelPreferences:ste.optional(),systemPrompt:v().optional(),includeContext:et(["none","thisServer","allServers"]).optional(),temperature:me().optional(),maxTokens:me().int(),stopSequences:B(v()).optional(),metadata:He.optional(),tools:B(bU).optional(),toolChoice:hte.optional()}),fU=tt.extend({method:V("sampling/createMessage"),params:dte}),kU=nt.extend({model:v(),stopReason:je(et(["endTurn","stopSequence","maxTokens"]).or(v())),role:dc,content:ute}),vU=nt.extend({model:v(),stopReason:je(et(["endTurn","stopSequence","maxTokens","toolUse"]).or(v())),role:dc,content:De([vu,B(vu)])}),yte=Z({type:V("boolean"),title:v().optional(),description:v().optional(),default:Ie().optional()}),bte=Z({type:V("string"),title:v().optional(),description:v().optional(),minLength:me().optional(),maxLength:me().optional(),format:et(["email","uri","date","date-time"]).optional(),default:v().optional()}),mte=Z({type:et(["number","integer"]),title:v().optional(),description:v().optional(),minimum:me().optional(),maximum:me().optional(),default:me().optional()}),pte=Z({type:V("string"),title:v().optional(),description:v().optional(),enum:B(v()),default:v().optional()}),wte=Z({type:V("string"),title:v().optional(),description:v().optional(),oneOf:B(Z({const:v(),title:v()})),default:v().optional()}),fte=Z({type:V("string"),title:v().optional(),description:v().optional(),enum:B(v()),enumNames:B(v()).optional(),default:v().optional()}),kte=De([pte,wte]),vte=Z({type:V("array"),title:v().optional(),description:v().optional(),minItems:me().optional(),maxItems:me().optional(),items:Z({type:V("string"),enum:B(v())}),default:B(v()).optional()}),Ste=Z({type:V("array"),title:v().optional(),description:v().optional(),minItems:me().optional(),maxItems:me().optional(),items:Z({anyOf:B(Z({const:v(),title:v()}))}),default:B(v()).optional()}),Pte=De([vte,Ste]),$te=De([fte,kte,Pte]),Ite=De([$te,yte,bte,mte]),Lte=Pu.extend({mode:V("form").optional(),message:v(),requestedSchema:Z({type:V("object"),properties:Te(v(),Ite),required:B(v()).optional()})}),Tte=Pu.extend({mode:V("url"),message:v(),elicitationId:v(),url:v().url()}),Ote=De([Lte,Tte]),SU=tt.extend({method:V("elicitation/create"),params:Ote}),Ate=Zt.extend({elicitationId:v()}),Cte=Ft.extend({method:V("notifications/elicitation/complete"),params:Ate}),PU=nt.extend({action:et(["accept","decline","cancel"]),content:Va((e)=>e===null?void 0:e,Te(v(),De([v(),me(),Ie(),B(v())])).optional())}),Dte=Z({type:V("ref/resource"),uri:v()}),zte=Z({type:V("ref/prompt"),name:v()}),_te=Nt.extend({ref:De([zte,Dte]),argument:Z({name:v(),value:v()}),context:Z({arguments:Te(v(),v()).optional()}).optional()}),jte=tt.extend({method:V("completion/complete"),params:_te}),$U=nt.extend({completion:Ee({values:B(v()).max(100),total:je(me().int()),hasMore:je(Ie())})}),Nte=Z({uri:v().startsWith("file://"),name:v().optional(),_meta:Te(v(),Ce()).optional()}),xte=tt.extend({method:V("roots/list"),params:Nt.optional()}),Rte=nt.extend({roots:B(Nte)}),Ute=Ft.extend({method:V("notifications/roots/list_changed"),params:Zt.optional()}),M1e=De([xS,See,jte,rte,Bee,Jee,zee,_ee,Nee,Ree,Mee,tte,Vee,MS,ES,qS,JS]),K1e=De([NS,RS,$ee,Ute,US]),E1e=De([jS,kU,vU,PU,Rte,KS,GS,Iu]),q1e=De([xS,fU,SU,xte,MS,ES,qS,JS]),G1e=De([NS,RS,ate,Eee,uU,pU,yU,US,Cte]),J1e=De([jS,oU,$U,dU,gU,sU,hU,lU,Lu,mU,KS,GS,Iu])});var Mte;var Tu=g(()=>{Mte=Symbol("Let zodToJsonSchema decide on which parser to use")});var YS=g(()=>{Tu()});var Xt=()=>{};var QS=g(()=>{Ge()});var VS=()=>{};var Ou=g(()=>{Ge()});var eP=g(()=>{Ge()});var tP=()=>{};var nP=g(()=>{Ge()});var oP=g(()=>{Ge();Xt()});var rP=g(()=>{Ge()});var Pxe;var Au=g(()=>{Pxe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});var Cu=g(()=>{Ge();Au();Ou();Xt()});var iP=g(()=>{Ge();Cu();Xt()});var aP=g(()=>{Xt()});var Du=g(()=>{Ge()});var cP=g(()=>{Ge();Du()});var sP=()=>{};var hP=g(()=>{Ge()});var lP=g(()=>{Ge();Xt()});var uP=g(()=>{Ge()});var gP=g(()=>{Ge()});var dP=g(()=>{Ge()});var yP=g(()=>{Ge()});var bP=g(()=>{Xt()});var mP=g(()=>{Xt()});var pP=g(()=>{Ge()});var wP=g(()=>{Xt();QS();VS();Ou();eP();tP();nP();oP();rP();iP();aP();cP();sP();hP();lP();uP();gP();Cu();dP();Au();yP();bP();Du();mP();pP()});var Ge=g(()=>{Tu();wP();Xt()});var IU=()=>{};var fP=g(()=>{Ge();YS();Xt()});var LU=g(()=>{fP();Tu();YS();Ge();IU();Xt();QS();VS();Ou();eP();tP();nP();oP();rP();iP();aP();cP();sP();hP();lP();uP();gP();pP();Cu();dP();Au();yP();bP();Du();mP();wP();fP()});var OU=g(()=>{ku();LU()});var CU=g(()=>{ku();qo();OU()});var mc=G((_U)=>{Object.defineProperty(_U,"__esModule",{value:!0});_U.regexpCode=_U.getEsmExportName=_U.getProperty=_U.safeStringify=_U.stringify=_U.strConcat=_U.addCodeArg=_U.str=_U._=_U.nil=_U._Code=_U.Name=_U.IDENTIFIER=_U._CodeOrName=void 0;class zu{}_U._CodeOrName=zu;_U.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class si extends zu{constructor(e){super();if(!_U.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}_U.Name=si;class cn extends zu{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,n)=>`${t}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,n)=>{if(n instanceof si)t[n.str]=(t[n.str]||0)+1;return t},{})}}_U._Code=cn;_U.nil=new cn("");function DU(e,...t){let n=[e[0]],r=0;while(r<t.length)vP(n,t[r]),n.push(e[++r]);return new cn(n)}_U._=DU;var kP=new cn("+");function zU(e,...t){let n=[bc(e[0])],r=0;while(r<t.length)n.push(kP),vP(n,t[r]),n.push(kP,bc(e[++r]));return Fte(n),new cn(n)}_U.str=zU;function vP(e,t){if(t instanceof cn)e.push(...t._items);else if(t instanceof si)e.push(t);else e.push(Qte(t))}_U.addCodeArg=vP;function Fte(e){let t=1;while(t<e.length-1){if(e[t]===kP){let n=Xte(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}function Xte(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof si||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof si))return`"${e}${t.slice(1)}`;return}function Yte(e,t){return t.emptyStr()?e:e.emptyStr()?t:zU`${e}${t}`}_U.strConcat=Yte;function Qte(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:bc(Array.isArray(e)?e.join(","):e)}function Vte(e){return new cn(bc(e))}_U.stringify=Vte;function bc(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}_U.safeStringify=bc;function ene(e){return typeof e=="string"&&_U.IDENTIFIER.test(e)?new cn(`.${e}`):DU`[${e}]`}_U.getProperty=ene;function tne(e){if(typeof e=="string"&&_U.IDENTIFIER.test(e))return new cn(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}_U.getEsmExportName=tne;function nne(e){return new cn(e.toString())}_U.regexpCode=nne});var IP=G((RU)=>{Object.defineProperty(RU,"__esModule",{value:!0});RU.ValueScope=RU.ValueScopeName=RU.Scope=RU.varKinds=RU.UsedValueState=void 0;var It=mc();class NU extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var ju;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(ju||(RU.UsedValueState=ju={}));RU.varKinds={const:new It.Name("const"),let:new It.Name("let"),var:new It.Name("var")};class PP{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof It.Name?e:this.name(e)}name(e){return new It.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,n;if(((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}RU.Scope=PP;class $P extends It.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=It._`.${new It.Name(t)}[${n}]`}}RU.ValueScopeName=$P;var bne=It._`\n`;class xU extends PP{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?bne:It.nil}}get(){return this._scope}name(e){return new $P(e,this._newName(e))}value(e,t){var n;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let r=this.toName(e),{prefix:o}=r,i=(n=t.key)!==null&&n!==void 0?n:t.ref,c=this._values[o];if(c){let l=c.get(i);if(l)return l}else c=this._values[o]=new Map;c.set(i,r);let s=this._scope[o]||(this._scope[o]=[]),h=s.length;return s[h]=t.ref,r.setValue(t,{property:o,itemIndex:h}),r}getValue(e,t){let n=this._values[e];if(!n)return;return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(n)=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return It._`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,(r)=>{if(r.value===void 0)throw Error(`CodeGen: name "${r}" has no value`);return r.value.code},t,n)}_reduceValues(e,t,n={},r){let o=It.nil;for(let i in e){let c=e[i];if(!c)continue;let s=n[i]=n[i]||new Map;c.forEach((h)=>{if(s.has(h))return;s.set(h,ju.Started);let l=t(h);if(l){let u=this.opts.es5?RU.varKinds.var:RU.varKinds.const;o=It._`${o}${u} ${h} = ${l};${this.opts._n}`}else if(l=r===null||r===void 0?void 0:r(h))o=It._`${o}${l}${this.opts._n}`;else throw new NU(h);s.set(h,ju.Completed)})}return o}}RU.ValueScope=xU});var ye=G((Lt)=>{Object.defineProperty(Lt,"__esModule",{value:!0});Lt.or=Lt.and=Lt.not=Lt.CodeGen=Lt.operators=Lt.varKinds=Lt.ValueScopeName=Lt.ValueScope=Lt.Scope=Lt.Name=Lt.regexpCode=Lt.stringify=Lt.getProperty=Lt.nil=Lt.strConcat=Lt.str=Lt._=void 0;var pe=mc(),sn=IP(),uo=mc();Object.defineProperty(Lt,"_",{enumerable:!0,get:function(){return uo._}});Object.defineProperty(Lt,"str",{enumerable:!0,get:function(){return uo.str}});Object.defineProperty(Lt,"strConcat",{enumerable:!0,get:function(){return uo.strConcat}});Object.defineProperty(Lt,"nil",{enumerable:!0,get:function(){return uo.nil}});Object.defineProperty(Lt,"getProperty",{enumerable:!0,get:function(){return uo.getProperty}});Object.defineProperty(Lt,"stringify",{enumerable:!0,get:function(){return uo.stringify}});Object.defineProperty(Lt,"regexpCode",{enumerable:!0,get:function(){return uo.regexpCode}});Object.defineProperty(Lt,"Name",{enumerable:!0,get:function(){return uo.Name}});var Ku=IP();Object.defineProperty(Lt,"Scope",{enumerable:!0,get:function(){return Ku.Scope}});Object.defineProperty(Lt,"ValueScope",{enumerable:!0,get:function(){return Ku.ValueScope}});Object.defineProperty(Lt,"ValueScopeName",{enumerable:!0,get:function(){return Ku.ValueScopeName}});Object.defineProperty(Lt,"varKinds",{enumerable:!0,get:function(){return Ku.varKinds}});Lt.operators={GT:new pe._Code(">"),GTE:new pe._Code(">="),LT:new pe._Code("<"),LTE:new pe._Code("<="),EQ:new pe._Code("==="),NEQ:new pe._Code("!=="),NOT:new pe._Code("!"),OR:new pe._Code("||"),AND:new pe._Code("&&"),ADD:new pe._Code("+")};class go{optimizeNodes(){return this}optimizeNames(e,t){return this}}class MU extends go{constructor(e,t,n){super();this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?sn.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=li(this.rhs,e,t);return this}get names(){return this.rhs instanceof pe._CodeOrName?this.rhs.names:{}}}class OP extends go{constructor(e,t,n){super();this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof pe.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=li(this.rhs,e,t),this}get names(){let e=this.lhs instanceof pe.Name?{}:{...this.lhs.names};return Mu(e,this.rhs)}}class KU extends OP{constructor(e,t,n,r){super(e,n,r);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class EU extends go{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class qU extends go{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class GU extends go{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class JU extends go{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=li(this.code,e,t),this}get names(){return this.code instanceof pe._CodeOrName?this.code.names:{}}}class Eu extends go{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let n=e[t].optimizeNodes();if(Array.isArray(n))e.splice(t,1,...n);else if(n)e[t]=n;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;while(r--){let o=n[r];if(o.optimizeNames(e,t))continue;fne(e,o.names),n.splice(r,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Go(e,t.names),{})}}class yo extends Eu{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class HU extends Eu{}class pc extends yo{}pc.kind="else";class Un extends yo{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let n=t.optimizeNodes();t=this.else=Array.isArray(n)?new pc(n):n}if(t){if(e===!1)return t instanceof Un?t:t.nodes;if(this.nodes.length)return this;return new Un(XU(e),t instanceof Un?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=li(this.condition,e,t),this}get names(){let e=super.names;if(Mu(e,this.condition),this.else)Go(e,this.else.names);return e}}Un.kind="if";class hi extends yo{}hi.kind="for";class BU extends hi{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=li(this.iteration,e,t),this}get names(){return Go(super.names,this.iteration.names)}}class WU extends hi{constructor(e,t,n,r){super();this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?sn.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=Mu(super.names,this.from);return Mu(e,this.to)}}class LP extends hi{constructor(e,t,n,r){super();this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=li(this.iterable,e,t),this}get names(){return Go(super.names,this.iterable.names)}}class Nu extends yo{constructor(e,t,n){super();this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}Nu.kind="func";class xu extends Eu{render(e){return"return "+super.render(e)}}xu.kind="return";class ZU extends yo{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)===null||n===void 0||n.optimizeNames(e,t),(r=this.finally)===null||r===void 0||r.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)Go(e,this.catch.names);if(this.finally)Go(e,this.finally.names);return e}}class Ru extends yo{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Ru.kind="catch";class Uu extends yo{render(e){return"finally"+super.render(e)}}Uu.kind="finally";class FU{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
7474
+ -d '{"event":"hello.world","level":"info","message":"first webhook event"}'`}]}]}]}});var sx;var hx=g(()=>{cx();sx={id:"webhook_events",name:"Webhook Events",searchAliases:["webhook","webhooks","json events","http events","generic webhook","event stream"],capabilities:["connectionless"],auth:[],delivery:["push"],intake:[{id:"webhook-events",label:"Webhook Events",transform:"webhook-events"}],lifecycleSkipReason:"Manual webhook setup is not exercised by automated lifecycle tests yet.",subtitle:"Point any vendor's webhooks at Sazabi. Arbitrary JSON events land as searchable log records with zero vendor-specific configuration.",features:["Any JSON event stream","One keyed URL per endpoint","Full payload preserved as attributes","No schema or field mapping"],evidenceHints:["A vendor that emits plain JSON webhooks without a dedicated Sazabi source","An internal service, deploy bot, or cron that POSTs JSON events","Existing outbound webhook configuration with no other Sazabi destination"],setupSkill:W,dashboard:{slug:"webhook-events",iconKey:"webhook-events",intakeSourceId:"webhook-events"}}});var Kl,lx,eNe,tNe,lo,nNe,oNe,B7,W7,Z7,rNe;var ux=g(()=>{eN();oN();aN();hN();gN();bN();wN();vN();$N();TN();CN();_N();xN();MN();qN();HN();ZN();YN();e1();o1();a1();h1();g1();b1();w1();v1();$1();T1();C1();_1();x1();M1();q1();H1();Z1();Y1();ex();ox();ax();hx();Kl=[Vj,nN,iN,sN,uN,yN,pN,kN,PN,LN,AN,zN,NN,UN,EN,JN,WN,XN,VN,n1,i1,s1,u1,y1,p1,k1,P1,L1,A1,z1,N1,U1,J1,E1,W1,X1,V1,nx,ix,sx],lx=Kl,eNe=Object.fromEntries(lx.map((e)=>[e.id,e.sensitiveFields??[]])),tNe=Object.fromEntries(lx.flatMap((e)=>[...Object.values(e.dashboard?.actions?.submit??{}),...Object.values(e.dashboard?.actions?.list??{}),...Object.values(e.dashboard?.actions?.prefetch??{})].flatMap((t)=>{let n=t.sensitiveInputFields??[];if(n.length===0)return[];return[["procedure"in t?t.procedure:`${e.id}.${t.actionId}`,n]]}))),lo=["vercel","cloudflare","railway","render","fly_io","netlify","supabase","digital_ocean","inngest","trigger_dev","temporal","mastra","neon","langchain","daytona","e2b","cloudwatch","convex","datadog","sentry","sentry_platform","openrouter","posthog","posthog_sdk","gcp","otel","otel_metrics","fluent_bit","vector","grafana_alloy","otel_collector","cloudflare_workers","elastic_cloud","porter","respan","plain","prometheus","webhook_events","claude_code","codex"],nNe=Kl.map((e)=>({id:e.id,name:e.name,capabilities:e.capabilities})),oNe=Object.fromEntries(Kl.map((e)=>[e.id,{name:e.name,setupSkill:e.setupSkill}])),B7={cloudflare:tv,cloudwatch:sv,convex:gv,digital_ocean:pv,fly_io:Pv,gcp:Lv,plain:Mv,posthog:Gv,render:Fv,sentry_platform:eS,vercel:cS},W7={cloudflare:nv,cloudwatch:hv,convex:yv,digital_ocean:fv,fly_io:Iv,gcp:Tv,plain:Ev,posthog:Jv,render:Yv,vercel:hS},Z7={cloudflare:ov,cloudflare_workers:rv,cloudwatch:lv,convex:dv,datadog:bv,daytona:mv,digital_ocean:wv,fluent_bit:Sv,fly_io:$v,grafana_alloy:Av,e2b:kv,elastic_cloud:vv,gcp:Ov,inngest:Cv,langchain:Dv,mastra:zv,neon:_v,netlify:jv,openrouter:Nv,otel:xv,otel_collector:Rv,otel_metrics:Uv,plain:Kv,posthog:Hv,posthog_sdk:Bv,porter:qv,prometheus:Wv,railway:Zv,render:Xv,respan:Qv,sentry:Vv,sentry_platform:tS,supabase:nS,temporal:oS,trigger_dev:rS,vector:iS,vercel:sS,webhook_events:lS,claude_code:ev,codex:uv},rNe=Kl.map((e)=>({sourceId:e.id,name:e.name,capabilities:e.capabilities,setupAuthModes:e.auth,deliveryModes:e.delivery,hasDashboardMetadata:Boolean(e.dashboard),hasManagedFlow:Boolean(B7[e.id]),hasConnectionlessFlow:Boolean(Z7[e.id]),hasStreamSelector:Boolean(W7[e.id]),lifecycleEligible:e.lifecycleEligible??!1,lifecycleSkipReason:e.lifecycleSkipReason}))});var gx=g(()=>{ux()});var El=g(()=>{Yj();gx()});var dx,uS,F7,ql,X7,yx,gS,oc,rc,bx,mx,px,Gl,wx,fx,Zr,kx,vx,Fr,Sx,Px,Jl,$x,Ix,Hl,Lx,Tx,Bl,Ox,Ax,Wl,Cx,Dx,Zl,zx,_x,Fl,jx,Nx,Xl,xx,Rx,Yl,Y7;var dS=g(()=>{El();be();Le();dx=lo,uS=a.enum(dx),F7=a.enum(["pending","provisioning","active","error"]),ql=a.enum(["managed","connectionless"]),X7=a.object({name:a.string().describe("Field name used as the JSON key in metadata."),type:a.string().describe('Zod type name, e.g. "string", "boolean", "enum".'),required:a.boolean().describe("Whether the field is required."),sensitive:a.boolean().describe("Whether the field contains a secret and will be encrypted."),description:a.string().nullable().describe("Human-readable description of the field.")}),yx=a.object({id:a.string().describe("Data source type identifier."),name:a.string().describe("Human-readable display name."),modes:a.array(ql).describe("Setup modes this source supports. `managed` sources take vendor credentials; `connectionless` sources mint a keyed intake endpoint."),metadataFields:a.array(X7).describe("Fields required in the metadata object when creating a managed instance. Empty for connectionless-only sources."),setupSkill:a.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),gS=a.object({kind:a.enum(["url","hostPort"]).describe("Card shape. `url` = a complete keyed URL whose hostname authenticates; `hostPort` = a non-keyed listener host + port whose credential travels separately."),label:a.string().optional().describe("Card label. Present when a source exposes several endpoints (e.g. separate logs and traces destinations)."),url:a.string().optional().describe("The complete keyed intake URL. Present when kind is `url`."),host:a.string().optional().describe("The regional listener hostname (no scheme). Present when kind is `hostPort`."),port:a.number().int().optional().describe("The listener port. Present when kind is `hostPort`."),description:a.string().optional().describe("Vendor-specific guidance rendered under the value."),extraCredential:a.object({label:a.string(),value:a.string(),description:a.string().optional()}).optional().describe("The credential the sender must attach when the hostname alone does not authenticate. Present when kind is `hostPort`.")}),oc=a.object({id:a.string().uuid(),instanceId:a.string().uuid().describe("Root instance ID. Every stream roots on exactly one data source instance."),displayName:a.string(),config:a.record(a.string(),a.unknown()),status:F7,errorMessage:a.string().nullable(),enabled:a.boolean().describe("Whether the stream is currently ingesting. Independent of provisioning status: a paused stream stays configured but stops accepting new data."),createdAt:a.string().datetime(),endpointCards:a.array(gS).optional().describe("Server-computed endpoint card(s) for this stream's delivery key — where to point the sender. Present only for streams that carry their own intake key.")}),rc=a.object({id:a.string().uuid(),dataSourceType:uS,mode:ql,name:a.string().nullable().describe("Display name. For connectionless instances this falls back to the stream's name when no explicit name is set."),streamCount:a.number().int(),createdAt:a.string().datetime()}),bx=rc.extend({streams:a.array(oc).describe("The instance's live streams, newest first.")}),mx=a.object({}),px=a.object({types:a.array(yx)}),Gl=P({operationId:"dataSources.listTypes",description:"List all supported data source types with their setup modes and metadata requirements.",backend:"api",route:{method:"GET",path:"/data-sources/types",tags:["Data Sources"]},input:mx,output:px,pagination:"none",async:"sync"}),wx=a.object({projectId:a.string().uuid().optional().describe("Project to list instances for. Auto-filled from SDK context when omitted."),dataSourceType:uS.optional().describe("Filter instances by data source type.")}),fx=a.object({instances:a.array(rc)}),Zr=P({operationId:"dataSources.listInstances",description:"List data source instances within one project.",backend:"api",route:{method:"GET",path:"/data-sources/instances",tags:["Data Sources"]},input:wx,output:fx,pagination:"none",async:"sync"}),kx=a.object({projectId:a.string().uuid().optional().describe("Project to create the instance in. Auto-filled from SDK context when omitted."),dataSourceType:uS.describe("Data source type identifier."),mode:ql.optional().describe("Setup mode. Defaults to `managed` when metadata is provided, otherwise `connectionless`. Must be a mode the source supports (see `modes` on the type catalog)."),name:a.string().optional().describe("Optional human-readable name for this instance."),metadata:a.record(a.string(),a.unknown()).optional().describe("Vendor credentials and configuration for managed setup. Fields vary by data source type (see `metadataFields` on the type catalog). Required for managed mode; must be omitted for connectionless mode.")}),vx=a.object({instance:rc.describe("The created instance."),streamId:a.string().uuid().optional().describe("ID of the stream created alongside the instance. Present for connectionless instances (which always mint their keyed stream) and for managed sources that auto-provision a default stream."),publicKey:a.string().optional().describe("Intake key minted for the instance. Store this securely — it is only shown once. Present for connectionless instances and for managed sources that ingest through a Sazabi endpoint."),endpointCards:a.array(gS).optional().describe("Server-computed endpoint card(s) for the minted key — where to point the sender. Present for connectionless instances.")}),Fr=P({operationId:"dataSources.createInstance",description:"Create a data source instance. Managed mode takes vendor credentials in `metadata`, validates them, and provisions delivery behind the instance. Connectionless mode mints the instance plus a keyed stream and returns the intake key and endpoint card(s) to point the sender at.",backend:"api",route:{method:"POST",path:"/data-sources/instances",successStatus:201,tags:["Data Sources"]},input:kx,output:vx,pagination:"none",async:"sync"}),Sx=a.object({instanceId:a.string().uuid().describe("Instance ID to fetch.")}),Px=a.object({instance:bx}),Jl=P({operationId:"dataSources.getInstance",description:"Get one data source instance by ID, including its streams and their endpoint card(s).",backend:"api",route:{method:"GET",path:"/data-sources/instances/{instanceId}",tags:["Data Sources"]},input:Sx,output:Px,pagination:"none",async:"sync"}),$x=a.object({instanceId:a.string().uuid().describe("Instance ID to update."),name:a.string().min(1).optional().describe("New display name for the instance."),enabled:a.boolean().optional().describe("Pause (`false`) or resume (`true`) ingestion for all of the instance's streams. Reversible; never deletes anything.")}),Ix=a.object({instance:rc}),Hl=P({operationId:"dataSources.updateInstance",description:"Update a data source instance: rename it and/or pause or resume ingestion across its streams.",backend:"api",route:{method:"PATCH",path:"/data-sources/instances/{instanceId}",tags:["Data Sources"]},input:$x,output:Ix,pagination:"none",async:"sync"}),Lx=a.object({instanceId:a.string().uuid().describe("Instance ID to delete.")}),Tx=a.object({success:a.boolean(),teardownError:a.string().nullable().describe("Null when vendor-side cleanup succeeded or was not needed; error message when remote cleanup failed and must be finished manually.")}),Bl=P({operationId:"dataSources.deleteInstance",description:"Delete a data source instance. Tombstones the instance and its streams, deactivates their intake keys (already-ingested data is preserved with its attribution), and runs vendor-side cleanup for managed instances when the source supports it.",backend:"api",route:{method:"DELETE",path:"/data-sources/instances/{instanceId}",successStatus:200,tags:["Data Sources"]},input:Lx,output:Tx,pagination:"none",async:"sync"}),Ox=a.object({instanceId:a.string().uuid().describe("Instance ID to list streams for."),enabled:a.boolean().optional().describe("Optional filter on stream ingestion state. Omit to list all streams; pass true for only enabled streams or false for only paused streams.")}),Ax=a.object({streams:a.array(oc)}),Wl=P({operationId:"dataSources.listStreams",description:"List the streams that belong to a data source instance.",backend:"api",route:{method:"GET",path:"/data-sources/instances/{instanceId}/streams",tags:["Data Sources"]},input:Ox,output:Ax,pagination:"none",async:"sync"}),Cx=a.object({instanceId:a.string().uuid().describe("Instance ID to create the stream under."),displayName:a.string().min(1).describe("Resource name, e.g. service or app name."),config:a.record(a.string(),a.unknown()).optional().describe("Platform-specific stream configuration.")}),Dx=a.object({streamId:a.string().uuid().describe("ID of the created stream.")}),Zl=P({operationId:"dataSources.createStream",description:"Create a new stream under a managed data source instance. Triggers async provisioning; poll the stream to track it. Connectionless instances are single-stream — create another instance instead.",backend:"api",route:{method:"POST",path:"/data-sources/instances/{instanceId}/streams",successStatus:201,tags:["Data Sources"]},input:Cx,output:Dx,pagination:"none",async:"sync"}),zx=a.object({streamId:a.string().uuid().describe("Stream ID to fetch.")}),_x=a.object({stream:oc}),Fl=P({operationId:"dataSources.getStream",description:"Get one data source stream by ID. Use to poll provisioning status.",backend:"api",route:{method:"GET",path:"/data-sources/streams/{streamId}",tags:["Data Sources"]},input:zx,output:_x,pagination:"none",async:"sync"}),jx=a.object({streamId:a.string().uuid().describe("Stream ID to update."),displayName:a.string().min(1).optional().describe("New display name for the stream."),enabled:a.boolean().optional().describe("Pause (`false`) or resume (`true`) ingestion for this stream. Reversible; never deletes anything.")}),Nx=a.object({stream:oc}),Xl=P({operationId:"dataSources.updateStream",description:"Update a data source stream: rename it and/or pause or resume its ingestion.",backend:"api",route:{method:"PATCH",path:"/data-sources/streams/{streamId}",tags:["Data Sources"]},input:jx,output:Nx,pagination:"none",async:"sync"}),xx=a.object({streamId:a.string().uuid().describe("Stream ID to delete.")}),Rx=a.object({success:a.boolean()}),Yl=P({operationId:"dataSources.deleteStream",description:"Delete a data source stream. Tombstones the stream and deactivates its intake key. Deleting a connectionless instance's only stream tombstones the instance too.",backend:"api",route:{method:"DELETE",path:"/data-sources/streams/{streamId}",successStatus:204,tags:["Data Sources"]},input:xx,output:Rx,pagination:"none",async:"sync"}),Y7={listTypes:Gl.contract,listInstances:Zr.contract,createInstance:Fr.contract,getInstance:Jl.contract,updateInstance:Hl.contract,deleteInstance:Bl.contract,listStreams:Wl.contract,createStream:Zl.contract,getStream:Fl.contract,updateStream:Xl.contract,deleteStream:Yl.contract}});var Ux,yS,Q7,Ql,V7,Mx,bS,ic,ac,Kx,Ex,qx,Vl,Gx,Jx,Xr,Hx,Bx,Yr,Wx,Zx,eu,Fx,Xx,tu,Yx,Qx,nu,Vx,eR,ou,tR,nR,ru,oR,rR,iu,iR,aR,au,cR,sR,cu,e2;var mS=g(()=>{El();be();Le();Ux=lo,yS=a.enum(Ux),Q7=a.enum(["pending","provisioning","active","error"]),Ql=a.enum(["managed","connectionless"]),V7=a.object({name:a.string().describe("Field name used as the JSON key in metadata."),type:a.string().describe('Zod type name, e.g. "string", "boolean", "enum".'),required:a.boolean().describe("Whether the field is required."),sensitive:a.boolean().describe("Whether the field contains a secret and will be encrypted."),description:a.string().nullable().describe("Human-readable description of the field.")}),Mx=a.object({id:a.string().describe("Log source provider identifier."),name:a.string().describe("Human-readable display name."),modes:a.array(Ql).describe("Setup modes this provider supports. `managed` log sources take vendor credentials; `connectionless` log sources mint a keyed intake endpoint."),metadataFields:a.array(V7).describe("Fields required in the metadata object when creating a managed log source. Empty for connectionless-only providers."),setupSkill:a.string().nullable().describe("Markdown setup skill for AI agents. Null when no skill is available.")}),bS=a.object({kind:a.enum(["url","hostPort"]).describe("Card shape. `url` = a complete keyed URL whose hostname authenticates; `hostPort` = a non-keyed listener host + port whose credential travels separately."),label:a.string().optional().describe("Card label. Present when a log source exposes several endpoints (e.g. separate logs and traces destinations)."),url:a.string().optional().describe("The complete keyed intake URL. Present when kind is `url`."),host:a.string().optional().describe("The regional listener hostname (no scheme). Present when kind is `hostPort`."),port:a.number().int().optional().describe("The listener port. Present when kind is `hostPort`."),description:a.string().optional().describe("Vendor-specific guidance rendered under the value."),extraCredential:a.object({label:a.string(),value:a.string(),description:a.string().optional()}).optional().describe("The credential the sender must attach when the hostname alone does not authenticate. Present when kind is `hostPort`.")}),ic=a.object({id:a.string().uuid(),logSourceId:a.string().uuid().describe("Root log source ID. Every log stream roots on exactly one log source."),displayName:a.string(),config:a.record(a.string(),a.unknown()),status:Q7,errorMessage:a.string().nullable(),enabled:a.boolean().describe("Whether the log stream is currently ingesting. Independent of provisioning status: a paused log stream stays configured but stops accepting new data."),createdAt:a.string().datetime(),endpointCards:a.array(bS).optional().describe("Server-computed endpoint card(s) for this log stream's delivery key — where to point the sender. Present only for log streams that carry their own intake key.")}),ac=a.object({id:a.string().uuid(),provider:yS,mode:Ql,name:a.string().nullable().describe("Display name. For connectionless log sources this falls back to the log stream's name when no explicit name is set."),streamCount:a.number().int(),createdAt:a.string().datetime()}),Kx=ac.extend({streams:a.array(ic).describe("The log source's live log streams, newest first.")}),Ex=a.object({}),qx=a.object({providers:a.array(Mx)}),Vl=P({operationId:"logSources.listProviders",description:"List all supported log source providers with their setup modes and metadata requirements.",backend:"api",route:{method:"GET",path:"/log-sources/providers",tags:["Log Sources"]},input:Ex,output:qx,pagination:"none",async:"sync"}),Gx=a.object({projectId:a.string().uuid().optional().describe("Project to list log sources for. Auto-filled from SDK context when omitted."),provider:yS.optional().describe("Filter log sources by provider.")}),Jx=a.object({logSources:a.array(ac)}),Xr=P({operationId:"logSources.list",description:"List log sources within one project.",backend:"api",route:{method:"GET",path:"/log-sources",tags:["Log Sources"]},input:Gx,output:Jx,pagination:"none",async:"sync"}),Hx=a.object({projectId:a.string().uuid().optional().describe("Project to create the log source in. Auto-filled from SDK context when omitted."),provider:yS.describe("Log source provider identifier."),mode:Ql.optional().describe("Setup mode. Defaults to `managed` when metadata is provided, otherwise `connectionless`. Must be a mode the provider supports (see `modes` on the provider catalog)."),name:a.string().optional().describe("Optional human-readable name for this log source."),metadata:a.record(a.string(),a.unknown()).optional().describe("Vendor credentials and configuration for managed setup. Fields vary by provider (see `metadataFields` on the provider catalog). Required for managed mode; must be omitted for connectionless mode.")}),Bx=a.object({logSource:ac.describe("The created log source."),streamId:a.string().uuid().optional().describe("ID of the log stream created alongside the log source. Present for connectionless log sources (which always mint their keyed log stream) and for managed providers that auto-provision a default log stream."),publicKey:a.string().optional().describe("Intake key minted for the log source. Store this securely — it is only shown once. Present for connectionless log sources and for managed providers that ingest through a Sazabi endpoint."),endpointCards:a.array(bS).optional().describe("Server-computed endpoint card(s) for the minted key — where to point the sender. Present for connectionless log sources.")}),Yr=P({operationId:"logSources.create",description:"Create a log source. Managed mode takes vendor credentials in `metadata`, validates them, and provisions delivery behind the log source. Connectionless mode mints the log source plus a keyed log stream and returns the intake key and endpoint card(s) to point the sender at.",backend:"api",route:{method:"POST",path:"/log-sources",successStatus:201,tags:["Log Sources"]},input:Hx,output:Bx,pagination:"none",async:"sync"}),Wx=a.object({logSourceId:a.string().uuid().describe("Log source ID to fetch.")}),Zx=a.object({logSource:Kx}),eu=P({operationId:"logSources.get",description:"Get one log source by ID, including its log streams and their endpoint card(s).",backend:"api",route:{method:"GET",path:"/log-sources/{logSourceId}",tags:["Log Sources"]},input:Wx,output:Zx,pagination:"none",async:"sync"}),Fx=a.object({logSourceId:a.string().uuid().describe("Log source ID to update."),name:a.string().min(1).optional().describe("New display name for the log source."),enabled:a.boolean().optional().describe("Pause (`false`) or resume (`true`) ingestion for all of the log source's log streams. Reversible; never deletes anything.")}),Xx=a.object({logSource:ac}),tu=P({operationId:"logSources.update",description:"Update a log source: rename it and/or pause or resume ingestion across its log streams.",backend:"api",route:{method:"PATCH",path:"/log-sources/{logSourceId}",tags:["Log Sources"]},input:Fx,output:Xx,pagination:"none",async:"sync"}),Yx=a.object({logSourceId:a.string().uuid().describe("Log source ID to delete.")}),Qx=a.object({success:a.boolean(),teardownError:a.string().nullable().describe("Null when vendor-side cleanup succeeded or was not needed; error message when remote cleanup failed and must be finished manually.")}),nu=P({operationId:"logSources.delete",description:"Delete a log source. Tombstones the log source and its log streams, deactivates their intake keys (already-ingested data is preserved with its attribution), and runs vendor-side cleanup for managed log sources when the provider supports it.",backend:"api",route:{method:"DELETE",path:"/log-sources/{logSourceId}",successStatus:200,tags:["Log Sources"]},input:Yx,output:Qx,pagination:"none",async:"sync"}),Vx=a.object({logSourceId:a.string().uuid().describe("Log source ID to list log streams for."),enabled:a.boolean().optional().describe("Optional filter on log stream ingestion state. Omit to list all log streams; pass true for only enabled log streams or false for only paused log streams.")}),eR=a.object({streams:a.array(ic)}),ou=P({operationId:"logSources.listStreams",description:"List the log streams that belong to a log source.",backend:"api",route:{method:"GET",path:"/log-sources/{logSourceId}/streams",tags:["Log Sources"]},input:Vx,output:eR,pagination:"none",async:"sync"}),tR=a.object({logSourceId:a.string().uuid().describe("Log source ID to create the log stream under."),displayName:a.string().min(1).describe("Resource name, e.g. service or app name."),config:a.record(a.string(),a.unknown()).optional().describe("Platform-specific log stream configuration.")}),nR=a.object({streamId:a.string().uuid().describe("ID of the created log stream.")}),ru=P({operationId:"logSources.createStream",description:"Create a new log stream under a managed log source. Triggers async provisioning; poll the log stream to track it. Connectionless log sources are single-stream — create another log source instead.",backend:"api",route:{method:"POST",path:"/log-sources/{logSourceId}/streams",successStatus:201,tags:["Log Sources"]},input:tR,output:nR,pagination:"none",async:"sync"}),oR=a.object({streamId:a.string().uuid().describe("Log stream ID to fetch.")}),rR=a.object({stream:ic}),iu=P({operationId:"logSources.getStream",description:"Get one log stream by ID. Use to poll provisioning status.",backend:"api",route:{method:"GET",path:"/log-sources/streams/{streamId}",tags:["Log Sources"]},input:oR,output:rR,pagination:"none",async:"sync"}),iR=a.object({streamId:a.string().uuid().describe("Log stream ID to update."),displayName:a.string().min(1).optional().describe("New display name for the log stream."),enabled:a.boolean().optional().describe("Pause (`false`) or resume (`true`) ingestion for this log stream. Reversible; never deletes anything.")}),aR=a.object({stream:ic}),au=P({operationId:"logSources.updateStream",description:"Update a log stream: rename it and/or pause or resume its ingestion.",backend:"api",route:{method:"PATCH",path:"/log-sources/streams/{streamId}",tags:["Log Sources"]},input:iR,output:aR,pagination:"none",async:"sync"}),cR=a.object({streamId:a.string().uuid().describe("Log stream ID to delete.")}),sR=a.object({success:a.boolean()}),cu=P({operationId:"logSources.deleteStream",description:"Delete a log stream. Tombstones the log stream and deactivates its intake key. Deleting a connectionless log source's only log stream tombstones the log source too.",backend:"api",route:{method:"DELETE",path:"/log-sources/streams/{streamId}",successStatus:200,tags:["Log Sources"]},input:cR,output:sR,pagination:"none",async:"sync"}),e2={listProviders:Vl.contract,list:Xr.contract,create:Yr.contract,get:eu.contract,update:tu.contract,delete:nu.contract,listStreams:ou.contract,createStream:ru.contract,getStream:iu.contract,updateStream:au.contract,deleteStream:cu.contract}});var hR,lR,uR,gR,dR,yR,bR,cc,mR,pR,wR,pS,fR,kR,vR,SR,PR,$R,IR,LR,TR,OR,t2,AR,CR,Qr,Vr,ei,ti,ni,su,n2;var wS=g(()=>{be();Le();hR=a.enum(["eq","neq","in","contains","starts_with","gt","gte","lt","lte","between","exists"]).describe("Filter operator: 'eq' (equals), 'neq' (not equals), 'in' (in array), 'contains' (substring), 'starts_with' (prefix), 'gt' (greater than), 'gte' (greater than or equal), 'lt' (less than), 'lte' (less than or equal), 'between' (range), 'exists' (field exists)"),lR=a.enum(["any","all","phrase"]).describe("Search mode: 'any' (match any token), 'all' (match all tokens), 'phrase' (exact phrase match)"),uR=a.object({query:a.string().min(1,"Search query must be at least 1 character").max(500,"Search query must be at most 500 characters").describe("Search query text (1-500 characters)"),fields:a.array(a.string()).optional().describe("Fields to search in (defaults to backend allowlist)"),mode:lR.optional().default("all").describe("Token matching mode")}),gR=a.object({field:a.string().describe("Field name to filter on"),op:hR.describe("Filter operator"),value:a.union([a.string(),a.number(),a.boolean(),a.array(a.union([a.string(),a.number()])),a.object({from:a.string(),to:a.string()})]).describe("Filter value (type depends on operator)")}).superRefine((e,t)=>{if(e.op==="in"&&!Array.isArray(e.value))t.addIssue({code:a.ZodIssueCode.custom,message:"Value must be an array when op is 'in'",path:["value"]});if(e.op==="between"){let n=e.value;if(!(typeof n==="object"&&n!==null&&("from"in n)&&("to"in n)))t.addIssue({code:a.ZodIssueCode.custom,message:"Value must be an object with from/to when op is 'between'",path:["value"]})}if(e.op==="exists"&&typeof e.value!=="boolean")t.addIssue({code:a.ZodIssueCode.custom,message:"Value must be boolean when op is 'exists'",path:["value"]})}),dR=a.object({field:a.string().describe("Field name to sort by"),direction:a.enum(["asc","desc"]).default("desc").describe("Sort direction: 'asc' for ascending, 'desc' for descending")}),yR=a.object({limit:a.number().int().min(1,"Limit must be at least 1").max(1000,"Limit must be at most 1000").default(50).describe("Maximum number of rows to return"),cursor:a.string().optional().describe("Opaque cursor from previous response for pagination")}),bR=a.object({projectId:a.string().uuid().optional().describe("Project to query logs for. Auto-filled from CLI and SDK context when omitted."),search:uR.optional().describe("Full-text search configuration"),filters:a.array(gR).optional().describe("Structured filter clauses (ANDed together). When no `timestamp` filter is provided, queries default to a 24h look-back window; pass an explicit `timestamp` filter to query a different range."),select:a.array(a.string()).optional().describe("Fields to return (defaults to backend default set)"),sort:dR.optional().describe("Sort configuration (defaults to timestamp desc)"),pagination:yR.optional().describe("Pagination configuration")}),cc=a.enum(["clickhouse","better-stack","datadog","gcp","axiom","cloudwatch","sentry","posthog","mezmo"]),mR=a.enum(["native","external"]),pR=a.object({projectId:a.string().uuid().optional().describe("Project to inspect. Auto-filled from CLI and SDK context when omitted.")}),wR=a.object({backend:a.object({id:cc,name:a.string(),kind:mR}).describe("Active log backend for the project"),features:a.array(a.string()).describe("Backend features registered on the server"),commands:a.array(a.enum(["schema","query","volume","patterns","nativeQuery"])).describe("CLI/API commands available for this backend"),queryableFields:a.array(a.string()).describe("Fields accepted by the normalized logs.query contract"),searchableFields:a.array(a.string()).describe("Fields accepted by logs.query full-text search"),observedServiceNames:a.array(a.string()).describe("Recently observed service names for this project"),observedAttributeKeys:a.array(a.string()).describe("Recently observed log attribute keys for this project"),schemaContext:a.record(a.string(),a.any()).optional().describe("Backend-specific schema guidance and examples")}),pS=a.enum(["1m","5m","15m","1h"]),fR=a.enum(["service_name","severity_text","environment"]),kR=a.object({projectId:a.string().uuid().optional().describe("Project to query. Auto-filled from CLI and SDK context when omitted."),startDate:a.string().datetime({offset:!0}),endDate:a.string().datetime({offset:!0}),interval:pS.optional().describe("Aggregation bucket size for the volume series"),groupBy:fR.optional().describe("Optional field to split volume series by"),filters:a.object({service_name:a.string().optional(),severity_text:a.string().optional(),environment:a.string().optional()}).optional()}).refine((e)=>new Date(e.startDate)<new Date(e.endDate),{message:"startDate must be before endDate",path:["endDate"]}),vR=a.object({total:a.number().nonnegative(),startDate:a.string().datetime({offset:!0}),endDate:a.string().datetime({offset:!0}),interval:pS,series:a.array(a.object({group:a.string(),total:a.number().nonnegative(),points:a.array(a.object({bucket:a.string(),count:a.number().nonnegative()}))}))}),SR=a.object({projectId:a.string().uuid().optional().describe("Project to query. Auto-filled from CLI and SDK context when omitted."),query:a.string().min(1).max(500).optional().describe("Optional text to match against normalized log patterns"),severity:a.string().optional().describe("Optional severity_text value, for example ERROR"),startDate:a.string().datetime({offset:!0}).optional().describe("Optional earliest last-seen timestamp"),endDate:a.string().datetime({offset:!0}).optional().describe("Optional latest last-seen timestamp"),limit:a.number().int().min(1).max(100).default(25).describe("Maximum number of log patterns to return")}).refine((e)=>!e.startDate||!e.endDate||new Date(e.startDate)<new Date(e.endDate),{message:"startDate must be before endDate",path:["endDate"]}),PR=a.object({serviceName:a.string().nullable(),fingerprint:a.string(),pattern:a.string(),severity:a.string().nullable(),occurrences:a.number().nonnegative(),firstSeen:a.string().nullable(),lastSeen:a.string().nullable(),representativeId:a.string().nullable()}),$R=a.object({patterns:a.array(PR),meta:a.object({backendId:cc,count:a.number().int().nonnegative(),took:a.number().nonnegative()})}),IR=a.object({projectId:a.string().uuid().optional().describe("Project to query. Auto-filled from CLI and SDK context when omitted."),query:a.string().min(1,"Query cannot be empty").max(1e4,"Query must be 10000 characters or less")}),LR=a.object({result:a.string().describe("Backend-formatted query result"),format:a.literal("text"),meta:a.object({backendId:cc,took:a.number().nonnegative(),truncated:a.boolean()})}),TR=a.object({projectId:a.string().uuid().optional().describe("Project to query. Auto-filled from CLI and SDK context when omitted."),query:a.string().min(1,"Query must be at least 1 character long.").max(4000,"Query must be at most 4000 characters").describe("Natural-language logs question. Examples: 'api request failures in the last day', 'timeouts in intake', 'top ERROR patterns for public-api'.")}),OR=a.object({answer:a.string().describe("Evidence-backed natural-language answer to the logs question"),steps:a.number().int().nonnegative().describe("Number of nested model steps used"),toolCalls:a.number().int().nonnegative().describe("Number of nested tool calls used"),compacted:a.boolean().describe("Whether nested messages were compacted during the search"),meta:a.object({backendId:cc,took:a.number().nonnegative(),modelProvider:a.string().optional(),modelId:a.string().optional()})}),t2=a.object({cursor:a.string().nullable().describe("Cursor for next page (null if no more results)"),hasMore:a.boolean().describe("Whether more results are available")}),AR=a.object({count:a.number().int().nonnegative().describe("Number of log rows returned in this response"),took:a.number().nonnegative().describe("Query execution time in milliseconds")}),CR=a.object({data:a.array(a.record(a.string(),a.any())).describe("Array of log rows with selected fields"),nextCursor:a.string().nullable().describe("Pass as 'cursor' in the next query to fetch the next page. Null when there are no more results."),meta:AR.describe("Query execution metadata")}),Qr=P({operationId:"logs.query",description:"Query logs within one project.",backend:"api",route:{method:"POST",path:"/logs/query",tags:["Logs"]},input:bR,output:CR,pagination:"cursor",async:"sync"}),Vr=P({operationId:"logs.schema",description:"Describe the active log backend, supported commands, query fields, and schema context.",backend:"api",route:{method:"POST",path:"/logs/schema",tags:["Logs"]},input:pR,output:wR,pagination:"none",async:"sync"}),ei=P({operationId:"logs.volume",description:"Query pre-aggregated log volume for one project.",backend:"api",route:{method:"POST",path:"/logs/volume",tags:["Logs"]},input:kR,output:vR,pagination:"none",async:"sync"}),ti=P({operationId:"logs.patterns",description:"Query normalized log patterns for discovery workflows.",backend:"api",route:{method:"POST",path:"/logs/patterns",tags:["Logs"]},input:SR,output:$R,pagination:"none",async:"sync"}),ni=P({operationId:"logs.nativeQuery",description:"Run a read-only query in the log store's native query language, with server-side guardrails.",backend:"api",route:{method:"POST",path:"/logs/native-query",tags:["Logs"]},input:IR,output:LR,pagination:"none",async:"sync"}),su=P({operationId:"logs.searchNatural",summary:"Natural Language Log Search",description:"Search project logs by asking a natural-language question. Experimental.",backend:"api",route:{method:"POST",path:"/logs/search-natural",tags:["Logs"]},input:TR,output:OR,pagination:"none",async:"sync"}),n2={query:Qr.contract,schema:Vr.contract,volume:ei.contract,patterns:ti.contract,nativeQuery:ni.contract,searchNatural:su.contract}});var DR=g(()=>{wl()});var fS=g(()=>{DR()});var _R=()=>{};var kS,vS,hu,o2,r2,oi,lu,jR,NR,SS,xR,RR,i2,UR,PS,a2,c2,s2,h2,l2,u2,g2,d2,y2,b2,m2,p2,w2,$S,MR,KR,f2,IS;var uu=g(()=>{be();kS=["streamable-http","sse"],vS=["none","headers","oauth","aws-sigv4"],hu=["none","client_secret_basic","client_secret_post"],o2=["preset","custom"],r2=["configured","authorizing","connected","error"],oi=["enabled","disabled","custom-only"],lu=["enabled","write_blocked","disabled"],jR=a.enum(kS),NR=a.enum(vS),SS=a.enum(hu),xR=a.enum(o2),RR=a.enum(r2),i2=a.enum(oi),UR=a.enum(lu),PS=a.object({id:a.string().min(1),name:a.string().min(1),value:a.string().min(1)}),a2=a.object({id:a.string().min(1),name:a.string().min(1),maskedValue:a.string().min(1)}),c2=a.object({authMode:a.literal("none")}),s2=a.object({tokenUrl:a.string().url(),clientId:a.string().min(1),clientSecret:a.string().min(1).optional(),tokenEndpointAuthMethod:SS.optional(),refreshToken:a.string().min(1),headerName:a.string().min(1).default("Authorization"),headerValuePrefix:a.string().default("Bearer "),expiresAt:a.string().datetime().optional()}),h2=a.object({authMode:a.literal("headers"),headers:a.array(PS),refreshCredentials:s2.optional()}),l2=a.object({authMode:a.literal("aws-sigv4"),accessKeyId:a.string().min(1),secretAccessKey:a.string().min(1),sessionToken:a.string().min(1).optional(),region:a.string().min(1),service:a.string().min(1).default("aws-mcp")}),u2=a.preprocess((e)=>{if(typeof e!=="string")return;let t=e.trim();return t.length>0?t:void 0},a.string().min(1).optional()).optional(),g2=a.object({accessToken:a.string().min(1),refreshToken:a.string().min(1).optional(),tokenType:a.string().min(1).optional(),scope:u2,expiresAt:a.string().datetime().optional()}).transform(({scope:e,...t})=>{return e===void 0?t:{...t,scope:e}}),d2=a.object({authMode:a.literal("oauth"),providerId:a.string().min(1),tokens:g2,headers:a.array(PS).optional()}),y2=a.discriminatedUnion("authMode",[c2,h2,d2,l2]),b2=a.string().min(1).regex(/^enc:v1:/,"Encrypted auth config must use enc:v1 format."),m2=a.object({codeVerifier:a.string().min(1),clientId:a.string().min(1),clientSecret:a.string().min(1).optional(),tokenEndpointAuthMethod:SS.optional(),tokenUrl:a.string().url().optional(),resourceUrl:a.string().url().optional(),projectId:a.string().uuid().optional(),returnTo:a.string().min(1).max(2000).optional(),messageId:a.string().min(1).max(240).optional(),scopes:a.array(a.string().min(1)).optional()}),p2=a.object({type:a.string().optional(),properties:a.record(a.string(),a.unknown()).optional(),required:a.array(a.string()).optional(),additionalProperties:a.boolean().optional()}).catchall(a.unknown()),w2=a.object({supportsOAuth:a.boolean().default(!1),supportsCustomHeaders:a.boolean().default(!0),supportsToolDiscovery:a.boolean().default(!0),readOnlyToolNames:a.array(a.string()).default([])}),$S=a.object({name:a.string().min(1),title:a.string().min(1),description:a.string().min(1),inputSchema:p2,annotations:a.record(a.string(),a.unknown()).default({}),availability:UR,isReadOnly:a.boolean()}),MR=a.object({discoveredAt:a.string().datetime(),tools:a.array($S)}),KR=a.object({mode:a.enum(["user","system"]),managedBy:a.object({type:a.literal("integration"),id:a.string().min(1),displayName:a.string().min(1),iconKey:a.string().min(1)}).nullable(),capabilities:a.object({canRename:a.boolean(),canEditCredentials:a.boolean(),canSetReadOnly:a.boolean(),canConfigureTools:a.boolean(),canDisconnect:a.boolean()})}),f2=a.object({id:a.string().uuid(),organizationId:a.string().min(1),projectId:a.string().uuid(),providerId:a.string().min(1),source:xR,displayName:a.string().min(1),connectionKey:a.string().min(1),serverUrl:a.string().url(),transport:jR,authMode:NR,installStatus:RR,installedByUserId:a.string().nullable(),connectedAt:a.string().datetime().nullable(),toolSnapshot:MR.nullable(),enabledToolNames:a.array(a.string()),readOnly:a.boolean().default(!1),version:a.number().int().nonnegative(),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),deletedAt:a.string().datetime().nullable()}),IS=KR});var TS=G((P1e,yu)=>{var ER,qR,GR,JR,HR,BR,WR,ZR,FR,XR,YR,QR,VR,gu,LS,e4,t4,n4,ri,o4,r4,i4,a4,c4,s4,h4,l4,u4,du,g4,d4,y4;(function(e){var t=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd)define("tslib",["exports"],function(r){e(n(t,n(r)))});else if(typeof yu==="object"&&typeof P1e==="object")e(n(t,n(P1e)));else e(n(t));function n(r,o){if(r!==t)if(typeof Object.create==="function")Object.defineProperty(r,"__esModule",{value:!0});else r.__esModule=!0;return function(i,c){return r[i]=o?o(i,c):c}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,c){i.__proto__=c}||function(i,c){for(var s in c)if(Object.prototype.hasOwnProperty.call(c,s))i[s]=c[s]};ER=function(i,c){if(typeof c!=="function"&&c!==null)throw TypeError("Class extends value "+String(c)+" is not a constructor or null");t(i,c);function s(){this.constructor=i}i.prototype=c===null?Object.create(c):(s.prototype=c.prototype,new s)},qR=Object.assign||function(i){for(var c,s=1,h=arguments.length;s<h;s++){c=arguments[s];for(var l in c)if(Object.prototype.hasOwnProperty.call(c,l))i[l]=c[l]}return i},GR=function(i,c){var s={};for(var h in i)if(Object.prototype.hasOwnProperty.call(i,h)&&c.indexOf(h)<0)s[h]=i[h];if(i!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var l=0,h=Object.getOwnPropertySymbols(i);l<h.length;l++)if(c.indexOf(h[l])<0&&Object.prototype.propertyIsEnumerable.call(i,h[l]))s[h[l]]=i[h[l]]}return s},JR=function(i,c,s,h){var l=arguments.length,u=l<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,s):h,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")u=Reflect.decorate(i,c,s,h);else for(var y=i.length-1;y>=0;y--)if(d=i[y])u=(l<3?d(u):l>3?d(c,s,u):d(c,s))||u;return l>3&&u&&Object.defineProperty(c,s,u),u},HR=function(i,c){return function(s,h){c(s,h,i)}},BR=function(i,c,s,h,l,u){function d(we){if(we!==void 0&&typeof we!=="function")throw TypeError("Function expected");return we}var y=h.kind,p=y==="getter"?"get":y==="setter"?"set":"value",f=!c&&i?h.static?i:i.prototype:null,k=c||(f?Object.getOwnPropertyDescriptor(f,h.name):{}),L,A=!1;for(var K=s.length-1;K>=0;K--){var x={};for(var Y in h)x[Y]=Y==="access"?{}:h[Y];for(var Y in h.access)x.access[Y]=h.access[Y];x.addInitializer=function(we){if(A)throw TypeError("Cannot add initializers after decoration has completed");u.push(d(we||null))};var E=(0,s[K])(y==="accessor"?{get:k.get,set:k.set}:k[p],x);if(y==="accessor"){if(E===void 0)continue;if(E===null||typeof E!=="object")throw TypeError("Object expected");if(L=d(E.get))k.get=L;if(L=d(E.set))k.set=L;if(L=d(E.init))l.unshift(L)}else if(L=d(E))if(y==="field")l.unshift(L);else k[p]=L}if(f)Object.defineProperty(f,h.name,k);A=!0},WR=function(i,c,s){var h=arguments.length>2;for(var l=0;l<c.length;l++)s=h?c[l].call(i,s):c[l].call(i);return h?s:void 0},ZR=function(i){return typeof i==="symbol"?i:"".concat(i)},FR=function(i,c,s){if(typeof c==="symbol")c=c.description?"[".concat(c.description,"]"):"";return Object.defineProperty(i,"name",{configurable:!0,value:s?"".concat(s," ",c):c})},XR=function(i,c){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(i,c)},YR=function(i,c,s,h){function l(u){return u instanceof s?u:new s(function(d){d(u)})}return new(s||(s=Promise))(function(u,d){function y(k){try{f(h.next(k))}catch(L){d(L)}}function p(k){try{f(h.throw(k))}catch(L){d(L)}}function f(k){k.done?u(k.value):l(k.value).then(y,p)}f((h=h.apply(i,c||[])).next())})},QR=function(i,c){var s={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},h,l,u,d=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return d.next=y(0),d.throw=y(1),d.return=y(2),typeof Symbol==="function"&&(d[Symbol.iterator]=function(){return this}),d;function y(f){return function(k){return p([f,k])}}function p(f){if(h)throw TypeError("Generator is already executing.");while(d&&(d=0,f[0]&&(s=0)),s)try{if(h=1,l&&(u=f[0]&2?l.return:f[0]?l.throw||((u=l.return)&&u.call(l),0):l.next)&&!(u=u.call(l,f[1])).done)return u;if(l=0,u)f=[f[0]&2,u.value];switch(f[0]){case 0:case 1:u=f;break;case 4:return s.label++,{value:f[1],done:!1};case 5:s.label++,l=f[1],f=[0];continue;case 7:f=s.ops.pop(),s.trys.pop();continue;default:if((u=s.trys,!(u=u.length>0&&u[u.length-1]))&&(f[0]===6||f[0]===2)){s=0;continue}if(f[0]===3&&(!u||f[1]>u[0]&&f[1]<u[3])){s.label=f[1];break}if(f[0]===6&&s.label<u[1]){s.label=u[1],u=f;break}if(u&&s.label<u[2]){s.label=u[2],s.ops.push(f);break}if(u[2])s.ops.pop();s.trys.pop();continue}f=c.call(i,s)}catch(k){f=[6,k],l=0}finally{h=u=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},VR=function(i,c){for(var s in i)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(c,s))du(c,i,s)},du=Object.create?function(i,c,s,h){if(h===void 0)h=s;var l=Object.getOwnPropertyDescriptor(c,s);if(!l||("get"in l?!c.__esModule:l.writable||l.configurable))l={enumerable:!0,get:function(){return c[s]}};Object.defineProperty(i,h,l)}:function(i,c,s,h){if(h===void 0)h=s;i[h]=c[s]},gu=function(i){var c=typeof Symbol==="function"&&Symbol.iterator,s=c&&i[c],h=0;if(s)return s.call(i);if(i&&typeof i.length==="number")return{next:function(){if(i&&h>=i.length)i=void 0;return{value:i&&i[h++],done:!i}}};throw TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")},LS=function(i,c){var s=typeof Symbol==="function"&&i[Symbol.iterator];if(!s)return i;var h=s.call(i),l,u=[],d;try{while((c===void 0||c-- >0)&&!(l=h.next()).done)u.push(l.value)}catch(y){d={error:y}}finally{try{if(l&&!l.done&&(s=h.return))s.call(h)}finally{if(d)throw d.error}}return u},e4=function(){for(var i=[],c=0;c<arguments.length;c++)i=i.concat(LS(arguments[c]));return i},t4=function(){for(var i=0,c=0,s=arguments.length;c<s;c++)i+=arguments[c].length;for(var h=Array(i),l=0,c=0;c<s;c++)for(var u=arguments[c],d=0,y=u.length;d<y;d++,l++)h[l]=u[d];return h},n4=function(i,c,s){if(s||arguments.length===2){for(var h=0,l=c.length,u;h<l;h++)if(u||!(h in c)){if(!u)u=Array.prototype.slice.call(c,0,h);u[h]=c[h]}}return i.concat(u||Array.prototype.slice.call(c))},ri=function(i){return this instanceof ri?(this.v=i,this):new ri(i)},o4=function(i,c,s){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var h=s.apply(i,c||[]),l,u=[];return l=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),y("next"),y("throw"),y("return",d),l[Symbol.asyncIterator]=function(){return this},l;function d(K){return function(x){return Promise.resolve(x).then(K,L)}}function y(K,x){if(h[K]){if(l[K]=function(Y){return new Promise(function(E,we){u.push([K,Y,E,we])>1||p(K,Y)})},x)l[K]=x(l[K])}}function p(K,x){try{f(h[K](x))}catch(Y){A(u[0][3],Y)}}function f(K){K.value instanceof ri?Promise.resolve(K.value.v).then(k,L):A(u[0][2],K)}function k(K){p("next",K)}function L(K){p("throw",K)}function A(K,x){if(K(x),u.shift(),u.length)p(u[0][0],u[0][1])}},r4=function(i){var c,s;return c={},h("next"),h("throw",function(l){throw l}),h("return"),c[Symbol.iterator]=function(){return this},c;function h(l,u){c[l]=i[l]?function(d){return(s=!s)?{value:ri(i[l](d)),done:!1}:u?u(d):d}:u}},i4=function(i){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var c=i[Symbol.asyncIterator],s;return c?c.call(i):(i=typeof gu==="function"?gu(i):i[Symbol.iterator](),s={},h("next"),h("throw"),h("return"),s[Symbol.asyncIterator]=function(){return this},s);function h(u){s[u]=i[u]&&function(d){return new Promise(function(y,p){d=i[u](d),l(y,p,d.done,d.value)})}}function l(u,d,y,p){Promise.resolve(p).then(function(f){u({value:f,done:y})},d)}},a4=function(i,c){if(Object.defineProperty)Object.defineProperty(i,"raw",{value:c});else i.raw=c;return i};var n=Object.create?function(i,c){Object.defineProperty(i,"default",{enumerable:!0,value:c})}:function(i,c){i.default=c},r=function(i){return r=Object.getOwnPropertyNames||function(c){var s=[];for(var h in c)if(Object.prototype.hasOwnProperty.call(c,h))s[s.length]=h;return s},r(i)};c4=function(i){if(i&&i.__esModule)return i;var c={};if(i!=null){for(var s=r(i),h=0;h<s.length;h++)if(s[h]!=="default")du(c,i,s[h])}return n(c,i),c},s4=function(i){return i&&i.__esModule?i:{default:i}},h4=function(i,c,s,h){if(s==="a"&&!h)throw TypeError("Private accessor was defined without a getter");if(typeof c==="function"?i!==c||!h:!c.has(i))throw TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?h:s==="a"?h.call(i):h?h.value:c.get(i)},l4=function(i,c,s,h,l){if(h==="m")throw TypeError("Private method is not writable");if(h==="a"&&!l)throw TypeError("Private accessor was defined without a setter");if(typeof c==="function"?i!==c||!l:!c.has(i))throw TypeError("Cannot write private member to an object whose class did not declare it");return h==="a"?l.call(i,s):l?l.value=s:c.set(i,s),s},u4=function(i,c){if(c===null||typeof c!=="object"&&typeof c!=="function")throw TypeError("Cannot use 'in' operator on non-object");return typeof i==="function"?c===i:i.has(c)},g4=function(i,c,s){if(c!==null&&c!==void 0){if(typeof c!=="object"&&typeof c!=="function")throw TypeError("Object expected.");var h,l;if(s){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");h=c[Symbol.asyncDispose]}if(h===void 0){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");if(h=c[Symbol.dispose],s)l=h}if(typeof h!=="function")throw TypeError("Object not disposable.");if(l)h=function(){try{l.call(this)}catch(u){return Promise.reject(u)}};i.stack.push({value:c,dispose:h,async:s})}else if(s)i.stack.push({async:!0});return c};var o=typeof SuppressedError==="function"?SuppressedError:function(i,c,s){var h=Error(s);return h.name="SuppressedError",h.error=i,h.suppressed=c,h};d4=function(i){function c(u){i.error=i.hasError?new o(u,i.error,"An error was suppressed during disposal."):u,i.hasError=!0}var s,h=0;function l(){while(s=i.stack.pop())try{if(!s.async&&h===1)return h=0,i.stack.push(s),Promise.resolve().then(l);if(s.dispose){var u=s.dispose.call(s.value);if(s.async)return h|=2,Promise.resolve(u).then(l,function(d){return c(d),l()})}else h|=1}catch(d){c(d)}if(h===1)return i.hasError?Promise.reject(i.error):Promise.resolve();if(i.hasError)throw i.error}return l()},y4=function(i,c){if(typeof i==="string"&&/^\.\.?\//.test(i))return i.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(s,h,l,u,d){return h?c?".jsx":".js":l&&(!u||!d)?s:l+u+"."+d.toLowerCase()+"js"});return i},e("__extends",ER),e("__assign",qR),e("__rest",GR),e("__decorate",JR),e("__param",HR),e("__esDecorate",BR),e("__runInitializers",WR),e("__propKey",ZR),e("__setFunctionName",FR),e("__metadata",XR),e("__awaiter",YR),e("__generator",QR),e("__exportStar",VR),e("__createBinding",du),e("__values",gu),e("__read",LS),e("__spread",e4),e("__spreadArrays",t4),e("__spreadArray",n4),e("__await",ri),e("__asyncGenerator",o4),e("__asyncDelegator",r4),e("__asyncValues",i4),e("__makeTemplateObject",a4),e("__importStar",c4),e("__importDefault",s4),e("__classPrivateFieldGet",h4),e("__classPrivateFieldSet",l4),e("__classPrivateFieldIn",u4),e("__addDisposableResource",g4),e("__disposeResources",d4),e("__rewriteRelativeImportExtension",y4)})});var OS=G((b4)=>{Object.defineProperty(b4,"__esModule",{value:!0});b4.MAX_HASHABLE_LENGTH=b4.INIT=b4.KEY=b4.DIGEST_LENGTH=b4.BLOCK_SIZE=void 0;b4.BLOCK_SIZE=64;b4.DIGEST_LENGTH=32;b4.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);b4.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];b4.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1});var f4=G((p4)=>{Object.defineProperty(p4,"__esModule",{value:!0});p4.RawSha256=void 0;var Wt=OS(),$2=function(){function e(){this.state=Int32Array.from(Wt.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(t){if(this.finished)throw Error("Attempted to update an already finished hash.");var n=0,r=t.byteLength;if(this.bytesHashed+=r,this.bytesHashed*8>Wt.MAX_HASHABLE_LENGTH)throw Error("Cannot hash more than 2^53 - 1 bits");while(r>0)if(this.buffer[this.bufferLength++]=t[n++],r--,this.bufferLength===Wt.BLOCK_SIZE)this.hashBuffer(),this.bufferLength=0},e.prototype.digest=function(){if(!this.finished){var t=this.bytesHashed*8,n=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),r=this.bufferLength;if(n.setUint8(this.bufferLength++,128),r%Wt.BLOCK_SIZE>=Wt.BLOCK_SIZE-8){for(var o=this.bufferLength;o<Wt.BLOCK_SIZE;o++)n.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(var o=this.bufferLength;o<Wt.BLOCK_SIZE-8;o++)n.setUint8(o,0);n.setUint32(Wt.BLOCK_SIZE-8,Math.floor(t/4294967296),!0),n.setUint32(Wt.BLOCK_SIZE-4,t),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(Wt.DIGEST_LENGTH);for(var o=0;o<8;o++)i[o*4]=this.state[o]>>>24&255,i[o*4+1]=this.state[o]>>>16&255,i[o*4+2]=this.state[o]>>>8&255,i[o*4+3]=this.state[o]>>>0&255;return i},e.prototype.hashBuffer=function(){var t=this,n=t.buffer,r=t.state,o=r[0],i=r[1],c=r[2],s=r[3],h=r[4],l=r[5],u=r[6],d=r[7];for(var y=0;y<Wt.BLOCK_SIZE;y++){if(y<16)this.temp[y]=(n[y*4]&255)<<24|(n[y*4+1]&255)<<16|(n[y*4+2]&255)<<8|n[y*4+3]&255;else{var p=this.temp[y-2],f=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10;p=this.temp[y-15];var k=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3;this.temp[y]=(f+this.temp[y-7]|0)+(k+this.temp[y-16]|0)}var L=(((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&l^~h&u)|0)+(d+(Wt.KEY[y]+this.temp[y]|0)|0)|0,A=((o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+(o&i^o&c^i&c)|0;d=u,u=l,l=h,h=s+L|0,s=c,c=i,i=o,o=L+A|0}r[0]+=o,r[1]+=i,r[2]+=c,r[3]+=s,r[4]+=h,r[5]+=l,r[6]+=u,r[7]+=d},e}();p4.RawSha256=$2});var S4=G((L1e,v4)=>{var{defineProperty:bu,getOwnPropertyDescriptor:I2,getOwnPropertyNames:L2}=Object,T2=Object.prototype.hasOwnProperty,O2=(e,t)=>bu(e,"name",{value:t,configurable:!0}),A2=(e,t)=>{for(var n in t)bu(e,n,{get:t[n],enumerable:!0})},C2=(e,t,n,r)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let o of L2(t))if(!T2.call(e,o)&&o!==n)bu(e,o,{get:()=>t[o],enumerable:!(r=I2(t,o))||r.enumerable})}return e},D2=(e)=>C2(bu({},"__esModule",{value:!0}),e),k4={};A2(k4,{isArrayBuffer:()=>z2});v4.exports=D2(k4);var z2=O2((e)=>typeof ArrayBuffer==="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]","isArrayBuffer")});var L4=G((T1e,I4)=>{var{defineProperty:mu,getOwnPropertyDescriptor:_2,getOwnPropertyNames:j2}=Object,N2=Object.prototype.hasOwnProperty,P4=(e,t)=>mu(e,"name",{value:t,configurable:!0}),x2=(e,t)=>{for(var n in t)mu(e,n,{get:t[n],enumerable:!0})},R2=(e,t,n,r)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let o of j2(t))if(!N2.call(e,o)&&o!==n)mu(e,o,{get:()=>t[o],enumerable:!(r=_2(t,o))||r.enumerable})}return e},U2=(e)=>R2(mu({},"__esModule",{value:!0}),e),$4={};x2($4,{fromArrayBuffer:()=>K2,fromString:()=>E2});I4.exports=U2($4);var M2=S4(),AS=tT("buffer"),K2=P4((e,t=0,n=e.byteLength-t)=>{if(!(0,M2.isArrayBuffer)(e))throw TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return AS.Buffer.from(e,t,n)},"fromArrayBuffer"),E2=P4((e,t)=>{if(typeof e!=="string")throw TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?AS.Buffer.from(e,t):AS.Buffer.from(e)},"fromString")});var D4=G((O1e,C4)=>{var{defineProperty:pu,getOwnPropertyDescriptor:q2,getOwnPropertyNames:G2}=Object,J2=Object.prototype.hasOwnProperty,CS=(e,t)=>pu(e,"name",{value:t,configurable:!0}),H2=(e,t)=>{for(var n in t)pu(e,n,{get:t[n],enumerable:!0})},B2=(e,t,n,r)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let o of G2(t))if(!J2.call(e,o)&&o!==n)pu(e,o,{get:()=>t[o],enumerable:!(r=q2(t,o))||r.enumerable})}return e},W2=(e)=>B2(pu({},"__esModule",{value:!0}),e),T4={};H2(T4,{fromUtf8:()=>A4,toUint8Array:()=>Z2,toUtf8:()=>F2});C4.exports=W2(T4);var O4=L4(),A4=CS((e)=>{let t=(0,O4.fromString)(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),Z2=CS((e)=>{if(typeof e==="string")return A4(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(e)},"toUint8Array"),F2=CS((e)=>{if(typeof e==="string")return e;if(typeof e!=="object"||typeof e.byteOffset!=="number"||typeof e.byteLength!=="number")throw Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return(0,O4.fromArrayBuffer)(e.buffer,e.byteOffset,e.byteLength).toString("utf8")},"toUtf8")});var j4=G((z4)=>{Object.defineProperty(z4,"__esModule",{value:!0});z4.convertToBuffer=void 0;var X2=D4(),Y2=typeof Buffer<"u"&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:X2.fromUtf8;function Q2(e){if(e instanceof Uint8Array)return e;if(typeof e==="string")return Y2(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(e)}z4.convertToBuffer=Q2});var R4=G((N4)=>{Object.defineProperty(N4,"__esModule",{value:!0});N4.isEmptyData=void 0;function V2(e){if(typeof e==="string")return e.length===0;return e.byteLength===0}N4.isEmptyData=V2});var K4=G((U4)=>{Object.defineProperty(U4,"__esModule",{value:!0});U4.numToUint8=void 0;function eee(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}U4.numToUint8=eee});var G4=G((E4)=>{Object.defineProperty(E4,"__esModule",{value:!0});E4.uint32ArrayFrom=void 0;function tee(e){if(!Uint32Array.from){var t=new Uint32Array(e.length),n=0;while(n<e.length)t[n]=e[n],n+=1;return t}return Uint32Array.from(e)}E4.uint32ArrayFrom=tee});var J4=G((ii)=>{Object.defineProperty(ii,"__esModule",{value:!0});ii.uint32ArrayFrom=ii.numToUint8=ii.isEmptyData=ii.convertToBuffer=void 0;var nee=j4();Object.defineProperty(ii,"convertToBuffer",{enumerable:!0,get:function(){return nee.convertToBuffer}});var oee=R4();Object.defineProperty(ii,"isEmptyData",{enumerable:!0,get:function(){return oee.isEmptyData}});var ree=K4();Object.defineProperty(ii,"numToUint8",{enumerable:!0,get:function(){return ree.numToUint8}});var iee=G4();Object.defineProperty(ii,"uint32ArrayFrom",{enumerable:!0,get:function(){return iee.uint32ArrayFrom}})});var Z4=G((B4)=>{Object.defineProperty(B4,"__esModule",{value:!0});B4.Sha256=void 0;var H4=TS(),fu=OS(),wu=f4(),DS=J4(),cee=function(){function e(t){this.secret=t,this.hash=new wu.RawSha256,this.reset()}return e.prototype.update=function(t){if((0,DS.isEmptyData)(t)||this.error)return;try{this.hash.update((0,DS.convertToBuffer)(t))}catch(n){this.error=n}},e.prototype.digestSync=function(){if(this.error)throw this.error;if(this.outer){if(!this.outer.finished)this.outer.update(this.hash.digest());return this.outer.digest()}return this.hash.digest()},e.prototype.digest=function(){return H4.__awaiter(this,void 0,void 0,function(){return H4.__generator(this,function(t){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new wu.RawSha256,this.secret){this.outer=new wu.RawSha256;var t=see(this.secret),n=new Uint8Array(fu.BLOCK_SIZE);n.set(t);for(var r=0;r<fu.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(var r=0;r<t.byteLength;r++)t[r]=0}},e}();B4.Sha256=cee;function see(e){var t=(0,DS.convertToBuffer)(e);if(t.byteLength>fu.BLOCK_SIZE){var n=new wu.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(fu.BLOCK_SIZE);return r.set(t),r}});var F4=G((zS)=>{Object.defineProperty(zS,"__esModule",{value:!0});var hee=TS();hee.__exportStar(Z4(),zS)});var ku=()=>{};var X4="io.modelcontextprotocol/related-task",Su="2.0",He,Y4,Q4,K1e,lee,uee,_S,Nt,Pu,tt,Zt,Ft,nt,$u,gee,dee,V4,sc,eU,tU,E1e,jS,yee,NS,bee,hc,ai,nU,mee,pee,wee,fee,kee,vee,See,Pee,oU,$ee,xS,Iee,Lee,RS,Tee,lc,uc,Oee,gc,Iu,Aee,US,MS,KS,ES,q1e,qS,GS,JS,Cee,rU,iU,HS,aU,dc,ci,cU,Dee,zee,sU,_ee,hU,BS,jee,Nee,lU,uU,xee,Ree,Uee,Mee,Kee,Eee,qee,Gee,Jee,gU,Hee,Bee,WS,ZS,FS,Wee,Zee,Fee,XS,Xee,dU,yU,Yee,Qee,bU,Vee,mU,Lu,G1e,ete,tte,pU,nte,wU,ote,rte,ite,ate,cte,ste,hte,lte,ute,vu,gte,dte,fU,kU,vU,yte,bte,mte,pte,wte,fte,kte,vte,Ste,Pte,$te,Ite,Lte,Tte,Ote,SU,Ate,Cte,PU,Dte,zte,_te,jte,$U,Nte,xte,Rte,Ute,J1e,H1e,B1e,W1e,Z1e,F1e;var qo=g(()=>{fS();He=pl((e)=>e!==null&&(typeof e==="object"||typeof e==="function")),Y4=De([v(),me().int()]),Q4=v(),K1e=Ee({ttl:me().optional(),pollInterval:me().optional()}),lee=Z({ttl:me().optional()}),uee=Z({taskId:v()}),_S=Ee({progressToken:Y4.optional(),[X4]:uee.optional()}),Nt=Z({_meta:_S.optional()}),Pu=Nt.extend({task:lee.optional()}),tt=Z({method:v(),params:Nt.loose().optional()}),Zt=Z({_meta:_S.optional()}),Ft=Z({method:v(),params:Zt.loose().optional()}),nt=Ee({_meta:_S.optional()}),$u=De([v(),me().int()]),gee=Z({jsonrpc:V(Su),id:$u,...tt.shape}).strict(),dee=Z({jsonrpc:V(Su),...Ft.shape}).strict(),V4=Z({jsonrpc:V(Su),id:$u,result:nt}).strict();(function(e){e[e.ConnectionClosed=-32000]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(sc||(sc={}));eU=Z({jsonrpc:V(Su),id:$u.optional(),error:Z({code:me().int(),message:v(),data:Ce().optional()})}).strict(),tU=De([gee,dee,V4,eU]),E1e=De([V4,eU]),jS=nt.strict(),yee=Zt.extend({requestId:$u.optional(),reason:v().optional()}),NS=Ft.extend({method:V("notifications/cancelled"),params:yee}),bee=Z({src:v(),mimeType:v().optional(),sizes:B(v()).optional(),theme:et(["light","dark"]).optional()}),hc=Z({icons:B(bee).optional()}),ai=Z({name:v(),title:v().optional()}),nU=ai.extend({...ai.shape,...hc.shape,version:v(),websiteUrl:v().optional(),description:v().optional()}),mee=Er(Z({applyDefaults:Ie().optional()}),Te(v(),Ce())),pee=Va((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.keys(e).length===0)return{form:{}}}return e},Er(Z({form:mee.optional(),url:He.optional()}),Te(v(),Ce()).optional())),wee=Ee({list:He.optional(),cancel:He.optional(),requests:Ee({sampling:Ee({createMessage:He.optional()}).optional(),elicitation:Ee({create:He.optional()}).optional()}).optional()}),fee=Ee({list:He.optional(),cancel:He.optional(),requests:Ee({tools:Ee({call:He.optional()}).optional()}).optional()}),kee=Z({experimental:Te(v(),He).optional(),sampling:Z({context:He.optional(),tools:He.optional()}).optional(),elicitation:pee.optional(),roots:Z({listChanged:Ie().optional()}).optional(),tasks:wee.optional(),extensions:Te(v(),He).optional()}),vee=Nt.extend({protocolVersion:v(),capabilities:kee,clientInfo:nU}),See=tt.extend({method:V("initialize"),params:vee}),Pee=Z({experimental:Te(v(),He).optional(),logging:He.optional(),completions:He.optional(),prompts:Z({listChanged:Ie().optional()}).optional(),resources:Z({subscribe:Ie().optional(),listChanged:Ie().optional()}).optional(),tools:Z({listChanged:Ie().optional()}).optional(),tasks:fee.optional(),extensions:Te(v(),He).optional()}),oU=nt.extend({protocolVersion:v(),capabilities:Pee,serverInfo:nU,instructions:v().optional()}),$ee=Ft.extend({method:V("notifications/initialized"),params:Zt.optional()}),xS=tt.extend({method:V("ping"),params:Nt.optional()}),Iee=Z({progress:me(),total:je(me()),message:je(v())}),Lee=Z({...Zt.shape,...Iee.shape,progressToken:Y4}),RS=Ft.extend({method:V("notifications/progress"),params:Lee}),Tee=Nt.extend({cursor:Q4.optional()}),lc=tt.extend({params:Tee.optional()}),uc=nt.extend({nextCursor:Q4.optional()}),Oee=et(["working","input_required","completed","failed","cancelled"]),gc=Z({taskId:v(),status:Oee,ttl:De([me(),Ba()]),createdAt:v(),lastUpdatedAt:v(),pollInterval:je(me()),statusMessage:je(v())}),Iu=nt.extend({task:gc}),Aee=Zt.merge(gc),US=Ft.extend({method:V("notifications/tasks/status"),params:Aee}),MS=tt.extend({method:V("tasks/get"),params:Nt.extend({taskId:v()})}),KS=nt.merge(gc),ES=tt.extend({method:V("tasks/result"),params:Nt.extend({taskId:v()})}),q1e=nt.loose(),qS=lc.extend({method:V("tasks/list")}),GS=uc.extend({tasks:B(gc)}),JS=tt.extend({method:V("tasks/cancel"),params:Nt.extend({taskId:v()})}),Cee=nt.merge(gc),rU=Z({uri:v(),mimeType:je(v()),_meta:Te(v(),Ce()).optional()}),iU=rU.extend({text:v()}),HS=v().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),aU=rU.extend({blob:HS}),dc=et(["user","assistant"]),ci=Z({audience:B(dc).optional(),priority:me().min(0).max(1).optional(),lastModified:ho.datetime({offset:!0}).optional()}),cU=Z({...ai.shape,...hc.shape,uri:v(),description:je(v()),mimeType:je(v()),size:je(me()),annotations:ci.optional(),_meta:je(Ee({}))}),Dee=Z({...ai.shape,...hc.shape,uriTemplate:v(),description:je(v()),mimeType:je(v()),annotations:ci.optional(),_meta:je(Ee({}))}),zee=lc.extend({method:V("resources/list")}),sU=uc.extend({resources:B(cU)}),_ee=lc.extend({method:V("resources/templates/list")}),hU=uc.extend({resourceTemplates:B(Dee)}),BS=Nt.extend({uri:v()}),jee=BS,Nee=tt.extend({method:V("resources/read"),params:jee}),lU=nt.extend({contents:B(De([iU,aU]))}),uU=Ft.extend({method:V("notifications/resources/list_changed"),params:Zt.optional()}),xee=BS,Ree=tt.extend({method:V("resources/subscribe"),params:xee}),Uee=BS,Mee=tt.extend({method:V("resources/unsubscribe"),params:Uee}),Kee=Zt.extend({uri:v()}),Eee=Ft.extend({method:V("notifications/resources/updated"),params:Kee}),qee=Z({name:v(),description:je(v()),required:je(Ie())}),Gee=Z({...ai.shape,...hc.shape,description:je(v()),arguments:je(B(qee)),_meta:je(Ee({}))}),Jee=lc.extend({method:V("prompts/list")}),gU=uc.extend({prompts:B(Gee)}),Hee=Nt.extend({name:v(),arguments:Te(v(),v()).optional()}),Bee=tt.extend({method:V("prompts/get"),params:Hee}),WS=Z({type:V("text"),text:v(),annotations:ci.optional(),_meta:Te(v(),Ce()).optional()}),ZS=Z({type:V("image"),data:HS,mimeType:v(),annotations:ci.optional(),_meta:Te(v(),Ce()).optional()}),FS=Z({type:V("audio"),data:HS,mimeType:v(),annotations:ci.optional(),_meta:Te(v(),Ce()).optional()}),Wee=Z({type:V("tool_use"),name:v(),id:v(),input:Te(v(),Ce()),_meta:Te(v(),Ce()).optional()}),Zee=Z({type:V("resource"),resource:De([iU,aU]),annotations:ci.optional(),_meta:Te(v(),Ce()).optional()}),Fee=cU.extend({type:V("resource_link")}),XS=De([WS,ZS,FS,Fee,Zee]),Xee=Z({role:dc,content:XS}),dU=nt.extend({description:v().optional(),messages:B(Xee)}),yU=Ft.extend({method:V("notifications/prompts/list_changed"),params:Zt.optional()}),Yee=Z({title:v().optional(),readOnlyHint:Ie().optional(),destructiveHint:Ie().optional(),idempotentHint:Ie().optional(),openWorldHint:Ie().optional()}),Qee=Z({taskSupport:et(["required","optional","forbidden"]).optional()}),bU=Z({...ai.shape,...hc.shape,description:v().optional(),inputSchema:Z({type:V("object"),properties:Te(v(),He).optional(),required:B(v()).optional()}).catchall(Ce()),outputSchema:Z({type:V("object"),properties:Te(v(),He).optional(),required:B(v()).optional()}).catchall(Ce()).optional(),annotations:Yee.optional(),execution:Qee.optional(),_meta:Te(v(),Ce()).optional()}),Vee=lc.extend({method:V("tools/list")}),mU=uc.extend({tools:B(bU)}),Lu=nt.extend({content:B(XS).default([]),structuredContent:Te(v(),Ce()).optional(),isError:Ie().optional()}),G1e=Lu.or(nt.extend({toolResult:Ce()})),ete=Pu.extend({name:v(),arguments:Te(v(),Ce()).optional()}),tte=tt.extend({method:V("tools/call"),params:ete}),pU=Ft.extend({method:V("notifications/tools/list_changed"),params:Zt.optional()}),nte=Z({autoRefresh:Ie().default(!0),debounceMs:me().int().nonnegative().default(300)}),wU=et(["debug","info","notice","warning","error","critical","alert","emergency"]),ote=Nt.extend({level:wU}),rte=tt.extend({method:V("logging/setLevel"),params:ote}),ite=Zt.extend({level:wU,logger:v().optional(),data:Ce()}),ate=Ft.extend({method:V("notifications/message"),params:ite}),cte=Z({name:v().optional()}),ste=Z({hints:B(cte).optional(),costPriority:me().min(0).max(1).optional(),speedPriority:me().min(0).max(1).optional(),intelligencePriority:me().min(0).max(1).optional()}),hte=Z({mode:et(["auto","required","none"]).optional()}),lte=Z({type:V("tool_result"),toolUseId:v().describe("The unique identifier for the corresponding tool call."),content:B(XS).default([]),structuredContent:Z({}).loose().optional(),isError:Ie().optional(),_meta:Te(v(),Ce()).optional()}),ute=Xa("type",[WS,ZS,FS]),vu=Xa("type",[WS,ZS,FS,Wee,lte]),gte=Z({role:dc,content:De([vu,B(vu)]),_meta:Te(v(),Ce()).optional()}),dte=Pu.extend({messages:B(gte),modelPreferences:ste.optional(),systemPrompt:v().optional(),includeContext:et(["none","thisServer","allServers"]).optional(),temperature:me().optional(),maxTokens:me().int(),stopSequences:B(v()).optional(),metadata:He.optional(),tools:B(bU).optional(),toolChoice:hte.optional()}),fU=tt.extend({method:V("sampling/createMessage"),params:dte}),kU=nt.extend({model:v(),stopReason:je(et(["endTurn","stopSequence","maxTokens"]).or(v())),role:dc,content:ute}),vU=nt.extend({model:v(),stopReason:je(et(["endTurn","stopSequence","maxTokens","toolUse"]).or(v())),role:dc,content:De([vu,B(vu)])}),yte=Z({type:V("boolean"),title:v().optional(),description:v().optional(),default:Ie().optional()}),bte=Z({type:V("string"),title:v().optional(),description:v().optional(),minLength:me().optional(),maxLength:me().optional(),format:et(["email","uri","date","date-time"]).optional(),default:v().optional()}),mte=Z({type:et(["number","integer"]),title:v().optional(),description:v().optional(),minimum:me().optional(),maximum:me().optional(),default:me().optional()}),pte=Z({type:V("string"),title:v().optional(),description:v().optional(),enum:B(v()),default:v().optional()}),wte=Z({type:V("string"),title:v().optional(),description:v().optional(),oneOf:B(Z({const:v(),title:v()})),default:v().optional()}),fte=Z({type:V("string"),title:v().optional(),description:v().optional(),enum:B(v()),enumNames:B(v()).optional(),default:v().optional()}),kte=De([pte,wte]),vte=Z({type:V("array"),title:v().optional(),description:v().optional(),minItems:me().optional(),maxItems:me().optional(),items:Z({type:V("string"),enum:B(v())}),default:B(v()).optional()}),Ste=Z({type:V("array"),title:v().optional(),description:v().optional(),minItems:me().optional(),maxItems:me().optional(),items:Z({anyOf:B(Z({const:v(),title:v()}))}),default:B(v()).optional()}),Pte=De([vte,Ste]),$te=De([fte,kte,Pte]),Ite=De([$te,yte,bte,mte]),Lte=Pu.extend({mode:V("form").optional(),message:v(),requestedSchema:Z({type:V("object"),properties:Te(v(),Ite),required:B(v()).optional()})}),Tte=Pu.extend({mode:V("url"),message:v(),elicitationId:v(),url:v().url()}),Ote=De([Lte,Tte]),SU=tt.extend({method:V("elicitation/create"),params:Ote}),Ate=Zt.extend({elicitationId:v()}),Cte=Ft.extend({method:V("notifications/elicitation/complete"),params:Ate}),PU=nt.extend({action:et(["accept","decline","cancel"]),content:Va((e)=>e===null?void 0:e,Te(v(),De([v(),me(),Ie(),B(v())])).optional())}),Dte=Z({type:V("ref/resource"),uri:v()}),zte=Z({type:V("ref/prompt"),name:v()}),_te=Nt.extend({ref:De([zte,Dte]),argument:Z({name:v(),value:v()}),context:Z({arguments:Te(v(),v()).optional()}).optional()}),jte=tt.extend({method:V("completion/complete"),params:_te}),$U=nt.extend({completion:Ee({values:B(v()).max(100),total:je(me().int()),hasMore:je(Ie())})}),Nte=Z({uri:v().startsWith("file://"),name:v().optional(),_meta:Te(v(),Ce()).optional()}),xte=tt.extend({method:V("roots/list"),params:Nt.optional()}),Rte=nt.extend({roots:B(Nte)}),Ute=Ft.extend({method:V("notifications/roots/list_changed"),params:Zt.optional()}),J1e=De([xS,See,jte,rte,Bee,Jee,zee,_ee,Nee,Ree,Mee,tte,Vee,MS,ES,qS,JS]),H1e=De([NS,RS,$ee,Ute,US]),B1e=De([jS,kU,vU,PU,Rte,KS,GS,Iu]),W1e=De([xS,fU,SU,xte,MS,ES,qS,JS]),Z1e=De([NS,RS,ate,Eee,uU,pU,yU,US,Cte]),F1e=De([jS,oU,$U,dU,gU,sU,hU,lU,Lu,mU,KS,GS,Iu])});var Mte;var Tu=g(()=>{Mte=Symbol("Let zodToJsonSchema decide on which parser to use")});var YS=g(()=>{Tu()});var Xt=()=>{};var QS=g(()=>{Ge()});var VS=()=>{};var Ou=g(()=>{Ge()});var eP=g(()=>{Ge()});var tP=()=>{};var nP=g(()=>{Ge()});var oP=g(()=>{Ge();Xt()});var rP=g(()=>{Ge()});var Oxe;var Au=g(()=>{Oxe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});var Cu=g(()=>{Ge();Au();Ou();Xt()});var iP=g(()=>{Ge();Cu();Xt()});var aP=g(()=>{Xt()});var Du=g(()=>{Ge()});var cP=g(()=>{Ge();Du()});var sP=()=>{};var hP=g(()=>{Ge()});var lP=g(()=>{Ge();Xt()});var uP=g(()=>{Ge()});var gP=g(()=>{Ge()});var dP=g(()=>{Ge()});var yP=g(()=>{Ge()});var bP=g(()=>{Xt()});var mP=g(()=>{Xt()});var pP=g(()=>{Ge()});var wP=g(()=>{Xt();QS();VS();Ou();eP();tP();nP();oP();rP();iP();aP();cP();sP();hP();lP();uP();gP();Cu();dP();Au();yP();bP();Du();mP();pP()});var Ge=g(()=>{Tu();wP();Xt()});var IU=()=>{};var fP=g(()=>{Ge();YS();Xt()});var LU=g(()=>{fP();Tu();YS();Ge();IU();Xt();QS();VS();Ou();eP();tP();nP();oP();rP();iP();aP();cP();sP();hP();lP();uP();gP();pP();Cu();dP();Au();yP();bP();Du();mP();wP();fP()});var OU=g(()=>{ku();LU()});var CU=g(()=>{ku();qo();OU()});var mc=G((_U)=>{Object.defineProperty(_U,"__esModule",{value:!0});_U.regexpCode=_U.getEsmExportName=_U.getProperty=_U.safeStringify=_U.stringify=_U.strConcat=_U.addCodeArg=_U.str=_U._=_U.nil=_U._Code=_U.Name=_U.IDENTIFIER=_U._CodeOrName=void 0;class zu{}_U._CodeOrName=zu;_U.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class si extends zu{constructor(e){super();if(!_U.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}_U.Name=si;class cn extends zu{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,n)=>`${t}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,n)=>{if(n instanceof si)t[n.str]=(t[n.str]||0)+1;return t},{})}}_U._Code=cn;_U.nil=new cn("");function DU(e,...t){let n=[e[0]],r=0;while(r<t.length)vP(n,t[r]),n.push(e[++r]);return new cn(n)}_U._=DU;var kP=new cn("+");function zU(e,...t){let n=[bc(e[0])],r=0;while(r<t.length)n.push(kP),vP(n,t[r]),n.push(kP,bc(e[++r]));return Fte(n),new cn(n)}_U.str=zU;function vP(e,t){if(t instanceof cn)e.push(...t._items);else if(t instanceof si)e.push(t);else e.push(Qte(t))}_U.addCodeArg=vP;function Fte(e){let t=1;while(t<e.length-1){if(e[t]===kP){let n=Xte(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}function Xte(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof si||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof si))return`"${e}${t.slice(1)}`;return}function Yte(e,t){return t.emptyStr()?e:e.emptyStr()?t:zU`${e}${t}`}_U.strConcat=Yte;function Qte(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:bc(Array.isArray(e)?e.join(","):e)}function Vte(e){return new cn(bc(e))}_U.stringify=Vte;function bc(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}_U.safeStringify=bc;function ene(e){return typeof e=="string"&&_U.IDENTIFIER.test(e)?new cn(`.${e}`):DU`[${e}]`}_U.getProperty=ene;function tne(e){if(typeof e=="string"&&_U.IDENTIFIER.test(e))return new cn(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}_U.getEsmExportName=tne;function nne(e){return new cn(e.toString())}_U.regexpCode=nne});var IP=G((RU)=>{Object.defineProperty(RU,"__esModule",{value:!0});RU.ValueScope=RU.ValueScopeName=RU.Scope=RU.varKinds=RU.UsedValueState=void 0;var It=mc();class NU extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var ju;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(ju||(RU.UsedValueState=ju={}));RU.varKinds={const:new It.Name("const"),let:new It.Name("let"),var:new It.Name("var")};class PP{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof It.Name?e:this.name(e)}name(e){return new It.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,n;if(((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}RU.Scope=PP;class $P extends It.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=It._`.${new It.Name(t)}[${n}]`}}RU.ValueScopeName=$P;var bne=It._`\n`;class xU extends PP{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?bne:It.nil}}get(){return this._scope}name(e){return new $P(e,this._newName(e))}value(e,t){var n;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let r=this.toName(e),{prefix:o}=r,i=(n=t.key)!==null&&n!==void 0?n:t.ref,c=this._values[o];if(c){let l=c.get(i);if(l)return l}else c=this._values[o]=new Map;c.set(i,r);let s=this._scope[o]||(this._scope[o]=[]),h=s.length;return s[h]=t.ref,r.setValue(t,{property:o,itemIndex:h}),r}getValue(e,t){let n=this._values[e];if(!n)return;return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(n)=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return It._`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,(r)=>{if(r.value===void 0)throw Error(`CodeGen: name "${r}" has no value`);return r.value.code},t,n)}_reduceValues(e,t,n={},r){let o=It.nil;for(let i in e){let c=e[i];if(!c)continue;let s=n[i]=n[i]||new Map;c.forEach((h)=>{if(s.has(h))return;s.set(h,ju.Started);let l=t(h);if(l){let u=this.opts.es5?RU.varKinds.var:RU.varKinds.const;o=It._`${o}${u} ${h} = ${l};${this.opts._n}`}else if(l=r===null||r===void 0?void 0:r(h))o=It._`${o}${l}${this.opts._n}`;else throw new NU(h);s.set(h,ju.Completed)})}return o}}RU.ValueScope=xU});var ye=G((Lt)=>{Object.defineProperty(Lt,"__esModule",{value:!0});Lt.or=Lt.and=Lt.not=Lt.CodeGen=Lt.operators=Lt.varKinds=Lt.ValueScopeName=Lt.ValueScope=Lt.Scope=Lt.Name=Lt.regexpCode=Lt.stringify=Lt.getProperty=Lt.nil=Lt.strConcat=Lt.str=Lt._=void 0;var pe=mc(),sn=IP(),uo=mc();Object.defineProperty(Lt,"_",{enumerable:!0,get:function(){return uo._}});Object.defineProperty(Lt,"str",{enumerable:!0,get:function(){return uo.str}});Object.defineProperty(Lt,"strConcat",{enumerable:!0,get:function(){return uo.strConcat}});Object.defineProperty(Lt,"nil",{enumerable:!0,get:function(){return uo.nil}});Object.defineProperty(Lt,"getProperty",{enumerable:!0,get:function(){return uo.getProperty}});Object.defineProperty(Lt,"stringify",{enumerable:!0,get:function(){return uo.stringify}});Object.defineProperty(Lt,"regexpCode",{enumerable:!0,get:function(){return uo.regexpCode}});Object.defineProperty(Lt,"Name",{enumerable:!0,get:function(){return uo.Name}});var Ku=IP();Object.defineProperty(Lt,"Scope",{enumerable:!0,get:function(){return Ku.Scope}});Object.defineProperty(Lt,"ValueScope",{enumerable:!0,get:function(){return Ku.ValueScope}});Object.defineProperty(Lt,"ValueScopeName",{enumerable:!0,get:function(){return Ku.ValueScopeName}});Object.defineProperty(Lt,"varKinds",{enumerable:!0,get:function(){return Ku.varKinds}});Lt.operators={GT:new pe._Code(">"),GTE:new pe._Code(">="),LT:new pe._Code("<"),LTE:new pe._Code("<="),EQ:new pe._Code("==="),NEQ:new pe._Code("!=="),NOT:new pe._Code("!"),OR:new pe._Code("||"),AND:new pe._Code("&&"),ADD:new pe._Code("+")};class go{optimizeNodes(){return this}optimizeNames(e,t){return this}}class MU extends go{constructor(e,t,n){super();this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?sn.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=li(this.rhs,e,t);return this}get names(){return this.rhs instanceof pe._CodeOrName?this.rhs.names:{}}}class OP extends go{constructor(e,t,n){super();this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof pe.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=li(this.rhs,e,t),this}get names(){let e=this.lhs instanceof pe.Name?{}:{...this.lhs.names};return Mu(e,this.rhs)}}class KU extends OP{constructor(e,t,n,r){super(e,n,r);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class EU extends go{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class qU extends go{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class GU extends go{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class JU extends go{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=li(this.code,e,t),this}get names(){return this.code instanceof pe._CodeOrName?this.code.names:{}}}class Eu extends go{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let n=e[t].optimizeNodes();if(Array.isArray(n))e.splice(t,1,...n);else if(n)e[t]=n;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;while(r--){let o=n[r];if(o.optimizeNames(e,t))continue;fne(e,o.names),n.splice(r,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Go(e,t.names),{})}}class yo extends Eu{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class HU extends Eu{}class pc extends yo{}pc.kind="else";class Un extends yo{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let n=t.optimizeNodes();t=this.else=Array.isArray(n)?new pc(n):n}if(t){if(e===!1)return t instanceof Un?t:t.nodes;if(this.nodes.length)return this;return new Un(XU(e),t instanceof Un?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=li(this.condition,e,t),this}get names(){let e=super.names;if(Mu(e,this.condition),this.else)Go(e,this.else.names);return e}}Un.kind="if";class hi extends yo{}hi.kind="for";class BU extends hi{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=li(this.iteration,e,t),this}get names(){return Go(super.names,this.iteration.names)}}class WU extends hi{constructor(e,t,n,r){super();this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?sn.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=Mu(super.names,this.from);return Mu(e,this.to)}}class LP extends hi{constructor(e,t,n,r){super();this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=li(this.iterable,e,t),this}get names(){return Go(super.names,this.iterable.names)}}class Nu extends yo{constructor(e,t,n){super();this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}Nu.kind="func";class xu extends Eu{render(e){return"return "+super.render(e)}}xu.kind="return";class ZU extends yo{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)===null||n===void 0||n.optimizeNames(e,t),(r=this.finally)===null||r===void 0||r.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)Go(e,this.catch.names);if(this.finally)Go(e,this.finally.names);return e}}class Ru extends yo{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Ru.kind="catch";class Uu extends yo{render(e){return"finally"+super.render(e)}}Uu.kind="finally";class FU{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
7475
7475
  `:""},this._extScope=e,this._scope=new sn.Scope({parent:e}),this._nodes=[new HU]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let o=this._scope.toName(t);if(n!==void 0&&r)this._constants[o.str]=n;return this._leafNode(new MU(e,o,n)),o}const(e,t,n){return this._def(sn.varKinds.const,e,t,n)}let(e,t,n){return this._def(sn.varKinds.let,e,t,n)}var(e,t,n){return this._def(sn.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new OP(e,t,n))}add(e,t){return this._leafNode(new KU(e,Lt.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==pe.nil)this._leafNode(new JU(e));return this}object(...e){let t=["{"];for(let[n,r]of e){if(t.length>1)t.push(",");if(t.push(n),n!==r||this.opts.es5)t.push(":"),(0,pe.addCodeArg)(t,r)}return t.push("}"),new pe._Code(t)}if(e,t,n){if(this._blockNode(new Un(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Un(e))}else(){return this._elseNode(new pc)}endIf(){return this._endBlockNode(Un,pc)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new BU(e),t)}forRange(e,t,n,r,o=this.opts.es5?sn.varKinds.var:sn.varKinds.let){let i=this._scope.toName(e);return this._for(new WU(o,i,t,n),()=>r(i))}forOf(e,t,n,r=sn.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let i=t instanceof pe.Name?t:this.var("_arr",t);return this.forRange("_i",0,pe._`${i}.length`,(c)=>{this.var(o,pe._`${i}[${c}]`),n(o)})}return this._for(new LP("of",r,o,t),()=>n(o))}forIn(e,t,n,r=this.opts.es5?sn.varKinds.var:sn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,pe._`Object.keys(${t})`,n);let o=this._scope.toName(e);return this._for(new LP("in",r,o,t),()=>n(o))}endFor(){return this._endBlockNode(hi)}label(e){return this._leafNode(new EU(e))}break(e){return this._leafNode(new qU(e))}return(e){let t=new xu;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(xu)}try(e,t,n){if(!t&&!n)throw Error('CodeGen: "try" without "catch" and "finally"');let r=new ZU;if(this._blockNode(r),this.code(e),t){let o=this.name("e");this._currNode=r.catch=new Ru(o),t(o)}if(n)this._currNode=r.finally=new Uu,this.code(n);return this._endBlockNode(Ru,Uu)}throw(e){return this._leafNode(new GU(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=pe.nil,n,r){if(this._blockNode(new Nu(e,t,n)),r)this.code(r).endFunc();return this}endFunc(){return this._endBlockNode(Nu)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof Un))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}Lt.CodeGen=FU;function Go(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function Mu(e,t){return t instanceof pe._CodeOrName?Go(e,t.names):e}function li(e,t,n){if(e instanceof pe.Name)return r(e);if(!o(e))return e;return new pe._Code(e._items.reduce((i,c)=>{if(c instanceof pe.Name)c=r(c);if(c instanceof pe._Code)i.push(...c._items);else i.push(c);return i},[]));function r(i){let c=n[i.str];if(c===void 0||t[i.str]!==1)return i;return delete t[i.str],c}function o(i){return i instanceof pe._Code&&i._items.some((c)=>c instanceof pe.Name&&t[c.str]===1&&n[c.str]!==void 0)}}function fne(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function XU(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:pe._`!${TP(e)}`}Lt.not=XU;var kne=YU(Lt.operators.AND);function vne(...e){return e.reduce(kne)}Lt.and=vne;var Sne=YU(Lt.operators.OR);function Pne(...e){return e.reduce(Sne)}Lt.or=Pne;function YU(e){return(t,n)=>t===pe.nil?n:n===pe.nil?t:pe._`${TP(t)} ${e} ${TP(n)}`}function TP(e){return e instanceof pe.Name?e:pe._`(${e})`}});var ke=G((a0)=>{Object.defineProperty(a0,"__esModule",{value:!0});a0.checkStrictMode=a0.getErrorPath=a0.Type=a0.useFunc=a0.setEvaluated=a0.evaluatedPropsToName=a0.mergeEvaluated=a0.eachItem=a0.unescapeJsonPointer=a0.escapeJsonPointer=a0.escapeFragment=a0.unescapeFragment=a0.schemaRefOrVal=a0.schemaHasRulesButRef=a0.schemaHasRules=a0.checkUnknownRules=a0.alwaysValidSchema=a0.toHash=void 0;var Ne=ye(),Tne=mc();function One(e){let t={};for(let n of e)t[n]=!0;return t}a0.toHash=One;function Ane(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return t0(e,t),!n0(t,e.self.RULES.all)}a0.alwaysValidSchema=Ane;function t0(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema)return;if(typeof t==="boolean")return;let o=r.RULES.keywords;for(let i in t)if(!o[i])i0(e,`unknown keyword: "${i}"`)}a0.checkUnknownRules=t0;function n0(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(t[n])return!0;return!1}a0.schemaHasRules=n0;function Cne(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}a0.schemaHasRulesButRef=Cne;function Dne({topSchemaRef:e,schemaPath:t},n,r,o){if(!o){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return Ne._`${n}`}return Ne._`${e}${t}${(0,Ne.getProperty)(r)}`}a0.schemaRefOrVal=Dne;function zne(e){return o0(decodeURIComponent(e))}a0.unescapeFragment=zne;function _ne(e){return encodeURIComponent(CP(e))}a0.escapeFragment=_ne;function CP(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}a0.escapeJsonPointer=CP;function o0(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}a0.unescapeJsonPointer=o0;function jne(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}a0.eachItem=jne;function VU({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(o,i,c,s)=>{let h=c===void 0?i:c instanceof Ne.Name?(i instanceof Ne.Name?e(o,i,c):t(o,i,c),c):i instanceof Ne.Name?(t(o,c,i),i):n(i,c);return s===Ne.Name&&!(h instanceof Ne.Name)?r(o,h):h}}a0.mergeEvaluated={props:VU({mergeNames:(e,t,n)=>e.if(Ne._`${n} !== true && ${t} !== undefined`,()=>{e.if(Ne._`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,Ne._`${n} || {}`).code(Ne._`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if(Ne._`${n} !== true`,()=>{if(t===!0)e.assign(n,!0);else e.assign(n,Ne._`${n} || {}`),DP(e,n,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:r0}),items:VU({mergeNames:(e,t,n)=>e.if(Ne._`${n} !== true && ${t} !== undefined`,()=>e.assign(n,Ne._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if(Ne._`${n} !== true`,()=>e.assign(n,t===!0?!0:Ne._`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function r0(e,t){if(t===!0)return e.var("props",!0);let n=e.var("props",Ne._`{}`);if(t!==void 0)DP(e,n,t);return n}a0.evaluatedPropsToName=r0;function DP(e,t,n){Object.keys(n).forEach((r)=>e.assign(Ne._`${t}${(0,Ne.getProperty)(r)}`,!0))}a0.setEvaluated=DP;var e0={};function Nne(e,t){return e.scopeValue("func",{ref:t,code:e0[t.code]||(e0[t.code]=new Tne._Code(t.code))})}a0.useFunc=Nne;var AP;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(AP||(a0.Type=AP={}));function xne(e,t,n){if(e instanceof Ne.Name){let r=t===AP.Num;return n?r?Ne._`"[" + ${e} + "]"`:Ne._`"['" + ${e} + "']"`:r?Ne._`"/" + ${e}`:Ne._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,Ne.getProperty)(e).toString():"/"+CP(e)}a0.getErrorPath=xne;function i0(e,t,n=e.opts.strictSchema){if(!n)return;if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}a0.checkStrictMode=i0});var Mn=G((s0)=>{Object.defineProperty(s0,"__esModule",{value:!0});var dt=ye(),eoe={data:new dt.Name("data"),valCxt:new dt.Name("valCxt"),instancePath:new dt.Name("instancePath"),parentData:new dt.Name("parentData"),parentDataProperty:new dt.Name("parentDataProperty"),rootData:new dt.Name("rootData"),dynamicAnchors:new dt.Name("dynamicAnchors"),vErrors:new dt.Name("vErrors"),errors:new dt.Name("errors"),this:new dt.Name("this"),self:new dt.Name("self"),scope:new dt.Name("scope"),json:new dt.Name("json"),jsonPos:new dt.Name("jsonPos"),jsonLen:new dt.Name("jsonLen"),jsonPart:new dt.Name("jsonPart")};s0.default=eoe});var wc=G((g0)=>{Object.defineProperty(g0,"__esModule",{value:!0});g0.extendErrors=g0.resetErrorsCount=g0.reportExtraError=g0.reportError=g0.keyword$DataError=g0.keywordError=void 0;var ve=ye(),Gu=ke(),wt=Mn();g0.keywordError={message:({keyword:e})=>ve.str`must pass "${e}" keyword validation`};g0.keyword$DataError={message:({keyword:e,schemaType:t})=>t?ve.str`"${e}" keyword must be ${t} ($data)`:ve.str`"${e}" keyword is invalid ($data)`};function noe(e,t=g0.keywordError,n,r){let{it:o}=e,{gen:i,compositeRule:c,allErrors:s}=o,h=u0(e,t,n);if(r!==null&&r!==void 0?r:c||s)h0(i,h);else l0(o,ve._`[${h}]`)}g0.reportError=noe;function ooe(e,t=g0.keywordError,n){let{it:r}=e,{gen:o,compositeRule:i,allErrors:c}=r,s=u0(e,t,n);if(h0(o,s),!(i||c))l0(r,wt.default.vErrors)}g0.reportExtraError=ooe;function roe(e,t){e.assign(wt.default.errors,t),e.if(ve._`${wt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(ve._`${wt.default.vErrors}.length`,t),()=>e.assign(wt.default.vErrors,null)))}g0.resetErrorsCount=roe;function ioe({gen:e,keyword:t,schemaValue:n,data:r,errsCount:o,it:i}){if(o===void 0)throw Error("ajv implementation error");let c=e.name("err");e.forRange("i",o,wt.default.errors,(s)=>{if(e.const(c,ve._`${wt.default.vErrors}[${s}]`),e.if(ve._`${c}.instancePath === undefined`,()=>e.assign(ve._`${c}.instancePath`,(0,ve.strConcat)(wt.default.instancePath,i.errorPath))),e.assign(ve._`${c}.schemaPath`,ve.str`${i.errSchemaPath}/${t}`),i.opts.verbose)e.assign(ve._`${c}.schema`,n),e.assign(ve._`${c}.data`,r)})}g0.extendErrors=ioe;function h0(e,t){let n=e.const("err",t);e.if(ve._`${wt.default.vErrors} === null`,()=>e.assign(wt.default.vErrors,ve._`[${n}]`),ve._`${wt.default.vErrors}.push(${n})`),e.code(ve._`${wt.default.errors}++`)}function l0(e,t){let{gen:n,validateName:r,schemaEnv:o}=e;if(o.$async)n.throw(ve._`new ${e.ValidationError}(${t})`);else n.assign(ve._`${r}.errors`,t),n.return(!1)}var Jo={keyword:new ve.Name("keyword"),schemaPath:new ve.Name("schemaPath"),params:new ve.Name("params"),propertyName:new ve.Name("propertyName"),message:new ve.Name("message"),schema:new ve.Name("schema"),parentSchema:new ve.Name("parentSchema")};function u0(e,t,n){let{createErrors:r}=e.it;if(r===!1)return ve._`{}`;return aoe(e,t,n)}function aoe(e,t,n={}){let{gen:r,it:o}=e,i=[coe(o,n),soe(e,n)];return hoe(e,t,i),r.object(...i)}function coe({errorPath:e},{instancePath:t}){let n=t?ve.str`${e}${(0,Gu.getErrorPath)(t,Gu.Type.Str)}`:e;return[wt.default.instancePath,(0,ve.strConcat)(wt.default.instancePath,n)]}function soe({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:r}){let o=r?t:ve.str`${t}/${e}`;if(n)o=ve.str`${o}${(0,Gu.getErrorPath)(n,Gu.Type.Str)}`;return[Jo.schemaPath,o]}function hoe(e,{params:t,message:n},r){let{keyword:o,data:i,schemaValue:c,it:s}=e,{opts:h,propertyName:l,topSchemaRef:u,schemaPath:d}=s;if(r.push([Jo.keyword,o],[Jo.params,typeof t=="function"?t(e):t||ve._`{}`]),h.messages)r.push([Jo.message,typeof n=="function"?n(e):n]);if(h.verbose)r.push([Jo.schema,c],[Jo.parentSchema,ve._`${u}${d}`],[wt.default.data,i]);if(l)r.push([Jo.propertyName,l])}});var p0=G((b0)=>{Object.defineProperty(b0,"__esModule",{value:!0});b0.boolOrEmptySchema=b0.topBoolOrEmptySchema=void 0;var yoe=wc(),boe=ye(),moe=Mn(),poe={message:"boolean schema is false"};function woe(e){let{gen:t,schema:n,validateName:r}=e;if(n===!1)y0(e,!1);else if(typeof n=="object"&&n.$async===!0)t.return(moe.default.data);else t.assign(boe._`${r}.errors`,null),t.return(!0)}b0.topBoolOrEmptySchema=woe;function foe(e,t){let{gen:n,schema:r}=e;if(r===!1)n.var(t,!1),y0(e);else n.var(t,!0)}b0.boolOrEmptySchema=foe;function y0(e,t){let{gen:n,data:r}=e,o={gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,yoe.reportError)(o,poe,void 0,t)}});var _P=G((w0)=>{Object.defineProperty(w0,"__esModule",{value:!0});w0.getRules=w0.isJSONType=void 0;var voe=["string","number","integer","boolean","null","object","array"],Soe=new Set(voe);function Poe(e){return typeof e=="string"&&Soe.has(e)}w0.isJSONType=Poe;function $oe(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}w0.getRules=$oe});var jP=G((S0)=>{Object.defineProperty(S0,"__esModule",{value:!0});S0.shouldUseRule=S0.shouldUseGroup=S0.schemaHasRulesForType=void 0;function Loe({schema:e,self:t},n){let r=t.RULES.types[n];return r&&r!==!0&&k0(e,r)}S0.schemaHasRulesForType=Loe;function k0(e,t){return t.rules.some((n)=>v0(e,n))}S0.shouldUseGroup=k0;function v0(e,t){var n;return e[t.keyword]!==void 0||((n=t.definition.implements)===null||n===void 0?void 0:n.some((r)=>e[r]!==void 0))}S0.shouldUseRule=v0});var fc=G((T0)=>{Object.defineProperty(T0,"__esModule",{value:!0});T0.reportTypeError=T0.checkDataTypes=T0.checkDataType=T0.coerceAndCheckDataType=T0.getJSONTypes=T0.getSchemaTypes=T0.DataType=void 0;var Aoe=_P(),Coe=jP(),Doe=wc(),ge=ye(),$0=ke(),ui;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(ui||(T0.DataType=ui={}));function zoe(e){let t=I0(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}T0.getSchemaTypes=zoe;function I0(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Aoe.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}T0.getJSONTypes=I0;function _oe(e,t){let{gen:n,data:r,opts:o}=e,i=joe(t,o.coerceTypes),c=t.length>0&&!(i.length===0&&t.length===1&&(0,Coe.schemaHasRulesForType)(e,t[0]));if(c){let s=xP(t,r,o.strictNumbers,ui.Wrong);n.if(s,()=>{if(i.length)Noe(e,t,i);else RP(e)})}return c}T0.coerceAndCheckDataType=_oe;var L0=new Set(["string","number","integer","boolean","null"]);function joe(e,t){return t?e.filter((n)=>L0.has(n)||t==="array"&&n==="array"):[]}function Noe(e,t,n){let{gen:r,data:o,opts:i}=e,c=r.let("dataType",ge._`typeof ${o}`),s=r.let("coerced",ge._`undefined`);if(i.coerceTypes==="array")r.if(ge._`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>r.assign(o,ge._`${o}[0]`).assign(c,ge._`typeof ${o}`).if(xP(t,o,i.strictNumbers),()=>r.assign(s,o)));r.if(ge._`${s} !== undefined`);for(let l of n)if(L0.has(l)||l==="array"&&i.coerceTypes==="array")h(l);r.else(),RP(e),r.endIf(),r.if(ge._`${s} !== undefined`,()=>{r.assign(o,s),xoe(e,s)});function h(l){switch(l){case"string":r.elseIf(ge._`${c} == "number" || ${c} == "boolean"`).assign(s,ge._`"" + ${o}`).elseIf(ge._`${o} === null`).assign(s,ge._`""`);return;case"number":r.elseIf(ge._`${c} == "boolean" || ${o} === null
7476
7476
  || (${c} == "string" && ${o} && ${o} == +${o})`).assign(s,ge._`+${o}`);return;case"integer":r.elseIf(ge._`${c} === "boolean" || ${o} === null
7477
7477
  || (${c} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(s,ge._`+${o}`);return;case"boolean":r.elseIf(ge._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(s,!1).elseIf(ge._`${o} === "true" || ${o} === 1`).assign(s,!0);return;case"null":r.elseIf(ge._`${o} === "" || ${o} === 0 || ${o} === false`),r.assign(s,null);return;case"array":r.elseIf(ge._`${c} === "string" || ${c} === "number"
7478
- || ${c} === "boolean" || ${o} === null`).assign(s,ge._`[${o}]`)}}}function xoe({gen:e,parentData:t,parentDataProperty:n},r){e.if(ge._`${t} !== undefined`,()=>e.assign(ge._`${t}[${n}]`,r))}function NP(e,t,n,r=ui.Correct){let o=r===ui.Correct?ge.operators.EQ:ge.operators.NEQ,i;switch(e){case"null":return ge._`${t} ${o} null`;case"array":i=ge._`Array.isArray(${t})`;break;case"object":i=ge._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=c(ge._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=c();break;default:return ge._`typeof ${t} ${o} ${e}`}return r===ui.Correct?i:(0,ge.not)(i);function c(s=ge.nil){return(0,ge.and)(ge._`typeof ${t} == "number"`,s,n?ge._`isFinite(${t})`:ge.nil)}}T0.checkDataType=NP;function xP(e,t,n,r){if(e.length===1)return NP(e[0],t,n,r);let o,i=(0,$0.toHash)(e);if(i.array&&i.object){let c=ge._`typeof ${t} != "object"`;o=i.null?c:ge._`!${t} || ${c}`,delete i.null,delete i.array,delete i.object}else o=ge.nil;if(i.number)delete i.integer;for(let c in i)o=(0,ge.and)(o,NP(c,t,n,r));return o}T0.checkDataTypes=xP;var Roe={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?ge._`{type: ${e}}`:ge._`{type: ${t}}`};function RP(e){let t=Uoe(e);(0,Doe.reportError)(t,Roe)}T0.reportTypeError=RP;function Uoe(e){let{gen:t,data:n,schema:r}=e,o=(0,$0.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:o,schemaValue:o,parentSchema:r,params:{},it:e}}});var z0=G((C0)=>{Object.defineProperty(C0,"__esModule",{value:!0});C0.assignDefaults=void 0;var gi=ye(),Hoe=ke();function Boe(e,t){let{properties:n,items:r}=e.schema;if(t==="object"&&n)for(let o in n)A0(e,o,n[o].default);else if(t==="array"&&Array.isArray(r))r.forEach((o,i)=>A0(e,i,o.default))}C0.assignDefaults=Boe;function A0(e,t,n){let{gen:r,compositeRule:o,data:i,opts:c}=e;if(n===void 0)return;let s=gi._`${i}${(0,gi.getProperty)(t)}`;if(o){(0,Hoe.checkStrictMode)(e,`default is ignored for: ${s}`);return}let h=gi._`${s} === undefined`;if(c.useDefaults==="empty")h=gi._`${h} || ${s} === null || ${s} === ""`;r.if(h,gi._`${s} = ${(0,gi.stringify)(n)}`)}});var Yt=G((N0)=>{Object.defineProperty(N0,"__esModule",{value:!0});N0.validateUnion=N0.validateArray=N0.usePattern=N0.callValidateCode=N0.schemaProperties=N0.allSchemaProperties=N0.noPropertyInData=N0.propertyInData=N0.isOwnProperty=N0.hasPropFunc=N0.reportMissingProp=N0.checkMissingProp=N0.checkReportMissingProp=void 0;var xe=ye(),UP=ke(),bo=Mn(),Woe=ke();function Zoe(e,t){let{gen:n,data:r,it:o}=e;n.if(KP(n,r,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:xe._`${t}`},!0),e.error()})}N0.checkReportMissingProp=Zoe;function Foe({gen:e,data:t,it:{opts:n}},r,o){return(0,xe.or)(...r.map((i)=>(0,xe.and)(KP(e,t,i,n.ownProperties),xe._`${o} = ${i}`)))}N0.checkMissingProp=Foe;function Xoe(e,t){e.setParams({missingProperty:t},!0),e.error()}N0.reportMissingProp=Xoe;function _0(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:xe._`Object.prototype.hasOwnProperty`})}N0.hasPropFunc=_0;function MP(e,t,n){return xe._`${_0(e)}.call(${t}, ${n})`}N0.isOwnProperty=MP;function Yoe(e,t,n,r){let o=xe._`${t}${(0,xe.getProperty)(n)} !== undefined`;return r?xe._`${o} && ${MP(e,t,n)}`:o}N0.propertyInData=Yoe;function KP(e,t,n,r){let o=xe._`${t}${(0,xe.getProperty)(n)} === undefined`;return r?(0,xe.or)(o,(0,xe.not)(MP(e,t,n))):o}N0.noPropertyInData=KP;function j0(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}N0.allSchemaProperties=j0;function Qoe(e,t){return j0(t).filter((n)=>!(0,UP.alwaysValidSchema)(e,t[n]))}N0.schemaProperties=Qoe;function Voe({schemaCode:e,data:t,it:{gen:n,topSchemaRef:r,schemaPath:o,errorPath:i},it:c},s,h,l){let u=l?xe._`${e}, ${t}, ${r}${o}`:t,d=[[bo.default.instancePath,(0,xe.strConcat)(bo.default.instancePath,i)],[bo.default.parentData,c.parentData],[bo.default.parentDataProperty,c.parentDataProperty],[bo.default.rootData,bo.default.rootData]];if(c.opts.dynamicRef)d.push([bo.default.dynamicAnchors,bo.default.dynamicAnchors]);let y=xe._`${u}, ${n.object(...d)}`;return h!==xe.nil?xe._`${s}.call(${h}, ${y})`:xe._`${s}(${y})`}N0.callValidateCode=Voe;var ere=xe._`new RegExp`;function tre({gen:e,it:{opts:t}},n){let r=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(n,r);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:xe._`${o.code==="new RegExp"?ere:(0,Woe.useFunc)(e,o)}(${n}, ${r})`})}N0.usePattern=tre;function nre(e){let{gen:t,data:n,keyword:r,it:o}=e,i=t.name("valid");if(o.allErrors){let s=t.let("valid",!0);return c(()=>t.assign(s,!1)),s}return t.var(i,!0),c(()=>t.break()),i;function c(s){let h=t.const("len",xe._`${n}.length`);t.forRange("i",0,h,(l)=>{e.subschema({keyword:r,dataProp:l,dataPropType:UP.Type.Num},i),t.if((0,xe.not)(i),s)})}}N0.validateArray=nre;function ore(e){let{gen:t,schema:n,keyword:r,it:o}=e;if(!Array.isArray(n))throw Error("ajv implementation error");if(n.some((h)=>(0,UP.alwaysValidSchema)(o,h))&&!o.opts.unevaluated)return;let c=t.let("valid",!1),s=t.name("_valid");t.block(()=>n.forEach((h,l)=>{let u=e.subschema({keyword:r,schemaProp:l,compositeRule:!0},s);if(t.assign(c,xe._`${c} || ${s}`),!e.mergeValidEvaluated(u,s))t.if((0,xe.not)(c))})),e.result(c,()=>e.reset(),()=>e.error(!0))}N0.validateUnion=ore});var E0=G((M0)=>{Object.defineProperty(M0,"__esModule",{value:!0});M0.validateKeywordUsage=M0.validSchemaType=M0.funcKeywordCode=M0.macroKeywordCode=void 0;var ft=ye(),Ho=Mn(),mre=Yt(),pre=wc();function wre(e,t){let{gen:n,keyword:r,schema:o,parentSchema:i,it:c}=e,s=t.macro.call(c.self,o,i,c),h=U0(n,r,s);if(c.opts.validateSchema!==!1)c.self.validateSchema(s,!0);let l=n.name("valid");e.subschema({schema:s,schemaPath:ft.nil,errSchemaPath:`${c.errSchemaPath}/${r}`,topSchemaRef:h,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}M0.macroKeywordCode=wre;function fre(e,t){var n;let{gen:r,keyword:o,schema:i,parentSchema:c,$data:s,it:h}=e;vre(h,t);let l=!s&&t.compile?t.compile.call(h.self,i,c,h):t.validate,u=U0(r,o,l),d=r.let("valid");e.block$data(d,y),e.ok((n=t.valid)!==null&&n!==void 0?n:d);function y(){if(t.errors===!1){if(k(),t.modifying)R0(e);L(()=>e.error())}else{let A=t.async?p():f();if(t.modifying)R0(e);L(()=>kre(e,A))}}function p(){let A=r.let("ruleErrs",null);return r.try(()=>k(ft._`await `),(K)=>r.assign(d,!1).if(ft._`${K} instanceof ${h.ValidationError}`,()=>r.assign(A,ft._`${K}.errors`),()=>r.throw(K))),A}function f(){let A=ft._`${u}.errors`;return r.assign(A,null),k(ft.nil),A}function k(A=t.async?ft._`await `:ft.nil){let K=h.opts.passContext?Ho.default.this:Ho.default.self,x=!(("compile"in t)&&!s||t.schema===!1);r.assign(d,ft._`${A}${(0,mre.callValidateCode)(e,u,K,x)}`,t.modifying)}function L(A){var K;r.if((0,ft.not)((K=t.valid)!==null&&K!==void 0?K:d),A)}}M0.funcKeywordCode=fre;function R0(e){let{gen:t,data:n,it:r}=e;t.if(r.parentData,()=>t.assign(n,ft._`${r.parentData}[${r.parentDataProperty}]`))}function kre(e,t){let{gen:n}=e;n.if(ft._`Array.isArray(${t})`,()=>{n.assign(Ho.default.vErrors,ft._`${Ho.default.vErrors} === null ? ${t} : ${Ho.default.vErrors}.concat(${t})`).assign(Ho.default.errors,ft._`${Ho.default.vErrors}.length`),(0,pre.extendErrors)(e)},()=>e.error())}function vre({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function U0(e,t,n){if(n===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,ft.stringify)(n)})}function Sre(e,t,n=!1){return!t.length||t.some((r)=>r==="array"?Array.isArray(e):r==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==r||n&&typeof e>"u")}M0.validSchemaType=Sre;function Pre({schema:e,opts:t,self:n,errSchemaPath:r},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw Error("ajv implementation error");let c=o.dependencies;if(c===null||c===void 0?void 0:c.some((s)=>!Object.prototype.hasOwnProperty.call(e,s)))throw Error(`parent schema must have dependencies of ${i}: ${c.join(",")}`);if(o.validateSchema){if(!o.validateSchema(e[i])){let h=`keyword "${i}" value is invalid at path "${r}": `+n.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")n.logger.error(h);else throw Error(h)}}}M0.validateKeywordUsage=Pre});var H0=G((G0)=>{Object.defineProperty(G0,"__esModule",{value:!0});G0.extendSubschemaMode=G0.extendSubschemaData=G0.getSubschema=void 0;var Pn=ye(),q0=ke();function Tre(e,{keyword:t,schemaProp:n,schema:r,schemaPath:o,errSchemaPath:i,topSchemaRef:c}){if(t!==void 0&&r!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let s=e.schema[t];return n===void 0?{schema:s,schemaPath:Pn._`${e.schemaPath}${(0,Pn.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[n],schemaPath:Pn._`${e.schemaPath}${(0,Pn.getProperty)(t)}${(0,Pn.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,q0.escapeFragment)(n)}`}}if(r!==void 0){if(o===void 0||i===void 0||c===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:o,topSchemaRef:c,errSchemaPath:i}}throw Error('either "keyword" or "schema" must be passed')}G0.getSubschema=Tre;function Ore(e,t,{dataProp:n,dataPropType:r,data:o,dataTypes:i,propertyName:c}){if(o!==void 0&&n!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=t;if(n!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=t,y=s.let("data",Pn._`${t.data}${(0,Pn.getProperty)(n)}`,!0);h(y),e.errorPath=Pn.str`${l}${(0,q0.getErrorPath)(n,r,d.jsPropertySyntax)}`,e.parentDataProperty=Pn._`${n}`,e.dataPathArr=[...u,e.parentDataProperty]}if(o!==void 0){let l=o instanceof Pn.Name?o:s.let("data",o,!0);if(h(l),c!==void 0)e.propertyName=c}if(i)e.dataTypes=i;function h(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}G0.extendSubschemaData=Ore;function Are(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:o,allErrors:i}){if(r!==void 0)e.compositeRule=r;if(o!==void 0)e.createErrors=o;if(i!==void 0)e.allErrors=i;e.jtdDiscriminator=t,e.jtdMetadata=n}G0.extendSubschemaMode=Are});var EP=G((e0e,B0)=>{B0.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var c=i[o];if(!e(t[c],n[c]))return!1}return!0}return t!==t&&n!==n}});var Z0=G((t0e,W0)=>{var mo=W0.exports=function(e,t,n){if(typeof t=="function")n=t,t={};n=t.cb||n;var r=typeof n=="function"?n:n.pre||function(){},o=n.post||function(){};Ju(t,r,o,e,"",e)};mo.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};mo.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};mo.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};mo.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Ju(e,t,n,r,o,i,c,s,h,l){if(r&&typeof r=="object"&&!Array.isArray(r)){t(r,o,i,c,s,h,l);for(var u in r){var d=r[u];if(Array.isArray(d)){if(u in mo.arrayKeywords)for(var y=0;y<d.length;y++)Ju(e,t,n,d[y],o+"/"+u+"/"+y,i,o,u,r,y)}else if(u in mo.propsKeywords){if(d&&typeof d=="object")for(var p in d)Ju(e,t,n,d[p],o+"/"+u+"/"+zre(p),i,o,u,r,p)}else if(u in mo.keywords||e.allKeys&&!(u in mo.skipKeywords))Ju(e,t,n,d,o+"/"+u,i,o,u,r)}n(r,o,i,c,s,h,l)}}function zre(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var kc=G((Q0)=>{Object.defineProperty(Q0,"__esModule",{value:!0});Q0.getSchemaRefs=Q0.resolveUrl=Q0.normalizeId=Q0._getFullPath=Q0.getFullPath=Q0.inlineRef=void 0;var _re=ke(),jre=EP(),Nre=Z0(),xre=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Rre(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!qP(e);if(!t)return!1;return F0(e)<=t}Q0.inlineRef=Rre;var Ure=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function qP(e){for(let t in e){if(Ure.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(qP))return!0;if(typeof n=="object"&&qP(n))return!0}return!1}function F0(e){let t=0;for(let n in e){if(n==="$ref")return 1/0;if(t++,xre.has(n))continue;if(typeof e[n]=="object")(0,_re.eachItem)(e[n],(r)=>t+=F0(r));if(t===1/0)return 1/0}return t}function X0(e,t="",n){if(n!==!1)t=di(t);let r=e.parse(t);return Y0(e,r)}Q0.getFullPath=X0;function Y0(e,t){return e.serialize(t).split("#")[0]+"#"}Q0._getFullPath=Y0;var Mre=/#\/?$/;function di(e){return e?e.replace(Mre,""):""}Q0.normalizeId=di;function Kre(e,t,n){return n=di(n),e.resolve(t,n)}Q0.resolveUrl=Kre;var Ere=/^[a-z_][-a-z0-9._]*$/i;function qre(e,t){if(typeof e=="boolean")return{};let{schemaId:n,uriResolver:r}=this.opts,o=di(e[n]||t),i={"":o},c=X0(r,o,!1),s={},h=new Set;return Nre(e,{allKeys:!0},(d,y,p,f)=>{if(f===void 0)return;let k=c+y,L=i[f];if(typeof d[n]=="string")L=A.call(this,d[n]);K.call(this,d.$anchor),K.call(this,d.$dynamicAnchor),i[y]=L;function A(x){let Y=this.opts.uriResolver.resolve;if(x=di(L?Y(L,x):x),h.has(x))throw u(x);h.add(x);let E=this.refs[x];if(typeof E=="string")E=this.refs[E];if(typeof E=="object")l(d,E.schema,x);else if(x!==di(k))if(x[0]==="#")l(d,s[x],x),s[x]=d;else this.refs[x]=k;return x}function K(x){if(typeof x=="string"){if(!Ere.test(x))throw Error(`invalid anchor "${x}"`);A.call(this,`#${x}`)}}}),s;function l(d,y,p){if(y!==void 0&&!jre(d,y))throw u(p)}function u(d){return Error(`reference "${d}" resolves to more than one schema`)}}Q0.getSchemaRefs=qre});var Pc=G((y6)=>{Object.defineProperty(y6,"__esModule",{value:!0});y6.getData=y6.KeywordCxt=y6.validateFunctionCode=void 0;var r6=p0(),e6=fc(),JP=jP(),Hu=fc(),Zre=z0(),Sc=E0(),GP=H0(),re=ye(),he=Mn(),Fre=kc(),Kn=ke(),vc=wc();function Xre(e){if(c6(e)){if(s6(e),a6(e)){Vre(e);return}}i6(e,()=>(0,r6.topBoolOrEmptySchema)(e))}y6.validateFunctionCode=Xre;function i6({gen:e,validateName:t,schema:n,schemaEnv:r,opts:o},i){if(o.code.es5)e.func(t,re._`${he.default.data}, ${he.default.valCxt}`,r.$async,()=>{e.code(re._`"use strict"; ${t6(n,o)}`),Qre(e,o),e.code(i)});else e.func(t,re._`${he.default.data}, ${Yre(o)}`,r.$async,()=>e.code(t6(n,o)).code(i))}function Yre(e){return re._`{${he.default.instancePath}="", ${he.default.parentData}, ${he.default.parentDataProperty}, ${he.default.rootData}=${he.default.data}${e.dynamicRef?re._`, ${he.default.dynamicAnchors}={}`:re.nil}}={}`}function Qre(e,t){e.if(he.default.valCxt,()=>{if(e.var(he.default.instancePath,re._`${he.default.valCxt}.${he.default.instancePath}`),e.var(he.default.parentData,re._`${he.default.valCxt}.${he.default.parentData}`),e.var(he.default.parentDataProperty,re._`${he.default.valCxt}.${he.default.parentDataProperty}`),e.var(he.default.rootData,re._`${he.default.valCxt}.${he.default.rootData}`),t.dynamicRef)e.var(he.default.dynamicAnchors,re._`${he.default.valCxt}.${he.default.dynamicAnchors}`)},()=>{if(e.var(he.default.instancePath,re._`""`),e.var(he.default.parentData,re._`undefined`),e.var(he.default.parentDataProperty,re._`undefined`),e.var(he.default.rootData,he.default.data),t.dynamicRef)e.var(he.default.dynamicAnchors,re._`{}`)})}function Vre(e){let{schema:t,opts:n,gen:r}=e;i6(e,()=>{if(n.$comment&&t.$comment)l6(e);if(rie(e),r.let(he.default.vErrors,null),r.let(he.default.errors,0),n.unevaluated)eie(e);h6(e),cie(e)});return}function eie(e){let{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",re._`${n}.evaluated`),t.if(re._`${e.evaluated}.dynamicProps`,()=>t.assign(re._`${e.evaluated}.props`,re._`undefined`)),t.if(re._`${e.evaluated}.dynamicItems`,()=>t.assign(re._`${e.evaluated}.items`,re._`undefined`))}function t6(e,t){let n=typeof e=="object"&&e[t.schemaId];return n&&(t.code.source||t.code.process)?re._`/*# sourceURL=${n} */`:re.nil}function tie(e,t){if(c6(e)){if(s6(e),a6(e)){nie(e,t);return}}(0,r6.boolOrEmptySchema)(e,t)}function a6({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function c6(e){return typeof e.schema!="boolean"}function nie(e,t){let{schema:n,gen:r,opts:o}=e;if(o.$comment&&n.$comment)l6(e);iie(e),aie(e);let i=r.const("_errs",he.default.errors);h6(e,i),r.var(t,re._`${i} === ${he.default.errors}`)}function s6(e){(0,Kn.checkUnknownRules)(e),oie(e)}function h6(e,t){if(e.opts.jtd)return n6(e,[],!1,t);let n=(0,e6.getSchemaTypes)(e.schema),r=(0,e6.coerceAndCheckDataType)(e,n);n6(e,n,!r,t)}function oie(e){let{schema:t,errSchemaPath:n,opts:r,self:o}=e;if(t.$ref&&r.ignoreKeywordsWithRef&&(0,Kn.schemaHasRulesButRef)(t,o.RULES))o.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function rie(e){let{schema:t,opts:n}=e;if(t.default!==void 0&&n.useDefaults&&n.strictSchema)(0,Kn.checkStrictMode)(e,"default is ignored in the schema root")}function iie(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=(0,Fre.resolveUrl)(e.opts.uriResolver,e.baseId,t)}function aie(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function l6({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:o}){let i=n.$comment;if(o.$comment===!0)e.code(re._`${he.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let c=re.str`${r}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code(re._`${he.default.self}.opts.$comment(${i}, ${c}, ${s}.schema)`)}}function cie(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:o,opts:i}=e;if(n.$async)t.if(re._`${he.default.errors} === 0`,()=>t.return(he.default.data),()=>t.throw(re._`new ${o}(${he.default.vErrors})`));else{if(t.assign(re._`${r}.errors`,he.default.vErrors),i.unevaluated)sie(e);t.return(re._`${he.default.errors} === 0`)}}function sie({gen:e,evaluated:t,props:n,items:r}){if(n instanceof re.Name)e.assign(re._`${t}.props`,n);if(r instanceof re.Name)e.assign(re._`${t}.items`,r)}function n6(e,t,n,r){let{gen:o,schema:i,data:c,allErrors:s,opts:h,self:l}=e,{RULES:u}=l;if(i.$ref&&(h.ignoreKeywordsWithRef||!(0,Kn.schemaHasRulesButRef)(i,u))){o.block(()=>g6(e,"$ref",u.all.$ref.definition));return}if(!h.jtd)hie(e,t);o.block(()=>{for(let y of u.rules)d(y);d(u.post)});function d(y){if(!(0,JP.shouldUseGroup)(i,y))return;if(y.type){if(o.if((0,Hu.checkDataType)(y.type,c,h.strictNumbers)),o6(e,y),t.length===1&&t[0]===y.type&&n)o.else(),(0,Hu.reportTypeError)(e);o.endIf()}else o6(e,y);if(!s)o.if(re._`${he.default.errors} === ${r||0}`)}}function o6(e,t){let{gen:n,schema:r,opts:{useDefaults:o}}=e;if(o)(0,Zre.assignDefaults)(e,t.type);n.block(()=>{for(let i of t.rules)if((0,JP.shouldUseRule)(r,i))g6(e,i.keyword,i.definition,t.type)})}function hie(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(lie(e,t),!e.opts.allowUnionTypes)uie(e,t);gie(e,e.dataTypes)}function lie(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((n)=>{if(!u6(e.dataTypes,n))HP(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),yie(e,t)}function uie(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))HP(e,"use allowUnionTypes to allow union type keyword")}function gie(e,t){let n=e.self.RULES.all;for(let r in n){let o=n[r];if(typeof o=="object"&&(0,JP.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;if(i.length&&!i.some((c)=>die(t,c)))HP(e,`missing type "${i.join(",")}" for keyword "${r}"`)}}}function die(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function u6(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function yie(e,t){let n=[];for(let r of e.dataTypes)if(u6(t,r))n.push(r);else if(t.includes("integer")&&r==="number")n.push("integer");e.dataTypes=n}function HP(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,Kn.checkStrictMode)(e,t,e.opts.strictTypes)}class BP{constructor(e,t,n){if((0,Sc.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Kn.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",d6(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Sc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",he.default.errors)}result(e,t,n){this.failResult((0,re.not)(e),t,n)}failResult(e,t,n){if(this.gen.if(e),n)n();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult((0,re.not)(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(re._`${t} !== undefined && (${(0,re.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?vc.reportExtraError:vc.reportError)(this,this.def.error,t)}$dataError(){(0,vc.reportError)(this,this.def.$dataError||vc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,vc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,n=re.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=re.nil,t=re.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:o,def:i}=this;if(n.if((0,re.or)(re._`${r} === undefined`,t)),e!==re.nil)n.assign(e,!0);if(o.length||i.validateSchema){if(n.elseIf(this.invalid$data()),this.$dataError(),e!==re.nil)n.assign(e,!1)}n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:o}=this;return(0,re.or)(i(),c());function i(){if(n.length){if(!(t instanceof re.Name))throw Error("ajv implementation error");let s=Array.isArray(n)?n:[n];return re._`${(0,Hu.checkDataTypes)(s,t,o.opts.strictNumbers,Hu.DataType.Wrong)}`}return re.nil}function c(){if(r.validateSchema){let s=e.scopeValue("validate$data",{ref:r.validateSchema});return re._`!${s}(${t})`}return re.nil}}subschema(e,t){let n=(0,GP.getSubschema)(this.it,e);(0,GP.extendSubschemaData)(n,this.it,e),(0,GP.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return tie(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;if(!n.opts.unevaluated)return;if(n.props!==!0&&e.props!==void 0)n.props=Kn.mergeEvaluated.props(r,e.props,n.props,t);if(n.items!==!0&&e.items!==void 0)n.items=Kn.mergeEvaluated.items(r,e.items,n.items,t)}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,re.Name)),!0}}y6.KeywordCxt=BP;function g6(e,t,n,r){let o=new BP(e,n,t);if("code"in n)n.code(o,r);else if(o.$data&&n.validate)(0,Sc.funcKeywordCode)(o,n);else if("macro"in n)(0,Sc.macroKeywordCode)(o,n);else if(n.compile||n.validate)(0,Sc.funcKeywordCode)(o,n)}var bie=/^\/(?:[^~]|~0|~1)*$/,mie=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function d6(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let o,i;if(e==="")return he.default.rootData;if(e[0]==="/"){if(!bie.test(e))throw Error(`Invalid JSON-pointer: ${e}`);o=e,i=he.default.rootData}else{let l=mie.exec(e);if(!l)throw Error(`Invalid JSON-pointer: ${e}`);let u=+l[1];if(o=l[2],o==="#"){if(u>=t)throw Error(h("property/index",u));return r[t-u]}if(u>t)throw Error(h("data",u));if(i=n[t-u],!o)return i}let c=i,s=o.split("/");for(let l of s)if(l)i=re._`${i}${(0,re.getProperty)((0,Kn.unescapeJsonPointer)(l))}`,c=re._`${c} && ${i}`;return c;function h(l,u){return`Cannot access ${l} ${u} levels up, current level is ${t}`}}y6.getData=d6});var Bu=G((p6)=>{Object.defineProperty(p6,"__esModule",{value:!0});class m6 extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}p6.default=m6});var $c=G((f6)=>{Object.defineProperty(f6,"__esModule",{value:!0});var WP=kc();class w6 extends Error{constructor(e,t,n,r){super(r||`can't resolve reference ${n} from id ${t}`);this.missingRef=(0,WP.resolveUrl)(e,t,n),this.missingSchema=(0,WP.normalizeId)((0,WP.getFullPath)(e,this.missingRef))}}f6.default=w6});var Zu=G((S6)=>{Object.defineProperty(S6,"__esModule",{value:!0});S6.resolveSchema=S6.getCompilingSchema=S6.resolveRef=S6.compileSchema=S6.SchemaEnv=void 0;var hn=ye(),vie=Bu(),Bo=Mn(),ln=kc(),k6=ke(),Sie=Pc();class Ic{constructor(e){var t;this.refs={},this.dynamicAnchors={};let n;if(typeof e.schema=="object")n=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,ln.normalizeId)(n===null||n===void 0?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n===null||n===void 0?void 0:n.$async,this.refs={}}}S6.SchemaEnv=Ic;function FP(e){let t=v6.call(this,e);if(t)return t;let n=(0,ln.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:r,lines:o}=this.opts.code,{ownProperties:i}=this.opts,c=new hn.CodeGen(this.scope,{es5:r,lines:o,ownProperties:i}),s;if(e.$async)s=c.scopeValue("Error",{ref:vie.default,code:hn._`require("ajv/dist/runtime/validation_error").default`});let h=c.scopeName("validate");e.validateName=h;let l={gen:c,allErrors:this.opts.allErrors,data:Bo.default.data,parentData:Bo.default.parentData,parentDataProperty:Bo.default.parentDataProperty,dataNames:[Bo.default.data],dataPathArr:[hn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,hn.stringify)(e.schema)}:{ref:e.schema}),validateName:h,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:hn.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:hn._`""`,opts:this.opts,self:this},u;try{this._compilations.add(e),(0,Sie.validateFunctionCode)(l),c.optimize(this.opts.code.optimize);let d=c.toString();if(u=`${c.scopeRefs(Bo.default.scope)}return ${d}`,this.opts.code.process)u=this.opts.code.process(u,e);let p=Function(`${Bo.default.self}`,`${Bo.default.scope}`,u)(this,this.scope.get());if(this.scope.value(h,{ref:p}),p.errors=null,p.schema=e.schema,p.schemaEnv=e,e.$async)p.$async=!0;if(this.opts.code.source===!0)p.source={validateName:h,validateCode:d,scopeValues:c._values};if(this.opts.unevaluated){let{props:f,items:k}=l;if(p.evaluated={props:f instanceof hn.Name?void 0:f,items:k instanceof hn.Name?void 0:k,dynamicProps:f instanceof hn.Name,dynamicItems:k instanceof hn.Name},p.source)p.source.evaluated=(0,hn.stringify)(p.evaluated)}return e.validate=p,e}catch(d){if(delete e.validate,delete e.validateName,u)this.logger.error("Error compiling schema, function code:",u);throw d}finally{this._compilations.delete(e)}}S6.compileSchema=FP;function Pie(e,t,n){var r;n=(0,ln.resolveUrl)(this.opts.uriResolver,t,n);let o=e.refs[n];if(o)return o;let i=Lie.call(this,e,n);if(i===void 0){let c=(r=e.localRefs)===null||r===void 0?void 0:r[n],{schemaId:s}=this.opts;if(c)i=new Ic({schema:c,schemaId:s,root:e,baseId:t})}if(i===void 0)return;return e.refs[n]=$ie.call(this,i)}S6.resolveRef=Pie;function $ie(e){if((0,ln.inlineRef)(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:FP.call(this,e)}function v6(e){for(let t of this._compilations)if(Iie(t,e))return t}S6.getCompilingSchema=v6;function Iie(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Lie(e,t){let n;while(typeof(n=this.refs[t])=="string")t=n;return n||this.schemas[t]||Wu.call(this,e,t)}function Wu(e,t){let n=this.opts.uriResolver.parse(t),r=(0,ln._getFullPath)(this.opts.uriResolver,n),o=(0,ln.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===o)return ZP.call(this,n,e);let i=(0,ln.normalizeId)(r),c=this.refs[i]||this.schemas[i];if(typeof c=="string"){let s=Wu.call(this,e,c);if(typeof(s===null||s===void 0?void 0:s.schema)!=="object")return;return ZP.call(this,n,s)}if(typeof(c===null||c===void 0?void 0:c.schema)!=="object")return;if(!c.validate)FP.call(this,c);if(i===(0,ln.normalizeId)(t)){let{schema:s}=c,{schemaId:h}=this.opts,l=s[h];if(l)o=(0,ln.resolveUrl)(this.opts.uriResolver,o,l);return new Ic({schema:s,schemaId:h,root:e,baseId:o})}return ZP.call(this,n,c)}S6.resolveSchema=Wu;var Tie=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function ZP(e,{baseId:t,schema:n,root:r}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let s of e.fragment.slice(1).split("/")){if(typeof n==="boolean")return;let h=n[(0,k6.unescapeFragment)(s)];if(h===void 0)return;n=h;let l=typeof n==="object"&&n[this.opts.schemaId];if(!Tie.has(s)&&l)t=(0,ln.resolveUrl)(this.opts.uriResolver,t,l)}let i;if(typeof n!="boolean"&&n.$ref&&!(0,k6.schemaHasRulesButRef)(n,this.RULES)){let s=(0,ln.resolveUrl)(this.opts.uriResolver,t,n.$ref);i=Wu.call(this,r,s)}let{schemaId:c}=this.opts;if(i=i||new Ic({schema:n,schemaId:c,root:r,baseId:t}),i.schema!==i.root.schema)return i;return}});var $6=G((c0e,zie)=>{zie.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var QP=G((s0e,C6)=>{var _ie=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),L6=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),XP=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),T6=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),jie=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function YP(e){let t="",n=0,r=0;for(r=0;r<e.length;r++){if(n=e[r].charCodeAt(0),n===48)continue;if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r]}return t}var Nie=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function I6(e){return e.length=0,!0}function xie(e,t,n){if(e.length){let r=YP(e);if(r!=="")t.push(r);else return n.error=!0,!1;e.length=0}return!0}function Rie(e){let t=0,n={error:!1,address:"",zone:""},r=[],o=[],i=!1,c=!1,s=xie;for(let h=0;h<e.length;h++){let l=e[h];if(l==="["||l==="]")continue;if(l===":"){if(i===!0)c=!0;if(!s(o,r,n))break;if(++t>7){n.error=!0;break}if(h>0&&e[h-1]===":")i=!0;r.push(":");continue}else if(l==="%"){if(!s(o,r,n))break;s=I6}else{o.push(l);continue}}if(o.length)if(s===I6)n.zone=o.join("");else if(c)r.push(o.join(""));else r.push(YP(o));return n.address=r.join(""),n}function O6(e){if(Uie(e,":")<2)return{host:e,isIPV6:!1};let t=Rie(e);if(!t.error){let{address:n,address:r}=t;if(t.zone)n+="%"+t.zone,r+="%25"+t.zone;return{host:n,isIPV6:!0,escapedHost:r}}else return{host:e,isIPV6:!1}}function Uie(e,t){let n=0;for(let r=0;r<e.length;r++)if(e[r]===t)n++;return n}function Mie(e){let t=e,n=[],r=-1,o=0;while(o=t.length){if(o===1)if(t===".")break;else if(t==="/"){n.push("/");break}else{n.push(t);break}else if(o===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){n.push("/");break}}}else if(o===3){if(t==="/.."){if(n.length!==0)n.pop();n.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),n.length!==0)n.pop();continue}}}}if((r=t.indexOf("/",1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join("")}var Kie={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Eie=/[@/?#:]/g,qie=/[@/?#]/g;function A6(e,t){let n=t?qie:Eie;return n.lastIndex=0,e.replace(n,(r)=>Kie[r])}function Gie(e,t=!1){if(e.indexOf("%")===-1)return e;let n="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let o=e.slice(r+1,r+3);if(XP(o)){let i=o.toUpperCase(),c=String.fromCharCode(parseInt(i,16));if(t&&T6(c))n+=c;else n+="%"+i;r+=2;continue}}n+=e[r]}return n}function Jie(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let r=e.slice(n+1,n+3);if(XP(r)){let o=r.toUpperCase(),i=String.fromCharCode(parseInt(o,16));if(i!=="."&&T6(i))t+=i;else t+="%"+o;n+=2;continue}}if(jie(e[n]))t+=e[n];else t+=escape(e[n])}return t}function Hie(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let r=e.slice(n+1,n+3);if(XP(r)){t+="%"+r.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function Bie(e){let t=[];if(e.userinfo!==void 0)t.push(e.userinfo),t.push("@");if(e.host!==void 0){let n=unescape(e.host);if(!L6(n)){let r=O6(n);if(r.isIPV6===!0)n=`[${r.escapedHost}]`;else n=A6(n,!1)}t.push(n)}if(typeof e.port==="number"||typeof e.port==="string")t.push(":"),t.push(String(e.port));return t.length?t.join(""):void 0}C6.exports={nonSimpleDomain:Nie,recomposeAuthority:Bie,reescapeHostDelimiters:A6,normalizePercentEncoding:Gie,normalizePathEncoding:Jie,escapePreservingEscapes:Hie,removeDotSegments:Mie,isIPv4:L6,isUUID:_ie,normalizeIPv6:O6,stringArrayToHexStripped:YP}});var N6=G((h0e,j6)=>{var{isUUID:Wie}=QP(),Zie=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Fie=["http","https","ws","wss","urn","urn:uuid"];function Xie(e){return Fie.indexOf(e)!==-1}function VP(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function D6(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function z6(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function Yie(e){return e.secure=VP(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function Qie(e){if(e.port===(VP(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let[t,n]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function Vie(e,t){if(!e.path)return e.error="URN can not be parsed",e;let n=e.path.match(Zie);if(n){let r=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];let o=`${r}:${t.nid||e.nid}`,i=e$(o);if(e.path=void 0,i)e=i.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function eae(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let n=t.scheme||e.scheme||"urn",r=e.nid.toLowerCase(),o=`${n}:${t.nid||r}`,i=e$(o);if(i)e=i.serialize(e,t);let c=e,s=e.nss;return c.path=`${r||t.nid}:${s}`,t.skipEscape=!0,c}function tae(e,t){let n=e;if(n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!Wie(n.uuid)))n.error=n.error||"UUID is not valid.";return n}function nae(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var _6={scheme:"http",domainHost:!0,parse:D6,serialize:z6},oae={scheme:"https",domainHost:_6.domainHost,parse:D6,serialize:z6},Fu={scheme:"ws",domainHost:!0,parse:Yie,serialize:Qie},rae={scheme:"wss",domainHost:Fu.domainHost,parse:Fu.parse,serialize:Fu.serialize},iae={scheme:"urn",parse:Vie,serialize:eae,skipNormalize:!0},aae={scheme:"urn:uuid",parse:tae,serialize:nae,skipNormalize:!0},Xu={http:_6,https:oae,ws:Fu,wss:rae,urn:iae,"urn:uuid":aae};Object.setPrototypeOf(Xu,null);function e$(e){return e&&(Xu[e]||Xu[e.toLowerCase()])||void 0}j6.exports={wsIsSecure:VP,SCHEMES:Xu,isValidSchemeName:Xie,getSchemeHandler:e$}});var E6=G((l0e,Yu)=>{var{normalizeIPv6:cae,removeDotSegments:Lc,recomposeAuthority:sae,normalizePercentEncoding:hae,normalizePathEncoding:lae,escapePreservingEscapes:uae,reescapeHostDelimiters:gae,isIPv4:dae,nonSimpleDomain:yae}=QP(),{SCHEMES:bae,getSchemeHandler:R6}=N6();function mae(e,t){if(typeof e==="string")e=vae(e,t);else if(typeof e==="object")e=yi(Wo(e,t),t);return e}function pae(e,t,n){let r=n?Object.assign({scheme:"null"},n):{scheme:"null"},o=U6(yi(e,r),yi(t,r),r,!0);return r.skipEscape=!0,Wo(o,r)}function U6(e,t,n,r){let o={};if(!r)e=yi(Wo(e,n),n),t=yi(Wo(t,n),n);if(n=n||{},!n.tolerant&&t.scheme)o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Lc(t.path||""),o.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Lc(t.path||""),o.query=t.query;else{if(!t.path)if(o.path=e.path,t.query!==void 0)o.query=t.query;else o.query=e.query;else{if(t.path[0]==="/")o.path=Lc(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)o.path="/"+t.path;else if(!e.path)o.path=t.path;else o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;o.path=Lc(o.path)}o.query=t.query}o.userinfo=e.userinfo,o.host=e.host,o.port=e.port}o.scheme=e.scheme}return o.fragment=t.fragment,o}function wae(e,t,n){let r=x6(e,n),o=x6(t,n);return r!==void 0&&o!==void 0&&r.toLowerCase()===o.toLowerCase()}function Wo(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},r=Object.assign({},t),o=[],i=R6(r.scheme||n.scheme);if(i&&i.serialize)i.serialize(n,r);if(n.path!==void 0)if(!r.skipEscape){if(n.path=uae(n.path),n.scheme!==void 0)n.path=n.path.split("%3A").join(":")}else n.path=hae(n.path);if(r.reference!=="suffix"&&n.scheme)o.push(n.scheme,":");let c=sae(n);if(c!==void 0){if(r.reference!=="suffix")o.push("//");if(o.push(c),n.path&&n.path[0]!=="/")o.push("/")}if(n.path!==void 0){let s=n.path;if(!r.absolutePath&&(!i||!i.absolutePath))s=Lc(s);if(c===void 0&&s[0]==="/"&&s[1]==="/")s="/%2F"+s.slice(2);o.push(s)}if(n.query!==void 0)o.push("?",n.query);if(n.fragment!==void 0)o.push("#",n.fragment);return o.join("")}var fae=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function kae(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port==="number"&&(e.port<0||e.port>65535))return"URI port is malformed.";return}function M6(e,t){let n=Object.assign({},t),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,i=!1;if(n.reference==="suffix")if(n.scheme)e=n.scheme+":"+e;else e="//"+e;let c=e.match(fae);if(c){if(r.scheme=c[1],r.userinfo=c[3],r.host=c[4],r.port=parseInt(c[5],10),r.path=c[6]||"",r.query=c[7],r.fragment=c[8],isNaN(r.port))r.port=c[5];let s=kae(r,c);if(s!==void 0)r.error=r.error||s,o=!0;if(r.host)if(dae(r.host)===!1){let u=cae(r.host);r.host=u.host.toLowerCase(),i=u.isIPV6}else i=!0;if(r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path)r.reference="same-document";else if(r.scheme===void 0)r.reference="relative";else if(r.fragment===void 0)r.reference="absolute";else r.reference="uri";if(n.reference&&n.reference!=="suffix"&&n.reference!==r.reference)r.error=r.error||"URI is not a "+n.reference+" reference.";let h=R6(n.scheme||r.scheme);if(!n.unicodeSupport&&(!h||!h.unicodeSupport)){if(r.host&&(n.domainHost||h&&h.domainHost)&&i===!1&&yae(r.host))try{r.host=new URL("http://"+r.host).hostname}catch(l){r.error=r.error||"Host's domain name can not be converted to ASCII: "+l}}if(!h||h&&!h.skipNormalize){if(e.indexOf("%")!==-1){if(r.scheme!==void 0)r.scheme=unescape(r.scheme);if(r.host!==void 0)r.host=gae(unescape(r.host),i)}if(r.path)r.path=lae(r.path);if(r.fragment)try{r.fragment=encodeURI(decodeURIComponent(r.fragment))}catch{r.error=r.error||"URI malformed"}}if(h&&h.parse)h.parse(r,n)}else r.error=r.error||"URI can not be parsed.";return{parsed:r,malformedAuthorityOrPort:o}}function yi(e,t){return M6(e,t).parsed}function vae(e,t){return K6(e,t).normalized}function K6(e,t){let{parsed:n,malformedAuthorityOrPort:r}=M6(e,t);return{normalized:r?e:Wo(n,t),malformedAuthorityOrPort:r}}function x6(e,t){if(typeof e==="string"){let{normalized:n,malformedAuthorityOrPort:r}=K6(e,t);return r?void 0:n}if(typeof e==="object")return Wo(e,t)}var t$={SCHEMES:bae,normalize:mae,resolve:pae,resolveComponent:U6,equal:wae,serialize:Wo,parse:yi};Yu.exports=t$;Yu.exports.default=t$;Yu.exports.fastUri=t$});var J6=G((G6)=>{Object.defineProperty(G6,"__esModule",{value:!0});var q6=E6();q6.code='require("ajv/dist/runtime/uri").default';G6.default=q6});var Q6=G((En)=>{Object.defineProperty(En,"__esModule",{value:!0});En.CodeGen=En.Name=En.nil=En.stringify=En.str=En._=En.KeywordCxt=void 0;var Pae=Pc();Object.defineProperty(En,"KeywordCxt",{enumerable:!0,get:function(){return Pae.KeywordCxt}});var bi=ye();Object.defineProperty(En,"_",{enumerable:!0,get:function(){return bi._}});Object.defineProperty(En,"str",{enumerable:!0,get:function(){return bi.str}});Object.defineProperty(En,"stringify",{enumerable:!0,get:function(){return bi.stringify}});Object.defineProperty(En,"nil",{enumerable:!0,get:function(){return bi.nil}});Object.defineProperty(En,"Name",{enumerable:!0,get:function(){return bi.Name}});Object.defineProperty(En,"CodeGen",{enumerable:!0,get:function(){return bi.CodeGen}});var $ae=Bu(),F6=$c(),Iae=_P(),Tc=Zu(),Lae=ye(),Oc=kc(),Qu=fc(),o$=ke(),H6=$6(),Tae=J6(),X6=(e,t)=>new RegExp(e,t);X6.code="new RegExp";var Oae=["removeAdditional","useDefaults","coerceTypes"],Aae=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Cae={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Dae={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},B6=200;function zae(e){var t,n,r,o,i,c,s,h,l,u,d,y,p,f,k,L,A,K,x,Y,E,we,Et,Zi,_d;let Fi=e.strict,jd=(t=e.code)===null||t===void 0?void 0:t.optimize,VL=jd===!0||jd===void 0?1:jd||0,eT=(r=(n=e.code)===null||n===void 0?void 0:n.regExp)!==null&&r!==void 0?r:X6,KY=(o=e.uriResolver)!==null&&o!==void 0?o:Tae.default;return{strictSchema:(c=(i=e.strictSchema)!==null&&i!==void 0?i:Fi)!==null&&c!==void 0?c:!0,strictNumbers:(h=(s=e.strictNumbers)!==null&&s!==void 0?s:Fi)!==null&&h!==void 0?h:!0,strictTypes:(u=(l=e.strictTypes)!==null&&l!==void 0?l:Fi)!==null&&u!==void 0?u:"log",strictTuples:(y=(d=e.strictTuples)!==null&&d!==void 0?d:Fi)!==null&&y!==void 0?y:"log",strictRequired:(f=(p=e.strictRequired)!==null&&p!==void 0?p:Fi)!==null&&f!==void 0?f:!1,code:e.code?{...e.code,optimize:VL,regExp:eT}:{optimize:VL,regExp:eT},loopRequired:(k=e.loopRequired)!==null&&k!==void 0?k:B6,loopEnum:(L=e.loopEnum)!==null&&L!==void 0?L:B6,meta:(A=e.meta)!==null&&A!==void 0?A:!0,messages:(K=e.messages)!==null&&K!==void 0?K:!0,inlineRefs:(x=e.inlineRefs)!==null&&x!==void 0?x:!0,schemaId:(Y=e.schemaId)!==null&&Y!==void 0?Y:"$id",addUsedSchema:(E=e.addUsedSchema)!==null&&E!==void 0?E:!0,validateSchema:(we=e.validateSchema)!==null&&we!==void 0?we:!0,validateFormats:(Et=e.validateFormats)!==null&&Et!==void 0?Et:!0,unicodeRegExp:(Zi=e.unicodeRegExp)!==null&&Zi!==void 0?Zi:!0,int32range:(_d=e.int32range)!==null&&_d!==void 0?_d:!0,uriResolver:KY}}class Vu{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...zae(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new Lae.ValueScope({scope:{},prefixes:Aae,es5:t,lines:n}),this.logger=Uae(e.logger);let r=e.validateFormats;if(e.validateFormats=!1,this.RULES=(0,Iae.getRules)(),W6.call(this,Cae,e,"NOT SUPPORTED"),W6.call(this,Dae,e,"DEPRECATED","warn"),this._metaOpts=xae.call(this),e.formats)jae.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)Nae.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);_ae.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=H6;if(n==="id")r={...H6},r.id=r.$id,delete r.$id;if(t&&e)this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);if(!("$async"in n))this.errors=n.errors;return r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(l,u){await o.call(this,l.$schema);let d=this._addSchema(l,u);return d.validate||i.call(this,d)}async function o(l){if(l&&!this.getSchema(l))await r.call(this,{$ref:l},!0)}async function i(l){try{return this._compileSchemaEnv(l)}catch(u){if(!(u instanceof F6.default))throw u;return c.call(this,u),await s.call(this,u.missingSchema),i.call(this,l)}}function c({missingSchema:l,missingRef:u}){if(this.refs[l])throw Error(`AnySchema ${l} is loaded but ${u} cannot be resolved`)}async function s(l){let u=await h.call(this,l);if(!this.refs[l])await o.call(this,u.$schema);if(!this.refs[l])this.addSchema(u,l,t)}async function h(l){let u=this._loading[l];if(u)return u;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,n,r);return this}let o;if(typeof e==="object"){let{schemaId:i}=this.opts;if(o=e[i],o!==void 0&&typeof o!="string")throw Error(`schema ${i} must be string`)}return t=(0,Oc.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw Error(o)}return r}getSchema(e){let t;while(typeof(t=Z6.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new Tc.SchemaEnv({schema:{},schemaId:n});if(t=Tc.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=Z6.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];if(n)n=(0,Oc.normalizeId)(n),delete this.schemas[n],delete this.refs[n];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e=="string"){if(n=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n}else if(typeof e=="object"&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Kae.call(this,n,t),!t)return(0,o$.eachItem)(n,(o)=>n$.call(this,o)),this;qae.call(this,t);let r={...t,type:(0,Qu.getJSONTypes)(t.type),schemaType:(0,Qu.getJSONTypes)(t.schemaType)};return(0,o$.eachItem)(n,r.type.length===0?(o)=>n$.call(this,o,r):(o)=>r.type.forEach((i)=>n$.call(this,o,r,i))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let r=n.rules.findIndex((o)=>o.keyword===e);if(r>=0)n.rules.splice(r,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){if(!e||e.length===0)return"No errors";return e.map((r)=>`${n}${r.instancePath} ${r.message}`).reduce((r,o)=>r+t+o)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let o=r.split("/").slice(1),i=e;for(let c of o)i=i[c];for(let c in n){let s=n[c];if(typeof s!="object")continue;let{$data:h}=s.definition,l=i[c];if(h&&l)i[c]=Y6(l)}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];if(!t||t.test(n)){if(typeof r=="string")delete e[n];else if(r&&!r.meta)this._cache.delete(r.schema),delete e[n]}}}_addSchema(e,t,n,r=this.opts.validateSchema,o=this.opts.addUsedSchema){let i,{schemaId:c}=this.opts;if(typeof e=="object")i=e[c];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let s=this._cache.get(e);if(s!==void 0)return s;n=(0,Oc.normalizeId)(i||n);let h=Oc.getSchemaRefs.call(this,e,n);if(s=new Tc.SchemaEnv({schema:e,schemaId:c,meta:t,baseId:n,localRefs:h}),this._cache.set(s.schema,s),o&&!n.startsWith("#")){if(n)this._checkUnique(n);this.refs[n]=s}if(r)this.validateSchema(e,!0);return s}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else Tc.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Tc.compileSchema.call(this,e)}finally{this.opts=t}}}Vu.ValidationError=$ae.default;Vu.MissingRefError=F6.default;En.default=Vu;function W6(e,t,n,r="error"){for(let o in e){let i=o;if(i in t)this.logger[r](`${n}: option ${o}. ${e[i]}`)}}function Z6(e){return e=(0,Oc.normalizeId)(e),this.schemas[e]||this.refs[e]}function _ae(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function jae(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function Nae(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let n=e[t];if(!n.keyword)n.keyword=t;this.addKeyword(n)}}function xae(){let e={...this.opts};for(let t of Oae)delete e[t];return e}var Rae={log(){},warn(){},error(){}};function Uae(e){if(e===!1)return Rae;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var Mae=/^[a-z_$][a-z0-9_$:-]*$/i;function Kae(e,t){let{RULES:n}=this;if((0,o$.eachItem)(e,(r)=>{if(n.keywords[r])throw Error(`Keyword ${r} is already defined`);if(!Mae.test(r))throw Error(`Keyword ${r} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function n$(e,t,n){var r;let o=t===null||t===void 0?void 0:t.post;if(n&&o)throw Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,c=o?i.post:i.rules.find(({type:h})=>h===n);if(!c)c={type:n,rules:[]},i.rules.push(c);if(i.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,Qu.getJSONTypes)(t.type),schemaType:(0,Qu.getJSONTypes)(t.schemaType)}};if(t.before)Eae.call(this,c,s,t.before);else c.rules.push(s);i.all[e]=s,(r=t.implements)===null||r===void 0||r.forEach((h)=>this.addKeyword(h))}function Eae(e,t,n){let r=e.rules.findIndex((o)=>o.keyword===n);if(r>=0)e.rules.splice(r,0,t);else e.rules.push(t),this.logger.warn(`rule ${n} is not defined`)}function qae(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=Y6(t);e.validateSchema=this.compile(t,!0)}var Gae={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Y6(e){return{anyOf:[e,Gae]}}});var eM=G((V6)=>{Object.defineProperty(V6,"__esModule",{value:!0});var Bae={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};V6.default=Bae});var aM=G((rM)=>{Object.defineProperty(rM,"__esModule",{value:!0});rM.callRef=rM.getValidate=void 0;var Zae=$c(),tM=Yt(),Tt=ye(),mi=Mn(),nM=Zu(),eg=ke(),Fae={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:n,it:r}=e,{baseId:o,schemaEnv:i,validateName:c,opts:s,self:h}=r,{root:l}=i;if((n==="#"||n==="#/")&&o===l.baseId)return d();let u=nM.resolveRef.call(h,l,o,n);if(u===void 0)throw new Zae.default(r.opts.uriResolver,o,n);if(u instanceof nM.SchemaEnv)return y(u);return p(u);function d(){if(i===l)return tg(e,c,i,i.$async);let f=t.scopeValue("root",{ref:l});return tg(e,Tt._`${f}.validate`,l,l.$async)}function y(f){let k=oM(e,f);tg(e,k,f,f.$async)}function p(f){let k=t.scopeValue("schema",s.code.source===!0?{ref:f,code:(0,Tt.stringify)(f)}:{ref:f}),L=t.name("valid"),A=e.subschema({schema:f,dataTypes:[],schemaPath:Tt.nil,topSchemaRef:k,errSchemaPath:n},L);e.mergeEvaluated(A),e.ok(L)}}};function oM(e,t){let{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):Tt._`${n.scopeValue("wrapper",{ref:t})}.validate`}rM.getValidate=oM;function tg(e,t,n,r){let{gen:o,it:i}=e,{allErrors:c,schemaEnv:s,opts:h}=i,l=h.passContext?mi.default.this:Tt.nil;if(r)u();else d();function u(){if(!s.$async)throw Error("async schema referenced by sync schema");let f=o.let("valid");o.try(()=>{if(o.code(Tt._`await ${(0,tM.callValidateCode)(e,t,l)}`),p(t),!c)o.assign(f,!0)},(k)=>{if(o.if(Tt._`!(${k} instanceof ${i.ValidationError})`,()=>o.throw(k)),y(k),!c)o.assign(f,!1)}),e.ok(f)}function d(){e.result((0,tM.callValidateCode)(e,t,l),()=>p(t),()=>y(t))}function y(f){let k=Tt._`${f}.errors`;o.assign(mi.default.vErrors,Tt._`${mi.default.vErrors} === null ? ${k} : ${mi.default.vErrors}.concat(${k})`),o.assign(mi.default.errors,Tt._`${mi.default.vErrors}.length`)}function p(f){var k;if(!i.opts.unevaluated)return;let L=(k=n===null||n===void 0?void 0:n.validate)===null||k===void 0?void 0:k.evaluated;if(i.props!==!0)if(L&&!L.dynamicProps){if(L.props!==void 0)i.props=eg.mergeEvaluated.props(o,L.props,i.props)}else{let A=o.var("props",Tt._`${f}.evaluated.props`);i.props=eg.mergeEvaluated.props(o,A,i.props,Tt.Name)}if(i.items!==!0)if(L&&!L.dynamicItems){if(L.items!==void 0)i.items=eg.mergeEvaluated.items(o,L.items,i.items)}else{let A=o.var("items",Tt._`${f}.evaluated.items`);i.items=eg.mergeEvaluated.items(o,A,i.items,Tt.Name)}}}rM.callRef=tg;rM.default=Fae});var sM=G((cM)=>{Object.defineProperty(cM,"__esModule",{value:!0});var Qae=eM(),Vae=aM(),ece=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Qae.default,Vae.default];cM.default=ece});var lM=G((hM)=>{Object.defineProperty(hM,"__esModule",{value:!0});var ng=ye(),po=ng.operators,og={maximum:{okStr:"<=",ok:po.LTE,fail:po.GT},minimum:{okStr:">=",ok:po.GTE,fail:po.LT},exclusiveMaximum:{okStr:"<",ok:po.LT,fail:po.GTE},exclusiveMinimum:{okStr:">",ok:po.GT,fail:po.LTE}},nce={message:({keyword:e,schemaCode:t})=>ng.str`must be ${og[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>ng._`{comparison: ${og[e].okStr}, limit: ${t}}`},oce={keyword:Object.keys(og),type:"number",schemaType:"number",$data:!0,error:nce,code(e){let{keyword:t,data:n,schemaCode:r}=e;e.fail$data(ng._`${n} ${og[t].fail} ${r} || isNaN(${n})`)}};hM.default=oce});var gM=G((uM)=>{Object.defineProperty(uM,"__esModule",{value:!0});var Ac=ye(),ice={message:({schemaCode:e})=>Ac.str`must be multiple of ${e}`,params:({schemaCode:e})=>Ac._`{multipleOf: ${e}}`},ace={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:ice,code(e){let{gen:t,data:n,schemaCode:r,it:o}=e,i=o.opts.multipleOfPrecision,c=t.let("res"),s=i?Ac._`Math.abs(Math.round(${c}) - ${c}) > 1e-${i}`:Ac._`${c} !== parseInt(${c})`;e.fail$data(Ac._`(${r} === 0 || (${c} = ${n}/${r}, ${s}))`)}};uM.default=ace});var bM=G((yM)=>{Object.defineProperty(yM,"__esModule",{value:!0});function dM(e){let t=e.length,n=0,r=0,o;while(r<t)if(n++,o=e.charCodeAt(r++),o>=55296&&o<=56319&&r<t){if(o=e.charCodeAt(r),(o&64512)===56320)r++}return n}yM.default=dM;dM.code='require("ajv/dist/runtime/ucs2length").default'});var pM=G((mM)=>{Object.defineProperty(mM,"__esModule",{value:!0});var Zo=ye(),hce=ke(),lce=bM(),uce={message({keyword:e,schemaCode:t}){let n=e==="maxLength"?"more":"fewer";return Zo.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>Zo._`{limit: ${e}}`},gce={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:uce,code(e){let{keyword:t,data:n,schemaCode:r,it:o}=e,i=t==="maxLength"?Zo.operators.GT:Zo.operators.LT,c=o.opts.unicode===!1?Zo._`${n}.length`:Zo._`${(0,hce.useFunc)(e.gen,lce.default)}(${n})`;e.fail$data(Zo._`${c} ${i} ${r}`)}};mM.default=gce});var fM=G((wM)=>{Object.defineProperty(wM,"__esModule",{value:!0});var yce=Yt(),bce=ke(),pi=ye(),mce={message:({schemaCode:e})=>pi.str`must match pattern "${e}"`,params:({schemaCode:e})=>pi._`{pattern: ${e}}`},pce={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:mce,code(e){let{gen:t,data:n,$data:r,schema:o,schemaCode:i,it:c}=e,s=c.opts.unicodeRegExp?"u":"";if(r){let{regExp:h}=c.opts.code,l=h.code==="new RegExp"?pi._`new RegExp`:(0,bce.useFunc)(t,h),u=t.let("valid");t.try(()=>t.assign(u,pi._`${l}(${i}, ${s}).test(${n})`),()=>t.assign(u,!1)),e.fail$data(pi._`!${u}`)}else{let h=(0,yce.usePattern)(e,o);e.fail$data(pi._`!${h}.test(${n})`)}}};wM.default=pce});var vM=G((kM)=>{Object.defineProperty(kM,"__esModule",{value:!0});var Cc=ye(),fce={message({keyword:e,schemaCode:t}){let n=e==="maxProperties"?"more":"fewer";return Cc.str`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>Cc._`{limit: ${e}}`},kce={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:fce,code(e){let{keyword:t,data:n,schemaCode:r}=e,o=t==="maxProperties"?Cc.operators.GT:Cc.operators.LT;e.fail$data(Cc._`Object.keys(${n}).length ${o} ${r}`)}};kM.default=kce});var PM=G((SM)=>{Object.defineProperty(SM,"__esModule",{value:!0});var Dc=Yt(),zc=ye(),Sce=ke(),Pce={message:({params:{missingProperty:e}})=>zc.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>zc._`{missingProperty: ${e}}`},$ce={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Pce,code(e){let{gen:t,schema:n,schemaCode:r,data:o,$data:i,it:c}=e,{opts:s}=c;if(!i&&n.length===0)return;let h=n.length>=s.loopRequired;if(c.allErrors)l();else u();if(s.strictRequired){let p=e.parentSchema.properties,{definedProperties:f}=e.it;for(let k of n)if((p===null||p===void 0?void 0:p[k])===void 0&&!f.has(k)){let L=c.schemaEnv.baseId+c.errSchemaPath,A=`required property "${k}" is not defined at "${L}" (strictRequired)`;(0,Sce.checkStrictMode)(c,A,c.opts.strictRequired)}}function l(){if(h||i)e.block$data(zc.nil,d);else for(let p of n)(0,Dc.checkReportMissingProp)(e,p)}function u(){let p=t.let("missing");if(h||i){let f=t.let("valid",!0);e.block$data(f,()=>y(p,f)),e.ok(f)}else t.if((0,Dc.checkMissingProp)(e,n,p)),(0,Dc.reportMissingProp)(e,p),t.else()}function d(){t.forOf("prop",r,(p)=>{e.setParams({missingProperty:p}),t.if((0,Dc.noPropertyInData)(t,o,p,s.ownProperties),()=>e.error())})}function y(p,f){e.setParams({missingProperty:p}),t.forOf(p,r,()=>{t.assign(f,(0,Dc.propertyInData)(t,o,p,s.ownProperties)),t.if((0,zc.not)(f),()=>{e.error(),t.break()})},zc.nil)}}};SM.default=$ce});var IM=G(($M)=>{Object.defineProperty($M,"__esModule",{value:!0});var _c=ye(),Lce={message({keyword:e,schemaCode:t}){let n=e==="maxItems"?"more":"fewer";return _c.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>_c._`{limit: ${e}}`},Tce={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Lce,code(e){let{keyword:t,data:n,schemaCode:r}=e,o=t==="maxItems"?_c.operators.GT:_c.operators.LT;e.fail$data(_c._`${n}.length ${o} ${r}`)}};$M.default=Tce});var rg=G((TM)=>{Object.defineProperty(TM,"__esModule",{value:!0});var LM=EP();LM.code='require("ajv/dist/runtime/equal").default';TM.default=LM});var AM=G((OM)=>{Object.defineProperty(OM,"__esModule",{value:!0});var r$=fc(),rt=ye(),Cce=ke(),Dce=rg(),zce={message:({params:{i:e,j:t}})=>rt.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>rt._`{i: ${e}, j: ${t}}`},_ce={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:zce,code(e){let{gen:t,data:n,$data:r,schema:o,parentSchema:i,schemaCode:c,it:s}=e;if(!r&&!o)return;let h=t.let("valid"),l=i.items?(0,r$.getSchemaTypes)(i.items):[];e.block$data(h,u,rt._`${c} === false`),e.ok(h);function u(){let f=t.let("i",rt._`${n}.length`),k=t.let("j");e.setParams({i:f,j:k}),t.assign(h,!0),t.if(rt._`${f} > 1`,()=>(d()?y:p)(f,k))}function d(){return l.length>0&&!l.some((f)=>f==="object"||f==="array")}function y(f,k){let L=t.name("item"),A=(0,r$.checkDataTypes)(l,L,s.opts.strictNumbers,r$.DataType.Wrong),K=t.const("indices",rt._`{}`);t.for(rt._`;${f}--;`,()=>{if(t.let(L,rt._`${n}[${f}]`),t.if(A,rt._`continue`),l.length>1)t.if(rt._`typeof ${L} == "string"`,rt._`${L} += "_"`);t.if(rt._`typeof ${K}[${L}] == "number"`,()=>{t.assign(k,rt._`${K}[${L}]`),e.error(),t.assign(h,!1).break()}).code(rt._`${K}[${L}] = ${f}`)})}function p(f,k){let L=(0,Cce.useFunc)(t,Dce.default),A=t.name("outer");t.label(A).for(rt._`;${f}--;`,()=>t.for(rt._`${k} = ${f}; ${k}--;`,()=>t.if(rt._`${L}(${n}[${f}], ${n}[${k}])`,()=>{e.error(),t.assign(h,!1).break(A)})))}}};OM.default=_ce});var DM=G((CM)=>{Object.defineProperty(CM,"__esModule",{value:!0});var i$=ye(),Nce=ke(),xce=rg(),Rce={message:"must be equal to constant",params:({schemaCode:e})=>i$._`{allowedValue: ${e}}`},Uce={keyword:"const",$data:!0,error:Rce,code(e){let{gen:t,data:n,$data:r,schemaCode:o,schema:i}=e;if(r||i&&typeof i=="object")e.fail$data(i$._`!${(0,Nce.useFunc)(t,xce.default)}(${n}, ${o})`);else e.fail(i$._`${i} !== ${n}`)}};CM.default=Uce});var _M=G((zM)=>{Object.defineProperty(zM,"__esModule",{value:!0});var jc=ye(),Kce=ke(),Ece=rg(),qce={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>jc._`{allowedValues: ${e}}`},Gce={keyword:"enum",schemaType:"array",$data:!0,error:qce,code(e){let{gen:t,data:n,$data:r,schema:o,schemaCode:i,it:c}=e;if(!r&&o.length===0)throw Error("enum must have non-empty array");let s=o.length>=c.opts.loopEnum,h,l=()=>h!==null&&h!==void 0?h:h=(0,Kce.useFunc)(t,Ece.default),u;if(s||r)u=t.let("valid"),e.block$data(u,d);else{if(!Array.isArray(o))throw Error("ajv implementation error");let p=t.const("vSchema",i);u=(0,jc.or)(...o.map((f,k)=>y(p,k)))}e.pass(u);function d(){t.assign(u,!1),t.forOf("v",i,(p)=>t.if(jc._`${l()}(${n}, ${p})`,()=>t.assign(u,!0).break()))}function y(p,f){let k=o[f];return typeof k==="object"&&k!==null?jc._`${l()}(${n}, ${p}[${f}])`:jc._`${n} === ${k}`}}};zM.default=Gce});var NM=G((jM)=>{Object.defineProperty(jM,"__esModule",{value:!0});var Hce=lM(),Bce=gM(),Wce=pM(),Zce=fM(),Fce=vM(),Xce=PM(),Yce=IM(),Qce=AM(),Vce=DM(),ese=_M(),tse=[Hce.default,Bce.default,Wce.default,Zce.default,Fce.default,Xce.default,Yce.default,Qce.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Vce.default,ese.default];jM.default=tse});var c$=G((RM)=>{Object.defineProperty(RM,"__esModule",{value:!0});RM.validateAdditionalItems=void 0;var Fo=ye(),a$=ke(),ose={message:({params:{len:e}})=>Fo.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Fo._`{limit: ${e}}`},rse={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:ose,code(e){let{parentSchema:t,it:n}=e,{items:r}=t;if(!Array.isArray(r)){(0,a$.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}xM(e,r)}};function xM(e,t){let{gen:n,schema:r,data:o,keyword:i,it:c}=e;c.items=!0;let s=n.const("len",Fo._`${o}.length`);if(r===!1)e.setParams({len:t.length}),e.pass(Fo._`${s} <= ${t.length}`);else if(typeof r=="object"&&!(0,a$.alwaysValidSchema)(c,r)){let l=n.var("valid",Fo._`${s} <= ${t.length}`);n.if((0,Fo.not)(l),()=>h(l)),e.ok(l)}function h(l){n.forRange("i",t.length,s,(u)=>{if(e.subschema({keyword:i,dataProp:u,dataPropType:a$.Type.Num},l),!c.allErrors)n.if((0,Fo.not)(l),()=>n.break())})}}RM.validateAdditionalItems=xM;RM.default=rse});var s$=G((EM)=>{Object.defineProperty(EM,"__esModule",{value:!0});EM.validateTuple=void 0;var MM=ye(),ig=ke(),ase=Yt(),cse={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:n}=e;if(Array.isArray(t))return KM(e,"additionalItems",t);if(n.items=!0,(0,ig.alwaysValidSchema)(n,t))return;e.ok((0,ase.validateArray)(e))}};function KM(e,t,n=e.schema){let{gen:r,parentSchema:o,data:i,keyword:c,it:s}=e;if(u(o),s.opts.unevaluated&&n.length&&s.items!==!0)s.items=ig.mergeEvaluated.items(r,n.length,s.items);let h=r.name("valid"),l=r.const("len",MM._`${i}.length`);n.forEach((d,y)=>{if((0,ig.alwaysValidSchema)(s,d))return;r.if(MM._`${l} > ${y}`,()=>e.subschema({keyword:c,schemaProp:y,dataProp:y},h)),e.ok(h)});function u(d){let{opts:y,errSchemaPath:p}=s,f=n.length,k=f===d.minItems&&(f===d.maxItems||d[t]===!1);if(y.strictTuples&&!k){let L=`"${c}" is ${f}-tuple, but minItems or maxItems/${t} are not specified or different at path "${p}"`;(0,ig.checkStrictMode)(s,L,y.strictTuples)}}}EM.validateTuple=KM;EM.default=cse});var JM=G((GM)=>{Object.defineProperty(GM,"__esModule",{value:!0});var hse=s$(),lse={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>(0,hse.validateTuple)(e,"items")};GM.default=lse});var WM=G((BM)=>{Object.defineProperty(BM,"__esModule",{value:!0});var HM=ye(),gse=ke(),dse=Yt(),yse=c$(),bse={message:({params:{len:e}})=>HM.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>HM._`{limit: ${e}}`},mse={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:bse,code(e){let{schema:t,parentSchema:n,it:r}=e,{prefixItems:o}=n;if(r.items=!0,(0,gse.alwaysValidSchema)(r,t))return;if(o)(0,yse.validateAdditionalItems)(e,o);else e.ok((0,dse.validateArray)(e))}};BM.default=mse});var FM=G((ZM)=>{Object.defineProperty(ZM,"__esModule",{value:!0});var Qt=ye(),ag=ke(),wse={message:({params:{min:e,max:t}})=>t===void 0?Qt.str`must contain at least ${e} valid item(s)`:Qt.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?Qt._`{minContains: ${e}}`:Qt._`{minContains: ${e}, maxContains: ${t}}`},fse={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:wse,code(e){let{gen:t,schema:n,parentSchema:r,data:o,it:i}=e,c,s,{minContains:h,maxContains:l}=r;if(i.opts.next)c=h===void 0?1:h,s=l;else c=1;let u=t.const("len",Qt._`${o}.length`);if(e.setParams({min:c,max:s}),s===void 0&&c===0){(0,ag.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&c>s){(0,ag.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,ag.alwaysValidSchema)(i,n)){let k=Qt._`${u} >= ${c}`;if(s!==void 0)k=Qt._`${k} && ${u} <= ${s}`;e.pass(k);return}i.items=!0;let d=t.name("valid");if(s===void 0&&c===1)p(d,()=>t.if(d,()=>t.break()));else if(c===0){if(t.let(d,!0),s!==void 0)t.if(Qt._`${o}.length > 0`,y)}else t.let(d,!1),y();e.result(d,()=>e.reset());function y(){let k=t.name("_valid"),L=t.let("count",0);p(k,()=>t.if(k,()=>f(L)))}function p(k,L){t.forRange("i",0,u,(A)=>{e.subschema({keyword:"contains",dataProp:A,dataPropType:ag.Type.Num,compositeRule:!0},k),L()})}function f(k){if(t.code(Qt._`${k}++`),s===void 0)t.if(Qt._`${k} >= ${c}`,()=>t.assign(d,!0).break());else if(t.if(Qt._`${k} > ${s}`,()=>t.assign(d,!1).break()),c===1)t.assign(d,!0);else t.if(Qt._`${k} >= ${c}`,()=>t.assign(d,!0))}}};ZM.default=fse});var tK=G((QM)=>{Object.defineProperty(QM,"__esModule",{value:!0});QM.validateSchemaDeps=QM.validatePropertyDeps=QM.error=void 0;var h$=ye(),vse=ke(),Nc=Yt();QM.error={message:({params:{property:e,depsCount:t,deps:n}})=>{let r=t===1?"property":"properties";return h$.str`must have ${r} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:r}})=>h$._`{property: ${e},
7478
+ || ${c} === "boolean" || ${o} === null`).assign(s,ge._`[${o}]`)}}}function xoe({gen:e,parentData:t,parentDataProperty:n},r){e.if(ge._`${t} !== undefined`,()=>e.assign(ge._`${t}[${n}]`,r))}function NP(e,t,n,r=ui.Correct){let o=r===ui.Correct?ge.operators.EQ:ge.operators.NEQ,i;switch(e){case"null":return ge._`${t} ${o} null`;case"array":i=ge._`Array.isArray(${t})`;break;case"object":i=ge._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=c(ge._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=c();break;default:return ge._`typeof ${t} ${o} ${e}`}return r===ui.Correct?i:(0,ge.not)(i);function c(s=ge.nil){return(0,ge.and)(ge._`typeof ${t} == "number"`,s,n?ge._`isFinite(${t})`:ge.nil)}}T0.checkDataType=NP;function xP(e,t,n,r){if(e.length===1)return NP(e[0],t,n,r);let o,i=(0,$0.toHash)(e);if(i.array&&i.object){let c=ge._`typeof ${t} != "object"`;o=i.null?c:ge._`!${t} || ${c}`,delete i.null,delete i.array,delete i.object}else o=ge.nil;if(i.number)delete i.integer;for(let c in i)o=(0,ge.and)(o,NP(c,t,n,r));return o}T0.checkDataTypes=xP;var Roe={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?ge._`{type: ${e}}`:ge._`{type: ${t}}`};function RP(e){let t=Uoe(e);(0,Doe.reportError)(t,Roe)}T0.reportTypeError=RP;function Uoe(e){let{gen:t,data:n,schema:r}=e,o=(0,$0.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:o,schemaValue:o,parentSchema:r,params:{},it:e}}});var z0=G((C0)=>{Object.defineProperty(C0,"__esModule",{value:!0});C0.assignDefaults=void 0;var gi=ye(),Hoe=ke();function Boe(e,t){let{properties:n,items:r}=e.schema;if(t==="object"&&n)for(let o in n)A0(e,o,n[o].default);else if(t==="array"&&Array.isArray(r))r.forEach((o,i)=>A0(e,i,o.default))}C0.assignDefaults=Boe;function A0(e,t,n){let{gen:r,compositeRule:o,data:i,opts:c}=e;if(n===void 0)return;let s=gi._`${i}${(0,gi.getProperty)(t)}`;if(o){(0,Hoe.checkStrictMode)(e,`default is ignored for: ${s}`);return}let h=gi._`${s} === undefined`;if(c.useDefaults==="empty")h=gi._`${h} || ${s} === null || ${s} === ""`;r.if(h,gi._`${s} = ${(0,gi.stringify)(n)}`)}});var Yt=G((N0)=>{Object.defineProperty(N0,"__esModule",{value:!0});N0.validateUnion=N0.validateArray=N0.usePattern=N0.callValidateCode=N0.schemaProperties=N0.allSchemaProperties=N0.noPropertyInData=N0.propertyInData=N0.isOwnProperty=N0.hasPropFunc=N0.reportMissingProp=N0.checkMissingProp=N0.checkReportMissingProp=void 0;var xe=ye(),UP=ke(),bo=Mn(),Woe=ke();function Zoe(e,t){let{gen:n,data:r,it:o}=e;n.if(KP(n,r,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:xe._`${t}`},!0),e.error()})}N0.checkReportMissingProp=Zoe;function Foe({gen:e,data:t,it:{opts:n}},r,o){return(0,xe.or)(...r.map((i)=>(0,xe.and)(KP(e,t,i,n.ownProperties),xe._`${o} = ${i}`)))}N0.checkMissingProp=Foe;function Xoe(e,t){e.setParams({missingProperty:t},!0),e.error()}N0.reportMissingProp=Xoe;function _0(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:xe._`Object.prototype.hasOwnProperty`})}N0.hasPropFunc=_0;function MP(e,t,n){return xe._`${_0(e)}.call(${t}, ${n})`}N0.isOwnProperty=MP;function Yoe(e,t,n,r){let o=xe._`${t}${(0,xe.getProperty)(n)} !== undefined`;return r?xe._`${o} && ${MP(e,t,n)}`:o}N0.propertyInData=Yoe;function KP(e,t,n,r){let o=xe._`${t}${(0,xe.getProperty)(n)} === undefined`;return r?(0,xe.or)(o,(0,xe.not)(MP(e,t,n))):o}N0.noPropertyInData=KP;function j0(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}N0.allSchemaProperties=j0;function Qoe(e,t){return j0(t).filter((n)=>!(0,UP.alwaysValidSchema)(e,t[n]))}N0.schemaProperties=Qoe;function Voe({schemaCode:e,data:t,it:{gen:n,topSchemaRef:r,schemaPath:o,errorPath:i},it:c},s,h,l){let u=l?xe._`${e}, ${t}, ${r}${o}`:t,d=[[bo.default.instancePath,(0,xe.strConcat)(bo.default.instancePath,i)],[bo.default.parentData,c.parentData],[bo.default.parentDataProperty,c.parentDataProperty],[bo.default.rootData,bo.default.rootData]];if(c.opts.dynamicRef)d.push([bo.default.dynamicAnchors,bo.default.dynamicAnchors]);let y=xe._`${u}, ${n.object(...d)}`;return h!==xe.nil?xe._`${s}.call(${h}, ${y})`:xe._`${s}(${y})`}N0.callValidateCode=Voe;var ere=xe._`new RegExp`;function tre({gen:e,it:{opts:t}},n){let r=t.unicodeRegExp?"u":"",{regExp:o}=t.code,i=o(n,r);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:xe._`${o.code==="new RegExp"?ere:(0,Woe.useFunc)(e,o)}(${n}, ${r})`})}N0.usePattern=tre;function nre(e){let{gen:t,data:n,keyword:r,it:o}=e,i=t.name("valid");if(o.allErrors){let s=t.let("valid",!0);return c(()=>t.assign(s,!1)),s}return t.var(i,!0),c(()=>t.break()),i;function c(s){let h=t.const("len",xe._`${n}.length`);t.forRange("i",0,h,(l)=>{e.subschema({keyword:r,dataProp:l,dataPropType:UP.Type.Num},i),t.if((0,xe.not)(i),s)})}}N0.validateArray=nre;function ore(e){let{gen:t,schema:n,keyword:r,it:o}=e;if(!Array.isArray(n))throw Error("ajv implementation error");if(n.some((h)=>(0,UP.alwaysValidSchema)(o,h))&&!o.opts.unevaluated)return;let c=t.let("valid",!1),s=t.name("_valid");t.block(()=>n.forEach((h,l)=>{let u=e.subschema({keyword:r,schemaProp:l,compositeRule:!0},s);if(t.assign(c,xe._`${c} || ${s}`),!e.mergeValidEvaluated(u,s))t.if((0,xe.not)(c))})),e.result(c,()=>e.reset(),()=>e.error(!0))}N0.validateUnion=ore});var E0=G((M0)=>{Object.defineProperty(M0,"__esModule",{value:!0});M0.validateKeywordUsage=M0.validSchemaType=M0.funcKeywordCode=M0.macroKeywordCode=void 0;var ft=ye(),Ho=Mn(),mre=Yt(),pre=wc();function wre(e,t){let{gen:n,keyword:r,schema:o,parentSchema:i,it:c}=e,s=t.macro.call(c.self,o,i,c),h=U0(n,r,s);if(c.opts.validateSchema!==!1)c.self.validateSchema(s,!0);let l=n.name("valid");e.subschema({schema:s,schemaPath:ft.nil,errSchemaPath:`${c.errSchemaPath}/${r}`,topSchemaRef:h,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}M0.macroKeywordCode=wre;function fre(e,t){var n;let{gen:r,keyword:o,schema:i,parentSchema:c,$data:s,it:h}=e;vre(h,t);let l=!s&&t.compile?t.compile.call(h.self,i,c,h):t.validate,u=U0(r,o,l),d=r.let("valid");e.block$data(d,y),e.ok((n=t.valid)!==null&&n!==void 0?n:d);function y(){if(t.errors===!1){if(k(),t.modifying)R0(e);L(()=>e.error())}else{let A=t.async?p():f();if(t.modifying)R0(e);L(()=>kre(e,A))}}function p(){let A=r.let("ruleErrs",null);return r.try(()=>k(ft._`await `),(K)=>r.assign(d,!1).if(ft._`${K} instanceof ${h.ValidationError}`,()=>r.assign(A,ft._`${K}.errors`),()=>r.throw(K))),A}function f(){let A=ft._`${u}.errors`;return r.assign(A,null),k(ft.nil),A}function k(A=t.async?ft._`await `:ft.nil){let K=h.opts.passContext?Ho.default.this:Ho.default.self,x=!(("compile"in t)&&!s||t.schema===!1);r.assign(d,ft._`${A}${(0,mre.callValidateCode)(e,u,K,x)}`,t.modifying)}function L(A){var K;r.if((0,ft.not)((K=t.valid)!==null&&K!==void 0?K:d),A)}}M0.funcKeywordCode=fre;function R0(e){let{gen:t,data:n,it:r}=e;t.if(r.parentData,()=>t.assign(n,ft._`${r.parentData}[${r.parentDataProperty}]`))}function kre(e,t){let{gen:n}=e;n.if(ft._`Array.isArray(${t})`,()=>{n.assign(Ho.default.vErrors,ft._`${Ho.default.vErrors} === null ? ${t} : ${Ho.default.vErrors}.concat(${t})`).assign(Ho.default.errors,ft._`${Ho.default.vErrors}.length`),(0,pre.extendErrors)(e)},()=>e.error())}function vre({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function U0(e,t,n){if(n===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,ft.stringify)(n)})}function Sre(e,t,n=!1){return!t.length||t.some((r)=>r==="array"?Array.isArray(e):r==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==r||n&&typeof e>"u")}M0.validSchemaType=Sre;function Pre({schema:e,opts:t,self:n,errSchemaPath:r},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw Error("ajv implementation error");let c=o.dependencies;if(c===null||c===void 0?void 0:c.some((s)=>!Object.prototype.hasOwnProperty.call(e,s)))throw Error(`parent schema must have dependencies of ${i}: ${c.join(",")}`);if(o.validateSchema){if(!o.validateSchema(e[i])){let h=`keyword "${i}" value is invalid at path "${r}": `+n.errorsText(o.validateSchema.errors);if(t.validateSchema==="log")n.logger.error(h);else throw Error(h)}}}M0.validateKeywordUsage=Pre});var H0=G((G0)=>{Object.defineProperty(G0,"__esModule",{value:!0});G0.extendSubschemaMode=G0.extendSubschemaData=G0.getSubschema=void 0;var Pn=ye(),q0=ke();function Tre(e,{keyword:t,schemaProp:n,schema:r,schemaPath:o,errSchemaPath:i,topSchemaRef:c}){if(t!==void 0&&r!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let s=e.schema[t];return n===void 0?{schema:s,schemaPath:Pn._`${e.schemaPath}${(0,Pn.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[n],schemaPath:Pn._`${e.schemaPath}${(0,Pn.getProperty)(t)}${(0,Pn.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,q0.escapeFragment)(n)}`}}if(r!==void 0){if(o===void 0||i===void 0||c===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:o,topSchemaRef:c,errSchemaPath:i}}throw Error('either "keyword" or "schema" must be passed')}G0.getSubschema=Tre;function Ore(e,t,{dataProp:n,dataPropType:r,data:o,dataTypes:i,propertyName:c}){if(o!==void 0&&n!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=t;if(n!==void 0){let{errorPath:l,dataPathArr:u,opts:d}=t,y=s.let("data",Pn._`${t.data}${(0,Pn.getProperty)(n)}`,!0);h(y),e.errorPath=Pn.str`${l}${(0,q0.getErrorPath)(n,r,d.jsPropertySyntax)}`,e.parentDataProperty=Pn._`${n}`,e.dataPathArr=[...u,e.parentDataProperty]}if(o!==void 0){let l=o instanceof Pn.Name?o:s.let("data",o,!0);if(h(l),c!==void 0)e.propertyName=c}if(i)e.dataTypes=i;function h(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}G0.extendSubschemaData=Ore;function Are(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:o,allErrors:i}){if(r!==void 0)e.compositeRule=r;if(o!==void 0)e.createErrors=o;if(i!==void 0)e.allErrors=i;e.jtdDiscriminator=t,e.jtdMetadata=n}G0.extendSubschemaMode=Are});var EP=G((i0e,B0)=>{B0.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var c=i[o];if(!e(t[c],n[c]))return!1}return!0}return t!==t&&n!==n}});var Z0=G((a0e,W0)=>{var mo=W0.exports=function(e,t,n){if(typeof t=="function")n=t,t={};n=t.cb||n;var r=typeof n=="function"?n:n.pre||function(){},o=n.post||function(){};Ju(t,r,o,e,"",e)};mo.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};mo.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};mo.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};mo.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Ju(e,t,n,r,o,i,c,s,h,l){if(r&&typeof r=="object"&&!Array.isArray(r)){t(r,o,i,c,s,h,l);for(var u in r){var d=r[u];if(Array.isArray(d)){if(u in mo.arrayKeywords)for(var y=0;y<d.length;y++)Ju(e,t,n,d[y],o+"/"+u+"/"+y,i,o,u,r,y)}else if(u in mo.propsKeywords){if(d&&typeof d=="object")for(var p in d)Ju(e,t,n,d[p],o+"/"+u+"/"+zre(p),i,o,u,r,p)}else if(u in mo.keywords||e.allKeys&&!(u in mo.skipKeywords))Ju(e,t,n,d,o+"/"+u,i,o,u,r)}n(r,o,i,c,s,h,l)}}function zre(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var kc=G((Q0)=>{Object.defineProperty(Q0,"__esModule",{value:!0});Q0.getSchemaRefs=Q0.resolveUrl=Q0.normalizeId=Q0._getFullPath=Q0.getFullPath=Q0.inlineRef=void 0;var _re=ke(),jre=EP(),Nre=Z0(),xre=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Rre(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!qP(e);if(!t)return!1;return F0(e)<=t}Q0.inlineRef=Rre;var Ure=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function qP(e){for(let t in e){if(Ure.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(qP))return!0;if(typeof n=="object"&&qP(n))return!0}return!1}function F0(e){let t=0;for(let n in e){if(n==="$ref")return 1/0;if(t++,xre.has(n))continue;if(typeof e[n]=="object")(0,_re.eachItem)(e[n],(r)=>t+=F0(r));if(t===1/0)return 1/0}return t}function X0(e,t="",n){if(n!==!1)t=di(t);let r=e.parse(t);return Y0(e,r)}Q0.getFullPath=X0;function Y0(e,t){return e.serialize(t).split("#")[0]+"#"}Q0._getFullPath=Y0;var Mre=/#\/?$/;function di(e){return e?e.replace(Mre,""):""}Q0.normalizeId=di;function Kre(e,t,n){return n=di(n),e.resolve(t,n)}Q0.resolveUrl=Kre;var Ere=/^[a-z_][-a-z0-9._]*$/i;function qre(e,t){if(typeof e=="boolean")return{};let{schemaId:n,uriResolver:r}=this.opts,o=di(e[n]||t),i={"":o},c=X0(r,o,!1),s={},h=new Set;return Nre(e,{allKeys:!0},(d,y,p,f)=>{if(f===void 0)return;let k=c+y,L=i[f];if(typeof d[n]=="string")L=A.call(this,d[n]);K.call(this,d.$anchor),K.call(this,d.$dynamicAnchor),i[y]=L;function A(x){let Y=this.opts.uriResolver.resolve;if(x=di(L?Y(L,x):x),h.has(x))throw u(x);h.add(x);let E=this.refs[x];if(typeof E=="string")E=this.refs[E];if(typeof E=="object")l(d,E.schema,x);else if(x!==di(k))if(x[0]==="#")l(d,s[x],x),s[x]=d;else this.refs[x]=k;return x}function K(x){if(typeof x=="string"){if(!Ere.test(x))throw Error(`invalid anchor "${x}"`);A.call(this,`#${x}`)}}}),s;function l(d,y,p){if(y!==void 0&&!jre(d,y))throw u(p)}function u(d){return Error(`reference "${d}" resolves to more than one schema`)}}Q0.getSchemaRefs=qre});var Pc=G((y6)=>{Object.defineProperty(y6,"__esModule",{value:!0});y6.getData=y6.KeywordCxt=y6.validateFunctionCode=void 0;var r6=p0(),e6=fc(),JP=jP(),Hu=fc(),Zre=z0(),Sc=E0(),GP=H0(),re=ye(),he=Mn(),Fre=kc(),Kn=ke(),vc=wc();function Xre(e){if(c6(e)){if(s6(e),a6(e)){Vre(e);return}}i6(e,()=>(0,r6.topBoolOrEmptySchema)(e))}y6.validateFunctionCode=Xre;function i6({gen:e,validateName:t,schema:n,schemaEnv:r,opts:o},i){if(o.code.es5)e.func(t,re._`${he.default.data}, ${he.default.valCxt}`,r.$async,()=>{e.code(re._`"use strict"; ${t6(n,o)}`),Qre(e,o),e.code(i)});else e.func(t,re._`${he.default.data}, ${Yre(o)}`,r.$async,()=>e.code(t6(n,o)).code(i))}function Yre(e){return re._`{${he.default.instancePath}="", ${he.default.parentData}, ${he.default.parentDataProperty}, ${he.default.rootData}=${he.default.data}${e.dynamicRef?re._`, ${he.default.dynamicAnchors}={}`:re.nil}}={}`}function Qre(e,t){e.if(he.default.valCxt,()=>{if(e.var(he.default.instancePath,re._`${he.default.valCxt}.${he.default.instancePath}`),e.var(he.default.parentData,re._`${he.default.valCxt}.${he.default.parentData}`),e.var(he.default.parentDataProperty,re._`${he.default.valCxt}.${he.default.parentDataProperty}`),e.var(he.default.rootData,re._`${he.default.valCxt}.${he.default.rootData}`),t.dynamicRef)e.var(he.default.dynamicAnchors,re._`${he.default.valCxt}.${he.default.dynamicAnchors}`)},()=>{if(e.var(he.default.instancePath,re._`""`),e.var(he.default.parentData,re._`undefined`),e.var(he.default.parentDataProperty,re._`undefined`),e.var(he.default.rootData,he.default.data),t.dynamicRef)e.var(he.default.dynamicAnchors,re._`{}`)})}function Vre(e){let{schema:t,opts:n,gen:r}=e;i6(e,()=>{if(n.$comment&&t.$comment)l6(e);if(rie(e),r.let(he.default.vErrors,null),r.let(he.default.errors,0),n.unevaluated)eie(e);h6(e),cie(e)});return}function eie(e){let{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",re._`${n}.evaluated`),t.if(re._`${e.evaluated}.dynamicProps`,()=>t.assign(re._`${e.evaluated}.props`,re._`undefined`)),t.if(re._`${e.evaluated}.dynamicItems`,()=>t.assign(re._`${e.evaluated}.items`,re._`undefined`))}function t6(e,t){let n=typeof e=="object"&&e[t.schemaId];return n&&(t.code.source||t.code.process)?re._`/*# sourceURL=${n} */`:re.nil}function tie(e,t){if(c6(e)){if(s6(e),a6(e)){nie(e,t);return}}(0,r6.boolOrEmptySchema)(e,t)}function a6({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function c6(e){return typeof e.schema!="boolean"}function nie(e,t){let{schema:n,gen:r,opts:o}=e;if(o.$comment&&n.$comment)l6(e);iie(e),aie(e);let i=r.const("_errs",he.default.errors);h6(e,i),r.var(t,re._`${i} === ${he.default.errors}`)}function s6(e){(0,Kn.checkUnknownRules)(e),oie(e)}function h6(e,t){if(e.opts.jtd)return n6(e,[],!1,t);let n=(0,e6.getSchemaTypes)(e.schema),r=(0,e6.coerceAndCheckDataType)(e,n);n6(e,n,!r,t)}function oie(e){let{schema:t,errSchemaPath:n,opts:r,self:o}=e;if(t.$ref&&r.ignoreKeywordsWithRef&&(0,Kn.schemaHasRulesButRef)(t,o.RULES))o.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function rie(e){let{schema:t,opts:n}=e;if(t.default!==void 0&&n.useDefaults&&n.strictSchema)(0,Kn.checkStrictMode)(e,"default is ignored in the schema root")}function iie(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=(0,Fre.resolveUrl)(e.opts.uriResolver,e.baseId,t)}function aie(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function l6({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:o}){let i=n.$comment;if(o.$comment===!0)e.code(re._`${he.default.self}.logger.log(${i})`);else if(typeof o.$comment=="function"){let c=re.str`${r}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code(re._`${he.default.self}.opts.$comment(${i}, ${c}, ${s}.schema)`)}}function cie(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:o,opts:i}=e;if(n.$async)t.if(re._`${he.default.errors} === 0`,()=>t.return(he.default.data),()=>t.throw(re._`new ${o}(${he.default.vErrors})`));else{if(t.assign(re._`${r}.errors`,he.default.vErrors),i.unevaluated)sie(e);t.return(re._`${he.default.errors} === 0`)}}function sie({gen:e,evaluated:t,props:n,items:r}){if(n instanceof re.Name)e.assign(re._`${t}.props`,n);if(r instanceof re.Name)e.assign(re._`${t}.items`,r)}function n6(e,t,n,r){let{gen:o,schema:i,data:c,allErrors:s,opts:h,self:l}=e,{RULES:u}=l;if(i.$ref&&(h.ignoreKeywordsWithRef||!(0,Kn.schemaHasRulesButRef)(i,u))){o.block(()=>g6(e,"$ref",u.all.$ref.definition));return}if(!h.jtd)hie(e,t);o.block(()=>{for(let y of u.rules)d(y);d(u.post)});function d(y){if(!(0,JP.shouldUseGroup)(i,y))return;if(y.type){if(o.if((0,Hu.checkDataType)(y.type,c,h.strictNumbers)),o6(e,y),t.length===1&&t[0]===y.type&&n)o.else(),(0,Hu.reportTypeError)(e);o.endIf()}else o6(e,y);if(!s)o.if(re._`${he.default.errors} === ${r||0}`)}}function o6(e,t){let{gen:n,schema:r,opts:{useDefaults:o}}=e;if(o)(0,Zre.assignDefaults)(e,t.type);n.block(()=>{for(let i of t.rules)if((0,JP.shouldUseRule)(r,i))g6(e,i.keyword,i.definition,t.type)})}function hie(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(lie(e,t),!e.opts.allowUnionTypes)uie(e,t);gie(e,e.dataTypes)}function lie(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((n)=>{if(!u6(e.dataTypes,n))HP(e,`type "${n}" not allowed by context "${e.dataTypes.join(",")}"`)}),yie(e,t)}function uie(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))HP(e,"use allowUnionTypes to allow union type keyword")}function gie(e,t){let n=e.self.RULES.all;for(let r in n){let o=n[r];if(typeof o=="object"&&(0,JP.shouldUseRule)(e.schema,o)){let{type:i}=o.definition;if(i.length&&!i.some((c)=>die(t,c)))HP(e,`missing type "${i.join(",")}" for keyword "${r}"`)}}}function die(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function u6(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function yie(e,t){let n=[];for(let r of e.dataTypes)if(u6(t,r))n.push(r);else if(t.includes("integer")&&r==="number")n.push("integer");e.dataTypes=n}function HP(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,Kn.checkStrictMode)(e,t,e.opts.strictTypes)}class BP{constructor(e,t,n){if((0,Sc.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Kn.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",d6(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Sc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",he.default.errors)}result(e,t,n){this.failResult((0,re.not)(e),t,n)}failResult(e,t,n){if(this.gen.if(e),n)n();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult((0,re.not)(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(re._`${t} !== undefined && (${(0,re.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?vc.reportExtraError:vc.reportError)(this,this.def.error,t)}$dataError(){(0,vc.reportError)(this,this.def.$dataError||vc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,vc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,n=re.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=re.nil,t=re.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:o,def:i}=this;if(n.if((0,re.or)(re._`${r} === undefined`,t)),e!==re.nil)n.assign(e,!0);if(o.length||i.validateSchema){if(n.elseIf(this.invalid$data()),this.$dataError(),e!==re.nil)n.assign(e,!1)}n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:o}=this;return(0,re.or)(i(),c());function i(){if(n.length){if(!(t instanceof re.Name))throw Error("ajv implementation error");let s=Array.isArray(n)?n:[n];return re._`${(0,Hu.checkDataTypes)(s,t,o.opts.strictNumbers,Hu.DataType.Wrong)}`}return re.nil}function c(){if(r.validateSchema){let s=e.scopeValue("validate$data",{ref:r.validateSchema});return re._`!${s}(${t})`}return re.nil}}subschema(e,t){let n=(0,GP.getSubschema)(this.it,e);(0,GP.extendSubschemaData)(n,this.it,e),(0,GP.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return tie(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;if(!n.opts.unevaluated)return;if(n.props!==!0&&e.props!==void 0)n.props=Kn.mergeEvaluated.props(r,e.props,n.props,t);if(n.items!==!0&&e.items!==void 0)n.items=Kn.mergeEvaluated.items(r,e.items,n.items,t)}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,re.Name)),!0}}y6.KeywordCxt=BP;function g6(e,t,n,r){let o=new BP(e,n,t);if("code"in n)n.code(o,r);else if(o.$data&&n.validate)(0,Sc.funcKeywordCode)(o,n);else if("macro"in n)(0,Sc.macroKeywordCode)(o,n);else if(n.compile||n.validate)(0,Sc.funcKeywordCode)(o,n)}var bie=/^\/(?:[^~]|~0|~1)*$/,mie=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function d6(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let o,i;if(e==="")return he.default.rootData;if(e[0]==="/"){if(!bie.test(e))throw Error(`Invalid JSON-pointer: ${e}`);o=e,i=he.default.rootData}else{let l=mie.exec(e);if(!l)throw Error(`Invalid JSON-pointer: ${e}`);let u=+l[1];if(o=l[2],o==="#"){if(u>=t)throw Error(h("property/index",u));return r[t-u]}if(u>t)throw Error(h("data",u));if(i=n[t-u],!o)return i}let c=i,s=o.split("/");for(let l of s)if(l)i=re._`${i}${(0,re.getProperty)((0,Kn.unescapeJsonPointer)(l))}`,c=re._`${c} && ${i}`;return c;function h(l,u){return`Cannot access ${l} ${u} levels up, current level is ${t}`}}y6.getData=d6});var Bu=G((p6)=>{Object.defineProperty(p6,"__esModule",{value:!0});class m6 extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}p6.default=m6});var $c=G((f6)=>{Object.defineProperty(f6,"__esModule",{value:!0});var WP=kc();class w6 extends Error{constructor(e,t,n,r){super(r||`can't resolve reference ${n} from id ${t}`);this.missingRef=(0,WP.resolveUrl)(e,t,n),this.missingSchema=(0,WP.normalizeId)((0,WP.getFullPath)(e,this.missingRef))}}f6.default=w6});var Zu=G((S6)=>{Object.defineProperty(S6,"__esModule",{value:!0});S6.resolveSchema=S6.getCompilingSchema=S6.resolveRef=S6.compileSchema=S6.SchemaEnv=void 0;var hn=ye(),vie=Bu(),Bo=Mn(),ln=kc(),k6=ke(),Sie=Pc();class Ic{constructor(e){var t;this.refs={},this.dynamicAnchors={};let n;if(typeof e.schema=="object")n=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:(0,ln.normalizeId)(n===null||n===void 0?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n===null||n===void 0?void 0:n.$async,this.refs={}}}S6.SchemaEnv=Ic;function FP(e){let t=v6.call(this,e);if(t)return t;let n=(0,ln.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:r,lines:o}=this.opts.code,{ownProperties:i}=this.opts,c=new hn.CodeGen(this.scope,{es5:r,lines:o,ownProperties:i}),s;if(e.$async)s=c.scopeValue("Error",{ref:vie.default,code:hn._`require("ajv/dist/runtime/validation_error").default`});let h=c.scopeName("validate");e.validateName=h;let l={gen:c,allErrors:this.opts.allErrors,data:Bo.default.data,parentData:Bo.default.parentData,parentDataProperty:Bo.default.parentDataProperty,dataNames:[Bo.default.data],dataPathArr:[hn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,hn.stringify)(e.schema)}:{ref:e.schema}),validateName:h,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:hn.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:hn._`""`,opts:this.opts,self:this},u;try{this._compilations.add(e),(0,Sie.validateFunctionCode)(l),c.optimize(this.opts.code.optimize);let d=c.toString();if(u=`${c.scopeRefs(Bo.default.scope)}return ${d}`,this.opts.code.process)u=this.opts.code.process(u,e);let p=Function(`${Bo.default.self}`,`${Bo.default.scope}`,u)(this,this.scope.get());if(this.scope.value(h,{ref:p}),p.errors=null,p.schema=e.schema,p.schemaEnv=e,e.$async)p.$async=!0;if(this.opts.code.source===!0)p.source={validateName:h,validateCode:d,scopeValues:c._values};if(this.opts.unevaluated){let{props:f,items:k}=l;if(p.evaluated={props:f instanceof hn.Name?void 0:f,items:k instanceof hn.Name?void 0:k,dynamicProps:f instanceof hn.Name,dynamicItems:k instanceof hn.Name},p.source)p.source.evaluated=(0,hn.stringify)(p.evaluated)}return e.validate=p,e}catch(d){if(delete e.validate,delete e.validateName,u)this.logger.error("Error compiling schema, function code:",u);throw d}finally{this._compilations.delete(e)}}S6.compileSchema=FP;function Pie(e,t,n){var r;n=(0,ln.resolveUrl)(this.opts.uriResolver,t,n);let o=e.refs[n];if(o)return o;let i=Lie.call(this,e,n);if(i===void 0){let c=(r=e.localRefs)===null||r===void 0?void 0:r[n],{schemaId:s}=this.opts;if(c)i=new Ic({schema:c,schemaId:s,root:e,baseId:t})}if(i===void 0)return;return e.refs[n]=$ie.call(this,i)}S6.resolveRef=Pie;function $ie(e){if((0,ln.inlineRef)(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:FP.call(this,e)}function v6(e){for(let t of this._compilations)if(Iie(t,e))return t}S6.getCompilingSchema=v6;function Iie(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Lie(e,t){let n;while(typeof(n=this.refs[t])=="string")t=n;return n||this.schemas[t]||Wu.call(this,e,t)}function Wu(e,t){let n=this.opts.uriResolver.parse(t),r=(0,ln._getFullPath)(this.opts.uriResolver,n),o=(0,ln.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===o)return ZP.call(this,n,e);let i=(0,ln.normalizeId)(r),c=this.refs[i]||this.schemas[i];if(typeof c=="string"){let s=Wu.call(this,e,c);if(typeof(s===null||s===void 0?void 0:s.schema)!=="object")return;return ZP.call(this,n,s)}if(typeof(c===null||c===void 0?void 0:c.schema)!=="object")return;if(!c.validate)FP.call(this,c);if(i===(0,ln.normalizeId)(t)){let{schema:s}=c,{schemaId:h}=this.opts,l=s[h];if(l)o=(0,ln.resolveUrl)(this.opts.uriResolver,o,l);return new Ic({schema:s,schemaId:h,root:e,baseId:o})}return ZP.call(this,n,c)}S6.resolveSchema=Wu;var Tie=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function ZP(e,{baseId:t,schema:n,root:r}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let s of e.fragment.slice(1).split("/")){if(typeof n==="boolean")return;let h=n[(0,k6.unescapeFragment)(s)];if(h===void 0)return;n=h;let l=typeof n==="object"&&n[this.opts.schemaId];if(!Tie.has(s)&&l)t=(0,ln.resolveUrl)(this.opts.uriResolver,t,l)}let i;if(typeof n!="boolean"&&n.$ref&&!(0,k6.schemaHasRulesButRef)(n,this.RULES)){let s=(0,ln.resolveUrl)(this.opts.uriResolver,t,n.$ref);i=Wu.call(this,r,s)}let{schemaId:c}=this.opts;if(i=i||new Ic({schema:n,schemaId:c,root:r,baseId:t}),i.schema!==i.root.schema)return i;return}});var $6=G((g0e,zie)=>{zie.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var QP=G((d0e,C6)=>{var _ie=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),L6=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),XP=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),T6=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),jie=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function YP(e){let t="",n=0,r=0;for(r=0;r<e.length;r++){if(n=e[r].charCodeAt(0),n===48)continue;if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return"";t+=e[r]}return t}var Nie=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function I6(e){return e.length=0,!0}function xie(e,t,n){if(e.length){let r=YP(e);if(r!=="")t.push(r);else return n.error=!0,!1;e.length=0}return!0}function Rie(e){let t=0,n={error:!1,address:"",zone:""},r=[],o=[],i=!1,c=!1,s=xie;for(let h=0;h<e.length;h++){let l=e[h];if(l==="["||l==="]")continue;if(l===":"){if(i===!0)c=!0;if(!s(o,r,n))break;if(++t>7){n.error=!0;break}if(h>0&&e[h-1]===":")i=!0;r.push(":");continue}else if(l==="%"){if(!s(o,r,n))break;s=I6}else{o.push(l);continue}}if(o.length)if(s===I6)n.zone=o.join("");else if(c)r.push(o.join(""));else r.push(YP(o));return n.address=r.join(""),n}function O6(e){if(Uie(e,":")<2)return{host:e,isIPV6:!1};let t=Rie(e);if(!t.error){let{address:n,address:r}=t;if(t.zone)n+="%"+t.zone,r+="%25"+t.zone;return{host:n,isIPV6:!0,escapedHost:r}}else return{host:e,isIPV6:!1}}function Uie(e,t){let n=0;for(let r=0;r<e.length;r++)if(e[r]===t)n++;return n}function Mie(e){let t=e,n=[],r=-1,o=0;while(o=t.length){if(o===1)if(t===".")break;else if(t==="/"){n.push("/");break}else{n.push(t);break}else if(o===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){n.push("/");break}}}else if(o===3){if(t==="/.."){if(n.length!==0)n.pop();n.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),n.length!==0)n.pop();continue}}}}if((r=t.indexOf("/",1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join("")}var Kie={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Eie=/[@/?#:]/g,qie=/[@/?#]/g;function A6(e,t){let n=t?qie:Eie;return n.lastIndex=0,e.replace(n,(r)=>Kie[r])}function Gie(e,t=!1){if(e.indexOf("%")===-1)return e;let n="";for(let r=0;r<e.length;r++){if(e[r]==="%"&&r+2<e.length){let o=e.slice(r+1,r+3);if(XP(o)){let i=o.toUpperCase(),c=String.fromCharCode(parseInt(i,16));if(t&&T6(c))n+=c;else n+="%"+i;r+=2;continue}}n+=e[r]}return n}function Jie(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let r=e.slice(n+1,n+3);if(XP(r)){let o=r.toUpperCase(),i=String.fromCharCode(parseInt(o,16));if(i!=="."&&T6(i))t+=i;else t+="%"+o;n+=2;continue}}if(jie(e[n]))t+=e[n];else t+=escape(e[n])}return t}function Hie(e){let t="";for(let n=0;n<e.length;n++){if(e[n]==="%"&&n+2<e.length){let r=e.slice(n+1,n+3);if(XP(r)){t+="%"+r.toUpperCase(),n+=2;continue}}t+=escape(e[n])}return t}function Bie(e){let t=[];if(e.userinfo!==void 0)t.push(e.userinfo),t.push("@");if(e.host!==void 0){let n=unescape(e.host);if(!L6(n)){let r=O6(n);if(r.isIPV6===!0)n=`[${r.escapedHost}]`;else n=A6(n,!1)}t.push(n)}if(typeof e.port==="number"||typeof e.port==="string")t.push(":"),t.push(String(e.port));return t.length?t.join(""):void 0}C6.exports={nonSimpleDomain:Nie,recomposeAuthority:Bie,reescapeHostDelimiters:A6,normalizePercentEncoding:Gie,normalizePathEncoding:Jie,escapePreservingEscapes:Hie,removeDotSegments:Mie,isIPv4:L6,isUUID:_ie,normalizeIPv6:O6,stringArrayToHexStripped:YP}});var N6=G((y0e,j6)=>{var{isUUID:Wie}=QP(),Zie=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Fie=["http","https","ws","wss","urn","urn:uuid"];function Xie(e){return Fie.indexOf(e)!==-1}function VP(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function D6(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function z6(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function Yie(e){return e.secure=VP(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function Qie(e){if(e.port===(VP(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let[t,n]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function Vie(e,t){if(!e.path)return e.error="URN can not be parsed",e;let n=e.path.match(Zie);if(n){let r=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];let o=`${r}:${t.nid||e.nid}`,i=e$(o);if(e.path=void 0,i)e=i.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function eae(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let n=t.scheme||e.scheme||"urn",r=e.nid.toLowerCase(),o=`${n}:${t.nid||r}`,i=e$(o);if(i)e=i.serialize(e,t);let c=e,s=e.nss;return c.path=`${r||t.nid}:${s}`,t.skipEscape=!0,c}function tae(e,t){let n=e;if(n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!Wie(n.uuid)))n.error=n.error||"UUID is not valid.";return n}function nae(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var _6={scheme:"http",domainHost:!0,parse:D6,serialize:z6},oae={scheme:"https",domainHost:_6.domainHost,parse:D6,serialize:z6},Fu={scheme:"ws",domainHost:!0,parse:Yie,serialize:Qie},rae={scheme:"wss",domainHost:Fu.domainHost,parse:Fu.parse,serialize:Fu.serialize},iae={scheme:"urn",parse:Vie,serialize:eae,skipNormalize:!0},aae={scheme:"urn:uuid",parse:tae,serialize:nae,skipNormalize:!0},Xu={http:_6,https:oae,ws:Fu,wss:rae,urn:iae,"urn:uuid":aae};Object.setPrototypeOf(Xu,null);function e$(e){return e&&(Xu[e]||Xu[e.toLowerCase()])||void 0}j6.exports={wsIsSecure:VP,SCHEMES:Xu,isValidSchemeName:Xie,getSchemeHandler:e$}});var E6=G((b0e,Yu)=>{var{normalizeIPv6:cae,removeDotSegments:Lc,recomposeAuthority:sae,normalizePercentEncoding:hae,normalizePathEncoding:lae,escapePreservingEscapes:uae,reescapeHostDelimiters:gae,isIPv4:dae,nonSimpleDomain:yae}=QP(),{SCHEMES:bae,getSchemeHandler:R6}=N6();function mae(e,t){if(typeof e==="string")e=vae(e,t);else if(typeof e==="object")e=yi(Wo(e,t),t);return e}function pae(e,t,n){let r=n?Object.assign({scheme:"null"},n):{scheme:"null"},o=U6(yi(e,r),yi(t,r),r,!0);return r.skipEscape=!0,Wo(o,r)}function U6(e,t,n,r){let o={};if(!r)e=yi(Wo(e,n),n),t=yi(Wo(t,n),n);if(n=n||{},!n.tolerant&&t.scheme)o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Lc(t.path||""),o.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Lc(t.path||""),o.query=t.query;else{if(!t.path)if(o.path=e.path,t.query!==void 0)o.query=t.query;else o.query=e.query;else{if(t.path[0]==="/")o.path=Lc(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)o.path="/"+t.path;else if(!e.path)o.path=t.path;else o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;o.path=Lc(o.path)}o.query=t.query}o.userinfo=e.userinfo,o.host=e.host,o.port=e.port}o.scheme=e.scheme}return o.fragment=t.fragment,o}function wae(e,t,n){let r=x6(e,n),o=x6(t,n);return r!==void 0&&o!==void 0&&r.toLowerCase()===o.toLowerCase()}function Wo(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},r=Object.assign({},t),o=[],i=R6(r.scheme||n.scheme);if(i&&i.serialize)i.serialize(n,r);if(n.path!==void 0)if(!r.skipEscape){if(n.path=uae(n.path),n.scheme!==void 0)n.path=n.path.split("%3A").join(":")}else n.path=hae(n.path);if(r.reference!=="suffix"&&n.scheme)o.push(n.scheme,":");let c=sae(n);if(c!==void 0){if(r.reference!=="suffix")o.push("//");if(o.push(c),n.path&&n.path[0]!=="/")o.push("/")}if(n.path!==void 0){let s=n.path;if(!r.absolutePath&&(!i||!i.absolutePath))s=Lc(s);if(c===void 0&&s[0]==="/"&&s[1]==="/")s="/%2F"+s.slice(2);o.push(s)}if(n.query!==void 0)o.push("?",n.query);if(n.fragment!==void 0)o.push("#",n.fragment);return o.join("")}var fae=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function kae(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof e.port==="number"&&(e.port<0||e.port>65535))return"URI port is malformed.";return}function M6(e,t){let n=Object.assign({},t),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,i=!1;if(n.reference==="suffix")if(n.scheme)e=n.scheme+":"+e;else e="//"+e;let c=e.match(fae);if(c){if(r.scheme=c[1],r.userinfo=c[3],r.host=c[4],r.port=parseInt(c[5],10),r.path=c[6]||"",r.query=c[7],r.fragment=c[8],isNaN(r.port))r.port=c[5];let s=kae(r,c);if(s!==void 0)r.error=r.error||s,o=!0;if(r.host)if(dae(r.host)===!1){let u=cae(r.host);r.host=u.host.toLowerCase(),i=u.isIPV6}else i=!0;if(r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path)r.reference="same-document";else if(r.scheme===void 0)r.reference="relative";else if(r.fragment===void 0)r.reference="absolute";else r.reference="uri";if(n.reference&&n.reference!=="suffix"&&n.reference!==r.reference)r.error=r.error||"URI is not a "+n.reference+" reference.";let h=R6(n.scheme||r.scheme);if(!n.unicodeSupport&&(!h||!h.unicodeSupport)){if(r.host&&(n.domainHost||h&&h.domainHost)&&i===!1&&yae(r.host))try{r.host=new URL("http://"+r.host).hostname}catch(l){r.error=r.error||"Host's domain name can not be converted to ASCII: "+l}}if(!h||h&&!h.skipNormalize){if(e.indexOf("%")!==-1){if(r.scheme!==void 0)r.scheme=unescape(r.scheme);if(r.host!==void 0)r.host=gae(unescape(r.host),i)}if(r.path)r.path=lae(r.path);if(r.fragment)try{r.fragment=encodeURI(decodeURIComponent(r.fragment))}catch{r.error=r.error||"URI malformed"}}if(h&&h.parse)h.parse(r,n)}else r.error=r.error||"URI can not be parsed.";return{parsed:r,malformedAuthorityOrPort:o}}function yi(e,t){return M6(e,t).parsed}function vae(e,t){return K6(e,t).normalized}function K6(e,t){let{parsed:n,malformedAuthorityOrPort:r}=M6(e,t);return{normalized:r?e:Wo(n,t),malformedAuthorityOrPort:r}}function x6(e,t){if(typeof e==="string"){let{normalized:n,malformedAuthorityOrPort:r}=K6(e,t);return r?void 0:n}if(typeof e==="object")return Wo(e,t)}var t$={SCHEMES:bae,normalize:mae,resolve:pae,resolveComponent:U6,equal:wae,serialize:Wo,parse:yi};Yu.exports=t$;Yu.exports.default=t$;Yu.exports.fastUri=t$});var J6=G((G6)=>{Object.defineProperty(G6,"__esModule",{value:!0});var q6=E6();q6.code='require("ajv/dist/runtime/uri").default';G6.default=q6});var Q6=G((En)=>{Object.defineProperty(En,"__esModule",{value:!0});En.CodeGen=En.Name=En.nil=En.stringify=En.str=En._=En.KeywordCxt=void 0;var Pae=Pc();Object.defineProperty(En,"KeywordCxt",{enumerable:!0,get:function(){return Pae.KeywordCxt}});var bi=ye();Object.defineProperty(En,"_",{enumerable:!0,get:function(){return bi._}});Object.defineProperty(En,"str",{enumerable:!0,get:function(){return bi.str}});Object.defineProperty(En,"stringify",{enumerable:!0,get:function(){return bi.stringify}});Object.defineProperty(En,"nil",{enumerable:!0,get:function(){return bi.nil}});Object.defineProperty(En,"Name",{enumerable:!0,get:function(){return bi.Name}});Object.defineProperty(En,"CodeGen",{enumerable:!0,get:function(){return bi.CodeGen}});var $ae=Bu(),F6=$c(),Iae=_P(),Tc=Zu(),Lae=ye(),Oc=kc(),Qu=fc(),o$=ke(),H6=$6(),Tae=J6(),X6=(e,t)=>new RegExp(e,t);X6.code="new RegExp";var Oae=["removeAdditional","useDefaults","coerceTypes"],Aae=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Cae={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Dae={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},B6=200;function zae(e){var t,n,r,o,i,c,s,h,l,u,d,y,p,f,k,L,A,K,x,Y,E,we,Et,Zi,_d;let Fi=e.strict,jd=(t=e.code)===null||t===void 0?void 0:t.optimize,VL=jd===!0||jd===void 0?1:jd||0,eT=(r=(n=e.code)===null||n===void 0?void 0:n.regExp)!==null&&r!==void 0?r:X6,KY=(o=e.uriResolver)!==null&&o!==void 0?o:Tae.default;return{strictSchema:(c=(i=e.strictSchema)!==null&&i!==void 0?i:Fi)!==null&&c!==void 0?c:!0,strictNumbers:(h=(s=e.strictNumbers)!==null&&s!==void 0?s:Fi)!==null&&h!==void 0?h:!0,strictTypes:(u=(l=e.strictTypes)!==null&&l!==void 0?l:Fi)!==null&&u!==void 0?u:"log",strictTuples:(y=(d=e.strictTuples)!==null&&d!==void 0?d:Fi)!==null&&y!==void 0?y:"log",strictRequired:(f=(p=e.strictRequired)!==null&&p!==void 0?p:Fi)!==null&&f!==void 0?f:!1,code:e.code?{...e.code,optimize:VL,regExp:eT}:{optimize:VL,regExp:eT},loopRequired:(k=e.loopRequired)!==null&&k!==void 0?k:B6,loopEnum:(L=e.loopEnum)!==null&&L!==void 0?L:B6,meta:(A=e.meta)!==null&&A!==void 0?A:!0,messages:(K=e.messages)!==null&&K!==void 0?K:!0,inlineRefs:(x=e.inlineRefs)!==null&&x!==void 0?x:!0,schemaId:(Y=e.schemaId)!==null&&Y!==void 0?Y:"$id",addUsedSchema:(E=e.addUsedSchema)!==null&&E!==void 0?E:!0,validateSchema:(we=e.validateSchema)!==null&&we!==void 0?we:!0,validateFormats:(Et=e.validateFormats)!==null&&Et!==void 0?Et:!0,unicodeRegExp:(Zi=e.unicodeRegExp)!==null&&Zi!==void 0?Zi:!0,int32range:(_d=e.int32range)!==null&&_d!==void 0?_d:!0,uriResolver:KY}}class Vu{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...zae(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new Lae.ValueScope({scope:{},prefixes:Aae,es5:t,lines:n}),this.logger=Uae(e.logger);let r=e.validateFormats;if(e.validateFormats=!1,this.RULES=(0,Iae.getRules)(),W6.call(this,Cae,e,"NOT SUPPORTED"),W6.call(this,Dae,e,"DEPRECATED","warn"),this._metaOpts=xae.call(this),e.formats)jae.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)Nae.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);_ae.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=H6;if(n==="id")r={...H6},r.id=r.$id,delete r.$id;if(t&&e)this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);if(!("$async"in n))this.errors=n.errors;return r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(l,u){await o.call(this,l.$schema);let d=this._addSchema(l,u);return d.validate||i.call(this,d)}async function o(l){if(l&&!this.getSchema(l))await r.call(this,{$ref:l},!0)}async function i(l){try{return this._compileSchemaEnv(l)}catch(u){if(!(u instanceof F6.default))throw u;return c.call(this,u),await s.call(this,u.missingSchema),i.call(this,l)}}function c({missingSchema:l,missingRef:u}){if(this.refs[l])throw Error(`AnySchema ${l} is loaded but ${u} cannot be resolved`)}async function s(l){let u=await h.call(this,l);if(!this.refs[l])await o.call(this,u.$schema);if(!this.refs[l])this.addSchema(u,l,t)}async function h(l){let u=this._loading[l];if(u)return u;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,n,r);return this}let o;if(typeof e==="object"){let{schemaId:i}=this.opts;if(o=e[i],o!==void 0&&typeof o!="string")throw Error(`schema ${i} must be string`)}return t=(0,Oc.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let o="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(o);else throw Error(o)}return r}getSchema(e){let t;while(typeof(t=Z6.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new Tc.SchemaEnv({schema:{},schemaId:n});if(t=Tc.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=Z6.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];if(n)n=(0,Oc.normalizeId)(n),delete this.schemas[n],delete this.refs[n];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e=="string"){if(n=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n}else if(typeof e=="object"&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Kae.call(this,n,t),!t)return(0,o$.eachItem)(n,(o)=>n$.call(this,o)),this;qae.call(this,t);let r={...t,type:(0,Qu.getJSONTypes)(t.type),schemaType:(0,Qu.getJSONTypes)(t.schemaType)};return(0,o$.eachItem)(n,r.type.length===0?(o)=>n$.call(this,o,r):(o)=>r.type.forEach((i)=>n$.call(this,o,r,i))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let r=n.rules.findIndex((o)=>o.keyword===e);if(r>=0)n.rules.splice(r,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){if(!e||e.length===0)return"No errors";return e.map((r)=>`${n}${r.instancePath} ${r.message}`).reduce((r,o)=>r+t+o)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let o=r.split("/").slice(1),i=e;for(let c of o)i=i[c];for(let c in n){let s=n[c];if(typeof s!="object")continue;let{$data:h}=s.definition,l=i[c];if(h&&l)i[c]=Y6(l)}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];if(!t||t.test(n)){if(typeof r=="string")delete e[n];else if(r&&!r.meta)this._cache.delete(r.schema),delete e[n]}}}_addSchema(e,t,n,r=this.opts.validateSchema,o=this.opts.addUsedSchema){let i,{schemaId:c}=this.opts;if(typeof e=="object")i=e[c];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let s=this._cache.get(e);if(s!==void 0)return s;n=(0,Oc.normalizeId)(i||n);let h=Oc.getSchemaRefs.call(this,e,n);if(s=new Tc.SchemaEnv({schema:e,schemaId:c,meta:t,baseId:n,localRefs:h}),this._cache.set(s.schema,s),o&&!n.startsWith("#")){if(n)this._checkUnique(n);this.refs[n]=s}if(r)this.validateSchema(e,!0);return s}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else Tc.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Tc.compileSchema.call(this,e)}finally{this.opts=t}}}Vu.ValidationError=$ae.default;Vu.MissingRefError=F6.default;En.default=Vu;function W6(e,t,n,r="error"){for(let o in e){let i=o;if(i in t)this.logger[r](`${n}: option ${o}. ${e[i]}`)}}function Z6(e){return e=(0,Oc.normalizeId)(e),this.schemas[e]||this.refs[e]}function _ae(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function jae(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function Nae(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let n=e[t];if(!n.keyword)n.keyword=t;this.addKeyword(n)}}function xae(){let e={...this.opts};for(let t of Oae)delete e[t];return e}var Rae={log(){},warn(){},error(){}};function Uae(e){if(e===!1)return Rae;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var Mae=/^[a-z_$][a-z0-9_$:-]*$/i;function Kae(e,t){let{RULES:n}=this;if((0,o$.eachItem)(e,(r)=>{if(n.keywords[r])throw Error(`Keyword ${r} is already defined`);if(!Mae.test(r))throw Error(`Keyword ${r} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function n$(e,t,n){var r;let o=t===null||t===void 0?void 0:t.post;if(n&&o)throw Error('keyword with "post" flag cannot have "type"');let{RULES:i}=this,c=o?i.post:i.rules.find(({type:h})=>h===n);if(!c)c={type:n,rules:[]},i.rules.push(c);if(i.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,Qu.getJSONTypes)(t.type),schemaType:(0,Qu.getJSONTypes)(t.schemaType)}};if(t.before)Eae.call(this,c,s,t.before);else c.rules.push(s);i.all[e]=s,(r=t.implements)===null||r===void 0||r.forEach((h)=>this.addKeyword(h))}function Eae(e,t,n){let r=e.rules.findIndex((o)=>o.keyword===n);if(r>=0)e.rules.splice(r,0,t);else e.rules.push(t),this.logger.warn(`rule ${n} is not defined`)}function qae(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=Y6(t);e.validateSchema=this.compile(t,!0)}var Gae={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Y6(e){return{anyOf:[e,Gae]}}});var eM=G((V6)=>{Object.defineProperty(V6,"__esModule",{value:!0});var Bae={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};V6.default=Bae});var aM=G((rM)=>{Object.defineProperty(rM,"__esModule",{value:!0});rM.callRef=rM.getValidate=void 0;var Zae=$c(),tM=Yt(),Tt=ye(),mi=Mn(),nM=Zu(),eg=ke(),Fae={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:n,it:r}=e,{baseId:o,schemaEnv:i,validateName:c,opts:s,self:h}=r,{root:l}=i;if((n==="#"||n==="#/")&&o===l.baseId)return d();let u=nM.resolveRef.call(h,l,o,n);if(u===void 0)throw new Zae.default(r.opts.uriResolver,o,n);if(u instanceof nM.SchemaEnv)return y(u);return p(u);function d(){if(i===l)return tg(e,c,i,i.$async);let f=t.scopeValue("root",{ref:l});return tg(e,Tt._`${f}.validate`,l,l.$async)}function y(f){let k=oM(e,f);tg(e,k,f,f.$async)}function p(f){let k=t.scopeValue("schema",s.code.source===!0?{ref:f,code:(0,Tt.stringify)(f)}:{ref:f}),L=t.name("valid"),A=e.subschema({schema:f,dataTypes:[],schemaPath:Tt.nil,topSchemaRef:k,errSchemaPath:n},L);e.mergeEvaluated(A),e.ok(L)}}};function oM(e,t){let{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):Tt._`${n.scopeValue("wrapper",{ref:t})}.validate`}rM.getValidate=oM;function tg(e,t,n,r){let{gen:o,it:i}=e,{allErrors:c,schemaEnv:s,opts:h}=i,l=h.passContext?mi.default.this:Tt.nil;if(r)u();else d();function u(){if(!s.$async)throw Error("async schema referenced by sync schema");let f=o.let("valid");o.try(()=>{if(o.code(Tt._`await ${(0,tM.callValidateCode)(e,t,l)}`),p(t),!c)o.assign(f,!0)},(k)=>{if(o.if(Tt._`!(${k} instanceof ${i.ValidationError})`,()=>o.throw(k)),y(k),!c)o.assign(f,!1)}),e.ok(f)}function d(){e.result((0,tM.callValidateCode)(e,t,l),()=>p(t),()=>y(t))}function y(f){let k=Tt._`${f}.errors`;o.assign(mi.default.vErrors,Tt._`${mi.default.vErrors} === null ? ${k} : ${mi.default.vErrors}.concat(${k})`),o.assign(mi.default.errors,Tt._`${mi.default.vErrors}.length`)}function p(f){var k;if(!i.opts.unevaluated)return;let L=(k=n===null||n===void 0?void 0:n.validate)===null||k===void 0?void 0:k.evaluated;if(i.props!==!0)if(L&&!L.dynamicProps){if(L.props!==void 0)i.props=eg.mergeEvaluated.props(o,L.props,i.props)}else{let A=o.var("props",Tt._`${f}.evaluated.props`);i.props=eg.mergeEvaluated.props(o,A,i.props,Tt.Name)}if(i.items!==!0)if(L&&!L.dynamicItems){if(L.items!==void 0)i.items=eg.mergeEvaluated.items(o,L.items,i.items)}else{let A=o.var("items",Tt._`${f}.evaluated.items`);i.items=eg.mergeEvaluated.items(o,A,i.items,Tt.Name)}}}rM.callRef=tg;rM.default=Fae});var sM=G((cM)=>{Object.defineProperty(cM,"__esModule",{value:!0});var Qae=eM(),Vae=aM(),ece=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Qae.default,Vae.default];cM.default=ece});var lM=G((hM)=>{Object.defineProperty(hM,"__esModule",{value:!0});var ng=ye(),po=ng.operators,og={maximum:{okStr:"<=",ok:po.LTE,fail:po.GT},minimum:{okStr:">=",ok:po.GTE,fail:po.LT},exclusiveMaximum:{okStr:"<",ok:po.LT,fail:po.GTE},exclusiveMinimum:{okStr:">",ok:po.GT,fail:po.LTE}},nce={message:({keyword:e,schemaCode:t})=>ng.str`must be ${og[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>ng._`{comparison: ${og[e].okStr}, limit: ${t}}`},oce={keyword:Object.keys(og),type:"number",schemaType:"number",$data:!0,error:nce,code(e){let{keyword:t,data:n,schemaCode:r}=e;e.fail$data(ng._`${n} ${og[t].fail} ${r} || isNaN(${n})`)}};hM.default=oce});var gM=G((uM)=>{Object.defineProperty(uM,"__esModule",{value:!0});var Ac=ye(),ice={message:({schemaCode:e})=>Ac.str`must be multiple of ${e}`,params:({schemaCode:e})=>Ac._`{multipleOf: ${e}}`},ace={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:ice,code(e){let{gen:t,data:n,schemaCode:r,it:o}=e,i=o.opts.multipleOfPrecision,c=t.let("res"),s=i?Ac._`Math.abs(Math.round(${c}) - ${c}) > 1e-${i}`:Ac._`${c} !== parseInt(${c})`;e.fail$data(Ac._`(${r} === 0 || (${c} = ${n}/${r}, ${s}))`)}};uM.default=ace});var bM=G((yM)=>{Object.defineProperty(yM,"__esModule",{value:!0});function dM(e){let t=e.length,n=0,r=0,o;while(r<t)if(n++,o=e.charCodeAt(r++),o>=55296&&o<=56319&&r<t){if(o=e.charCodeAt(r),(o&64512)===56320)r++}return n}yM.default=dM;dM.code='require("ajv/dist/runtime/ucs2length").default'});var pM=G((mM)=>{Object.defineProperty(mM,"__esModule",{value:!0});var Zo=ye(),hce=ke(),lce=bM(),uce={message({keyword:e,schemaCode:t}){let n=e==="maxLength"?"more":"fewer";return Zo.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>Zo._`{limit: ${e}}`},gce={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:uce,code(e){let{keyword:t,data:n,schemaCode:r,it:o}=e,i=t==="maxLength"?Zo.operators.GT:Zo.operators.LT,c=o.opts.unicode===!1?Zo._`${n}.length`:Zo._`${(0,hce.useFunc)(e.gen,lce.default)}(${n})`;e.fail$data(Zo._`${c} ${i} ${r}`)}};mM.default=gce});var fM=G((wM)=>{Object.defineProperty(wM,"__esModule",{value:!0});var yce=Yt(),bce=ke(),pi=ye(),mce={message:({schemaCode:e})=>pi.str`must match pattern "${e}"`,params:({schemaCode:e})=>pi._`{pattern: ${e}}`},pce={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:mce,code(e){let{gen:t,data:n,$data:r,schema:o,schemaCode:i,it:c}=e,s=c.opts.unicodeRegExp?"u":"";if(r){let{regExp:h}=c.opts.code,l=h.code==="new RegExp"?pi._`new RegExp`:(0,bce.useFunc)(t,h),u=t.let("valid");t.try(()=>t.assign(u,pi._`${l}(${i}, ${s}).test(${n})`),()=>t.assign(u,!1)),e.fail$data(pi._`!${u}`)}else{let h=(0,yce.usePattern)(e,o);e.fail$data(pi._`!${h}.test(${n})`)}}};wM.default=pce});var vM=G((kM)=>{Object.defineProperty(kM,"__esModule",{value:!0});var Cc=ye(),fce={message({keyword:e,schemaCode:t}){let n=e==="maxProperties"?"more":"fewer";return Cc.str`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>Cc._`{limit: ${e}}`},kce={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:fce,code(e){let{keyword:t,data:n,schemaCode:r}=e,o=t==="maxProperties"?Cc.operators.GT:Cc.operators.LT;e.fail$data(Cc._`Object.keys(${n}).length ${o} ${r}`)}};kM.default=kce});var PM=G((SM)=>{Object.defineProperty(SM,"__esModule",{value:!0});var Dc=Yt(),zc=ye(),Sce=ke(),Pce={message:({params:{missingProperty:e}})=>zc.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>zc._`{missingProperty: ${e}}`},$ce={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Pce,code(e){let{gen:t,schema:n,schemaCode:r,data:o,$data:i,it:c}=e,{opts:s}=c;if(!i&&n.length===0)return;let h=n.length>=s.loopRequired;if(c.allErrors)l();else u();if(s.strictRequired){let p=e.parentSchema.properties,{definedProperties:f}=e.it;for(let k of n)if((p===null||p===void 0?void 0:p[k])===void 0&&!f.has(k)){let L=c.schemaEnv.baseId+c.errSchemaPath,A=`required property "${k}" is not defined at "${L}" (strictRequired)`;(0,Sce.checkStrictMode)(c,A,c.opts.strictRequired)}}function l(){if(h||i)e.block$data(zc.nil,d);else for(let p of n)(0,Dc.checkReportMissingProp)(e,p)}function u(){let p=t.let("missing");if(h||i){let f=t.let("valid",!0);e.block$data(f,()=>y(p,f)),e.ok(f)}else t.if((0,Dc.checkMissingProp)(e,n,p)),(0,Dc.reportMissingProp)(e,p),t.else()}function d(){t.forOf("prop",r,(p)=>{e.setParams({missingProperty:p}),t.if((0,Dc.noPropertyInData)(t,o,p,s.ownProperties),()=>e.error())})}function y(p,f){e.setParams({missingProperty:p}),t.forOf(p,r,()=>{t.assign(f,(0,Dc.propertyInData)(t,o,p,s.ownProperties)),t.if((0,zc.not)(f),()=>{e.error(),t.break()})},zc.nil)}}};SM.default=$ce});var IM=G(($M)=>{Object.defineProperty($M,"__esModule",{value:!0});var _c=ye(),Lce={message({keyword:e,schemaCode:t}){let n=e==="maxItems"?"more":"fewer";return _c.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>_c._`{limit: ${e}}`},Tce={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Lce,code(e){let{keyword:t,data:n,schemaCode:r}=e,o=t==="maxItems"?_c.operators.GT:_c.operators.LT;e.fail$data(_c._`${n}.length ${o} ${r}`)}};$M.default=Tce});var rg=G((TM)=>{Object.defineProperty(TM,"__esModule",{value:!0});var LM=EP();LM.code='require("ajv/dist/runtime/equal").default';TM.default=LM});var AM=G((OM)=>{Object.defineProperty(OM,"__esModule",{value:!0});var r$=fc(),rt=ye(),Cce=ke(),Dce=rg(),zce={message:({params:{i:e,j:t}})=>rt.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>rt._`{i: ${e}, j: ${t}}`},_ce={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:zce,code(e){let{gen:t,data:n,$data:r,schema:o,parentSchema:i,schemaCode:c,it:s}=e;if(!r&&!o)return;let h=t.let("valid"),l=i.items?(0,r$.getSchemaTypes)(i.items):[];e.block$data(h,u,rt._`${c} === false`),e.ok(h);function u(){let f=t.let("i",rt._`${n}.length`),k=t.let("j");e.setParams({i:f,j:k}),t.assign(h,!0),t.if(rt._`${f} > 1`,()=>(d()?y:p)(f,k))}function d(){return l.length>0&&!l.some((f)=>f==="object"||f==="array")}function y(f,k){let L=t.name("item"),A=(0,r$.checkDataTypes)(l,L,s.opts.strictNumbers,r$.DataType.Wrong),K=t.const("indices",rt._`{}`);t.for(rt._`;${f}--;`,()=>{if(t.let(L,rt._`${n}[${f}]`),t.if(A,rt._`continue`),l.length>1)t.if(rt._`typeof ${L} == "string"`,rt._`${L} += "_"`);t.if(rt._`typeof ${K}[${L}] == "number"`,()=>{t.assign(k,rt._`${K}[${L}]`),e.error(),t.assign(h,!1).break()}).code(rt._`${K}[${L}] = ${f}`)})}function p(f,k){let L=(0,Cce.useFunc)(t,Dce.default),A=t.name("outer");t.label(A).for(rt._`;${f}--;`,()=>t.for(rt._`${k} = ${f}; ${k}--;`,()=>t.if(rt._`${L}(${n}[${f}], ${n}[${k}])`,()=>{e.error(),t.assign(h,!1).break(A)})))}}};OM.default=_ce});var DM=G((CM)=>{Object.defineProperty(CM,"__esModule",{value:!0});var i$=ye(),Nce=ke(),xce=rg(),Rce={message:"must be equal to constant",params:({schemaCode:e})=>i$._`{allowedValue: ${e}}`},Uce={keyword:"const",$data:!0,error:Rce,code(e){let{gen:t,data:n,$data:r,schemaCode:o,schema:i}=e;if(r||i&&typeof i=="object")e.fail$data(i$._`!${(0,Nce.useFunc)(t,xce.default)}(${n}, ${o})`);else e.fail(i$._`${i} !== ${n}`)}};CM.default=Uce});var _M=G((zM)=>{Object.defineProperty(zM,"__esModule",{value:!0});var jc=ye(),Kce=ke(),Ece=rg(),qce={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>jc._`{allowedValues: ${e}}`},Gce={keyword:"enum",schemaType:"array",$data:!0,error:qce,code(e){let{gen:t,data:n,$data:r,schema:o,schemaCode:i,it:c}=e;if(!r&&o.length===0)throw Error("enum must have non-empty array");let s=o.length>=c.opts.loopEnum,h,l=()=>h!==null&&h!==void 0?h:h=(0,Kce.useFunc)(t,Ece.default),u;if(s||r)u=t.let("valid"),e.block$data(u,d);else{if(!Array.isArray(o))throw Error("ajv implementation error");let p=t.const("vSchema",i);u=(0,jc.or)(...o.map((f,k)=>y(p,k)))}e.pass(u);function d(){t.assign(u,!1),t.forOf("v",i,(p)=>t.if(jc._`${l()}(${n}, ${p})`,()=>t.assign(u,!0).break()))}function y(p,f){let k=o[f];return typeof k==="object"&&k!==null?jc._`${l()}(${n}, ${p}[${f}])`:jc._`${n} === ${k}`}}};zM.default=Gce});var NM=G((jM)=>{Object.defineProperty(jM,"__esModule",{value:!0});var Hce=lM(),Bce=gM(),Wce=pM(),Zce=fM(),Fce=vM(),Xce=PM(),Yce=IM(),Qce=AM(),Vce=DM(),ese=_M(),tse=[Hce.default,Bce.default,Wce.default,Zce.default,Fce.default,Xce.default,Yce.default,Qce.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Vce.default,ese.default];jM.default=tse});var c$=G((RM)=>{Object.defineProperty(RM,"__esModule",{value:!0});RM.validateAdditionalItems=void 0;var Fo=ye(),a$=ke(),ose={message:({params:{len:e}})=>Fo.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Fo._`{limit: ${e}}`},rse={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:ose,code(e){let{parentSchema:t,it:n}=e,{items:r}=t;if(!Array.isArray(r)){(0,a$.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}xM(e,r)}};function xM(e,t){let{gen:n,schema:r,data:o,keyword:i,it:c}=e;c.items=!0;let s=n.const("len",Fo._`${o}.length`);if(r===!1)e.setParams({len:t.length}),e.pass(Fo._`${s} <= ${t.length}`);else if(typeof r=="object"&&!(0,a$.alwaysValidSchema)(c,r)){let l=n.var("valid",Fo._`${s} <= ${t.length}`);n.if((0,Fo.not)(l),()=>h(l)),e.ok(l)}function h(l){n.forRange("i",t.length,s,(u)=>{if(e.subschema({keyword:i,dataProp:u,dataPropType:a$.Type.Num},l),!c.allErrors)n.if((0,Fo.not)(l),()=>n.break())})}}RM.validateAdditionalItems=xM;RM.default=rse});var s$=G((EM)=>{Object.defineProperty(EM,"__esModule",{value:!0});EM.validateTuple=void 0;var MM=ye(),ig=ke(),ase=Yt(),cse={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:n}=e;if(Array.isArray(t))return KM(e,"additionalItems",t);if(n.items=!0,(0,ig.alwaysValidSchema)(n,t))return;e.ok((0,ase.validateArray)(e))}};function KM(e,t,n=e.schema){let{gen:r,parentSchema:o,data:i,keyword:c,it:s}=e;if(u(o),s.opts.unevaluated&&n.length&&s.items!==!0)s.items=ig.mergeEvaluated.items(r,n.length,s.items);let h=r.name("valid"),l=r.const("len",MM._`${i}.length`);n.forEach((d,y)=>{if((0,ig.alwaysValidSchema)(s,d))return;r.if(MM._`${l} > ${y}`,()=>e.subschema({keyword:c,schemaProp:y,dataProp:y},h)),e.ok(h)});function u(d){let{opts:y,errSchemaPath:p}=s,f=n.length,k=f===d.minItems&&(f===d.maxItems||d[t]===!1);if(y.strictTuples&&!k){let L=`"${c}" is ${f}-tuple, but minItems or maxItems/${t} are not specified or different at path "${p}"`;(0,ig.checkStrictMode)(s,L,y.strictTuples)}}}EM.validateTuple=KM;EM.default=cse});var JM=G((GM)=>{Object.defineProperty(GM,"__esModule",{value:!0});var hse=s$(),lse={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>(0,hse.validateTuple)(e,"items")};GM.default=lse});var WM=G((BM)=>{Object.defineProperty(BM,"__esModule",{value:!0});var HM=ye(),gse=ke(),dse=Yt(),yse=c$(),bse={message:({params:{len:e}})=>HM.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>HM._`{limit: ${e}}`},mse={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:bse,code(e){let{schema:t,parentSchema:n,it:r}=e,{prefixItems:o}=n;if(r.items=!0,(0,gse.alwaysValidSchema)(r,t))return;if(o)(0,yse.validateAdditionalItems)(e,o);else e.ok((0,dse.validateArray)(e))}};BM.default=mse});var FM=G((ZM)=>{Object.defineProperty(ZM,"__esModule",{value:!0});var Qt=ye(),ag=ke(),wse={message:({params:{min:e,max:t}})=>t===void 0?Qt.str`must contain at least ${e} valid item(s)`:Qt.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?Qt._`{minContains: ${e}}`:Qt._`{minContains: ${e}, maxContains: ${t}}`},fse={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:wse,code(e){let{gen:t,schema:n,parentSchema:r,data:o,it:i}=e,c,s,{minContains:h,maxContains:l}=r;if(i.opts.next)c=h===void 0?1:h,s=l;else c=1;let u=t.const("len",Qt._`${o}.length`);if(e.setParams({min:c,max:s}),s===void 0&&c===0){(0,ag.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&c>s){(0,ag.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,ag.alwaysValidSchema)(i,n)){let k=Qt._`${u} >= ${c}`;if(s!==void 0)k=Qt._`${k} && ${u} <= ${s}`;e.pass(k);return}i.items=!0;let d=t.name("valid");if(s===void 0&&c===1)p(d,()=>t.if(d,()=>t.break()));else if(c===0){if(t.let(d,!0),s!==void 0)t.if(Qt._`${o}.length > 0`,y)}else t.let(d,!1),y();e.result(d,()=>e.reset());function y(){let k=t.name("_valid"),L=t.let("count",0);p(k,()=>t.if(k,()=>f(L)))}function p(k,L){t.forRange("i",0,u,(A)=>{e.subschema({keyword:"contains",dataProp:A,dataPropType:ag.Type.Num,compositeRule:!0},k),L()})}function f(k){if(t.code(Qt._`${k}++`),s===void 0)t.if(Qt._`${k} >= ${c}`,()=>t.assign(d,!0).break());else if(t.if(Qt._`${k} > ${s}`,()=>t.assign(d,!1).break()),c===1)t.assign(d,!0);else t.if(Qt._`${k} >= ${c}`,()=>t.assign(d,!0))}}};ZM.default=fse});var tK=G((QM)=>{Object.defineProperty(QM,"__esModule",{value:!0});QM.validateSchemaDeps=QM.validatePropertyDeps=QM.error=void 0;var h$=ye(),vse=ke(),Nc=Yt();QM.error={message:({params:{property:e,depsCount:t,deps:n}})=>{let r=t===1?"property":"properties";return h$.str`must have ${r} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:r}})=>h$._`{property: ${e},
7479
7479
  missingProperty: ${r},
7480
7480
  depsCount: ${t},
7481
- deps: ${n}}`};var Sse={keyword:"dependencies",type:"object",schemaType:"object",error:QM.error,code(e){let[t,n]=Pse(e);XM(e,t),YM(e,n)}};function Pse({schema:e}){let t={},n={};for(let r in e){if(r==="__proto__")continue;let o=Array.isArray(e[r])?t:n;o[r]=e[r]}return[t,n]}function XM(e,t=e.schema){let{gen:n,data:r,it:o}=e;if(Object.keys(t).length===0)return;let i=n.let("missing");for(let c in t){let s=t[c];if(s.length===0)continue;let h=(0,Nc.propertyInData)(n,r,c,o.opts.ownProperties);if(e.setParams({property:c,depsCount:s.length,deps:s.join(", ")}),o.allErrors)n.if(h,()=>{for(let l of s)(0,Nc.checkReportMissingProp)(e,l)});else n.if(h$._`${h} && (${(0,Nc.checkMissingProp)(e,s,i)})`),(0,Nc.reportMissingProp)(e,i),n.else()}}QM.validatePropertyDeps=XM;function YM(e,t=e.schema){let{gen:n,data:r,keyword:o,it:i}=e,c=n.name("valid");for(let s in t){if((0,vse.alwaysValidSchema)(i,t[s]))continue;n.if((0,Nc.propertyInData)(n,r,s,i.opts.ownProperties),()=>{let h=e.subschema({keyword:o,schemaProp:s},c);e.mergeValidEvaluated(h,c)},()=>n.var(c,!0)),e.ok(c)}}QM.validateSchemaDeps=YM;QM.default=Sse});var rK=G((oK)=>{Object.defineProperty(oK,"__esModule",{value:!0});var nK=ye(),Lse=ke(),Tse={message:"property name must be valid",params:({params:e})=>nK._`{propertyName: ${e.propertyName}}`},Ose={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Tse,code(e){let{gen:t,schema:n,data:r,it:o}=e;if((0,Lse.alwaysValidSchema)(o,n))return;let i=t.name("valid");t.forIn("key",r,(c)=>{e.setParams({propertyName:c}),e.subschema({keyword:"propertyNames",data:c,dataTypes:["string"],propertyName:c,compositeRule:!0},i),t.if((0,nK.not)(i),()=>{if(e.error(!0),!o.allErrors)t.break()})}),e.ok(i)}};oK.default=Ose});var l$=G((iK)=>{Object.defineProperty(iK,"__esModule",{value:!0});var cg=Yt(),un=ye(),Cse=Mn(),sg=ke(),Dse={message:"must NOT have additional properties",params:({params:e})=>un._`{additionalProperty: ${e.additionalProperty}}`},zse={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Dse,code(e){let{gen:t,schema:n,parentSchema:r,data:o,errsCount:i,it:c}=e;if(!i)throw Error("ajv implementation error");let{allErrors:s,opts:h}=c;if(c.props=!0,h.removeAdditional!=="all"&&(0,sg.alwaysValidSchema)(c,n))return;let l=(0,cg.allSchemaProperties)(r.properties),u=(0,cg.allSchemaProperties)(r.patternProperties);d(),e.ok(un._`${i} === ${Cse.default.errors}`);function d(){t.forIn("key",o,(L)=>{if(!l.length&&!u.length)f(L);else t.if(y(L),()=>f(L))})}function y(L){let A;if(l.length>8){let K=(0,sg.schemaRefOrVal)(c,r.properties,"properties");A=(0,cg.isOwnProperty)(t,K,L)}else if(l.length)A=(0,un.or)(...l.map((K)=>un._`${L} === ${K}`));else A=un.nil;if(u.length)A=(0,un.or)(A,...u.map((K)=>un._`${(0,cg.usePattern)(e,K)}.test(${L})`));return(0,un.not)(A)}function p(L){t.code(un._`delete ${o}[${L}]`)}function f(L){if(h.removeAdditional==="all"||h.removeAdditional&&n===!1){p(L);return}if(n===!1){if(e.setParams({additionalProperty:L}),e.error(),!s)t.break();return}if(typeof n=="object"&&!(0,sg.alwaysValidSchema)(c,n)){let A=t.name("valid");if(h.removeAdditional==="failing")k(L,A,!1),t.if((0,un.not)(A),()=>{e.reset(),p(L)});else if(k(L,A),!s)t.if((0,un.not)(A),()=>t.break())}}function k(L,A,K){let x={keyword:"additionalProperties",dataProp:L,dataPropType:sg.Type.Str};if(K===!1)Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(x,A)}}};iK.default=zse});var hK=G((sK)=>{Object.defineProperty(sK,"__esModule",{value:!0});var jse=Pc(),aK=Yt(),u$=ke(),cK=l$(),Nse={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:n,parentSchema:r,data:o,it:i}=e;if(i.opts.removeAdditional==="all"&&r.additionalProperties===void 0)cK.default.code(new jse.KeywordCxt(i,cK.default,"additionalProperties"));let c=(0,aK.allSchemaProperties)(n);for(let d of c)i.definedProperties.add(d);if(i.opts.unevaluated&&c.length&&i.props!==!0)i.props=u$.mergeEvaluated.props(t,(0,u$.toHash)(c),i.props);let s=c.filter((d)=>!(0,u$.alwaysValidSchema)(i,n[d]));if(s.length===0)return;let h=t.name("valid");for(let d of s){if(l(d))u(d);else{if(t.if((0,aK.propertyInData)(t,o,d,i.opts.ownProperties)),u(d),!i.allErrors)t.else().var(h,!0);t.endIf()}e.it.definedProperties.add(d),e.ok(h)}function l(d){return i.opts.useDefaults&&!i.compositeRule&&n[d].default!==void 0}function u(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},h)}}};sK.default=Nse});var yK=G((dK)=>{Object.defineProperty(dK,"__esModule",{value:!0});var lK=Yt(),hg=ye(),uK=ke(),gK=ke(),Rse={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:n,data:r,parentSchema:o,it:i}=e,{opts:c}=i,s=(0,lK.allSchemaProperties)(n),h=s.filter((k)=>(0,uK.alwaysValidSchema)(i,n[k]));if(s.length===0||h.length===s.length&&(!i.opts.unevaluated||i.props===!0))return;let l=c.strictSchema&&!c.allowMatchingProperties&&o.properties,u=t.name("valid");if(i.props!==!0&&!(i.props instanceof hg.Name))i.props=(0,gK.evaluatedPropsToName)(t,i.props);let{props:d}=i;y();function y(){for(let k of s){if(l)p(k);if(i.allErrors)f(k);else t.var(u,!0),f(k),t.if(u)}}function p(k){for(let L in l)if(new RegExp(k).test(L))(0,uK.checkStrictMode)(i,`property ${L} matches pattern ${k} (use allowMatchingProperties)`)}function f(k){t.forIn("key",r,(L)=>{t.if(hg._`${(0,lK.usePattern)(e,k)}.test(${L})`,()=>{let A=h.includes(k);if(!A)e.subschema({keyword:"patternProperties",schemaProp:k,dataProp:L,dataPropType:gK.Type.Str},u);if(i.opts.unevaluated&&d!==!0)t.assign(hg._`${d}[${L}]`,!0);else if(!A&&!i.allErrors)t.if((0,hg.not)(u),()=>t.break())})})}}};dK.default=Rse});var mK=G((bK)=>{Object.defineProperty(bK,"__esModule",{value:!0});var Mse=ke(),Kse={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:n,it:r}=e;if((0,Mse.alwaysValidSchema)(r,n)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};bK.default=Kse});var wK=G((pK)=>{Object.defineProperty(pK,"__esModule",{value:!0});var qse=Yt(),Gse={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:qse.validateUnion,error:{message:"must match a schema in anyOf"}};pK.default=Gse});var kK=G((fK)=>{Object.defineProperty(fK,"__esModule",{value:!0});var lg=ye(),Hse=ke(),Bse={message:"must match exactly one schema in oneOf",params:({params:e})=>lg._`{passingSchemas: ${e.passing}}`},Wse={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Bse,code(e){let{gen:t,schema:n,parentSchema:r,it:o}=e;if(!Array.isArray(n))throw Error("ajv implementation error");if(o.opts.discriminator&&r.discriminator)return;let i=n,c=t.let("valid",!1),s=t.let("passing",null),h=t.name("_valid");e.setParams({passing:s}),t.block(l),e.result(c,()=>e.reset(),()=>e.error(!0));function l(){i.forEach((u,d)=>{let y;if((0,Hse.alwaysValidSchema)(o,u))t.var(h,!0);else y=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},h);if(d>0)t.if(lg._`${h} && ${c}`).assign(c,!1).assign(s,lg._`[${s}, ${d}]`).else();t.if(h,()=>{if(t.assign(c,!0),t.assign(s,d),y)e.mergeEvaluated(y,lg.Name)})})}}};fK.default=Wse});var SK=G((vK)=>{Object.defineProperty(vK,"__esModule",{value:!0});var Fse=ke(),Xse={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:n,it:r}=e;if(!Array.isArray(n))throw Error("ajv implementation error");let o=t.name("valid");n.forEach((i,c)=>{if((0,Fse.alwaysValidSchema)(r,i))return;let s=e.subschema({keyword:"allOf",schemaProp:c},o);e.ok(o),e.mergeEvaluated(s)})}};vK.default=Xse});var LK=G((IK)=>{Object.defineProperty(IK,"__esModule",{value:!0});var ug=ye(),$K=ke(),Qse={message:({params:e})=>ug.str`must match "${e.ifClause}" schema`,params:({params:e})=>ug._`{failingKeyword: ${e.ifClause}}`},Vse={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Qse,code(e){let{gen:t,parentSchema:n,it:r}=e;if(n.then===void 0&&n.else===void 0)(0,$K.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let o=PK(r,"then"),i=PK(r,"else");if(!o&&!i)return;let c=t.let("valid",!0),s=t.name("_valid");if(h(),e.reset(),o&&i){let u=t.let("ifClause");e.setParams({ifClause:u}),t.if(s,l("then",u),l("else",u))}else if(o)t.if(s,l("then"));else t.if((0,ug.not)(s),l("else"));e.pass(c,()=>e.error(!0));function h(){let u=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(u)}function l(u,d){return()=>{let y=e.subschema({keyword:u},s);if(t.assign(c,s),e.mergeValidEvaluated(y,c),d)t.assign(d,ug._`${u}`);else e.setParams({ifClause:u})}}}};function PK(e,t){let n=e.schema[t];return n!==void 0&&!(0,$K.alwaysValidSchema)(e,n)}IK.default=Vse});var OK=G((TK)=>{Object.defineProperty(TK,"__esModule",{value:!0});var the=ke(),nhe={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){if(t.if===void 0)(0,the.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};TK.default=nhe});var CK=G((AK)=>{Object.defineProperty(AK,"__esModule",{value:!0});var rhe=c$(),ihe=JM(),ahe=s$(),che=WM(),she=FM(),hhe=tK(),lhe=rK(),uhe=l$(),ghe=hK(),dhe=yK(),yhe=mK(),bhe=wK(),mhe=kK(),phe=SK(),whe=LK(),fhe=OK();function khe(e=!1){let t=[yhe.default,bhe.default,mhe.default,phe.default,whe.default,fhe.default,lhe.default,uhe.default,hhe.default,ghe.default,dhe.default];if(e)t.push(ihe.default,che.default);else t.push(rhe.default,ahe.default);return t.push(she.default),t}AK.default=khe});var zK=G((DK)=>{Object.defineProperty(DK,"__esModule",{value:!0});var qe=ye(),She={message:({schemaCode:e})=>qe.str`must match format "${e}"`,params:({schemaCode:e})=>qe._`{format: ${e}}`},Phe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:She,code(e,t){let{gen:n,data:r,$data:o,schema:i,schemaCode:c,it:s}=e,{opts:h,errSchemaPath:l,schemaEnv:u,self:d}=s;if(!h.validateFormats)return;if(o)y();else p();function y(){let f=n.scopeValue("formats",{ref:d.formats,code:h.code.formats}),k=n.const("fDef",qe._`${f}[${c}]`),L=n.let("fType"),A=n.let("format");n.if(qe._`typeof ${k} == "object" && !(${k} instanceof RegExp)`,()=>n.assign(L,qe._`${k}.type || "string"`).assign(A,qe._`${k}.validate`),()=>n.assign(L,qe._`"string"`).assign(A,k)),e.fail$data((0,qe.or)(K(),x()));function K(){if(h.strictSchema===!1)return qe.nil;return qe._`${c} && !${A}`}function x(){let Y=u.$async?qe._`(${k}.async ? await ${A}(${r}) : ${A}(${r}))`:qe._`${A}(${r})`,E=qe._`(typeof ${A} == "function" ? ${Y} : ${A}.test(${r}))`;return qe._`${A} && ${A} !== true && ${L} === ${t} && !${E}`}}function p(){let f=d.formats[i];if(!f){K();return}if(f===!0)return;let[k,L,A]=x(f);if(k===t)e.pass(Y());function K(){if(h.strictSchema===!1){d.logger.warn(E());return}throw Error(E());function E(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function x(E){let we=E instanceof RegExp?(0,qe.regexpCode)(E):h.code.formats?qe._`${h.code.formats}${(0,qe.getProperty)(i)}`:void 0,Et=n.scopeValue("formats",{key:i,ref:E,code:we});if(typeof E=="object"&&!(E instanceof RegExp))return[E.type||"string",E.validate,qe._`${Et}.validate`];return["string",E,Et]}function Y(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!u.$async)throw Error("async format in sync schema");return qe._`await ${A}(${r})`}return typeof L=="function"?qe._`${A}(${r})`:qe._`${A}.test(${r})`}}}};DK.default=Phe});var jK=G((_K)=>{Object.defineProperty(_K,"__esModule",{value:!0});var Ihe=zK(),Lhe=[Ihe.default];_K.default=Lhe});var RK=G((NK)=>{Object.defineProperty(NK,"__esModule",{value:!0});NK.contentVocabulary=NK.metadataVocabulary=void 0;NK.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];NK.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var KK=G((MK)=>{Object.defineProperty(MK,"__esModule",{value:!0});var Ahe=sM(),Che=NM(),Dhe=CK(),zhe=jK(),UK=RK(),_he=[Ahe.default,Che.default,(0,Dhe.default)(),zhe.default,UK.metadataVocabulary,UK.contentVocabulary];MK.default=_he});var JK=G((qK)=>{Object.defineProperty(qK,"__esModule",{value:!0});qK.DiscrError=void 0;var EK;(function(e){e.Tag="tag",e.Mapping="mapping"})(EK||(qK.DiscrError=EK={}))});var WK=G((BK)=>{Object.defineProperty(BK,"__esModule",{value:!0});var wi=ye(),g$=JK(),HK=Zu(),Nhe=$c(),xhe=ke(),Rhe={message:({params:{discrError:e,tagName:t}})=>e===g$.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>wi._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},Uhe={keyword:"discriminator",type:"object",schemaType:"object",error:Rhe,code(e){let{gen:t,data:n,schema:r,parentSchema:o,it:i}=e,{oneOf:c}=o;if(!i.opts.discriminator)throw Error("discriminator: requires discriminator option");let s=r.propertyName;if(typeof s!="string")throw Error("discriminator: requires propertyName");if(r.mapping)throw Error("discriminator: mapping is not supported");if(!c)throw Error("discriminator: requires oneOf keyword");let h=t.let("valid",!1),l=t.const("tag",wi._`${n}${(0,wi.getProperty)(s)}`);t.if(wi._`typeof ${l} == "string"`,()=>u(),()=>e.error(!1,{discrError:g$.DiscrError.Tag,tag:l,tagName:s})),e.ok(h);function u(){let p=y();t.if(!1);for(let f in p)t.elseIf(wi._`${l} === ${f}`),t.assign(h,d(p[f]));t.else(),e.error(!1,{discrError:g$.DiscrError.Mapping,tag:l,tagName:s}),t.endIf()}function d(p){let f=t.name("valid"),k=e.subschema({keyword:"oneOf",schemaProp:p},f);return e.mergeEvaluated(k,wi.Name),f}function y(){var p;let f={},k=A(o),L=!0;for(let Y=0;Y<c.length;Y++){let E=c[Y];if((E===null||E===void 0?void 0:E.$ref)&&!(0,xhe.schemaHasRulesButRef)(E,i.self.RULES)){let Et=E.$ref;if(E=HK.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,Et),E instanceof HK.SchemaEnv)E=E.schema;if(E===void 0)throw new Nhe.default(i.opts.uriResolver,i.baseId,Et)}let we=(p=E===null||E===void 0?void 0:E.properties)===null||p===void 0?void 0:p[s];if(typeof we!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);L=L&&(k||A(E)),K(we,Y)}if(!L)throw Error(`discriminator: "${s}" must be required`);return f;function A({required:Y}){return Array.isArray(Y)&&Y.includes(s)}function K(Y,E){if(Y.const)x(Y.const,E);else if(Y.enum)for(let we of Y.enum)x(we,E);else throw Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function x(Y,E){if(typeof Y!="string"||Y in f)throw Error(`discriminator: "${s}" values must be unique strings`);f[Y]=E}}}};BK.default=Uhe});var ZK=G((r6e,Khe)=>{Khe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var XK=G((Ot,d$)=>{Object.defineProperty(Ot,"__esModule",{value:!0});Ot.MissingRefError=Ot.ValidationError=Ot.CodeGen=Ot.Name=Ot.nil=Ot.stringify=Ot.str=Ot._=Ot.KeywordCxt=Ot.Ajv=void 0;var Ehe=Q6(),qhe=KK(),Ghe=WK(),FK=ZK(),Jhe=["/properties"],gg="http://json-schema.org/draft-07/schema";class xc extends Ehe.default{_addVocabularies(){if(super._addVocabularies(),qhe.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(Ghe.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(FK,Jhe):FK;this.addMetaSchema(e,gg,!1),this.refs["http://json-schema.org/schema"]=gg}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(gg)?gg:void 0)}}Ot.Ajv=xc;d$.exports=Ot=xc;d$.exports.Ajv=xc;Object.defineProperty(Ot,"__esModule",{value:!0});Ot.default=xc;var Hhe=Pc();Object.defineProperty(Ot,"KeywordCxt",{enumerable:!0,get:function(){return Hhe.KeywordCxt}});var fi=ye();Object.defineProperty(Ot,"_",{enumerable:!0,get:function(){return fi._}});Object.defineProperty(Ot,"str",{enumerable:!0,get:function(){return fi.str}});Object.defineProperty(Ot,"stringify",{enumerable:!0,get:function(){return fi.stringify}});Object.defineProperty(Ot,"nil",{enumerable:!0,get:function(){return fi.nil}});Object.defineProperty(Ot,"Name",{enumerable:!0,get:function(){return fi.Name}});Object.defineProperty(Ot,"CodeGen",{enumerable:!0,get:function(){return fi.CodeGen}});var Bhe=Bu();Object.defineProperty(Ot,"ValidationError",{enumerable:!0,get:function(){return Bhe.default}});var Whe=$c();Object.defineProperty(Ot,"MissingRefError",{enumerable:!0,get:function(){return Whe.default}})});var aE=G((rE)=>{Object.defineProperty(rE,"__esModule",{value:!0});rE.formatNames=rE.fastFormats=rE.fullFormats=void 0;function $n(e,t){return{validate:e,compare:t}}rE.fullFormats={date:$n(eE,p$),time:$n(b$(!0),w$),"date-time":$n(YK(!0),nE),"iso-time":$n(b$(),tE),"iso-date-time":$n(YK(),oE),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:tle,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:sle,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:nle,int32:{type:"number",validate:ile},int64:{type:"number",validate:ale},float:{type:"number",validate:VK},double:{type:"number",validate:VK},password:!0,binary:!0};rE.fastFormats={...rE.fullFormats,date:$n(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,p$),time:$n(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,w$),"date-time":$n(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,nE),"iso-time":$n(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,tE),"iso-date-time":$n(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,oE),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};rE.formatNames=Object.keys(rE.fullFormats);function Xhe(e){return e%4===0&&(e%100!==0||e%400===0)}var Yhe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Qhe=[0,31,28,31,30,31,30,31,31,30,31,30,31];function eE(e){let t=Yhe.exec(e);if(!t)return!1;let n=+t[1],r=+t[2],o=+t[3];return r>=1&&r<=12&&o>=1&&o<=(r===2&&Xhe(n)?29:Qhe[r])}function p$(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var y$=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function b$(e){return function(n){let r=y$.exec(n);if(!r)return!1;let o=+r[1],i=+r[2],c=+r[3],s=r[4],h=r[5]==="-"?-1:1,l=+(r[6]||0),u=+(r[7]||0);if(l>23||u>59||e&&!s)return!1;if(o<=23&&i<=59&&c<60)return!0;let d=i-u*h,y=o-l*h-(d<0?1:0);return(y===23||y===-1)&&(d===59||d===-1)&&c<61}}function w$(e,t){if(!(e&&t))return;let n=new Date("2020-01-01T"+e).valueOf(),r=new Date("2020-01-01T"+t).valueOf();if(!(n&&r))return;return n-r}function tE(e,t){if(!(e&&t))return;let n=y$.exec(e),r=y$.exec(t);if(!(n&&r))return;if(e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t)return 1;if(e<t)return-1;return 0}var m$=/t|\s/i;function YK(e){let t=b$(e);return function(r){let o=r.split(m$);return o.length===2&&eE(o[0])&&t(o[1])}}function nE(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(!(n&&r))return;return n-r}function oE(e,t){if(!(e&&t))return;let[n,r]=e.split(m$),[o,i]=t.split(m$),c=p$(n,o);if(c===void 0)return;return c||w$(r,i)}var Vhe=/\/|:/,ele=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function tle(e){return Vhe.test(e)&&ele.test(e)}var QK=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function nle(e){return QK.lastIndex=0,QK.test(e)}var ole=-2147483648,rle=2147483647;function ile(e){return Number.isInteger(e)&&e<=rle&&e>=ole}function ale(e){return Number.isInteger(e)}function VK(){return!0}var cle=/[^\\]\\Z/;function sle(e){if(cle.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var sE=G((cE)=>{Object.defineProperty(cE,"__esModule",{value:!0});cE.formatLimitDefinition=void 0;var lle=XK(),gn=ye(),wo=gn.operators,dg={formatMaximum:{okStr:"<=",ok:wo.LTE,fail:wo.GT},formatMinimum:{okStr:">=",ok:wo.GTE,fail:wo.LT},formatExclusiveMaximum:{okStr:"<",ok:wo.LT,fail:wo.GTE},formatExclusiveMinimum:{okStr:">",ok:wo.GT,fail:wo.LTE}},ule={message:({keyword:e,schemaCode:t})=>gn.str`should be ${dg[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>gn._`{comparison: ${dg[e].okStr}, limit: ${t}}`};cE.formatLimitDefinition={keyword:Object.keys(dg),type:"string",schemaType:"string",$data:!0,error:ule,code(e){let{gen:t,data:n,schemaCode:r,keyword:o,it:i}=e,{opts:c,self:s}=i;if(!c.validateFormats)return;let h=new lle.KeywordCxt(i,s.RULES.all.format.definition,"format");if(h.$data)l();else u();function l(){let y=t.scopeValue("formats",{ref:s.formats,code:c.code.formats}),p=t.const("fmt",gn._`${y}[${h.schemaCode}]`);e.fail$data((0,gn.or)(gn._`typeof ${p} != "object"`,gn._`${p} instanceof RegExp`,gn._`typeof ${p}.compare != "function"`,d(p)))}function u(){let y=h.schema,p=s.formats[y];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw Error(`"${o}": format "${y}" does not define "compare" function`);let f=t.scopeValue("formats",{key:y,ref:p,code:c.code.formats?gn._`${c.code.formats}${(0,gn.getProperty)(y)}`:void 0});e.fail$data(d(f))}function d(y){return gn._`${y}.compare(${n}, ${r}) ${dg[o].fail} 0`}},dependencies:["format"]};var gle=(e)=>{return e.addKeyword(cE.formatLimitDefinition),e};cE.default=gle});var gE=G((Rc,uE)=>{Object.defineProperty(Rc,"__esModule",{value:!0});var ki=aE(),yle=sE(),v$=ye(),hE=new v$.Name("fullFormats"),ble=new v$.Name("fastFormats"),S$=(e,t={keywords:!0})=>{if(Array.isArray(t))return lE(e,t,ki.fullFormats,hE),e;let[n,r]=t.mode==="fast"?[ki.fastFormats,ble]:[ki.fullFormats,hE],o=t.formats||ki.formatNames;if(lE(e,o,n,r),t.keywords)(0,yle.default)(e);return e};S$.get=(e,t="full")=>{let r=(t==="fast"?ki.fastFormats:ki.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function lE(e,t,n,r){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=v$._`require("ajv-formats/dist/formats").${r}`);for(let c of t)e.addFormat(c,n[c])}uE.exports=Rc=S$;Object.defineProperty(Rc,"__esModule",{value:!0});Rc.default=S$});var mle;var dE=g(()=>{mle=Io(gE(),1)});var yE=g(()=>{qo()});var bE=g(()=>{CU();qo();dE();ku();yE()});var wle;var mE=g(()=>{wle=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then((e)=>e.webcrypto)});var it,fle,wE,kle,vle,Sle,Ple,pE,$le,Ile,Lle,N6e,x6e;var P$=g(()=>{fS();it=Wh().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:fk.custom,message:"URL must be parseable",fatal:!0}),da}).refine((e)=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),fle=Ee({resource:v().url(),authorization_servers:B(it).optional(),jwks_uri:v().url().optional(),scopes_supported:B(v()).optional(),bearer_methods_supported:B(v()).optional(),resource_signing_alg_values_supported:B(v()).optional(),resource_name:v().optional(),resource_documentation:v().optional(),resource_policy_uri:v().url().optional(),resource_tos_uri:v().url().optional(),tls_client_certificate_bound_access_tokens:Ie().optional(),authorization_details_types_supported:B(v()).optional(),dpop_signing_alg_values_supported:B(v()).optional(),dpop_bound_access_tokens_required:Ie().optional()}),wE=Ee({issuer:v(),authorization_endpoint:it,token_endpoint:it,registration_endpoint:it.optional(),scopes_supported:B(v()).optional(),response_types_supported:B(v()),response_modes_supported:B(v()).optional(),grant_types_supported:B(v()).optional(),token_endpoint_auth_methods_supported:B(v()).optional(),token_endpoint_auth_signing_alg_values_supported:B(v()).optional(),service_documentation:it.optional(),revocation_endpoint:it.optional(),revocation_endpoint_auth_methods_supported:B(v()).optional(),revocation_endpoint_auth_signing_alg_values_supported:B(v()).optional(),introspection_endpoint:v().optional(),introspection_endpoint_auth_methods_supported:B(v()).optional(),introspection_endpoint_auth_signing_alg_values_supported:B(v()).optional(),code_challenge_methods_supported:B(v()).optional(),client_id_metadata_document_supported:Ie().optional()}),kle=Ee({issuer:v(),authorization_endpoint:it,token_endpoint:it,userinfo_endpoint:it.optional(),jwks_uri:it,registration_endpoint:it.optional(),scopes_supported:B(v()).optional(),response_types_supported:B(v()),response_modes_supported:B(v()).optional(),grant_types_supported:B(v()).optional(),acr_values_supported:B(v()).optional(),subject_types_supported:B(v()),id_token_signing_alg_values_supported:B(v()),id_token_encryption_alg_values_supported:B(v()).optional(),id_token_encryption_enc_values_supported:B(v()).optional(),userinfo_signing_alg_values_supported:B(v()).optional(),userinfo_encryption_alg_values_supported:B(v()).optional(),userinfo_encryption_enc_values_supported:B(v()).optional(),request_object_signing_alg_values_supported:B(v()).optional(),request_object_encryption_alg_values_supported:B(v()).optional(),request_object_encryption_enc_values_supported:B(v()).optional(),token_endpoint_auth_methods_supported:B(v()).optional(),token_endpoint_auth_signing_alg_values_supported:B(v()).optional(),display_values_supported:B(v()).optional(),claim_types_supported:B(v()).optional(),claims_supported:B(v()).optional(),service_documentation:v().optional(),claims_locales_supported:B(v()).optional(),ui_locales_supported:B(v()).optional(),claims_parameter_supported:Ie().optional(),request_parameter_supported:Ie().optional(),request_uri_parameter_supported:Ie().optional(),require_request_uri_registration:Ie().optional(),op_policy_uri:it.optional(),op_tos_uri:it.optional(),client_id_metadata_document_supported:Ie().optional()}),vle=Z({...kle.shape,...wE.pick({code_challenge_methods_supported:!0}).shape}),Sle=Z({access_token:v(),id_token:v().optional(),token_type:v(),expires_in:ec.number().optional(),scope:v().optional(),refresh_token:v().optional()}).strip(),Ple=Z({error:v(),error_description:v().optional(),error_uri:v().optional()}),pE=it.optional().or(V("").transform(()=>{return})),$le=Z({redirect_uris:B(it),token_endpoint_auth_method:v().optional(),grant_types:B(v()).optional(),response_types:B(v()).optional(),client_name:v().optional(),client_uri:it.optional(),logo_uri:pE,scope:v().optional(),contacts:B(v()).optional(),tos_uri:pE,policy_uri:v().optional(),jwks_uri:it.optional(),jwks:ll().optional(),software_id:v().optional(),software_version:v().optional(),software_statement:v().optional()}).strip(),Ile=Z({client_id:v(),client_secret:v().optional(),client_id_issued_at:me().optional(),client_secret_expires_at:me().optional()}).strip(),Lle=$le.merge(Ile),N6e=Z({error:v(),error_description:v().optional()}).strip(),x6e=Z({token:v(),token_type_hint:v().optional()}).strip()});var Be,yg,Uc,Mc,Kc,bg,mg,pg,Ec,wg,fg,kg,vg,Sg,Pg,qc,$g,Ig,Tle;var fE=g(()=>{Be=class Be extends Error{constructor(e,t){super(e);this.errorUri=t,this.name=this.constructor.name}toResponseObject(){let e={error:this.errorCode,error_description:this.message};if(this.errorUri)e.error_uri=this.errorUri;return e}get errorCode(){return this.constructor.errorCode}};yg=class yg extends Be{};yg.errorCode="invalid_request";Uc=class Uc extends Be{};Uc.errorCode="invalid_client";Mc=class Mc extends Be{};Mc.errorCode="invalid_grant";Kc=class Kc extends Be{};Kc.errorCode="unauthorized_client";bg=class bg extends Be{};bg.errorCode="unsupported_grant_type";mg=class mg extends Be{};mg.errorCode="invalid_scope";pg=class pg extends Be{};pg.errorCode="access_denied";Ec=class Ec extends Be{};Ec.errorCode="server_error";wg=class wg extends Be{};wg.errorCode="temporarily_unavailable";fg=class fg extends Be{};fg.errorCode="unsupported_response_type";kg=class kg extends Be{};kg.errorCode="unsupported_token_type";vg=class vg extends Be{};vg.errorCode="invalid_token";Sg=class Sg extends Be{};Sg.errorCode="method_not_allowed";Pg=class Pg extends Be{};Pg.errorCode="too_many_requests";qc=class qc extends Be{};qc.errorCode="invalid_client_metadata";$g=class $g extends Be{};$g.errorCode="insufficient_scope";Ig=class Ig extends Be{};Ig.errorCode="invalid_target";Tle={[yg.errorCode]:yg,[Uc.errorCode]:Uc,[Mc.errorCode]:Mc,[Kc.errorCode]:Kc,[bg.errorCode]:bg,[mg.errorCode]:mg,[pg.errorCode]:pg,[Ec.errorCode]:Ec,[wg.errorCode]:wg,[fg.errorCode]:fg,[kg.errorCode]:kg,[vg.errorCode]:vg,[Sg.errorCode]:Sg,[Pg.errorCode]:Pg,[qc.errorCode]:qc,[$g.errorCode]:$g,[Ig.errorCode]:Ig}});var $$=g(()=>{mE();qo();P$();P$();fE()});var kE=g(()=>{qo();$$()});var vE=g(()=>{qo();$$()});var SE=()=>{};var PE=g(()=>{SE()});var jle,fMe,kMe,Nle,vMe,SMe,PMe,$Me;var $E=g(()=>{bE();kE();vE();PE();be();uu();jle=Io(F4(),1),fMe=a.object({name:a.string().min(1),description:a.string().optional(),inputSchema:a.record(a.string(),a.unknown()).optional(),annotations:a.record(a.string(),a.unknown()).optional()}),kMe=a.object({results:a.array(a.object({id:a.string().min(1),readonly:a.boolean().optional()}))}),Nle=a.object({type:a.string()}).catchall(a.unknown()),vMe=a.object({content:a.array(Nle),structuredContent:a.unknown().optional(),isError:a.boolean().optional()}),SMe=a.object({name:a.string().min(1),version:a.string().min(1)}),PMe=a.object({status:a.number().int().optional(),data:a.object({status:a.number().int().optional()}).passthrough().optional(),cause:a.object({status:a.number().int().optional()}).passthrough().optional()}).passthrough(),$Me=a.object({exp:a.number().int().positive().optional()}).passthrough()});var dn=(e,t)=>e.find((n)=>n.name.trim()===t),IE=(e)=>{let t=dn(e,"Authorization");if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},LE=(e)=>{let t=dn(e,"DD_API_KEY"),n=dn(e,"DD_APPLICATION_KEY");return[t,n].filter((r)=>r!==void 0).map((r)=>({...r,name:r.name.trim(),value:r.value.trim()}))},TE=({headers:e})=>{let t=e.Authorization?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("ApiKey "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},xle=(e)=>{try{let t=new URL(e);if(!t.hostname.startsWith("mcp."))return null;return`${t.protocol}//${t.hostname.replace(/^mcp\./,"api.")}`}catch{return null}},OE=async({headers:e,serverUrl:t})=>{let n=e.DD_API_KEY?.trim(),r=e.DD_APPLICATION_KEY?.trim();if(!n||!r)return{success:!1,errorMessage:"Missing required fields."};let o=xle(t);if(!o)return{success:!0};let i;try{i=await fetch(`${o}/api/v2/validate_keys`,{method:"GET",headers:{"DD-API-KEY":n,"DD-APPLICATION-KEY":r},signal:AbortSignal.timeout(1e4)})}catch{return{success:!1,errorMessage:"Unable to reach the provider's API. Please try again."}}if(!i.ok)return{success:!1,errorMessage:i.status===401||i.status===403?"Invalid inputs. Please check and try again.":"Unable to reach the provider's API. Please try again."};return{success:!0}},AE=(e)=>{let t=dn(e,"Authorization");if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},CE=async({headers:e})=>{let t=e.Authorization?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};let n;try{n=await fetch("https://api.cloudflare.com/client/v4/user/tokens/verify",{method:"GET",headers:{Authorization:t},signal:AbortSignal.timeout(1e4)})}catch{return{success:!1,errorMessage:"Unable to reach the provider's API. Please try again."}}if(!n.ok)return{success:!1,errorMessage:n.status===401||n.status===403?"Invalid inputs. Please check and try again.":"Unable to reach the provider's API. Please try again."};let r;try{r=await n.json()}catch{return{success:!1,errorMessage:"Unable to reach the provider's API. Please try again."}}if(r.success!==!0||r.result?.status!=="active")return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},DE=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},zE=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},_E=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},jE=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},NE=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},xE=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},RE=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},UE=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},ME=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},KE=async({headers:e})=>{let t=e.Authorization?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};let n;try{n=await fetch("https://api.render.com/v1/owners",{method:"GET",headers:{Authorization:t,Accept:"application/json"},signal:AbortSignal.timeout(1e4)})}catch{return{success:!1,errorMessage:"Unable to reach the provider's API. Please try again."}}if(!n.ok)return{success:!1,errorMessage:n.status===401||n.status===403?"Invalid inputs. Please check and try again.":"Unable to reach the provider's API. Please try again."};return{success:!0}},EE=(e)=>{let t=dn(e,"SIGNOZ-API-KEY"),n=dn(e,"X-SigNoz-URL");return[t,n].filter((r)=>r!==void 0).map((r)=>({...r,name:r.name.trim(),value:r.value.trim()}))},qE=({headers:e})=>{if(!e["SIGNOZ-API-KEY"]?.trim())return{success:!1,errorMessage:"Missing required fields."};return{success:!0}},GE=(e)=>{let t=dn(e,"x-api-key");if(!t)return e;return[{id:t.id,name:"x-api-key",value:t.value.trim()}]},JE=({headers:e})=>{if(!e["x-api-key"]?.trim())return{success:!1,errorMessage:"Missing required fields."};return{success:!0}},HE=(e)=>{let t=dn(e,"x-consumer-api-key");if(!t)return e;return[{id:t.id,name:"x-consumer-api-key",value:t.value.trim()}]},BE=({headers:e})=>{if(!e["x-consumer-api-key"]?.trim())return{success:!1,errorMessage:"Missing required fields."};return{success:!0}},WE=(e)=>{let t=dn(e,"X-API-Key");if(!t)return e;return[{id:t.id,name:"X-API-Key",value:t.value.trim()}]},ZE=({headers:e})=>{if(!e["X-API-Key"]?.trim())return{success:!1,errorMessage:"Missing required fields."};return{success:!0}},FE=(e)=>{let t=dn(e,"x-context-dev-api-key");if(!t)return e;return[{id:t.id,name:"x-context-dev-api-key",value:t.value.trim()}]},XE=({headers:e})=>{if(!e["x-context-dev-api-key"]?.trim())return{success:!1,errorMessage:"Missing required fields."};return{success:!0}},YE=(e)=>{let t=dn(e,"Authorization");if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},QE=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},VE=({headers:e})=>{let t=e.Authorization?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},eq=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Basic "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},tq=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},nq=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},oq=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},rq=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},iq=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},aq=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},cq=async({headers:e,serverUrl:t})=>{let n=new URL(t);n.pathname="/user/v1/projects/",n.search="",n.hash="";let r;try{r=await fetch(n,{method:"GET",headers:e,signal:AbortSignal.timeout(1e4)})}catch{return{success:!1,errorMessage:"Unable to reach the provider's API. Please try again."}}if(r.ok)return{success:!0};if(r.status===401||r.status===403)return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!1,errorMessage:"Unable to reach the provider's API. Please try again."}};var TMe,OMe,AMe,CMe,DMe,zMe,_Me,jMe,NMe,xMe,RMe,UMe,MMe,KMe,EMe,qMe,GMe,JMe,HMe,BMe,WMe,ZMe,FMe,XMe,YMe,QMe,VMe,eKe,tKe,nKe,oKe,rKe,iKe,aKe,cKe,sKe,hKe,lKe,uKe,gKe,dKe,yKe,bKe,mKe,pKe,wKe,fKe,kKe,vKe,SKe,PKe,$Ke,IKe,LKe,TKe,OKe,AKe,CKe;var sq=g(()=>{TMe=`
7481
+ deps: ${n}}`};var Sse={keyword:"dependencies",type:"object",schemaType:"object",error:QM.error,code(e){let[t,n]=Pse(e);XM(e,t),YM(e,n)}};function Pse({schema:e}){let t={},n={};for(let r in e){if(r==="__proto__")continue;let o=Array.isArray(e[r])?t:n;o[r]=e[r]}return[t,n]}function XM(e,t=e.schema){let{gen:n,data:r,it:o}=e;if(Object.keys(t).length===0)return;let i=n.let("missing");for(let c in t){let s=t[c];if(s.length===0)continue;let h=(0,Nc.propertyInData)(n,r,c,o.opts.ownProperties);if(e.setParams({property:c,depsCount:s.length,deps:s.join(", ")}),o.allErrors)n.if(h,()=>{for(let l of s)(0,Nc.checkReportMissingProp)(e,l)});else n.if(h$._`${h} && (${(0,Nc.checkMissingProp)(e,s,i)})`),(0,Nc.reportMissingProp)(e,i),n.else()}}QM.validatePropertyDeps=XM;function YM(e,t=e.schema){let{gen:n,data:r,keyword:o,it:i}=e,c=n.name("valid");for(let s in t){if((0,vse.alwaysValidSchema)(i,t[s]))continue;n.if((0,Nc.propertyInData)(n,r,s,i.opts.ownProperties),()=>{let h=e.subschema({keyword:o,schemaProp:s},c);e.mergeValidEvaluated(h,c)},()=>n.var(c,!0)),e.ok(c)}}QM.validateSchemaDeps=YM;QM.default=Sse});var rK=G((oK)=>{Object.defineProperty(oK,"__esModule",{value:!0});var nK=ye(),Lse=ke(),Tse={message:"property name must be valid",params:({params:e})=>nK._`{propertyName: ${e.propertyName}}`},Ose={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Tse,code(e){let{gen:t,schema:n,data:r,it:o}=e;if((0,Lse.alwaysValidSchema)(o,n))return;let i=t.name("valid");t.forIn("key",r,(c)=>{e.setParams({propertyName:c}),e.subschema({keyword:"propertyNames",data:c,dataTypes:["string"],propertyName:c,compositeRule:!0},i),t.if((0,nK.not)(i),()=>{if(e.error(!0),!o.allErrors)t.break()})}),e.ok(i)}};oK.default=Ose});var l$=G((iK)=>{Object.defineProperty(iK,"__esModule",{value:!0});var cg=Yt(),un=ye(),Cse=Mn(),sg=ke(),Dse={message:"must NOT have additional properties",params:({params:e})=>un._`{additionalProperty: ${e.additionalProperty}}`},zse={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Dse,code(e){let{gen:t,schema:n,parentSchema:r,data:o,errsCount:i,it:c}=e;if(!i)throw Error("ajv implementation error");let{allErrors:s,opts:h}=c;if(c.props=!0,h.removeAdditional!=="all"&&(0,sg.alwaysValidSchema)(c,n))return;let l=(0,cg.allSchemaProperties)(r.properties),u=(0,cg.allSchemaProperties)(r.patternProperties);d(),e.ok(un._`${i} === ${Cse.default.errors}`);function d(){t.forIn("key",o,(L)=>{if(!l.length&&!u.length)f(L);else t.if(y(L),()=>f(L))})}function y(L){let A;if(l.length>8){let K=(0,sg.schemaRefOrVal)(c,r.properties,"properties");A=(0,cg.isOwnProperty)(t,K,L)}else if(l.length)A=(0,un.or)(...l.map((K)=>un._`${L} === ${K}`));else A=un.nil;if(u.length)A=(0,un.or)(A,...u.map((K)=>un._`${(0,cg.usePattern)(e,K)}.test(${L})`));return(0,un.not)(A)}function p(L){t.code(un._`delete ${o}[${L}]`)}function f(L){if(h.removeAdditional==="all"||h.removeAdditional&&n===!1){p(L);return}if(n===!1){if(e.setParams({additionalProperty:L}),e.error(),!s)t.break();return}if(typeof n=="object"&&!(0,sg.alwaysValidSchema)(c,n)){let A=t.name("valid");if(h.removeAdditional==="failing")k(L,A,!1),t.if((0,un.not)(A),()=>{e.reset(),p(L)});else if(k(L,A),!s)t.if((0,un.not)(A),()=>t.break())}}function k(L,A,K){let x={keyword:"additionalProperties",dataProp:L,dataPropType:sg.Type.Str};if(K===!1)Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(x,A)}}};iK.default=zse});var hK=G((sK)=>{Object.defineProperty(sK,"__esModule",{value:!0});var jse=Pc(),aK=Yt(),u$=ke(),cK=l$(),Nse={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:n,parentSchema:r,data:o,it:i}=e;if(i.opts.removeAdditional==="all"&&r.additionalProperties===void 0)cK.default.code(new jse.KeywordCxt(i,cK.default,"additionalProperties"));let c=(0,aK.allSchemaProperties)(n);for(let d of c)i.definedProperties.add(d);if(i.opts.unevaluated&&c.length&&i.props!==!0)i.props=u$.mergeEvaluated.props(t,(0,u$.toHash)(c),i.props);let s=c.filter((d)=>!(0,u$.alwaysValidSchema)(i,n[d]));if(s.length===0)return;let h=t.name("valid");for(let d of s){if(l(d))u(d);else{if(t.if((0,aK.propertyInData)(t,o,d,i.opts.ownProperties)),u(d),!i.allErrors)t.else().var(h,!0);t.endIf()}e.it.definedProperties.add(d),e.ok(h)}function l(d){return i.opts.useDefaults&&!i.compositeRule&&n[d].default!==void 0}function u(d){e.subschema({keyword:"properties",schemaProp:d,dataProp:d},h)}}};sK.default=Nse});var yK=G((dK)=>{Object.defineProperty(dK,"__esModule",{value:!0});var lK=Yt(),hg=ye(),uK=ke(),gK=ke(),Rse={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:n,data:r,parentSchema:o,it:i}=e,{opts:c}=i,s=(0,lK.allSchemaProperties)(n),h=s.filter((k)=>(0,uK.alwaysValidSchema)(i,n[k]));if(s.length===0||h.length===s.length&&(!i.opts.unevaluated||i.props===!0))return;let l=c.strictSchema&&!c.allowMatchingProperties&&o.properties,u=t.name("valid");if(i.props!==!0&&!(i.props instanceof hg.Name))i.props=(0,gK.evaluatedPropsToName)(t,i.props);let{props:d}=i;y();function y(){for(let k of s){if(l)p(k);if(i.allErrors)f(k);else t.var(u,!0),f(k),t.if(u)}}function p(k){for(let L in l)if(new RegExp(k).test(L))(0,uK.checkStrictMode)(i,`property ${L} matches pattern ${k} (use allowMatchingProperties)`)}function f(k){t.forIn("key",r,(L)=>{t.if(hg._`${(0,lK.usePattern)(e,k)}.test(${L})`,()=>{let A=h.includes(k);if(!A)e.subschema({keyword:"patternProperties",schemaProp:k,dataProp:L,dataPropType:gK.Type.Str},u);if(i.opts.unevaluated&&d!==!0)t.assign(hg._`${d}[${L}]`,!0);else if(!A&&!i.allErrors)t.if((0,hg.not)(u),()=>t.break())})})}}};dK.default=Rse});var mK=G((bK)=>{Object.defineProperty(bK,"__esModule",{value:!0});var Mse=ke(),Kse={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:n,it:r}=e;if((0,Mse.alwaysValidSchema)(r,n)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};bK.default=Kse});var wK=G((pK)=>{Object.defineProperty(pK,"__esModule",{value:!0});var qse=Yt(),Gse={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:qse.validateUnion,error:{message:"must match a schema in anyOf"}};pK.default=Gse});var kK=G((fK)=>{Object.defineProperty(fK,"__esModule",{value:!0});var lg=ye(),Hse=ke(),Bse={message:"must match exactly one schema in oneOf",params:({params:e})=>lg._`{passingSchemas: ${e.passing}}`},Wse={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Bse,code(e){let{gen:t,schema:n,parentSchema:r,it:o}=e;if(!Array.isArray(n))throw Error("ajv implementation error");if(o.opts.discriminator&&r.discriminator)return;let i=n,c=t.let("valid",!1),s=t.let("passing",null),h=t.name("_valid");e.setParams({passing:s}),t.block(l),e.result(c,()=>e.reset(),()=>e.error(!0));function l(){i.forEach((u,d)=>{let y;if((0,Hse.alwaysValidSchema)(o,u))t.var(h,!0);else y=e.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},h);if(d>0)t.if(lg._`${h} && ${c}`).assign(c,!1).assign(s,lg._`[${s}, ${d}]`).else();t.if(h,()=>{if(t.assign(c,!0),t.assign(s,d),y)e.mergeEvaluated(y,lg.Name)})})}}};fK.default=Wse});var SK=G((vK)=>{Object.defineProperty(vK,"__esModule",{value:!0});var Fse=ke(),Xse={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:n,it:r}=e;if(!Array.isArray(n))throw Error("ajv implementation error");let o=t.name("valid");n.forEach((i,c)=>{if((0,Fse.alwaysValidSchema)(r,i))return;let s=e.subschema({keyword:"allOf",schemaProp:c},o);e.ok(o),e.mergeEvaluated(s)})}};vK.default=Xse});var LK=G((IK)=>{Object.defineProperty(IK,"__esModule",{value:!0});var ug=ye(),$K=ke(),Qse={message:({params:e})=>ug.str`must match "${e.ifClause}" schema`,params:({params:e})=>ug._`{failingKeyword: ${e.ifClause}}`},Vse={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Qse,code(e){let{gen:t,parentSchema:n,it:r}=e;if(n.then===void 0&&n.else===void 0)(0,$K.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let o=PK(r,"then"),i=PK(r,"else");if(!o&&!i)return;let c=t.let("valid",!0),s=t.name("_valid");if(h(),e.reset(),o&&i){let u=t.let("ifClause");e.setParams({ifClause:u}),t.if(s,l("then",u),l("else",u))}else if(o)t.if(s,l("then"));else t.if((0,ug.not)(s),l("else"));e.pass(c,()=>e.error(!0));function h(){let u=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(u)}function l(u,d){return()=>{let y=e.subschema({keyword:u},s);if(t.assign(c,s),e.mergeValidEvaluated(y,c),d)t.assign(d,ug._`${u}`);else e.setParams({ifClause:u})}}}};function PK(e,t){let n=e.schema[t];return n!==void 0&&!(0,$K.alwaysValidSchema)(e,n)}IK.default=Vse});var OK=G((TK)=>{Object.defineProperty(TK,"__esModule",{value:!0});var the=ke(),nhe={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){if(t.if===void 0)(0,the.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};TK.default=nhe});var CK=G((AK)=>{Object.defineProperty(AK,"__esModule",{value:!0});var rhe=c$(),ihe=JM(),ahe=s$(),che=WM(),she=FM(),hhe=tK(),lhe=rK(),uhe=l$(),ghe=hK(),dhe=yK(),yhe=mK(),bhe=wK(),mhe=kK(),phe=SK(),whe=LK(),fhe=OK();function khe(e=!1){let t=[yhe.default,bhe.default,mhe.default,phe.default,whe.default,fhe.default,lhe.default,uhe.default,hhe.default,ghe.default,dhe.default];if(e)t.push(ihe.default,che.default);else t.push(rhe.default,ahe.default);return t.push(she.default),t}AK.default=khe});var zK=G((DK)=>{Object.defineProperty(DK,"__esModule",{value:!0});var qe=ye(),She={message:({schemaCode:e})=>qe.str`must match format "${e}"`,params:({schemaCode:e})=>qe._`{format: ${e}}`},Phe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:She,code(e,t){let{gen:n,data:r,$data:o,schema:i,schemaCode:c,it:s}=e,{opts:h,errSchemaPath:l,schemaEnv:u,self:d}=s;if(!h.validateFormats)return;if(o)y();else p();function y(){let f=n.scopeValue("formats",{ref:d.formats,code:h.code.formats}),k=n.const("fDef",qe._`${f}[${c}]`),L=n.let("fType"),A=n.let("format");n.if(qe._`typeof ${k} == "object" && !(${k} instanceof RegExp)`,()=>n.assign(L,qe._`${k}.type || "string"`).assign(A,qe._`${k}.validate`),()=>n.assign(L,qe._`"string"`).assign(A,k)),e.fail$data((0,qe.or)(K(),x()));function K(){if(h.strictSchema===!1)return qe.nil;return qe._`${c} && !${A}`}function x(){let Y=u.$async?qe._`(${k}.async ? await ${A}(${r}) : ${A}(${r}))`:qe._`${A}(${r})`,E=qe._`(typeof ${A} == "function" ? ${Y} : ${A}.test(${r}))`;return qe._`${A} && ${A} !== true && ${L} === ${t} && !${E}`}}function p(){let f=d.formats[i];if(!f){K();return}if(f===!0)return;let[k,L,A]=x(f);if(k===t)e.pass(Y());function K(){if(h.strictSchema===!1){d.logger.warn(E());return}throw Error(E());function E(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function x(E){let we=E instanceof RegExp?(0,qe.regexpCode)(E):h.code.formats?qe._`${h.code.formats}${(0,qe.getProperty)(i)}`:void 0,Et=n.scopeValue("formats",{key:i,ref:E,code:we});if(typeof E=="object"&&!(E instanceof RegExp))return[E.type||"string",E.validate,qe._`${Et}.validate`];return["string",E,Et]}function Y(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!u.$async)throw Error("async format in sync schema");return qe._`await ${A}(${r})`}return typeof L=="function"?qe._`${A}(${r})`:qe._`${A}.test(${r})`}}}};DK.default=Phe});var jK=G((_K)=>{Object.defineProperty(_K,"__esModule",{value:!0});var Ihe=zK(),Lhe=[Ihe.default];_K.default=Lhe});var RK=G((NK)=>{Object.defineProperty(NK,"__esModule",{value:!0});NK.contentVocabulary=NK.metadataVocabulary=void 0;NK.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];NK.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var KK=G((MK)=>{Object.defineProperty(MK,"__esModule",{value:!0});var Ahe=sM(),Che=NM(),Dhe=CK(),zhe=jK(),UK=RK(),_he=[Ahe.default,Che.default,(0,Dhe.default)(),zhe.default,UK.metadataVocabulary,UK.contentVocabulary];MK.default=_he});var JK=G((qK)=>{Object.defineProperty(qK,"__esModule",{value:!0});qK.DiscrError=void 0;var EK;(function(e){e.Tag="tag",e.Mapping="mapping"})(EK||(qK.DiscrError=EK={}))});var WK=G((BK)=>{Object.defineProperty(BK,"__esModule",{value:!0});var wi=ye(),g$=JK(),HK=Zu(),Nhe=$c(),xhe=ke(),Rhe={message:({params:{discrError:e,tagName:t}})=>e===g$.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>wi._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},Uhe={keyword:"discriminator",type:"object",schemaType:"object",error:Rhe,code(e){let{gen:t,data:n,schema:r,parentSchema:o,it:i}=e,{oneOf:c}=o;if(!i.opts.discriminator)throw Error("discriminator: requires discriminator option");let s=r.propertyName;if(typeof s!="string")throw Error("discriminator: requires propertyName");if(r.mapping)throw Error("discriminator: mapping is not supported");if(!c)throw Error("discriminator: requires oneOf keyword");let h=t.let("valid",!1),l=t.const("tag",wi._`${n}${(0,wi.getProperty)(s)}`);t.if(wi._`typeof ${l} == "string"`,()=>u(),()=>e.error(!1,{discrError:g$.DiscrError.Tag,tag:l,tagName:s})),e.ok(h);function u(){let p=y();t.if(!1);for(let f in p)t.elseIf(wi._`${l} === ${f}`),t.assign(h,d(p[f]));t.else(),e.error(!1,{discrError:g$.DiscrError.Mapping,tag:l,tagName:s}),t.endIf()}function d(p){let f=t.name("valid"),k=e.subschema({keyword:"oneOf",schemaProp:p},f);return e.mergeEvaluated(k,wi.Name),f}function y(){var p;let f={},k=A(o),L=!0;for(let Y=0;Y<c.length;Y++){let E=c[Y];if((E===null||E===void 0?void 0:E.$ref)&&!(0,xhe.schemaHasRulesButRef)(E,i.self.RULES)){let Et=E.$ref;if(E=HK.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,Et),E instanceof HK.SchemaEnv)E=E.schema;if(E===void 0)throw new Nhe.default(i.opts.uriResolver,i.baseId,Et)}let we=(p=E===null||E===void 0?void 0:E.properties)===null||p===void 0?void 0:p[s];if(typeof we!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);L=L&&(k||A(E)),K(we,Y)}if(!L)throw Error(`discriminator: "${s}" must be required`);return f;function A({required:Y}){return Array.isArray(Y)&&Y.includes(s)}function K(Y,E){if(Y.const)x(Y.const,E);else if(Y.enum)for(let we of Y.enum)x(we,E);else throw Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function x(Y,E){if(typeof Y!="string"||Y in f)throw Error(`discriminator: "${s}" values must be unique strings`);f[Y]=E}}}};BK.default=Uhe});var ZK=G((h6e,Khe)=>{Khe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var XK=G((Ot,d$)=>{Object.defineProperty(Ot,"__esModule",{value:!0});Ot.MissingRefError=Ot.ValidationError=Ot.CodeGen=Ot.Name=Ot.nil=Ot.stringify=Ot.str=Ot._=Ot.KeywordCxt=Ot.Ajv=void 0;var Ehe=Q6(),qhe=KK(),Ghe=WK(),FK=ZK(),Jhe=["/properties"],gg="http://json-schema.org/draft-07/schema";class xc extends Ehe.default{_addVocabularies(){if(super._addVocabularies(),qhe.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(Ghe.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(FK,Jhe):FK;this.addMetaSchema(e,gg,!1),this.refs["http://json-schema.org/schema"]=gg}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(gg)?gg:void 0)}}Ot.Ajv=xc;d$.exports=Ot=xc;d$.exports.Ajv=xc;Object.defineProperty(Ot,"__esModule",{value:!0});Ot.default=xc;var Hhe=Pc();Object.defineProperty(Ot,"KeywordCxt",{enumerable:!0,get:function(){return Hhe.KeywordCxt}});var fi=ye();Object.defineProperty(Ot,"_",{enumerable:!0,get:function(){return fi._}});Object.defineProperty(Ot,"str",{enumerable:!0,get:function(){return fi.str}});Object.defineProperty(Ot,"stringify",{enumerable:!0,get:function(){return fi.stringify}});Object.defineProperty(Ot,"nil",{enumerable:!0,get:function(){return fi.nil}});Object.defineProperty(Ot,"Name",{enumerable:!0,get:function(){return fi.Name}});Object.defineProperty(Ot,"CodeGen",{enumerable:!0,get:function(){return fi.CodeGen}});var Bhe=Bu();Object.defineProperty(Ot,"ValidationError",{enumerable:!0,get:function(){return Bhe.default}});var Whe=$c();Object.defineProperty(Ot,"MissingRefError",{enumerable:!0,get:function(){return Whe.default}})});var aE=G((rE)=>{Object.defineProperty(rE,"__esModule",{value:!0});rE.formatNames=rE.fastFormats=rE.fullFormats=void 0;function $n(e,t){return{validate:e,compare:t}}rE.fullFormats={date:$n(eE,p$),time:$n(b$(!0),w$),"date-time":$n(YK(!0),nE),"iso-time":$n(b$(),tE),"iso-date-time":$n(YK(),oE),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:tle,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:sle,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:nle,int32:{type:"number",validate:ile},int64:{type:"number",validate:ale},float:{type:"number",validate:VK},double:{type:"number",validate:VK},password:!0,binary:!0};rE.fastFormats={...rE.fullFormats,date:$n(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,p$),time:$n(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,w$),"date-time":$n(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,nE),"iso-time":$n(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,tE),"iso-date-time":$n(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,oE),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};rE.formatNames=Object.keys(rE.fullFormats);function Xhe(e){return e%4===0&&(e%100!==0||e%400===0)}var Yhe=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Qhe=[0,31,28,31,30,31,30,31,31,30,31,30,31];function eE(e){let t=Yhe.exec(e);if(!t)return!1;let n=+t[1],r=+t[2],o=+t[3];return r>=1&&r<=12&&o>=1&&o<=(r===2&&Xhe(n)?29:Qhe[r])}function p$(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var y$=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function b$(e){return function(n){let r=y$.exec(n);if(!r)return!1;let o=+r[1],i=+r[2],c=+r[3],s=r[4],h=r[5]==="-"?-1:1,l=+(r[6]||0),u=+(r[7]||0);if(l>23||u>59||e&&!s)return!1;if(o<=23&&i<=59&&c<60)return!0;let d=i-u*h,y=o-l*h-(d<0?1:0);return(y===23||y===-1)&&(d===59||d===-1)&&c<61}}function w$(e,t){if(!(e&&t))return;let n=new Date("2020-01-01T"+e).valueOf(),r=new Date("2020-01-01T"+t).valueOf();if(!(n&&r))return;return n-r}function tE(e,t){if(!(e&&t))return;let n=y$.exec(e),r=y$.exec(t);if(!(n&&r))return;if(e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t)return 1;if(e<t)return-1;return 0}var m$=/t|\s/i;function YK(e){let t=b$(e);return function(r){let o=r.split(m$);return o.length===2&&eE(o[0])&&t(o[1])}}function nE(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(!(n&&r))return;return n-r}function oE(e,t){if(!(e&&t))return;let[n,r]=e.split(m$),[o,i]=t.split(m$),c=p$(n,o);if(c===void 0)return;return c||w$(r,i)}var Vhe=/\/|:/,ele=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function tle(e){return Vhe.test(e)&&ele.test(e)}var QK=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function nle(e){return QK.lastIndex=0,QK.test(e)}var ole=-2147483648,rle=2147483647;function ile(e){return Number.isInteger(e)&&e<=rle&&e>=ole}function ale(e){return Number.isInteger(e)}function VK(){return!0}var cle=/[^\\]\\Z/;function sle(e){if(cle.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var sE=G((cE)=>{Object.defineProperty(cE,"__esModule",{value:!0});cE.formatLimitDefinition=void 0;var lle=XK(),gn=ye(),wo=gn.operators,dg={formatMaximum:{okStr:"<=",ok:wo.LTE,fail:wo.GT},formatMinimum:{okStr:">=",ok:wo.GTE,fail:wo.LT},formatExclusiveMaximum:{okStr:"<",ok:wo.LT,fail:wo.GTE},formatExclusiveMinimum:{okStr:">",ok:wo.GT,fail:wo.LTE}},ule={message:({keyword:e,schemaCode:t})=>gn.str`should be ${dg[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>gn._`{comparison: ${dg[e].okStr}, limit: ${t}}`};cE.formatLimitDefinition={keyword:Object.keys(dg),type:"string",schemaType:"string",$data:!0,error:ule,code(e){let{gen:t,data:n,schemaCode:r,keyword:o,it:i}=e,{opts:c,self:s}=i;if(!c.validateFormats)return;let h=new lle.KeywordCxt(i,s.RULES.all.format.definition,"format");if(h.$data)l();else u();function l(){let y=t.scopeValue("formats",{ref:s.formats,code:c.code.formats}),p=t.const("fmt",gn._`${y}[${h.schemaCode}]`);e.fail$data((0,gn.or)(gn._`typeof ${p} != "object"`,gn._`${p} instanceof RegExp`,gn._`typeof ${p}.compare != "function"`,d(p)))}function u(){let y=h.schema,p=s.formats[y];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw Error(`"${o}": format "${y}" does not define "compare" function`);let f=t.scopeValue("formats",{key:y,ref:p,code:c.code.formats?gn._`${c.code.formats}${(0,gn.getProperty)(y)}`:void 0});e.fail$data(d(f))}function d(y){return gn._`${y}.compare(${n}, ${r}) ${dg[o].fail} 0`}},dependencies:["format"]};var gle=(e)=>{return e.addKeyword(cE.formatLimitDefinition),e};cE.default=gle});var gE=G((Rc,uE)=>{Object.defineProperty(Rc,"__esModule",{value:!0});var ki=aE(),yle=sE(),v$=ye(),hE=new v$.Name("fullFormats"),ble=new v$.Name("fastFormats"),S$=(e,t={keywords:!0})=>{if(Array.isArray(t))return lE(e,t,ki.fullFormats,hE),e;let[n,r]=t.mode==="fast"?[ki.fastFormats,ble]:[ki.fullFormats,hE],o=t.formats||ki.formatNames;if(lE(e,o,n,r),t.keywords)(0,yle.default)(e);return e};S$.get=(e,t="full")=>{let r=(t==="fast"?ki.fastFormats:ki.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function lE(e,t,n,r){var o,i;(o=(i=e.opts.code).formats)!==null&&o!==void 0||(i.formats=v$._`require("ajv-formats/dist/formats").${r}`);for(let c of t)e.addFormat(c,n[c])}uE.exports=Rc=S$;Object.defineProperty(Rc,"__esModule",{value:!0});Rc.default=S$});var mle;var dE=g(()=>{mle=Io(gE(),1)});var yE=g(()=>{qo()});var bE=g(()=>{CU();qo();dE();ku();yE()});var wle;var mE=g(()=>{wle=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then((e)=>e.webcrypto)});var it,fle,wE,kle,vle,Sle,Ple,pE,$le,Ile,Lle,K6e,E6e;var P$=g(()=>{fS();it=Wh().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:fk.custom,message:"URL must be parseable",fatal:!0}),da}).refine((e)=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),fle=Ee({resource:v().url(),authorization_servers:B(it).optional(),jwks_uri:v().url().optional(),scopes_supported:B(v()).optional(),bearer_methods_supported:B(v()).optional(),resource_signing_alg_values_supported:B(v()).optional(),resource_name:v().optional(),resource_documentation:v().optional(),resource_policy_uri:v().url().optional(),resource_tos_uri:v().url().optional(),tls_client_certificate_bound_access_tokens:Ie().optional(),authorization_details_types_supported:B(v()).optional(),dpop_signing_alg_values_supported:B(v()).optional(),dpop_bound_access_tokens_required:Ie().optional()}),wE=Ee({issuer:v(),authorization_endpoint:it,token_endpoint:it,registration_endpoint:it.optional(),scopes_supported:B(v()).optional(),response_types_supported:B(v()),response_modes_supported:B(v()).optional(),grant_types_supported:B(v()).optional(),token_endpoint_auth_methods_supported:B(v()).optional(),token_endpoint_auth_signing_alg_values_supported:B(v()).optional(),service_documentation:it.optional(),revocation_endpoint:it.optional(),revocation_endpoint_auth_methods_supported:B(v()).optional(),revocation_endpoint_auth_signing_alg_values_supported:B(v()).optional(),introspection_endpoint:v().optional(),introspection_endpoint_auth_methods_supported:B(v()).optional(),introspection_endpoint_auth_signing_alg_values_supported:B(v()).optional(),code_challenge_methods_supported:B(v()).optional(),client_id_metadata_document_supported:Ie().optional()}),kle=Ee({issuer:v(),authorization_endpoint:it,token_endpoint:it,userinfo_endpoint:it.optional(),jwks_uri:it,registration_endpoint:it.optional(),scopes_supported:B(v()).optional(),response_types_supported:B(v()),response_modes_supported:B(v()).optional(),grant_types_supported:B(v()).optional(),acr_values_supported:B(v()).optional(),subject_types_supported:B(v()),id_token_signing_alg_values_supported:B(v()),id_token_encryption_alg_values_supported:B(v()).optional(),id_token_encryption_enc_values_supported:B(v()).optional(),userinfo_signing_alg_values_supported:B(v()).optional(),userinfo_encryption_alg_values_supported:B(v()).optional(),userinfo_encryption_enc_values_supported:B(v()).optional(),request_object_signing_alg_values_supported:B(v()).optional(),request_object_encryption_alg_values_supported:B(v()).optional(),request_object_encryption_enc_values_supported:B(v()).optional(),token_endpoint_auth_methods_supported:B(v()).optional(),token_endpoint_auth_signing_alg_values_supported:B(v()).optional(),display_values_supported:B(v()).optional(),claim_types_supported:B(v()).optional(),claims_supported:B(v()).optional(),service_documentation:v().optional(),claims_locales_supported:B(v()).optional(),ui_locales_supported:B(v()).optional(),claims_parameter_supported:Ie().optional(),request_parameter_supported:Ie().optional(),request_uri_parameter_supported:Ie().optional(),require_request_uri_registration:Ie().optional(),op_policy_uri:it.optional(),op_tos_uri:it.optional(),client_id_metadata_document_supported:Ie().optional()}),vle=Z({...kle.shape,...wE.pick({code_challenge_methods_supported:!0}).shape}),Sle=Z({access_token:v(),id_token:v().optional(),token_type:v(),expires_in:ec.number().optional(),scope:v().optional(),refresh_token:v().optional()}).strip(),Ple=Z({error:v(),error_description:v().optional(),error_uri:v().optional()}),pE=it.optional().or(V("").transform(()=>{return})),$le=Z({redirect_uris:B(it),token_endpoint_auth_method:v().optional(),grant_types:B(v()).optional(),response_types:B(v()).optional(),client_name:v().optional(),client_uri:it.optional(),logo_uri:pE,scope:v().optional(),contacts:B(v()).optional(),tos_uri:pE,policy_uri:v().optional(),jwks_uri:it.optional(),jwks:ll().optional(),software_id:v().optional(),software_version:v().optional(),software_statement:v().optional()}).strip(),Ile=Z({client_id:v(),client_secret:v().optional(),client_id_issued_at:me().optional(),client_secret_expires_at:me().optional()}).strip(),Lle=$le.merge(Ile),K6e=Z({error:v(),error_description:v().optional()}).strip(),E6e=Z({token:v(),token_type_hint:v().optional()}).strip()});var Be,yg,Uc,Mc,Kc,bg,mg,pg,Ec,wg,fg,kg,vg,Sg,Pg,qc,$g,Ig,Tle;var fE=g(()=>{Be=class Be extends Error{constructor(e,t){super(e);this.errorUri=t,this.name=this.constructor.name}toResponseObject(){let e={error:this.errorCode,error_description:this.message};if(this.errorUri)e.error_uri=this.errorUri;return e}get errorCode(){return this.constructor.errorCode}};yg=class yg extends Be{};yg.errorCode="invalid_request";Uc=class Uc extends Be{};Uc.errorCode="invalid_client";Mc=class Mc extends Be{};Mc.errorCode="invalid_grant";Kc=class Kc extends Be{};Kc.errorCode="unauthorized_client";bg=class bg extends Be{};bg.errorCode="unsupported_grant_type";mg=class mg extends Be{};mg.errorCode="invalid_scope";pg=class pg extends Be{};pg.errorCode="access_denied";Ec=class Ec extends Be{};Ec.errorCode="server_error";wg=class wg extends Be{};wg.errorCode="temporarily_unavailable";fg=class fg extends Be{};fg.errorCode="unsupported_response_type";kg=class kg extends Be{};kg.errorCode="unsupported_token_type";vg=class vg extends Be{};vg.errorCode="invalid_token";Sg=class Sg extends Be{};Sg.errorCode="method_not_allowed";Pg=class Pg extends Be{};Pg.errorCode="too_many_requests";qc=class qc extends Be{};qc.errorCode="invalid_client_metadata";$g=class $g extends Be{};$g.errorCode="insufficient_scope";Ig=class Ig extends Be{};Ig.errorCode="invalid_target";Tle={[yg.errorCode]:yg,[Uc.errorCode]:Uc,[Mc.errorCode]:Mc,[Kc.errorCode]:Kc,[bg.errorCode]:bg,[mg.errorCode]:mg,[pg.errorCode]:pg,[Ec.errorCode]:Ec,[wg.errorCode]:wg,[fg.errorCode]:fg,[kg.errorCode]:kg,[vg.errorCode]:vg,[Sg.errorCode]:Sg,[Pg.errorCode]:Pg,[qc.errorCode]:qc,[$g.errorCode]:$g,[Ig.errorCode]:Ig}});var $$=g(()=>{mE();qo();P$();P$();fE()});var kE=g(()=>{qo();$$()});var vE=g(()=>{qo();$$()});var SE=()=>{};var PE=g(()=>{SE()});var jle,$Me,IMe,Nle,LMe,TMe,OMe,AMe;var $E=g(()=>{bE();kE();vE();PE();be();uu();jle=Io(F4(),1),$Me=a.object({name:a.string().min(1),description:a.string().optional(),inputSchema:a.record(a.string(),a.unknown()).optional(),annotations:a.record(a.string(),a.unknown()).optional()}),IMe=a.object({results:a.array(a.object({id:a.string().min(1),readonly:a.boolean().optional()}))}),Nle=a.object({type:a.string()}).catchall(a.unknown()),LMe=a.object({content:a.array(Nle),structuredContent:a.unknown().optional(),isError:a.boolean().optional()}),TMe=a.object({name:a.string().min(1),version:a.string().min(1)}),OMe=a.object({status:a.number().int().optional(),data:a.object({status:a.number().int().optional()}).passthrough().optional(),cause:a.object({status:a.number().int().optional()}).passthrough().optional()}).passthrough(),AMe=a.object({exp:a.number().int().positive().optional()}).passthrough()});var dn=(e,t)=>e.find((n)=>n.name.trim()===t),IE=(e)=>{let t=dn(e,"Authorization");if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},LE=(e)=>{let t=dn(e,"DD_API_KEY"),n=dn(e,"DD_APPLICATION_KEY");return[t,n].filter((r)=>r!==void 0).map((r)=>({...r,name:r.name.trim(),value:r.value.trim()}))},TE=({headers:e})=>{let t=e.Authorization?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("ApiKey "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},xle=(e)=>{try{let t=new URL(e);if(!t.hostname.startsWith("mcp."))return null;return`${t.protocol}//${t.hostname.replace(/^mcp\./,"api.")}`}catch{return null}},OE=async({headers:e,serverUrl:t})=>{let n=e.DD_API_KEY?.trim(),r=e.DD_APPLICATION_KEY?.trim();if(!n||!r)return{success:!1,errorMessage:"Missing required fields."};let o=xle(t);if(!o)return{success:!0};let i;try{i=await fetch(`${o}/api/v2/validate_keys`,{method:"GET",headers:{"DD-API-KEY":n,"DD-APPLICATION-KEY":r},signal:AbortSignal.timeout(1e4)})}catch{return{success:!1,errorMessage:"Unable to reach the provider's API. Please try again."}}if(!i.ok)return{success:!1,errorMessage:i.status===401||i.status===403?"Invalid inputs. Please check and try again.":"Unable to reach the provider's API. Please try again."};return{success:!0}},AE=(e)=>{let t=dn(e,"Authorization");if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},CE=async({headers:e})=>{let t=e.Authorization?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};let n;try{n=await fetch("https://api.cloudflare.com/client/v4/user/tokens/verify",{method:"GET",headers:{Authorization:t},signal:AbortSignal.timeout(1e4)})}catch{return{success:!1,errorMessage:"Unable to reach the provider's API. Please try again."}}if(!n.ok)return{success:!1,errorMessage:n.status===401||n.status===403?"Invalid inputs. Please check and try again.":"Unable to reach the provider's API. Please try again."};let r;try{r=await n.json()}catch{return{success:!1,errorMessage:"Unable to reach the provider's API. Please try again."}}if(r.success!==!0||r.result?.status!=="active")return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},DE=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},zE=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},_E=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},jE=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},NE=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},xE=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},RE=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},UE=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},ME=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},KE=async({headers:e})=>{let t=e.Authorization?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};let n;try{n=await fetch("https://api.render.com/v1/owners",{method:"GET",headers:{Authorization:t,Accept:"application/json"},signal:AbortSignal.timeout(1e4)})}catch{return{success:!1,errorMessage:"Unable to reach the provider's API. Please try again."}}if(!n.ok)return{success:!1,errorMessage:n.status===401||n.status===403?"Invalid inputs. Please check and try again.":"Unable to reach the provider's API. Please try again."};return{success:!0}},EE=(e)=>{let t=dn(e,"SIGNOZ-API-KEY"),n=dn(e,"X-SigNoz-URL");return[t,n].filter((r)=>r!==void 0).map((r)=>({...r,name:r.name.trim(),value:r.value.trim()}))},qE=({headers:e})=>{if(!e["SIGNOZ-API-KEY"]?.trim())return{success:!1,errorMessage:"Missing required fields."};return{success:!0}},GE=(e)=>{let t=dn(e,"x-api-key");if(!t)return e;return[{id:t.id,name:"x-api-key",value:t.value.trim()}]},JE=({headers:e})=>{if(!e["x-api-key"]?.trim())return{success:!1,errorMessage:"Missing required fields."};return{success:!0}},HE=(e)=>{let t=dn(e,"x-consumer-api-key");if(!t)return e;return[{id:t.id,name:"x-consumer-api-key",value:t.value.trim()}]},BE=({headers:e})=>{if(!e["x-consumer-api-key"]?.trim())return{success:!1,errorMessage:"Missing required fields."};return{success:!0}},WE=(e)=>{let t=dn(e,"X-API-Key");if(!t)return e;return[{id:t.id,name:"X-API-Key",value:t.value.trim()}]},ZE=({headers:e})=>{if(!e["X-API-Key"]?.trim())return{success:!1,errorMessage:"Missing required fields."};return{success:!0}},FE=(e)=>{let t=dn(e,"x-context-dev-api-key");if(!t)return e;return[{id:t.id,name:"x-context-dev-api-key",value:t.value.trim()}]},XE=({headers:e})=>{if(!e["x-context-dev-api-key"]?.trim())return{success:!1,errorMessage:"Missing required fields."};return{success:!0}},YE=(e)=>{let t=dn(e,"Authorization");if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},QE=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},VE=({headers:e})=>{let t=e.Authorization?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},eq=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Basic "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},tq=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},nq=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},oq=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},rq=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},iq=(e)=>{let t=e.find((n)=>n.name.trim().toLowerCase()==="Authorization".toLowerCase());if(!t)return e;return[{id:t.id,name:"Authorization",value:t.value.trim()}]},aq=({headers:e})=>{let t=Object.entries(e).find(([n])=>n.trim().toLowerCase()==="Authorization".toLowerCase())?.[1]?.trim();if(!t)return{success:!1,errorMessage:"Missing required fields."};if(!t.startsWith("Bearer "))return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!0}},cq=async({headers:e,serverUrl:t})=>{let n=new URL(t);n.pathname="/user/v1/projects/",n.search="",n.hash="";let r;try{r=await fetch(n,{method:"GET",headers:e,signal:AbortSignal.timeout(1e4)})}catch{return{success:!1,errorMessage:"Unable to reach the provider's API. Please try again."}}if(r.ok)return{success:!0};if(r.status===401||r.status===403)return{success:!1,errorMessage:"Invalid inputs. Please check and try again."};return{success:!1,errorMessage:"Unable to reach the provider's API. Please try again."}};var zMe,_Me,jMe,NMe,xMe,RMe,UMe,MMe,KMe,EMe,qMe,GMe,JMe,HMe,BMe,WMe,ZMe,FMe,XMe,YMe,QMe,VMe,eKe,tKe,nKe,oKe,rKe,iKe,aKe,cKe,sKe,hKe,lKe,uKe,gKe,dKe,yKe,bKe,mKe,pKe,wKe,fKe,kKe,vKe,SKe,PKe,$Ke,IKe,LKe,TKe,OKe,AKe,CKe,DKe,zKe,_Ke,jKe,NKe;var sq=g(()=>{zMe=`
7482
7482
  ## Overview
7483
7483
 
7484
7484
  Connect Atlassian to Sazabi agents to search and manage Jira, Confluence, Jira Service Management, Compass, and Bitbucket from your workflow.
@@ -7498,7 +7498,7 @@ Atlassian hosts a remote MCP server (Atlassian Rovo) at \`https://mcp.atlassian.
7498
7498
 
7499
7499
  - An Atlassian Cloud site with Rovo/MCP access enabled
7500
7500
  - Permission to authorize third-party OAuth applications for your Atlassian org
7501
- `.trim(),OMe=`
7501
+ `.trim(),_Me=`
7502
7502
  ## Overview
7503
7503
 
7504
7504
  Connect Attio to Sazabi agents to search and manage your CRM records, workspace data, and relationship intelligence without leaving your workflow.
@@ -7518,7 +7518,7 @@ Attio's MCP server authenticates via OAuth using Attio's OpenID Connect flow wit
7518
7518
 
7519
7519
  - An active Attio workspace
7520
7520
  - Permission to authorize third-party OAuth applications in Attio
7521
- `.trim(),AMe=`
7521
+ `.trim(),jMe=`
7522
7522
  ## Overview
7523
7523
 
7524
7524
  Connect Autumn to Sazabi agents to inspect and manage your billing and pricing — customers, plans, features, balances, usage, and subscriptions — from agent conversations. Autumn is a pricing and billing layer built on top of Stripe.
@@ -7538,7 +7538,7 @@ Autumn hosts an MCP server at \`https://mcp.useautumn.com/mcp\` that authenticat
7538
7538
 
7539
7539
  - An Autumn account with a secret key (\`am_sk_...\`) from the [Autumn dashboard](https://app.useautumn.com) under **Developer > API Keys**
7540
7540
  - Use a sandbox key to explore or a production key for live billing data
7541
- `.trim(),CMe=`
7541
+ `.trim(),NMe=`
7542
7542
  ## Overview
7543
7543
 
7544
7544
  Connect the AWS-managed AWS MCP server (AWS Agent Toolkit) to Sazabi agents to search AWS documentation and run AWS API operations using your own IAM credentials.
@@ -7562,7 +7562,7 @@ The AWS MCP server is a remote endpoint that authenticates with AWS SigV4, not a
7562
7562
  ## Availability
7563
7563
 
7564
7564
  The SigV4 signing foundation is in place, so a connection configured with AWS credentials works end to end. The dashboard connect form for submitting IAM credentials is not shipped yet, so this connector is listed but not yet self-serve connectable from settings.
7565
- `.trim(),DMe=`
7565
+ `.trim(),xMe=`
7566
7566
  ## Overview
7567
7567
 
7568
7568
  Connect Cloudflare to Sazabi agents to investigate Workers observability logs and analytics, inspect bindings, review builds, and surface Radar insights directly from agent conversations.
@@ -7582,7 +7582,7 @@ Cloudflare's hosted MCP servers authenticate via OAuth with dynamic client regis
7582
7582
 
7583
7583
  - An active Cloudflare account
7584
7584
  - Permission to authorize third-party OAuth applications for your Cloudflare account
7585
- `.trim(),zMe=`
7585
+ `.trim(),RMe=`
7586
7586
  ## Overview
7587
7587
 
7588
7588
  Connect Cloudflare to Sazabi agents using a Cloudflare API token instead of OAuth. This connects to the same hosted Cloudflare API MCP server (Workers, DNS, zones, and more) but authenticates with an API token you mint yourself.
@@ -7602,7 +7602,7 @@ Cloudflare's hosted MCP server accepts a Cloudflare API token as a Bearer creden
7602
7602
 
7603
7603
  - An active Cloudflare account
7604
7604
  - A Cloudflare API token scoped to the products you want the agent to access (tokens with Client IP Address Filtering enabled are not supported)
7605
- `.trim(),_Me=`
7605
+ `.trim(),UMe=`
7606
7606
  ## Overview
7607
7607
 
7608
7608
  Connect Calendly to Sazabi agents to check availability, create scheduling links, and manage meetings directly from agent conversations.
@@ -7622,7 +7622,7 @@ Calendly's MCP server authenticates via OAuth with dynamic client registration.
7622
7622
 
7623
7623
  - A Calendly account (Free, Standard, Teams, or Enterprise)
7624
7624
  - Permission to authorize third-party OAuth applications
7625
- `.trim(),jMe=`
7625
+ `.trim(),MMe=`
7626
7626
  ## Overview
7627
7627
 
7628
7628
  Connect Clay to Sazabi agents to search contacts, interactions, and workspace workflows for enriched prospecting and relationship data.
@@ -7642,7 +7642,7 @@ Clay's MCP server authenticates via OAuth with dynamic client registration. Once
7642
7642
 
7643
7643
  - An active Clay workspace
7644
7644
  - Permission to authorize third-party OAuth applications in Clay
7645
- `.trim(),NMe=`
7645
+ `.trim(),KMe=`
7646
7646
  ## Overview
7647
7647
 
7648
7648
  Connect Datadog to Sazabi agents to query metrics, logs, traces, and incident data using your Datadog site URL, API key, and Application Key.
@@ -7664,7 +7664,7 @@ Datadog's hosted MCP server accepts API and Application Key authentication via H
7664
7664
  - Your Datadog site URL from the top of your browser, such as \`https://app.datadoghq.com\` or \`https://us3.datadoghq.com\`
7665
7665
  - A Datadog API key created in **Organization Settings > Access > API Keys**
7666
7666
  - A Datadog Application Key created in **Organization Settings > Access > Application Keys** with no scopes, which defaults to the owner's scopes, or with full scopes
7667
- `.trim(),xMe=`
7667
+ `.trim(),EMe=`
7668
7668
  ## Overview
7669
7669
 
7670
7670
  Connect Checkly to Sazabi agents to query synthetic monitoring data, including checks, check results, test sessions, root cause analyses, status pages, and incidents during investigations.
@@ -7683,7 +7683,7 @@ Checkly ships an official hosted MCP server at \`https://api.checklyhq.com/mcp\`
7683
7683
 
7684
7684
  - A Checkly account
7685
7685
  - A Checkly-approved OAuth client for Sazabi (pending; Checkly does not support Dynamic Client Registration)
7686
- `.trim(),RMe="\n## Overview\n\nConnect Google Cloud (GCP) to Sazabi agents to query Cloud Logging, Cloud Monitoring, BigQuery, and other Google Cloud products using your own Google IAM-scoped credentials.\n\n## How it works\n\nGoogle ships first-party remote MCP servers per product over streamable HTTP at `https://SERVICE.googleapis.com/mcp`. Sazabi defaults to Cloud Logging (`https://logging.googleapis.com/mcp`); you can point the server URL at other endpoints such as `https://monitoring.googleapis.com/mcp` or `https://bigquery.googleapis.com/mcp`. These servers authenticate with a Google OAuth 2.0 Bearer access token: you supply a short-lived access token (for example from `gcloud auth application-default print-access-token`), and Sazabi sends it in the `Authorization` header. Access is scoped by Google IAM. The per-connection read-only toggle governs write tools — note it defaults to off, so write tools are callable until you turn it on.\n\n## Features\n\n- Query Cloud Logging for logs and log-based signals\n- Read Cloud Monitoring metrics and time series\n- Run BigQuery queries and inspect datasets\n- Point at other supported per-product Google Cloud MCP endpoints\n\n## Requirements\n\n- A Google Cloud project with the target product APIs enabled\n- A Google OAuth 2.0 access token scoped by IAM to the resources Sazabi should read (tokens are short-lived and must be refreshed on expiry)\n".trim(),UMe=`
7686
+ `.trim(),qMe="\n## Overview\n\nConnect Google Cloud (GCP) to Sazabi agents to query Cloud Logging, Cloud Monitoring, BigQuery, and other Google Cloud products using your own Google IAM-scoped credentials.\n\n## How it works\n\nGoogle ships first-party remote MCP servers per product over streamable HTTP at `https://SERVICE.googleapis.com/mcp`. Sazabi defaults to Cloud Logging (`https://logging.googleapis.com/mcp`); you can point the server URL at other endpoints such as `https://monitoring.googleapis.com/mcp` or `https://bigquery.googleapis.com/mcp`. These servers authenticate with a Google OAuth 2.0 Bearer access token: you supply a short-lived access token (for example from `gcloud auth application-default print-access-token`), and Sazabi sends it in the `Authorization` header. Access is scoped by Google IAM. The per-connection read-only toggle governs write tools — note it defaults to off, so write tools are callable until you turn it on.\n\n## Features\n\n- Query Cloud Logging for logs and log-based signals\n- Read Cloud Monitoring metrics and time series\n- Run BigQuery queries and inspect datasets\n- Point at other supported per-product Google Cloud MCP endpoints\n\n## Requirements\n\n- A Google Cloud project with the target product APIs enabled\n- A Google OAuth 2.0 access token scoped by IAM to the resources Sazabi should read (tokens are short-lived and must be refreshed on expiry)\n".trim(),GMe=`
7687
7687
  ## Overview
7688
7688
 
7689
7689
  Connect Google Drive to Sazabi agents to search and read files and metadata in a Google Drive through Google's hosted MCP server.
@@ -7702,7 +7702,7 @@ Google hosts an official Google Drive MCP server at \`https://drivemcp.googleapi
7702
7702
 
7703
7703
  - A Google Cloud project with the Google Drive API and Google Drive MCP API (\`drivemcp.googleapis.com\`) enabled
7704
7704
  - An OAuth client (Client ID / Client Secret) configured with the Sazabi callback URL and Drive scopes, provisioned in your Sazabi deployment configuration
7705
- `.trim(),MMe=`
7705
+ `.trim(),JMe=`
7706
7706
  ## Overview
7707
7707
 
7708
7708
  Connect Grafana Cloud to Sazabi agents to browse dashboards, query metrics, logs, and traces, and review alerts and incidents during investigations.
@@ -7723,7 +7723,7 @@ Grafana's Cloud MCP server authenticates via OAuth 2.1 with dynamic client regis
7723
7723
  - An active Grafana Cloud stack
7724
7724
  - Permission to authorize third-party OAuth applications in Grafana Cloud
7725
7725
  - A role granting the \`grafana-assistant-app.cloud-mcp:access\` action
7726
- `.trim(),KMe=`
7726
+ `.trim(),HMe=`
7727
7727
  ## Overview
7728
7728
 
7729
7729
  Connect Granola to Sazabi agents to search and browse your AI-powered meeting notes, transcripts, and folders.
@@ -7742,7 +7742,7 @@ Granola's MCP server authenticates via OAuth with dynamic client registration. O
7742
7742
  ## Requirements
7743
7743
 
7744
7744
  - An active Granola account with meeting notes
7745
- `.trim(),EMe=`
7745
+ `.trim(),BMe=`
7746
7746
  ## Overview
7747
7747
 
7748
7748
  Connect Happenstance to Sazabi agents to search your professional network and find warm paths to the people you want to reach.
@@ -7760,7 +7760,7 @@ Happenstance's MCP server authenticates via OAuth with dynamic client registrati
7760
7760
  ## Requirements
7761
7761
 
7762
7762
  - An active Happenstance account with a connected network
7763
- `.trim(),qMe=`
7763
+ `.trim(),WMe=`
7764
7764
  ## Overview
7765
7765
 
7766
7766
  Connect Honeycomb to Sazabi agents to query observability data, including environments, datasets, columns, boards, triggers, and SLOs, directly from agent conversations.
@@ -7781,7 +7781,7 @@ Honeycomb's MCP server authenticates via OAuth with dynamic client registration.
7781
7781
  - An active Honeycomb account
7782
7782
  - A user with Read access under Model Context Protocol; the \`mcp:write\` scope is required for write tools
7783
7783
  - EU teams select the **Europe (EU)** region when connecting
7784
- `.trim(),GMe=`
7784
+ `.trim(),ZMe=`
7785
7785
  ## Overview
7786
7786
 
7787
7787
  Connect incident.io to Sazabi agents to browse incidents, alerts, and on-call schedules directly from agent conversations.
@@ -7802,7 +7802,7 @@ incident.io's MCP server authenticates via OAuth with dynamic client registratio
7802
7802
  - An active incident.io account
7803
7803
  - Responder or higher role in your incident.io organization
7804
7804
  - An incident.io admin to open the bottom-left gear menu, choose **MCP Server**, and add \`app.sazabi.com\` to your allowed redirect domains, otherwise authorization fails with a 404
7805
- `.trim(),JMe=`
7805
+ `.trim(),FMe=`
7806
7806
  ## Overview
7807
7807
 
7808
7808
  Connect Linear to Sazabi agents to browse and manage issues, projects, and roadmaps directly from agent conversations.
@@ -7822,7 +7822,7 @@ Linear's MCP server authenticates via OAuth with dynamic client registration. On
7822
7822
 
7823
7823
  - An active Linear workspace
7824
7824
  - Member or higher role with access to the relevant teams
7825
- `.trim(),HMe=`
7825
+ `.trim(),XMe=`
7826
7826
  ## Overview
7827
7827
 
7828
7828
  Connect Mercury to Sazabi agents to search banking context such as accounts, cards, recipients, transactions, treasury records, and organization data.
@@ -7842,7 +7842,7 @@ Mercury's hosted MCP server authenticates via OAuth with dynamic client registra
7842
7842
 
7843
7843
  - An active Mercury account with access to the desired organization
7844
7844
  - Permission to authorize third-party OAuth applications in Mercury
7845
- `.trim(),BMe=`
7845
+ `.trim(),YMe=`
7846
7846
  ## Overview
7847
7847
 
7848
7848
  Connect Plain to Sazabi agents to search and manage support threads, customers, and tenants from your Plain workspace.
@@ -7862,7 +7862,7 @@ Plain's MCP server authenticates via OAuth with dynamic client registration. Onc
7862
7862
 
7863
7863
  - An active Plain workspace
7864
7864
  - Permission to authorize third-party OAuth applications in Plain
7865
- `.trim(),WMe=`
7865
+ `.trim(),QMe=`
7866
7866
  ## Overview
7867
7867
 
7868
7868
  Connect PostHog to Sazabi agents to query analytics data, feature flags, and experiment results from your PostHog organization.
@@ -7882,7 +7882,7 @@ PostHog's MCP server authenticates via OAuth with dynamic client registration. O
7882
7882
 
7883
7883
  - A PostHog account
7884
7884
  - Permission to authorize third-party OAuth applications in PostHog
7885
- `.trim(),ZMe=`
7885
+ `.trim(),VMe=`
7886
7886
  ## Overview
7887
7887
 
7888
7888
  Connect Pylon to Sazabi agents to search and manage support issues, customer accounts, and contacts from agent conversations.
@@ -7902,7 +7902,7 @@ Pylon's MCP server authenticates via OAuth with dynamic client registration. Onc
7902
7902
 
7903
7903
  - An active Pylon account
7904
7904
  - Permission to authorize third-party OAuth applications in your Pylon workspace
7905
- `.trim(),FMe=`
7905
+ `.trim(),eKe=`
7906
7906
  ## Overview
7907
7907
 
7908
7908
  Connect Sentry to Sazabi agents to browse error events, issues, and project data across your Sentry organizations.
@@ -7922,7 +7922,7 @@ Sentry's MCP server authenticates via OAuth with dynamic client registration. On
7922
7922
 
7923
7923
  - An active Sentry account (Cloud or self-hosted)
7924
7924
  - Member or higher role in the Sentry organization
7925
- `.trim(),XMe=`
7925
+ `.trim(),tKe=`
7926
7926
  ## Overview
7927
7927
 
7928
7928
  Connect SigNoz to Sazabi agents to query your metrics, logs, traces, alerts, and dashboards while investigating production issues.
@@ -7942,7 +7942,7 @@ SigNoz's MCP server authenticates with a SigNoz API key. Sazabi stores your key
7942
7942
 
7943
7943
  - A SigNoz account (Cloud or self-hosted)
7944
7944
  - A SigNoz API key (admin-level for alert, dashboard, and notification-channel tools)
7945
- `.trim(),YMe=`
7945
+ `.trim(),nKe=`
7946
7946
  ## Overview
7947
7947
 
7948
7948
  Connect Slack to Sazabi agents to search messages and retrieve files from your Slack workspace.
@@ -7961,7 +7961,7 @@ Slack's MCP server authenticates via OAuth using Slack's user-scoped authorizati
7961
7961
 
7962
7962
  - A Slack workspace where you have member access
7963
7963
  - Permission to install OAuth apps (or admin approval for managed workspaces)
7964
- `.trim(),QMe=`
7964
+ `.trim(),oKe=`
7965
7965
  ## Overview
7966
7966
 
7967
7967
  Connect Supabase to Sazabi agents to manage organizations, projects, databases, and run SQL queries from agent conversations.
@@ -7982,7 +7982,7 @@ Supabase's MCP server authenticates via OAuth with dynamic client registration.
7982
7982
 
7983
7983
  - A Supabase account (Free or paid plan)
7984
7984
  - Owner or admin role on the Supabase organization
7985
- `.trim(),VMe=`
7985
+ `.trim(),rKe=`
7986
7986
  ## Overview
7987
7987
 
7988
7988
  Connect Superhuman to Sazabi agents to search, draft, send, and triage emails from your Superhuman Mail inbox.
@@ -8002,7 +8002,7 @@ Superhuman's MCP server authenticates via OAuth with dynamic client registration
8002
8002
 
8003
8003
  - An active Superhuman Mail account
8004
8004
  - Permission to authorize third-party OAuth applications
8005
- `.trim(),eKe=`
8005
+ `.trim(),iKe=`
8006
8006
  ## Overview
8007
8007
 
8008
8008
  Connect Cekura to Sazabi agents to test, monitor, and evaluate AI agent workflows directly from agent conversations.
@@ -8023,7 +8023,7 @@ Cekura's MCP server accepts API key authentication via HTTP headers. Sazabi stor
8023
8023
 
8024
8024
  - A Cekura account
8025
8025
  - A Cekura API key
8026
- `.trim(),tKe=`
8026
+ `.trim(),aKe=`
8027
8027
  ## Overview
8028
8028
 
8029
8029
  Connect Braintrust to Sazabi agents to query your Braintrust experiments, datasets, prompts, and logs directly from agent conversations.
@@ -8042,7 +8042,7 @@ Braintrust hosts an MCP server at \`https://api.braintrust.dev/mcp\` over Stream
8042
8042
 
8043
8043
  - A Braintrust account
8044
8044
  - A Braintrust API key (Settings > API keys)
8045
- `.trim(),nKe=`
8045
+ `.trim(),cKe=`
8046
8046
  ## Overview
8047
8047
 
8048
8048
  Connect Exa to Sazabi agents to search the web, research companies, crawl pages, and run deep research directly from agent conversations.
@@ -8063,7 +8063,7 @@ Exa hosts an MCP server at \`https://mcp.exa.ai/mcp\` that authenticates via API
8063
8063
 
8064
8064
  - An Exa account
8065
8065
  - An Exa API key from the [Exa dashboard](https://dashboard.exa.ai/api-keys)
8066
- `.trim(),oKe=`
8066
+ `.trim(),sKe=`
8067
8067
  ## Overview
8068
8068
 
8069
8069
  Connect RentAHuman to Sazabi agents to hire and coordinate real human workers for tasks requiring human judgment or real-world action.
@@ -8083,7 +8083,7 @@ RentAHuman hosts an MCP server at \`https://rentahuman.ai/api/mcp\` that authent
8083
8083
 
8084
8084
  - A RentAHuman account
8085
8085
  - An API key from the [RentAHuman API keys page](https://rentahuman.ai/account/api-keys)
8086
- `.trim(),rKe=`
8086
+ `.trim(),hKe=`
8087
8087
  ## Overview
8088
8088
 
8089
8089
  Connect Context.dev to Sazabi agents to resolve brand data, scrape and crawl websites into LLM-ready Markdown, extract structured data, and manage website-change monitors directly from agent conversations.
@@ -8103,7 +8103,7 @@ Context.dev hosts an MCP server at \`https://context-dev.stlmcp.com\` that authe
8103
8103
 
8104
8104
  - A Context.dev account
8105
8105
  - A Context.dev API key (\`ctxt_secret_...\`) from the [Context.dev dashboard](https://context.dev)
8106
- `.trim(),iKe=`
8106
+ `.trim(),lKe=`
8107
8107
  ## Overview
8108
8108
 
8109
8109
  Connect Elastic Cloud to Sazabi agents to search Elasticsearch indices and query Agent Builder tools directly from agent conversations using your Kibana-hosted MCP endpoint.
@@ -8129,7 +8129,7 @@ Elastic Cloud exposes a built-in MCP server from your Kibana instance at \`/api/
8129
8129
  - Kibana application: \`feature_agentBuilder.read\` and \`feature_actions.read\` on \`kibana-.kibana\`
8130
8130
  - Cluster: \`monitor_inference\`
8131
8131
  - Index: \`read\` and \`view_index_metadata\` on the indices you want agents to access
8132
- `.trim(),aKe=`
8132
+ `.trim(),uKe=`
8133
8133
  ## Overview
8134
8134
 
8135
8135
  Connect Intercom to Sazabi agents to read support conversations, contacts, and help center content directly from agent conversations.
@@ -8149,7 +8149,7 @@ Intercom ships an official hosted MCP server at \`https://mcp.intercom.com/mcp\`
8149
8149
 
8150
8150
  - A US-hosted Intercom workspace (Intercom's hosted MCP currently supports US-hosted workspaces only)
8151
8151
  - An Intercom app with an API access token
8152
- `.trim(),cKe=`
8152
+ `.trim(),gKe=`
8153
8153
  ## Overview
8154
8154
 
8155
8155
  Connect Neon to Sazabi agents to manage serverless Postgres databases, branches, and run SQL queries directly from agent conversations.
@@ -8170,7 +8170,7 @@ Neon's MCP server authenticates via OAuth with dynamic client registration. Once
8170
8170
 
8171
8171
  - A Neon account (Free or paid plan)
8172
8172
  - Permission to authorize third-party OAuth applications
8173
- `.trim(),sKe=`
8173
+ `.trim(),dKe=`
8174
8174
  ## Overview
8175
8175
 
8176
8176
  Connect Pydantic Logfire to Sazabi agents to query OpenTelemetry traces and metrics, surface recent exceptions, and browse projects, alerts, dashboards, and schedules.
@@ -8191,7 +8191,7 @@ Logfire's MCP server authenticates via OAuth with dynamic client registration. O
8191
8191
 
8192
8192
  - A Pydantic Logfire account in the US region (\`logfire-us.pydantic.dev\`)
8193
8193
  - Permission to authorize third-party OAuth applications in your Logfire organization
8194
- `.trim(),hKe=`
8194
+ `.trim(),yKe=`
8195
8195
  ## Overview
8196
8196
 
8197
8197
  Connect Axiom to Sazabi agents to query your observability datasets and logs using APL, Axiom's powerful query language, directly from agent conversations.
@@ -8212,7 +8212,7 @@ Axiom's MCP server authenticates via OAuth with dynamic client registration. Onc
8212
8212
 
8213
8213
  - An Axiom account (Free, Pro, Team, or Enterprise plan)
8214
8214
  - Permission to authorize third-party OAuth applications
8215
- `.trim(),lKe=`
8215
+ `.trim(),bKe=`
8216
8216
  ## Overview
8217
8217
 
8218
8218
  Connect LangSmith to Sazabi agents to query your LLM tracing projects, runs, datasets, and evaluations directly from agent conversations.
@@ -8232,7 +8232,7 @@ LangSmith's hosted Remote MCP server authenticates via OAuth 2.1 with dynamic cl
8232
8232
 
8233
8233
  - A LangSmith account
8234
8234
  - Permission to authorize third-party OAuth applications in your LangSmith organization
8235
- `.trim(),uKe=`
8235
+ `.trim(),mKe=`
8236
8236
  ## Overview
8237
8237
 
8238
8238
  Connect PlanetScale to Sazabi agents to query databases, inspect schema, and explore Insights data directly from agent conversations.
@@ -8253,7 +8253,7 @@ PlanetScale's MCP server authenticates via OAuth with dynamic client registratio
8253
8253
 
8254
8254
  - A PlanetScale account (Hobby or paid plan)
8255
8255
  - Permission to authorize third-party OAuth applications in your PlanetScale organization
8256
- `.trim(),gKe=`
8256
+ `.trim(),pKe=`
8257
8257
  ## Overview
8258
8258
 
8259
8259
  Connect Airbyte to give Sazabi agents authenticated access to the third-party platforms you use every day, such as CRM, support desk, analytics, billing, and more, so agents can read and write records on your behalf from agent conversations.
@@ -8274,7 +8274,7 @@ Airbyte hosts and manages the Agent Engine MCP server, so there is nothing to in
8274
8274
  - An Airbyte account (sign up at app.airbyte.ai)
8275
8275
  - At least one agent connector configured in Airbyte
8276
8276
  - Permission to authorize third-party OAuth applications
8277
- `.trim(),dKe=`
8277
+ `.trim(),wKe=`
8278
8278
  ## Overview
8279
8279
 
8280
8280
  Connect Better Stack to Sazabi agents to investigate incidents, monitors, and log sources, and build telemetry queries directly from agent conversations.
@@ -8294,7 +8294,7 @@ Better Stack's hosted MCP server authenticates via OAuth with dynamic client reg
8294
8294
 
8295
8295
  - An active Better Stack account
8296
8296
  - Permission to authorize third-party OAuth applications in your Better Stack organization
8297
- `.trim(),yKe=`
8297
+ `.trim(),fKe=`
8298
8298
  ## Overview
8299
8299
 
8300
8300
  Connect Paper to Sazabi agents to read and write your design files, inspect node trees, and manipulate design-system elements without leaving your workflow.
@@ -8315,7 +8315,7 @@ The Paper MCP server runs locally from the Paper Desktop app. Opening a file in
8315
8315
  - The Paper Desktop app installed and running
8316
8316
  - A design file open in the Paper Desktop app
8317
8317
  - The MCP server endpoint accessible at \`http://127.0.0.1:29979/mcp\`
8318
- `.trim(),bKe=`
8318
+ `.trim(),kKe=`
8319
8319
  ## Overview
8320
8320
 
8321
8321
  Connect Stripe to Sazabi agents to query and manage payments, customers, subscriptions, invoices, and billing directly from agent conversations.
@@ -8335,7 +8335,7 @@ Stripe's remote MCP server (\`https://mcp.stripe.com\`) authenticates via OAuth
8335
8335
 
8336
8336
  - An active Stripe account
8337
8337
  - Permission to authorize third-party OAuth applications for your Stripe account
8338
- `.trim(),mKe=`
8338
+ `.trim(),vKe=`
8339
8339
  ## Overview
8340
8340
 
8341
8341
  Connect X (formerly Twitter) to Sazabi agents to search posts and access real-time X data directly from agent conversations.
@@ -8354,7 +8354,7 @@ X hosts an MCP server at \`https://api.x.com/mcp\` over Streamable HTTP. It does
8354
8354
 
8355
8355
  - An X Developer account with API access
8356
8356
  - An X app with an OAuth 2.0 access token
8357
- `.trim(),pKe=`
8357
+ `.trim(),SKe=`
8358
8358
  ## Overview
8359
8359
 
8360
8360
  Connect Circleback to Sazabi agents to search and read your meeting notes, transcripts, action items, and calendar/email context.
@@ -8374,7 +8374,7 @@ Circleback hosts an authenticated remote MCP server at \`https://circleback.ai/a
8374
8374
 
8375
8375
  - A Circleback account on a paid plan
8376
8376
  - Permission to authorize third-party OAuth applications in Circleback
8377
- `.trim(),wKe=`
8377
+ `.trim(),PKe=`
8378
8378
  ## Overview
8379
8379
 
8380
8380
  Connect Clerk's hosted MCP server to Sazabi agents to search Clerk's public documentation and SDK implementation snippets directly from agent conversations.
@@ -8392,7 +8392,7 @@ Clerk's official MCP server (\`https://mcp.clerk.com/mcp\`) is a read-only Strea
8392
8392
  ## Requirements
8393
8393
 
8394
8394
  - None. The Clerk MCP server is public and requires no authentication
8395
- `.trim(),fKe=`
8395
+ `.trim(),$Ke=`
8396
8396
  ## Overview
8397
8397
 
8398
8398
  Connect DeepWiki's hosted MCP server to Sazabi agents to search public GitHub repository documentation and ask questions about open-source code directly from agent conversations.
@@ -8410,7 +8410,7 @@ DeepWiki's official MCP server (\`https://mcp.deepwiki.com/mcp\`) is a read-only
8410
8410
  ## Requirements
8411
8411
 
8412
8412
  - None. The DeepWiki MCP server is public and requires no authentication
8413
- `.trim(),kKe=`
8413
+ `.trim(),IKe=`
8414
8414
  ## Overview
8415
8415
 
8416
8416
  Connect Railway to Sazabi agents to inspect and manage your Railway infrastructure — projects, services, deployments, environment variables, and logs — directly from agent conversations.
@@ -8430,7 +8430,7 @@ Railway's hosted MCP server authenticates via OAuth with dynamic client registra
8430
8430
 
8431
8431
  - An active Railway account
8432
8432
  - Membership in the Railway workspace you want to connect
8433
- `.trim(),vKe=`
8433
+ `.trim(),LKe=`
8434
8434
  ## Overview
8435
8435
 
8436
8436
  Connect Vercel to Sazabi agents to inspect and manage your Vercel projects and deployments and access Vercel platform documentation, directly from agent conversations.
@@ -8449,7 +8449,7 @@ Vercel hosts a remote MCP server at \`https://mcp.vercel.com\` over Streamable H
8449
8449
 
8450
8450
  - An active Vercel account
8451
8451
  - Access to the Vercel teams and projects you want to connect
8452
- `.trim(),SKe=`
8452
+ `.trim(),TKe=`
8453
8453
  ## Overview
8454
8454
 
8455
8455
  Connect Salesforce to Sazabi agents to query Salesforce data and metadata and run Apex invocable actions and Flows exposed by a hosted MCP server, directly from agent conversations.
@@ -8469,7 +8469,7 @@ Salesforce hosted MCP servers run on Salesforce infrastructure and authenticate
8469
8469
  - A Salesforce org with hosted MCP servers enabled
8470
8470
  - An admin-registered External Client App with the \`mcp_api\` and \`refresh_token\` scopes and PKCE enabled
8471
8471
  - Deployment configuration supplying the ECA Client ID and Client Secret
8472
- `.trim(),PKe=`
8472
+ `.trim(),OKe=`
8473
8473
  ## Overview
8474
8474
 
8475
8475
  Connect Langfuse to Sazabi agents to inspect LLM traces, observations, metrics, scores, comments, and prompts directly from agent conversations.
@@ -8490,7 +8490,7 @@ Langfuse hosts an MCP server over Streamable HTTP at \`/api/public/mcp\`, region
8490
8490
 
8491
8491
  - A Langfuse Cloud account (or self-hosted deployment via the custom connector)
8492
8492
  - A Langfuse project API key pair (Public \`pk-lf-...\` and Secret \`sk-lf-...\`) from **Project settings → API keys**
8493
- `.trim(),$Ke=`
8493
+ `.trim(),AKe=`
8494
8494
  ## Overview
8495
8495
 
8496
8496
  Connect Render to Sazabi agents to inspect and manage your Render infrastructure — services, deploys, environment variables, logs, and metrics — directly from agent conversations.
@@ -8511,7 +8511,7 @@ Render hosts an MCP server at \`https://mcp.render.com/mcp\` over Streamable HTT
8511
8511
 
8512
8512
  - A Render account
8513
8513
  - A Render API key from **Account Settings > API Keys** in the [Render dashboard](https://dashboard.render.com/settings/api-keys)
8514
- `.trim(),IKe=`
8514
+ `.trim(),CKe=`
8515
8515
  ## Overview
8516
8516
 
8517
8517
  Connect Resend to Sazabi agents to send transactional and broadcast emails and manage domains, contacts, and audiences directly from agent conversations.
@@ -8532,7 +8532,7 @@ Resend hosts an MCP server at \`https://mcp.resend.com/mcp\` over Streamable HTT
8532
8532
  - A Resend account
8533
8533
  - A Resend API key (\`re_...\`) from the [Resend dashboard](https://resend.com/api-keys)
8534
8534
  - A verified sending domain
8535
- `.trim(),LKe="\n## Overview\n\nConnect Respan to Sazabi agents to query LLM request logs, execution traces, prompts, and customer data from your Respan account (the LLM observability platform formerly known as Keywords AI).\n\n## How it works\n\nRespan hosts an MCP server at `https://mcp.respan.ai/api/mcp` over Streamable HTTP. Sazabi stores your Respan API key securely and sends it as the `Authorization: Bearer` token to Respan's MCP endpoint. Once connected, agents can list and inspect LLM request logs, walk trace span trees, read prompt templates and versions, and look up customer budget usage. Write tools (such as creating a log) are enabled — mutations are governed by the per-connection read-only toggle.\n\n## Features\n\n- Query and filter LLM request logs (`list_logs`, `get_log_detail`, `create_log`)\n- Inspect execution traces and span trees (`list_traces`, `get_trace_tree`)\n- Read customer data and budget usage (`list_customers`, `get_customer_detail`)\n- Manage prompt templates and versions (`list_prompts`, `get_prompt_detail`, `list_prompt_versions`, `get_prompt_version_detail`)\n\n## Requirements\n\n- A Respan account\n- A Respan API key from the [Respan dashboard](https://platform.respan.ai/platform/api/api-keys)\n".trim(),TKe=`
8535
+ `.trim(),DKe="\n## Overview\n\nConnect Respan to Sazabi agents to query LLM request logs, execution traces, prompts, and customer data from your Respan account (the LLM observability platform formerly known as Keywords AI).\n\n## How it works\n\nRespan hosts an MCP server at `https://mcp.respan.ai/api/mcp` over Streamable HTTP. Sazabi stores your Respan API key securely and sends it as the `Authorization: Bearer` token to Respan's MCP endpoint. Once connected, agents can list and inspect LLM request logs, walk trace span trees, read prompt templates and versions, and look up customer budget usage. Write tools (such as creating a log) are enabled — mutations are governed by the per-connection read-only toggle.\n\n## Features\n\n- Query and filter LLM request logs (`list_logs`, `get_log_detail`, `create_log`)\n- Inspect execution traces and span trees (`list_traces`, `get_trace_tree`)\n- Read customer data and budget usage (`list_customers`, `get_customer_detail`)\n- Manage prompt templates and versions (`list_prompts`, `get_prompt_detail`, `list_prompt_versions`, `get_prompt_version_detail`)\n\n## Requirements\n\n- A Respan account\n- A Respan API key from the [Respan dashboard](https://platform.respan.ai/platform/api/api-keys)\n".trim(),zKe=`
8536
8536
  ## Overview
8537
8537
 
8538
8538
  Connect The Context Company to Sazabi agents for read-only observability queries over agent insights, runs, and sessions.
@@ -8552,7 +8552,7 @@ The Context Company hosts a Streamable HTTP MCP server at \`https://api.theconte
8552
8552
 
8553
8553
  - A The Context Company account
8554
8554
  - A read-only API key from the [MCP access documentation](https://docs.thecontext.company/access-data/mcp)
8555
- `.trim(),OKe=`
8555
+ `.trim(),_Ke=`
8556
8556
  ## Overview
8557
8557
 
8558
8558
  Connect Composio to Sazabi agents to use tools from your configured Composio toolkits and connected apps — many SaaS integrations behind one hosted MCP endpoint.
@@ -8571,7 +8571,7 @@ Composio hosts an MCP server at \`https://connect.composio.dev/mcp\` that authen
8571
8571
 
8572
8572
  - A Composio account with a configured toolkit or connected apps
8573
8573
  - A Composio API key, created in the Composio dashboard
8574
- `.trim(),AKe=`
8574
+ `.trim(),jKe=`
8575
8575
  ## Overview
8576
8576
 
8577
8577
  Connect Notion to Sazabi agents to search and work with your Notion pages, databases, and workspace content from your workflow.
@@ -8590,7 +8590,7 @@ Notion hosts a remote MCP server at \`https://mcp.notion.com/mcp\` over streamab
8590
8590
 
8591
8591
  - A Notion workspace
8592
8592
  - Permission to authorize third-party integrations for that workspace
8593
- `.trim(),CKe=`
8593
+ `.trim(),NKe=`
8594
8594
  ## Overview
8595
8595
 
8596
8596
  Connect 1Password so Sazabi agents can work with your vaults and secrets through 1Password's documented secure AI access options.
@@ -8610,11 +8610,11 @@ Connect 1Password so Sazabi agents can work with your vaults and secrets through
8610
8610
  ## Availability
8611
8611
 
8612
8612
  1Password does not yet offer a hosted MCP endpoint Sazabi can connect to, so this connector is listed but not yet connectable from settings. Use the 1Password CLI sandbox preset for agent access today.
8613
- `.trim()});import{dirname as Rle,resolve as Ule}from"node:path";import{fileURLToPath as Mle}from"node:url";var Kle,hq,lq,Ele,uq,qle,Gle,Jle,gq;var I$=g(()=>{be();uu();Kle=Ule(Rle(Mle(import.meta.url)),"../../../skills"),hq=["airbyte","atlassian","attio","autumn","aws","axiom","better-stack","braintrust","calendly","cekura","checkly","clay","clerk","cloudflare","composio","context-dev","custom","datadog","deepwiki","elastic-cloud","exa","gcp","google-drive","grafana","granola","happenstance","honeycomb","incident-io","intercom","langfuse","langsmith","linear","logfire","mercury","neon","notion","onepassword","paper","plug","posthog","plain","planetscale","pylon","railway","render","rentahuman","resend","respan","salesforce","sentry","signoz","slack","stripe","supabase","superhuman","the-context-company","vercel","x"],lq=a.enum(hq),Ele=a.object({readOnlyToolNames:a.array(a.string()).optional(),blockedToolNames:a.array(a.string()).optional(),defaultUnavailableReason:a.enum(lu).optional(),allowWriteTools:a.boolean().optional()}),uq=a.object({registrationEndpoint:a.string().url(),tokenEndpointAuthMethod:a.enum(hu).optional(),includeScopesInRegistration:a.boolean().optional()}),qle=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(),dynamicClientRegistration:uq.optional()}),Gle=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:uq.optional()}),Jle=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()}),gq=a.object({id:a.string().min(1),label:a.string().min(1),iconKey:lq,defaultServerUrl:a.string().url().nullable(),serverUrlPathSuffixMaxSegments:a.number().int().positive().optional(),transport:a.enum(kS),authMode:a.enum(vS),availability:a.enum(oi),oauth:qle.optional(),regions:a.array(Gle).optional(),capabilityOverrides:Ele.optional(),helpText:a.string().optional(),setupGroups:a.array(Jle).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 D=(e)=>{return{...gq.parse(e),...e.getAvailableScopes?{getAvailableScopes:e.getAvailableScopes}:{},...e.getUrlConfiguration?{getUrlConfiguration:e.getUrlConfiguration}:{},...e.validateCredentials?{validateCredentials:e.validateCredentials}:{},...e.normalizeHeaders?{normalizeHeaders:e.normalizeHeaders}:{}}};var ne=g(()=>{I$()});var dq;var yq=g(()=>{ne();dq=D({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:"Give agents authenticated access to your connected third-party platforms (CRM, support, analytics, and more) to read and write records on your behalf.",skill:"airbyte",setupSkill:"airbyte-setup"})});var bq;var mq=g(()=>{ne();bq=D({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.",skill:"atlassian",setupSkill:"atlassian-setup"})});var pq;var wq=g(()=>{ne();pq=D({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.",skill:"attio",setupSkill:"attio-setup"})});var fq;var kq=g(()=>{ne();fq=D({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:VE,normalizeHeaders:YE})});var L$,FKe,vq;var T$=g(()=>{ne();L$=[{value:"us-east-1",label:"US East (N. Virginia) — us-east-1"},{value:"eu-central-1",label:"Europe (Frankfurt) — eu-central-1"}],FKe=new Set(L$.map((e)=>e.value)),vq=D({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 Sq;var Pq=g(()=>{ne();Sq=D({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()=>null,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 $q;var Iq=g(()=>{ne();$q=D({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, and build telemetry queries to investigate production issues."})});var Lq;var Tq=g(()=>{ne();Lq=D({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. The hosted MCP server lives at `https://api.braintrust.dev/mcp` (use `https://api-eu.braintrust.dev/mcp` if your data lives in the EU data plane).",fieldKeys:["apiKey"]}],validateCredentials:xE,normalizeHeaders:NE})});var Oq;var Aq=g(()=>{ne();Oq=D({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 Cq;var Dq=g(()=>{ne();Cq=D({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:"Create or copy a project-scoped Cekura [API key](https://dashboard.cekura.ai/settings/org/api-key) when possible, then paste it below.",fieldKeys:["apiKey"]}],validateCredentials:cq})});var zq;var _q=g(()=>{ne();zq=D({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 jq;var Nq=g(()=>{ne();jq=D({id:"circleback",label:"Circleback",iconKey:"plug",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 Circleback meeting notes, transcripts, action items, and calendar/email context."})});var xq;var Rq=g(()=>{ne();xq=D({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."})});var Uq;var Mq=g(()=>{ne();Uq=D({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 Kq;var Eq=g(()=>{ne();Kq=D({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:"Query Cloudflare Workers observability logs and analytics, bindings (D1, R2, KV), builds, and Radar insights."})});var qq;var Gq=g(()=>{ne();qq=D({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.",imageKeys:["mcp.cloudflare-api-token.create-token"],body:"In the Cloudflare dashboard, go to **My Profile > API Tokens > Create Token**. Use a template or **Create Custom Token**, grant the permissions you want the agent to use (for example Workers Observability, DNS, or Account 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:CE,normalizeHeaders:AE})});var Jq;var Hq=g(()=>{ne();Jq=D({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:"Connect to Composio's hosted MCP server and use tools from your configured toolkit with a Composio API key.",setupGroups:[{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:"Create or copy an API key from the [Composio dashboard](https://app.composio.dev/settings) and 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:BE,normalizeHeaders:HE})});var Bq;var Wq=g(()=>{ne();Bq=D({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:XE,normalizeHeaders:FE,skill:"context-dev",setupSkill:"context-dev-setup"})});var Zq;var Fq=g(()=>{ne();Zq=D({id:"custom",label:"Custom",iconKey:"plug",defaultServerUrl:null,transport:"streamable-http",authMode:"headers",availability:"custom-only",capabilityOverrides:{allowWriteTools:!0},helpText:"Connect any MCP server."})});var Xq;var Yq=g(()=>{ne();Xq=D({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.",fieldKeys:["apiKey","applicationKey"]}],validateCredentials:OE,normalizeHeaders:LE})});var Qq;var Vq=g(()=>{ne();Qq=D({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 eG;var tG=g(()=>{ne();eG=D({id:"elastic-cloud",label:"Elastic Cloud",iconKey:"elastic-cloud",defaultServerUrl:null,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, create an API key with the Agent Builder and index read privileges required by Elastic's MCP server, then copy the generated key.",fieldKeys:["apiKey"]}],validateCredentials:TE,normalizeHeaders:IE})});var nG;var oG=g(()=>{ne();nG=D({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:JE,normalizeHeaders:GE,skill:"exa",setupSkill:"exa-setup"})});var rG;var iG=g(()=>{ne();rG=D({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:aq,normalizeHeaders:iq})});var aG;var cG=g(()=>{ne();aG=D({id:"google-drive",label:"Google Drive",iconKey:"google-drive",defaultServerUrl:"https://drivemcp.googleapis.com/mcp/v1",transport:"streamable-http",authMode:"oauth",availability:"enabled",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(`
8613
+ `.trim()});import{dirname as Rle,resolve as Ule}from"node:path";import{fileURLToPath as Mle}from"node:url";var Kle,hq,lq,Ele,uq,qle,Gle,Jle,gq;var I$=g(()=>{be();uu();Kle=Ule(Rle(Mle(import.meta.url)),"../../../skills"),hq=["airbyte","atlassian","attio","autumn","aws","axiom","better-stack","braintrust","calendly","cekura","checkly","clay","clerk","cloudflare","composio","context-dev","custom","datadog","deepwiki","elastic-cloud","exa","gcp","google-drive","grafana","granola","happenstance","honeycomb","incident-io","intercom","langfuse","langsmith","linear","logfire","mercury","neon","notion","onepassword","paper","plug","posthog","plain","planetscale","pylon","railway","render","rentahuman","resend","respan","salesforce","sentry","signoz","slack","stripe","supabase","superhuman","the-context-company","vercel","x"],lq=a.enum(hq),Ele=a.object({readOnlyToolNames:a.array(a.string()).optional(),blockedToolNames:a.array(a.string()).optional(),defaultUnavailableReason:a.enum(lu).optional(),allowWriteTools:a.boolean().optional()}),uq=a.object({registrationEndpoint:a.string().url(),tokenEndpointAuthMethod:a.enum(hu).optional(),includeScopesInRegistration:a.boolean().optional()}),qle=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(),dynamicClientRegistration:uq.optional()}),Gle=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:uq.optional()}),Jle=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()}),gq=a.object({id:a.string().min(1),label:a.string().min(1),iconKey:lq,defaultServerUrl:a.string().url().nullable(),serverUrlPathSuffixMaxSegments:a.number().int().positive().optional(),transport:a.enum(kS),authMode:a.enum(vS),availability:a.enum(oi),oauth:qle.optional(),regions:a.array(Gle).optional(),capabilityOverrides:Ele.optional(),helpText:a.string().optional(),setupGroups:a.array(Jle).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 D=(e)=>{return{...gq.parse(e),...e.getAvailableScopes?{getAvailableScopes:e.getAvailableScopes}:{},...e.getUrlConfiguration?{getUrlConfiguration:e.getUrlConfiguration}:{},...e.validateCredentials?{validateCredentials:e.validateCredentials}:{},...e.normalizeHeaders?{normalizeHeaders:e.normalizeHeaders}:{}}};var ne=g(()=>{I$()});var dq;var yq=g(()=>{ne();dq=D({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:"Give agents authenticated access to your connected third-party platforms (CRM, support, analytics, and more) to read and write records on your behalf.",skill:"airbyte",setupSkill:"airbyte-setup"})});var bq;var mq=g(()=>{ne();bq=D({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.",skill:"atlassian",setupSkill:"atlassian-setup"})});var pq;var wq=g(()=>{ne();pq=D({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.",skill:"attio",setupSkill:"attio-setup"})});var fq;var kq=g(()=>{ne();fq=D({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:VE,normalizeHeaders:YE})});var L$,eEe,vq;var T$=g(()=>{ne();L$=[{value:"us-east-1",label:"US East (N. Virginia) — us-east-1"},{value:"eu-central-1",label:"Europe (Frankfurt) — eu-central-1"}],eEe=new Set(L$.map((e)=>e.value)),vq=D({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 Sq;var Pq=g(()=>{ne();Sq=D({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()=>null,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 $q;var Iq=g(()=>{ne();$q=D({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, and build telemetry queries to investigate production issues."})});var Lq;var Tq=g(()=>{ne();Lq=D({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. The hosted MCP server lives at `https://api.braintrust.dev/mcp` (use `https://api-eu.braintrust.dev/mcp` if your data lives in the EU data plane).",fieldKeys:["apiKey"]}],validateCredentials:xE,normalizeHeaders:NE})});var Oq;var Aq=g(()=>{ne();Oq=D({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 Cq;var Dq=g(()=>{ne();Cq=D({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:"Create or copy a project-scoped Cekura [API key](https://dashboard.cekura.ai/settings/org/api-key) when possible, then paste it below.",fieldKeys:["apiKey"]}],validateCredentials:cq})});var zq;var _q=g(()=>{ne();zq=D({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 jq;var Nq=g(()=>{ne();jq=D({id:"circleback",label:"Circleback",iconKey:"plug",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 Circleback meeting notes, transcripts, action items, and calendar/email context."})});var xq;var Rq=g(()=>{ne();xq=D({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."})});var Uq;var Mq=g(()=>{ne();Uq=D({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 Kq;var Eq=g(()=>{ne();Kq=D({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:"Query Cloudflare Workers observability logs and analytics, bindings (D1, R2, KV), builds, and Radar insights."})});var qq;var Gq=g(()=>{ne();qq=D({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.",imageKeys:["mcp.cloudflare-api-token.create-token"],body:"In the Cloudflare dashboard, go to **My Profile > API Tokens > Create Token**. Use a template or **Create Custom Token**, grant the permissions you want the agent to use (for example Workers Observability, DNS, or Account 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:CE,normalizeHeaders:AE})});var Jq;var Hq=g(()=>{ne();Jq=D({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:"Connect to Composio's hosted MCP server and use tools from your configured toolkit with a Composio API key.",setupGroups:[{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:"Create or copy an API key from the [Composio dashboard](https://app.composio.dev/settings) and 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:BE,normalizeHeaders:HE})});var Bq;var Wq=g(()=>{ne();Bq=D({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:XE,normalizeHeaders:FE,skill:"context-dev",setupSkill:"context-dev-setup"})});var Zq;var Fq=g(()=>{ne();Zq=D({id:"custom",label:"Custom",iconKey:"plug",defaultServerUrl:null,transport:"streamable-http",authMode:"headers",availability:"custom-only",capabilityOverrides:{allowWriteTools:!0},helpText:"Connect any MCP server."})});var Xq;var Yq=g(()=>{ne();Xq=D({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.",fieldKeys:["apiKey","applicationKey"]}],validateCredentials:OE,normalizeHeaders:LE})});var Qq;var Vq=g(()=>{ne();Qq=D({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 eG;var tG=g(()=>{ne();eG=D({id:"elastic-cloud",label:"Elastic Cloud",iconKey:"elastic-cloud",defaultServerUrl:null,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, create an API key with the Agent Builder and index read privileges required by Elastic's MCP server, then copy the generated key.",fieldKeys:["apiKey"]}],validateCredentials:TE,normalizeHeaders:IE})});var nG;var oG=g(()=>{ne();nG=D({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:JE,normalizeHeaders:GE,skill:"exa",setupSkill:"exa-setup"})});var rG;var iG=g(()=>{ne();rG=D({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:aq,normalizeHeaders:iq})});var aG;var cG=g(()=>{ne();aG=D({id:"google-drive",label:"Google Drive",iconKey:"google-drive",defaultServerUrl:"https://drivemcp.googleapis.com/mcp/v1",transport:"streamable-http",authMode:"oauth",availability:"enabled",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(`
8614
8614
  `)}],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."})});var sG;var hG=g(()=>{ne();sG=D({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 lG;var uG=g(()=>{ne();lG=D({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()=>[],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 gG;var dG=g(()=>{ne();gG=D({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 yG;var bG=g(()=>{ne();yG=D({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, triggers, and run queries."})});var mG;var pG=g(()=>{ne();mG=D({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 wG;var fG=g(()=>{ne();wG=D({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:UE,normalizeHeaders:RE})});var kG;var vG=g(()=>{ne();kG=D({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:eq,normalizeHeaders:QE})});var SG;var PG=g(()=>{ne();SG=D({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."})});var $G;var IG=g(()=>{ne();$G=D({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 manage Linear issues and projects."})});var LG;var TG=g(()=>{ne();LG=D({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, dashboards, and schedules."})});var OG;var AG=g(()=>{ne();OG=D({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."}],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."})});var CG;var DG=g(()=>{ne();CG=D({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:"Start with https://mcp.neon.tech/mcp. To narrow access, append query params such as `?readonly=true`, `&projectId=<id>`, and/or `&category=<groups>`, then copy the resulting Server URL.",defaultServerUrl:"https://mcp.neon.tech/mcp",imageKeys:["mcp.neon.projects-console","mcp.neon.project-settings-details"],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 zG;var _G=g(()=>{ne();zG=D({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."})});var jG;var NG=g(()=>{ne();jG=D({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 xG;var RG=g(()=>{ne();xG=D({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."})});var UG;var MG=g(()=>{ne();UG=D({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 KG;var EG=g(()=>{ne();KG=D({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 qG;var GG=g(()=>{ne();qG=D({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"},{value:"user:write"},{value:"organization:read"},{value:"project:read"},{value:"project:write"},{value:"survey:read"},{value:"survey:write"},{value:"error_tracking:read"},{value:"logs:read"},{value:"tracing:read"}],getUrlConfiguration:async()=>({docsUrl:"https://posthog.com/docs/model-context-protocol/faq",instructions:"Add ?features=<groups> or ?tools=<names> to limit which tools are exposed (e.g. https://mcp.posthog.com/mcp?features=flags,workspace), then copy the Server URL.",defaultServerUrl:"https://mcp.posthog.com/mcp",imageKeys:["mcp.posthog.settings-page"],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 JG;var HG=g(()=>{ne();JG=D({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 BG;var WG=g(()=>{ne();BG=D({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 ZG;var FG=g(()=>{ne();ZG=D({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.",fieldKeys:["apiKey"]}],validateCredentials:KE,normalizeHeaders:ME})});var XG;var YG=g(()=>{ne();XG=D({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.",fieldKeys:["apiKey"]}],validateCredentials:ZE,normalizeHeaders:WE,skill:"rentahuman",setupSkill:"rentahuman-setup"})});var QG;var VG=g(()=>{ne();QG=D({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. 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:nq,normalizeHeaders:tq,skill:"resend",setupSkill:"resend-setup"})});var eJ;var tJ=g(()=>{ne();eJ=D({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:rq,normalizeHeaders:oq,skill:"respan",setupSkill:"respan-setup"})});var nJ;var oJ=g(()=>{ne();nJ=D({id:"salesforce",label:"Salesforce",iconKey:"salesforce",defaultServerUrl:"https://api.salesforce.com/platform/mcp/v1/platform/sobject-all",transport:"streamable-http",authMode:"oauth",availability:"enabled",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(`
8615
- `)}],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."})});var rJ;var iJ=g(()=>{ne();rJ=D({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 `https://mcp.sentry.dev/mcp` for broad access. To scope this connection to one organization or project, copy a path-scoped URL such as `https://mcp.sentry.dev/mcp/your-org` or `https://mcp.sentry.dev/mcp/your-org/your-project`.",defaultServerUrl:"https://mcp.sentry.dev/mcp",imageKeys:["mcp.sentry.url-configuration-page"],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 aJ;var cJ=g(()=>{ne();aJ=D({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:qE,normalizeHeaders:EE})});var sJ;var hJ=g(()=>{ne();sJ=D({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"}},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 lJ;var uJ=g(()=>{ne();lJ=D({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 gJ;var dJ=g(()=>{ne();gJ=D({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 yJ;var bJ=g(()=>{ne();yJ=D({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:"Create a read-only API key in [The Context Company](https://docs.thecontext.company/access-data/mcp), then paste the raw key below. Sazabi sends it as `Authorization: Bearer <key>` to `https://api.thecontext.company/mcp`.",fieldKeys:["apiKey"]}],validateCredentials:_E,normalizeHeaders:zE,skill:"the-context-company",setupSkill:"the-context-company-setup"})});var mJ;var pJ=g(()=>{ne();mJ=D({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."})});var wJ;var fJ=g(()=>{ne();wJ=D({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 an X API OAuth 2.0 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:"Create an OAuth 2.0 Bearer token",description:"Generate the OAuth 2.0 access token the hosted MCP server will use.",body:"In your app's **Keys and tokens**, generate an OAuth 2.0 access token and copy it. Paste the raw token into Sazabi — Sazabi adds the `Bearer ` prefix and sends it in the `Authorization` header.",fieldKeys:["accessToken"]}],validateCredentials:jE,normalizeHeaders:DE,skill:"x",setupSkill:"x-setup"})});var kJ,pJe;var vJ=g(()=>{yq();mq();wq();kq();T$();T$();Pq();Iq();Tq();Aq();Dq();_q();Nq();Rq();Mq();Eq();Gq();Hq();Wq();Fq();Yq();Vq();tG();oG();iG();cG();hG();uG();dG();bG();pG();fG();vG();PG();IG();TG();AG();DG();_G();NG();RG();MG();EG();GG();HG();WG();FG();YG();VG();tJ();oJ();iJ();cJ();hJ();uJ();dJ();bJ();pJ();fJ();kJ=[lJ,Xq,Qq,dq,bq,pq,fq,vq,Sq,$q,Lq,Oq,Cq,zq,xq,Uq,Kq,qq,jq,Jq,Bq,eG,nG,rG,aG,sG,lG,gG,yG,mG,wG,kG,SG,$G,LG,OG,CG,zG,jG,xG,UG,KG,qG,JG,BG,XG,ZG,QG,eJ,nJ,rJ,aJ,sJ,gJ,yJ,mJ,wJ,Zq],pJe=new Map(kJ.map((e)=>[e.id,e]))});var SJ=()=>{};var PJ=()=>{};var $J=()=>{};var IJ=()=>{};var LJ=()=>{};var TJ=()=>{};var OJ=()=>{};var AJ=()=>{};var CJ=()=>{};var DJ=()=>{};var zJ=()=>{};var _J=()=>{};var jJ=()=>{};var NJ=()=>{};var xJ=()=>{};var RJ=()=>{};var UJ=()=>{};var MJ=()=>{};var KJ=()=>{};var EJ=()=>{};var qJ=()=>{};var GJ=()=>{};var JJ=()=>{};var HJ=()=>{};var BJ=()=>{};var WJ=()=>{};var ZJ=()=>{};var FJ=()=>{};var XJ=()=>{};var YJ=()=>{};var QJ=()=>{};var VJ=()=>{};var eH=()=>{};var tH=()=>{};var nH=()=>{};var oH=()=>{};var rH=()=>{};var iH=()=>{};var aH=()=>{};var cH=()=>{};var sH=g(()=>{SJ();PJ();$J();IJ();LJ();TJ();OJ();AJ();CJ();DJ();zJ();_J();jJ();NJ();xJ();RJ();UJ();MJ();KJ();EJ();qJ();GJ();JJ();HJ();BJ();WJ();ZJ();FJ();XJ();YJ();QJ();VJ();eH();tH();nH();oH();rH();iH();aH();cH()});var hH=()=>{};var lH=()=>{};var uH=g(()=>{_R();uu();$E();sq();vJ();I$();sH();hH();lH()});var gH,Zle,dH,Fle,yH,Xle,bH,mH,Lg,pH,wH,fH,vi,kH,vH,Si,SH,PH,Pi,$H,Yle,IH,Tg,Qle;var O$=g(()=>{uH();be();Le();gH=["configured","authorizing","connected","error"],Zle=a.enum(gH),dH=["preset","custom"],Fle=a.enum(dH),yH=["streamable-http","sse"],Xle=a.enum(yH),bH=["none","headers","oauth","aws-sigv4"],mH=a.enum(bH),Lg=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:Fle.describe("Whether the connector is a built-in preset or a custom server."),installStatus:Zle.describe("Current connection lifecycle status."),authMode:mH.describe("Authentication mode."),transport:Xle.describe("Transport protocol."),serverUrl:a.string().describe("MCP server URL."),readOnly:a.boolean().describe("Whether the connector is restricted to read-only tools."),management:IS.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()}),pH=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.")}),wH=a.object({projectId:a.string().uuid().optional().describe("Project to list connectors for. Auto-filled from SDK context when omitted."),connectedOnly:a.boolean().optional().describe("When true, only return connectors that are connected.")}),fH=a.object({connectors:a.array(Lg)}),vi=P({operationId:"mcpConnectors.list",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:wH,output:fH,pagination:"none",async:"sync"}),kH=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.")}),vH=a.object({connector:Lg}),Si=P({operationId:"mcpConnectors.get",description:"Get one configured MCP connector by connection ID.",backend:"api",route:{method:"GET",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"]},input:kH,output:vH,pagination:"none",async:"sync"}),SH=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.")}),PH=a.object({connector:Lg,tools:a.array(pH)}),Pi=P({operationId:"mcpConnectors.details",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:SH,output:PH,pagination:"none",async:"sync"}),$H=a.object({providerId:a.string().describe('Provider identifier, e.g. "linear".'),label:a.string().describe("Human-readable provider name."),authMode:mH.describe("Authentication mode."),availability:a.enum(oi).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.")}),Yle=a.object({}),IH=a.object({providers:a.array($H)}),Tg=P({operationId:"mcpConnectors.listProviders",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:Yle,output:IH,pagination:"none",async:"sync"}),Qle={list:vi.contract,get:Si.contract,details:Pi.contract,listProviders:Tg.contract}});var $i,Vle,eue,tue,nue,oue,rue,iue,A$,GZe;var Og=g(()=>{be();Le();$i=a.enum(["admin","member"]),Vle=a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional(),role:$i}),eue=a.object({id:a.string().min(1),name:a.string().nullable(),email:a.string().email()}),tue=a.object({credentialType:a.literal("user"),user:eue,activeOrganizationId:a.string().min(1).nullable(),organizations:a.array(Vle).describe("Organizations the user belongs to, including membership role.")}),nue=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()}),oue=a.object({credentialType:a.literal("partner"),superorganization:a.object({id:a.string().uuid(),name:a.string()})}),rue=a.object({}),iue=a.discriminatedUnion("credentialType",[tue,nue,oue]),A$=P({operationId:"me.get",description:"Return the identity and available context for the current credential.",backend:"api",route:{method:"GET",path:"/me",tags:["Auth"]},input:rue,output:iue,pagination:"none",async:"sync"}),GZe=A$.contract});var LH,aue,cue,sue,hue,lue,uue,C$,D$,z$,ZZe;var TH=g(()=>{be();Le();Og();LH=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:$i.describe("Organization role."),createdAt:a.string().datetime().describe("When the membership was created.")}),aue=a.object({organizationId:a.string().min(1).optional().describe("Organization to list members for. Auto-filled from CLI and SDK context when omitted.")}),cue=a.object({members:a.array(LH).describe("Members visible within the selected organization.")}),sue=a.object({organizationId:a.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted."),userId:a.string().min(1).describe("User ID of the member to update."),role:$i.describe("Role to assign.")}),hue=a.object({member:LH.describe("Updated organization member.")}),lue=a.object({params:a.object({userId:a.string().min(1).describe("User ID 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.")})}).transform(({params:e,query:t})=>({...t,...e})),uue=a.object({removedUserId:a.string().min(1).describe("User ID removed from the organization.")}),C$=P({operationId:"members.list",description:"List members in an organization.",backend:"api",route:{method:"GET",path:"/members",tags:["Members"]},input:aue,output:cue,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"}]}}]}),D$=P({operationId:"members.updateRole",description:"Update a member's organization role.",backend:"api",route:{method:"PATCH",path:"/members/{userId}/role",tags:["Members"]},input:sue,output:hue,pagination:"none",async:"sync",examples:[{name:"promote-member",input:{organizationId:"organization-123",userId:"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"}}}]}),z$=P({operationId:"members.remove",description:"Remove a member from an organization.",backend:"api",route:{method:"DELETE",path:"/members/{userId}",tags:["Members"],inputStructure:"detailed"},input:lue,output:uue,pagination:"none",async:"sync"}),ZZe={list:C$.contract,updateRole:D$.contract,remove:z$.contract}});var AH,CH,Ag,DH,Cg,OH=4194304,_$,j$,gue=(e)=>{let t=e.split(",").map((r)=>r.trim()).filter(Boolean),n=a.array(Ag).safeParse(t);if(!n.success)throw Error("Kind filter must be a comma-separated list of note, runbook, or change.");return n.data},Gc,N$,x$,zH,_H,jH,NH,xH,RH,UH,MH,KH,EH,qH,GH,Ii,Li,Ti,Oi,Ai,due;var R$=g(()=>{be();Le();AH=["note","runbook"],CH=["note","runbook","change"],Ag=a.enum(CH),DH=a.enum(AH),Cg=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."),_$=a.string().min(1).refine((e)=>new TextEncoder().encode(e).length<=OH,{message:`Memory body must be at most ${OH} bytes (4 MiB).`}).describe("Document body stored in project memory."),j$=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."),Gc=a.string().min(1).transform(gue).describe("Comma-separated kinds, for example note,runbook."),N$=a.object({id:a.string().uuid(),projectId:a.string().uuid(),kind:Ag,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()}),x$=N$.extend({body:_$}),zH=a.object({projectId:a.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),path:Cg.describe("Relative path for the curated document."),body:_$,kind:DH.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.")}),_H=a.object({document:x$}),jH=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:Cg.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."})}),NH=a.object({document:x$}),xH=a.object({projectId:a.string().uuid().optional().describe("Project to list memory for. Auto-filled from CLI and SDK context when omitted."),kind:Gc.optional(),since:j$.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.")}),RH=a.object({documents:a.array(N$),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),UH=a.object({documentId:a.string().uuid(),kind:Ag,managed:a.boolean(),path:a.string().nullable(),title:a.string().nullable(),snippet:a.string(),score:a.number()}),MH=a.object({calibrated:a.literal(!0),minScoreThreshold:a.number(),queryTerms:a.array(a.string()),message:a.string()}),KH=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:Gc.optional(),since:j$.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.")}),EH=a.object({hits:a.array(UH),emptyVerdict:MH.nullable()}),qH=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:Cg.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."})}),GH=a.object({deleted:a.boolean()}),Ii=P({operationId:"memory.put",description:"Create or replace a curated project memory document. Embeds on success.",backend:"api",route:{method:"PUT",path:"/memory",tags:["Memory"]},input:zH,output:_H,pagination:"none",async:"sync"}),Li=P({operationId:"memory.get",description:"Get one project memory document by id or path.",backend:"api",route:{method:"GET",path:"/memory/document",tags:["Memory"]},input:jH,output:NH,pagination:"none",async:"sync"}),Ti=P({operationId:"memory.list",description:"List project memory catalog rows without embedding search.",backend:"api",route:{method:"GET",path:"/memory",tags:["Memory"]},input:xH,output:RH,pagination:"cursor",async:"sync"}),Oi=P({operationId:"memory.search",description:"Hybrid semantic and keyword search over project memory documents.",backend:"api",route:{method:"POST",path:"/memory/search",tags:["Memory"]},input:KH,output:EH,pagination:"none",async:"sync"}),Ai=P({operationId:"memory.delete",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:qH,output:GH,pagination:"none",async:"sync"}),due={put:Ii.contract,get:Li.contract,list:Ti.contract,search:Oi.contract,delete:Ai.contract}});var JH,HH,yue,bue,mue,pue,wue,Jc,fue,kue,vue,U$,M$,K$,E$,tFe;var Dg=g(()=>{be();Le();JH=a.enum(["processing","completed","aborted","error"]),HH=a.object({id:a.string().uuid(),threadId:a.string().uuid(),userMessageId:a.string().uuid().nullable(),assistantMessageId:a.string().uuid().nullable(),parentRunId:a.string().uuid().nullable(),workflowRunId:a.string().nullable(),status:JH,source:a.enum(["app","api","mcp","slack","teams","linear","github","agent","cli"]),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),completedAt:a.string().datetime().nullable()}),yue=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.")}),bue=a.object({runs:a.array(HH),nextCursor:a.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),mue=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.")}),pue=a.object({runs:a.array(HH),nextCursor:a.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),wue=a.object({runId:a.string().uuid().describe("Run ID returned by a deferred operation.")}),Jc=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:JH.describe("Current run lifecycle status."),response:a.string().nullable().describe("Assistant response text when the run has completed.")}),fue=Jc.describe("Current run state and, when complete, the assistant response."),kue=a.object({runId:a.string().uuid().describe("Run ID of the in-flight run to request cancellation for.")}),vue=a.object({success:a.literal(!0).describe("Always true when the cancellation request was accepted.")}),U$=P({operationId:"runs.list",description:"List deferred runs within one project.",backend:"api",route:{method:"GET",path:"/runs",tags:["Runs"]},input:yue,output:bue,pagination:"cursor",async:"sync"}),M$=P({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:mue,output:pue,pagination:"cursor",async:"sync"}),K$=P({operationId:"runs.get",description:"Get the current result for a deferred run by run ID.",backend:"api",route:{method:"GET",path:"/runs/{runId}",tags:["Runs"]},input:wue,output:fue,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}}]}),E$=P({operationId:"runs.cancel",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:kue,output:vue,pagination:"none",async:"sync",examples:[{name:"cancel-processing-run",input:{runId:"33333333-3333-4333-8333-333333333333"},output:{success:!0}}]}),tFe={list:U$.contract,listForThread:M$.contract,get:K$.contract,cancel:E$.contract}});var zg=(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"]})},_g=(e,t,n)=>{if(e&&!t)n.addIssue({code:"custom",message:"ambientServiceRun requires an automationId",path:["ambientServiceRun"]})};var BH,Hc,Sue,Pue,$ue,Iue,Lue,Tue,Oue,Aue,Cue,q$,Due,zue,_ue,jue,Nue,xue,Rue,Uue,Mue,Kue,Eue,que,G$,J$,H$,B$,W$,Z$,WH,Gue,Jue,Hue,Bue,ZH,Wue,Zue,Fue,Xue,Yue,Que,Xo="22222222-2222-4222-8222-222222222222",FH="11111111-1111-4111-8111-111111111111",Vue="44444444-4444-4444-8444-444444444444",XH="55555555-5555-4555-8555-555555555555",F$,X$,Y$,Q$,V$,sFe;var eI=g(()=>{be();Le();Dg();BH=a.enum(["slack","teams","linear","github","app","mcp","agent","api","cli"]),Hc=a.object({id:a.string().uuid(),projectId:a.string().uuid(),title:a.string().nullable(),status:a.enum(["regular","archived"]),source:BH.nullable(),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),Sue=a.object({type:a.literal("message"),message:a.string()}),Pue=a.object({type:a.literal("reasoning"),reasoning:a.string(),status:a.enum(["in_progress","complete"]).optional()}),$ue=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()}),Iue=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()}),Lue=a.object({type:a.literal("fork"),sourceThreadId:a.string(),sourceMessageId:a.string(),sourceThreadTitle:a.string().nullable()}),Tue=a.object({type:a.literal("summary"),summary:a.string()}),Oue=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()}))}),Aue=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()}))}),Cue=a.union([Sue,Pue,$ue,Iue,Lue,Tue,Oue,Aue]),q$=a.object({id:a.string().uuid(),role:a.enum(["user","assistant"]),content:a.array(Cue),source:BH,createdAt:a.string().datetime()}),Due=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.")}),zue=a.object({threads:a.array(Hc).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.")}),_ue=a.object({threadId:a.string().uuid().describe("Thread ID returned by threads.list or threads.create.")}),jue=a.object({thread:Hc.describe("The requested thread."),messages:a.array(q$).describe("Messages currently stored on the thread in chronological order.")}),Nue=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)=>{zg(e.message,e.automationId,t),_g(e.ambientServiceRun,e.automationId,t)}),xue=Jc.describe("Deferred run result for creating a thread."),Rue=a.object({threadId:a.string().uuid().describe("Thread ID whose current processing status should be returned.")}),Uue=a.object({status:a.enum(["idle","processing"]),lastRunStatus:a.enum(["error"]).nullable()}),Mue=a.object({threadId:a.string().uuid().describe("Thread ID whose active run should be stopped.")}),Kue=a.object({success:a.literal(!0).describe("Always true when the stop request was accepted.")}),Eue=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.")}),que=a.object({thread:Hc.describe("The updated thread.")}),G$=P({operationId:"threads.list",description:"List threads in a project, optionally filtered by status.",backend:"api",route:{method:"GET",path:"/threads",tags:["Threads"]},input:Due,output:zue,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}}]}),J$=P({operationId:"threads.get",description:"Get a thread and its messages.",backend:"api",route:{method:"GET",path:"/threads/{threadId}",tags:["Threads"]},input:_ue,output:jue,pagination:"none",async:"sync"}),H$=P({operationId:"threads.getStatus",description:"Get the current processing status for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/status",tags:["Threads"]},input:Rue,output:Uue,pagination:"none",async:"sync",examples:[{name:"processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{status:"processing",lastRunStatus:null}}]}),B$=P({operationId:"threads.stop",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:Mue,output:Kue,pagination:"none",async:"sync",examples:[{name:"stop-processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{success:!0}}]}),W$=P({operationId:"threads.create",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:Nue,output:xue,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}}]}),Z$=P({operationId:"threads.update",description:"Update a thread's status.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}",tags:["Threads"]},input:Eue,output:que,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"}}}]}),WH=a.enum(["private","organization"]),Gue=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.")}),Jue=a.object({thread:Hc.describe("The newly created forked thread.")}),Hue=a.object({threadId:a.string().uuid().describe("Thread ID of the thread to update."),visibility:WH.describe("New visibility. 'private' restricts the thread to its owner; 'organization' shares it with the organization.")}),Bue=a.object({thread:Hc.describe("The updated thread."),visibility:WH.describe("The thread's resulting visibility.")}),ZH=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()}),Wue=a.object({threadId:a.string().uuid().describe("Thread ID to create a public read-only snapshot for.")}),Zue=a.object({share:ZH.describe("The created share link.")}),Fue=a.object({threadId:a.string().uuid().describe("Thread ID the snapshot belongs to."),shareId:a.string().uuid().describe("Snapshot ID to revoke.")}),Xue=a.void(),Yue=a.object({threadId:a.string().uuid().describe("Thread ID to list public snapshots for.")}),Que=a.object({shares:a.array(ZH).describe("Active share links for the thread.")}),F$=P({operationId:"threads.fork",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:Gue,output:Jue,pagination:"none",async:"sync",examples:[{name:"fork-from-message",input:{threadId:Xo,messageId:Vue},output:{thread:{id:"66666666-6666-4666-8666-666666666666",projectId:FH,title:"API returning 500s (fork)",status:"regular",source:"api",createdAt:"2026-01-01T00:20:00.000Z",updatedAt:"2026-01-01T00:20:00.000Z"}}}]}),X$=P({operationId:"threads.setVisibility",description:"Set a thread's visibility to private or organization.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}/visibility",tags:["Threads"]},input:Hue,output:Bue,pagination:"none",async:"sync",examples:[{name:"make-private",input:{threadId:Xo,visibility:"private"},output:{thread:{id:Xo,projectId:FH,title:"API returning 500s",status:"regular",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:30:00.000Z"},visibility:"private"}}]}),Y$=P({operationId:"threads.createShareLink",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:Wue,output:Zue,pagination:"none",async:"sync",examples:[{name:"create-share-link",input:{threadId:Xo},output:{share:{shareId:XH,threadId:Xo,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}}}]}),Q$=P({operationId:"threads.listShareLinks",description:"List active public share links for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/share",tags:["Threads"]},input:Yue,output:Que,pagination:"none",async:"sync",examples:[{name:"list-share-links",input:{threadId:Xo},output:{shares:[{shareId:XH,threadId:Xo,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}]}}]}),V$=P({operationId:"threads.revokeShareLink",description:"Revoke a public share link for a thread.",backend:"api",route:{method:"DELETE",path:"/threads/{threadId}/share/{shareId}",successStatus:204,tags:["Threads"]},input:Fue,output:Xue,pagination:"none",async:"sync"}),sFe={list:G$.contract,get:J$.contract,getStatus:H$.contract,stop:B$.contract,create:W$.contract,update:Z$.contract,fork:F$.contract,setVisibility:X$.contract,createShareLink:Y$.contract,listShareLinks:Q$.contract,revokeShareLink:V$.contract}});var ege,tge,nge,oge,YH,QH;var VH=g(()=>{be();Le();Dg();eI();ege=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.")}),tge=a.object({messages:a.array(q$),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),nge=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)=>{zg(e.message,e.automationId,t),_g(e.ambientServiceRun,e.automationId,t)}),oge=Jc.describe("Deferred run result for appending a message to an existing thread."),YH=P({operationId:"messages.list",description:"List messages in a thread with cursor pagination.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/messages",tags:["Messages"]},input:ege,output:tge,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}}]}),QH=P({operationId:"messages.append",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:nge,output:oge,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 xt,tB,tI,Ci,nB,jg,fo,oB,eB;var Bc=g(()=>{be();xt={IN_APP:"in_app",SLACK:"slack",SLACK_CHANNEL:"slack_channel",TEAMS_CHANNEL:"teams_channel",EMAIL:"email",SMS:"sms",INCIDENT_IO:"incident_io",PAGERDUTY:"pagerduty",ROOTLY:"rootly",WEBHOOK:"webhook"},tB=[xt.IN_APP,xt.SLACK,xt.EMAIL,xt.SMS],tI=[xt.SLACK_CHANNEL,xt.TEAMS_CHANNEL,xt.INCIDENT_IO,xt.PAGERDUTY,xt.ROOTLY,xt.WEBHOOK],Ci=Object.values(xt),nB=[...Ci,"victorops"],jg=a.enum(Ci),fo=a.enum(tI),oB=[{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"}],eB=new Set(oB.map(({channel:e})=>e));if(eB.size!==Ci.length||Ci.some((e)=>!eB.has(e)))throw Error("Notification channel definitions must represent every channel")});var rB,rge=(e,t)=>e.value===t.value&&e.label===t.label&&e.scope===t.scope&&e.role===t.role&&e.defaultOff===t.defaultOff&&(e.deliveryConditions??[]).join(",")===(t.deliveryConditions??[]).join(","),kt=(e)=>{for(let t of Object.values(e)){let n=rB.get(t.value);if(n&&!rge(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}`);rB.set(t.value,t)}return e};var qn=g(()=>{rB=new Map});var iB;var aB=g(()=>{qn();iB=kt({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 cB;var sB=g(()=>{qn();cB=kt({BILLING_PLAN_UPGRADE_APPLIED:{value:"billing_plan_upgrade_applied",label:"Billing upgrade applied",scope:"org",role:"admin"},BILLING_PLAN_DOWNGRADE_SCHEDULED:{value:"billing_plan_downgrade_scheduled",label:"Billing downgrade scheduled",scope:"org",role:"admin"},BILLING_PLAN_DOWNGRADE_APPLIED:{value:"billing_plan_downgrade_applied",label:"Billing downgrade applied",scope:"org",role:"admin"},BILLING_CREDIT_BALANCE_LOW:{value:"billing_credit_balance_low",label:"Billing credits low",scope:"org",role:"admin"},BILLING_CREDIT_BALANCE_DEPLETED:{value:"billing_credit_balance_depleted",label:"Billing credits depleted",scope:"org",role:"admin"},BILLING_AUTO_TOP_UP_SETTINGS_CHANGED:{value:"billing_auto_top_up_settings_changed",label:"Billing auto top-up changed",scope:"org",role:"admin"},BILLING_AUTO_TOP_UP_FAILED:{value:"billing_auto_top_up_failed",label:"Billing auto top-up failed",scope:"org",role:"admin"},BILLING_INVOICE_PAID:{value:"billing_invoice_paid",label:"Billing invoice paid",scope:"org",role:"admin"},BILLING_NEGATIVE_BALANCE_COLLECTED:{value:"billing_negative_balance_collected",label:"Billing outstanding balance charged",scope:"org",role:"admin"},BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED:{value:"billing_negative_balance_collection_failed",label:"Billing outstanding balance charge failed",scope:"org",role:"admin"}})});var hB;var lB=g(()=>{qn();hB=kt({INTEGRATION_CONNECTED:{value:"integration_connected",label:"Integration connected",scope:"org",defaultOff:!0},INTEGRATION_DISCONNECTED:{value:"integration_disconnected",label:"Integration disconnected",scope:"org"}})});var uB;var gB=g(()=>{qn();uB=kt({ISSUE_TRIGGERED:{value:"issue_triggered",label:"Issue triggered",scope:"project",deliveryConditions:["component","severity"]},ISSUE_RESOLVED:{value:"issue_resolved",label:"Issue resolved",scope:"project",deliveryConditions:["component","severity"]},ISSUE_IGNORED:{value:"issue_ignored",label:"Issue ignored",scope:"project",deliveryConditions:["component","severity"]}})});var dB;var yB=g(()=>{qn();dB=kt({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 bB;var mB=g(()=>{qn();bB=kt({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 pB;var wB=g(()=>{qn();pB=kt({SECURITY_ALERT:{value:"security_alert",label:"Security alert",scope:"org",role:"admin"}})});var nI,at,age,oI=(e)=>{let t=age.get(e)?.label;if(t)return t;let n=e.replace(/_/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):e};var Wc=g(()=>{aB();sB();lB();gB();yB();mB();wB();qn();nI={...pB,...dB,...hB,...iB,...uB,...bB,...cB},at=Object.fromEntries(Object.entries(nI).map(([e,t])=>[e,t.value])),age=new Map(Object.values(nI).map((e)=>[e.value,e]))});var rI,kB,GFe,In,JFe;var Zc=g(()=>{Wc();Bc();Bc();rI=Object.values(at),kB=[at.BILLING_PLAN_UPGRADE_APPLIED,at.BILLING_PLAN_DOWNGRADE_SCHEDULED,at.BILLING_PLAN_DOWNGRADE_APPLIED,at.BILLING_CREDIT_BALANCE_LOW,at.BILLING_CREDIT_BALANCE_DEPLETED,at.BILLING_AUTO_TOP_UP_SETTINGS_CHANGED,at.BILLING_AUTO_TOP_UP_FAILED,at.BILLING_INVOICE_PAID,at.BILLING_NEGATIVE_BALANCE_COLLECTED,at.BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED],GFe=new Set(kB),In=[at.ISSUE_TRIGGERED,at.ISSUE_RESOLVED,at.ISSUE_IGNORED,at.AUTOMATION_RUN_FAILED],JFe=new Set(In)});var Fc,vB,SB=(e)=>typeof e==="string"&&(e in vB)?vB[e]:e,sge;var PB=g(()=>{Bc();be();Zc();Fc=a.enum(rI),vB={data_source_connected:"log_source_connected",data_source_disconnected:"log_source_disconnected"},sge=a.preprocess(SB,Fc)});var hge;var $B=g(()=>{Wc();Zc();hge=In.map((e)=>({notificationType:e,label:oI(e)}))});var IB=g(()=>{Wc();Zc()});var iI=g(()=>{Bc();Wc();Zc();PB();$B();IB()});var uge,gge,dge,yge,bge,mge,pge,aI,DXe;var LB=g(()=>{iI();be();Le();uge=a.enum(["ready","missing","degraded","unavailable"]),gge=a.object({id:a.string(),label:a.string(),status:a.enum(["active","inactive","degraded"]),statusLabel:a.string()}),dge=a.object({channel:jg,name:a.string(),description:a.string(),scope:a.enum(["personal","project"]),enabled:a.boolean().nullable(),preferenceId:a.string().nullable(),prerequisite:a.object({status:uge,statusLabel:a.string(),message:a.string()}),action:a.object({label:a.string(),href:a.string()}).nullable(),destinations:a.array(gge),destinationManagement:a.enum(["none","slack_channels","teams_channels","integration_connections","webhook_endpoints"]),canCreateDestinations:a.boolean(),supportedNotificationTypes:a.array(Fc)}),yge=a.object({channel:fo,enabled:a.boolean(),preferenceId:a.string().nullable()}),bge=a.object({channel:fo,notificationType:Fc,enabled:a.boolean(),preferenceId:a.string()}),mge=a.object({projectId:a.string().uuid().optional().describe("Project to inspect. Auto-filled from CLI and SDK context when omitted.")}),pge=a.object({channelCards:a.array(dge).length(10),channels:a.array(yge),notificationTypePreferences:a.array(bge),issueNotificationMinSeverity:a.enum(["low","medium","high","critical"])}),aI=P({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:mge,output:pge,pagination:"none",async:"sync"}),DXe={getProject:aI.contract}});var TB,sI,OB,hI,xXe,RXe,lI,uI=(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."})},UXe,AB,cI,gI,Xc,CB,wge,fge,kge,vge,Sge,Pge,$ge,Ige,Lge,dI,yI,bI,mI,pI,MXe;var DB=g(()=>{iI();be();Le();TB=a.enum(["low","medium","high","critical"]),sI=a.object({severities:a.array(TB).min(1).optional()}).strict(),OB=a.object({componentIds:a.array(a.string().uuid()).min(1).optional(),severities:a.array(TB).min(1).optional()}).strict(),hI=a.object({channel:fo,destinationKey:a.string().min(1)}),xXe=a.object({destinations:a.array(hI).min(1),notificationTypes:a.array(a.enum(In)).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:sI}),RXe=a.object({destinations:a.array(hI).min(1),notificationTypes:a.array(a.enum(In)).min(1),condition:OB}),lI=a.object({destinations:a.array(hI).min(1),notificationTypes:a.array(a.enum(In)).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([sI,OB])}),UXe=lI.superRefine(uI),AB=a.object({id:a.string(),channel:fo,destinationKey:a.string(),displayName:a.string()}),cI=a.object({id:a.string().uuid(),label:a.string(),lifecycle:a.enum(["active","retired","merged"])}),gI=a.object({id:a.string().uuid(),projectId:a.string().uuid(),notificationTypes:a.array(a.enum(In)),destinations:a.array(AB),condition:sI,component:cI.nullable(),componentId:a.string().uuid().nullable(),includeDescendants:a.boolean(),suspendedAt:a.string().datetime().nullable(),suspensionReason:a.string().nullable(),components:a.array(cI),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),Xc=a.object({projectId:a.string().uuid().optional().describe("Project whose notification delivery rules are being managed.")}),CB=a.string().uuid().describe("Logical notification delivery rule ID."),wge=Xc,fge=a.object({rules:a.array(gI)}),kge=a.object({destinations:a.array(AB),notificationTypes:a.array(a.object({notificationType:a.enum(In),label:a.string(),conditions:a.array(a.enum(["component","severity"]))})),components:a.array(cI)}),vge=Xc.extend(lI.shape).superRefine(uI),Sge=gI,Pge=Xc.extend({...lI.shape,ruleId:CB}).superRefine(uI),$ge=gI,Ige=Xc.extend({ruleId:CB}),Lge=a.object({removed:a.boolean()}),dI=P({operationId:"notificationDeliveryRules.list",description:"List the positive delivery rules for a project.",backend:"api",route:{method:"GET",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:wge,output:fge,pagination:"none",async:"sync"}),yI=P({operationId:"notificationDeliveryRules.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:Xc,output:kge,pagination:"none",async:"sync"}),bI=P({operationId:"notificationDeliveryRules.create",description:"Create a positive project notification delivery rule.",backend:"api",route:{method:"POST",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:vge,output:Sge,pagination:"none",async:"sync"}),mI=P({operationId:"notificationDeliveryRules.update",description:"Replace a positive delivery rule atomically.",backend:"api",route:{method:"PUT",path:"/notification-delivery-rules/{ruleId}",tags:["Notification delivery rules"]},input:Pge,output:$ge,pagination:"none",async:"sync"}),pI=P({operationId:"notificationDeliveryRules.delete",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:Ige,output:Lge,pagination:"none",async:"sync"}),MXe={list:dI.contract,options:yI.contract,create:bI.contract,update:mI.contract,delete:pI.contract}});var wI,Tge,Oge,Age,Cge,Dge,zge,fI,_ge,jge,kI,Nge,xge,vI,Rge,Uge,SI,Mge,Kge,PI,GXe;var zB=g(()=>{be();Le();wI=a.enum(["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"]),Tge=a.enum(["needs-onboarding","blocked","ready"]),Oge=a.enum(["incomplete","complete","skipped"]),Age=a.object({invitationId:a.string(),organizationId:a.string(),organizationName:a.string(),organizationSlug:a.string(),organizationImageUrl:a.string().nullable(),inviterName:a.string().nullable()}),Cge=a.object({gate:Tge,canonicalStep:wI.nullable(),organizationId:a.string().nullable(),projectId:a.string().nullable(),completionByStep:a.record(wI,Oge),githubSkipped:a.boolean(),githubAppSkipped:a.boolean(),slackSkipped:a.boolean(),sampleIssueId:a.string().nullable(),actorRole:a.enum(["admin","member"]).nullable(),requiredStep:a.union([wI,a.literal("select-organization")]).nullable(),isCompleted:a.boolean(),onboardingRecommendationsThreadId:a.string().nullable(),hasOrganizations:a.boolean(),hasPaidBillingSubscription:a.boolean(),billingStepEnabled:a.boolean(),pendingInvitations:a.array(Age)}),Dge=a.object({}),zge=a.object({onboarding:Cge}),fI=P({operationId:"onboarding.getState",description:"Read onboarding progress for the authenticated user.",backend:"api",route:{method:"GET",path:"/onboarding/state",tags:["Onboarding"]},input:Dge,output:zge,pagination:"none",async:"sync"}),_ge=a.object({integration:a.enum(["github","slack"]).describe("Integration onboarding step to skip.")}),jge=a.object({skipped:a.literal(!0)}),kI=P({operationId:"onboarding.skipIntegration",description:"Skip a GitHub or Slack integration step during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-integration",tags:["Onboarding"]},input:_ge,output:jge,pagination:"none",async:"sync"}),Nge=a.object({}),xge=a.object({skipped:a.literal(!0)}),vI=P({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:Nge,output:xge,pagination:"none",async:"sync"}),Rge=a.object({}),Uge=a.object({skipped:a.literal(!0)}),SI=P({operationId:"onboarding.skipSampleIssue",summary:"Skip Test Issue",description:"Skip the optional test issue during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-sample-issue",tags:["Onboarding"]},input:Rge,output:Uge,pagination:"none",async:"sync"}),Mge=a.object({projectId:a.string().uuid().describe("Project that completed onboarding.")}),Kge=a.object({completed:a.boolean()}),PI=P({operationId:"onboarding.finish",description:"Mark onboarding complete when all prerequisites are satisfied.",backend:"api",route:{method:"POST",path:"/onboarding/finish",tags:["Onboarding"]},input:Mge,output:Kge,pagination:"none",async:"sync"}),GXe={getState:fI.contract,skipIntegration:kI.contract,skipGithubAppInstallation:vI.contract,skipSampleIssue:SI.contract,finish:PI.contract}});var Ng,Ege,qge,Gge,Jge,Hge,Bge,Wge,Zge,Fge,Xge,$I,II,LI,TI,ZXe;var _B=g(()=>{be();Le();Og();Ng=a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional()}),Ege=Ng.extend({role:$i.optional()}),qge=a.object({}),Gge=a.object({organizations:a.array(Ege).describe("Organizations available to the current credential.")}),Jge=a.object({organizationId:a.string().min(1).describe("Organization ID to fetch.")}),Hge=a.object({organization:Ng}),Bge=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.")}),Wge=a.object({organization:Ng.describe("Updated organization.")}),Zge=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"),Fge=a.object({name:Zge.describe("Organization display name.")}),Xge=a.object({organization:Ng}),$I=P({operationId:"organizations.create",description:"Create an organization for the authenticated user.",backend:"api",route:{method:"POST",path:"/organizations",tags:["Organizations"],successStatus:201},input:Fge,output:Xge,pagination:"none",async:"sync"}),II=P({operationId:"organizations.list",description:"List organizations available to the current credential.",backend:"api",route:{method:"GET",path:"/organizations",tags:["Organizations"]},input:qge,output:Gge,pagination:"none",async:"sync"}),LI=P({operationId:"organizations.get",description:"Get one organization by ID.",backend:"api",route:{method:"GET",path:"/organizations/{organizationId}",tags:["Organizations"]},input:Jge,output:Hge,pagination:"none",async:"sync"}),TI=P({operationId:"organizations.update",description:"Update one organization.",backend:"api",route:{method:"PATCH",path:"/organizations/{organizationId}",tags:["Organizations"]},input:Bge,output:Wge,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}}}]}),ZXe={list:II.contract,get:LI.contract,create:$I.contract,update:TI.contract}});var Di,Yc,jB,NB,xB,RB,UB,MB,KB,xg,Rg,Ug,EB,qB,Mg,GB,JB,Kg,Yge;var OI=g(()=>{be();Le();Di=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"]),Yc=a.object({id:a.string().uuid(),organizationId:a.string().min(1),name:a.string(),region:Di}),jB=a.object({organizationId:a.string().min(1).optional().describe("Organization to list projects for. Auto-filled from CLI and SDK context when omitted.")}),NB=a.object({projects:a.array(Yc).describe("Projects visible within the selected organization.")}),xB=a.object({projectId:a.string().uuid().describe("Project ID to fetch.")}),RB=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"),UB=a.object({organizationId:a.string().min(1).optional().describe("Organization to create the project under. Auto-filled from CLI and SDK context when omitted."),name:RB.describe("Project name."),region:Di.optional().default("us-west-2").describe("AWS region where the new project should be created.")}),MB=a.object({project:Yc}),KB=a.object({project:Yc}),xg=P({operationId:"projects.list",description:"List projects in an organization.",backend:"api",route:{method:"GET",path:"/projects",tags:["Projects"]},input:jB,output:NB,pagination:"none",async:"sync"}),Rg=P({operationId:"projects.get",description:"Get one project by ID.",backend:"api",route:{method:"GET",path:"/projects/{projectId}",tags:["Projects"]},input:xB,output:KB,pagination:"none",async:"sync"}),Ug=P({operationId:"projects.create",description:"Create one project in an organization.",backend:"api",route:{method:"POST",path:"/projects",successStatus:201,tags:["Projects"]},input:UB,output:MB,pagination:"none",async:"sync"}),EB=a.object({projectId:a.string().uuid().describe("Project ID to update."),name:RB.optional().describe("New project name.")}),qB=a.object({project:Yc}),Mg=P({operationId:"projects.update",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:EB,output:qB,pagination:"none",async:"sync"}),GB=a.object({projectId:a.string().uuid().describe("Project ID to delete.")}),JB=a.void(),Kg=P({operationId:"projects.delete",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:GB,output:JB,pagination:"none",async:"sync"}),Yge={list:xg.contract,get:Rg.contract,create:Ug.contract,update:Mg.contract,delete:Kg.contract}});var HB,Qge,Vge,ede,tde,nde,AI,tYe;var BB=g(()=>{be();Le();HB=a.enum(["open","merged","closed"]),Qge=a.enum(["review_required","approved","changes_requested"]),Vge=a.enum(["passing","failing","pending"]),ede=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:HB.nullable(),reviewState:Qge.nullable(),checksState:Vge.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()}),tde=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:HB.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.")}),nde=a.object({pullRequests:a.array(ede),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),AI=P({operationId:"pullRequests.list",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:tde,output:nde,pagination:"cursor",async:"sync"}),tYe={list:AI.contract}});var WB,ZB,FB,XB,YB,Qc;var CI=g(()=>{be();Le();WB=a.enum(["data_source","mcp_connector","sandbox_cli","integration"]),ZB=a.enum(["connected","recommended"]),FB=a.object({kind:WB.describe("What the recommendation targets: a data source, MCP connector, sandbox CLI, or integration."),targetId:a.string().describe("Exact catalog id for the kind (data source type, MCP provider id, sandbox CLI preset type, or integration provider id)."),status:ZB.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.")}),XB=a.object({projectId:a.string().uuid().optional().describe("Project to list recommendations for. Auto-filled from CLI and SDK context when omitted.")}),YB=a.object({recommendations:a.array(FB).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).")}),Qc=P({operationId:"recommendations.list",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:XB,output:YB,pagination:"none",async:"sync"})});var QB,ode,VB,Eg,eW,tW,nW,oW,zi,rW,iW,aW,qg,rde;var DI=g(()=>{be();Le();QB=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.")}),ode=a.object({}),VB=a.object({types:a.array(QB)}),Eg=P({operationId:"sandboxPresets.listTypes",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:ode,output:VB,pagination:"none",async:"sync"}),eW=a.enum(["github_app","personal_access_token","stored_credentials"]),tW=a.object({presetType:a.string().describe("Preset type identifier."),credentialSource:eW.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.")}),nW=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.")}),oW=a.object({connections:a.array(tW)}),zi=P({operationId:"sandboxPresets.listConnections",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:nW,output:oW,pagination:"none",async:"sync"}),rW=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.")}),iW=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(rW).max(100).describe("Full set of env vars for this preset. Replaces any previously stored values for the preset.")}),aW=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.")}),qg=P({operationId:"sandboxPresets.upsertPreset",summary:"Upsert CLI Connection",description:"Set or replace a project's sandbox CLI connection environment variables (e.g. the kubectl CLI's KUBECONFIG_CONTENTS). Values are encrypted server-side and never returned. Requires a secret key scoped to the target project's organization.",backend:"api",route:{method:"POST",path:"/sandbox-presets/config",successStatus:200,tags:["Sandbox Presets"]},input:iW,output:aW,pagination:"none",async:"sync"}),rde={listConnections:zi.contract,listTypes:Eg.contract,upsertPreset:qg.contract}});var Gg,cW=1048576,zI,sW,_I,ide,ade,cde,sde,hde,lde,ude,gde,dde,yde,jI,NI,xI,RI,UI,uYe;var hW=g(()=>{be();Le();Gg=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."),zI=a.string().min(1).refine((e)=>new TextEncoder().encode(e).length<=cW,{message:`Script content must be at most ${cW} bytes (1 MiB).`}).describe("Bash script body materialized as /home/sazabi/scripts/<name>.sh in the sandbox."),sW=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()}),_I=sW.extend({content:zI}),ide=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.")}),ade=a.object({scripts:a.array(sW),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),cde=a.object({name:Gg.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.")}),sde=a.object({script:_I}),hde=a.object({projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted."),name:Gg.describe("Script name. Must be unique within the project among non-deleted scripts."),content:zI,description:a.string().max(500).nullable().optional().describe("Optional human-readable description.")}),lde=a.object({script:_I}),ude=a.object({name:Gg.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:zI.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.")}),gde=a.object({script:_I}),dde=a.object({name:Gg.describe("Script to delete."),projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted.")}),yde=a.object({deleted:a.boolean()}),jI=P({operationId:"scripts.list",description:"List durable bash scripts stored for a project.",backend:"api",route:{method:"GET",path:"/scripts",tags:["Scripts"]},input:ide,output:ade,pagination:"cursor",async:"sync"}),NI=P({operationId:"scripts.get",description:"Get a single project script by name, including its body.",backend:"api",route:{method:"GET",path:"/scripts/{name}",tags:["Scripts"]},input:cde,output:sde,pagination:"none",async:"sync"}),xI=P({operationId:"scripts.create",description:"Create a durable bash script for a project.",backend:"api",route:{method:"POST",path:"/scripts",successStatus:201,tags:["Scripts"]},input:hde,output:lde,pagination:"none",async:"sync"}),RI=P({operationId:"scripts.update",description:"Update a project script's body and/or description.",backend:"api",route:{method:"PATCH",path:"/scripts/{name}",tags:["Scripts"]},input:ude,output:gde,pagination:"none",async:"sync"}),UI=P({operationId:"scripts.delete",description:"Soft-delete a project script by name.",backend:"api",route:{method:"DELETE",path:"/scripts/{name}",successStatus:204,tags:["Scripts"]},input:dde,output:yde,pagination:"none",async:"sync"}),uYe={list:jI.contract,get:NI.contract,create:xI.contract,update:RI.contract,delete:UI.contract}});var MI,lW,uW,gW,dW,_i,ji,bde;var KI=g(()=>{be();Le();MI=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.")}),lW=MI.extend({status:a.enum(["regular","archived"]).optional().describe("Optional thread status filter.")}),uW=MI.extend({threadId:a.string().uuid().optional().describe("Optional thread restriction for message search."),role:a.enum(["user","assistant"]).optional().describe("Optional message role filter.")}),gW=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.")}),dW=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.")}),_i=P({operationId:"search.threads",description:"Search threads within one project.",backend:"api",route:{method:"GET",path:"/search/threads",tags:["Search"]},input:lW,output:gW,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}}}]}),ji=P({operationId:"search.messages",description:"Search messages within one project.",backend:"api",route:{method:"GET",path:"/search/messages",tags:["Search"]},input:uW,output:dW,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}}}]}),bde={threads:_i.contract,messages:ji.contract}});var es,bW,mW,pW,wW,fW,kW,vW,SW,PW,mde,JI,$W,Jg,Hg,Ni,Bg,Wg,IW,LW,Zg,TW,OW,xi,EI,pde,AW,CW,DW,wde,zW,_W,jW,HI,NW,xW,RW,Fg,Xg,Yg,Qg,ts,UW,qI,MW,ns,BI,KW,EW,fde,kde,WI,qW,GW,JW,HW,BW,WW,ZW,ZI,Vg,ed,td,nd,FI,FW,GI,Vc,XI,vde,od,XW,YW,QW,VW,yW,eZ,tZ,nZ,rd,id,oZ,YI,rZ,iZ,aZ,cZ,sZ,ad,cd,Sde;var QI=g(()=>{be();Le();es=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),description:a.string().nullable(),origin:a.enum(["user_declared","code_detected","log_observed"]),lifecycle:a.enum(["active","retired","merged"]),observationState:a.enum(["observed","stale","unobserved"]),registryRevision:a.number().int().nonnegative(),canonicalComponentId:a.string().uuid(),mergedIntoComponentId:a.string().uuid().nullable(),currentStatus:a.enum(["operational","degraded","outage"]).describe("Current health status of this component."),firstSeenAt:a.string().datetime(),lastSeenAt:a.string().datetime(),deletedAt:a.string().datetime().nullable().describe("Timestamp when this component was retired, if any."),retiredAt:a.string().datetime().nullable(),retirementReason:a.string().nullable(),legacyStateUnknown:a.boolean().describe("True only for migration-era inactive rows whose retirement authority is unknown.")}),bW=a.object({projectId:a.string().uuid().optional().describe("Project to list status components 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 components to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),includeDeleted:a.union([a.boolean(),a.stringbool()]).default(!1).describe("When true, include retired and merged components.")}),mW=a.object({statusComponents:a.array(es),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),pW=a.object({componentId:a.string().uuid().describe("Status component ID to retrieve.")}),wW=a.object({statusComponent:es}),fW=a.object({projectId:a.string().uuid().optional().describe("Project to register the status component in. Auto-filled from CLI and SDK context when omitted."),name:a.string().trim().min(1,"Name is required").describe("Evidence-backed component name to register."),description:a.string().trim().min(1,"Description cannot be empty").optional().describe("Optional component description."),requestId:a.string().uuid().optional().describe("Project-scoped idempotency key. Reuse only for an identical registration request.")}),kW=a.object({statusComponent:es}),vW=a.object({componentId:a.string().uuid().describe("Active component ID to rename."),name:a.string().trim().min(1,"Name is required"),requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact rename."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for renaming the component.")}),SW=a.object({statusComponent:es}),PW=a.object({componentId:a.string().uuid().describe("Status component ID to deregister."),reason:a.string().trim().min(1,"Reason cannot be empty").optional().describe("Optional reason for audit logging.")}),mde=a.object({openIssueIds:a.array(a.string().uuid()),activeComponentIssueIds:a.array(a.string().uuid()),automationBindingIds:a.array(a.string().uuid()),notificationRuleIds:a.array(a.string().uuid()),dataSourceMappingIds:a.array(a.string().uuid()),observationIds:a.array(a.string().uuid()),relationshipIds:a.array(a.string().uuid()),recommendationScopeIds:a.array(a.string().uuid()),externalIncidentIds:a.array(a.string().uuid()),authorizedDeliveryIds:a.array(a.string().uuid()),authorizedAutomationRunIds:a.array(a.string().uuid())}),JI=a.object({requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),canonicalComponentName:a.string(),lifecycle:a.enum(["active","retired"]),affectedComponentIds:a.array(a.string().uuid()),componentRevisions:a.record(a.string().uuid(),a.number().int().nonnegative()),requiresCanonicalGroupConfirmation:a.boolean(),recommendationScopeEnabled:a.literal(!1),dependents:mde,counts:a.record(a.string(),a.number().int().nonnegative())}),$W=a.discriminatedUnion("status",[a.object({status:a.literal("observation_withdrawn"),componentId:a.string().uuid(),sourceType:a.literal("secret_key"),withdrawn:a.boolean()}),a.object({status:a.literal("retirement_confirmation_required"),preview:JI})]),Jg=P({operationId:"statusComponents.list",description:"List status page components in a project.",backend:"api",route:{method:"GET",path:"/status-components",tags:["Status Components"]},input:bW,output:mW,pagination:"cursor",async:"sync"}),Hg=P({operationId:"statusComponents.get",description:"Get a single status component by ID.",backend:"api",route:{method:"GET",path:"/status-components/{componentId}",tags:["Status Components"]},input:pW,output:wW,pagination:"none",async:"sync"}),Ni=P({operationId:"statusComponents.register",description:"Register a status page component in a project, or refresh an existing active component with the same name.",backend:"api",route:{method:"POST",path:"/status-components",tags:["Status Components"]},input:fW,output:kW,pagination:"none",async:"sync"}),Bg=P({operationId:"statusComponents.deregister",description:"Withdraw this credential's component observation, or return a retirement preview for a human caller.",backend:"api",route:{method:"POST",path:"/status-components/{componentId}/deregister",tags:["Status Components"]},input:PW,output:$W,pagination:"none",async:"sync"}),Wg=P({operationId:"statusComponents.rename",description:"Rename an active component while reserving its previous exact name as an alias.",backend:"api",route:{method:"POST",path:"/status-components/{componentId}/rename",tags:["Status Components"]},input:vW,output:SW,pagination:"none",async:"sync"}),IW=a.object({componentId:a.string().uuid().describe("Component whose owning team to set."),teamId:a.string().uuid().nullable().describe("Team to assign as owner, or null to unassign.")}),LW=a.object({componentId:a.string().uuid().describe("Component that was updated."),teamId:a.string().uuid().nullable().describe("Owning team after the update, or null when unassigned.")}),Zg=P({operationId:"statusComponents.assignTeam",description:"Assign a component to an owning team, reassign it, or unassign it. A component is owned by at most one team.",backend:"api",route:{method:"PUT",path:"/status-components/{componentId}/team",tags:["Status Components"]},input:IW,output:LW,pagination:"none",async:"sync"}),TW=a.object({componentId:a.string().uuid().describe("Component or merged-source ID whose canonical group to retire.")}),OW=a.object({preview:JI}),xi=a.record(a.string().uuid(),a.number().int().nonnegative()),EI=a.object({id:a.string().uuid(),rowRevision:a.number().int().nonnegative()}),pde=a.object({notificationRules:a.array(EI),automationBindings:a.array(EI),relationships:a.array(EI)}),AW=a.object({componentId:a.string().uuid().describe("Component or merged-source ID confirmed by the preview."),requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact retirement."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for retiring the component."),componentRevisions:xi.describe("Exact canonical-group revisions returned by retirementPreview."),confirmCanonicalGroup:a.boolean().default(!1).describe("Explicitly confirm retiring the complete canonical group when the request used a merged source.")}),CW=a.object({operationId:a.string().uuid(),status:a.enum(["committed","complete","followup_failed"]),requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),affectedComponentIds:a.array(a.string().uuid()),counts:a.record(a.string(),a.number().int().nonnegative()),authorizedDeliveryIds:a.array(a.string().uuid()),authorizedAutomationRunIds:a.array(a.string().uuid()),manualExternalIncidentIds:a.array(a.string().uuid()),issueAutomationSuppressions:a.number().int().nonnegative(),outboxEffectCount:a.number().int().nonnegative(),manifest:pde,followups:a.record(a.string(),a.unknown()).optional()}),DW=a.object({result:CW}),wde=a.object({notificationRuleIds:a.array(a.string().uuid()),automationBindingIds:a.array(a.string().uuid()),recommendationScopeIds:a.array(a.string().uuid()),relationshipIds:a.array(a.string().uuid())}),zW=a.object({componentId:a.string().uuid().describe("Retired component or merged-source ID to inspect."),retirementOperationId:a.string().uuid().optional().describe("Optional retirement operation to verify; defaults to the component's current retirement.")}),_W=a.object({requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),canonicalComponentName:a.string(),retirementOperationId:a.string().uuid(),affectedComponentIds:a.array(a.string().uuid()),componentRevisions:xi,eligible:wde}),jW=a.object({preview:_W}),HI=a.object({notificationRuleIds:a.array(a.string().uuid()).default([]),automationBindingIds:a.array(a.string().uuid()).default([]),recommendationScopeIds:a.array(a.string().uuid()).default([]),relationshipIds:a.array(a.string().uuid()).default([])}),NW=a.object({componentId:a.string().uuid().describe("Retired component or merged-source ID confirmed by preview."),retirementOperationId:a.string().uuid().describe("Retirement operation whose unchanged dependents may be restored."),requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact restoration."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for restoring the component."),componentRevisions:xi.describe("Exact canonical-group revisions returned by restorationPreview."),selections:HI.default({notificationRuleIds:[],automationBindingIds:[],recommendationScopeIds:[],relationshipIds:[]}).describe("Only these still-eligible dependents are restored; omitted selections restore none.")}),xW=a.object({operationId:a.string().uuid(),status:a.literal("complete"),requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),affectedComponentIds:a.array(a.string().uuid()),restored:HI}),RW=a.object({result:xW}),Fg=P({operationId:"statusComponents.retirementPreview",description:"Preview every synchronous and follow-up consequence of retiring a canonical component group.",backend:"api",route:{method:"POST",path:"/status-components/{componentId}/retirement/preview",tags:["Status Components"]},input:TW,output:OW,pagination:"none",async:"sync"}),Xg=P({operationId:"statusComponents.retire",description:"Atomically retire a confirmed canonical component group and durably enqueue lifecycle follow-ups.",backend:"api",route:{method:"POST",path:"/status-components/{componentId}/retire",tags:["Status Components"]},input:AW,output:DW,pagination:"none",async:"sync"}),Yg=P({operationId:"statusComponents.restorationPreview",description:"Preview unchanged retirement-owned dependents that remain eligible for explicit restoration.",backend:"api",route:{method:"POST",path:"/status-components/{componentId}/restoration/preview",tags:["Status Components"]},input:zW,output:jW,pagination:"none",async:"sync"}),Qg=P({operationId:"statusComponents.restore",description:"Restore a retired canonical component and only the explicitly selected eligible dependents.",backend:"api",route:{method:"POST",path:"/status-components/{componentId}/restore",tags:["Status Components"]},input:NW,output:RW,pagination:"none",async:"sync"}),ts=a.enum(["part_of","depends_on"]).describe("Relationship semantics: part_of is an acyclic child-to-parent edge; depends_on may be cyclic."),UW=a.enum(["observed","stale","unobserved"]),qI=a.object({originalComponentId:a.string().uuid(),effectiveComponentId:a.string().uuid(),name:a.string(),lifecycle:a.enum(["active","retired","merged"]),observationState:UW}),MW=a.object({id:a.string().uuid(),source:qI,target:qI,relationshipType:ts,createdAt:a.string().datetime(),endedAt:a.string().datetime().nullable(),endReason:a.string().nullable(),rowRevision:a.number().int().nonnegative()}),ns=a.object({projectId:a.string().uuid().optional().describe("Project containing the component topology. Auto-filled from CLI and SDK context when omitted.")}),BI=a.object({sourceComponentId:a.string().uuid().describe("Child or dependency-source component ID."),targetComponentId:a.string().uuid().describe("Parent or dependency-target component ID."),relationshipType:ts}),KW=ns.extend({includeHistorical:a.union([a.boolean(),a.stringbool()]).default(!1).describe("Include historically ended relationships.")}),EW=a.object({relationships:a.array(MW)}),fde=a.object({ruleId:a.string().uuid(),ruleGroupId:a.string().uuid().nullable(),ownerComponentId:a.string().uuid(),destinationIds:a.array(a.string().uuid()),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),kde=a.object({bindingId:a.string().uuid(),automationId:a.string().uuid(),ownerComponentId:a.string().uuid(),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),WI=a.object({notificationRules:a.array(fde),automationBindings:a.array(kde)}),qW=BI.extend({action:a.enum(["add","remove"]),organizationId:a.string(),projectId:a.string().uuid(),relationshipId:a.string().uuid().nullable(),componentRevisions:a.record(a.string().uuid(),a.number().int().nonnegative()),policyImpact:WI,confirmationRequired:a.boolean()}),GW=ns.merge(BI).extend({action:a.enum(["add","remove"]).describe("Topology mutation to preview without changing the graph.")}),JW=a.object({preview:qW}),HW=ns.merge(BI).extend({requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact mutation."),reason:a.string().trim().min(1,"Reason cannot be empty"),componentRevisions:a.record(a.string().uuid(),a.number().int().nonnegative()),confirmPolicyImpact:a.boolean().default(!1).describe("Confirm the descendant-scoped notification and automation changes shown by preview.")}),BW=HW,WW=HW,ZW=a.object({action:a.enum(["add","remove"]),relationshipId:a.string().uuid(),sourceComponentId:a.string().uuid(),targetComponentId:a.string().uuid(),relationshipType:ts,policyImpact:WI}),ZI=a.object({result:ZW}),Vg=P({operationId:"statusComponents.relationships.list",description:"List active or historical component topology edges.",backend:"api",route:{method:"GET",path:"/status-components/relationships",tags:["Status Components"]},input:KW,output:EW,pagination:"none",async:"sync"}),ed=P({operationId:"statusComponents.relationships.preview",description:"Preview descendant-scoped notification and automation impact for a topology change.",backend:"api",route:{method:"POST",path:"/status-components/relationships/preview",tags:["Status Components"]},input:GW,output:JW,pagination:"none",async:"sync"}),td=P({operationId:"statusComponents.relationships.add",description:"Add a confirmed, tenant-safe component topology edge.",backend:"api",route:{method:"POST",path:"/status-components/relationships",tags:["Status Components"]},input:BW,output:ZI,pagination:"none",async:"sync"}),nd=P({operationId:"statusComponents.relationships.remove",description:"Historically end a confirmed component topology edge.",backend:"api",route:{method:"POST",path:"/status-components/relationships/remove",tags:["Status Components"]},input:WW,output:ZI,pagination:"none",async:"sync"}),FI=a.enum(["suspend","move"]),FW=a.object({disposition:FI,beforeComponentIds:a.array(a.string().uuid()).describe("Exact effective component set returned by mergePreview."),afterComponentIds:a.array(a.string().uuid()).describe("Exact effective component set that ownership would have on the target.")}),GI=a.object({kind:a.enum(["notification_rule","automation_binding"]),policyId:a.string().uuid(),sourceRowRevision:a.number().int().nonnegative(),sourceComponentId:a.string().uuid(),equivalentPolicyId:a.string().uuid().nullable(),equivalent:a.boolean(),defaultDisposition:a.enum(["deduplicate","suspend"]),allowedDispositions:a.array(FI),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),Vc=a.object({kind:a.enum(["notification_rule","automation_binding"]),policyId:a.string().uuid(),ownerComponentId:a.string().uuid(),rowRevision:a.number().int().nonnegative(),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),XI=a.object({relationshipId:a.string().uuid(),action:a.enum(["rewire","close_self","close_duplicate"]),relationshipType:ts,beforeSourceComponentId:a.string().uuid(),beforeTargetComponentId:a.string().uuid(),afterSourceComponentId:a.string().uuid(),afterTargetComponentId:a.string().uuid(),survivingRelationshipId:a.string().uuid().nullable(),beforeRowRevision:a.number().int().nonnegative(),afterRowRevision:a.number().int().nonnegative().nullable()}),vde=a.object({openIssueIds:a.array(a.string().uuid()),componentIssueIds:a.array(a.string().uuid()),observationIds:a.array(a.string().uuid()),dataSourceMappingIds:a.array(a.string().uuid()),nameIds:a.array(a.string().uuid()),relationshipIds:a.array(a.string().uuid()),recommendationScopeIds:a.array(a.string().uuid())}),od=a.object({sourceComponentId:a.string().uuid().describe("Active or retired component whose independent grain is removed."),targetComponentId:a.string().uuid().describe("Active terminal component that becomes the canonical target.")}),XW=ns.merge(od),YW=od.extend({organizationId:a.string(),projectId:a.string().uuid(),sourceGroupComponentIds:a.array(a.string().uuid()),targetGroupComponentIds:a.array(a.string().uuid()),affectedComponentIds:a.array(a.string().uuid()),componentRevisions:xi,inventory:vde,notificationPolicies:a.array(GI),automationBindings:a.array(GI),notificationScopeChanges:a.array(Vc),automationScopeChanges:a.array(Vc),relationshipChanges:a.array(XI),recommendationScopeEnabled:a.literal(!1),dependentCount:a.number().int().nonnegative(),ordinaryTransactionLimit:a.number().int().positive(),operatorAssistanceRequired:a.boolean(),confirmationRequired:a.boolean()}),QW=a.object({preview:YW}),VW=ns.merge(od).extend({requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact consolidation."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for consolidation."),componentRevisions:xi.describe("Exact canonical-group revisions returned by mergePreview."),policyDispositions:a.record(a.string().uuid(),FW).describe("Exactly one disposition for every non-equivalent source policy; each repeats the previewed effective sets."),confirmPolicyImpact:a.boolean().default(!1).describe("Explicitly acknowledge every before/after policy scope change shown by mergePreview.")}),yW=a.object({policyId:a.string().uuid(),action:a.enum(["deduplicated","suspended","moved"]),equivalentPolicyId:a.string().uuid().nullable(),beforeRowRevision:a.number().int().nonnegative(),afterRowRevision:a.number().int().nonnegative(),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),eZ=a.object({componentRevisions:xi,redirectedComponentIds:a.array(a.string().uuid()),dataSourceMappingIds:a.array(a.string().uuid()),movedAliasIds:a.array(a.string().uuid()),historicalDisplayIds:a.array(a.string().uuid()),relationshipChanges:a.array(XI),notificationPolicies:a.array(yW),automationBindings:a.array(yW),notificationScopeChanges:a.array(Vc),automationScopeChanges:a.array(Vc),recommendationScopeIds:a.array(a.string().uuid())}),tZ=od.extend({operationId:a.string().uuid(),status:a.literal("complete"),affectedComponentIds:a.array(a.string().uuid()),manifest:eZ}),nZ=a.object({result:tZ}),rd=P({operationId:"statusComponents.mergePreview",description:"Preview one-hop redirects, historical preservation, operational rebinding, topology contraction, and policy dispositions for component consolidation.",backend:"api",route:{method:"POST",path:"/status-components/merge/preview",tags:["Status Components"]},input:XW,output:QW,pagination:"none",async:"sync"}),id=P({operationId:"statusComponents.merge",description:"Consolidate a source into an active terminal target without rewriting historical issue or observation attribution.",backend:"api",route:{method:"POST",path:"/status-components/merge",tags:["Status Components"]},input:VW,output:nZ,pagination:"none",async:"sync"}),oZ=a.enum(["degraded","outage"]).describe("Severity of a status-page incident. 'outage' marks the component down; 'degraded' marks partial impact."),YI=a.object({id:a.string().uuid(),componentId:a.string().uuid(),projectId:a.string().uuid(),severity:oZ,summary:a.string().describe("Human-readable summary of the status-page issue."),startedAt:a.string().datetime().describe("When the incident began affecting the component."),resolvedAt:a.string().datetime().nullable().describe("When the incident was resolved, or null while ongoing.")}),rZ=a.object({projectId:a.string().uuid().optional().describe("Project to list status-page issues for. Auto-filled from CLI and SDK context when omitted."),componentId:a.string().uuid().optional().describe("Restrict results to a single component."),activeOnly:a.union([a.boolean(),a.stringbool()]).default(!1).describe("When true, return only unresolved (ongoing) issues."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),iZ=a.object({incidents:a.array(YI),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),aZ=a.object({timestamp:a.string().datetime(),status:a.enum(["operational","degraded","outage","unknown"]).describe("Worst component status observed during this timeline bucket.")}),cZ=a.object({componentId:a.string().uuid().describe("Status component to build the timeline for."),windowStart:a.string().datetime({offset:!0}).optional().describe("Start of the timeline window. Defaults to 7 days before windowEnd."),windowEnd:a.string().datetime({offset:!0}).optional().describe("End of the timeline window. Defaults to now.")}),sZ=a.object({componentId:a.string().uuid(),windowStart:a.string().datetime(),windowEnd:a.string().datetime(),timeline:a.array(aZ),incidents:a.array(YI)}),ad=P({operationId:"statusComponents.incidents.list",description:"List status-page issues in a project.",backend:"api",route:{method:"GET",path:"/status-incidents",tags:["Status Components"]},input:rZ,output:iZ,pagination:"cursor",async:"sync"}),cd=P({operationId:"statusComponents.timeline",description:"Get the dense status timeline and incidents for a component over a time window.",backend:"api",route:{method:"GET",path:"/status-components/{componentId}/timeline",tags:["Status Components"]},input:cZ,output:sZ,pagination:"none",async:"sync"}),Sde={list:Jg.contract,get:Hg.contract,register:Ni.contract,deregister:Bg.contract,rename:Wg.contract,assignTeam:Zg.contract,retirementPreview:Fg.contract,retire:Xg.contract,restorationPreview:Yg.contract,restore:Qg.contract,mergePreview:rd.contract,merge:id.contract,relationships:{list:Vg.contract,preview:ed.contract,add:td.contract,remove:nd.contract},incidents:{list:ad.contract},timeline:cd.contract}});var hZ;var lZ=g(()=>{hZ=["onboarding","setup"]});var uZ,gZ,dZ,yZ,os;var VI=g(()=>{lZ();be();Le();uZ=a.enum(hZ),gZ=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:uZ.describe("Task category: onboarding (core setup steps) or setup (additional configuration).")}),dZ=a.object({projectId:a.string().uuid().optional().describe("Project to list tasks for. Auto-filled from CLI and SDK context when omitted.")}),yZ=a.object({tasks:a.array(gZ).describe("All onboarding and setup tasks with their current completion status.")}),os=P({operationId:"tasks.list",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:dZ,output:yZ,pagination:"none",async:"sync"})});var Pde,$de,Yo,Ide,Lde,Tde,Ode,Ade,Cde,Dde,zde,_de,jde,Nde,xde,Rde,Ude,eL,tL,nL,oL,rL,iL,aL,LYe;var bZ=g(()=>{be();Le();Pde=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.")}),$de=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.")}),Yo=a.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted."),Ide=a.object({organizationId:Yo}),Lde=a.object({teams:a.array(Pde).describe("Active teams in the organization.")}),Tde=a.object({organizationId:Yo,name:a.string().trim().min(1).describe("Team name."),description:a.string().trim().min(1).optional().describe("Optional team description.")}),Ode=a.object({id:a.string().uuid().describe("ID of the created team.")}),Ade=a.object({organizationId:Yo,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.")}),Cde=a.object({id:a.string().uuid().describe("ID of the updated team.")}),Dde=a.object({params:a.object({teamId:a.string().uuid().describe("Team to delete.")}),query:a.object({organizationId:Yo})}).transform(({params:e,query:t})=>({...t,...e})),zde=a.object({success:a.literal(!0).describe("The team and its memberships were removed.")}),_de=a.object({organizationId:Yo,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.")}),jde=a.object({id:a.string().uuid().describe("ID of the team membership.")}),Nde=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:Yo})}).transform(({params:e,query:t})=>({...t,...e})),xde=a.object({success:a.literal(!0).describe("The membership was removed.")}),Rde=a.object({organizationId:Yo,teamId:a.string().uuid().describe("Team to list members for.")}),Ude=a.object({members:a.array($de).describe("Active members of the team.")}),eL=P({operationId:"teams.list",description:"List teams in an organization.",backend:"api",route:{method:"GET",path:"/teams",tags:["Teams"]},input:Ide,output:Lde,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}]}}]}),tL=P({operationId:"teams.create",description:"Create a team in an organization.",backend:"api",route:{method:"POST",path:"/teams",tags:["Teams"],successStatus:201},input:Tde,output:Ode,pagination:"none",async:"sync"}),nL=P({operationId:"teams.update",description:"Rename a team or update its description.",backend:"api",route:{method:"PATCH",path:"/teams/{teamId}",tags:["Teams"]},input:Ade,output:Cde,pagination:"none",async:"sync"}),oL=P({operationId:"teams.delete",description:"Delete a team, its memberships, and its component-ownership assignments.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}",tags:["Teams"],inputStructure:"detailed"},input:Dde,output:zde,pagination:"none",async:"sync"}),rL=P({operationId:"teams.addMember",description:"Add an active organization member to a team.",backend:"api",route:{method:"POST",path:"/teams/{teamId}/members",tags:["Teams"],successStatus:201},input:_de,output:jde,pagination:"none",async:"sync"}),iL=P({operationId:"teams.removeMember",description:"Remove a member from a team.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}/members/{userId}",tags:["Teams"],inputStructure:"detailed"},input:Nde,output:xde,pagination:"none",async:"sync"}),aL=P({operationId:"teams.listMembers",description:"List a team's active members.",backend:"api",route:{method:"GET",path:"/teams/{teamId}/members",tags:["Teams"]},input:Rde,output:Ude,pagination:"none",async:"sync"}),LYe={list:eL.contract,create:tL.contract,update:nL.contract,delete:oL.contract,addMember:rL.contract,removeMember:iL.contract,listMembers:aL.contract}});var cL;var mZ=g(()=>{oD();iD();lD();qk();Hk();FD();dS();mS();wS();O$();Og();TH();R$();VH();LB();DB();zB();_B();OI();BB();CI();Dg();DI();hW();KI();QI();VI();bZ();eI();cL={me:A$.contract,automations:{list:Tk.contract,get:Ok.contract,create:Ak.contract,update:Ck.contract,enable:Dk.contract,disable:zk.contract,runs:{list:_k.contract,get:jk.contract,logs:Nk.contract}},logs:{query:Qr.contract,schema:Vr.contract,volume:ei.contract,patterns:ti.contract,nativeQuery:ni.contract,searchNatural:su.contract},dataSources:{listTypes:Gl.contract,listInstances:Zr.contract,createInstance:Fr.contract,getInstance:Jl.contract,updateInstance:Hl.contract,deleteInstance:Bl.contract,listStreams:Wl.contract,createStream:Zl.contract,getStream:Fl.contract,updateStream:Xl.contract,deleteStream:Yl.contract},logSources:{listProviders:Vl.contract,list:Xr.contract,create:Yr.contract,get:eu.contract,update:tu.contract,delete:nu.contract,listStreams:ou.contract,createStream:ru.contract,getStream:iu.contract,updateStream:au.contract,deleteStream:cu.contract},integrations:{listProviders:cD.contract,listConnections:sD.contract,getConnection:hD.contract},notificationChannels:{getProject:aI.contract},notificationDeliveryRules:{list:dI.contract,options:yI.contract,create:bI.contract,update:mI.contract,delete:pI.contract},mcpConnectors:{listProviders:Tg.contract,list:vi.contract,get:Si.contract,details:Pi.contract},sandboxPresets:{listConnections:zi.contract,listTypes:Eg.contract,upsertPreset:qg.contract},scripts:{list:jI.contract,get:NI.contract,create:xI.contract,update:RI.contract,delete:UI.contract},logMatchExpressions:{list:Zk.contract,get:Fk.contract,create:Xk.contract,update:Yk.contract,disable:Qk.contract},memory:{put:Ii.contract,get:Li.contract,list:Ti.contract,search:Oi.contract,delete:Ai.contract},onboarding:{getState:fI.contract,skipIntegration:kI.contract,skipGithubAppInstallation:vI.contract,skipSampleIssue:SI.contract,finish:PI.contract},organizations:{list:II.contract,get:LI.contract,create:$I.contract,update:TI.contract},members:{list:C$.contract,updateRole:D$.contract,remove:z$.contract},teams:{list:eL.contract,create:tL.contract,update:nL.contract,delete:oL.contract,addMember:rL.contract,removeMember:iL.contract,listMembers:aL.contract},publicKeys:{list:Gr.contract,get:Jr.contract,ensureLogForwarding:Hr.contract,update:Br.contract,deactivate:Wr.contract},secretKeys:{list:jl.contract,get:Nl.contract,create:xl.contract,update:Rl.contract,delete:Ul.contract},projects:{list:xg.contract,get:Rg.contract,create:Ug.contract,update:Mg.contract,delete:Kg.contract},search:{threads:_i.contract,messages:ji.contract},messages:{list:YH.contract,append:QH.contract},threads:{list:G$.contract,get:J$.contract,getStatus:H$.contract,stop:B$.contract,create:W$.contract,update:Z$.contract,fork:F$.contract,setVisibility:X$.contract,createShareLink:Y$.contract,listShareLinks:Q$.contract,revokeShareLink:V$.contract},runs:{list:U$.contract,listForThread:M$.contract,get:K$.contract,cancel:E$.contract},pullRequests:{list:AI.contract},issues:{count:Pl.contract,create:qr.contract,list:vl.contract,search:Sl.contract,get:$l.contract,resolve:Il.contract,ignore:Ll.contract,reopen:Tl.contract,reassignAndReopen:Ol.contract,mute:Al.contract,unmute:Cl.contract},billing:{getSummary:xk.contract,getUsage:Rk.contract,listTransactions:Uk.contract},tasks:{list:os.contract},recommendations:{list:Qc.contract},statusComponents:{list:Jg.contract,get:Hg.contract,register:Ni.contract,deregister:Bg.contract,rename:Wg.contract,assignTeam:Zg.contract,retirementPreview:Fg.contract,retire:Xg.contract,restorationPreview:Yg.contract,restore:Qg.contract,mergePreview:rd.contract,merge:id.contract,relationships:{list:Vg.contract,preview:ed.contract,add:td.contract,remove:nd.contract},incidents:{list:ad.contract},timeline:cd.contract}}});var Ri=g(()=>{YC();mZ();qk();Hk();dS();mS();wS();O$();R$();OI();CI();DI();KI();QI();VI()});var Mde="https://api.sazabi.com",Kde="x-sazabi-client-source",wZ=(e)=>{return{streamRun:async(t)=>{return pZ({options:e,path:`/runs/${encodeURIComponent(t.runId)}/stream`,cursor:t.cursor,signal:t.signal})},streamThread:async(t)=>{return pZ({options:e,path:`/threads/${encodeURIComponent(t.threadId)}/stream`,cursor:t.cursor,signal:t.signal})}}},pZ=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=Ede(e.options.apiBaseUrl,e.path,e.cursor);return Gde({url:r,token:n,clientSource:e.options.clientSource,initialCursor:e.cursor,signal:e.signal,fetch:t})},Ede=(e,t,n)=>{let r=qde(e??Mde),o=new URL(`${r}${t}`);if(n)o.searchParams.set(Sk,n);return o.toString()},qde=(e)=>{let t=e.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},Gde=async(e)=>{let t=[],n=[],r=!1,o=!1,i,c=e.initialCursor,s=new AbortController,h=(k)=>{if(r)return;r=!0,i=k;while(n.length>0)n.shift()?.({value:void 0,done:!0})},l=(k)=>{let L=n.shift();if(L){L({value:k,done:!1});return}t.push(k)},u=(k)=>{if(k.event===$k){let A=Zde(k.data);if(A!==void 0)c=A;return}if(k.data===Ik){o=!0,s.abort(),h();return}let L=Fde(k.data);if(L)l(L)},d=()=>{o=!0,s.abort(),h()};if(e.signal)if(e.signal.aborted)o=!0,s.abort();else e.signal.addEventListener("abort",d,{once:!0});let y={[Symbol.asyncIterator](){return y},get cursor(){return c},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((k)=>{n.push(k)}).then((k)=>{if(k.done&&i)throw i;return k})},return:async()=>{return o=!0,s.abort(),h(),{value:void 0,done:!0}},throw:async(k)=>{throw o=!0,s.abort(),h(k instanceof Error?k:Error(String(k))),k},close:async()=>{o=!0,s.abort(),h()}};if(o)return h(),y;let p=await e.fetch(e.url,{method:Pk,headers:Jde(e.token,e.clientSource),signal:s.signal});if(await Hde(p))h();else Bde(p,u).then(()=>h()).catch((k)=>{if(Yde(k)||o||e.signal?.aborted){h();return}h(Qde(k))});return y},Jde=(e,t)=>{return{accept:"text/event-stream",authorization:`Bearer ${e}`,...t?{[Kde]:t}:{}}},Hde=async(e)=>{if(e.status===204)return!0;if(e.ok&&e.body)return!1;let t=await Xde(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}`)},Bde=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=Wde(t);try{while(!0){let c=await n.read();if(c.done)break;o+=r.decode(c.value,{stream:!0});let s=o.split(/\r\n|\r|\n/);o=s.pop()??"";for(let h of s)i.line(h)}if(o+=r.decode(),o)for(let c of o.split(/\r\n|\r|\n/))i.line(c);i.flush()}finally{n.releaseLock()}},Wde=(e)=>{let t="message",n=[],r=()=>{t="message",n=[]},o=()=>{if(n.length===0){r();return}e({event:t,data:n.join(`
8615
+ `)}],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."})});var rJ;var iJ=g(()=>{ne();rJ=D({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 `https://mcp.sentry.dev/mcp` for broad access. To scope this connection to one organization or project, copy a path-scoped URL such as `https://mcp.sentry.dev/mcp/your-org` or `https://mcp.sentry.dev/mcp/your-org/your-project`.",defaultServerUrl:"https://mcp.sentry.dev/mcp",imageKeys:["mcp.sentry.url-configuration-page"],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 aJ;var cJ=g(()=>{ne();aJ=D({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:qE,normalizeHeaders:EE})});var sJ;var hJ=g(()=>{ne();sJ=D({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"}},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 lJ;var uJ=g(()=>{ne();lJ=D({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 gJ;var dJ=g(()=>{ne();gJ=D({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 yJ;var bJ=g(()=>{ne();yJ=D({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:"Create a read-only API key in [The Context Company](https://docs.thecontext.company/access-data/mcp), then paste the raw key below. Sazabi sends it as `Authorization: Bearer <key>` to `https://api.thecontext.company/mcp`.",fieldKeys:["apiKey"]}],validateCredentials:_E,normalizeHeaders:zE,skill:"the-context-company",setupSkill:"the-context-company-setup"})});var mJ;var pJ=g(()=>{ne();mJ=D({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."})});var wJ;var fJ=g(()=>{ne();wJ=D({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 an X API OAuth 2.0 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:"Create an OAuth 2.0 Bearer token",description:"Generate the OAuth 2.0 access token the hosted MCP server will use.",body:"In your app's **Keys and tokens**, generate an OAuth 2.0 access token and copy it. Paste the raw token into Sazabi — Sazabi adds the `Bearer ` prefix and sends it in the `Authorization` header.",fieldKeys:["accessToken"]}],validateCredentials:jE,normalizeHeaders:DE,skill:"x",setupSkill:"x-setup"})});var kJ,SJe;var vJ=g(()=>{yq();mq();wq();kq();T$();T$();Pq();Iq();Tq();Aq();Dq();_q();Nq();Rq();Mq();Eq();Gq();Hq();Wq();Fq();Yq();Vq();tG();oG();iG();cG();hG();uG();dG();bG();pG();fG();vG();PG();IG();TG();AG();DG();_G();NG();RG();MG();EG();GG();HG();WG();FG();YG();VG();tJ();oJ();iJ();cJ();hJ();uJ();dJ();bJ();pJ();fJ();kJ=[lJ,Xq,Qq,dq,bq,pq,fq,vq,Sq,$q,Lq,Oq,Cq,zq,xq,Uq,Kq,qq,jq,Jq,Bq,eG,nG,rG,aG,sG,lG,gG,yG,mG,wG,kG,SG,$G,LG,OG,CG,zG,jG,xG,UG,KG,qG,JG,BG,XG,ZG,QG,eJ,nJ,rJ,aJ,sJ,gJ,yJ,mJ,wJ,Zq],SJe=new Map(kJ.map((e)=>[e.id,e]))});var SJ=()=>{};var PJ=()=>{};var $J=()=>{};var IJ=()=>{};var LJ=()=>{};var TJ=()=>{};var OJ=()=>{};var AJ=()=>{};var CJ=()=>{};var DJ=()=>{};var zJ=()=>{};var _J=()=>{};var jJ=()=>{};var NJ=()=>{};var xJ=()=>{};var RJ=()=>{};var UJ=()=>{};var MJ=()=>{};var KJ=()=>{};var EJ=()=>{};var qJ=()=>{};var GJ=()=>{};var JJ=()=>{};var HJ=()=>{};var BJ=()=>{};var WJ=()=>{};var ZJ=()=>{};var FJ=()=>{};var XJ=()=>{};var YJ=()=>{};var QJ=()=>{};var VJ=()=>{};var eH=()=>{};var tH=()=>{};var nH=()=>{};var oH=()=>{};var rH=()=>{};var iH=()=>{};var aH=()=>{};var cH=()=>{};var sH=g(()=>{SJ();PJ();$J();IJ();LJ();TJ();OJ();AJ();CJ();DJ();zJ();_J();jJ();NJ();xJ();RJ();UJ();MJ();KJ();EJ();qJ();GJ();JJ();HJ();BJ();WJ();ZJ();FJ();XJ();YJ();QJ();VJ();eH();tH();nH();oH();rH();iH();aH();cH()});var hH=()=>{};var lH=()=>{};var uH=g(()=>{_R();uu();$E();sq();vJ();I$();sH();hH();lH()});var gH,Zle,dH,Fle,yH,Xle,bH,mH,Lg,pH,wH,fH,vi,kH,vH,Si,SH,PH,Pi,$H,Yle,IH,Tg,Qle;var O$=g(()=>{uH();be();Le();gH=["configured","authorizing","connected","error"],Zle=a.enum(gH),dH=["preset","custom"],Fle=a.enum(dH),yH=["streamable-http","sse"],Xle=a.enum(yH),bH=["none","headers","oauth","aws-sigv4"],mH=a.enum(bH),Lg=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:Fle.describe("Whether the connector is a built-in preset or a custom server."),installStatus:Zle.describe("Current connection lifecycle status."),authMode:mH.describe("Authentication mode."),transport:Xle.describe("Transport protocol."),serverUrl:a.string().describe("MCP server URL."),readOnly:a.boolean().describe("Whether the connector is restricted to read-only tools."),management:IS.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()}),pH=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.")}),wH=a.object({projectId:a.string().uuid().optional().describe("Project to list connectors for. Auto-filled from SDK context when omitted."),connectedOnly:a.boolean().optional().describe("When true, only return connectors that are connected.")}),fH=a.object({connectors:a.array(Lg)}),vi=P({operationId:"mcpConnectors.list",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:wH,output:fH,pagination:"none",async:"sync"}),kH=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.")}),vH=a.object({connector:Lg}),Si=P({operationId:"mcpConnectors.get",description:"Get one configured MCP connector by connection ID.",backend:"api",route:{method:"GET",path:"/mcp-connectors/{connectionId}",tags:["MCP Connectors"]},input:kH,output:vH,pagination:"none",async:"sync"}),SH=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.")}),PH=a.object({connector:Lg,tools:a.array(pH)}),Pi=P({operationId:"mcpConnectors.details",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:SH,output:PH,pagination:"none",async:"sync"}),$H=a.object({providerId:a.string().describe('Provider identifier, e.g. "linear".'),label:a.string().describe("Human-readable provider name."),authMode:mH.describe("Authentication mode."),availability:a.enum(oi).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.")}),Yle=a.object({}),IH=a.object({providers:a.array($H)}),Tg=P({operationId:"mcpConnectors.listProviders",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:Yle,output:IH,pagination:"none",async:"sync"}),Qle={list:vi.contract,get:Si.contract,details:Pi.contract,listProviders:Tg.contract}});var $i,Vle,eue,tue,nue,oue,rue,iue,A$,ZZe;var Og=g(()=>{be();Le();$i=a.enum(["admin","member"]),Vle=a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional(),role:$i}),eue=a.object({id:a.string().min(1),name:a.string().nullable(),email:a.string().email()}),tue=a.object({credentialType:a.literal("user"),user:eue,activeOrganizationId:a.string().min(1).nullable(),organizations:a.array(Vle).describe("Organizations the user belongs to, including membership role.")}),nue=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()}),oue=a.object({credentialType:a.literal("partner"),superorganization:a.object({id:a.string().uuid(),name:a.string()})}),rue=a.object({}),iue=a.discriminatedUnion("credentialType",[tue,nue,oue]),A$=P({operationId:"me.get",description:"Return the identity and available context for the current credential.",backend:"api",route:{method:"GET",path:"/me",tags:["Auth"]},input:rue,output:iue,pagination:"none",async:"sync"}),ZZe=A$.contract});var LH,aue,cue,sue,hue,lue,uue,C$,D$,z$,VZe;var TH=g(()=>{be();Le();Og();LH=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:$i.describe("Organization role."),createdAt:a.string().datetime().describe("When the membership was created.")}),aue=a.object({organizationId:a.string().min(1).optional().describe("Organization to list members for. Auto-filled from CLI and SDK context when omitted.")}),cue=a.object({members:a.array(LH).describe("Members visible within the selected organization.")}),sue=a.object({organizationId:a.string().min(1).optional().describe("Organization containing the member. Auto-filled from CLI and SDK context when omitted."),userId:a.string().min(1).describe("User ID of the member to update."),role:$i.describe("Role to assign.")}),hue=a.object({member:LH.describe("Updated organization member.")}),lue=a.object({params:a.object({userId:a.string().min(1).describe("User ID 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.")})}).transform(({params:e,query:t})=>({...t,...e})),uue=a.object({removedUserId:a.string().min(1).describe("User ID removed from the organization.")}),C$=P({operationId:"members.list",description:"List members in an organization.",backend:"api",route:{method:"GET",path:"/members",tags:["Members"]},input:aue,output:cue,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"}]}}]}),D$=P({operationId:"members.updateRole",description:"Update a member's organization role.",backend:"api",route:{method:"PATCH",path:"/members/{userId}/role",tags:["Members"]},input:sue,output:hue,pagination:"none",async:"sync",examples:[{name:"promote-member",input:{organizationId:"organization-123",userId:"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"}}}]}),z$=P({operationId:"members.remove",description:"Remove a member from an organization.",backend:"api",route:{method:"DELETE",path:"/members/{userId}",tags:["Members"],inputStructure:"detailed"},input:lue,output:uue,pagination:"none",async:"sync"}),VZe={list:C$.contract,updateRole:D$.contract,remove:z$.contract}});var AH,CH,Ag,DH,Cg,OH=4194304,_$,j$,gue=(e)=>{let t=e.split(",").map((r)=>r.trim()).filter(Boolean),n=a.array(Ag).safeParse(t);if(!n.success)throw Error("Kind filter must be a comma-separated list of note, runbook, or change.");return n.data},Gc,N$,x$,zH,_H,jH,NH,xH,RH,UH,MH,KH,EH,qH,GH,Ii,Li,Ti,Oi,Ai,due;var R$=g(()=>{be();Le();AH=["note","runbook"],CH=["note","runbook","change"],Ag=a.enum(CH),DH=a.enum(AH),Cg=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."),_$=a.string().min(1).refine((e)=>new TextEncoder().encode(e).length<=OH,{message:`Memory body must be at most ${OH} bytes (4 MiB).`}).describe("Document body stored in project memory."),j$=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."),Gc=a.string().min(1).transform(gue).describe("Comma-separated kinds, for example note,runbook."),N$=a.object({id:a.string().uuid(),projectId:a.string().uuid(),kind:Ag,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()}),x$=N$.extend({body:_$}),zH=a.object({projectId:a.string().uuid().optional().describe("Project that owns the document. Auto-filled from CLI and SDK context when omitted."),path:Cg.describe("Relative path for the curated document."),body:_$,kind:DH.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.")}),_H=a.object({document:x$}),jH=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:Cg.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."})}),NH=a.object({document:x$}),xH=a.object({projectId:a.string().uuid().optional().describe("Project to list memory for. Auto-filled from CLI and SDK context when omitted."),kind:Gc.optional(),since:j$.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.")}),RH=a.object({documents:a.array(N$),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),UH=a.object({documentId:a.string().uuid(),kind:Ag,managed:a.boolean(),path:a.string().nullable(),title:a.string().nullable(),snippet:a.string(),score:a.number()}),MH=a.object({calibrated:a.literal(!0),minScoreThreshold:a.number(),queryTerms:a.array(a.string()),message:a.string()}),KH=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:Gc.optional(),since:j$.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.")}),EH=a.object({hits:a.array(UH),emptyVerdict:MH.nullable()}),qH=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:Cg.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."})}),GH=a.object({deleted:a.boolean()}),Ii=P({operationId:"memory.put",description:"Create or replace a curated project memory document. Embeds on success.",backend:"api",route:{method:"PUT",path:"/memory",tags:["Memory"]},input:zH,output:_H,pagination:"none",async:"sync"}),Li=P({operationId:"memory.get",description:"Get one project memory document by id or path.",backend:"api",route:{method:"GET",path:"/memory/document",tags:["Memory"]},input:jH,output:NH,pagination:"none",async:"sync"}),Ti=P({operationId:"memory.list",description:"List project memory catalog rows without embedding search.",backend:"api",route:{method:"GET",path:"/memory",tags:["Memory"]},input:xH,output:RH,pagination:"cursor",async:"sync"}),Oi=P({operationId:"memory.search",description:"Hybrid semantic and keyword search over project memory documents.",backend:"api",route:{method:"POST",path:"/memory/search",tags:["Memory"]},input:KH,output:EH,pagination:"none",async:"sync"}),Ai=P({operationId:"memory.delete",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:qH,output:GH,pagination:"none",async:"sync"}),due={put:Ii.contract,get:Li.contract,list:Ti.contract,search:Oi.contract,delete:Ai.contract}});var JH,HH,yue,bue,mue,pue,wue,Jc,fue,kue,vue,U$,M$,K$,E$,aFe;var Dg=g(()=>{be();Le();JH=a.enum(["processing","completed","aborted","error"]),HH=a.object({id:a.string().uuid(),threadId:a.string().uuid(),userMessageId:a.string().uuid().nullable(),assistantMessageId:a.string().uuid().nullable(),parentRunId:a.string().uuid().nullable(),workflowRunId:a.string().nullable(),status:JH,source:a.enum(["app","api","mcp","slack","teams","linear","github","agent","cli"]),createdAt:a.string().datetime(),updatedAt:a.string().datetime(),completedAt:a.string().datetime().nullable()}),yue=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.")}),bue=a.object({runs:a.array(HH),nextCursor:a.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),mue=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.")}),pue=a.object({runs:a.array(HH),nextCursor:a.string().datetime().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),wue=a.object({runId:a.string().uuid().describe("Run ID returned by a deferred operation.")}),Jc=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:JH.describe("Current run lifecycle status."),response:a.string().nullable().describe("Assistant response text when the run has completed.")}),fue=Jc.describe("Current run state and, when complete, the assistant response."),kue=a.object({runId:a.string().uuid().describe("Run ID of the in-flight run to request cancellation for.")}),vue=a.object({success:a.literal(!0).describe("Always true when the cancellation request was accepted.")}),U$=P({operationId:"runs.list",description:"List deferred runs within one project.",backend:"api",route:{method:"GET",path:"/runs",tags:["Runs"]},input:yue,output:bue,pagination:"cursor",async:"sync"}),M$=P({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:mue,output:pue,pagination:"cursor",async:"sync"}),K$=P({operationId:"runs.get",description:"Get the current result for a deferred run by run ID.",backend:"api",route:{method:"GET",path:"/runs/{runId}",tags:["Runs"]},input:wue,output:fue,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}}]}),E$=P({operationId:"runs.cancel",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:kue,output:vue,pagination:"none",async:"sync",examples:[{name:"cancel-processing-run",input:{runId:"33333333-3333-4333-8333-333333333333"},output:{success:!0}}]}),aFe={list:U$.contract,listForThread:M$.contract,get:K$.contract,cancel:E$.contract}});var zg=(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"]})},_g=(e,t,n)=>{if(e&&!t)n.addIssue({code:"custom",message:"ambientServiceRun requires an automationId",path:["ambientServiceRun"]})};var BH,Hc,Sue,Pue,$ue,Iue,Lue,Tue,Oue,Aue,Cue,q$,Due,zue,_ue,jue,Nue,xue,Rue,Uue,Mue,Kue,Eue,que,G$,J$,H$,B$,W$,Z$,WH,Gue,Jue,Hue,Bue,ZH,Wue,Zue,Fue,Xue,Yue,Que,Xo="22222222-2222-4222-8222-222222222222",FH="11111111-1111-4111-8111-111111111111",Vue="44444444-4444-4444-8444-444444444444",XH="55555555-5555-4555-8555-555555555555",F$,X$,Y$,Q$,V$,dFe;var eI=g(()=>{be();Le();Dg();BH=a.enum(["slack","teams","linear","github","app","mcp","agent","api","cli"]),Hc=a.object({id:a.string().uuid(),projectId:a.string().uuid(),title:a.string().nullable(),status:a.enum(["regular","archived"]),source:BH.nullable(),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),Sue=a.object({type:a.literal("message"),message:a.string()}),Pue=a.object({type:a.literal("reasoning"),reasoning:a.string(),status:a.enum(["in_progress","complete"]).optional()}),$ue=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()}),Iue=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()}),Lue=a.object({type:a.literal("fork"),sourceThreadId:a.string(),sourceMessageId:a.string(),sourceThreadTitle:a.string().nullable()}),Tue=a.object({type:a.literal("summary"),summary:a.string()}),Oue=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()}))}),Aue=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()}))}),Cue=a.union([Sue,Pue,$ue,Iue,Lue,Tue,Oue,Aue]),q$=a.object({id:a.string().uuid(),role:a.enum(["user","assistant"]),content:a.array(Cue),source:BH,createdAt:a.string().datetime()}),Due=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.")}),zue=a.object({threads:a.array(Hc).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.")}),_ue=a.object({threadId:a.string().uuid().describe("Thread ID returned by threads.list or threads.create.")}),jue=a.object({thread:Hc.describe("The requested thread."),messages:a.array(q$).describe("Messages currently stored on the thread in chronological order.")}),Nue=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)=>{zg(e.message,e.automationId,t),_g(e.ambientServiceRun,e.automationId,t)}),xue=Jc.describe("Deferred run result for creating a thread."),Rue=a.object({threadId:a.string().uuid().describe("Thread ID whose current processing status should be returned.")}),Uue=a.object({status:a.enum(["idle","processing"]),lastRunStatus:a.enum(["error"]).nullable()}),Mue=a.object({threadId:a.string().uuid().describe("Thread ID whose active run should be stopped.")}),Kue=a.object({success:a.literal(!0).describe("Always true when the stop request was accepted.")}),Eue=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.")}),que=a.object({thread:Hc.describe("The updated thread.")}),G$=P({operationId:"threads.list",description:"List threads in a project, optionally filtered by status.",backend:"api",route:{method:"GET",path:"/threads",tags:["Threads"]},input:Due,output:zue,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}}]}),J$=P({operationId:"threads.get",description:"Get a thread and its messages.",backend:"api",route:{method:"GET",path:"/threads/{threadId}",tags:["Threads"]},input:_ue,output:jue,pagination:"none",async:"sync"}),H$=P({operationId:"threads.getStatus",description:"Get the current processing status for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/status",tags:["Threads"]},input:Rue,output:Uue,pagination:"none",async:"sync",examples:[{name:"processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{status:"processing",lastRunStatus:null}}]}),B$=P({operationId:"threads.stop",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:Mue,output:Kue,pagination:"none",async:"sync",examples:[{name:"stop-processing-thread",input:{threadId:"22222222-2222-4222-8222-222222222222"},output:{success:!0}}]}),W$=P({operationId:"threads.create",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:Nue,output:xue,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}}]}),Z$=P({operationId:"threads.update",description:"Update a thread's status.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}",tags:["Threads"]},input:Eue,output:que,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"}}}]}),WH=a.enum(["private","organization"]),Gue=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.")}),Jue=a.object({thread:Hc.describe("The newly created forked thread.")}),Hue=a.object({threadId:a.string().uuid().describe("Thread ID of the thread to update."),visibility:WH.describe("New visibility. 'private' restricts the thread to its owner; 'organization' shares it with the organization.")}),Bue=a.object({thread:Hc.describe("The updated thread."),visibility:WH.describe("The thread's resulting visibility.")}),ZH=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()}),Wue=a.object({threadId:a.string().uuid().describe("Thread ID to create a public read-only snapshot for.")}),Zue=a.object({share:ZH.describe("The created share link.")}),Fue=a.object({threadId:a.string().uuid().describe("Thread ID the snapshot belongs to."),shareId:a.string().uuid().describe("Snapshot ID to revoke.")}),Xue=a.void(),Yue=a.object({threadId:a.string().uuid().describe("Thread ID to list public snapshots for.")}),Que=a.object({shares:a.array(ZH).describe("Active share links for the thread.")}),F$=P({operationId:"threads.fork",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:Gue,output:Jue,pagination:"none",async:"sync",examples:[{name:"fork-from-message",input:{threadId:Xo,messageId:Vue},output:{thread:{id:"66666666-6666-4666-8666-666666666666",projectId:FH,title:"API returning 500s (fork)",status:"regular",source:"api",createdAt:"2026-01-01T00:20:00.000Z",updatedAt:"2026-01-01T00:20:00.000Z"}}}]}),X$=P({operationId:"threads.setVisibility",description:"Set a thread's visibility to private or organization.",backend:"api",route:{method:"PATCH",path:"/threads/{threadId}/visibility",tags:["Threads"]},input:Hue,output:Bue,pagination:"none",async:"sync",examples:[{name:"make-private",input:{threadId:Xo,visibility:"private"},output:{thread:{id:Xo,projectId:FH,title:"API returning 500s",status:"regular",source:"api",createdAt:"2026-01-01T00:00:00.000Z",updatedAt:"2026-01-01T00:30:00.000Z"},visibility:"private"}}]}),Y$=P({operationId:"threads.createShareLink",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:Wue,output:Zue,pagination:"none",async:"sync",examples:[{name:"create-share-link",input:{threadId:Xo},output:{share:{shareId:XH,threadId:Xo,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}}}]}),Q$=P({operationId:"threads.listShareLinks",description:"List active public share links for a thread.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/share",tags:["Threads"]},input:Yue,output:Que,pagination:"none",async:"sync",examples:[{name:"list-share-links",input:{threadId:Xo},output:{shares:[{shareId:XH,threadId:Xo,url:"https://app.sazabi.com/share/55555555-5555-4555-8555-555555555555",createdAt:"2026-01-01T00:40:00.000Z"}]}}]}),V$=P({operationId:"threads.revokeShareLink",description:"Revoke a public share link for a thread.",backend:"api",route:{method:"DELETE",path:"/threads/{threadId}/share/{shareId}",successStatus:204,tags:["Threads"]},input:Fue,output:Xue,pagination:"none",async:"sync"}),dFe={list:G$.contract,get:J$.contract,getStatus:H$.contract,stop:B$.contract,create:W$.contract,update:Z$.contract,fork:F$.contract,setVisibility:X$.contract,createShareLink:Y$.contract,listShareLinks:Q$.contract,revokeShareLink:V$.contract}});var ege,tge,nge,oge,YH,QH;var VH=g(()=>{be();Le();Dg();eI();ege=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.")}),tge=a.object({messages:a.array(q$),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),nge=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)=>{zg(e.message,e.automationId,t),_g(e.ambientServiceRun,e.automationId,t)}),oge=Jc.describe("Deferred run result for appending a message to an existing thread."),YH=P({operationId:"messages.list",description:"List messages in a thread with cursor pagination.",backend:"api",route:{method:"GET",path:"/threads/{threadId}/messages",tags:["Messages"]},input:ege,output:tge,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}}]}),QH=P({operationId:"messages.append",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:nge,output:oge,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 xt,tB,tI,Ci,nB,jg,fo,oB,eB;var Bc=g(()=>{be();xt={IN_APP:"in_app",SLACK:"slack",SLACK_CHANNEL:"slack_channel",TEAMS_CHANNEL:"teams_channel",EMAIL:"email",SMS:"sms",INCIDENT_IO:"incident_io",PAGERDUTY:"pagerduty",ROOTLY:"rootly",WEBHOOK:"webhook"},tB=[xt.IN_APP,xt.SLACK,xt.EMAIL,xt.SMS],tI=[xt.SLACK_CHANNEL,xt.TEAMS_CHANNEL,xt.INCIDENT_IO,xt.PAGERDUTY,xt.ROOTLY,xt.WEBHOOK],Ci=Object.values(xt),nB=[...Ci,"victorops"],jg=a.enum(Ci),fo=a.enum(tI),oB=[{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"}],eB=new Set(oB.map(({channel:e})=>e));if(eB.size!==Ci.length||Ci.some((e)=>!eB.has(e)))throw Error("Notification channel definitions must represent every channel")});var rB,rge=(e,t)=>e.value===t.value&&e.label===t.label&&e.scope===t.scope&&e.role===t.role&&e.defaultOff===t.defaultOff&&(e.deliveryConditions??[]).join(",")===(t.deliveryConditions??[]).join(","),kt=(e)=>{for(let t of Object.values(e)){let n=rB.get(t.value);if(n&&!rge(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}`);rB.set(t.value,t)}return e};var qn=g(()=>{rB=new Map});var iB;var aB=g(()=>{qn();iB=kt({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 cB;var sB=g(()=>{qn();cB=kt({BILLING_PLAN_UPGRADE_APPLIED:{value:"billing_plan_upgrade_applied",label:"Billing upgrade applied",scope:"org",role:"admin"},BILLING_PLAN_DOWNGRADE_SCHEDULED:{value:"billing_plan_downgrade_scheduled",label:"Billing downgrade scheduled",scope:"org",role:"admin"},BILLING_PLAN_DOWNGRADE_APPLIED:{value:"billing_plan_downgrade_applied",label:"Billing downgrade applied",scope:"org",role:"admin"},BILLING_CREDIT_BALANCE_LOW:{value:"billing_credit_balance_low",label:"Billing credits low",scope:"org",role:"admin"},BILLING_CREDIT_BALANCE_DEPLETED:{value:"billing_credit_balance_depleted",label:"Billing credits depleted",scope:"org",role:"admin"},BILLING_AUTO_TOP_UP_SETTINGS_CHANGED:{value:"billing_auto_top_up_settings_changed",label:"Billing auto top-up changed",scope:"org",role:"admin"},BILLING_AUTO_TOP_UP_FAILED:{value:"billing_auto_top_up_failed",label:"Billing auto top-up failed",scope:"org",role:"admin"},BILLING_INVOICE_PAID:{value:"billing_invoice_paid",label:"Billing invoice paid",scope:"org",role:"admin"},BILLING_NEGATIVE_BALANCE_COLLECTED:{value:"billing_negative_balance_collected",label:"Billing outstanding balance charged",scope:"org",role:"admin"},BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED:{value:"billing_negative_balance_collection_failed",label:"Billing outstanding balance charge failed",scope:"org",role:"admin"}})});var hB;var lB=g(()=>{qn();hB=kt({INTEGRATION_CONNECTED:{value:"integration_connected",label:"Integration connected",scope:"org",defaultOff:!0},INTEGRATION_DISCONNECTED:{value:"integration_disconnected",label:"Integration disconnected",scope:"org"}})});var uB;var gB=g(()=>{qn();uB=kt({ISSUE_TRIGGERED:{value:"issue_triggered",label:"Issue triggered",scope:"project",deliveryConditions:["component","severity"]},ISSUE_RESOLVED:{value:"issue_resolved",label:"Issue resolved",scope:"project",deliveryConditions:["component","severity"]},ISSUE_IGNORED:{value:"issue_ignored",label:"Issue ignored",scope:"project",deliveryConditions:["component","severity"]}})});var dB;var yB=g(()=>{qn();dB=kt({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 bB;var mB=g(()=>{qn();bB=kt({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 pB;var wB=g(()=>{qn();pB=kt({SECURITY_ALERT:{value:"security_alert",label:"Security alert",scope:"org",role:"admin"}})});var nI,at,age,oI=(e)=>{let t=age.get(e)?.label;if(t)return t;let n=e.replace(/_/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):e};var Wc=g(()=>{aB();sB();lB();gB();yB();mB();wB();qn();nI={...pB,...dB,...hB,...iB,...uB,...bB,...cB},at=Object.fromEntries(Object.entries(nI).map(([e,t])=>[e,t.value])),age=new Map(Object.values(nI).map((e)=>[e.value,e]))});var rI,kB,ZFe,In,FFe;var Zc=g(()=>{Wc();Bc();Bc();rI=Object.values(at),kB=[at.BILLING_PLAN_UPGRADE_APPLIED,at.BILLING_PLAN_DOWNGRADE_SCHEDULED,at.BILLING_PLAN_DOWNGRADE_APPLIED,at.BILLING_CREDIT_BALANCE_LOW,at.BILLING_CREDIT_BALANCE_DEPLETED,at.BILLING_AUTO_TOP_UP_SETTINGS_CHANGED,at.BILLING_AUTO_TOP_UP_FAILED,at.BILLING_INVOICE_PAID,at.BILLING_NEGATIVE_BALANCE_COLLECTED,at.BILLING_NEGATIVE_BALANCE_COLLECTION_FAILED],ZFe=new Set(kB),In=[at.ISSUE_TRIGGERED,at.ISSUE_RESOLVED,at.ISSUE_IGNORED,at.AUTOMATION_RUN_FAILED],FFe=new Set(In)});var Fc,vB,SB=(e)=>typeof e==="string"&&(e in vB)?vB[e]:e,sge;var PB=g(()=>{Bc();be();Zc();Fc=a.enum(rI),vB={data_source_connected:"log_source_connected",data_source_disconnected:"log_source_disconnected"},sge=a.preprocess(SB,Fc)});var hge;var $B=g(()=>{Wc();Zc();hge=In.map((e)=>({notificationType:e,label:oI(e)}))});var IB=g(()=>{Wc();Zc()});var iI=g(()=>{Bc();Wc();Zc();PB();$B();IB()});var uge,gge,dge,yge,bge,mge,pge,aI,xXe;var LB=g(()=>{iI();be();Le();uge=a.enum(["ready","missing","degraded","unavailable"]),gge=a.object({id:a.string(),label:a.string(),status:a.enum(["active","inactive","degraded"]),statusLabel:a.string()}),dge=a.object({channel:jg,name:a.string(),description:a.string(),scope:a.enum(["personal","project"]),enabled:a.boolean().nullable(),preferenceId:a.string().nullable(),prerequisite:a.object({status:uge,statusLabel:a.string(),message:a.string()}),action:a.object({label:a.string(),href:a.string()}).nullable(),destinations:a.array(gge),destinationManagement:a.enum(["none","slack_channels","teams_channels","integration_connections","webhook_endpoints"]),canCreateDestinations:a.boolean(),supportedNotificationTypes:a.array(Fc)}),yge=a.object({channel:fo,enabled:a.boolean(),preferenceId:a.string().nullable()}),bge=a.object({channel:fo,notificationType:Fc,enabled:a.boolean(),preferenceId:a.string()}),mge=a.object({projectId:a.string().uuid().optional().describe("Project to inspect. Auto-filled from CLI and SDK context when omitted.")}),pge=a.object({channelCards:a.array(dge).length(10),channels:a.array(yge),notificationTypePreferences:a.array(bge),issueNotificationMinSeverity:a.enum(["low","medium","high","critical"])}),aI=P({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:mge,output:pge,pagination:"none",async:"sync"}),xXe={getProject:aI.contract}});var TB,sI,OB,hI,EXe,qXe,lI,uI=(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."})},GXe,AB,cI,gI,Xc,CB,wge,fge,kge,vge,Sge,Pge,$ge,Ige,Lge,dI,yI,bI,mI,pI,JXe;var DB=g(()=>{iI();be();Le();TB=a.enum(["low","medium","high","critical"]),sI=a.object({severities:a.array(TB).min(1).optional()}).strict(),OB=a.object({componentIds:a.array(a.string().uuid()).min(1).optional(),severities:a.array(TB).min(1).optional()}).strict(),hI=a.object({channel:fo,destinationKey:a.string().min(1)}),EXe=a.object({destinations:a.array(hI).min(1),notificationTypes:a.array(a.enum(In)).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:sI}),qXe=a.object({destinations:a.array(hI).min(1),notificationTypes:a.array(a.enum(In)).min(1),condition:OB}),lI=a.object({destinations:a.array(hI).min(1),notificationTypes:a.array(a.enum(In)).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([sI,OB])}),GXe=lI.superRefine(uI),AB=a.object({id:a.string(),channel:fo,destinationKey:a.string(),displayName:a.string()}),cI=a.object({id:a.string().uuid(),label:a.string(),lifecycle:a.enum(["active","retired","merged"])}),gI=a.object({id:a.string().uuid(),projectId:a.string().uuid(),notificationTypes:a.array(a.enum(In)),destinations:a.array(AB),condition:sI,component:cI.nullable(),componentId:a.string().uuid().nullable(),includeDescendants:a.boolean(),suspendedAt:a.string().datetime().nullable(),suspensionReason:a.string().nullable(),components:a.array(cI),createdAt:a.string().datetime(),updatedAt:a.string().datetime()}),Xc=a.object({projectId:a.string().uuid().optional().describe("Project whose notification delivery rules are being managed.")}),CB=a.string().uuid().describe("Logical notification delivery rule ID."),wge=Xc,fge=a.object({rules:a.array(gI)}),kge=a.object({destinations:a.array(AB),notificationTypes:a.array(a.object({notificationType:a.enum(In),label:a.string(),conditions:a.array(a.enum(["component","severity"]))})),components:a.array(cI)}),vge=Xc.extend(lI.shape).superRefine(uI),Sge=gI,Pge=Xc.extend({...lI.shape,ruleId:CB}).superRefine(uI),$ge=gI,Ige=Xc.extend({ruleId:CB}),Lge=a.object({removed:a.boolean()}),dI=P({operationId:"notificationDeliveryRules.list",description:"List the positive delivery rules for a project.",backend:"api",route:{method:"GET",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:wge,output:fge,pagination:"none",async:"sync"}),yI=P({operationId:"notificationDeliveryRules.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:Xc,output:kge,pagination:"none",async:"sync"}),bI=P({operationId:"notificationDeliveryRules.create",description:"Create a positive project notification delivery rule.",backend:"api",route:{method:"POST",path:"/notification-delivery-rules",tags:["Notification delivery rules"]},input:vge,output:Sge,pagination:"none",async:"sync"}),mI=P({operationId:"notificationDeliveryRules.update",description:"Replace a positive delivery rule atomically.",backend:"api",route:{method:"PUT",path:"/notification-delivery-rules/{ruleId}",tags:["Notification delivery rules"]},input:Pge,output:$ge,pagination:"none",async:"sync"}),pI=P({operationId:"notificationDeliveryRules.delete",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:Ige,output:Lge,pagination:"none",async:"sync"}),JXe={list:dI.contract,options:yI.contract,create:bI.contract,update:mI.contract,delete:pI.contract}});var wI,Tge,Oge,Age,Cge,Dge,zge,fI,_ge,jge,kI,Nge,xge,vI,Rge,Uge,SI,Mge,Kge,PI,ZXe;var zB=g(()=>{be();Le();wI=a.enum(["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"]),Tge=a.enum(["needs-onboarding","blocked","ready"]),Oge=a.enum(["incomplete","complete","skipped"]),Age=a.object({invitationId:a.string(),organizationId:a.string(),organizationName:a.string(),organizationSlug:a.string(),organizationImageUrl:a.string().nullable(),inviterName:a.string().nullable()}),Cge=a.object({gate:Tge,canonicalStep:wI.nullable(),organizationId:a.string().nullable(),projectId:a.string().nullable(),completionByStep:a.record(wI,Oge),githubSkipped:a.boolean(),githubAppSkipped:a.boolean(),slackSkipped:a.boolean(),sampleIssueId:a.string().nullable(),actorRole:a.enum(["admin","member"]).nullable(),requiredStep:a.union([wI,a.literal("select-organization")]).nullable(),isCompleted:a.boolean(),onboardingRecommendationsThreadId:a.string().nullable(),hasOrganizations:a.boolean(),hasPaidBillingSubscription:a.boolean(),billingStepEnabled:a.boolean(),pendingInvitations:a.array(Age)}),Dge=a.object({}),zge=a.object({onboarding:Cge}),fI=P({operationId:"onboarding.getState",description:"Read onboarding progress for the authenticated user.",backend:"api",route:{method:"GET",path:"/onboarding/state",tags:["Onboarding"]},input:Dge,output:zge,pagination:"none",async:"sync"}),_ge=a.object({integration:a.enum(["github","slack"]).describe("Integration onboarding step to skip.")}),jge=a.object({skipped:a.literal(!0)}),kI=P({operationId:"onboarding.skipIntegration",description:"Skip a GitHub or Slack integration step during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-integration",tags:["Onboarding"]},input:_ge,output:jge,pagination:"none",async:"sync"}),Nge=a.object({}),xge=a.object({skipped:a.literal(!0)}),vI=P({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:Nge,output:xge,pagination:"none",async:"sync"}),Rge=a.object({}),Uge=a.object({skipped:a.literal(!0)}),SI=P({operationId:"onboarding.skipSampleIssue",summary:"Skip Test Issue",description:"Skip the optional test issue during onboarding.",backend:"api",route:{method:"POST",path:"/onboarding/skip-sample-issue",tags:["Onboarding"]},input:Rge,output:Uge,pagination:"none",async:"sync"}),Mge=a.object({projectId:a.string().uuid().describe("Project that completed onboarding.")}),Kge=a.object({completed:a.boolean()}),PI=P({operationId:"onboarding.finish",description:"Mark onboarding complete when all prerequisites are satisfied.",backend:"api",route:{method:"POST",path:"/onboarding/finish",tags:["Onboarding"]},input:Mge,output:Kge,pagination:"none",async:"sync"}),ZXe={getState:fI.contract,skipIntegration:kI.contract,skipGithubAppInstallation:vI.contract,skipSampleIssue:SI.contract,finish:PI.contract}});var Ng,Ege,qge,Gge,Jge,Hge,Bge,Wge,Zge,Fge,Xge,$I,II,LI,TI,VXe;var _B=g(()=>{be();Le();Og();Ng=a.object({id:a.string().min(1),name:a.string(),slug:a.string(),logo:a.string().nullable().optional()}),Ege=Ng.extend({role:$i.optional()}),qge=a.object({}),Gge=a.object({organizations:a.array(Ege).describe("Organizations available to the current credential.")}),Jge=a.object({organizationId:a.string().min(1).describe("Organization ID to fetch.")}),Hge=a.object({organization:Ng}),Bge=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.")}),Wge=a.object({organization:Ng.describe("Updated organization.")}),Zge=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"),Fge=a.object({name:Zge.describe("Organization display name.")}),Xge=a.object({organization:Ng}),$I=P({operationId:"organizations.create",description:"Create an organization for the authenticated user.",backend:"api",route:{method:"POST",path:"/organizations",tags:["Organizations"],successStatus:201},input:Fge,output:Xge,pagination:"none",async:"sync"}),II=P({operationId:"organizations.list",description:"List organizations available to the current credential.",backend:"api",route:{method:"GET",path:"/organizations",tags:["Organizations"]},input:qge,output:Gge,pagination:"none",async:"sync"}),LI=P({operationId:"organizations.get",description:"Get one organization by ID.",backend:"api",route:{method:"GET",path:"/organizations/{organizationId}",tags:["Organizations"]},input:Jge,output:Hge,pagination:"none",async:"sync"}),TI=P({operationId:"organizations.update",description:"Update one organization.",backend:"api",route:{method:"PATCH",path:"/organizations/{organizationId}",tags:["Organizations"]},input:Bge,output:Wge,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}}}]}),VXe={list:II.contract,get:LI.contract,create:$I.contract,update:TI.contract}});var Di,Yc,jB,NB,xB,RB,UB,MB,KB,xg,Rg,Ug,EB,qB,Mg,GB,JB,Kg,Yge;var OI=g(()=>{be();Le();Di=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"]),Yc=a.object({id:a.string().uuid(),organizationId:a.string().min(1),name:a.string(),region:Di}),jB=a.object({organizationId:a.string().min(1).optional().describe("Organization to list projects for. Auto-filled from CLI and SDK context when omitted.")}),NB=a.object({projects:a.array(Yc).describe("Projects visible within the selected organization.")}),xB=a.object({projectId:a.string().uuid().describe("Project ID to fetch.")}),RB=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"),UB=a.object({organizationId:a.string().min(1).optional().describe("Organization to create the project under. Auto-filled from CLI and SDK context when omitted."),name:RB.describe("Project name."),region:Di.optional().default("us-west-2").describe("AWS region where the new project should be created.")}),MB=a.object({project:Yc}),KB=a.object({project:Yc}),xg=P({operationId:"projects.list",description:"List projects in an organization.",backend:"api",route:{method:"GET",path:"/projects",tags:["Projects"]},input:jB,output:NB,pagination:"none",async:"sync"}),Rg=P({operationId:"projects.get",description:"Get one project by ID.",backend:"api",route:{method:"GET",path:"/projects/{projectId}",tags:["Projects"]},input:xB,output:KB,pagination:"none",async:"sync"}),Ug=P({operationId:"projects.create",description:"Create one project in an organization.",backend:"api",route:{method:"POST",path:"/projects",successStatus:201,tags:["Projects"]},input:UB,output:MB,pagination:"none",async:"sync"}),EB=a.object({projectId:a.string().uuid().describe("Project ID to update."),name:RB.optional().describe("New project name.")}),qB=a.object({project:Yc}),Mg=P({operationId:"projects.update",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:EB,output:qB,pagination:"none",async:"sync"}),GB=a.object({projectId:a.string().uuid().describe("Project ID to delete.")}),JB=a.void(),Kg=P({operationId:"projects.delete",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:GB,output:JB,pagination:"none",async:"sync"}),Yge={list:xg.contract,get:Rg.contract,create:Ug.contract,update:Mg.contract,delete:Kg.contract}});var HB,Qge,Vge,ede,tde,nde,AI,aYe;var BB=g(()=>{be();Le();HB=a.enum(["open","merged","closed"]),Qge=a.enum(["review_required","approved","changes_requested"]),Vge=a.enum(["passing","failing","pending"]),ede=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:HB.nullable(),reviewState:Qge.nullable(),checksState:Vge.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()}),tde=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:HB.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.")}),nde=a.object({pullRequests:a.array(ede),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),AI=P({operationId:"pullRequests.list",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:tde,output:nde,pagination:"cursor",async:"sync"}),aYe={list:AI.contract}});var WB,ZB,FB,XB,YB,Qc;var CI=g(()=>{be();Le();WB=a.enum(["data_source","mcp_connector","sandbox_cli","integration"]),ZB=a.enum(["connected","recommended"]),FB=a.object({kind:WB.describe("What the recommendation targets: a data source, MCP connector, sandbox CLI, or integration."),targetId:a.string().describe("Exact catalog id for the kind (data source type, MCP provider id, sandbox CLI preset type, or integration provider id)."),status:ZB.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.")}),XB=a.object({projectId:a.string().uuid().optional().describe("Project to list recommendations for. Auto-filled from CLI and SDK context when omitted.")}),YB=a.object({recommendations:a.array(FB).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).")}),Qc=P({operationId:"recommendations.list",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:XB,output:YB,pagination:"none",async:"sync"})});var QB,ode,VB,Eg,eW,tW,nW,oW,zi,rW,iW,aW,qg,rde;var DI=g(()=>{be();Le();QB=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.")}),ode=a.object({}),VB=a.object({types:a.array(QB)}),Eg=P({operationId:"sandboxPresets.listTypes",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:ode,output:VB,pagination:"none",async:"sync"}),eW=a.enum(["github_app","personal_access_token","stored_credentials"]),tW=a.object({presetType:a.string().describe("Preset type identifier."),credentialSource:eW.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.")}),nW=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.")}),oW=a.object({connections:a.array(tW)}),zi=P({operationId:"sandboxPresets.listConnections",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:nW,output:oW,pagination:"none",async:"sync"}),rW=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.")}),iW=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(rW).max(100).describe("Full set of env vars for this preset. Replaces any previously stored values for the preset.")}),aW=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.")}),qg=P({operationId:"sandboxPresets.upsertPreset",summary:"Upsert CLI Connection",description:"Set or replace a project's sandbox CLI connection environment variables (e.g. the kubectl CLI's KUBECONFIG_CONTENTS). Values are encrypted server-side and never returned. Requires a secret key scoped to the target project's organization.",backend:"api",route:{method:"POST",path:"/sandbox-presets/config",successStatus:200,tags:["Sandbox Presets"]},input:iW,output:aW,pagination:"none",async:"sync"}),rde={listConnections:zi.contract,listTypes:Eg.contract,upsertPreset:qg.contract}});var Gg,cW=1048576,zI,sW,_I,ide,ade,cde,sde,hde,lde,ude,gde,dde,yde,jI,NI,xI,RI,UI,mYe;var hW=g(()=>{be();Le();Gg=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."),zI=a.string().min(1).refine((e)=>new TextEncoder().encode(e).length<=cW,{message:`Script content must be at most ${cW} bytes (1 MiB).`}).describe("Bash script body materialized as /home/sazabi/scripts/<name>.sh in the sandbox."),sW=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()}),_I=sW.extend({content:zI}),ide=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.")}),ade=a.object({scripts:a.array(sW),nextCursor:a.string().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),cde=a.object({name:Gg.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.")}),sde=a.object({script:_I}),hde=a.object({projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted."),name:Gg.describe("Script name. Must be unique within the project among non-deleted scripts."),content:zI,description:a.string().max(500).nullable().optional().describe("Optional human-readable description.")}),lde=a.object({script:_I}),ude=a.object({name:Gg.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:zI.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.")}),gde=a.object({script:_I}),dde=a.object({name:Gg.describe("Script to delete."),projectId:a.string().uuid().optional().describe("Project that owns the script. Auto-filled from CLI and SDK context when omitted.")}),yde=a.object({deleted:a.boolean()}),jI=P({operationId:"scripts.list",description:"List durable bash scripts stored for a project.",backend:"api",route:{method:"GET",path:"/scripts",tags:["Scripts"]},input:ide,output:ade,pagination:"cursor",async:"sync"}),NI=P({operationId:"scripts.get",description:"Get a single project script by name, including its body.",backend:"api",route:{method:"GET",path:"/scripts/{name}",tags:["Scripts"]},input:cde,output:sde,pagination:"none",async:"sync"}),xI=P({operationId:"scripts.create",description:"Create a durable bash script for a project.",backend:"api",route:{method:"POST",path:"/scripts",successStatus:201,tags:["Scripts"]},input:hde,output:lde,pagination:"none",async:"sync"}),RI=P({operationId:"scripts.update",description:"Update a project script's body and/or description.",backend:"api",route:{method:"PATCH",path:"/scripts/{name}",tags:["Scripts"]},input:ude,output:gde,pagination:"none",async:"sync"}),UI=P({operationId:"scripts.delete",description:"Soft-delete a project script by name.",backend:"api",route:{method:"DELETE",path:"/scripts/{name}",successStatus:204,tags:["Scripts"]},input:dde,output:yde,pagination:"none",async:"sync"}),mYe={list:jI.contract,get:NI.contract,create:xI.contract,update:RI.contract,delete:UI.contract}});var MI,lW,uW,gW,dW,_i,ji,bde;var KI=g(()=>{be();Le();MI=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.")}),lW=MI.extend({status:a.enum(["regular","archived"]).optional().describe("Optional thread status filter.")}),uW=MI.extend({threadId:a.string().uuid().optional().describe("Optional thread restriction for message search."),role:a.enum(["user","assistant"]).optional().describe("Optional message role filter.")}),gW=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.")}),dW=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.")}),_i=P({operationId:"search.threads",description:"Search threads within one project.",backend:"api",route:{method:"GET",path:"/search/threads",tags:["Search"]},input:lW,output:gW,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}}}]}),ji=P({operationId:"search.messages",description:"Search messages within one project.",backend:"api",route:{method:"GET",path:"/search/messages",tags:["Search"]},input:uW,output:dW,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}}}]}),bde={threads:_i.contract,messages:ji.contract}});var es,bW,mW,pW,wW,fW,kW,vW,SW,PW,mde,JI,$W,Jg,Hg,Ni,Bg,Wg,IW,LW,Zg,TW,OW,xi,EI,pde,AW,CW,DW,wde,zW,_W,jW,HI,NW,xW,RW,Fg,Xg,Yg,Qg,ts,UW,qI,MW,ns,BI,KW,EW,fde,kde,WI,qW,GW,JW,HW,BW,WW,ZW,ZI,Vg,ed,td,nd,FI,FW,GI,Vc,XI,vde,od,XW,YW,QW,VW,yW,eZ,tZ,nZ,rd,id,oZ,YI,rZ,iZ,aZ,cZ,sZ,ad,cd,Sde;var QI=g(()=>{be();Le();es=a.object({id:a.string().uuid(),projectId:a.string().uuid(),name:a.string(),description:a.string().nullable(),origin:a.enum(["user_declared","code_detected","log_observed"]),lifecycle:a.enum(["active","retired","merged"]),observationState:a.enum(["observed","stale","unobserved"]),registryRevision:a.number().int().nonnegative(),canonicalComponentId:a.string().uuid(),mergedIntoComponentId:a.string().uuid().nullable(),currentStatus:a.enum(["operational","degraded","outage"]).describe("Current health status of this component."),firstSeenAt:a.string().datetime(),lastSeenAt:a.string().datetime(),deletedAt:a.string().datetime().nullable().describe("Timestamp when this component was retired, if any."),retiredAt:a.string().datetime().nullable(),retirementReason:a.string().nullable(),legacyStateUnknown:a.boolean().describe("True only for migration-era inactive rows whose retirement authority is unknown.")}),bW=a.object({projectId:a.string().uuid().optional().describe("Project to list status components 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 components to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page."),includeDeleted:a.union([a.boolean(),a.stringbool()]).default(!1).describe("When true, include retired and merged components.")}),mW=a.object({statusComponents:a.array(es),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),pW=a.object({componentId:a.string().uuid().describe("Status component ID to retrieve.")}),wW=a.object({statusComponent:es}),fW=a.object({projectId:a.string().uuid().optional().describe("Project to register the status component in. Auto-filled from CLI and SDK context when omitted."),name:a.string().trim().min(1,"Name is required").describe("Evidence-backed component name to register."),description:a.string().trim().min(1,"Description cannot be empty").optional().describe("Optional component description."),requestId:a.string().uuid().optional().describe("Project-scoped idempotency key. Reuse only for an identical registration request.")}),kW=a.object({statusComponent:es}),vW=a.object({componentId:a.string().uuid().describe("Active component ID to rename."),name:a.string().trim().min(1,"Name is required"),requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact rename."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for renaming the component.")}),SW=a.object({statusComponent:es}),PW=a.object({componentId:a.string().uuid().describe("Status component ID to deregister."),reason:a.string().trim().min(1,"Reason cannot be empty").optional().describe("Optional reason for audit logging.")}),mde=a.object({openIssueIds:a.array(a.string().uuid()),activeComponentIssueIds:a.array(a.string().uuid()),automationBindingIds:a.array(a.string().uuid()),notificationRuleIds:a.array(a.string().uuid()),dataSourceMappingIds:a.array(a.string().uuid()),observationIds:a.array(a.string().uuid()),relationshipIds:a.array(a.string().uuid()),recommendationScopeIds:a.array(a.string().uuid()),externalIncidentIds:a.array(a.string().uuid()),authorizedDeliveryIds:a.array(a.string().uuid()),authorizedAutomationRunIds:a.array(a.string().uuid())}),JI=a.object({requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),canonicalComponentName:a.string(),lifecycle:a.enum(["active","retired"]),affectedComponentIds:a.array(a.string().uuid()),componentRevisions:a.record(a.string().uuid(),a.number().int().nonnegative()),requiresCanonicalGroupConfirmation:a.boolean(),recommendationScopeEnabled:a.literal(!1),dependents:mde,counts:a.record(a.string(),a.number().int().nonnegative())}),$W=a.discriminatedUnion("status",[a.object({status:a.literal("observation_withdrawn"),componentId:a.string().uuid(),sourceType:a.literal("secret_key"),withdrawn:a.boolean()}),a.object({status:a.literal("retirement_confirmation_required"),preview:JI})]),Jg=P({operationId:"statusComponents.list",description:"List status page components in a project.",backend:"api",route:{method:"GET",path:"/status-components",tags:["Status Components"]},input:bW,output:mW,pagination:"cursor",async:"sync"}),Hg=P({operationId:"statusComponents.get",description:"Get a single status component by ID.",backend:"api",route:{method:"GET",path:"/status-components/{componentId}",tags:["Status Components"]},input:pW,output:wW,pagination:"none",async:"sync"}),Ni=P({operationId:"statusComponents.register",description:"Register a status page component in a project, or refresh an existing active component with the same name.",backend:"api",route:{method:"POST",path:"/status-components",tags:["Status Components"]},input:fW,output:kW,pagination:"none",async:"sync"}),Bg=P({operationId:"statusComponents.deregister",description:"Withdraw this credential's component observation, or return a retirement preview for a human caller.",backend:"api",route:{method:"POST",path:"/status-components/{componentId}/deregister",tags:["Status Components"]},input:PW,output:$W,pagination:"none",async:"sync"}),Wg=P({operationId:"statusComponents.rename",description:"Rename an active component while reserving its previous exact name as an alias.",backend:"api",route:{method:"POST",path:"/status-components/{componentId}/rename",tags:["Status Components"]},input:vW,output:SW,pagination:"none",async:"sync"}),IW=a.object({componentId:a.string().uuid().describe("Component whose owning team to set."),teamId:a.string().uuid().nullable().describe("Team to assign as owner, or null to unassign.")}),LW=a.object({componentId:a.string().uuid().describe("Component that was updated."),teamId:a.string().uuid().nullable().describe("Owning team after the update, or null when unassigned.")}),Zg=P({operationId:"statusComponents.assignTeam",description:"Assign a component to an owning team, reassign it, or unassign it. A component is owned by at most one team.",backend:"api",route:{method:"PUT",path:"/status-components/{componentId}/team",tags:["Status Components"]},input:IW,output:LW,pagination:"none",async:"sync"}),TW=a.object({componentId:a.string().uuid().describe("Component or merged-source ID whose canonical group to retire.")}),OW=a.object({preview:JI}),xi=a.record(a.string().uuid(),a.number().int().nonnegative()),EI=a.object({id:a.string().uuid(),rowRevision:a.number().int().nonnegative()}),pde=a.object({notificationRules:a.array(EI),automationBindings:a.array(EI),relationships:a.array(EI)}),AW=a.object({componentId:a.string().uuid().describe("Component or merged-source ID confirmed by the preview."),requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact retirement."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for retiring the component."),componentRevisions:xi.describe("Exact canonical-group revisions returned by retirementPreview."),confirmCanonicalGroup:a.boolean().default(!1).describe("Explicitly confirm retiring the complete canonical group when the request used a merged source.")}),CW=a.object({operationId:a.string().uuid(),status:a.enum(["committed","complete","followup_failed"]),requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),affectedComponentIds:a.array(a.string().uuid()),counts:a.record(a.string(),a.number().int().nonnegative()),authorizedDeliveryIds:a.array(a.string().uuid()),authorizedAutomationRunIds:a.array(a.string().uuid()),manualExternalIncidentIds:a.array(a.string().uuid()),issueAutomationSuppressions:a.number().int().nonnegative(),outboxEffectCount:a.number().int().nonnegative(),manifest:pde,followups:a.record(a.string(),a.unknown()).optional()}),DW=a.object({result:CW}),wde=a.object({notificationRuleIds:a.array(a.string().uuid()),automationBindingIds:a.array(a.string().uuid()),recommendationScopeIds:a.array(a.string().uuid()),relationshipIds:a.array(a.string().uuid())}),zW=a.object({componentId:a.string().uuid().describe("Retired component or merged-source ID to inspect."),retirementOperationId:a.string().uuid().optional().describe("Optional retirement operation to verify; defaults to the component's current retirement.")}),_W=a.object({requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),canonicalComponentName:a.string(),retirementOperationId:a.string().uuid(),affectedComponentIds:a.array(a.string().uuid()),componentRevisions:xi,eligible:wde}),jW=a.object({preview:_W}),HI=a.object({notificationRuleIds:a.array(a.string().uuid()).default([]),automationBindingIds:a.array(a.string().uuid()).default([]),recommendationScopeIds:a.array(a.string().uuid()).default([]),relationshipIds:a.array(a.string().uuid()).default([])}),NW=a.object({componentId:a.string().uuid().describe("Retired component or merged-source ID confirmed by preview."),retirementOperationId:a.string().uuid().describe("Retirement operation whose unchanged dependents may be restored."),requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact restoration."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for restoring the component."),componentRevisions:xi.describe("Exact canonical-group revisions returned by restorationPreview."),selections:HI.default({notificationRuleIds:[],automationBindingIds:[],recommendationScopeIds:[],relationshipIds:[]}).describe("Only these still-eligible dependents are restored; omitted selections restore none.")}),xW=a.object({operationId:a.string().uuid(),status:a.literal("complete"),requestedComponentId:a.string().uuid(),canonicalComponentId:a.string().uuid(),affectedComponentIds:a.array(a.string().uuid()),restored:HI}),RW=a.object({result:xW}),Fg=P({operationId:"statusComponents.retirementPreview",description:"Preview every synchronous and follow-up consequence of retiring a canonical component group.",backend:"api",route:{method:"POST",path:"/status-components/{componentId}/retirement/preview",tags:["Status Components"]},input:TW,output:OW,pagination:"none",async:"sync"}),Xg=P({operationId:"statusComponents.retire",description:"Atomically retire a confirmed canonical component group and durably enqueue lifecycle follow-ups.",backend:"api",route:{method:"POST",path:"/status-components/{componentId}/retire",tags:["Status Components"]},input:AW,output:DW,pagination:"none",async:"sync"}),Yg=P({operationId:"statusComponents.restorationPreview",description:"Preview unchanged retirement-owned dependents that remain eligible for explicit restoration.",backend:"api",route:{method:"POST",path:"/status-components/{componentId}/restoration/preview",tags:["Status Components"]},input:zW,output:jW,pagination:"none",async:"sync"}),Qg=P({operationId:"statusComponents.restore",description:"Restore a retired canonical component and only the explicitly selected eligible dependents.",backend:"api",route:{method:"POST",path:"/status-components/{componentId}/restore",tags:["Status Components"]},input:NW,output:RW,pagination:"none",async:"sync"}),ts=a.enum(["part_of","depends_on"]).describe("Relationship semantics: part_of is an acyclic child-to-parent edge; depends_on may be cyclic."),UW=a.enum(["observed","stale","unobserved"]),qI=a.object({originalComponentId:a.string().uuid(),effectiveComponentId:a.string().uuid(),name:a.string(),lifecycle:a.enum(["active","retired","merged"]),observationState:UW}),MW=a.object({id:a.string().uuid(),source:qI,target:qI,relationshipType:ts,createdAt:a.string().datetime(),endedAt:a.string().datetime().nullable(),endReason:a.string().nullable(),rowRevision:a.number().int().nonnegative()}),ns=a.object({projectId:a.string().uuid().optional().describe("Project containing the component topology. Auto-filled from CLI and SDK context when omitted.")}),BI=a.object({sourceComponentId:a.string().uuid().describe("Child or dependency-source component ID."),targetComponentId:a.string().uuid().describe("Parent or dependency-target component ID."),relationshipType:ts}),KW=ns.extend({includeHistorical:a.union([a.boolean(),a.stringbool()]).default(!1).describe("Include historically ended relationships.")}),EW=a.object({relationships:a.array(MW)}),fde=a.object({ruleId:a.string().uuid(),ruleGroupId:a.string().uuid().nullable(),ownerComponentId:a.string().uuid(),destinationIds:a.array(a.string().uuid()),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),kde=a.object({bindingId:a.string().uuid(),automationId:a.string().uuid(),ownerComponentId:a.string().uuid(),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),WI=a.object({notificationRules:a.array(fde),automationBindings:a.array(kde)}),qW=BI.extend({action:a.enum(["add","remove"]),organizationId:a.string(),projectId:a.string().uuid(),relationshipId:a.string().uuid().nullable(),componentRevisions:a.record(a.string().uuid(),a.number().int().nonnegative()),policyImpact:WI,confirmationRequired:a.boolean()}),GW=ns.merge(BI).extend({action:a.enum(["add","remove"]).describe("Topology mutation to preview without changing the graph.")}),JW=a.object({preview:qW}),HW=ns.merge(BI).extend({requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact mutation."),reason:a.string().trim().min(1,"Reason cannot be empty"),componentRevisions:a.record(a.string().uuid(),a.number().int().nonnegative()),confirmPolicyImpact:a.boolean().default(!1).describe("Confirm the descendant-scoped notification and automation changes shown by preview.")}),BW=HW,WW=HW,ZW=a.object({action:a.enum(["add","remove"]),relationshipId:a.string().uuid(),sourceComponentId:a.string().uuid(),targetComponentId:a.string().uuid(),relationshipType:ts,policyImpact:WI}),ZI=a.object({result:ZW}),Vg=P({operationId:"statusComponents.relationships.list",description:"List active or historical component topology edges.",backend:"api",route:{method:"GET",path:"/status-components/relationships",tags:["Status Components"]},input:KW,output:EW,pagination:"none",async:"sync"}),ed=P({operationId:"statusComponents.relationships.preview",description:"Preview descendant-scoped notification and automation impact for a topology change.",backend:"api",route:{method:"POST",path:"/status-components/relationships/preview",tags:["Status Components"]},input:GW,output:JW,pagination:"none",async:"sync"}),td=P({operationId:"statusComponents.relationships.add",description:"Add a confirmed, tenant-safe component topology edge.",backend:"api",route:{method:"POST",path:"/status-components/relationships",tags:["Status Components"]},input:BW,output:ZI,pagination:"none",async:"sync"}),nd=P({operationId:"statusComponents.relationships.remove",description:"Historically end a confirmed component topology edge.",backend:"api",route:{method:"POST",path:"/status-components/relationships/remove",tags:["Status Components"]},input:WW,output:ZI,pagination:"none",async:"sync"}),FI=a.enum(["suspend","move"]),FW=a.object({disposition:FI,beforeComponentIds:a.array(a.string().uuid()).describe("Exact effective component set returned by mergePreview."),afterComponentIds:a.array(a.string().uuid()).describe("Exact effective component set that ownership would have on the target.")}),GI=a.object({kind:a.enum(["notification_rule","automation_binding"]),policyId:a.string().uuid(),sourceRowRevision:a.number().int().nonnegative(),sourceComponentId:a.string().uuid(),equivalentPolicyId:a.string().uuid().nullable(),equivalent:a.boolean(),defaultDisposition:a.enum(["deduplicate","suspend"]),allowedDispositions:a.array(FI),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),Vc=a.object({kind:a.enum(["notification_rule","automation_binding"]),policyId:a.string().uuid(),ownerComponentId:a.string().uuid(),rowRevision:a.number().int().nonnegative(),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),XI=a.object({relationshipId:a.string().uuid(),action:a.enum(["rewire","close_self","close_duplicate"]),relationshipType:ts,beforeSourceComponentId:a.string().uuid(),beforeTargetComponentId:a.string().uuid(),afterSourceComponentId:a.string().uuid(),afterTargetComponentId:a.string().uuid(),survivingRelationshipId:a.string().uuid().nullable(),beforeRowRevision:a.number().int().nonnegative(),afterRowRevision:a.number().int().nonnegative().nullable()}),vde=a.object({openIssueIds:a.array(a.string().uuid()),componentIssueIds:a.array(a.string().uuid()),observationIds:a.array(a.string().uuid()),dataSourceMappingIds:a.array(a.string().uuid()),nameIds:a.array(a.string().uuid()),relationshipIds:a.array(a.string().uuid()),recommendationScopeIds:a.array(a.string().uuid())}),od=a.object({sourceComponentId:a.string().uuid().describe("Active or retired component whose independent grain is removed."),targetComponentId:a.string().uuid().describe("Active terminal component that becomes the canonical target.")}),XW=ns.merge(od),YW=od.extend({organizationId:a.string(),projectId:a.string().uuid(),sourceGroupComponentIds:a.array(a.string().uuid()),targetGroupComponentIds:a.array(a.string().uuid()),affectedComponentIds:a.array(a.string().uuid()),componentRevisions:xi,inventory:vde,notificationPolicies:a.array(GI),automationBindings:a.array(GI),notificationScopeChanges:a.array(Vc),automationScopeChanges:a.array(Vc),relationshipChanges:a.array(XI),recommendationScopeEnabled:a.literal(!1),dependentCount:a.number().int().nonnegative(),ordinaryTransactionLimit:a.number().int().positive(),operatorAssistanceRequired:a.boolean(),confirmationRequired:a.boolean()}),QW=a.object({preview:YW}),VW=ns.merge(od).extend({requestId:a.string().uuid().describe("Project-scoped idempotency key for this exact consolidation."),reason:a.string().trim().min(1,"Reason cannot be empty").describe("Customer-visible audit reason for consolidation."),componentRevisions:xi.describe("Exact canonical-group revisions returned by mergePreview."),policyDispositions:a.record(a.string().uuid(),FW).describe("Exactly one disposition for every non-equivalent source policy; each repeats the previewed effective sets."),confirmPolicyImpact:a.boolean().default(!1).describe("Explicitly acknowledge every before/after policy scope change shown by mergePreview.")}),yW=a.object({policyId:a.string().uuid(),action:a.enum(["deduplicated","suspended","moved"]),equivalentPolicyId:a.string().uuid().nullable(),beforeRowRevision:a.number().int().nonnegative(),afterRowRevision:a.number().int().nonnegative(),beforeComponentIds:a.array(a.string().uuid()),afterComponentIds:a.array(a.string().uuid())}),eZ=a.object({componentRevisions:xi,redirectedComponentIds:a.array(a.string().uuid()),dataSourceMappingIds:a.array(a.string().uuid()),movedAliasIds:a.array(a.string().uuid()),historicalDisplayIds:a.array(a.string().uuid()),relationshipChanges:a.array(XI),notificationPolicies:a.array(yW),automationBindings:a.array(yW),notificationScopeChanges:a.array(Vc),automationScopeChanges:a.array(Vc),recommendationScopeIds:a.array(a.string().uuid())}),tZ=od.extend({operationId:a.string().uuid(),status:a.literal("complete"),affectedComponentIds:a.array(a.string().uuid()),manifest:eZ}),nZ=a.object({result:tZ}),rd=P({operationId:"statusComponents.mergePreview",description:"Preview one-hop redirects, historical preservation, operational rebinding, topology contraction, and policy dispositions for component consolidation.",backend:"api",route:{method:"POST",path:"/status-components/merge/preview",tags:["Status Components"]},input:XW,output:QW,pagination:"none",async:"sync"}),id=P({operationId:"statusComponents.merge",description:"Consolidate a source into an active terminal target without rewriting historical issue or observation attribution.",backend:"api",route:{method:"POST",path:"/status-components/merge",tags:["Status Components"]},input:VW,output:nZ,pagination:"none",async:"sync"}),oZ=a.enum(["degraded","outage"]).describe("Severity of a status-page incident. 'outage' marks the component down; 'degraded' marks partial impact."),YI=a.object({id:a.string().uuid(),componentId:a.string().uuid(),projectId:a.string().uuid(),severity:oZ,summary:a.string().describe("Human-readable summary of the status-page issue."),startedAt:a.string().datetime().describe("When the incident began affecting the component."),resolvedAt:a.string().datetime().nullable().describe("When the incident was resolved, or null while ongoing.")}),rZ=a.object({projectId:a.string().uuid().optional().describe("Project to list status-page issues for. Auto-filled from CLI and SDK context when omitted."),componentId:a.string().uuid().optional().describe("Restrict results to a single component."),activeOnly:a.union([a.boolean(),a.stringbool()]).default(!1).describe("When true, return only unresolved (ongoing) issues."),limit:a.coerce.number().int().min(1).max(100).default(50).describe("Maximum number of issues to return per page."),cursor:a.string().uuid().optional().describe("Cursor from a previous response's nextCursor to fetch the next page.")}),iZ=a.object({incidents:a.array(YI),nextCursor:a.string().uuid().nullable().describe("Pass as 'cursor' to fetch the next page. Null when there are no more results.")}),aZ=a.object({timestamp:a.string().datetime(),status:a.enum(["operational","degraded","outage","unknown"]).describe("Worst component status observed during this timeline bucket.")}),cZ=a.object({componentId:a.string().uuid().describe("Status component to build the timeline for."),windowStart:a.string().datetime({offset:!0}).optional().describe("Start of the timeline window. Defaults to 7 days before windowEnd."),windowEnd:a.string().datetime({offset:!0}).optional().describe("End of the timeline window. Defaults to now.")}),sZ=a.object({componentId:a.string().uuid(),windowStart:a.string().datetime(),windowEnd:a.string().datetime(),timeline:a.array(aZ),incidents:a.array(YI)}),ad=P({operationId:"statusComponents.incidents.list",description:"List status-page issues in a project.",backend:"api",route:{method:"GET",path:"/status-incidents",tags:["Status Components"]},input:rZ,output:iZ,pagination:"cursor",async:"sync"}),cd=P({operationId:"statusComponents.timeline",description:"Get the dense status timeline and incidents for a component over a time window.",backend:"api",route:{method:"GET",path:"/status-components/{componentId}/timeline",tags:["Status Components"]},input:cZ,output:sZ,pagination:"none",async:"sync"}),Sde={list:Jg.contract,get:Hg.contract,register:Ni.contract,deregister:Bg.contract,rename:Wg.contract,assignTeam:Zg.contract,retirementPreview:Fg.contract,retire:Xg.contract,restorationPreview:Yg.contract,restore:Qg.contract,mergePreview:rd.contract,merge:id.contract,relationships:{list:Vg.contract,preview:ed.contract,add:td.contract,remove:nd.contract},incidents:{list:ad.contract},timeline:cd.contract}});var hZ;var lZ=g(()=>{hZ=["onboarding","setup"]});var uZ,gZ,dZ,yZ,os;var VI=g(()=>{lZ();be();Le();uZ=a.enum(hZ),gZ=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:uZ.describe("Task category: onboarding (core setup steps) or setup (additional configuration).")}),dZ=a.object({projectId:a.string().uuid().optional().describe("Project to list tasks for. Auto-filled from CLI and SDK context when omitted.")}),yZ=a.object({tasks:a.array(gZ).describe("All onboarding and setup tasks with their current completion status.")}),os=P({operationId:"tasks.list",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:dZ,output:yZ,pagination:"none",async:"sync"})});var Pde,$de,Yo,Ide,Lde,Tde,Ode,Ade,Cde,Dde,zde,_de,jde,Nde,xde,Rde,Ude,eL,tL,nL,oL,rL,iL,aL,DYe;var bZ=g(()=>{be();Le();Pde=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.")}),$de=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.")}),Yo=a.string().min(1).optional().describe("Organization to operate on. Auto-filled from CLI and SDK context when omitted."),Ide=a.object({organizationId:Yo}),Lde=a.object({teams:a.array(Pde).describe("Active teams in the organization.")}),Tde=a.object({organizationId:Yo,name:a.string().trim().min(1).describe("Team name."),description:a.string().trim().min(1).optional().describe("Optional team description.")}),Ode=a.object({id:a.string().uuid().describe("ID of the created team.")}),Ade=a.object({organizationId:Yo,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.")}),Cde=a.object({id:a.string().uuid().describe("ID of the updated team.")}),Dde=a.object({params:a.object({teamId:a.string().uuid().describe("Team to delete.")}),query:a.object({organizationId:Yo})}).transform(({params:e,query:t})=>({...t,...e})),zde=a.object({success:a.literal(!0).describe("The team and its memberships were removed.")}),_de=a.object({organizationId:Yo,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.")}),jde=a.object({id:a.string().uuid().describe("ID of the team membership.")}),Nde=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:Yo})}).transform(({params:e,query:t})=>({...t,...e})),xde=a.object({success:a.literal(!0).describe("The membership was removed.")}),Rde=a.object({organizationId:Yo,teamId:a.string().uuid().describe("Team to list members for.")}),Ude=a.object({members:a.array($de).describe("Active members of the team.")}),eL=P({operationId:"teams.list",description:"List teams in an organization.",backend:"api",route:{method:"GET",path:"/teams",tags:["Teams"]},input:Ide,output:Lde,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}]}}]}),tL=P({operationId:"teams.create",description:"Create a team in an organization.",backend:"api",route:{method:"POST",path:"/teams",tags:["Teams"],successStatus:201},input:Tde,output:Ode,pagination:"none",async:"sync"}),nL=P({operationId:"teams.update",description:"Rename a team or update its description.",backend:"api",route:{method:"PATCH",path:"/teams/{teamId}",tags:["Teams"]},input:Ade,output:Cde,pagination:"none",async:"sync"}),oL=P({operationId:"teams.delete",description:"Delete a team, its memberships, and its component-ownership assignments.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}",tags:["Teams"],inputStructure:"detailed"},input:Dde,output:zde,pagination:"none",async:"sync"}),rL=P({operationId:"teams.addMember",description:"Add an active organization member to a team.",backend:"api",route:{method:"POST",path:"/teams/{teamId}/members",tags:["Teams"],successStatus:201},input:_de,output:jde,pagination:"none",async:"sync"}),iL=P({operationId:"teams.removeMember",description:"Remove a member from a team.",backend:"api",route:{method:"DELETE",path:"/teams/{teamId}/members/{userId}",tags:["Teams"],inputStructure:"detailed"},input:Nde,output:xde,pagination:"none",async:"sync"}),aL=P({operationId:"teams.listMembers",description:"List a team's active members.",backend:"api",route:{method:"GET",path:"/teams/{teamId}/members",tags:["Teams"]},input:Rde,output:Ude,pagination:"none",async:"sync"}),DYe={list:eL.contract,create:tL.contract,update:nL.contract,delete:oL.contract,addMember:rL.contract,removeMember:iL.contract,listMembers:aL.contract}});var cL;var mZ=g(()=>{oD();iD();lD();qk();Hk();FD();dS();mS();wS();O$();Og();TH();R$();VH();LB();DB();zB();_B();OI();BB();CI();Dg();DI();hW();KI();QI();VI();bZ();eI();cL={me:A$.contract,automations:{list:Tk.contract,get:Ok.contract,create:Ak.contract,update:Ck.contract,enable:Dk.contract,disable:zk.contract,runs:{list:_k.contract,get:jk.contract,logs:Nk.contract}},logs:{query:Qr.contract,schema:Vr.contract,volume:ei.contract,patterns:ti.contract,nativeQuery:ni.contract,searchNatural:su.contract},dataSources:{listTypes:Gl.contract,listInstances:Zr.contract,createInstance:Fr.contract,getInstance:Jl.contract,updateInstance:Hl.contract,deleteInstance:Bl.contract,listStreams:Wl.contract,createStream:Zl.contract,getStream:Fl.contract,updateStream:Xl.contract,deleteStream:Yl.contract},logSources:{listProviders:Vl.contract,list:Xr.contract,create:Yr.contract,get:eu.contract,update:tu.contract,delete:nu.contract,listStreams:ou.contract,createStream:ru.contract,getStream:iu.contract,updateStream:au.contract,deleteStream:cu.contract},integrations:{listProviders:cD.contract,listConnections:sD.contract,getConnection:hD.contract},notificationChannels:{getProject:aI.contract},notificationDeliveryRules:{list:dI.contract,options:yI.contract,create:bI.contract,update:mI.contract,delete:pI.contract},mcpConnectors:{listProviders:Tg.contract,list:vi.contract,get:Si.contract,details:Pi.contract},sandboxPresets:{listConnections:zi.contract,listTypes:Eg.contract,upsertPreset:qg.contract},scripts:{list:jI.contract,get:NI.contract,create:xI.contract,update:RI.contract,delete:UI.contract},logMatchExpressions:{list:Zk.contract,get:Fk.contract,create:Xk.contract,update:Yk.contract,disable:Qk.contract},memory:{put:Ii.contract,get:Li.contract,list:Ti.contract,search:Oi.contract,delete:Ai.contract},onboarding:{getState:fI.contract,skipIntegration:kI.contract,skipGithubAppInstallation:vI.contract,skipSampleIssue:SI.contract,finish:PI.contract},organizations:{list:II.contract,get:LI.contract,create:$I.contract,update:TI.contract},members:{list:C$.contract,updateRole:D$.contract,remove:z$.contract},teams:{list:eL.contract,create:tL.contract,update:nL.contract,delete:oL.contract,addMember:rL.contract,removeMember:iL.contract,listMembers:aL.contract},publicKeys:{list:Gr.contract,get:Jr.contract,ensureLogForwarding:Hr.contract,update:Br.contract,deactivate:Wr.contract},secretKeys:{list:jl.contract,get:Nl.contract,create:xl.contract,update:Rl.contract,delete:Ul.contract},projects:{list:xg.contract,get:Rg.contract,create:Ug.contract,update:Mg.contract,delete:Kg.contract},search:{threads:_i.contract,messages:ji.contract},messages:{list:YH.contract,append:QH.contract},threads:{list:G$.contract,get:J$.contract,getStatus:H$.contract,stop:B$.contract,create:W$.contract,update:Z$.contract,fork:F$.contract,setVisibility:X$.contract,createShareLink:Y$.contract,listShareLinks:Q$.contract,revokeShareLink:V$.contract},runs:{list:U$.contract,listForThread:M$.contract,get:K$.contract,cancel:E$.contract},pullRequests:{list:AI.contract},issues:{count:Pl.contract,create:qr.contract,list:vl.contract,search:Sl.contract,get:$l.contract,resolve:Il.contract,ignore:Ll.contract,reopen:Tl.contract,reassignAndReopen:Ol.contract,mute:Al.contract,unmute:Cl.contract},billing:{getSummary:xk.contract,getUsage:Rk.contract,listTransactions:Uk.contract},tasks:{list:os.contract},recommendations:{list:Qc.contract},statusComponents:{list:Jg.contract,get:Hg.contract,register:Ni.contract,deregister:Bg.contract,rename:Wg.contract,assignTeam:Zg.contract,retirementPreview:Fg.contract,retire:Xg.contract,restorationPreview:Yg.contract,restore:Qg.contract,mergePreview:rd.contract,merge:id.contract,relationships:{list:Vg.contract,preview:ed.contract,add:td.contract,remove:nd.contract},incidents:{list:ad.contract},timeline:cd.contract}}});var Ri=g(()=>{YC();mZ();qk();Hk();dS();mS();wS();O$();R$();OI();CI();DI();KI();QI();VI()});var Mde="https://api.sazabi.com",Kde="x-sazabi-client-source",wZ=(e)=>{return{streamRun:async(t)=>{return pZ({options:e,path:`/runs/${encodeURIComponent(t.runId)}/stream`,cursor:t.cursor,signal:t.signal})},streamThread:async(t)=>{return pZ({options:e,path:`/threads/${encodeURIComponent(t.threadId)}/stream`,cursor:t.cursor,signal:t.signal})}}},pZ=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=Ede(e.options.apiBaseUrl,e.path,e.cursor);return Gde({url:r,token:n,clientSource:e.options.clientSource,initialCursor:e.cursor,signal:e.signal,fetch:t})},Ede=(e,t,n)=>{let r=qde(e??Mde),o=new URL(`${r}${t}`);if(n)o.searchParams.set(Sk,n);return o.toString()},qde=(e)=>{let t=e.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},Gde=async(e)=>{let t=[],n=[],r=!1,o=!1,i,c=e.initialCursor,s=new AbortController,h=(k)=>{if(r)return;r=!0,i=k;while(n.length>0)n.shift()?.({value:void 0,done:!0})},l=(k)=>{let L=n.shift();if(L){L({value:k,done:!1});return}t.push(k)},u=(k)=>{if(k.event===$k){let A=Zde(k.data);if(A!==void 0)c=A;return}if(k.data===Ik){o=!0,s.abort(),h();return}let L=Fde(k.data);if(L)l(L)},d=()=>{o=!0,s.abort(),h()};if(e.signal)if(e.signal.aborted)o=!0,s.abort();else e.signal.addEventListener("abort",d,{once:!0});let y={[Symbol.asyncIterator](){return y},get cursor(){return c},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((k)=>{n.push(k)}).then((k)=>{if(k.done&&i)throw i;return k})},return:async()=>{return o=!0,s.abort(),h(),{value:void 0,done:!0}},throw:async(k)=>{throw o=!0,s.abort(),h(k instanceof Error?k:Error(String(k))),k},close:async()=>{o=!0,s.abort(),h()}};if(o)return h(),y;let p=await e.fetch(e.url,{method:Pk,headers:Jde(e.token,e.clientSource),signal:s.signal});if(await Hde(p))h();else Bde(p,u).then(()=>h()).catch((k)=>{if(Yde(k)||o||e.signal?.aborted){h();return}h(Qde(k))});return y},Jde=(e,t)=>{return{accept:"text/event-stream",authorization:`Bearer ${e}`,...t?{[Kde]:t}:{}}},Hde=async(e)=>{if(e.status===204)return!0;if(e.ok&&e.body)return!1;let t=await Xde(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}`)},Bde=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=Wde(t);try{while(!0){let c=await n.read();if(c.done)break;o+=r.decode(c.value,{stream:!0});let s=o.split(/\r\n|\r|\n/);o=s.pop()??"";for(let h of s)i.line(h)}if(o+=r.decode(),o)for(let c of o.split(/\r\n|\r|\n/))i.line(c);i.flush()}finally{n.releaseLock()}},Wde=(e)=>{let t="message",n=[],r=()=>{t="message",n=[]},o=()=>{if(n.length===0){r();return}e({event:t,data:n.join(`
8616
8616
  `)}),r()};return{line:(i)=>{if(i===""){o();return}if(i.startsWith(":"))return;let c=i.indexOf(":"),s=c===-1?i:i.slice(0,c),h=c===-1?"":i.slice(c+1),l=h.startsWith(" ")?h.slice(1):h;if(s==="event"){t=l||"message";return}if(s==="data")n.push(l)},flush:o}},Zde=(e)=>{try{let t=vk.safeParse(JSON.parse(e));return t.success?t.data.streamNextOffset:void 0}catch{return}},Fde=(e)=>{try{let t=kk.safeParse(JSON.parse(e));return t.success?t.data:void 0}catch{return}},Xde=async(e)=>{try{return await e.text()}catch{return""}},Yde=(e)=>{return e instanceof Error&&e.name==="AbortError"},Qde=(e)=>{return e instanceof Error?e:Error(String(e))};var fZ=g(()=>{Ri()});var sL,hL,lL,kZ;var vZ=g(()=>{be();sL=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.")}),hL=a.object({service:a.string(),namespace:a.string(),environment:a.string(),host:a.string(),container:a.string(),pod:a.string()}),lL=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:hL}),kZ=a.object({type:a.literal("logs"),timestamp:a.string().datetime(),data:a.array(lL)})});var Vde="https://{region}.intake.sazabi.com",eye="https://{region}.tail.sazabi.com",$Z=500,tye=5000,IZ="sazabi.public_key",nye="x-sazabi-internal-log-forwarding-secret",oye="x-sazabi-internal-log-forwarding-source",rye=(e)=>{return e.startsWith("[")&&e.endsWith("]")?e.slice(1,-1):e},LZ=(e)=>{let t=rye(e);return t==="localhost"||t==="127.0.0.1"||t==="::1"},iye,aye,cye,TZ=(e)=>{let t=new Map;return{tail:async(n)=>{let r=await fye(e.credentialProvider,n.projectId,"logs.tail"),o=await kye(e,t,r,n.region,"logs.tail"),i=lye({projectId:r,region:o,filters:n.filters,apiBaseUrl:e.apiBaseUrl,tailBaseUrl:e.tailBaseUrl}),c=await e.credentialProvider.getToken(),s=e.fetch??globalThis.fetch;if(!s)throw Error("Fetch transport is not available in this runtime.");return Sye({token:c,url:i,signal:n.signal,fetch:s})},forward:async(n)=>{let r=await vye(e,t,n.projectId??await e.credentialProvider.getProjectId?.(),n.region,"logs.forward"),o=yye(r,e.intakeBaseUrl),i=e.fetch??globalThis.fetch,c=mye(n.logs,n.publicKey),s=Cye(c);return await Aye(i,o,c,wye(n.sazabiInternalForwarding)),{forwardedCount:s,failedCount:0}}}},sye="3010",hye,lye=(e)=>{let t=(e.tailBaseUrl??uye({region:e.region,apiBaseUrl:e.apiBaseUrl})).replace("{region}",e.region),n=gye(t);n.searchParams.set("projectId",e.projectId);let r=dye(e.filters);if(r)n.searchParams.set("filters",r);return n.toString()},uye=(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 eye.replace("{region}",e.region)},gye=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)throw Error(`Invalid tail base URL: ${e}`);if(LZ(t.hostname)){if(t.protocol="http:",!t.port||hye.has(t.port))t.port=sye;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},dye=(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))},yye=(e,t)=>{let n=(t??Vde).replace("{region}",e),r=n.endsWith("/")?n.slice(0,-1):n,o=bye(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`},bye=(e)=>{let t=(()=>{try{return new URL(e)}catch{return null}})();if(!t)return;if(!LZ(t.hostname))return;return t.pathname="/adapters/otlp",t.toString()},mye=(e,t)=>{let n=e.resourceLogs;if(!n||n.length===0)return{...e,resourceLogs:[{resource:{attributes:[OZ(t)]},scopeLogs:[]}]};return{...e,resourceLogs:n.map((r)=>({...r,resource:{...r.resource,attributes:pye(r.resource?.attributes,t)}}))}},pye=(e,t)=>{return[...(e??[]).filter((r)=>r?.key!==IZ),OZ(t)]},OZ=(e)=>({key:IZ,value:{stringValue:e}}),wye=(e)=>{if(!e?.secret)return{};return{[nye]:e.secret,...e.source?{[oye]:e.source}:{}}},fye=async(e,t,n)=>{let r=t??await e.getProjectId?.();if(r)return r;throw DZ(n,"Project ID is required",["projectId"])},kye=async(e,t,n,r,o)=>{return r??await AZ(e,t,n)},vye=async(e,t,n,r,o)=>{if(r)return r;if(!n)throw DZ(o,"Project ID is required",["projectId"]);return AZ(e,t,n)},AZ=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}},Sye=async(e)=>{let t=[],n=[],r=!1,o=!1,i,c=0,s,h,l=(L)=>{if(r)return;r=!0,i=L;while(n.length>0){let A=n.shift();if(A)A({value:void 0,done:!0})}},u=(L)=>{let A=n.shift();if(A){A({value:L,done:!1});return}t.push(L)},d=()=>{h?.abort()},y=(L)=>{if(L.event!=="log"){if(L.id)s=L.id;return}let A=Tye(L.data);for(let K of A)u(K);if(L.id)s=L.id},p=async(L)=>{let A=!1;while(!r&&!o){let K=new AbortController,x=()=>K.abort();h=K;let Y=!1;e.signal?.addEventListener("abort",x,{once:!0});try{let E=await e.fetch(Pye(e.url,s),{method:"GET",headers:{accept:"text/event-stream",authorization:`Bearer ${e.token}`},signal:K.signal});await $ye(E),c=0,A=!0,L(),await Iye(E,y),Y=!0}catch(E){if(PZ(E)||e.signal?.aborted)break;let we=SZ(E);if(!A||Oye(we))throw we;Y=!0}finally{if(e.signal?.removeEventListener("abort",x),h===K)h=void 0}if(r||o||e.signal?.aborted)break;if(!Y)continue;c+=1,await CZ(Math.min($Z*2**(c-1),tye),e.signal)}};if(e.signal?.addEventListener("abort",()=>{o=!0,d(),l()},{once:!0}),e.signal?.aborted)o=!0,d(),l();await new Promise((L,A)=>{let K=!1;p(()=>{if(!K)K=!0,L()}).catch((Y)=>{let E=SZ(Y);if(!K){K=!0,A(E);return}if(!PZ(Y))l(E)})});let k={[Symbol.asyncIterator](){return k},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((L)=>{n.push(L)}).then((L)=>{if(L.done&&i)throw i;return L})},return:async()=>{return o=!0,d(),l(),{value:void 0,done:!0}},throw:async(L)=>{throw o=!0,d(),l(L instanceof Error?L:Error(String(L))),L}};return k},Pye=(e,t)=>{if(!t)return e;let n=new URL(e);return n.searchParams.set("cursor",t),n.toString()},$ye=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}`)},Iye=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=Lye(t);try{while(!0){let c=await n.read();if(c.done)break;o+=r.decode(c.value,{stream:!0});let s=o.split(/\r\n|\r|\n/);o=s.pop()??"";for(let h of s)i.line(h)}if(o+=r.decode(),o){let c=o.split(/\r\n|\r|\n/);for(let s of c)i.line(s)}i.flush()}finally{n.releaseLock()}},Lye=(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(`
8617
- `),...n?{id:n}:{}}),o()};return{line:(c)=>{if(c===""){i();return}if(c.startsWith(":"))return;let s=c.indexOf(":"),h=s===-1?c:c.slice(0,s),l=s===-1?"":c.slice(s+1),u=l.startsWith(" ")?l.slice(1):l;if(h==="event"){t=u||"message";return}if(h==="data"){r.push(u);return}if(h==="id"&&!u.includes("\x00"))n=u},flush:i}},Tye=(e)=>{try{let t=kZ.safeParse(JSON.parse(e));if(!t.success)return[];return t.data.data}catch{return[]}},SZ=(e)=>{return e instanceof Error?e:Error(String(e))},PZ=(e)=>{return e instanceof Error&&e.name==="AbortError"},Oye=(e)=>{return e.message.startsWith("Authentication failed")||e.message.startsWith("Forbidden (")||e.message.startsWith("Wrong region (")||e.message.startsWith("Client error (")},Aye=async(e,t,n,r={},o=3,i=1e4)=>{let c;for(let s=0;s<=o;s+=1){let h=new AbortController,l=globalThis.setTimeout(()=>h.abort(),i);try{let u=await e(t,{method:"POST",headers:{"content-type":"application/json",...r},body:JSON.stringify(n),signal:h.signal});if(u.ok)return;let d=await u.text();if(u.status===401||u.status===403)throw Error("Authentication failed. Check your public key.");if(u.status>=400&&u.status<500&&u.status!==429)throw Error(`Client error (${u.status}): ${d}`);c=Error(u.status===429?`Rate limited (429): ${d}`:`Server error (${u.status}): ${d}`)}catch(u){let d=u instanceof Error?u.message:String(u);if(d.startsWith("Authentication failed")||d.startsWith("Client error ("))throw u instanceof Error?u:Error(d);c=u instanceof Error&&u.name==="AbortError"?Error("Request timed out"):u instanceof Error?u:Error(String(u))}finally{globalThis.clearTimeout(l)}if(s<o)await CZ($Z*2**s)}throw Error(`Failed after ${o+1} attempts: ${c?.message??"Unknown error"}`)},Cye=(e)=>{return e.resourceLogs?.reduce((t,n)=>t+(n.scopeLogs?.reduce((r,o)=>r+(o.logRecords?.length??0),0)??0),0)??0},CZ=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})})},DZ=(e,t,n)=>{return new Qe("BAD_REQUEST",{message:t,data:{operationId:e,missingContext:n}})};var uL=g(()=>{lr();vZ();be();iye=a.object({projectId:a.string().uuid().optional().describe("Project to tail logs for. Auto-filled from CLI and SDK context when omitted."),filters:sL.optional().describe("Optional filters applied by the tail SSE service.")}),aye=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.")}),cye=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.")}),hye=new Set(["15006","3010"])});var gL="https://api.sazabi.com",_Z="https://api.platform.sazabi.com",jZ="sazabi-cli",Dye="urn:ietf:params:oauth:grant-type:device_code",NZ=(e)=>{let t=hy(new Sy(cL,{url:zye(e.apiBaseUrl??gL),headers:async()=>{let o=new Headers({authorization:`Bearer ${await e.credentialProvider.getToken()}`});if(e.clientSource)o.set("x-sazabi-client-source",e.clientSource);return o},fetch:e.fetch,customErrorResponseBodyDecoder:(o,i)=>{let c=Mye(o);if(!c)return null;return new Qe(c.code,{message:c.message,status:i.status,data:{operationId:c.operationId,missingContext:c.missingContext}})}})),n=TZ({raw:t,credentialProvider:e.credentialProvider,fetch:e.fetch,apiBaseUrl:e.apiBaseUrl??gL,intakeBaseUrl:e.intakeBaseUrl,tailBaseUrl:e.tailBaseUrl}),r=wZ({credentialProvider:e.credentialProvider,fetch:e.fetch,apiBaseUrl:e.apiBaseUrl??gL,clientSource:e.clientSource});return{raw:t,me:async()=>t.me({}),automations:{list:async(o={})=>t.automations.list(await te(e.credentialProvider,o,"automations.list")),get:async(o)=>t.automations.get(await te(e.credentialProvider,o,"automations.get")),create:async(o)=>t.automations.create(await te(e.credentialProvider,o,"automations.create")),update:async(o)=>t.automations.update(await te(e.credentialProvider,o,"automations.update")),enable:async(o)=>t.automations.enable(await te(e.credentialProvider,o,"automations.enable")),disable:async(o)=>t.automations.disable(await te(e.credentialProvider,o,"automations.disable")),runs:{list:async(o)=>t.automations.runs.list(await te(e.credentialProvider,o,"automations.runs.list")),get:async(o)=>t.automations.runs.get(await te(e.credentialProvider,o,"automations.runs.get")),logs:async(o)=>t.automations.runs.logs(await te(e.credentialProvider,o,"automations.runs.logs"))}},logs:{...n,query:async(o={})=>t.logs.query(await te(e.credentialProvider,o,Qr.operationId)),schema:async(o={})=>t.logs.schema(await te(e.credentialProvider,o,Vr.operationId)),volume:async(o)=>t.logs.volume(await te(e.credentialProvider,o,ei.operationId)),patterns:async(o={})=>t.logs.patterns(await te(e.credentialProvider,o,ti.operationId)),nativeQuery:async(o)=>t.logs.nativeQuery(await te(e.credentialProvider,o,ni.operationId))},organizations:{list:async()=>t.organizations.list({}),get:async(o)=>t.organizations.get(o),update:async(o)=>t.organizations.update(await jye(e.credentialProvider,o))},members:{list:async(o={})=>t.members.list(await Fe(e.credentialProvider,o)),updateRole:async(o)=>t.members.updateRole(await Fe(e.credentialProvider,o)),remove:async(o)=>{let i=await Fe(e.credentialProvider,o);return t.members.remove({params:{userId:i.userId},query:{organizationId:i.organizationId}})}},teams:{list:async(o={})=>t.teams.list(await Fe(e.credentialProvider,o)),create:async(o)=>t.teams.create(await Fe(e.credentialProvider,o)),update:async(o)=>t.teams.update(await Fe(e.credentialProvider,o)),delete:async(o)=>{let i=await Fe(e.credentialProvider,o);return t.teams.delete({params:{teamId:i.teamId},query:{organizationId:i.organizationId}})},addMember:async(o)=>t.teams.addMember(await Fe(e.credentialProvider,o)),removeMember:async(o)=>{let i=await Fe(e.credentialProvider,o);return t.teams.removeMember({params:{teamId:i.teamId,userId:i.userId},query:{organizationId:i.organizationId}})},listMembers:async(o)=>t.teams.listMembers(await Fe(e.credentialProvider,o))},publicKeys:{list:async(o={})=>t.publicKeys.list(await te(e.credentialProvider,o,Gr.operationId)),get:async(o)=>t.publicKeys.get(await te(e.credentialProvider,o,Jr.operationId)),ensureLogForwarding:async(o={})=>t.publicKeys.ensureLogForwarding(await te(e.credentialProvider,o,Hr.operationId)),update:async(o)=>t.publicKeys.update(await te(e.credentialProvider,o,Br.operationId)),deactivate:async(o)=>{let i=await te(e.credentialProvider,o,Wr.operationId);return t.publicKeys.deactivate({params:{keyId:i.keyId},query:{projectId:i.projectId}})}},secretKeys:{list:async(o={})=>t.secretKeys.list(o),get:async(o)=>t.secretKeys.get(o),create:async(o)=>t.secretKeys.create(o),update:async(o)=>t.secretKeys.update(o),delete:async(o)=>{await t.secretKeys.delete({params:{keyId:o.keyId}})}},search:{threads:async(o)=>t.search.threads(await te(e.credentialProvider,o,_i.operationId)),messages:async(o)=>t.search.messages(await te(e.credentialProvider,o,ji.operationId))},projects:{list:async(o={})=>t.projects.list(await _ye(e.credentialProvider,o)),get:async(o)=>t.projects.get(o),create:async(o)=>t.projects.create(await Fe(e.credentialProvider,o))},messages:{list:async(o)=>t.messages.list(o),append:async(o)=>zZ(t,await t.messages.append(Uye(o)))},threads:{list:async(o={})=>t.threads.list(await Nye(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)=>zZ(t,await t.threads.create(await Rye(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 xye(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)},dataSources:{listTypes:async()=>t.dataSources.listTypes({}),instances:{list:async(o={})=>t.dataSources.listInstances(await te(e.credentialProvider,o,Zr.operationId)),get:async(o)=>t.dataSources.getInstance(o),create:async(o)=>t.dataSources.createInstance(await te(e.credentialProvider,o,Fr.operationId)),update:async(o)=>t.dataSources.updateInstance(o),delete:async(o)=>t.dataSources.deleteInstance(o)},streams:{list:async(o)=>t.dataSources.listStreams(o),get:async(o)=>t.dataSources.getStream(o),create:async(o)=>t.dataSources.createStream(o),update:async(o)=>t.dataSources.updateStream(o),delete:async(o)=>t.dataSources.deleteStream(o)}},logSources:{listProviders:async()=>t.logSources.listProviders({}),list:async(o={})=>t.logSources.list(await te(e.credentialProvider,o,Xr.operationId)),get:async(o)=>t.logSources.get(o),create:async(o)=>t.logSources.create(await te(e.credentialProvider,o,Yr.operationId)),update:async(o)=>t.logSources.update(o),delete:async(o)=>t.logSources.delete(o),streams:{list:async(o)=>t.logSources.listStreams(o),get:async(o)=>t.logSources.getStream(o),create:async(o)=>t.logSources.createStream(o),update:async(o)=>t.logSources.updateStream(o),delete:async(o)=>t.logSources.deleteStream(o)}},integrations:{listProviders:async(o={})=>t.integrations.listProviders(await Fe(e.credentialProvider,o)),listConnections:async(o={})=>t.integrations.listConnections(await Fe(e.credentialProvider,o)),getConnection:async(o)=>t.integrations.getConnection(await Fe(e.credentialProvider,o))},mcpConnectors:{list:async(o={})=>t.mcpConnectors.list(await te(e.credentialProvider,o,vi.operationId)),get:async(o)=>t.mcpConnectors.get(await te(e.credentialProvider,o,Si.operationId)),details:async(o)=>t.mcpConnectors.details(await te(e.credentialProvider,o,Pi.operationId)),listProviders:async()=>t.mcpConnectors.listProviders({})},sandboxPresets:{listConnections:async(o={})=>t.sandboxPresets.listConnections(await te(e.credentialProvider,o,zi.operationId)),listTypes:async()=>t.sandboxPresets.listTypes({})},memory:{list:async(o={})=>t.memory.list(await te(e.credentialProvider,o,Ti.operationId)),get:async(o)=>t.memory.get(await te(e.credentialProvider,o,Li.operationId)),put:async(o)=>t.memory.put(await te(e.credentialProvider,o,Ii.operationId)),search:async(o)=>t.memory.search(await te(e.credentialProvider,o,Oi.operationId)),delete:async(o)=>t.memory.delete(await te(e.credentialProvider,o,Ai.operationId))},logMatchExpressions:{list:async(o={})=>t.logMatchExpressions.list(await te(e.credentialProvider,o,"logMatchExpressions.list")),get:async(o)=>t.logMatchExpressions.get(await te(e.credentialProvider,o,"logMatchExpressions.get")),create:async(o)=>t.logMatchExpressions.create(await te(e.credentialProvider,o,"logMatchExpressions.create")),update:async(o)=>t.logMatchExpressions.update(await te(e.credentialProvider,o,"logMatchExpressions.update")),disable:async(o)=>t.logMatchExpressions.disable(await te(e.credentialProvider,o,"logMatchExpressions.disable"))},scripts:{list:async(o={})=>t.scripts.list(await te(e.credentialProvider,o,"scripts.list")),get:async(o)=>t.scripts.get(await te(e.credentialProvider,o,"scripts.get")),create:async(o)=>t.scripts.create(await te(e.credentialProvider,o,"scripts.create")),update:async(o)=>t.scripts.update(await te(e.credentialProvider,o,"scripts.update")),delete:async(o)=>t.scripts.delete(await te(e.credentialProvider,o,"scripts.delete"))},issues:{count:async(o={})=>t.issues.count(await te(e.credentialProvider,o,"issues.count")),create:async(o)=>t.issues.create(await te(e.credentialProvider,o,qr.operationId)),list:async(o={})=>t.issues.list(await te(e.credentialProvider,o,"issues.list")),search:async(o={})=>t.issues.search(await te(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)},pullRequests:{list:async(o={})=>t.pullRequests.list(await te(e.credentialProvider,o,"pullRequests.list"))},statusComponents:{list:async(o={})=>t.statusComponents.list(await te(e.credentialProvider,o,"statusComponents.list")),get:async(o)=>t.statusComponents.get(o),register:async(o)=>t.statusComponents.register(await te(e.credentialProvider,o,Ni.operationId)),deregister:async(o)=>t.statusComponents.deregister({componentId:o.componentId,...o.reason!==void 0?{reason:o.reason}:{}}),rename:async(o)=>t.statusComponents.rename(o),assignTeam:async(o)=>t.statusComponents.assignTeam(o),retirementPreview:async(o)=>t.statusComponents.retirementPreview(o),retire:async(o)=>t.statusComponents.retire(o),restorationPreview:async(o)=>t.statusComponents.restorationPreview(o),restore:async(o)=>t.statusComponents.restore(o),mergePreview:async(o)=>t.statusComponents.mergePreview(await te(e.credentialProvider,o,"statusComponents.mergePreview")),merge:async(o)=>t.statusComponents.merge(await te(e.credentialProvider,o,"statusComponents.merge")),relationships:{list:async(o={})=>t.statusComponents.relationships.list(await te(e.credentialProvider,o,"statusComponents.relationships.list")),preview:async(o)=>t.statusComponents.relationships.preview(await te(e.credentialProvider,o,"statusComponents.relationships.preview")),add:async(o)=>t.statusComponents.relationships.add(await te(e.credentialProvider,o,"statusComponents.relationships.add")),remove:async(o)=>t.statusComponents.relationships.remove(await te(e.credentialProvider,o,"statusComponents.relationships.remove"))},incidents:{list:async(o={})=>t.statusComponents.incidents.list(await te(e.credentialProvider,o,"statusComponents.incidents.list"))},timeline:async(o)=>t.statusComponents.timeline(o)},billing:{getSummary:async(o={})=>t.billing.getSummary(await Fe(e.credentialProvider,o)),getUsage:async(o={})=>t.billing.getUsage(await Fe(e.credentialProvider,o)),listTransactions:async(o={})=>t.billing.listTransactions(await Fe(e.credentialProvider,o))},tasks:{list:async(o={})=>t.tasks.list(await te(e.credentialProvider,o,os.operationId))},recommendations:{list:async(o={})=>t.recommendations.list(await te(e.credentialProvider,o,Qc.operationId))}}},yL=async(e={})=>{let t=await UZ(e.fetch)(xZ(e.apiBaseUrl??_Z,"/device/code"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:e.clientId??jZ,...e.scope?{scope:e.scope}:{}})}),n=await t.json();if(!t.ok)throw Kye(n,t.status);let r=n;return{deviceCode:Ui(r.device_code,"device_code"),userCode:Ui(r.user_code,"user_code"),verificationUri:Ui(r.verification_uri,"verification_uri"),verificationUriComplete:Ui(r.verification_uri_complete,"verification_uri_complete"),expiresIn:dL(r.expires_in,"expires_in"),interval:dL(r.interval,"interval")}},bL=async(e)=>{let t=await UZ(e.fetch)(xZ(e.apiBaseUrl??_Z,"/device/token"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:Dye,device_code:e.deviceCode,client_id:e.clientId??jZ})}),n=await t.json();if(t.ok){let o=n;return{status:"authorized",accessToken:Ui(o.access_token,"access_token"),tokenType:Ui(o.token_type,"token_type"),expiresIn:dL(o.expires_in,"expires_in"),scope:typeof o.scope==="string"?o.scope:""}}let r=RZ(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)},zye=(e)=>{let t=e.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},xZ=(e,t)=>{return`${e.replace(/\/+$/,"")}/api/auth${t}`},_ye=async(e,t)=>{return Fe(e,t)},Fe=async(e,t)=>{let n=t.organizationId??await e.getOrganizationId?.();return n?{...t,organizationId:n}:t},jye=async(e,t)=>{let n=t.organizationId??await e.getOrganizationId?.();if(!n)throw new Qe("BAD_REQUEST",{message:"Organization ID is required",data:{operationId:"organizations.update",missingContext:["organizationId"]},status:400});return{...t,organizationId:n}},te=async(e,t,n)=>{let r=t.projectId??await e.getProjectId?.();if(!r)throw new Qe("BAD_REQUEST",{message:"Project ID is required",data:{operationId:n,missingContext:["projectId"]},status:400});return{...t,projectId:r}},Nye=async(e,t)=>{let n=t.projectId??await e.getProjectId?.();return n?{...t,projectId:n}:t},xye=async(e,t)=>{let n=t.projectId??await e.getProjectId?.();return n?{...t,projectId:n}:t},Rye=async(e,t)=>{let n=t.projectId??await e.getProjectId?.();return n?{...t,projectId:n}:t},Uye=(e)=>{return{threadId:e.threadId,message:e.message,wait:e.wait??!0,timeoutSeconds:e.timeoutSeconds??20,...e.automationId!==void 0?{automationId:e.automationId}:{}}},Mye=(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"):[]}},RZ=(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}},Kye=(e,t)=>{let n=RZ(e);return Error(n?.errorDescription??`Device authorization failed with status ${t}`)},UZ=(e)=>{return e??globalThis.fetch},zZ=(e,t)=>({result:t,poll:()=>e.runs.get({runId:t.runId}),waitForCompletion:async(n={})=>Eye(e,t,n)}),Eye=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 qye(r),i=await e.runs.get({runId:i.runId})}return i},qye=async(e)=>{await new Promise((t)=>globalThis.setTimeout(t,e))},Ui=(e,t)=>{if(typeof e==="string")return e;throw Error(`Expected '${t}' to be a string.`)},dL=(e,t)=>{if(typeof e==="number")return e;throw Error(`Expected '${t}' to be a number.`)};var mL=g(()=>{lr();ZT();Ri();fZ();uL();uL()});var We=(e)=>({success:!0,value:e}),Me=(e,t,n)=>({success:!1,error:e,...t!==void 0&&{statusCode:t},...n!==void 0&&{errorPayload:n}}),w=(e,t,n)=>{if(!e.success){let r=`${t}: ${e.error}`;if(n)return b(e.errorPayload??r);return m(r)}return e.value};var ie=g(()=>{ee()});var Gye="https://api.sazabi.com",O=async(e)=>{try{return We(await e())}catch(t){let n=Jye(t),r=Hye(t),o=t instanceof Error?t.message:String(t);return Me(o,r,n)}},Jye=(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,missingContext:Array.isArray(n.missingContext)?n.missingContext.filter((r)=>typeof r==="string"):[]}},Hye=(e)=>{if(!e||typeof e!=="object")return;let t=e;return typeof t.status==="number"?t.status:void 0},Gn=(e)=>{let t=NZ({apiBaseUrl:e.baseUrl??Gye,clientSource:"cli",credentialProvider:{getToken:()=>e.token,getOrganizationId:()=>e.organizationId,getProjectId:()=>e.projectId},intakeBaseUrl:e.intakeBaseUrl,tailBaseUrl:e.tailBaseUrl});return{me:()=>O(()=>t.me()),automations:{list:(n={})=>O(()=>t.automations.list(n)),get:(n)=>O(()=>t.automations.get({automationId:n})),create:(n)=>O(()=>t.automations.create(n)),update:(n)=>O(()=>t.automations.update(n)),enable:(n)=>O(()=>t.automations.enable({automationId:n})),disable:(n)=>O(()=>t.automations.disable({automationId:n})),runs:{list:(n,r={})=>O(()=>t.automations.runs.list({automationId:n,...r})),get:(n,r)=>O(()=>t.automations.runs.get({automationId:n,runId:r})),logs:(n,r)=>O(()=>t.automations.runs.logs({automationId:n,runId:r}))}},logs:{tail:(n)=>O(()=>t.logs.tail(n)),forward:(n)=>O(()=>t.logs.forward(n)),query:(n={})=>O(()=>t.logs.query(n)),schema:(n={})=>O(()=>t.logs.schema(n)),volume:(n)=>O(()=>t.logs.volume(n)),patterns:(n={})=>O(()=>t.logs.patterns(n)),nativeQuery:(n)=>O(()=>t.logs.nativeQuery(n))},organizations:{list:()=>O(()=>t.organizations.list()),get:(n)=>O(()=>t.organizations.get({organizationId:n})),rename:(n,r)=>O(()=>t.organizations.update({organizationId:r,name:n}))},members:{list:(n={})=>O(()=>t.members.list(n)),updateRole:(n,r,o)=>O(()=>t.members.updateRole({organizationId:o,userId:n,role:r})),remove:(n,r)=>O(()=>t.members.remove({organizationId:r,userId:n}))},teams:{list:(n={})=>O(()=>t.teams.list(n)),create:(n,r,o)=>O(()=>t.teams.create({organizationId:o,name:n,...r!==void 0?{description:r}:{}})),update:(n,r,o)=>O(()=>t.teams.update({organizationId:o,teamId:n,...r.name!==void 0?{name:r.name}:{},...r.description!==void 0?{description:r.description}:{}})),delete:(n,r)=>O(()=>t.teams.delete({organizationId:r,teamId:n})),addMember:(n,r,o)=>O(()=>t.teams.addMember({organizationId:o,teamId:n,userId:r})),removeMember:(n,r,o)=>O(()=>t.teams.removeMember({organizationId:o,teamId:n,userId:r})),listMembers:(n,r)=>O(()=>t.teams.listMembers({organizationId:r,teamId:n}))},projects:{list:(n={})=>O(()=>t.projects.list(n)),get:(n)=>O(()=>t.projects.get({projectId:n})),create:(n)=>O(()=>t.projects.create(n))},threads:{list:(n={})=>O(()=>t.threads.list(n)),get:(n)=>O(()=>t.threads.get({threadId:n})),create:(n)=>O(()=>t.threads.create(n)),getStatus:(n)=>O(()=>t.threads.getStatus({threadId:n})),update:(n,r)=>O(()=>t.threads.update({threadId:n,status:r})),fork:(n,r)=>O(()=>t.threads.fork({threadId:n,messageId:r})),setVisibility:(n,r)=>O(()=>t.threads.setVisibility({threadId:n,visibility:r})),createShareLink:(n)=>O(()=>t.threads.createShareLink({threadId:n})),listShareLinks:(n)=>O(()=>t.threads.listShareLinks({threadId:n})),revokeShareLink:(n,r)=>O(()=>t.threads.revokeShareLink({threadId:n,shareId:r})),stop:(n)=>O(()=>t.threads.stop({threadId:n})),stream:(n)=>O(()=>t.threads.stream(n))},messages:{list:(n,r={})=>O(()=>t.messages.list({threadId:n,...r})),append:(n,r,o,i,c,s)=>O(()=>t.messages.append({threadId:n,message:r,wait:o,timeoutSeconds:i,...c!==void 0?{automationId:c}:{},...s?{ambientServiceRun:s}:{}}))},runs:{get:(n)=>O(()=>t.runs.get({runId:n})),cancel:(n)=>O(()=>t.runs.cancel({runId:n})),stream:(n)=>O(()=>t.runs.stream(n))},search:{threads:(n)=>O(()=>t.search.threads(n)),messages:(n)=>O(()=>t.search.messages(n))},publicKeys:{list:(n)=>O(()=>t.publicKeys.list(n)),get:(n,r)=>O(()=>t.publicKeys.get(r?{keyId:n,projectId:r}:{keyId:n})),ensureLogForwarding:(n)=>O(()=>t.publicKeys.ensureLogForwarding(n)),update:(n)=>O(()=>t.publicKeys.update(n)),deactivate:(n)=>O(()=>t.publicKeys.deactivate(n))},secretKeys:{list:(n)=>O(()=>t.secretKeys.list(n)),get:(n)=>O(()=>t.secretKeys.get({keyId:n})),create:(n)=>O(()=>t.secretKeys.create(n)),update:(n)=>O(()=>t.secretKeys.update(n)),delete:(n)=>O(()=>t.secretKeys.delete(n))},issues:{count:(n={})=>O(()=>t.issues.count(n)),create:(n)=>O(()=>t.issues.create(n)),list:(n={})=>O(()=>t.issues.list(n)),search:(n={})=>O(()=>t.issues.search(n)),get:(n)=>O(()=>t.issues.get({issueId:n})),resolve:(n)=>O(()=>t.issues.resolve({issueId:n})),ignore:(n)=>O(()=>t.issues.ignore({issueId:n})),reopen:(n)=>O(()=>t.issues.reopen({issueId:n})),mute:(n)=>O(()=>t.issues.mute({issueId:n})),unmute:(n)=>O(()=>t.issues.unmute({issueId:n}))},pullRequests:{list:(n={})=>O(()=>t.pullRequests.list(n))},statusComponents:{list:(n={})=>O(()=>t.statusComponents.list(n)),get:(n)=>O(()=>t.statusComponents.get({componentId:n})),register:(n)=>O(()=>t.statusComponents.register(n)),deregister:(n,r)=>O(()=>t.statusComponents.deregister({componentId:n,...r!==void 0?{reason:r}:{}})),rename:(n)=>O(()=>t.statusComponents.rename(n)),retirementPreview:(n)=>O(()=>t.statusComponents.retirementPreview(n)),retire:(n)=>O(()=>t.statusComponents.retire(n)),restorationPreview:(n)=>O(()=>t.statusComponents.restorationPreview(n)),restore:(n)=>O(()=>t.statusComponents.restore(n)),mergePreview:(n)=>O(()=>t.statusComponents.mergePreview(n)),merge:(n)=>O(()=>t.statusComponents.merge(n)),relationships:{list:(n={})=>O(()=>t.statusComponents.relationships.list(n)),preview:(n)=>O(()=>t.statusComponents.relationships.preview(n)),add:(n)=>O(()=>t.statusComponents.relationships.add(n)),remove:(n)=>O(()=>t.statusComponents.relationships.remove(n))},incidents:{list:(n={})=>O(()=>t.statusComponents.incidents.list(n))},timeline:(n)=>O(()=>t.statusComponents.timeline(n))},billing:{getSummary:(n={})=>O(()=>t.billing.getSummary(n)),getUsage:(n={})=>O(()=>t.billing.getUsage(n)),listTransactions:(n={})=>O(()=>t.billing.listTransactions(n))},tasks:{list:(n={})=>O(()=>t.tasks.list(n))},recommendations:{list:(n={})=>O(()=>t.recommendations.list(n))},dataSources:{listTypes:()=>O(()=>t.dataSources.listTypes()),instances:{list:(n)=>O(()=>t.dataSources.instances.list(n)),get:(n)=>O(()=>t.dataSources.instances.get({instanceId:n})),create:(n)=>O(()=>t.dataSources.instances.create(n)),update:(n)=>O(()=>t.dataSources.instances.update(n)),delete:(n)=>O(()=>t.dataSources.instances.delete({instanceId:n}))},streams:{list:(n)=>O(()=>t.dataSources.streams.list({instanceId:n})),get:(n)=>O(()=>t.dataSources.streams.get({streamId:n})),create:(n)=>O(()=>t.dataSources.streams.create(n)),update:(n)=>O(()=>t.dataSources.streams.update(n)),delete:(n)=>O(()=>t.dataSources.streams.delete({streamId:n}))}},logSources:{listProviders:()=>O(()=>t.logSources.listProviders()),list:(n)=>O(()=>t.logSources.list(n)),get:(n)=>O(()=>t.logSources.get({logSourceId:n})),create:(n)=>O(()=>t.logSources.create(n)),update:(n)=>O(()=>t.logSources.update(n)),delete:(n)=>O(()=>t.logSources.delete({logSourceId:n})),streams:{list:(n)=>O(()=>t.logSources.streams.list({logSourceId:n})),get:(n)=>O(()=>t.logSources.streams.get({streamId:n})),create:(n)=>O(()=>t.logSources.streams.create(n)),update:(n)=>O(()=>t.logSources.streams.update(n)),delete:(n)=>O(()=>t.logSources.streams.delete({streamId:n}))}},integrations:{listProviders:()=>O(()=>t.integrations.listProviders()),listConnections:(n)=>O(()=>t.integrations.listConnections(n)),getConnection:(n)=>O(()=>t.integrations.getConnection({connectionId:n}))},mcpConnectors:{list:(n)=>O(()=>t.mcpConnectors.list(n)),get:(n)=>O(()=>t.mcpConnectors.get(n)),details:(n)=>O(()=>t.mcpConnectors.details(n)),listProviders:()=>O(()=>t.mcpConnectors.listProviders())},sandboxPresets:{listTypes:()=>O(()=>t.sandboxPresets.listTypes())},memory:{list:(n={})=>O(()=>t.memory.list(n)),get:(n)=>O(()=>t.memory.get(n)),search:(n)=>O(()=>t.memory.search(n)),put:(n)=>O(()=>t.memory.put({kind:"note",...n})),delete:(n)=>O(()=>t.memory.delete(n))},logMatchExpressions:{list:(n={})=>O(()=>t.logMatchExpressions.list(n)),get:(n)=>O(()=>t.logMatchExpressions.get({expressionId:n})),create:(n)=>O(()=>t.logMatchExpressions.create(n)),update:(n,r={})=>O(()=>t.logMatchExpressions.update({expressionId:n,...r})),disable:(n)=>O(()=>t.logMatchExpressions.disable({expressionId:n}))},scripts:{list:(n={})=>O(()=>t.scripts.list(n)),get:(n)=>O(()=>t.scripts.get({name:n})),create:(n)=>O(()=>t.scripts.create(n)),update:(n,r={})=>O(()=>t.scripts.update({name:n,...r})),delete:(n)=>O(()=>t.scripts.delete({name:n}))}}};var rs=g(()=>{mL();ie()});var MZ;var KZ=g(()=>{MZ={version:2,activeProfile:"default",profiles:{default:{}}}});import*as Jn from"node:fs";import*as EZ from"node:os";import*as fL from"node:path";var yt=(e)=>{if(e===void 0||e===null)return;if(typeof e==="string")return e.length>0?e:void 0;return},pL,Mi,Bye=()=>{if(!Jn.existsSync(pL))Jn.mkdirSync(pL,{recursive:!0,mode:448})},wL,qZ=(e)=>{wL=e},GZ=(e)=>({token:yt(e.token),activeOrganizationId:yt(e.activeOrganizationId??e.organizationId),organizationName:yt(e.organizationName),activeProjectId:yt(e.activeProjectId??e.defaultProjectId),apiBaseUrl:yt(e.apiBaseUrl),authBaseUrl:yt(e.authBaseUrl),webBaseUrl:yt(e.webBaseUrl),intakeBaseUrl:yt(e.intakeBaseUrl),tailBaseUrl:yt(e.tailBaseUrl),apiDomain:yt(e.apiDomain),webDomain:yt(e.webDomain),intakeDomain:yt(e.intakeDomain),tailDomain:yt(e.tailDomain),forwardPublicKey:yt(e.forwardPublicKey),forwardPublicKeyProjectId:yt(e.forwardPublicKeyProjectId)}),Wye=(e)=>({version:2,activeProfile:"default",profiles:{default:GZ(e)}}),Zye=(e)=>{let t=yt(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]=GZ(i)}if(!r[t])r[t]={};return{version:2,activeProfile:t,profiles:r}},Re=()=>{try{if(!Jn.existsSync(Mi))return We(MZ);let e=Jn.readFileSync(Mi,"utf-8"),t=JSON.parse(e),n=typeof t.version==="number"?t.version:void 0;if(n!==void 0&&n>2)return Me("Settings file requires a newer CLI version. Upgrade with 'npm install -g @sazabi/cli@latest'.");if(n===2)return We(Zye(t));let r=Wye(t),o=Xe(r);if(!o.success)return o;return We(r)}catch(e){let t=e instanceof Error?e.message:String(e);return Me(t)}},Xe=(e)=>{try{return Bye(),Jn.writeFileSync(Mi,JSON.stringify(e,null,2),{encoding:"utf-8",mode:384}),We(void 0)}catch(t){let n=t instanceof Error?t.message:String(t);return Me(n)}},Ln=(e,t)=>{if(t)return t;if(wL)return wL;let n=process.env.SAZABI_PROFILE?.trim();if(n)return n;return e.activeProfile??"default"},Rt=(e,t)=>{let n=Ln(e,t),r=e.profiles[n];if(r)return We(r);if(n==="default")return We({});return Me(`Profile '${n}' does not exist. Run 'sazabi profiles create ${n}' first.`)},Hn=()=>{let e=Re();if(!e.success)return e;return Rt(e.value)},Ut=(e,t,n)=>{let r=Ln(e,n);if(!e.profiles[r])return Me(`Profile '${r}' does not exist. Run 'sazabi profiles create ${r}' first.`);return We({...e,profiles:{...e.profiles,[r]:{...e.profiles[r],...t}}})},Bn=(e)=>{if(!e?.forwardPublicKey&&!e?.forwardPublicKeyProjectId)return{};return{forwardPublicKey:void 0,forwardPublicKeyProjectId:void 0}};var Vt=g(()=>{KZ();ie();pL=fL.join(EZ.homedir(),".sazabi"),Mi=fL.join(pL,"settings.json")});var Tn=(e)=>{let{cliFlag:t,globalUrl:n,globalDomain:r,buildUrlFromDomain:o,defaultUrl:i}=e;if(t)return t;let c=process.env.SAZABI_API_URL?.trim();if(c)return c;if(n)return n;if(r)return o(r);return i},C=(e)=>{let{tokenFlag:t,organizationIdFlag:n,projectIdFlag:r,jsonMode:o}=e,i=t?.trim(),c=process.env.SAZABI_TOKEN?.trim(),s=process.env.SAZABI_ORGANIZATION_ID?.trim(),h=process.env.SAZABI_PROJECT_ID?.trim(),l=w(Hn(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",o),u=l.token?.trim(),d=(i&&i.length>0?i:void 0)||(c&&c.length>0?c:void 0)||u,y=i&&i.length>0?"flag":c&&c.length>0?"environment":"settings";if(!d||d.length===0){if(o)return b("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.");return m("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.")}let p,f;if(n)p=n,f="flag";else if(s&&s.length>0)p=s,f="environment";else if(l.activeOrganizationId)p=l.activeOrganizationId,f="settings";let k,L;if(r)k=r,L="flag";else if(h&&h.length>0)k=h,L="environment";else if(l.activeProjectId)k=l.activeProjectId,L="settings";return{token:d,type:"token",projectId:k,organizationId:p,tokenSource:y,organizationSource:f,projectSource:L}},vL=(e)=>{let t=w(Hn(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",e?.jsonMode);return Tn({cliFlag:e?.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(n)=>`https://api.${n}`,defaultUrl:"https://api.sazabi.com"})},z=(e)=>{let t=vL({apiBaseUrlFlag:e.apiBaseUrlFlag,jsonMode:e.jsonMode});return Gn({token:e.token,baseUrl:t,organizationId:e.organizationId,projectId:e.projectId})},JZ,kL,hd=async(e)=>{let t=w(Hn(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",e.jsonMode),n=Tn({cliFlag:e.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(h)=>`https://api.${h}`,defaultUrl:"https://api.sazabi.com"}),r=`${e.token}@${n}@${e.projectId??""}`,o=JZ.get(r);if(o)return o;let i=kL.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 m("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.")}let c=e.projectId,s=(async()=>{let l=await Gn({token:e.token,baseUrl:n,projectId:c}).projects.get(c),d=w(l,"Couldn't fetch project info (run 'sazabi projects list' to verify the project ID)",e.jsonMode).project;return JZ.set(r,d),d})();kL.set(r,s);try{return await s}finally{kL.delete(r)}},sd=(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\.)+/,"")}`},Ki=(e)=>{let t=(r)=>r.replace(/\/+$/,"");if(e)return t(e);let n=w(Hn(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)");if(n.webBaseUrl)return t(n.webBaseUrl);if(n.webDomain)return sd(n.webDomain);if(n.apiDomain)return sd(n.apiDomain);return"https://app.sazabi.com"},On=(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 m(n)},ko=(e,t)=>{return`${Ki(t)}/projects/${e}`},Ye=(e,t,n,r)=>{let o=`${Ki(n)}/projects/${e}/threads/${t}`;return r?`${o}?messageId=${encodeURIComponent(r)}`:o},HZ=(e,t,n,r)=>{return Ye(e,t,n,r)},BZ=(e,t,n)=>{return`${ko(e,n)}/issues/${t}`},WZ=(e,t,n)=>{return`${ko(e,n)}/automations/${t}`},ZZ=(e,t)=>{return`${ko(e,t)}/status`},ld=(e,t,n)=>{return`${ko(e,n)}/settings/log-sources/${t}`},FZ=(e,t,n)=>{return`${ko(e,n)}/settings/mcp-connectors/${t}`},XZ=(e,t,n)=>{return`${ko(e,n)}/settings/sandbox/catalog/${t}`},YZ=(e,t)=>{return`https://otlp.${t}.intake.${e}`};var ce=g(()=>{ee();rs();ie();Vt();JZ=new Map,kL=new Map});var Cd,CY=(e)=>{Cd.set(e.name,e)},Dd=(e)=>{return Cd.get(e)},ks=()=>{return Array.from(Cd.values())},DY=(e)=>{return Cd.has(e)};var WL=g(()=>{Cd=new Map});async function YL(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 QL(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 Wi(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 Ss(e){let t=await e.dataSources.instances.list();if(!t.success)return[];return t.value.instances.map((n)=>({value:n.id,description:n.name??n.dataSourceType}))}async function jY(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 Vve=3000,eSe,NY=async(e,t,n)=>{try{let r=eSe[e]?.[t];if(!r)return[];let o=Hn();if(!o.success)return[];let i=o.value,c=process.env.SAZABI_TOKEN?.trim()||i.token?.trim();if(!c)return[];let s=Tn({globalUrl:i.apiBaseUrl,globalDomain:i.apiDomain,buildUrlFromDomain:(u)=>`https://api.${u}`,defaultUrl:"https://api.sazabi.com"}),h=Gn({token:c,baseUrl:s,organizationId:i.activeOrganizationId,projectId:i.activeProjectId});return(await Promise.race([r(h),new Promise((u)=>setTimeout(()=>u([]),Vve))])).filter((u)=>u.value.startsWith(n))}catch{return[]}};var xY=g(()=>{rs();ce();Vt();eSe={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:YL,update:YL,deactivate:YL},"secret-keys":{get:QL,update:QL,delete:QL},"log-sources":{get:Wi,rename:Wi,enable:Wi,disable:Wi,delete:Wi,remove:Wi},"data-sources":{get:Ss,rename:Ss,enable:Ss,disable:Ss,delete:Ss},members:{"update-role":jY,remove:jY}}});var UY={};yn(UY,{parseCompletionContext:()=>oSe,getCompletions:()=>rSe});var tSe,nSe,oSe=(e)=>{let t=e.length>0?e:[""],n=t.length-1,r=t[n]??"";return{words:t,currentIndex:n,partial:r}},rSe=async(e)=>{let{words:t,currentIndex:n,partial:r}=e,o=t[n-1];if(o==="--profile")return sSe(r);let i=cSe(t),c=Math.max(0,i.length-(t.length-n));if(c===0)return iSe(r);let s=i[0]??"",h=Dd(s);if(!h)return[];if(c===1&&h.subcommands){if(r.startsWith("-"))return RY(h.options,i);return aSe(h,r)}let l=h.subcommands?i[1]:void 0,d=(l?h.subcommands?.[l]:void 0)?.options??h.options;if(r.startsWith("-"))return RY(d,i);if(o?.startsWith("--")){let y=o.slice(2);if(d?.[y]?.type==="string"){let f=`${s}:${l??""}`,k=nSe[f]?.[y]??tSe[y];if(k)return k.filter((L)=>L.startsWith(r)).map((L)=>({value:L}));return[]}}return NY(s,l??"",r)},iSe=(e)=>{let n=ks().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},aSe=(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}))},RY=(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,c]of Object.entries(e)){let s=`--${i}`;if(r.has(s))continue;if(!s.startsWith(n))continue;o.push({value:s,description:c.description})}return o},cSe=(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},sSe=(e)=>{try{let t=Re();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 MY=g(()=>{WL();Vt();xY();tSe={status:["regular","archived"],format:["json","text"]},nSe={"members:update-role":{role:["admin","member"]},"messages:search":{role:["user","assistant"]},"messages:list":{role:["user","assistant"]}}});ee();ee();ee();import{parseArgs as yQ}from"node:util";var $=(e,t,n={})=>{let r=yQ({args:e,options:t,allowPositionals:Boolean(n.allowPositionals),strict:!1,tokens:!0}),o=Object.hasOwn(t,"json")&&r.values.json===!0,i=new Set(Object.keys(t)),c=new Set(Object.entries(t).map(([,h])=>h.short).filter((h)=>Boolean(h))),s=[];if(Array.isArray(r.tokens))for(let h of r.tokens){if(h.kind!=="option")continue;let l=h.name,u=l.length>1;if(!(i.has(l)||!u&&c.has(l))){let y=u?`--${l}`:`-${l}`;if(!s.includes(y))s.push(y)}}for(let h of Object.keys(r.values))if(!i.has(h)){let l=h.length>1?`--${h}`:`-${h}`;if(!s.includes(l))s.push(l)}if(s.length>0){let h=`Unknown option${s.length>1?"s":""}: ${s.join(", ")}. Run the command with -h for usage.`;if(o)b(h);m(h)}for(let[h,l]of Object.entries(t))if(l.type==="string"&&r.values[h]===!0){let u=h.length===1?`-${h}`:`--${h}`,d=`Option ${u} requires a value. Use '${u} <value>'.`;if(o)b(d);m(d)}for(let[h,l]of Object.entries(t)){let u=r.values[h];if(l.type==="string"&&typeof u==="string"){if(u.startsWith("--")||u.length===2&&u[0]==="-"&&/[a-zA-Z]/.test(u.charAt(1))){let p=`Option ${h.length===1?`-${h}`:`--${h}`} received "${u}" as its value. Did you forget to provide a value?`;if(o)b(p);m(p)}}}return{values:r.values,positionals:r.positionals}};var Ts=(e,t)=>{if(e?.json?.type!=="boolean")throw Error(`${t} must include a boolean --json option (enforced by CommandBuilder)`)};class bT{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)Ts(this.options,`Subcommand "${this.name}"`);if(!this.allowNoJson&&this.subcommands){for(let[e,t]of Object.entries(this.subcommands))if(!t.subcommands)Ts(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 mT{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)Ts(this.options,`Command "${this.name}"`);if(this.subcommands)for(let[e,t]of Object.entries(this.subcommands)){if(t.subcommands)continue;Ts(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 Q=(e,t)=>{return new mT(e,t)},S=(e,t,n)=>{return new bT(e,t,n)};ee();var ut=(e,t,n,r,o)=>{let i=Number.parseInt(e,10);if(Number.isNaN(i)||i<t||i>n){let c=`${r} must be between ${t} and ${n}.`;if(o)return b(c);return m(c)}return i},Dt=(e,t,n,r)=>{if(!t.includes(e)){let o=t.map((c)=>`"${c}"`).join(" or "),i=`${n} must be ${o}.`;if(r)return b(i);return m(i)}return e};ee();ce();ie();var PL=(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},VZ=(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)}},eF=(e,t)=>{return PL(e).find((n)=>n.id===t)},SL=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),QZ=(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},Fye=(e)=>{if(Array.isArray(e)&&e.every(SL))return e;if(SL(e))for(let t of["rows","data","items","points"]){let n=e[t];if(Array.isArray(n)&&n.every(SL))return n}return null},tF=(e)=>{let t=Fye(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(QZ).join(",")];for(let o of t)r.push(n.map((i)=>QZ(o[i])).join(","));return r.join(`
8617
+ `),...n?{id:n}:{}}),o()};return{line:(c)=>{if(c===""){i();return}if(c.startsWith(":"))return;let s=c.indexOf(":"),h=s===-1?c:c.slice(0,s),l=s===-1?"":c.slice(s+1),u=l.startsWith(" ")?l.slice(1):l;if(h==="event"){t=u||"message";return}if(h==="data"){r.push(u);return}if(h==="id"&&!u.includes("\x00"))n=u},flush:i}},Tye=(e)=>{try{let t=kZ.safeParse(JSON.parse(e));if(!t.success)return[];return t.data.data}catch{return[]}},SZ=(e)=>{return e instanceof Error?e:Error(String(e))},PZ=(e)=>{return e instanceof Error&&e.name==="AbortError"},Oye=(e)=>{return e.message.startsWith("Authentication failed")||e.message.startsWith("Forbidden (")||e.message.startsWith("Wrong region (")||e.message.startsWith("Client error (")},Aye=async(e,t,n,r={},o=3,i=1e4)=>{let c;for(let s=0;s<=o;s+=1){let h=new AbortController,l=globalThis.setTimeout(()=>h.abort(),i);try{let u=await e(t,{method:"POST",headers:{"content-type":"application/json",...r},body:JSON.stringify(n),signal:h.signal});if(u.ok)return;let d=await u.text();if(u.status===401||u.status===403)throw Error("Authentication failed. Check your public key.");if(u.status>=400&&u.status<500&&u.status!==429)throw Error(`Client error (${u.status}): ${d}`);c=Error(u.status===429?`Rate limited (429): ${d}`:`Server error (${u.status}): ${d}`)}catch(u){let d=u instanceof Error?u.message:String(u);if(d.startsWith("Authentication failed")||d.startsWith("Client error ("))throw u instanceof Error?u:Error(d);c=u instanceof Error&&u.name==="AbortError"?Error("Request timed out"):u instanceof Error?u:Error(String(u))}finally{globalThis.clearTimeout(l)}if(s<o)await CZ($Z*2**s)}throw Error(`Failed after ${o+1} attempts: ${c?.message??"Unknown error"}`)},Cye=(e)=>{return e.resourceLogs?.reduce((t,n)=>t+(n.scopeLogs?.reduce((r,o)=>r+(o.logRecords?.length??0),0)??0),0)??0},CZ=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})})},DZ=(e,t,n)=>{return new Qe("BAD_REQUEST",{message:t,data:{operationId:e,missingContext:n}})};var uL=g(()=>{lr();vZ();be();iye=a.object({projectId:a.string().uuid().optional().describe("Project to tail logs for. Auto-filled from CLI and SDK context when omitted."),filters:sL.optional().describe("Optional filters applied by the tail SSE service.")}),aye=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.")}),cye=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.")}),hye=new Set(["15006","3010"])});var gL="https://api.sazabi.com",_Z="https://api.platform.sazabi.com",jZ="sazabi-cli",Dye="urn:ietf:params:oauth:grant-type:device_code",NZ=(e)=>{let t=hy(new Sy(cL,{url:zye(e.apiBaseUrl??gL),headers:async()=>{let o=new Headers({authorization:`Bearer ${await e.credentialProvider.getToken()}`});if(e.clientSource)o.set("x-sazabi-client-source",e.clientSource);return o},fetch:e.fetch,customErrorResponseBodyDecoder:(o,i)=>{let c=Mye(o);if(!c)return null;return new Qe(c.code,{message:c.message,status:i.status,data:{operationId:c.operationId,missingContext:c.missingContext}})}})),n=TZ({raw:t,credentialProvider:e.credentialProvider,fetch:e.fetch,apiBaseUrl:e.apiBaseUrl??gL,intakeBaseUrl:e.intakeBaseUrl,tailBaseUrl:e.tailBaseUrl}),r=wZ({credentialProvider:e.credentialProvider,fetch:e.fetch,apiBaseUrl:e.apiBaseUrl??gL,clientSource:e.clientSource});return{raw:t,me:async()=>t.me({}),automations:{list:async(o={})=>t.automations.list(await te(e.credentialProvider,o,"automations.list")),get:async(o)=>t.automations.get(await te(e.credentialProvider,o,"automations.get")),create:async(o)=>t.automations.create(await te(e.credentialProvider,o,"automations.create")),update:async(o)=>t.automations.update(await te(e.credentialProvider,o,"automations.update")),enable:async(o)=>t.automations.enable(await te(e.credentialProvider,o,"automations.enable")),disable:async(o)=>t.automations.disable(await te(e.credentialProvider,o,"automations.disable")),runs:{list:async(o)=>t.automations.runs.list(await te(e.credentialProvider,o,"automations.runs.list")),get:async(o)=>t.automations.runs.get(await te(e.credentialProvider,o,"automations.runs.get")),logs:async(o)=>t.automations.runs.logs(await te(e.credentialProvider,o,"automations.runs.logs"))}},logs:{...n,query:async(o={})=>t.logs.query(await te(e.credentialProvider,o,Qr.operationId)),schema:async(o={})=>t.logs.schema(await te(e.credentialProvider,o,Vr.operationId)),volume:async(o)=>t.logs.volume(await te(e.credentialProvider,o,ei.operationId)),patterns:async(o={})=>t.logs.patterns(await te(e.credentialProvider,o,ti.operationId)),nativeQuery:async(o)=>t.logs.nativeQuery(await te(e.credentialProvider,o,ni.operationId))},organizations:{list:async()=>t.organizations.list({}),get:async(o)=>t.organizations.get(o),update:async(o)=>t.organizations.update(await jye(e.credentialProvider,o))},members:{list:async(o={})=>t.members.list(await Fe(e.credentialProvider,o)),updateRole:async(o)=>t.members.updateRole(await Fe(e.credentialProvider,o)),remove:async(o)=>{let i=await Fe(e.credentialProvider,o);return t.members.remove({params:{userId:i.userId},query:{organizationId:i.organizationId}})}},teams:{list:async(o={})=>t.teams.list(await Fe(e.credentialProvider,o)),create:async(o)=>t.teams.create(await Fe(e.credentialProvider,o)),update:async(o)=>t.teams.update(await Fe(e.credentialProvider,o)),delete:async(o)=>{let i=await Fe(e.credentialProvider,o);return t.teams.delete({params:{teamId:i.teamId},query:{organizationId:i.organizationId}})},addMember:async(o)=>t.teams.addMember(await Fe(e.credentialProvider,o)),removeMember:async(o)=>{let i=await Fe(e.credentialProvider,o);return t.teams.removeMember({params:{teamId:i.teamId,userId:i.userId},query:{organizationId:i.organizationId}})},listMembers:async(o)=>t.teams.listMembers(await Fe(e.credentialProvider,o))},publicKeys:{list:async(o={})=>t.publicKeys.list(await te(e.credentialProvider,o,Gr.operationId)),get:async(o)=>t.publicKeys.get(await te(e.credentialProvider,o,Jr.operationId)),ensureLogForwarding:async(o={})=>t.publicKeys.ensureLogForwarding(await te(e.credentialProvider,o,Hr.operationId)),update:async(o)=>t.publicKeys.update(await te(e.credentialProvider,o,Br.operationId)),deactivate:async(o)=>{let i=await te(e.credentialProvider,o,Wr.operationId);return t.publicKeys.deactivate({params:{keyId:i.keyId},query:{projectId:i.projectId}})}},secretKeys:{list:async(o={})=>t.secretKeys.list(o),get:async(o)=>t.secretKeys.get(o),create:async(o)=>t.secretKeys.create(o),update:async(o)=>t.secretKeys.update(o),delete:async(o)=>{await t.secretKeys.delete({params:{keyId:o.keyId}})}},search:{threads:async(o)=>t.search.threads(await te(e.credentialProvider,o,_i.operationId)),messages:async(o)=>t.search.messages(await te(e.credentialProvider,o,ji.operationId))},projects:{list:async(o={})=>t.projects.list(await _ye(e.credentialProvider,o)),get:async(o)=>t.projects.get(o),create:async(o)=>t.projects.create(await Fe(e.credentialProvider,o))},messages:{list:async(o)=>t.messages.list(o),append:async(o)=>zZ(t,await t.messages.append(Uye(o)))},threads:{list:async(o={})=>t.threads.list(await Nye(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)=>zZ(t,await t.threads.create(await Rye(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 xye(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)},dataSources:{listTypes:async()=>t.dataSources.listTypes({}),instances:{list:async(o={})=>t.dataSources.listInstances(await te(e.credentialProvider,o,Zr.operationId)),get:async(o)=>t.dataSources.getInstance(o),create:async(o)=>t.dataSources.createInstance(await te(e.credentialProvider,o,Fr.operationId)),update:async(o)=>t.dataSources.updateInstance(o),delete:async(o)=>t.dataSources.deleteInstance(o)},streams:{list:async(o)=>t.dataSources.listStreams(o),get:async(o)=>t.dataSources.getStream(o),create:async(o)=>t.dataSources.createStream(o),update:async(o)=>t.dataSources.updateStream(o),delete:async(o)=>t.dataSources.deleteStream(o)}},logSources:{listProviders:async()=>t.logSources.listProviders({}),list:async(o={})=>t.logSources.list(await te(e.credentialProvider,o,Xr.operationId)),get:async(o)=>t.logSources.get(o),create:async(o)=>t.logSources.create(await te(e.credentialProvider,o,Yr.operationId)),update:async(o)=>t.logSources.update(o),delete:async(o)=>t.logSources.delete(o),streams:{list:async(o)=>t.logSources.listStreams(o),get:async(o)=>t.logSources.getStream(o),create:async(o)=>t.logSources.createStream(o),update:async(o)=>t.logSources.updateStream(o),delete:async(o)=>t.logSources.deleteStream(o)}},integrations:{listProviders:async(o={})=>t.integrations.listProviders(await Fe(e.credentialProvider,o)),listConnections:async(o={})=>t.integrations.listConnections(await Fe(e.credentialProvider,o)),getConnection:async(o)=>t.integrations.getConnection(await Fe(e.credentialProvider,o))},mcpConnectors:{list:async(o={})=>t.mcpConnectors.list(await te(e.credentialProvider,o,vi.operationId)),get:async(o)=>t.mcpConnectors.get(await te(e.credentialProvider,o,Si.operationId)),details:async(o)=>t.mcpConnectors.details(await te(e.credentialProvider,o,Pi.operationId)),listProviders:async()=>t.mcpConnectors.listProviders({})},sandboxPresets:{listConnections:async(o={})=>t.sandboxPresets.listConnections(await te(e.credentialProvider,o,zi.operationId)),listTypes:async()=>t.sandboxPresets.listTypes({})},memory:{list:async(o={})=>t.memory.list(await te(e.credentialProvider,o,Ti.operationId)),get:async(o)=>t.memory.get(await te(e.credentialProvider,o,Li.operationId)),put:async(o)=>t.memory.put(await te(e.credentialProvider,o,Ii.operationId)),search:async(o)=>t.memory.search(await te(e.credentialProvider,o,Oi.operationId)),delete:async(o)=>t.memory.delete(await te(e.credentialProvider,o,Ai.operationId))},logMatchExpressions:{list:async(o={})=>t.logMatchExpressions.list(await te(e.credentialProvider,o,"logMatchExpressions.list")),get:async(o)=>t.logMatchExpressions.get(await te(e.credentialProvider,o,"logMatchExpressions.get")),create:async(o)=>t.logMatchExpressions.create(await te(e.credentialProvider,o,"logMatchExpressions.create")),update:async(o)=>t.logMatchExpressions.update(await te(e.credentialProvider,o,"logMatchExpressions.update")),disable:async(o)=>t.logMatchExpressions.disable(await te(e.credentialProvider,o,"logMatchExpressions.disable"))},scripts:{list:async(o={})=>t.scripts.list(await te(e.credentialProvider,o,"scripts.list")),get:async(o)=>t.scripts.get(await te(e.credentialProvider,o,"scripts.get")),create:async(o)=>t.scripts.create(await te(e.credentialProvider,o,"scripts.create")),update:async(o)=>t.scripts.update(await te(e.credentialProvider,o,"scripts.update")),delete:async(o)=>t.scripts.delete(await te(e.credentialProvider,o,"scripts.delete"))},issues:{count:async(o={})=>t.issues.count(await te(e.credentialProvider,o,"issues.count")),create:async(o)=>t.issues.create(await te(e.credentialProvider,o,qr.operationId)),list:async(o={})=>t.issues.list(await te(e.credentialProvider,o,"issues.list")),search:async(o={})=>t.issues.search(await te(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)},pullRequests:{list:async(o={})=>t.pullRequests.list(await te(e.credentialProvider,o,"pullRequests.list"))},statusComponents:{list:async(o={})=>t.statusComponents.list(await te(e.credentialProvider,o,"statusComponents.list")),get:async(o)=>t.statusComponents.get(o),register:async(o)=>t.statusComponents.register(await te(e.credentialProvider,o,Ni.operationId)),deregister:async(o)=>t.statusComponents.deregister({componentId:o.componentId,...o.reason!==void 0?{reason:o.reason}:{}}),rename:async(o)=>t.statusComponents.rename(o),assignTeam:async(o)=>t.statusComponents.assignTeam(o),retirementPreview:async(o)=>t.statusComponents.retirementPreview(o),retire:async(o)=>t.statusComponents.retire(o),restorationPreview:async(o)=>t.statusComponents.restorationPreview(o),restore:async(o)=>t.statusComponents.restore(o),mergePreview:async(o)=>t.statusComponents.mergePreview(await te(e.credentialProvider,o,"statusComponents.mergePreview")),merge:async(o)=>t.statusComponents.merge(await te(e.credentialProvider,o,"statusComponents.merge")),relationships:{list:async(o={})=>t.statusComponents.relationships.list(await te(e.credentialProvider,o,"statusComponents.relationships.list")),preview:async(o)=>t.statusComponents.relationships.preview(await te(e.credentialProvider,o,"statusComponents.relationships.preview")),add:async(o)=>t.statusComponents.relationships.add(await te(e.credentialProvider,o,"statusComponents.relationships.add")),remove:async(o)=>t.statusComponents.relationships.remove(await te(e.credentialProvider,o,"statusComponents.relationships.remove"))},incidents:{list:async(o={})=>t.statusComponents.incidents.list(await te(e.credentialProvider,o,"statusComponents.incidents.list"))},timeline:async(o)=>t.statusComponents.timeline(o)},billing:{getSummary:async(o={})=>t.billing.getSummary(await Fe(e.credentialProvider,o)),getUsage:async(o={})=>t.billing.getUsage(await Fe(e.credentialProvider,o)),listTransactions:async(o={})=>t.billing.listTransactions(await Fe(e.credentialProvider,o))},tasks:{list:async(o={})=>t.tasks.list(await te(e.credentialProvider,o,os.operationId))},recommendations:{list:async(o={})=>t.recommendations.list(await te(e.credentialProvider,o,Qc.operationId))}}},yL=async(e={})=>{let t=await UZ(e.fetch)(xZ(e.apiBaseUrl??_Z,"/device/code"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({client_id:e.clientId??jZ,...e.scope?{scope:e.scope}:{}})}),n=await t.json();if(!t.ok)throw Kye(n,t.status);let r=n;return{deviceCode:Ui(r.device_code,"device_code"),userCode:Ui(r.user_code,"user_code"),verificationUri:Ui(r.verification_uri,"verification_uri"),verificationUriComplete:Ui(r.verification_uri_complete,"verification_uri_complete"),expiresIn:dL(r.expires_in,"expires_in"),interval:dL(r.interval,"interval")}},bL=async(e)=>{let t=await UZ(e.fetch)(xZ(e.apiBaseUrl??_Z,"/device/token"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:Dye,device_code:e.deviceCode,client_id:e.clientId??jZ})}),n=await t.json();if(t.ok){let o=n;return{status:"authorized",accessToken:Ui(o.access_token,"access_token"),tokenType:Ui(o.token_type,"token_type"),expiresIn:dL(o.expires_in,"expires_in"),scope:typeof o.scope==="string"?o.scope:""}}let r=RZ(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)},zye=(e)=>{let t=e.replace(/\/+$/,"");return t.endsWith("/v1")?t:`${t}/v1`},xZ=(e,t)=>{return`${e.replace(/\/+$/,"")}/api/auth${t}`},_ye=async(e,t)=>{return Fe(e,t)},Fe=async(e,t)=>{let n=t.organizationId??await e.getOrganizationId?.();return n?{...t,organizationId:n}:t},jye=async(e,t)=>{let n=t.organizationId??await e.getOrganizationId?.();if(!n)throw new Qe("BAD_REQUEST",{message:"Organization ID is required",data:{operationId:"organizations.update",missingContext:["organizationId"]},status:400});return{...t,organizationId:n}},te=async(e,t,n)=>{let r=t.projectId??await e.getProjectId?.();if(!r)throw new Qe("BAD_REQUEST",{message:"Project ID is required",data:{operationId:n,missingContext:["projectId"]},status:400});return{...t,projectId:r}},Nye=async(e,t)=>{let n=t.projectId??await e.getProjectId?.();return n?{...t,projectId:n}:t},xye=async(e,t)=>{let n=t.projectId??await e.getProjectId?.();return n?{...t,projectId:n}:t},Rye=async(e,t)=>{let n=t.projectId??await e.getProjectId?.();return n?{...t,projectId:n}:t},Uye=(e)=>{return{threadId:e.threadId,message:e.message,wait:e.wait??!0,timeoutSeconds:e.timeoutSeconds??20,...e.automationId!==void 0?{automationId:e.automationId}:{}}},Mye=(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"):[]}},RZ=(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}},Kye=(e,t)=>{let n=RZ(e);return Error(n?.errorDescription??`Device authorization failed with status ${t}`)},UZ=(e)=>{return e??globalThis.fetch},zZ=(e,t)=>({result:t,poll:()=>e.runs.get({runId:t.runId}),waitForCompletion:async(n={})=>Eye(e,t,n)}),Eye=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 qye(r),i=await e.runs.get({runId:i.runId})}return i},qye=async(e)=>{await new Promise((t)=>globalThis.setTimeout(t,e))},Ui=(e,t)=>{if(typeof e==="string")return e;throw Error(`Expected '${t}' to be a string.`)},dL=(e,t)=>{if(typeof e==="number")return e;throw Error(`Expected '${t}' to be a number.`)};var mL=g(()=>{lr();ZT();Ri();fZ();uL();uL()});var We=(e)=>({success:!0,value:e}),Me=(e,t,n)=>({success:!1,error:e,...t!==void 0&&{statusCode:t},...n!==void 0&&{errorPayload:n}}),w=(e,t,n)=>{if(!e.success){let r=`${t}: ${e.error}`;if(n)return b(e.errorPayload??r);return m(r)}return e.value};var ie=g(()=>{ee()});var Gye="https://api.sazabi.com",O=async(e)=>{try{return We(await e())}catch(t){let n=Jye(t),r=Hye(t),o=t instanceof Error?t.message:String(t);return Me(o,r,n)}},Jye=(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,missingContext:Array.isArray(n.missingContext)?n.missingContext.filter((r)=>typeof r==="string"):[]}},Hye=(e)=>{if(!e||typeof e!=="object")return;let t=e;return typeof t.status==="number"?t.status:void 0},Gn=(e)=>{let t=NZ({apiBaseUrl:e.baseUrl??Gye,clientSource:"cli",credentialProvider:{getToken:()=>e.token,getOrganizationId:()=>e.organizationId,getProjectId:()=>e.projectId},intakeBaseUrl:e.intakeBaseUrl,tailBaseUrl:e.tailBaseUrl});return{me:()=>O(()=>t.me()),automations:{list:(n={})=>O(()=>t.automations.list(n)),get:(n)=>O(()=>t.automations.get({automationId:n})),create:(n)=>O(()=>t.automations.create(n)),update:(n)=>O(()=>t.automations.update(n)),enable:(n)=>O(()=>t.automations.enable({automationId:n})),disable:(n)=>O(()=>t.automations.disable({automationId:n})),runs:{list:(n,r={})=>O(()=>t.automations.runs.list({automationId:n,...r})),get:(n,r)=>O(()=>t.automations.runs.get({automationId:n,runId:r})),logs:(n,r)=>O(()=>t.automations.runs.logs({automationId:n,runId:r}))}},logs:{tail:(n)=>O(()=>t.logs.tail(n)),forward:(n)=>O(()=>t.logs.forward(n)),query:(n={})=>O(()=>t.logs.query(n)),schema:(n={})=>O(()=>t.logs.schema(n)),volume:(n)=>O(()=>t.logs.volume(n)),patterns:(n={})=>O(()=>t.logs.patterns(n)),nativeQuery:(n)=>O(()=>t.logs.nativeQuery(n))},organizations:{list:()=>O(()=>t.organizations.list()),get:(n)=>O(()=>t.organizations.get({organizationId:n})),rename:(n,r)=>O(()=>t.organizations.update({organizationId:r,name:n}))},members:{list:(n={})=>O(()=>t.members.list(n)),updateRole:(n,r,o)=>O(()=>t.members.updateRole({organizationId:o,userId:n,role:r})),remove:(n,r)=>O(()=>t.members.remove({organizationId:r,userId:n}))},teams:{list:(n={})=>O(()=>t.teams.list(n)),create:(n,r,o)=>O(()=>t.teams.create({organizationId:o,name:n,...r!==void 0?{description:r}:{}})),update:(n,r,o)=>O(()=>t.teams.update({organizationId:o,teamId:n,...r.name!==void 0?{name:r.name}:{},...r.description!==void 0?{description:r.description}:{}})),delete:(n,r)=>O(()=>t.teams.delete({organizationId:r,teamId:n})),addMember:(n,r,o)=>O(()=>t.teams.addMember({organizationId:o,teamId:n,userId:r})),removeMember:(n,r,o)=>O(()=>t.teams.removeMember({organizationId:o,teamId:n,userId:r})),listMembers:(n,r)=>O(()=>t.teams.listMembers({organizationId:r,teamId:n}))},projects:{list:(n={})=>O(()=>t.projects.list(n)),get:(n)=>O(()=>t.projects.get({projectId:n})),create:(n)=>O(()=>t.projects.create(n))},threads:{list:(n={})=>O(()=>t.threads.list(n)),get:(n)=>O(()=>t.threads.get({threadId:n})),create:(n)=>O(()=>t.threads.create(n)),getStatus:(n)=>O(()=>t.threads.getStatus({threadId:n})),update:(n,r)=>O(()=>t.threads.update({threadId:n,status:r})),fork:(n,r)=>O(()=>t.threads.fork({threadId:n,messageId:r})),setVisibility:(n,r)=>O(()=>t.threads.setVisibility({threadId:n,visibility:r})),createShareLink:(n)=>O(()=>t.threads.createShareLink({threadId:n})),listShareLinks:(n)=>O(()=>t.threads.listShareLinks({threadId:n})),revokeShareLink:(n,r)=>O(()=>t.threads.revokeShareLink({threadId:n,shareId:r})),stop:(n)=>O(()=>t.threads.stop({threadId:n})),stream:(n)=>O(()=>t.threads.stream(n))},messages:{list:(n,r={})=>O(()=>t.messages.list({threadId:n,...r})),append:(n,r,o,i,c,s)=>O(()=>t.messages.append({threadId:n,message:r,wait:o,timeoutSeconds:i,...c!==void 0?{automationId:c}:{},...s?{ambientServiceRun:s}:{}}))},runs:{get:(n)=>O(()=>t.runs.get({runId:n})),cancel:(n)=>O(()=>t.runs.cancel({runId:n})),stream:(n)=>O(()=>t.runs.stream(n))},search:{threads:(n)=>O(()=>t.search.threads(n)),messages:(n)=>O(()=>t.search.messages(n))},publicKeys:{list:(n)=>O(()=>t.publicKeys.list(n)),get:(n,r)=>O(()=>t.publicKeys.get(r?{keyId:n,projectId:r}:{keyId:n})),ensureLogForwarding:(n)=>O(()=>t.publicKeys.ensureLogForwarding(n)),update:(n)=>O(()=>t.publicKeys.update(n)),deactivate:(n)=>O(()=>t.publicKeys.deactivate(n))},secretKeys:{list:(n)=>O(()=>t.secretKeys.list(n)),get:(n)=>O(()=>t.secretKeys.get({keyId:n})),create:(n)=>O(()=>t.secretKeys.create(n)),update:(n)=>O(()=>t.secretKeys.update(n)),delete:(n)=>O(()=>t.secretKeys.delete(n))},issues:{count:(n={})=>O(()=>t.issues.count(n)),create:(n)=>O(()=>t.issues.create(n)),list:(n={})=>O(()=>t.issues.list(n)),search:(n={})=>O(()=>t.issues.search(n)),get:(n)=>O(()=>t.issues.get({issueId:n})),resolve:(n)=>O(()=>t.issues.resolve({issueId:n})),ignore:(n)=>O(()=>t.issues.ignore({issueId:n})),reopen:(n)=>O(()=>t.issues.reopen({issueId:n})),mute:(n)=>O(()=>t.issues.mute({issueId:n})),unmute:(n)=>O(()=>t.issues.unmute({issueId:n}))},pullRequests:{list:(n={})=>O(()=>t.pullRequests.list(n))},statusComponents:{list:(n={})=>O(()=>t.statusComponents.list(n)),get:(n)=>O(()=>t.statusComponents.get({componentId:n})),register:(n)=>O(()=>t.statusComponents.register(n)),deregister:(n,r)=>O(()=>t.statusComponents.deregister({componentId:n,...r!==void 0?{reason:r}:{}})),rename:(n)=>O(()=>t.statusComponents.rename(n)),retirementPreview:(n)=>O(()=>t.statusComponents.retirementPreview(n)),retire:(n)=>O(()=>t.statusComponents.retire(n)),restorationPreview:(n)=>O(()=>t.statusComponents.restorationPreview(n)),restore:(n)=>O(()=>t.statusComponents.restore(n)),mergePreview:(n)=>O(()=>t.statusComponents.mergePreview(n)),merge:(n)=>O(()=>t.statusComponents.merge(n)),relationships:{list:(n={})=>O(()=>t.statusComponents.relationships.list(n)),preview:(n)=>O(()=>t.statusComponents.relationships.preview(n)),add:(n)=>O(()=>t.statusComponents.relationships.add(n)),remove:(n)=>O(()=>t.statusComponents.relationships.remove(n))},incidents:{list:(n={})=>O(()=>t.statusComponents.incidents.list(n))},timeline:(n)=>O(()=>t.statusComponents.timeline(n))},billing:{getSummary:(n={})=>O(()=>t.billing.getSummary(n)),getUsage:(n={})=>O(()=>t.billing.getUsage(n)),listTransactions:(n={})=>O(()=>t.billing.listTransactions(n))},tasks:{list:(n={})=>O(()=>t.tasks.list(n))},recommendations:{list:(n={})=>O(()=>t.recommendations.list(n))},dataSources:{listTypes:()=>O(()=>t.dataSources.listTypes()),instances:{list:(n)=>O(()=>t.dataSources.instances.list(n)),get:(n)=>O(()=>t.dataSources.instances.get({instanceId:n})),create:(n)=>O(()=>t.dataSources.instances.create(n)),update:(n)=>O(()=>t.dataSources.instances.update(n)),delete:(n)=>O(()=>t.dataSources.instances.delete({instanceId:n}))},streams:{list:(n)=>O(()=>t.dataSources.streams.list({instanceId:n})),get:(n)=>O(()=>t.dataSources.streams.get({streamId:n})),create:(n)=>O(()=>t.dataSources.streams.create(n)),update:(n)=>O(()=>t.dataSources.streams.update(n)),delete:(n)=>O(()=>t.dataSources.streams.delete({streamId:n}))}},logSources:{listProviders:()=>O(()=>t.logSources.listProviders()),list:(n)=>O(()=>t.logSources.list(n)),get:(n)=>O(()=>t.logSources.get({logSourceId:n})),create:(n)=>O(()=>t.logSources.create(n)),update:(n)=>O(()=>t.logSources.update(n)),delete:(n)=>O(()=>t.logSources.delete({logSourceId:n})),streams:{list:(n)=>O(()=>t.logSources.streams.list({logSourceId:n})),get:(n)=>O(()=>t.logSources.streams.get({streamId:n})),create:(n)=>O(()=>t.logSources.streams.create(n)),update:(n)=>O(()=>t.logSources.streams.update(n)),delete:(n)=>O(()=>t.logSources.streams.delete({streamId:n}))}},integrations:{listProviders:()=>O(()=>t.integrations.listProviders()),listConnections:(n)=>O(()=>t.integrations.listConnections(n)),getConnection:(n)=>O(()=>t.integrations.getConnection({connectionId:n}))},mcpConnectors:{list:(n)=>O(()=>t.mcpConnectors.list(n)),get:(n)=>O(()=>t.mcpConnectors.get(n)),details:(n)=>O(()=>t.mcpConnectors.details(n)),listProviders:()=>O(()=>t.mcpConnectors.listProviders())},sandboxPresets:{listTypes:()=>O(()=>t.sandboxPresets.listTypes())},memory:{list:(n={})=>O(()=>t.memory.list(n)),get:(n)=>O(()=>t.memory.get(n)),search:(n)=>O(()=>t.memory.search(n)),put:(n)=>O(()=>t.memory.put({kind:"note",...n})),delete:(n)=>O(()=>t.memory.delete(n))},logMatchExpressions:{list:(n={})=>O(()=>t.logMatchExpressions.list(n)),get:(n)=>O(()=>t.logMatchExpressions.get({expressionId:n})),create:(n)=>O(()=>t.logMatchExpressions.create(n)),update:(n,r={})=>O(()=>t.logMatchExpressions.update({expressionId:n,...r})),disable:(n)=>O(()=>t.logMatchExpressions.disable({expressionId:n}))},scripts:{list:(n={})=>O(()=>t.scripts.list(n)),get:(n)=>O(()=>t.scripts.get({name:n})),create:(n)=>O(()=>t.scripts.create(n)),update:(n,r={})=>O(()=>t.scripts.update({name:n,...r})),delete:(n)=>O(()=>t.scripts.delete({name:n}))}}};var rs=g(()=>{mL();ie()});var MZ;var KZ=g(()=>{MZ={version:2,activeProfile:"default",profiles:{default:{}}}});import*as Jn from"node:fs";import*as EZ from"node:os";import*as fL from"node:path";var yt=(e)=>{if(e===void 0||e===null)return;if(typeof e==="string")return e.length>0?e:void 0;return},pL,Mi,Bye=()=>{if(!Jn.existsSync(pL))Jn.mkdirSync(pL,{recursive:!0,mode:448})},wL,qZ=(e)=>{wL=e},GZ=(e)=>({token:yt(e.token),activeOrganizationId:yt(e.activeOrganizationId??e.organizationId),organizationName:yt(e.organizationName),activeProjectId:yt(e.activeProjectId??e.defaultProjectId),apiBaseUrl:yt(e.apiBaseUrl),authBaseUrl:yt(e.authBaseUrl),webBaseUrl:yt(e.webBaseUrl),intakeBaseUrl:yt(e.intakeBaseUrl),tailBaseUrl:yt(e.tailBaseUrl),apiDomain:yt(e.apiDomain),webDomain:yt(e.webDomain),intakeDomain:yt(e.intakeDomain),tailDomain:yt(e.tailDomain),forwardPublicKey:yt(e.forwardPublicKey),forwardPublicKeyProjectId:yt(e.forwardPublicKeyProjectId)}),Wye=(e)=>({version:2,activeProfile:"default",profiles:{default:GZ(e)}}),Zye=(e)=>{let t=yt(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]=GZ(i)}if(!r[t])r[t]={};return{version:2,activeProfile:t,profiles:r}},Re=()=>{try{if(!Jn.existsSync(Mi))return We(MZ);let e=Jn.readFileSync(Mi,"utf-8"),t=JSON.parse(e),n=typeof t.version==="number"?t.version:void 0;if(n!==void 0&&n>2)return Me("Settings file requires a newer CLI version. Upgrade with 'npm install -g @sazabi/cli@latest'.");if(n===2)return We(Zye(t));let r=Wye(t),o=Xe(r);if(!o.success)return o;return We(r)}catch(e){let t=e instanceof Error?e.message:String(e);return Me(t)}},Xe=(e)=>{try{return Bye(),Jn.writeFileSync(Mi,JSON.stringify(e,null,2),{encoding:"utf-8",mode:384}),We(void 0)}catch(t){let n=t instanceof Error?t.message:String(t);return Me(n)}},Ln=(e,t)=>{if(t)return t;if(wL)return wL;let n=process.env.SAZABI_PROFILE?.trim();if(n)return n;return e.activeProfile??"default"},Rt=(e,t)=>{let n=Ln(e,t),r=e.profiles[n];if(r)return We(r);if(n==="default")return We({});return Me(`Profile '${n}' does not exist. Run 'sazabi profiles create ${n}' first.`)},Hn=()=>{let e=Re();if(!e.success)return e;return Rt(e.value)},Ut=(e,t,n)=>{let r=Ln(e,n);if(!e.profiles[r])return Me(`Profile '${r}' does not exist. Run 'sazabi profiles create ${r}' first.`);return We({...e,profiles:{...e.profiles,[r]:{...e.profiles[r],...t}}})},Bn=(e)=>{if(!e?.forwardPublicKey&&!e?.forwardPublicKeyProjectId)return{};return{forwardPublicKey:void 0,forwardPublicKeyProjectId:void 0}};var Vt=g(()=>{KZ();ie();pL=fL.join(EZ.homedir(),".sazabi"),Mi=fL.join(pL,"settings.json")});var Tn=(e)=>{let{cliFlag:t,globalUrl:n,globalDomain:r,buildUrlFromDomain:o,defaultUrl:i}=e;if(t)return t;let c=process.env.SAZABI_API_URL?.trim();if(c)return c;if(n)return n;if(r)return o(r);return i},C=(e)=>{let{tokenFlag:t,organizationIdFlag:n,projectIdFlag:r,jsonMode:o}=e,i=t?.trim(),c=process.env.SAZABI_TOKEN?.trim(),s=process.env.SAZABI_ORGANIZATION_ID?.trim(),h=process.env.SAZABI_PROJECT_ID?.trim(),l=w(Hn(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",o),u=l.token?.trim(),d=(i&&i.length>0?i:void 0)||(c&&c.length>0?c:void 0)||u,y=i&&i.length>0?"flag":c&&c.length>0?"environment":"settings";if(!d||d.length===0){if(o)return b("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.");return m("Not authenticated. Set SAZABI_TOKEN, pass --token, run 'sazabi auth login', or run 'sazabi auth save <token>'.")}let p,f;if(n)p=n,f="flag";else if(s&&s.length>0)p=s,f="environment";else if(l.activeOrganizationId)p=l.activeOrganizationId,f="settings";let k,L;if(r)k=r,L="flag";else if(h&&h.length>0)k=h,L="environment";else if(l.activeProjectId)k=l.activeProjectId,L="settings";return{token:d,type:"token",projectId:k,organizationId:p,tokenSource:y,organizationSource:f,projectSource:L}},vL=(e)=>{let t=w(Hn(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",e?.jsonMode);return Tn({cliFlag:e?.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(n)=>`https://api.${n}`,defaultUrl:"https://api.sazabi.com"})},z=(e)=>{let t=vL({apiBaseUrlFlag:e.apiBaseUrlFlag,jsonMode:e.jsonMode});return Gn({token:e.token,baseUrl:t,organizationId:e.organizationId,projectId:e.projectId})},JZ,kL,hd=async(e)=>{let t=w(Hn(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",e.jsonMode),n=Tn({cliFlag:e.apiBaseUrlFlag,globalUrl:t.apiBaseUrl,globalDomain:t.apiDomain,buildUrlFromDomain:(h)=>`https://api.${h}`,defaultUrl:"https://api.sazabi.com"}),r=`${e.token}@${n}@${e.projectId??""}`,o=JZ.get(r);if(o)return o;let i=kL.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 m("Project ID is required. Run 'sazabi projects use <project-id>' or set SAZABI_PROJECT_ID.")}let c=e.projectId,s=(async()=>{let l=await Gn({token:e.token,baseUrl:n,projectId:c}).projects.get(c),d=w(l,"Couldn't fetch project info (run 'sazabi projects list' to verify the project ID)",e.jsonMode).project;return JZ.set(r,d),d})();kL.set(r,s);try{return await s}finally{kL.delete(r)}},sd=(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\.)+/,"")}`},Ki=(e)=>{let t=(r)=>r.replace(/\/+$/,"");if(e)return t(e);let n=w(Hn(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)");if(n.webBaseUrl)return t(n.webBaseUrl);if(n.webDomain)return sd(n.webDomain);if(n.apiDomain)return sd(n.apiDomain);return"https://app.sazabi.com"},On=(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 m(n)},ko=(e,t)=>{return`${Ki(t)}/projects/${e}`},Ye=(e,t,n,r)=>{let o=`${Ki(n)}/projects/${e}/threads/${t}`;return r?`${o}?messageId=${encodeURIComponent(r)}`:o},HZ=(e,t,n,r)=>{return Ye(e,t,n,r)},BZ=(e,t,n)=>{return`${ko(e,n)}/issues/${t}`},WZ=(e,t,n)=>{return`${ko(e,n)}/automations/${t}`},ZZ=(e,t)=>{return`${ko(e,t)}/status`},ld=(e,t,n)=>{return`${ko(e,n)}/settings/log-streams/${t}`},FZ=(e,t,n)=>{return`${ko(e,n)}/settings/mcp-connectors/${t}`},XZ=(e,t,n)=>{return`${ko(e,n)}/settings/sandbox/catalog/${t}`},YZ=(e,t)=>{return`https://otlp.${t}.intake.${e}`};var ce=g(()=>{ee();rs();ie();Vt();JZ=new Map,kL=new Map});var Cd,CY=(e)=>{Cd.set(e.name,e)},Dd=(e)=>{return Cd.get(e)},ks=()=>{return Array.from(Cd.values())},DY=(e)=>{return Cd.has(e)};var WL=g(()=>{Cd=new Map});async function YL(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 QL(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 Wi(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 Ss(e){let t=await e.dataSources.instances.list();if(!t.success)return[];return t.value.instances.map((n)=>({value:n.id,description:n.name??n.dataSourceType}))}async function jY(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 Vve=3000,eSe,NY=async(e,t,n)=>{try{let r=eSe[e]?.[t];if(!r)return[];let o=Hn();if(!o.success)return[];let i=o.value,c=process.env.SAZABI_TOKEN?.trim()||i.token?.trim();if(!c)return[];let s=Tn({globalUrl:i.apiBaseUrl,globalDomain:i.apiDomain,buildUrlFromDomain:(u)=>`https://api.${u}`,defaultUrl:"https://api.sazabi.com"}),h=Gn({token:c,baseUrl:s,organizationId:i.activeOrganizationId,projectId:i.activeProjectId});return(await Promise.race([r(h),new Promise((u)=>setTimeout(()=>u([]),Vve))])).filter((u)=>u.value.startsWith(n))}catch{return[]}};var xY=g(()=>{rs();ce();Vt();eSe={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:YL,update:YL,deactivate:YL},"secret-keys":{get:QL,update:QL,delete:QL},"log-sources":{get:Wi,rename:Wi,enable:Wi,disable:Wi,delete:Wi,remove:Wi},"data-sources":{get:Ss,rename:Ss,enable:Ss,disable:Ss,delete:Ss},members:{"update-role":jY,remove:jY}}});var UY={};yn(UY,{parseCompletionContext:()=>oSe,getCompletions:()=>rSe});var tSe,nSe,oSe=(e)=>{let t=e.length>0?e:[""],n=t.length-1,r=t[n]??"";return{words:t,currentIndex:n,partial:r}},rSe=async(e)=>{let{words:t,currentIndex:n,partial:r}=e,o=t[n-1];if(o==="--profile")return sSe(r);let i=cSe(t),c=Math.max(0,i.length-(t.length-n));if(c===0)return iSe(r);let s=i[0]??"",h=Dd(s);if(!h)return[];if(c===1&&h.subcommands){if(r.startsWith("-"))return RY(h.options,i);return aSe(h,r)}let l=h.subcommands?i[1]:void 0,d=(l?h.subcommands?.[l]:void 0)?.options??h.options;if(r.startsWith("-"))return RY(d,i);if(o?.startsWith("--")){let y=o.slice(2);if(d?.[y]?.type==="string"){let f=`${s}:${l??""}`,k=nSe[f]?.[y]??tSe[y];if(k)return k.filter((L)=>L.startsWith(r)).map((L)=>({value:L}));return[]}}return NY(s,l??"",r)},iSe=(e)=>{let n=ks().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},aSe=(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}))},RY=(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,c]of Object.entries(e)){let s=`--${i}`;if(r.has(s))continue;if(!s.startsWith(n))continue;o.push({value:s,description:c.description})}return o},cSe=(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},sSe=(e)=>{try{let t=Re();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 MY=g(()=>{WL();Vt();xY();tSe={status:["regular","archived"],format:["json","text"]},nSe={"members:update-role":{role:["admin","member"]},"messages:search":{role:["user","assistant"]},"messages:list":{role:["user","assistant"]}}});ee();ee();ee();import{parseArgs as yQ}from"node:util";var $=(e,t,n={})=>{let r=yQ({args:e,options:t,allowPositionals:Boolean(n.allowPositionals),strict:!1,tokens:!0}),o=Object.hasOwn(t,"json")&&r.values.json===!0,i=new Set(Object.keys(t)),c=new Set(Object.entries(t).map(([,h])=>h.short).filter((h)=>Boolean(h))),s=[];if(Array.isArray(r.tokens))for(let h of r.tokens){if(h.kind!=="option")continue;let l=h.name,u=l.length>1;if(!(i.has(l)||!u&&c.has(l))){let y=u?`--${l}`:`-${l}`;if(!s.includes(y))s.push(y)}}for(let h of Object.keys(r.values))if(!i.has(h)){let l=h.length>1?`--${h}`:`-${h}`;if(!s.includes(l))s.push(l)}if(s.length>0){let h=`Unknown option${s.length>1?"s":""}: ${s.join(", ")}. Run the command with -h for usage.`;if(o)b(h);m(h)}for(let[h,l]of Object.entries(t))if(l.type==="string"&&r.values[h]===!0){let u=h.length===1?`-${h}`:`--${h}`,d=`Option ${u} requires a value. Use '${u} <value>'.`;if(o)b(d);m(d)}for(let[h,l]of Object.entries(t)){let u=r.values[h];if(l.type==="string"&&typeof u==="string"){if(u.startsWith("--")||u.length===2&&u[0]==="-"&&/[a-zA-Z]/.test(u.charAt(1))){let p=`Option ${h.length===1?`-${h}`:`--${h}`} received "${u}" as its value. Did you forget to provide a value?`;if(o)b(p);m(p)}}}return{values:r.values,positionals:r.positionals}};var Ts=(e,t)=>{if(e?.json?.type!=="boolean")throw Error(`${t} must include a boolean --json option (enforced by CommandBuilder)`)};class bT{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)Ts(this.options,`Subcommand "${this.name}"`);if(!this.allowNoJson&&this.subcommands){for(let[e,t]of Object.entries(this.subcommands))if(!t.subcommands)Ts(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 mT{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)Ts(this.options,`Command "${this.name}"`);if(this.subcommands)for(let[e,t]of Object.entries(this.subcommands)){if(t.subcommands)continue;Ts(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 Q=(e,t)=>{return new mT(e,t)},S=(e,t,n)=>{return new bT(e,t,n)};ee();var ut=(e,t,n,r,o)=>{let i=Number.parseInt(e,10);if(Number.isNaN(i)||i<t||i>n){let c=`${r} must be between ${t} and ${n}.`;if(o)return b(c);return m(c)}return i},Dt=(e,t,n,r)=>{if(!t.includes(e)){let o=t.map((c)=>`"${c}"`).join(" or "),i=`${n} must be ${o}.`;if(r)return b(i);return m(i)}return e};ee();ce();ie();var PL=(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},VZ=(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)}},eF=(e,t)=>{return PL(e).find((n)=>n.id===t)},SL=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e),QZ=(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},Fye=(e)=>{if(Array.isArray(e)&&e.every(SL))return e;if(SL(e))for(let t of["rows","data","items","points"]){let n=e[t];if(Array.isArray(n)&&n.every(SL))return n}return null},tF=(e)=>{let t=Fye(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(QZ).join(",")];for(let o of t)r.push(n.map((i)=>QZ(o[i])).join(","));return r.join(`
8618
8618
  `)};var Xye=100,nF=100,Yye=async(e,t,n)=>{let r=[],o;for(let i=0;i<nF;i++){let c=await e.messages.list(t,{limit:Xye,...o?{cursor:o}:{}}),s=w(c,"Couldn't get artifact (check the thread ID and try again)",n);if(r.push(...s.messages),!s.nextCursor)break;o=s.nextCursor}if(o&&!n)console.error(`Warning: reached the ${nF}-page limit; the artifact may exist beyond the scanned messages.`);return r},Qye=(e,t,n)=>{if(t)return t;let r=`--thread-id is required to locate artifact '${e}'. Usage: sazabi artifacts get <artifact-id> --thread-id <thread-id>`;if(n)b(r);else m(r);return},Vye=(e,t)=>{if(t.json){J({id:e.id,messageId:e.messageId,name:e.name,toolCallId:e.toolCallId,createdAt:e.createdAt,data:e.data});return}if(t.format==="csv"){let n=tF(e.data);if(n===null){m(`Artifact '${e.id}' (${e.name}) has no embedded rows to render as CSV. Built-in table/timeseries artifacts persist query parameters rather than result rows, so only artifacts that embed their data (such as custom artifacts) can be exported as CSV. Use --json or the default output to inspect this artifact.`);return}console.log(n);return}console.log(JSON.stringify(e.data,null,2))},oF=async(e,t)=>{if(!VZ(e)){let h=`Invalid artifact ID: '${e}'. Expected format '<message-id>:<index>' (from 'sazabi artifacts list').`;if(t.json)return b(h);return m(h)}let r=Qye(e,t.threadId,t.json);if(!r)return;let o=C({tokenFlag:t.token,jsonMode:t.json}),i=z({token:o.token,projectId:o.projectId,apiBaseUrlFlag:t.apiBaseUrl}),c=await Yye(i,r,t.json),s=eF(c,e);if(!s){let h=`Artifact '${e}' not found in thread '${r}'. Run 'sazabi artifacts list --thread-id ${r}' to see available artifacts.`;if(t.json)return b(h);return m(h)}Vye(s,t)};ee();ce();ie();var ebe={id:{label:"ID",type:{kind:"string"}},name:{label:"Type",type:{kind:"string"}},toolCallId:{label:"Tool call",type:{kind:"nullable-string",emptyLabel:"(none)"}},createdAt:{label:"Created",type:{kind:"date"}}},tbe={schema:ebe,columns:["id","name","toolCallId","createdAt"],header:"Artifacts",emptyMessage:"No artifacts found in this thread."},nbe=100,rF=100,obe=async(e,t,n)=>{let r=[],o;for(let i=0;i<rF;i++){let c=await e.messages.list(t,{limit:nbe,...o?{cursor:o}:{}}),s=w(c,"Couldn't list artifacts (check the thread ID and try again)",n);if(r.push(...s.messages),!s.nextCursor)break;o=s.nextCursor}if(o&&!n)console.error(`Warning: reached the ${rF}-page limit; artifact list may be incomplete for this thread.`);return r},iF=async(e)=>{let t=C({tokenFlag:e.token,jsonMode:e.json}),n=z({token:t.token,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl}),r=await obe(n,e.threadId,e.json),i=PL(r).map((c)=>({id:c.id,name:c.name,toolCallId:c.toolCallId,createdAt:c.createdAt}));H(tbe,i,{json:e.json})};var aF=Q("artifacts","Retrieve artifacts produced in a thread").withSubcommands({list:S("list","List artifacts produced in a thread",async(e)=>{let{values:t}=$(e,{token:{type:"string"},"thread-id":{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}}),n=t["thread-id"];if(!n){if(t.json)return b("--thread-id is required. Usage: sazabi artifacts list --thread-id <thread-id>");return m("--thread-id is required. Usage: sazabi artifacts list --thread-id <thread-id>")}await iF({threadId:n,token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override authentication token"},"thread-id":{type:"string",description:"Thread to list artifacts for (required)"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi artifacts list --thread-id <thread-id> # List artifacts in a thread","sazabi artifacts list --thread-id <thread-id> --json # Output as JSON"]).build(),get:S("get","Get a single artifact's data",async(e)=>{let{values:t,positionals:n}=$(e,{token:{type:"string"},"thread-id":{type:"string"},format:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Artifact ID is required. Usage: sazabi artifacts get <artifact-id> --thread-id <thread-id>");return m("Artifact ID is required. Usage: sazabi artifacts get <artifact-id> --thread-id <thread-id>")}if(n.length>1){let i=n.slice(1).join(", ");if(t.json)return b(`Unexpected arguments: ${i}.`);return m(`Unexpected arguments: ${i}.`)}let o;if(t.format)o=Dt(t.format,["json","csv"],"Format",t.json);await oF(r,{token:t.token,threadId:t["thread-id"],format:o,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<artifact-id>").withOptions({token:{type:"string",description:"Override authentication token"},"thread-id":{type:"string",description:"Thread the artifact belongs to (required)"},format:{type:"string",description:"Output format for non-JSON mode: json (default) or csv"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi artifacts get <artifact-id> --thread-id <thread-id> # Print artifact data","sazabi artifacts get <artifact-id> --thread-id <thread-id> --format csv # Render table/timeseries as CSV","sazabi artifacts get <artifact-id> --thread-id <thread-id> --json # Output as JSON"]).build()}).withExamples(["sazabi artifacts list --thread-id <thread-id> # List artifacts in a thread","sazabi artifacts get <artifact-id> --thread-id <thread-id> # Get one artifact's data"]).build();ee();mL();import{spawn as rbe}from"node:child_process";var j={token:{type:"string"},"api-base-url":{type:"string"},json:{type:"boolean"}},_={token:{type:"string",description:"Override token"},"api-base-url":{type:"string",description:"Override API base URL"},json:{type:"boolean",description:"Output as JSON"}};ce();ie();Vt();var Ei=(e)=>{if(e==="flag")return"from flag";if(e==="environment")return"from environment";return"from settings"},ibe=async(e={})=>{let t=C({jsonMode:e.json}),n=z({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=w(await n.me(),"Couldn't fetch authentication details (run 'sazabi auth login' to sign in again)",e.json);if(e.json){J({credential:r,activeOrganizationId:t.organizationId,activeProjectId:t.projectId,tokenSource:t.tokenSource,organizationSource:t.organizationSource,projectSource:t.projectSource});return}if(Pe("Authentication"),r.credentialType==="user"){fe({Type:`User token (${Ei(t.tokenSource)})`,User:r.user.name??r.user.email,Email:r.user.email,"Active organization":t.organizationId&&t.organizationSource?`${t.organizationId} (${Ei(t.organizationSource)})`:lt("(none)"),"Active project":t.projectId&&t.projectSource?`${t.projectId} (${Ei(t.projectSource)})`:lt("(none)"),Organizations:r.organizations.length.toString(),"Dashboard URL":Ki()});return}if(r.credentialType==="secret"){fe({Type:`Secret key (${Ei(t.tokenSource)})`,Organization:r.organization.name,"Key name":r.keyName,"Active project":t.projectId&&t.projectSource?`${t.projectId} (${Ei(t.projectSource)})`:lt("(none)"),"Dashboard URL":Ki()});return}fe({Type:`Partner key (${Ei(t.tokenSource)})`,Superorganization:r.superorganization.name,"Dashboard URL":Ki()})},abe=async(e,t={})=>{let n=e.trim();if(!n){if(t.json)return b("Token is required.");return m("Token is required.")}let r=w(Re(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",t.json);await $L({token:n,options:t,cliSettings:r,status:"saved"})},cF=(e)=>{let t=process.platform,n,r;if(t==="darwin")n="open",r=[e];else if(t==="win32")n="cmd",r=["/c","start","",e];else n="xdg-open",r=[e];let o=rbe(n,r,{detached:!0,stdio:"ignore"});o.on("error",()=>{}),o.unref()},sF=(e)=>new Promise((t)=>setTimeout(t,e)),cbe=async(e={})=>{let t=w(Re(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",e.json),n=Ln(t),r=t.profiles[n]??{},o=IL(r,e.apiBaseUrl),i=hF(o,e.authBaseUrl??r.authBaseUrl),c;try{c=await yL({apiBaseUrl:i})}catch(y){let p=y instanceof Error?y.message:String(y);if(e.json)return b(`Failed to initiate sign-up: ${p}`);return m(`Failed to initiate sign-up: ${p}`)}let s=uF({profile:r,publicApiBaseUrl:o,authBaseUrl:i,apiBaseUrlOverride:e.apiBaseUrl,authBaseUrlOverride:e.authBaseUrl,webBaseUrlOverride:e.webBaseUrl,verificationUriComplete:c.verificationUriComplete}),h=`/login/cli?user_code=${encodeURIComponent(c.userCode)}`,l=`${s}/sign-up?returnTo=${encodeURIComponent(h)}`,u=new Date(Date.now()+c.expiresIn*1000),d=c.interval*1000;if(!e.json)le(),Pe("Create a Sazabi account"),le(),bn(`Opening ${ze.info(l)}`),le(),cF(l),ae("Waiting for sign-up to complete...");while(new Date<u){await sF(d);try{let y=await bL({apiBaseUrl:i,deviceCode:c.deviceCode});if(y.status==="pending"){d=(y.interval??c.interval)*1000;continue}if(y.status==="denied"){if(e.json)return b("Sign-up was denied.");return le(),m("Sign-up was denied.")}if(y.status==="expired"){if(e.json)return b("Sign-up request expired. Try again.");return le(),m("Sign-up request expired. Try again.")}await $L({token:y.accessToken,options:e,cliSettings:t,status:"authorized"});return}catch(y){let p=y instanceof Error?y.message:String(y);if(e.json)return b(`Sign-up failed: ${p}`);return le(),m(`Sign-up failed: ${p}`)}}if(e.json)return b("Sign-up request expired. Try again.");return le(),m("Sign-up request expired. Try again.")},sbe=async(e={})=>{let t=w(Re(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",e.json),n=Ln(t),r=t.profiles[n]??{},o=IL(r,e.apiBaseUrl),i=hF(o,e.authBaseUrl??r.authBaseUrl),c;try{c=await yL({apiBaseUrl:i})}catch(d){let y=d instanceof Error?d.message:String(d);if(e.json)return b(`Failed to initiate login: ${y}`);return m(`Failed to initiate login: ${y}`)}let s=uF({profile:r,publicApiBaseUrl:o,authBaseUrl:i,apiBaseUrlOverride:e.apiBaseUrl,authBaseUrlOverride:e.authBaseUrl,webBaseUrlOverride:e.webBaseUrl,verificationUriComplete:c.verificationUriComplete}),h=mbe(c.verificationUriComplete,s),l=new Date(Date.now()+c.expiresIn*1000),u=c.interval*1000;if(!e.json)le(),Pe("Sign in to Sazabi"),le(),bn("Enter this code in your browser:"),le(),bn(ze.bold(c.userCode),4),le(),bn(`Opening ${ze.info(h)}`),le(),cF(h),ae("Waiting for authorization...");while(new Date<l){await sF(u);try{let d=await bL({apiBaseUrl:i,deviceCode:c.deviceCode});if(d.status==="pending"){u=(d.interval??c.interval)*1000;continue}if(d.status==="denied"){if(e.json)return b("Authorization was denied.");return le(),m("Authorization was denied.")}if(d.status==="expired"){if(e.json)return b("Authorization request expired. Try again.");return le(),m("Authorization request expired. Try again.")}await $L({token:d.accessToken,options:e,cliSettings:t,status:"authorized"});return}catch(d){let y=d instanceof Error?d.message:String(d);if(e.json)return b(`Authorization failed: ${y}`);return le(),m(`Authorization failed: ${y}`)}}if(e.json)return b("Authorization request expired. Try again.");return le(),m("Authorization request expired. Try again.")},hbe=(e)=>{let t=w(Re(),"Couldn't read settings (check that ~/.sazabi/settings.json is readable)",e.json),n=w(Rt(t),"Couldn't resolve profile (run 'sazabi profiles list' to see available profiles)",e.json),r=Boolean(n.token),o=w(Ut(t,{token:void 0,activeOrganizationId:void 0,organizationName:void 0,activeProjectId:void 0,...Bn(n)}),"Failed to update profile",e.json);if(w(Xe(o),"Failed to remove credentials",e.json),e.json){J({removed:r});return}if(r){F("Signed out.");return}ae("No credentials were saved.")},$L=async({token:e,options:t,cliSettings:n,status:r})=>{let o=Ln(n),i=n.profiles[o]??{},c=IL(i,t.apiBaseUrl),s=z({token:e,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),h=w(await s.me(),`Couldn't resolve authenticated context at ${c} (pass --api-base-url to target a different environment)`,t.json);if(r==="authorized"&&h.credentialType!=="user"){if(t.json)return b("Expected a user session from device authorization.");return m("Expected a user session from device authorization.")}let l=n.profiles[o]?n:{...n,profiles:{...n.profiles,[o]:{}}},u=l.profiles[o],d=await lbe({client:s,credential:h,currentProjectId:u.activeProjectId,jsonMode:t.json}),y=u.token!==e||u.activeOrganizationId!==d.activeOrganizationId||u.activeProjectId!==d.activeProjectId,p=w(Ut(l,{token:e,activeOrganizationId:d.activeOrganizationId,organizationName:d.activeOrganizationName,activeProjectId:d.activeProjectId,apiBaseUrl:t.apiBaseUrl??u.apiBaseUrl,authBaseUrl:t.authBaseUrl??u.authBaseUrl,webBaseUrl:t.webBaseUrl??u.webBaseUrl,...y&&Bn(u)}),"Failed to update profile",t.json);if(w(Xe(p),"Failed to save credentials",t.json),t.json){J({status:r,credential:h,activeOrganizationId:d.activeOrganizationId,activeProjectId:d.activeProjectId,projects:d.projects});return}if(le(),F(r==="authorized"?"Signed in.":"Token saved."),le(),gbe({credential:h,activeOrganizationName:d.activeOrganizationName,activeProjectId:d.activeProjectId,projects:d.projects}),d.projects.length>0){le(),Pe("Available projects");for(let f of d.projects){let L=f.id===d.activeProjectId?ze.success(" (active)"):"";bn(`${f.name} (${f.region})${L}`)}}},lbe=async({client:e,credential:t,currentProjectId:n,jsonMode:r})=>{if(t.credentialType==="partner")return{projects:[]};let o=t.credentialType==="user"?t.activeOrganizationId??t.organizations[0]?.id:t.organization.id,i=t.credentialType==="user"?t.organizations.find((s)=>s.id===o)?.name:t.organization.name,c=o?w(await e.projects.list({organizationId:o}),"Couldn't fetch projects (check your organization access and try again)",r).projects:[];return{activeOrganizationId:o,activeOrganizationName:i,activeProjectId:ube(c,n),projects:c}},ube=(e,t)=>{if(t&&e.some((n)=>n.id===t))return t;return e[0]?.id},gbe=({credential:e,activeOrganizationName:t,activeProjectId:n,projects:r})=>{if(e.credentialType==="user"){fe({Type:"User token",User:e.user.name??e.user.email,Organizations:e.organizations.length.toString(),"Active organization":t??"(none)","Active project":r.find((o)=>o.id===n)?.name??"(none)"});return}if(e.credentialType==="secret"){fe({Type:"Secret key",Organization:e.organization.name,"Key name":e.keyName,"Active project":r.find((o)=>o.id===n)?.name??"(none)"});return}fe({Type:"Partner key",Superorganization:e.superorganization.name})},IL=(e,t)=>{return Tn({cliFlag:t,globalUrl:e.apiBaseUrl,globalDomain:e.apiDomain,buildUrlFromDomain:(n)=>`https://api.${n}`,defaultUrl:"https://api.sazabi.com"})},hF=(e,t)=>{if(t)return t;try{let n=new URL(e);if(["localhost","127.0.0.1"].includes(n.hostname)&&["15005","15009"].includes(n.port))return n.port="15001",n.toString().replace(/\/$/,"");if(n.hostname==="api.sazabi.com")return n.hostname="api.platform.sazabi.com",n.toString().replace(/\/$/,"");if(n.hostname==="api.staging.sazabi.dev")return n.hostname="api.platform.staging.sazabi.dev",n.toString().replace(/\/$/,"");return n.toString().replace(/\/$/,"")}catch{return e}},lF=(e)=>e.replace(/\/+$/,""),Mt=(e)=>(e?.trim().length??0)>0,dbe=(e)=>{if(!Mt(e))return;try{let t=new URL(e);return`${t.protocol}//${t.host}`}catch{return}},qi=(e)=>{if(!Mt(e))return;try{let n=new URL(e).hostname.toLowerCase();if(["localhost","127.0.0.1"].includes(n))return"https://localhost:5173";if(["api.staging.sazabi.dev","api.platform.staging.sazabi.dev"].includes(n))return"https://app.staging.sazabi.dev";if(["api.sazabi.com","api.platform.sazabi.com"].includes(n))return"https://app.sazabi.com"}catch{return}return},ybe=(e)=>{if(Mt(e.webBaseUrl))return lF(e.webBaseUrl);if(Mt(e.webDomain))return sd(e.webDomain);return},bbe=({profile:e,publicApiBaseUrl:t})=>{if(!(Mt(e.authBaseUrl)||Mt(e.apiBaseUrl)||Mt(e.apiDomain)))return;if(Mt(e.authBaseUrl)){let r=qi(e.authBaseUrl);if(r)return r}return qi(t)},uF=({profile:e,publicApiBaseUrl:t,authBaseUrl:n,apiBaseUrlOverride:r,authBaseUrlOverride:o,webBaseUrlOverride:i,verificationUriComplete:c})=>{if(Mt(i))return lF(i);let s=process.env.SAZABI_API_URL?.trim(),h=Mt(o)||Mt(r)||Mt(s),l=dbe(c);if(h){let y=Mt(o)?qi(n):qi(t);if(y)return y;if(l)return l}let u=ybe(e);if(u)return u;let d=bbe({profile:e,publicApiBaseUrl:t});if(d)return d;if(l)return l;return"https://app.sazabi.com"},mbe=(e,t)=>{if(!t)return e;try{let n=new URL(e),r=new URL(t);return n.protocol=r.protocol,n.host=r.host,n.toString()}catch{return e}},gF=Q("auth","Manage authentication credentials").withSubcommands({signup:S("signup","Create a new Sazabi account via browser",async(e)=>{let{values:t,positionals:n}=$(e,{...j,"auth-base-url":{type:"string"},"web-base-url":{type:"string"}},{allowPositionals:!0});if(n.length>0){let r=n.join(", ");if(t.json)return b(`Unexpected arguments: ${r}.`);return m(`Unexpected arguments: ${r}.`)}await cbe({json:t.json,apiBaseUrl:t["api-base-url"],authBaseUrl:t["auth-base-url"],webBaseUrl:t["web-base-url"]})}).withOptions({..._,"auth-base-url":{type:"string",description:"Override auth API base URL"},"web-base-url":{type:"string",description:"Override web app base URL"}}).withExamples(["sazabi auth signup # Create a new account via browser"]).build(),login:S("login","Authenticate via browser",async(e)=>{let{values:t,positionals:n}=$(e,{...j,"auth-base-url":{type:"string"},"web-base-url":{type:"string"}},{allowPositionals:!0});if(n.length>0){let r=n.join(", ");if(t.json)return b(`Unexpected arguments: ${r}.`);return m(`Unexpected arguments: ${r}.`)}await sbe({json:t.json,apiBaseUrl:t["api-base-url"],authBaseUrl:t["auth-base-url"],webBaseUrl:t["web-base-url"]})}).withOptions({..._,"auth-base-url":{type:"string",description:"Override auth API base URL"},"web-base-url":{type:"string",description:"Override web app base URL"}}).withExamples(["sazabi auth login # Authenticate via browser"]).build(),save:S("save","Save an existing bearer token",async(e)=>{let{values:t,positionals:n}=$(e,{...j,"web-base-url":{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Token is required.");return m("Token is required.")}if(n.length>1){let o=n.slice(1).join(", ");if(t.json)return b(`Unexpected arguments: ${o}.`);return m(`Unexpected arguments: ${o}.`)}await abe(r,{json:t.json,apiBaseUrl:t["api-base-url"],webBaseUrl:t["web-base-url"]})}).withPositionalArgs("<token>").withOptions({..._,"web-base-url":{type:"string",description:"Override web app base URL"}}).withExamples(["sazabi auth save sazabi_secret_xxx # Save a secret key for future commands"]).build(),logout:S("logout","Remove saved credentials",async(e)=>{let{values:t,positionals:n}=$(e,j,{allowPositionals:!0});if(n.length>0){let r=n.join(", ");if(t.json)return b(`Unexpected arguments: ${r}.`);return m(`Unexpected arguments: ${r}.`)}hbe({json:t.json})}).withOptions(_).withExamples(["sazabi auth logout # Remove saved credentials"]).build(),whoami:S("whoami","Display current authentication context",async(e)=>{let{values:t,positionals:n}=$(e,j,{allowPositionals:!0});if(n.length>0){let r=n.join(", ");if(t.json)return b(`Unexpected arguments: ${r}.`);return m(`Unexpected arguments: ${r}.`)}await ibe({json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions(_).withExamples(["sazabi auth whoami # Show current context","sazabi auth whoami --json # Output as JSON"]).build()}).withExamples(["sazabi auth signup # Create a new account via browser","sazabi auth login # Authenticate via browser","sazabi auth save sazabi_secret_xxx # Save an existing token","sazabi auth logout # Remove saved credentials","sazabi auth whoami # Show current context"]).build();ee();ce();ie();var is=(e)=>({id:e.id,name:e.name,status:e.enabled?"active":"paused",source:e.source,kind:e.kind,health:e.health,cronExpression:e.cronExpression,timezone:e.timezone,timeoutSeconds:e.timeoutSeconds,successRate:e.successRate,runCount:e.runCount,failedRunCount:e.failedRunCount,lastRunStatus:e.lastRun?.status??null,lastRunAt:e.lastRun?.startedAt??null,scriptIdentifier:"scriptIdentifier"in e?e.scriptIdentifier:null,scriptId:"scriptId"in e?e.scriptId:null,scriptName:"scriptName"in e?e.scriptName:null,canToggle:"canToggle"in e?e.canToggle:null,createdAt:"createdAt"in e?e.createdAt:null,updatedAt:"updatedAt"in e?e.updatedAt:null}),yF={id:{label:"ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"nullable-string"}},name:{label:"Name",type:{kind:"string"}},status:{label:"Status",type:{kind:"custom",render:(e)=>e==="active"?"Enabled":"Disabled",serialize:(e)=>e}},source:{label:"Source",type:{kind:"string"}},kind:{label:"Kind",type:{kind:"string"}},health:{label:"Health",type:{kind:"string"}},cronExpression:{label:"Cron",type:{kind:"nullable-string",emptyLabel:"(n/a)"}},timezone:{label:"Timezone",type:{kind:"string"}},timeoutSeconds:{label:"Timeout (s)",type:{kind:"custom",render:(e)=>e==null?"(none)":String(e),serialize:(e)=>e}},successRate:{label:"Success rate",type:{kind:"custom",render:(e)=>e==null?"(n/a)":`${Math.round(Number(e)*100)}%`,serialize:(e)=>e}},runCount:{label:"Runs (7d)",type:{kind:"number"}},failedRunCount:{label:"Failures (7d)",type:{kind:"number"}},lastRunStatus:{label:"Last run status",type:{kind:"nullable-string",emptyLabel:"(never)"}},lastRunAt:{label:"Last run",type:{kind:"nullable-date",emptyLabel:"(never)"}},scriptIdentifier:{label:"Script",type:{kind:"nullable-string"}},scriptId:{label:"Script ID",type:{kind:"nullable-string"}},scriptName:{label:"Script name",type:{kind:"nullable-string"}},canToggle:{label:"Can toggle",type:{kind:"custom",render:(e)=>e==null?"(n/a)":e?"yes":"no",serialize:(e)=>e}},createdAt:{label:"Created at",type:{kind:"nullable-date"}},updatedAt:{label:"Updated at",type:{kind:"nullable-date"}}},pbe={schema:yF,columns:["name","status","health","cronExpression","lastRunAt"],jsonFields:["id","name","status","source","kind","health","cronExpression","timezone","timeoutSeconds","successRate","runCount","failedRunCount","lastRunStatus","lastRunAt"],header:"Automations",emptyMessage:"No automations found."},ud={layout:"field-list",schema:yF,fields:["id","url","name","status","source","kind","health","cronExpression","timezone","timeoutSeconds","successRate","runCount","failedRunCount","lastRunStatus","lastRunAt","scriptIdentifier","scriptId","scriptName","canToggle","createdAt","updatedAt"],title:"Automation"},bF=(e)=>({id:e.id,automationRunKey:e.automationRunKey,status:e.status,scheduledAt:e.scheduledAt,dueAt:e.dueAt,startedAt:e.startedAt,completedAt:e.completedAt,durationMs:e.durationMs,exitCode:e.exitCode,errorMessage:e.errorMessage,automationId:"automationId"in e?e.automationId:null}),mF={id:{label:"ID",type:{kind:"id"}},automationId:{label:"Automation",type:{kind:"nullable-string"}},automationRunKey:{label:"Run key",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},scheduledAt:{label:"Scheduled at",type:{kind:"nullable-date"}},dueAt:{label:"Due at",type:{kind:"nullable-date"}},startedAt:{label:"Started at",type:{kind:"date"}},completedAt:{label:"Completed at",type:{kind:"nullable-date"}},durationMs:{label:"Duration (ms)",type:{kind:"custom",render:(e)=>e==null?"(n/a)":String(e),serialize:(e)=>e}},exitCode:{label:"Exit code",type:{kind:"custom",render:(e)=>e==null?"(n/a)":String(e),serialize:(e)=>e}},errorMessage:{label:"Error",type:{kind:"nullable-string",emptyLabel:"(none)"}}},wbe={schema:mF,columns:["status","startedAt","durationMs","exitCode"],jsonFields:["id","automationRunKey","status","scheduledAt","dueAt","startedAt","completedAt","durationMs","exitCode","errorMessage"],header:"Automation runs",emptyMessage:"No automation runs found."},fbe={layout:"field-list",schema:mF,fields:["id","automationId","automationRunKey","status","scheduledAt","dueAt","startedAt","completedAt","durationMs","exitCode","errorMessage"],title:"Automation run"},kbe=(e)=>({status:e.status,exitCode:e.exitCode,truncated:e.truncated,durationMs:e.durationMs,startedAt:e.startedAt,completedAt:e.completedAt,stdout:e.stdout,stderr:e.stderr}),vbe={status:{label:"Status",type:{kind:"string"}},exitCode:{label:"Exit code",type:{kind:"custom",render:(e)=>e==null?"(n/a)":String(e),serialize:(e)=>e}},truncated:{label:"Truncated",type:{kind:"custom",render:(e)=>e?"yes":"no",serialize:(e)=>e}},durationMs:{label:"Duration (ms)",type:{kind:"custom",render:(e)=>e==null?"(n/a)":String(e),serialize:(e)=>e}},startedAt:{label:"Started at",type:{kind:"nullable-date"}},completedAt:{label:"Completed at",type:{kind:"nullable-date"}},stdout:{label:"Stdout",type:{kind:"custom",render:(e)=>e?String(e):"(empty)",serialize:(e)=>e}},stderr:{label:"Stderr",type:{kind:"custom",render:(e)=>e?String(e):"(empty)",serialize:(e)=>e}}},Sbe={layout:"field-list",schema:vbe,fields:["status","exitCode","truncated","durationMs","startedAt","completedAt","stdout","stderr"],title:"Automation run logs"},vo=(e)=>{let t=C({tokenFlag:e.token,projectIdFlag:e.projectId,jsonMode:e.json});return{client:z({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),projectId:t.projectId}},gd=(e,t)=>t?{...e,url:WZ(t,e.id)}:e,Pbe=async(e)=>{let{client:t}=vo(e),n=w(await t.automations.list({search:e.search,status:e.status,source:e.source,health:e.health,sort:e.sort,limit:e.limit,cursor:e.cursor}),"Couldn't list automations (check the active project and try again)",e.json);H(pbe,n.automations.map(is),{json:e.json,nextCursor:n.nextCursor})},$be=async(e,t)=>{let{client:n,projectId:r}=vo(t),o=w(await n.automations.get(e),"Couldn't get automation (run 'sazabi automations list' to see automation IDs)",t.json);U(ud,gd(is(o.automation),r),{json:t.json})},Ibe=async(e,t)=>{let n=t.scriptId!==void 0,r=t.script!==void 0,o=t.expressionId!==void 0,i=Number(n)+Number(r)+Number(o),c=(u)=>{if(t.json){b(u);return}m(u)};if(i!==1){c("Provide exactly one of --script-id, --script, or --expression-id.");return}if(o){if(t.cronExpression!==void 0||t.timezone!==void 0||t.timeoutSeconds!==void 0){c("Cron and timeout flags are not used with --expression-id log-match automations.");return}if(!t.description?.trim()){c("--description is required for log-match automations (investigation instructions).");return}}let{client:s,projectId:h}=vo(t),l=w(await s.automations.create({name:e,...t.description!==void 0?{description:t.description}:{},...t.scriptId!==void 0?{scriptId:t.scriptId}:{},...t.script!==void 0?{script:t.script}:{},...t.expressionId!==void 0?{expressionId:t.expressionId}:{},...t.cronExpression!==void 0?{cronExpression:t.cronExpression}:{},...t.timezone!==void 0?{timezone:t.timezone}:{},...t.timeoutSeconds!==void 0?{timeoutSeconds:t.timeoutSeconds}:{},...t.enabled!==void 0?{enabled:t.enabled}:{}}),o?"Couldn't create log-match automation (check the expression ID and description)":"Couldn't create automation (check the script name/ID and try again)",t.json);if(!t.json)F(`Automation "${l.automation.name}" created.`);U(ud,gd(is(l.automation),h),{json:t.json})},Lbe=async(e,t)=>{if(t.name===void 0&&t.description===void 0&&t.clearDescription!==!0&&t.cronExpression===void 0&&t.timezone===void 0&&t.timeoutSeconds===void 0){if(t.json){b("Nothing to update. Provide --name, --description, --clear-description, --cron-expression, --timezone, or --timeout-seconds.");return}m("Nothing to update. Provide --name, --description, --clear-description, --cron-expression, --timezone, or --timeout-seconds.");return}if(t.description!==void 0&&t.clearDescription===!0){if(t.json){b("Use either --description or --clear-description, not both.");return}m("Use either --description or --clear-description, not both.");return}let{client:n,projectId:r}=vo(t),o=w(await n.automations.update({automationId:e,...t.name!==void 0?{name:t.name}:{},...t.clearDescription?{description:null}:t.description!==void 0?{description:t.description}:{},...t.cronExpression!==void 0?{cronExpression:t.cronExpression}:{},...t.timezone!==void 0?{timezone:t.timezone}:{},...t.timeoutSeconds!==void 0?{timeoutSeconds:t.timeoutSeconds}:{}}),"Couldn't update automation (run 'sazabi automations list' to see automation IDs)",t.json);if(!t.json)F(`Automation "${o.automation.name}" updated.`);U(ud,gd(is(o.automation),r),{json:t.json})},pF=async(e,t,n)=>{let{client:r,projectId:o}=vo(n),i=w(t?await r.automations.enable(e):await r.automations.disable(e),t?"Failed to enable automation":"Failed to disable automation",n.json),c=gd(is(i.automation),o);if(!n.json)F(`Automation "${c.name}" is now ${t?"enabled":"disabled"}.`);U(ud,c,{json:n.json})},Tbe=async(e,t)=>pF(e,!0,t),Obe=async(e,t)=>pF(e,!1,t),Abe=async(e,t)=>{let{client:n}=vo(t),r=w(await n.automations.runs.list(e,{status:t.status,limit:t.limit,cursor:t.cursor}),"Couldn't list automation runs (run 'sazabi automations list' to see automation IDs)",t.json);H(wbe,r.runs.map(bF),{json:t.json,nextCursor:r.nextCursor})},Cbe=async(e,t,n)=>{let{client:r}=vo(n),o=w(await r.automations.runs.get(e,t),"Couldn't get automation run (run 'sazabi automations runs list <automation-id>' to see run IDs)",n.json);U(fbe,bF(o.run),{json:n.json})},Dbe=async(e,t,n)=>{let{client:r}=vo(n),o=w(await r.automations.runs.logs(e,t),"Couldn't get automation run logs (run 'sazabi automations runs list <automation-id>' to see run IDs)",n.json);U(Sbe,kbe(o.logs),{json:n.json})},Wn={...j,"project-id":{type:"string"}},Zn={..._,"project-id":{type:"string",description:"Override active project ID"}},zbe=(e,t)=>{let n=e[0];if(!n){if(t){b("Automation name is required.");return}m("Automation name is required.");return}return n},Qo=(e,t)=>{let n=e[0];if(!n){if(t){b("Automation ID is required.");return}m("Automation ID is required.");return}return n},dF=(e,t)=>{let n=e[1];if(!n){if(t){b("Run ID is required.");return}m("Run ID is required.");return}return n},wF=Q("automations","Manage scheduled automations").withSubcommands({list:S("list","List automations in the active project",async(e)=>{let{values:t}=$(e,{...Wn,search:{type:"string"},status:{type:"string"},source:{type:"string"},health:{type:"string"},sort:{type:"string"},limit:{type:"string"},cursor:{type:"string"}}),n=(u)=>{if(t.json){b(u);return}m(u)},r=t.status;if(r!==void 0&&r!=="active"&&r!=="paused")return n(`Invalid --status value "${r}". Expected "active" or "paused".`);let o=t.source;if(o!==void 0&&o!=="sazabi_managed"&&o!=="custom")return n(`Invalid --source value "${o}". Expected "sazabi_managed" or "custom".`);let i=t.health,c=["healthy","failing","never_run"];if(i!==void 0&&!c.includes(i))return n(`Invalid --health value "${i}". Expected one of: ${c.join(", ")}.`);let s=t.sort,h=["name","last_run","failures","runs"];if(s!==void 0&&!h.includes(s))return n(`Invalid --sort value "${s}". Expected one of: ${h.join(", ")}.`);let l;if(t.limit!==void 0){if(l=Number(t.limit),!Number.isInteger(l)||l<1||l>100)return n(`Invalid --limit value "${t.limit}". Expected an integer between 1 and 100.`)}await Pbe({token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],search:t.search,status:r,source:o,health:i,sort:s,limit:l,cursor:t.cursor})}).withOptions({...Zn,search:{type:"string",description:"Filter by automation name (case-insensitive)"},status:{type:"string",description:"Filter by status: active or paused"},source:{type:"string",description:"Filter by source: sazabi_managed or custom"},health:{type:"string",description:"Filter by health: healthy, failing, or never_run"},sort:{type:"string",description:"Sort by: name, last_run, failures, or runs"},limit:{type:"string",description:"Maximum number of automations to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples(["sazabi automations list # List all automations","sazabi automations list --status paused # List paused automations"]).build(),get:S("get","Get one automation by ID",async(e)=>{let{values:t,positionals:n}=$(e,Wn,{allowPositionals:!0}),r=Qo(n,t.json);if(!r)return;await $be(r,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id>").withOptions(Zn).withExamples(["sazabi automations get <automation-id> # Get one automation"]).build(),create:S("create","Create an automation",async(e)=>{let{values:t,positionals:n}=$(e,{...Wn,description:{type:"string"},"script-id":{type:"string"},script:{type:"string"},"expression-id":{type:"string"},"cron-expression":{type:"string"},timezone:{type:"string"},"timeout-seconds":{type:"string"},enabled:{type:"boolean"}},{allowPositionals:!0}),r=zbe(n,t.json);if(!r)return;let o=(c)=>{if(t.json){b(c);return}m(c)},i;if(t["timeout-seconds"]!==void 0){if(i=Number(t["timeout-seconds"]),!Number.isInteger(i)||i<1||i>3600)return o(`Invalid --timeout-seconds value "${t["timeout-seconds"]}". Expected an integer between 1 and 3600.`)}await Ibe(r,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],description:t.description,scriptId:t["script-id"],script:t.script,expressionId:t["expression-id"],cronExpression:t["cron-expression"],timezone:t.timezone,timeoutSeconds:i,enabled:t.enabled})}).withPositionalArgs("<name>").withOptions({...Zn,description:{type:"string",description:"Human-readable description (required for log-match automations)"},"script-id":{type:"string",description:"Project script ID to run (cron automations)"},script:{type:"string",description:"Project script name to run (cron automations)"},"expression-id":{type:"string",description:"Log-match expression ID to bind (creates a log-match investigation automation)"},"cron-expression":{type:"string",description:"Cron schedule expression"},timezone:{type:"string",description:"IANA timezone for the schedule"},"timeout-seconds":{type:"string",description:"Run timeout in seconds (1-3600)"},enabled:{type:"boolean",description:"Create the automation enabled"}}).withExamples(["sazabi automations create deploy-nightly --script health --cron-expression '0 3 * * *' # Create from a DB-backed script by name","sazabi automations create deploy-nightly --script-id <script-id> # Create by script ID",'sazabi automations create "Investigate Plain tickets" --expression-id <uuid> --description "When a new Plain ticket is created, investigate …" # Create a log-match investigation automation']).build(),update:S("update","Update an automation",async(e)=>{let{values:t,positionals:n}=$(e,{...Wn,name:{type:"string"},description:{type:"string"},"clear-description":{type:"boolean"},"cron-expression":{type:"string"},timezone:{type:"string"},"timeout-seconds":{type:"string"}},{allowPositionals:!0}),r=Qo(n,t.json);if(!r)return;let o=(c)=>{if(t.json){b(c);return}m(c)},i;if(t["timeout-seconds"]!==void 0){if(i=Number(t["timeout-seconds"]),!Number.isInteger(i)||i<1||i>3600)return o(`Invalid --timeout-seconds value "${t["timeout-seconds"]}". Expected an integer between 1 and 3600.`)}await Lbe(r,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],name:t.name,description:t.description,clearDescription:t["clear-description"],cronExpression:t["cron-expression"],timezone:t.timezone,timeoutSeconds:i})}).withPositionalArgs("<automation-id>").withOptions({...Zn,name:{type:"string",description:"New automation name"},description:{type:"string",description:"New human-readable description"},"clear-description":{type:"boolean",description:"Clear the automation description"},"cron-expression":{type:"string",description:"New cron schedule expression"},timezone:{type:"string",description:"New IANA timezone for the schedule"},"timeout-seconds":{type:"string",description:"New run timeout in seconds (1-3600)"}}).withExamples(["sazabi automations update <automation-id> --cron-expression '0 4 * * *' # Change the schedule"]).build(),enable:S("enable","Enable an automation",async(e)=>{let{values:t,positionals:n}=$(e,Wn,{allowPositionals:!0}),r=Qo(n,t.json);if(!r)return;await Tbe(r,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id>").withOptions(Zn).withExamples(["sazabi automations enable <automation-id> # Enable an automation"]).build(),disable:S("disable","Disable an automation",async(e)=>{let{values:t,positionals:n}=$(e,Wn,{allowPositionals:!0}),r=Qo(n,t.json);if(!r)return;await Obe(r,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id>").withOptions(Zn).withExamples(["sazabi automations disable <automation-id> # Disable an automation"]).build(),runs:S("runs","Inspect automation runs").withSubcommands({list:S("list","List runs for an automation",async(e)=>{let{values:t,positionals:n}=$(e,{...Wn,status:{type:"string"},limit:{type:"string"},cursor:{type:"string"}},{allowPositionals:!0}),r=Qo(n,t.json);if(!r)return;let o=(h)=>{if(t.json){b(h);return}m(h)},i=t.status,c=["running","succeeded","failed","timed_out","cancelled"];if(i!==void 0&&!c.includes(i))return o(`Invalid --status value "${i}". Expected one of: ${c.join(", ")}.`);let s;if(t.limit!==void 0){if(s=Number(t.limit),!Number.isInteger(s)||s<1||s>100)return o(`Invalid --limit value "${t.limit}". Expected an integer between 1 and 100.`)}await Abe(r,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"],status:i,limit:s,cursor:t.cursor})}).withPositionalArgs("<automation-id>").withOptions({...Zn,status:{type:"string",description:"Filter by run status: running, succeeded, failed, timed_out, or cancelled"},limit:{type:"string",description:"Maximum number of runs to return (default: 50, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"}}).withExamples(["sazabi automations runs list <automation-id> # List runs for an automation","sazabi automations runs list <automation-id> --status failed # List failed runs"]).build(),get:S("get","Get one automation run by ID",async(e)=>{let{values:t,positionals:n}=$(e,Wn,{allowPositionals:!0}),r=Qo(n,t.json);if(!r)return;let o=dF(n,t.json);if(!o)return;await Cbe(r,o,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id> <run-id>").withOptions(Zn).withExamples(["sazabi automations runs get <automation-id> <run-id> # Get one automation run"]).build(),logs:S("logs","Get the captured logs for an automation run",async(e)=>{let{values:t,positionals:n}=$(e,Wn,{allowPositionals:!0}),r=Qo(n,t.json);if(!r)return;let o=dF(n,t.json);if(!o)return;await Dbe(r,o,{token:t.token,projectId:t["project-id"],json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<automation-id> <run-id>").withOptions(Zn).withExamples(["sazabi automations runs logs <automation-id> <run-id> # Get captured logs for a run"]).build()}).withExamples(["sazabi automations runs list <automation-id> # List runs for an automation","sazabi automations runs get <automation-id> <run-id> # Get one run","sazabi automations runs logs <automation-id> <run-id> # Get captured logs for a run"]).build()}).withExamples(["sazabi automations list # List all automations","sazabi automations get <automation-id> # Get one automation","sazabi automations create deploy-nightly --script health --cron-expression '0 3 * * *' # Create from a DB-backed script by name","sazabi automations update <automation-id> --cron-expression '0 4 * * *' # Change the schedule","sazabi automations enable <automation-id> # Enable an automation","sazabi automations disable <automation-id> # Disable an automation","sazabi automations runs list <automation-id> # List runs for an automation","sazabi automations runs get <automation-id> <run-id> # Get one run","sazabi automations runs logs <automation-id> <run-id> # Get captured logs for a run"]).build();ee();ce();ie();var LL=(e)=>{let t=e.json,n=C({tokenFlag:e.token,jsonMode:t});return{client:z({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:e["api-base-url"],jsonMode:t}),json:t??!1}},_be={plan:{label:"Plan",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},currency:{label:"Currency",type:{kind:"string"}},balance:{label:"Current balance",type:{kind:"string"}},targetBalance:{label:"Target balance",type:{kind:"string"}},cycle:{label:"Cycle",type:{kind:"string"}},estimate:{label:"Est. total",type:{kind:"string"}},pendingDowngrade:{label:"Pending downgrade",type:{kind:"string"}}},jbe={layout:"field-list",schema:_be,fields:["plan","status","currency","balance","targetBalance","cycle","estimate","pendingDowngrade"]},Nbe=(e)=>({plan:e.planName??"—",status:e.status,currency:e.currency??"—",balance:e.currentBalance??"—",targetBalance:e.targetCreditBalance??"—",cycle:e.currentCycle?`${e.currentCycle.startsAt.slice(0,10)} - ${e.currentCycle.endsAt.slice(0,10)}`:"—",estimate:e.currentPeriodEstimate?`${e.currentPeriodEstimate.totalAmount} ${e.currentPeriodEstimate.currency}`:"—",pendingDowngrade:e.pendingDowngrade?`${e.pendingDowngrade.planName??"—"} (effective ${e.pendingDowngrade.effectiveAt.slice(0,10)})`:"—"}),xbe=async(e)=>{let{values:t}=$(e,j),{client:n,json:r}=LL(t),o=w(await n.billing.getSummary(),"Couldn't fetch billing summary (check your organization access and try again)",r);if(!r){if(Pe("Billing summary"),!o.billable&&o.nonBillableReason)fe({"Not billable":o.nonBillableReason})}U(jbe,Nbe(o),{json:r})},Rbe={logs_ingested_bytes:"Log data (GB)",input_tokens:"Input tokens",output_tokens:"Output tokens"},Ube=(e)=>{let t=Number.parseFloat(e);if(Number.isNaN(t))return e;return(t/1e9).toFixed(3)},Mbe=(e,t)=>{if(t==="logs_ingested_bytes")return Ube(e);let n=Number.parseInt(e,10);return Number.isNaN(n)?e:n.toLocaleString()},Kbe={dimension:{label:"Dimension",type:{kind:"string"}},total:{label:"Total quantity",type:{kind:"string"}},credits:{label:"Credits consumed",type:{kind:"string"}}},Ebe={schema:Kbe,columns:["dimension","total","credits"],emptyMessage:"No usage recorded for this billing cycle."},qbe=async(e)=>{let{values:t}=$(e,{...j,cycle:{type:"string"}}),{client:n,json:r}=LL(t);if(t.cycle&&t.cycle!=="current"&&t.cycle!=="previous"){if(r)return b("--cycle must be 'current' or 'previous'.");m("--cycle must be 'current' or 'previous'.");return}let o=t.cycle??"current",i=w(await n.billing.getUsage({cycle:o}),"Couldn't fetch billing usage (check your organization access and try again)",r);if(!r){if(Pe(`Billing usage (${o} cycle)`),i.cycle)fe({Cycle:`${i.cycle.startsAt.slice(0,10)} - ${i.cycle.endsAt.slice(0,10)}`})}let c=i.usage.map((s)=>{let h=s.dimension;return{dimension:Rbe[h]??s.dimension,total:Mbe(s.totalQuantity,h),credits:s.creditsConsumed}});H(Ebe,c,{json:r})},Gbe={occurredAt:{label:"Date",type:{kind:"date"}},type:{label:"Type",type:{kind:"string"}},delta:{label:"Credit delta",type:{kind:"string"}},balance:{label:"Balance after",type:{kind:"string"}}},Jbe={schema:Gbe,columns:["occurredAt","type","delta","balance"],emptyMessage:"No billing transactions found."},Hbe=async(e)=>{let{values:t}=$(e,{...j,limit:{type:"string"},page:{type:"string"}}),{client:n,json:r}=LL(t),o,i;if(t.limit){if(o=Number.parseInt(t.limit,10),Number.isNaN(o)||o<1||o>100){if(r)return b("--limit must be a positive integer (max 100).");m("--limit must be a positive integer (max 100).");return}}if(t.page){if(i=Number.parseInt(t.page,10),Number.isNaN(i)||i<1){if(r)return b("--page must be a positive integer.");m("--page must be a positive integer.");return}}let c=w(await n.billing.listTransactions({limit:o??10,page:i??1}),"Couldn't fetch billing transactions (check your organization access and try again)",r);if(!r)Pe("Billing transactions");let s=c.items.map((h)=>({occurredAt:h.occurredAt,type:h.transactionType,delta:h.creditDelta,balance:h.balanceAfter}));if(H(Jbe,s,{json:r,count:c.pagination.total}),!r&&c.pagination.hasNext){let h=(i??1)+1;fe({"Next page":`Use --page ${h} for more results.`})}},Bbe=S("summary","Show the billing summary for your organization",async(e)=>{await xbe(e)}).withOptions(_).withExamples(["sazabi billing summary # Show billing summary","sazabi billing summary --json # Output as JSON"]).build(),Wbe=S("usage","Show per-dimension usage for the current or previous cycle",async(e)=>{await qbe(e)}).withOptions({..._,cycle:{type:"string",description:"Which cycle to report (current or previous)"}}).withExamples(["sazabi billing usage # Current cycle usage","sazabi billing usage --cycle previous # Previous cycle usage","sazabi billing usage --json # Output as JSON"]).build(),Zbe=S("transactions","List recent credit ledger transactions",async(e)=>{await Hbe(e)}).withOptions({..._,limit:{type:"string",description:"Max results per page (default 10, max 100)"},page:{type:"string",description:"Page number (1-indexed)"}}).withExamples(["sazabi billing transactions # Recent transactions","sazabi billing transactions --limit 50 # More results","sazabi billing transactions --page 2 # Next page","sazabi billing transactions --json # Output as JSON"]).build(),fF=Q("billing","View billing summary, usage, and transactions").withSubcommands({summary:Bbe,usage:Wbe,transactions:Zbe}).withExamples(["sazabi billing summary # Show billing plan and balance","sazabi billing usage # Show usage for current cycle","sazabi billing transactions # List recent transactions"]).build();ee();var kF=()=>`
8619
8619
  _sazabi() {
8620
8620
  local -a completions
@@ -9594,5 +9594,5 @@ The full API reference is available at https://api.sazabi.com/docs (interactive
9594
9594
  ### CLI
9595
9595
  - \`references/cli/setup.md\` — Installation, authentication, credential precedence, settings
9596
9596
  - \`references/cli/commands.md\` — All CLI commands, log tailing, log forwarding, JSON mode
9597
- `;var Frt=qke(Eke(Gke(import.meta.url)),"../skills"),Jke=[...lo].sort().map((e)=>({relPath:`references/log-sources/${e}.md`,contents:Vk(e)})),WX=[{name:"sazabi",files:[{relPath:"SKILL.md",contents:BX},{relPath:"references/cli/commands.md",contents:GX},{relPath:"references/cli/setup.md",contents:JX},{relPath:"references/mcp/setup.md",contents:HX},...Jke]}];var Hi=WX;ie();import*as ct from"node:fs";import*as Ze from"node:path";var FX=(e)=>{let t=[],n=Ze.resolve(e.targetRoot);for(let r of e.skills){let o=Ze.join(n,r.name),i=Ze.relative(n,o);if(i.startsWith("..")||Ze.isAbsolute(i))return Me(`Invalid skill name "${r.name}" escapes target root.`);let c=[];for(let s of r.files){let h=Ze.resolve(o,s.relPath),l=Ze.relative(o,h);if(l.startsWith("..")||Ze.isAbsolute(l))return Me(`Invalid skill file path "${s.relPath}" in skill "${r.name}" escapes skill root.`);c.push({absPath:h,contents:s.contents})}t.push({skillName:r.name,files:c})}return We(t)},XX=(e)=>{let t=[];for(let n of e)for(let r of n.files)if(ct.existsSync(r.absPath))t.push(r.absPath);return t},ZX=(e)=>{let t=Ze.resolve(e);while(!ct.existsSync(t)){let n=Ze.dirname(t);if(n===t)break;t=n}return t},YX=(e,t)=>{try{let n;if(t.targetRoot){let c=ZX(t.targetRoot);n=ct.existsSync(c)?ct.realpathSync(c):Ze.resolve(t.targetRoot)}let r=[];for(let c of e)for(let s of c.files)r.push({absPath:s.absPath,contents:s.contents,existed:ct.existsSync(s.absPath)});if(!t.force){let c=r.find((s)=>s.existed);if(c)return Me(`Refusing to overwrite ${c.absPath}. Use --force to overwrite.`)}let o=[],i=[];for(let c of r){if(n){let h=Ze.dirname(c.absPath),l=ZX(h);if(ct.existsSync(l)){let u=ct.realpathSync(l),d=Ze.relative(n,u);if(d.startsWith("..")||Ze.isAbsolute(d))return Me(`Refusing to write ${c.absPath}: symlink escape detected (resolves outside target root).`)}}ct.mkdirSync(Ze.dirname(c.absPath),{recursive:!0,mode:493});let s=!1;try{if(ct.lstatSync(c.absPath).isSymbolicLink())s=!0}catch(h){if(!(h instanceof Error&&("code"in h)&&h.code==="ENOENT"))throw h}if(s)return Me(`Refusing to write ${c.absPath}: path is a symbolic link.`);if(t.force&&c.existed)try{ct.unlinkSync(c.absPath)}catch(h){if(!(h instanceof Error&&("code"in h)&&h.code==="ENOENT"))throw h}try{ct.writeFileSync(c.absPath,c.contents,{encoding:"utf-8",mode:420,flag:"wx"})}catch(h){if(h instanceof Error&&"code"in h&&h.code==="EEXIST"){let l=t.force?`Failed to write ${c.absPath}: file was recreated during operation (possible race condition). Try again.`:`Refusing to overwrite ${c.absPath}. Use --force to overwrite.`;return Me(l)}throw h}if(c.existed)i.push(c.absPath);else o.push(c.absPath)}return We({written:o,overwritten:i})}catch(n){let r=n instanceof Error?n.message:String(n);return Me(`Failed to write skill files: ${r}`)}};var Vo=(e,t)=>{if(t)return b(e);return m(e)},Hke=(e)=>e!==void 0&&Id.includes(e),eY=async(e)=>{let t=Boolean(e.json);if(!e.agent)return void Vo(`Agent is required. Usage: sazabi skill install <agent>. Known agents: ${Id.join(", ")}.`,t);if(!Hke(e.agent))return void Vo(`Unknown agent '${e.agent}'. Known agents: ${Id.join(", ")}.`,t);let n=e.agent;if(e.user&&e.project)return void Vo("--user and --project are mutually exclusive.",t);if(e.projectDir!==void 0&&!e.project)return void Vo("--project-dir is only valid with --project.",t);let r=e.project?"project":"user",o=e.projectDir!==void 0?VX.resolve(e.projectDir):process.cwd(),i=qX({agent:n,scope:r,home:QX.homedir(),projectDir:o});if(i.kind==="unsupported")return void Vo(i.reason,t);if(Hi.length===0)return void Vo("No skills are available to install.",t);let c=w(FX({targetRoot:i.root,skills:Hi}),"Failed to plan skill installation",t);if(!e.force){let h=XX(c);if(h.length>0)return void Vo(["Refusing to overwrite existing files (use --force to overwrite):",...h.map((l)=>` ${l}`)].join(`
9597
+ `;var eit=qke(Eke(Gke(import.meta.url)),"../skills"),Jke=[...lo].sort().map((e)=>({relPath:`references/log-sources/${e}.md`,contents:Vk(e)})),WX=[{name:"sazabi",files:[{relPath:"SKILL.md",contents:BX},{relPath:"references/cli/commands.md",contents:GX},{relPath:"references/cli/setup.md",contents:JX},{relPath:"references/mcp/setup.md",contents:HX},...Jke]}];var Hi=WX;ie();import*as ct from"node:fs";import*as Ze from"node:path";var FX=(e)=>{let t=[],n=Ze.resolve(e.targetRoot);for(let r of e.skills){let o=Ze.join(n,r.name),i=Ze.relative(n,o);if(i.startsWith("..")||Ze.isAbsolute(i))return Me(`Invalid skill name "${r.name}" escapes target root.`);let c=[];for(let s of r.files){let h=Ze.resolve(o,s.relPath),l=Ze.relative(o,h);if(l.startsWith("..")||Ze.isAbsolute(l))return Me(`Invalid skill file path "${s.relPath}" in skill "${r.name}" escapes skill root.`);c.push({absPath:h,contents:s.contents})}t.push({skillName:r.name,files:c})}return We(t)},XX=(e)=>{let t=[];for(let n of e)for(let r of n.files)if(ct.existsSync(r.absPath))t.push(r.absPath);return t},ZX=(e)=>{let t=Ze.resolve(e);while(!ct.existsSync(t)){let n=Ze.dirname(t);if(n===t)break;t=n}return t},YX=(e,t)=>{try{let n;if(t.targetRoot){let c=ZX(t.targetRoot);n=ct.existsSync(c)?ct.realpathSync(c):Ze.resolve(t.targetRoot)}let r=[];for(let c of e)for(let s of c.files)r.push({absPath:s.absPath,contents:s.contents,existed:ct.existsSync(s.absPath)});if(!t.force){let c=r.find((s)=>s.existed);if(c)return Me(`Refusing to overwrite ${c.absPath}. Use --force to overwrite.`)}let o=[],i=[];for(let c of r){if(n){let h=Ze.dirname(c.absPath),l=ZX(h);if(ct.existsSync(l)){let u=ct.realpathSync(l),d=Ze.relative(n,u);if(d.startsWith("..")||Ze.isAbsolute(d))return Me(`Refusing to write ${c.absPath}: symlink escape detected (resolves outside target root).`)}}ct.mkdirSync(Ze.dirname(c.absPath),{recursive:!0,mode:493});let s=!1;try{if(ct.lstatSync(c.absPath).isSymbolicLink())s=!0}catch(h){if(!(h instanceof Error&&("code"in h)&&h.code==="ENOENT"))throw h}if(s)return Me(`Refusing to write ${c.absPath}: path is a symbolic link.`);if(t.force&&c.existed)try{ct.unlinkSync(c.absPath)}catch(h){if(!(h instanceof Error&&("code"in h)&&h.code==="ENOENT"))throw h}try{ct.writeFileSync(c.absPath,c.contents,{encoding:"utf-8",mode:420,flag:"wx"})}catch(h){if(h instanceof Error&&"code"in h&&h.code==="EEXIST"){let l=t.force?`Failed to write ${c.absPath}: file was recreated during operation (possible race condition). Try again.`:`Refusing to overwrite ${c.absPath}. Use --force to overwrite.`;return Me(l)}throw h}if(c.existed)i.push(c.absPath);else o.push(c.absPath)}return We({written:o,overwritten:i})}catch(n){let r=n instanceof Error?n.message:String(n);return Me(`Failed to write skill files: ${r}`)}};var Vo=(e,t)=>{if(t)return b(e);return m(e)},Hke=(e)=>e!==void 0&&Id.includes(e),eY=async(e)=>{let t=Boolean(e.json);if(!e.agent)return void Vo(`Agent is required. Usage: sazabi skill install <agent>. Known agents: ${Id.join(", ")}.`,t);if(!Hke(e.agent))return void Vo(`Unknown agent '${e.agent}'. Known agents: ${Id.join(", ")}.`,t);let n=e.agent;if(e.user&&e.project)return void Vo("--user and --project are mutually exclusive.",t);if(e.projectDir!==void 0&&!e.project)return void Vo("--project-dir is only valid with --project.",t);let r=e.project?"project":"user",o=e.projectDir!==void 0?VX.resolve(e.projectDir):process.cwd(),i=qX({agent:n,scope:r,home:QX.homedir(),projectDir:o});if(i.kind==="unsupported")return void Vo(i.reason,t);if(Hi.length===0)return void Vo("No skills are available to install.",t);let c=w(FX({targetRoot:i.root,skills:Hi}),"Failed to plan skill installation",t);if(!e.force){let h=XX(c);if(h.length>0)return void Vo(["Refusing to overwrite existing files (use --force to overwrite):",...h.map((l)=>` ${l}`)].join(`
9598
9598
  `),t)}let s=w(YX(c,{force:Boolean(e.force),targetRoot:i.root}),"Failed to install skills",t);if(t){J({agent:n,scope:r,targetRoot:i.root,skills:Hi.map((h)=>({name:h.name,files:h.files.map((l)=>l.relPath)})),written:s.written,overwritten:s.overwritten});return}Pe("Installed skills"),fe({Agent:n,Scope:r,Destination:i.root});for(let h of s.written)F(`wrote ${h}`);for(let h of s.overwritten)ht(`replaced ${h}`);F(`Installed ${Hi.length} skill${Hi.length===1?"":"s"} to ${i.root}`)};var tY=Q("skill","Manage Sazabi agent skills").withSubcommands({install:S("install","Install Sazabi skills into your AI agent's skills directory",async(e)=>{let{values:t,positionals:n}=$(e,{user:{type:"boolean"},project:{type:"boolean"},"project-dir":{type:"string"},force:{type:"boolean"},json:{type:"boolean"}},{allowPositionals:!0});await eY({agent:n[0],user:t.user,project:t.project,projectDir:t["project-dir"],force:t.force,json:t.json})}).withPositionalArgs("<agent>").withOptions({user:{type:"boolean",description:"Install into the user-scoped skills directory (default)"},project:{type:"boolean",description:"Install into the project-scoped skills directory"},"project-dir":{type:"string",description:"Project directory for --project (default: current working directory)"},force:{type:"boolean",description:"Overwrite existing skill files"},json:{type:"boolean",description:"Output as JSON"}}).withExamples(["sazabi skill install claude-code # Install for Claude Code in $HOME (default --user)","sazabi skill install codex --project # Install into current repo","sazabi skill install codex --project --project-dir ../other # Install into another repo","sazabi skill install claude-code --force # Overwrite existing files"]).build()}).withExamples(["sazabi skill install claude-code # Install Sazabi skills for Claude Code in $HOME","sazabi skill install codex --project # Install Sazabi skills into the current repo"]).build();ee();ce();ie();ee();ce();ie();var Bke={id:{label:"ID",type:{kind:"string"}},componentId:{label:"Component",type:{kind:"string"}},projectId:{label:"Project",type:{kind:"string"}},severity:{label:"Severity",type:{kind:"string"}},summary:{label:"Summary",type:{kind:"string"}},startedAt:{label:"Started at",type:{kind:"date"}},resolvedAt:{label:"Resolved at",type:{kind:"nullable-date"}}},qL={schema:Bke,columns:["id","componentId","severity","startedAt","resolvedAt"],jsonFields:["id","componentId","projectId","severity","summary","startedAt","resolvedAt"],emptyMessage:"No status page issues found."},Wke={timestamp:{label:"Time",type:{kind:"date"}},status:{label:"Status",type:{kind:"string"}}},nY={schema:Wke,columns:["timestamp","status"],emptyMessage:"No timeline data available."},oY=(e)=>{let t=C({tokenFlag:e.token,jsonMode:e.json});return z({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json})},Zke=async(e)=>{let t=oY(e),n=w(await t.statusComponents.incidents.list({...e.componentId?{componentId:e.componentId}:{},activeOnly:e.activeOnly,limit:e.limit,cursor:e.cursor}),"Couldn't list status page issues (check the active project and try again)",e.json);H(qL,n.incidents,{json:e.json,nextCursor:n.nextCursor})},Fke=async(e,t)=>{let n=oY(t),r=w(await n.statusComponents.timeline({componentId:e,...t.windowStart?{windowStart:t.windowStart}:{},...t.windowEnd?{windowEnd:t.windowEnd}:{}}),"Couldn't fetch status timeline (check the component ID and try again)",t.json);if(t.json){H(nY,r.timeline,{json:!0}),H(qL,r.incidents,{json:!0});return}Pe("Status timeline"),H(nY,r.timeline),Pe("Issues"),H(qL,r.incidents)},rY=S("incidents","List status page issues").withSubcommands({list:S("list","List status page issues in the active project",async(e)=>{let{values:t}=$(e,{...j,"component-id":{type:"string"},"active-only":{type:"boolean"},limit:{type:"string"},cursor:{type:"string"}}),n=t.limit?Number(t.limit):void 0;if(n!==void 0&&(!Number.isInteger(n)||n<1||n>100)){if(t.json)return b("Invalid --limit. Must be an integer between 1 and 100.");return m("Invalid --limit. Must be an integer between 1 and 100.")}await Zke({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],componentId:t["component-id"],activeOnly:t["active-only"],limit:n,cursor:t.cursor})}).withOptions({..._,"component-id":{type:"string",description:"Filter issues to a single component"},"active-only":{type:"boolean",description:"Only show unresolved (ongoing) issues"},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 status incidents list # List recent issues","sazabi status incidents list --active-only # Only ongoing issues","sazabi status incidents list --component-id <id> --json # Issues for one component"]).build()}).withExamples(["sazabi status incidents list # List recent issues","sazabi status incidents list --active-only # List ongoing issues"]).build(),iY=S("timeline","Show the status timeline and issues for a component",async(e)=>{let{values:t,positionals:n}=$(e,{...j,"window-start":{type:"string"},"window-end":{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return m("Component ID is required.")}await Fke(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],windowStart:t["window-start"],windowEnd:t["window-end"]})}).withPositionalArgs("<component-id>").withOptions({..._,"window-start":{type:"string",description:"ISO timestamp for timeline window start (defaults to 7 days ago)"},"window-end":{type:"string",description:"ISO timestamp for timeline window end (defaults to now)"}}).withExamples(["sazabi status timeline <component-id> # Last 7 days","sazabi status timeline <component-id> --window-start 2026-06-01T00:00:00Z --window-end 2026-06-08T00:00:00Z # Custom window"]).build();var Xke={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},currentStatus:{label:"Status",type:{kind:"string"}},firstSeenAt:{label:"Created at",type:{kind:"date"}}},Yke={schema:Xke,columns:["id","name","currentStatus","firstSeenAt"],emptyMessage:"All clear. No status components found."},Qke=async(e)=>{let t=C({tokenFlag:e.token,jsonMode:e.json}),n=z({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=w(await n.statusComponents.list(),"Couldn't fetch status (check the active project and try again)",e.json);if(e.json){J(r);return}if(Pe("Status page"),t.projectId)fe({URL:ZZ(t.projectId)});H(Yke,r.statusComponents)},aY=Q("status","Show a summary of the status page").withHandler(async(e)=>{let{values:t}=$(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}});await Qke({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withOptions({token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withSubcommands({incidents:rY,timeline:iY}).withExamples(["sazabi status # Show status page summary","sazabi status --json # Output as JSON","sazabi status incidents list --active-only # List ongoing issues","sazabi status timeline <component-id> # Show component timeline"]).build();ee();ce();ie();var sY={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"}},retiredAt:{label:"Retired at",type:{kind:"nullable-date"}},retirementReason:{label:"Retirement reason",type:{kind:"nullable-string"}},legacyStateUnknown:{label:"Legacy inactive",type:{kind:"boolean"}}},Vke={schema:sY,columns:["id","name","lifecycle","observationState","currentStatus"],jsonFields:["id","projectId","name","currentStatus","description","origin","lifecycle","observationState","registryRevision","canonicalComponentId","mergedIntoComponentId","firstSeenAt","lastSeenAt","deletedAt","retiredAt","retirementReason","legacyStateUnknown"],emptyMessage:"No status components found. Register one with 'sazabi status-components register --name <name>'."},JL={layout:"field-list",schema:sY,fields:["id","projectId","name","currentStatus","description","origin","lifecycle","observationState","registryRevision","canonicalComponentId","mergedIntoComponentId","firstSeenAt","lastSeenAt","deletedAt","retiredAt","retirementReason","legacyStateUnknown"],title:"Status component"},eve={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"}}},tve={layout:"field-list",schema:eve,fields:["status","componentId","sourceType","withdrawn"],title:"Component observation"},nve=(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`},ove={status:{label:"Status",type:{kind:"string"}},preview:{label:"Retirement preview",type:{kind:"custom",render:nve,serialize:(e)=>e}}},rve={layout:"field-list",schema:ove,fields:["status","preview"],title:"Retirement confirmation required"},fs=(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 m(o)}},GL=(e)=>e?e.split(",").map((t)=>t.trim()).filter(Boolean):[],HL={kind:"custom",render:(e)=>JSON.stringify(e,null,2),serialize:(e)=>e},ive={preview:{label:"Preview",type:HL}},ave={layout:"field-list",schema:ive,fields:["preview"],title:"Component operation preview"},cve={result:{label:"Result",type:HL}},sve={layout:"field-list",schema:cve,fields:["result"],title:"Component operation result"},Od=(e,t)=>U(ave,e,{json:t}),Ad=(e,t)=>U(sve,e,{json:t}),hve=async(e)=>{let t=C({tokenFlag:e.token,jsonMode:e.json}),n=z({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=w(await n.statusComponents.list({limit:e.limit,cursor:e.cursor,includeDeleted:e.includeDeleted}),"Couldn't list status components (check the active project and try again)",e.json);H(Vke,r.statusComponents,{json:e.json,nextCursor:r.nextCursor})},lve=async(e,t)=>{let n=C({tokenFlag:t.token,jsonMode:t.json}),r=z({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),o=w(await r.statusComponents.get(e),"Couldn't get status component (run 'sazabi status-components list' to see component IDs)",t.json);U(JL,o.statusComponent,{json:t.json})},uve=async(e)=>{let t=e.name?.trim(),n=e.description?.trim();if(!t){if(e.json)return b("Name is required.");return m("Name is required.")}if(e.description!==void 0&&!n){if(e.json)return b("Description cannot be empty.");return m("Description cannot be empty.")}let r=C({tokenFlag:e.token,jsonMode:e.json}),o=z({token:r.token,organizationId:r.organizationId,projectId:r.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),i=w(await o.statusComponents.register({name:t,...n?{description:n}:{}}),"Failed to register status component",e.json);U(JL,i.statusComponent,{json:e.json})},gve=async(e,t)=>{let n=t.reason?.trim();if(t.reason!==void 0&&!n){if(t.json)return b("Reason cannot be empty.");return m("Reason cannot be empty.")}let r=C({tokenFlag:t.token,jsonMode:t.json}),o=z({token:r.token,organizationId:r.organizationId,projectId:r.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),i=w(await o.statusComponents.deregister(e,n),"Failed to deregister status component",t.json);if(i.status==="observation_withdrawn"){U(tve,i,{json:t.json});return}U(rve,i,{json:t.json})},Bi=(e)=>{let t=C({tokenFlag:e.token,jsonMode:e.json});return z({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json})},dve=async(e,t)=>{let n=t.name?.trim(),r=t.reason?.trim();if(!n){if(t.json)return b("Name is required.");return m("Name is required.")}if(!t.requestId){if(t.json)return b("Request ID is required.");return m("Request ID is required.")}if(!r){if(t.json)return b("Reason is required.");return m("Reason is required.")}let o=Bi(t),i=w(await o.statusComponents.rename({componentId:e,name:n,requestId:t.requestId,reason:r}),"Failed to rename component",t.json);U(JL,i.statusComponent,{json:t.json})},yve=async(e,t)=>{let n=Bi(t),r=fs(t.confirmPreviewRevision,"Confirm preview revision",t.json);if(!r){let c=w(await n.statusComponents.retirementPreview({componentId:e}),"Failed to preview component retirement",t.json);Od(c,t.json);return}let o=t.reason?.trim();if(!t.requestId||!o){if(t.json)return b("Commit requires --request-id and --reason with --confirm-preview-revision.");return m("Commit requires --request-id and --reason with --confirm-preview-revision.")}let i=w(await n.statusComponents.retire({componentId:e,requestId:t.requestId,reason:o,componentRevisions:r,confirmCanonicalGroup:t.confirmCanonicalGroup??!1}),"Failed to retire component; refresh the preview if it changed",t.json);Ad(i,t.json)},bve=async(e,t)=>{let n=Bi(t),r=fs(t.confirmPreviewRevision,"Confirm preview revision",t.json);if(!r){let c=w(await n.statusComponents.restorationPreview({componentId:e,...t.retirementOperationId?{retirementOperationId:t.retirementOperationId}:{}}),"Failed to preview component restoration",t.json);Od(c,t.json);return}let o=t.reason?.trim();if(!t.requestId||!t.retirementOperationId||!o){if(t.json)return b("Commit requires --request-id, --retirement-operation-id, and --reason with --confirm-preview-revision.");return m("Commit requires --request-id, --retirement-operation-id, and --reason with --confirm-preview-revision.")}let i=w(await n.statusComponents.restore({componentId:e,retirementOperationId:t.retirementOperationId,requestId:t.requestId,reason:o,componentRevisions:r,selections:{notificationRuleIds:GL(t.notificationRuleIds),automationBindingIds:GL(t.automationBindingIds),recommendationScopeIds:[],relationshipIds:GL(t.relationshipIds)}}),"Failed to restore component; refresh the preview if it changed",t.json);Ad(i,t.json)},mve=async(e)=>{if(!e.sourceComponentId||!e.targetComponentId){if(e.json)return b("Source and target component IDs are required.");return m("Source and target component IDs are required.")}let t=Bi(e),n={sourceComponentId:e.sourceComponentId,targetComponentId:e.targetComponentId},r=fs(e.confirmPreviewRevision,"Confirm preview revision",e.json);if(!r){let s=w(await t.statusComponents.mergePreview(n),"Failed to preview component consolidation",e.json);Od(s,e.json);return}let o=e.reason?.trim(),i=fs(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 m("Commit requires --request-id, --reason, and --policy-dispositions with --confirm-preview-revision.")}let c=w(await t.statusComponents.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);Ad(c,e.json)},pve=async(e)=>{let t=Bi(e),n=w(await t.statusComponents.relationships.list({includeHistorical:e.includeHistorical}),"Failed to list component relationships",e.json);U({layout:"field-list",schema:{relationships:{label:"Relationships",type:HL}},fields:["relationships"],title:"Component relationships"},n,{json:e.json})},wve=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 m("Source, target, and relationship type (part_of or depends_on) are required.")}let n=Bi(t),r={action:e,sourceComponentId:t.sourceComponentId,targetComponentId:t.targetComponentId,relationshipType:t.relationshipType},o=fs(t.confirmPreviewRevision,"Confirm preview revision",t.json);if(!o){let h=w(await n.statusComponents.relationships.preview(r),"Failed to preview component relationship",t.json);Od(h,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 m("Commit requires --request-id and --reason with --confirm-preview-revision.")}let c={sourceComponentId:r.sourceComponentId,targetComponentId:r.targetComponentId,relationshipType:r.relationshipType,requestId:t.requestId,reason:i,componentRevisions:o,confirmPolicyImpact:t.confirmPolicyImpact??!1},s=w(e==="add"?await n.statusComponents.relationships.add(c):await n.statusComponents.relationships.remove(c),`Failed to ${e} component relationship; refresh the preview if it changed`,t.json);Ad(s,t.json)},Ld={...j,"confirm-preview-revision":{type:"string"},"request-id":{type:"string"},reason:{type:"string"}},Td={..._,"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"}},cY=(e)=>S(e,`${e==="add"?"Add":"End"} a component relationship`,async(t)=>{let{values:n}=$(t,{...Ld,source:{type:"string"},target:{type:"string"},type:{type:"string"},"confirm-policy-impact":{type:"boolean"}});await wve(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({...Td,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 status-components relationships ${e} --source <component-id> --target <component-id> --type part_of # Preview a parent-child topology change`]).build(),fve=Q("relationships","Inspect and edit component topology").withSubcommands({list:S("list","List component relationships",async(e)=>{let{values:t}=$(e,{...j,"include-historical":{type:"boolean"}});await pve({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:cY("add"),remove:cY("remove")}).build(),hY=Q("status-components","Manage status page components").withSubcommands({list:S("list","List status components in the active project",async(e)=>{let{values:t}=$(e,{...j,limit:{type:"string"},cursor:{type:"string"},"include-deleted":{type:"boolean"}});await hve({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 status components"}}).withExamples(["sazabi status-components list # List all status components","sazabi status-components list --include-deleted # Include deregistered components"]).build(),get:S("get","Get one status component by ID",async(e)=>{let{values:t,positionals:n}=$(e,j,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return m("Component ID is required.")}await lve(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<component-id>").withOptions(_).withExamples(["sazabi status-components get <component-id> # Get one status component"]).build(),register:S("register","Register or refresh a status component",async(e)=>{let{values:t}=$(e,{...j,name:{type:"string"},description:{type:"string"}});await uve({token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],name:t.name,description:t.description})}).withOptions({..._,name:{type:"string",description:"Component name to register"},description:{type:"string",description:"Optional component description"}}).withExamples(['sazabi status-components register --name "API Gateway" # Register a component','sazabi status-components register --name "Checkout" --description "Checkout API and workflow" # Register with description']).build(),deregister:S("deregister","Deregister a status component",async(e)=>{let{values:t,positionals:n}=$(e,{...j,reason:{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return m("Component ID is required.")}await gve(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],reason:t.reason})}).withPositionalArgs("<component-id>").withOptions({..._,reason:{type:"string",description:"Optional deregistration reason"}}).withExamples(["sazabi status-components deregister <component-id> # Deregister a component",'sazabi status-components deregister <component-id> --reason "service retired" # Deregister with reason']).build(),rename:S("rename","Rename an active component",async(e)=>{let{values:t,positionals:n}=$(e,{...j,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 m("Component ID is required.")}await dve(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(),retire:S("retire","Preview or confirm component retirement",async(e)=>{let{values:t,positionals:n}=$(e,{...Ld,"confirm-canonical-group":{type:"boolean"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Component ID is required.");return m("Component ID is required.")}await yve(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],confirmPreviewRevision:t["confirm-preview-revision"],requestId:t["request-id"],reason:t.reason,confirmCanonicalGroup:t["confirm-canonical-group"]})}).withPositionalArgs("<component-id>").withOptions({...Td,"confirm-canonical-group":{type:"boolean",description:"Confirm the complete canonical group"}}).build(),restore:S("restore","Preview or confirm component restoration",async(e)=>{let{values:t,positionals:n}=$(e,{...Ld,"retirement-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 m("Component ID is required.")}await bve(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"],confirmPreviewRevision:t["confirm-preview-revision"],requestId:t["request-id"],reason:t.reason,retirementOperationId:t["retirement-operation-id"],notificationRuleIds:t["notification-rule-ids"],automationBindingIds:t["automation-binding-ids"],relationshipIds:t["relationship-ids"]})}).withPositionalArgs("<component-id>").withOptions({...Td,"retirement-operation-id":{type:"string",description:"Retirement 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:S("merge","Preview or confirm present-day component consolidation",async(e)=>{let{values:t}=$(e,{...Ld,source:{type:"string"},target:{type:"string"},"policy-dispositions":{type:"string"},"confirm-policy-impact":{type:"boolean"}});await mve({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({...Td,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 status-components merge --source <component-id> --target <component-id> # Preview only"]).build(),relationships:fve}).withExamples(["sazabi status-components list # List all status components","sazabi status-components get <component-id> # Get one status component",'sazabi status-components register --name "API Gateway" # Register a component',"sazabi status-components deregister <component-id> # Deregister a component"]).build();ee();ce();ie();var gY={id:{label:"ID",type:{kind:"id"}},label:{label:"Task",type:{kind:"string"}},description:{label:"Description",type:{kind:"string"}},instructions:{label:"Instructions",type:{kind:"string"}},completed:{label:"Status",type:{kind:"custom",render:(e)=>e?ze.success("✓ Done"):ze.muted("○ Pending"),serialize:(e)=>e}},completedAt:{label:"Completed at",type:{kind:"nullable-date",emptyLabel:"(none)"}},category:{label:"Category",type:{kind:"string"}}},kve={schema:gY,columns:["completed","label","id","category"],header:"Onboarding and setup tasks",emptyMessage:"No tasks found."},vve={layout:"field-list",schema:gY,fields:["id","label","completed","completedAt","category","description","instructions"],title:"Task"},Sve=async(e)=>{let t=C({tokenFlag:e.token,projectIdFlag:e.projectId,organizationIdFlag:e.organizationId,jsonMode:e.json}),n=z({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json}),r=w(await n.tasks.list(),"Couldn't list tasks (check the active project and try again)",e.json);H(kve,r.tasks,{json:e.json})},Pve=async(e,t)=>{let n=C({tokenFlag:t.token,projectIdFlag:t.projectId,organizationIdFlag:t.organizationId,jsonMode:t.json}),r=z({token:n.token,organizationId:n.organizationId,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl,jsonMode:t.json}),i=w(await r.tasks.list(),"Couldn't list tasks (check the active project and try again)",t.json).tasks.find((c)=>c.id===e);if(!i){let c=`Task not found: ${e}. Run 'sazabi tasks list' to see available tasks.`;if(t.json)return b(c);return m(c)}U(vve,i,{json:t.json})},lY={...j,"project-id":{type:"string"},"organization-id":{type:"string"}},uY={..._,"project-id":{type:"string",description:"Override active project ID"},"organization-id":{type:"string",description:"Override active organization ID"}},dY=Q("tasks","View onboarding and setup tasks").withSubcommands({list:S("list","List all onboarding and setup tasks for the active project",async(e)=>{let{values:t}=$(e,lY);await Sve({token:t.token,projectId:t["project-id"],organizationId:t["organization-id"],apiBaseUrl:t["api-base-url"],json:t.json})}).withOptions(uY).withExamples(["sazabi tasks list # List all tasks for the active project","sazabi tasks list --json # Output tasks as JSON"]).build(),get:S("get","Get one task by ID",async(e)=>{let{values:t,positionals:n}=$(e,lY,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Task ID is required.");return m("Task ID is required.")}await Pve(r,{token:t.token,projectId:t["project-id"],organizationId:t["organization-id"],apiBaseUrl:t["api-base-url"],json:t.json})}).withPositionalArgs("<task-id>").withOptions(uY).withExamples(["sazabi tasks get install_github_app # Show task details and instructions","sazabi tasks get send_message --json # Output as JSON"]).build()}).withExamples(["sazabi tasks list # List all tasks","sazabi tasks list --json # List tasks as JSON","sazabi tasks get install_github_app # Get one task by ID","sazabi tasks get send_message --json # Get one task as JSON"]).build();ee();ce();ie();var $ve={id:{label:"ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"string"}},description:{label:"Description",type:{kind:"nullable-string"}},memberCount:{label:"Members",type:{kind:"number"}},createdAt:{label:"Created",type:{kind:"date"}}},Ive={schema:$ve,columns:["id","name","description","memberCount","createdAt"],header:"Teams",emptyMessage:"No teams found."},Lve={userId:{label:"User ID",type:{kind:"string"}},name:{label:"Name",type:{kind:"nullable-string"}},email:{label:"Email",type:{kind:"string"}},addedAt:{label:"Added",type:{kind:"date"}}},Tve={schema:Lve,columns:["userId","name","email","addedAt"],header:"Team Members",emptyMessage:"No members found."},or=(e)=>{let t=C({tokenFlag:e.token,organizationIdFlag:e.organizationId,jsonMode:e.json});return{credentials:t,client:z({token:t.token,organizationId:t.organizationId,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl,jsonMode:e.json})}},Ove=async(e)=>{let{client:t,credentials:n}=or(e),r=w(await t.teams.list({organizationId:n.organizationId}),"Couldn't list teams (check the active organization and try again)",e.json);H(Ive,r.teams,{json:e.json})},Ave=async(e,t,n)=>{let{client:r,credentials:o}=or(n),i=w(await r.teams.create(e,t,o.organizationId),"Failed to create team",n.json);if(n.json){J(i);return}F(`Team ${e} created (${i.id}).`)},Cve=async(e,t,n)=>{let{client:r,credentials:o}=or(n),i=w(await r.teams.update(e,t,o.organizationId),"Failed to update team",n.json);if(n.json){J(i);return}F(`Team ${i.id} updated.`)},Dve=async(e,t)=>{let{client:n,credentials:r}=or(t),o=w(await n.teams.delete(e,r.organizationId),"Failed to delete team",t.json);if(t.json){J(o);return}F(`Team ${e} deleted.`)},zve=async(e,t)=>{let{client:n,credentials:r}=or(t),o=w(await n.teams.listMembers(e,r.organizationId),"Failed to list team members",t.json);H(Tve,o.members,{json:t.json})},_ve=async(e,t,n)=>{let{client:r,credentials:o}=or(n),i=w(await r.teams.addMember(e,t,o.organizationId),"Failed to add team member",n.json);if(n.json){J(i);return}F(`Member ${t} added to team ${e}.`)},jve=async(e,t,n)=>{let{client:r,credentials:o}=or(n),i=w(await r.teams.removeMember(e,t,o.organizationId),"Failed to remove team member",n.json);if(n.json){J(i);return}F(`Member ${t} removed from team ${e}.`)},er={..._,"organization-id":{type:"string",description:"Override organization selection"}},tr={...j,"organization-id":{type:"string"}},nr=(e)=>({token:e.token,organizationId:e["organization-id"],json:e.json,apiBaseUrl:e["api-base-url"]}),yY=Q("teams","Manage organization teams").withSubcommands({list:S("list","List teams in the active organization",async(e)=>{let{values:t,positionals:n}=$(e,tr,{allowPositionals:!0});if(n.length>0){let o=`Unexpected arguments: ${n.join(", ")}. Run 'sazabi teams -h' for usage.`;if(t.json)return b(o);return m(o)}await Ove(nr(t))}).withOptions({...er}).withExamples(["sazabi teams list # List teams in the active organization"]).build(),create:S("create","Create a team in the active organization",async(e)=>{let{values:t,positionals:n}=$(e,{...tr,description:{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Team name is required.");return m("Team name is required.")}await Ave(r,t.description,nr(t))}).withOptions({...er,description:{type:"string",description:"Optional team description"}}).withExamples(['sazabi teams create Payments --description "Owns checkout" # Create a team']).build(),update:S("update","Rename a team or update its description",async(e)=>{let{values:t,positionals:n}=$(e,{...tr,name:{type:"string"},description:{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Team ID is required.");return m("Team ID is required.")}if(t.name===void 0&&t.description===void 0){if(t.json)return b("Provide --name or --description to update.");return m("Provide --name or --description to update.")}await Cve(r,{name:t.name,description:t.description},nr(t))}).withOptions({...er,name:{type:"string",description:"New team name"},description:{type:"string",description:"New team description"}}).withExamples(["sazabi teams update team_123 --name Platform # Rename a team"]).build(),delete:S("delete","Delete a team from the active organization",async(e)=>{let{values:t,positionals:n}=$(e,tr,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Team ID is required.");return m("Team ID is required.")}await Dve(r,nr(t))}).withOptions({...er}).withExamples(["sazabi teams delete team_123 # Delete a team"]).build(),members:S("members","Manage a team's members").withSubcommands({list:S("list","List a team's active members",async(e)=>{let{values:t,positionals:n}=$(e,tr,{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Team ID is required.");return m("Team ID is required.")}await zve(r,nr(t))}).withPositionalArgs("<team-id>").withOptions({...er}).withExamples(["sazabi teams members list team_123 # List a team's members"]).build(),add:S("add","Add an organization member to a team",async(e)=>{let{values:t,positionals:n}=$(e,tr,{allowPositionals:!0}),r=n[0],o=n[1];if(!r||!o){if(t.json)return b("Team ID and user ID are required.");return m("Team ID and user ID are required.")}await _ve(r,o,nr(t))}).withPositionalArgs("<team-id> <user-id>").withOptions({...er}).withExamples(["sazabi teams members add team_123 user_456 # Add a member to a team"]).build(),remove:S("remove","Remove a member from a team",async(e)=>{let{values:t,positionals:n}=$(e,tr,{allowPositionals:!0}),r=n[0],o=n[1];if(!r||!o){if(t.json)return b("Team ID and user ID are required.");return m("Team ID and user ID are required.")}await jve(r,o,nr(t))}).withPositionalArgs("<team-id> <user-id>").withOptions({...er}).withExamples(["sazabi teams members remove team_123 user_456 # Remove a member from a team"]).build()}).build()}).withExamples(["sazabi teams list # List teams in the active organization","sazabi teams create Payments # Create a team","sazabi teams members add team_123 user_456 # Add a member to a team"]).build();ee();ee();ce();ie();var Nve={id:{label:"ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},createdAt:{label:"Created",type:{kind:"date"}},updatedAt:{label:"Updated",type:{kind:"date"}}},xve={layout:"field-list",schema:Nve,fields:["id","url","title","status","createdAt","updatedAt"]},bY=async(e,t)=>{let n=C({tokenFlag:t.token,jsonMode:t.json}),r=z({token:n.token,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{thread:o}=w(await r.threads.update(e,"archived"),"Failed to archive thread",t.json),i={...o,url:Ye(o.projectId,o.id)};U(xve,i,{json:t.json})};ee();ce();ie();var Rve={id:{label:"ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},createdAt:{label:"Created",type:{kind:"date"}},updatedAt:{label:"Updated",type:{kind:"date"}}},Uve={layout:"field-list",schema:Rve,fields:["id","url","title","status","createdAt","updatedAt"],title:"Forked thread"},mY=async(e,t,n)=>{let r=C({tokenFlag:n.token,jsonMode:n.json}),o=z({token:r.token,projectId:r.projectId,apiBaseUrlFlag:n.apiBaseUrl}),{thread:i}=w(await o.threads.fork(e,t),"Failed to fork thread",n.json),c={...i,url:Ye(i.projectId,i.id)};U(Uve,c,{json:n.json})};ee();ce();ie();var Mve={id:{label:"ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},createdAt:{label:"Created",type:{kind:"date"}},updatedAt:{label:"Updated",type:{kind:"date"}}},Kve={id:{label:"ID",type:{kind:"id"}},role:{label:"Role",type:{kind:"role"}},createdAt:{label:"When",type:{kind:"date"}},text:{label:"Message",type:{kind:"truncated",maxLength:80}}},Eve=(e)=>{for(let t of e.content){if(t.type==="message"&&t.message)return t.message;if(t.type==="tool_call")return`[tool: ${t.name}]`;if(t.type==="artifact")return`[artifact: ${t.name}]`;if(t.type==="summary")return"[summary]";if(t.type==="reasoning")return"[reasoning]";if(t.type==="fork")return"[fork]";if(t.type==="slack_context")return"[Slack context]";if(t.type==="teams_context")return"[Teams context]"}return"(empty)"},pY=async(e,t)=>{let n=C({tokenFlag:t.token,jsonMode:t.json}),r=z({token:n.token,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{thread:o,messages:i}=w(await r.threads.get(e),"Couldn't get thread (run 'sazabi threads list' to see thread IDs)",t.json);if(t.json){J({thread:o,messages:i});return}let c=qi(vL({apiBaseUrlFlag:t.apiBaseUrl})),s={...o,url:Ye(o.projectId,o.id,c)},h=i.map((l)=>({id:l.id,role:l.role,createdAt:l.createdAt,text:Eve(l)}));U({layout:"field-list",schema:Mve,fields:["id","url","title","status","createdAt","updatedAt"],title:"Thread"},s),le(),H({schema:Kve,columns:["id","role","createdAt","text"],header:"Messages",emptyMessage:"No messages."},h)};ee();ce();ie();var qve={id:{label:"ID",type:{kind:"string"}},projectId:{label:"Project",type:{kind:"string"}},url:{label:"URL",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},updatedAt:{label:"Updated",type:{kind:"date"}}},Gve={schema:qve,columns:["id","title","status","updatedAt","url"],jsonFields:["id","projectId","url","title","status","updatedAt"],header:"Threads",emptyMessage:"No threads found."},wY=async(e)=>{let t=C({tokenFlag:e.token,jsonMode:e.json}),r=await z({token:t.token,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl}).threads.list({limit:e.limit,cursor:e.cursor,status:e.status}),{threads:o,nextCursor:i}=w(r,"Couldn't list threads (check the active project and try again)",e.json),c=o.map((s)=>({...s,url:Ye(s.projectId,s.id)}));H(Gve,c,{json:e.json,nextCursor:i})};ee();ce();ie();var Jve={id:{label:"ID",type:{kind:"string"}},projectId:{label:"Project",type:{kind:"string"}},url:{label:"URL",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},score:{label:"Score",align:"right",type:{kind:"custom",render:(e)=>e!=null?e.toFixed(2):"-"}}},Hve={schema:Jve,columns:["id","title","status","score","url"],jsonFields:["id","projectId","url","title","status","score"],header:{title:"Search Results",variant:"search"},emptyMessage:"No matching threads found."},fY=async(e,t)=>{let n=C({tokenFlag:t.token,jsonMode:t.json}),r=z({token:n.token,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{threads:o,pagination:i}=w(await r.search.threads({query:e,limit:t.limit,page:t.page,status:t.status}),"Failed to search threads",t.json),c=o.map((s)=>({...s,url:Ye(s.projectId??On(n.projectId,t.json),s.id)}));if(t.json){J({threads:c,pagination:i});return}H(Hve,c,{count:i.totalResults}),Dn({type:"page",page:i.page,totalPages:i.totalPages})};ee();ce();ie();var kY={shareId:{label:"Share ID",type:{kind:"id"}},threadId:{label:"Thread ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"string"}},createdAt:{label:"Created",type:{kind:"date"}}},Bve={layout:"field-list",schema:kY,fields:["shareId","threadId","url","createdAt"],title:"Share link"},BL=(e)=>{let t=C({tokenFlag:e.token,jsonMode:e.json});return z({token:t.token,projectId:t.projectId,apiBaseUrlFlag:e.apiBaseUrl})},vY=async(e,t)=>{let n=BL(t),{share:r}=w(await n.threads.createShareLink(e),"Failed to create share link",t.json);U(Bve,r,{json:t.json})},SY=async(e,t)=>{let n=BL(t),{shares:r}=w(await n.threads.listShareLinks(e),"Couldn't list share links (verify the thread ID and try again)",t.json);H({schema:kY,columns:["shareId","url","createdAt"],header:"Share links",emptyMessage:"No active share links."},r,{json:t.json})},PY=async(e,t,n)=>{let r=BL(n);if(w(await r.threads.revokeShareLink(e,t),"Failed to revoke share link",n.json),U({layout:"field-list",schema:{shareId:{label:"Share ID",type:{kind:"id"}},revoked:{label:"Revoked",type:{kind:"string"}}},fields:["shareId","revoked"]},{shareId:t,revoked:!0},{json:n.json}),!n.json)F(`Revoked share link ${t}.`)};ee();ce();ie();var $Y=async(e,t={})=>{let n=C({tokenFlag:t.token,jsonMode:t.json}),r=z({token:n.token,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl}),o=w(await r.threads.stop(e),"Failed to stop thread",t.json);if(t.json){J({...o,threadId:e});return}F(`Requested stop for thread ${e}.`),ae(`Stop is best-effort; check status with: sazabi threads get ${e}`)};ce();var IY=async(e,t={})=>{let n=C({tokenFlag:t.token,jsonMode:t.json}),r=z({token:n.token,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl});await Sd({json:t.json,label:`thread ${e}`,resumeCommand:`sazabi threads stream ${e}`,errorContext:`Couldn't stream thread (retry with 'sazabi threads stream ${e}')`,open:(o)=>r.threads.stream({threadId:e,...t.cursor?{cursor:t.cursor}:{},signal:o})})};ee();ce();ie();var Wve={id:{label:"ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},status:{label:"Status",type:{kind:"string"}},createdAt:{label:"Created",type:{kind:"date"}},updatedAt:{label:"Updated",type:{kind:"date"}}},Zve={layout:"field-list",schema:Wve,fields:["id","url","title","status","createdAt","updatedAt"]},LY=async(e,t)=>{let n=C({tokenFlag:t.token,jsonMode:t.json}),r=z({token:n.token,projectId:n.projectId,apiBaseUrlFlag:t.apiBaseUrl}),{thread:o}=w(await r.threads.update(e,"regular"),"Failed to unarchive thread",t.json),i={...o,url:Ye(o.projectId,o.id)};U(Zve,i,{json:t.json})};ee();ce();ie();var Fve={id:{label:"ID",type:{kind:"id"}},url:{label:"URL",type:{kind:"string"}},title:{label:"Title",type:{kind:"nullable-string",emptyLabel:"(no title)"}},visibility:{label:"Visibility",type:{kind:"string"}},status:{label:"Status",type:{kind:"string"}},createdAt:{label:"Created",type:{kind:"date"}},updatedAt:{label:"Updated",type:{kind:"date"}}},Xve={layout:"field-list",schema:Fve,fields:["id","url","title","visibility","status","createdAt","updatedAt"]},TY=async(e,t,n)=>{let r=C({tokenFlag:n.token,jsonMode:n.json}),o=z({token:r.token,projectId:r.projectId,apiBaseUrlFlag:n.apiBaseUrl}),{thread:i,visibility:c}=w(await o.threads.setVisibility(e,t),"Failed to set thread visibility",n.json),s={...i,visibility:c,url:Ye(i.projectId,i.id)};U(Xve,s,{json:n.json})};var OY=Q("threads","Manage agent threads").withSubcommands({list:S("list","List threads from the active project",async(e)=>{let{values:t}=$(e,{token:{type:"string"},limit:{type:"string"},cursor:{type:"string"},status:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}}),n={token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]};if(t.limit)n.limit=ut(t.limit,1,100,"Limit",t.json);if(t.cursor)n.cursor=t.cursor;if(t.status)n.status=Dt(t.status,["regular","archived"],"Status",t.json);await wY(n)}).withOptions({token:{type:"string",description:"Override token"},limit:{type:"string",description:"Maximum number of threads to return (default: 20, max: 100)"},cursor:{type:"string",description:"Pagination cursor from previous response"},status:{type:"string",description:"Filter by status: regular or archived"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads list # List all threads","sazabi threads list --limit 50 # List with custom limit","sazabi threads list --status archived # List archived threads","sazabi threads list --cursor xyz # List next page"]).build(),get:S("get","Get thread with messages",async(e)=>{let{values:t,positionals:n}=$(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Thread ID is required. Usage: sazabi threads get <thread-id>");return m("Thread ID is required. Usage: sazabi threads get <thread-id>")}if(n.length>1){let o=n.slice(1).join(", ");if(t.json)return b(`Unexpected arguments: ${o}. Run 'sazabi threads -h' for usage.`);return m(`Unexpected arguments: ${o}. Run 'sazabi threads -h' for usage.`)}await pY(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads get <thread-id> # Get thread with messages","sazabi threads get <thread-id> --json # Output as JSON"]).build(),search:S("search","Search threads in the active project",async(e)=>{let{values:t,positionals:n}=$(e,{token:{type:"string"},limit:{type:"string"},page:{type:"string"},status:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),r=n.join(" ");if(!r){if(t.json)return b("Search query is required. Usage: sazabi threads search <query>");return m("Search query is required. Usage: sazabi threads search <query>")}let o={token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]};if(t.limit)o.limit=ut(t.limit,1,100,"Limit",t.json);if(t.page)o.page=ut(t.page,1,Number.MAX_SAFE_INTEGER,"Page",t.json);if(t.status)o.status=Dt(t.status,["regular","archived"],"Status",t.json);await fY(r,o)}).withPositionalArgs("<query>").withOptions({token:{type:"string",description:"Override token"},limit:{type:"string",description:"Maximum number of results (default: 20, max: 100)"},page:{type:"string",description:"Page number for pagination (default: 1)"},status:{type:"string",description:"Filter by status: regular or archived"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(['sazabi threads search "error handling" # Search threads','sazabi threads search "bug" --limit 50 # Search with limit','sazabi threads search "authentication" --status regular # Search only regular threads']).build(),archive:S("archive","Archive a thread",async(e)=>{let{values:t,positionals:n}=$(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Thread ID is required. Usage: sazabi threads archive <thread-id>");return m("Thread ID is required. Usage: sazabi threads archive <thread-id>")}if(n.length>1){let o=n.slice(1).join(", ");if(t.json)return b(`Unexpected arguments: ${o}. Run 'sazabi threads -h' for usage.`);return m(`Unexpected arguments: ${o}. Run 'sazabi threads -h' for usage.`)}await bY(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads archive <thread-id> # Archive a thread","sazabi threads archive <thread-id> --json # Output as JSON"]).build(),unarchive:S("unarchive","Unarchive a thread",async(e)=>{let{values:t,positionals:n}=$(e,{token:{type:"string"},json:{type:"boolean"},"api-base-url":{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Thread ID is required. Usage: sazabi threads unarchive <thread-id>");return m("Thread ID is required. Usage: sazabi threads unarchive <thread-id>")}if(n.length>1){let o=n.slice(1).join(", ");if(t.json)return b(`Unexpected arguments: ${o}. Run 'sazabi threads -h' for usage.`);return m(`Unexpected arguments: ${o}. Run 'sazabi threads -h' for usage.`)}await LY(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({token:{type:"string",description:"Override token"},json:{type:"boolean",description:"Output as JSON"},"api-base-url":{type:"string",description:"Override API base URL"}}).withExamples(["sazabi threads unarchive <thread-id> # Unarchive a thread","sazabi threads unarchive <thread-id> --json # Output as JSON"]).build(),fork:S("fork","Fork a thread from a message into a new thread",async(e)=>{let{values:t,positionals:n}=$(e,{...j,"message-id":{type:"string",short:"m"}},{allowPositionals:!0}),r=n[0],o=t["message-id"],i=n[1];if(o&&i&&o!==i){let s=`Conflicting message IDs: --message-id ${o} and positional ${i}. Provide only one.`;if(t.json)return b(s);return m(s)}let c=o??i;if(!r||!c){if(t.json)return b("Thread ID and message ID are required. Usage: sazabi threads fork <thread-id> --message-id <message-id>");return m("Thread ID and message ID are required. Usage: sazabi threads fork <thread-id> --message-id <message-id>")}if(n.length>2){let s=n.slice(2).join(", ");if(t.json)return b(`Unexpected arguments: ${s}. Run 'sazabi threads -h' for usage.`);return m(`Unexpected arguments: ${s}. Run 'sazabi threads -h' for usage.`)}await mY(r,c,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({..._,"message-id":{type:"string",short:"m",description:"Message ID to fork from (copies messages up to it)"}}).withExamples(["sazabi threads fork <thread-id> --message-id <message-id> # Fork from a message","sazabi threads fork <thread-id> -m <message-id> --json # Output as JSON"]).build(),visibility:S("visibility","Set a thread's visibility (private or organization)",async(e)=>{let{values:t,positionals:n}=$(e,{...j},{allowPositionals:!0}),r=n[0],o=n[1];if(!r||!o){if(t.json)return b("Thread ID and visibility are required. Usage: sazabi threads visibility <thread-id> <private|organization>");return m("Thread ID and visibility are required. Usage: sazabi threads visibility <thread-id> <private|organization>")}if(n.length>2){let c=n.slice(2).join(", ");if(t.json)return b(`Unexpected arguments: ${c}. Run 'sazabi threads -h' for usage.`);return m(`Unexpected arguments: ${c}. Run 'sazabi threads -h' for usage.`)}let i=Dt(o,["private","organization"],"Visibility",t.json);await TY(r,i,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id> <private|organization>").withOptions({..._}).withExamples(["sazabi threads visibility <thread-id> private # Restrict to owner","sazabi threads visibility <thread-id> organization # Share with organization"]).build(),stop:S("stop","Stop a thread's in-flight run",async(e)=>{let{values:t,positionals:n}=$(e,{...j},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Thread ID is required. Usage: sazabi threads stop <thread-id>");return m("Thread ID is required. Usage: sazabi threads stop <thread-id>")}if(n.length>1){let o=n.slice(1).join(", ");if(t.json)return b(`Unexpected arguments: ${o}. Run 'sazabi threads -h' for usage.`);return m(`Unexpected arguments: ${o}. Run 'sazabi threads -h' for usage.`)}await $Y(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({..._}).withExamples(["sazabi threads stop <thread-id> # Stop the thread's active run","sazabi threads stop <thread-id> --json # Output the result as JSON"]).build(),stream:S("stream","Stream a thread's live agent-run events",async(e)=>{let{values:t,positionals:n}=$(e,{...j,cursor:{type:"string"}},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Thread ID is required. Usage: sazabi threads stream <thread-id>");return m("Thread ID is required. Usage: sazabi threads stream <thread-id>")}if(n.length>1){let o=n.slice(1).join(", ");if(t.json)return b(`Unexpected arguments: ${o}. Run 'sazabi threads -h' for usage.`);return m(`Unexpected arguments: ${o}. Run 'sazabi threads -h' for usage.`)}await IY(r,{token:t.token,cursor:t.cursor,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({..._,cursor:{type:"string",description:"Resume from a prior stream cursor after a disconnect"}}).withExamples(["sazabi threads stream <thread-id> # Follow live thread events","sazabi threads stream <thread-id> --json # Emit NDJSON events for tools","sazabi threads stream <thread-id> --cursor seq:42 # Resume after a disconnect"]).build(),share:Q("share","Manage public read-only share links for a thread").withSubcommands({create:S("create","Create a public read-only snapshot link for a thread",async(e)=>{let{values:t,positionals:n}=$(e,{...j},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Thread ID is required. Usage: sazabi threads share create <thread-id>");return m("Thread ID is required. Usage: sazabi threads share create <thread-id>")}if(n.length>1){let o=n.slice(1).join(", ");if(t.json)return b(`Unexpected arguments: ${o}. Run 'sazabi threads -h' for usage.`);return m(`Unexpected arguments: ${o}. Run 'sazabi threads -h' for usage.`)}await vY(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({..._}).withExamples(["sazabi threads share create <thread-id> # Create a share link"]).build(),list:S("list","List active public share links for a thread",async(e)=>{let{values:t,positionals:n}=$(e,{...j},{allowPositionals:!0}),r=n[0];if(!r){if(t.json)return b("Thread ID is required. Usage: sazabi threads share list <thread-id>");return m("Thread ID is required. Usage: sazabi threads share list <thread-id>")}if(n.length>1){let o=n.slice(1).join(", ");if(t.json)return b(`Unexpected arguments: ${o}. Run 'sazabi threads -h' for usage.`);return m(`Unexpected arguments: ${o}. Run 'sazabi threads -h' for usage.`)}await SY(r,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id>").withOptions({..._}).withExamples(["sazabi threads share list <thread-id> # List share links"]).build(),revoke:S("revoke","Revoke a public share link for a thread",async(e)=>{let{values:t,positionals:n}=$(e,{...j},{allowPositionals:!0}),r=n[0],o=n[1];if(!r||!o){if(t.json)return b("Thread ID and share ID are required. Usage: sazabi threads share revoke <thread-id> <share-id>");return m("Thread ID and share ID are required. Usage: sazabi threads share revoke <thread-id> <share-id>")}if(n.length>2){let i=n.slice(2).join(", ");if(t.json)return b(`Unexpected arguments: ${i}. Run 'sazabi threads -h' for usage.`);return m(`Unexpected arguments: ${i}. Run 'sazabi threads -h' for usage.`)}await PY(r,o,{token:t.token,json:t.json,apiBaseUrl:t["api-base-url"]})}).withPositionalArgs("<thread-id> <share-id>").withOptions({..._}).withExamples(["sazabi threads share revoke <thread-id> <share-id> # Revoke a share link"]).build()}).withExamples(["sazabi threads share create <thread-id> # Create a share link","sazabi threads share list <thread-id> # List share links","sazabi threads share revoke <thread-id> <share-id> # Revoke a share link"]).build()}).withExamples(["sazabi threads list # List all threads","sazabi threads get <thread-id> # Get thread with messages",'sazabi threads search "error" # Search threads',"sazabi threads archive <thread-id> # Archive a thread","sazabi threads unarchive <thread-id> # Unarchive a thread","sazabi threads fork <thread-id> -m <message-id> # Fork a thread","sazabi threads visibility <thread-id> private # Set visibility","sazabi threads stop <thread-id> # Stop the active run","sazabi threads stream <thread-id> # Stream live agent events","sazabi threads share create <thread-id> # Create a share link"]).build();var AY=[gF,wF,fF,SF,ZF,TF,AF,lX,IX,gX,yY,LX,TX,RF,UF,EX,tY,cX,OY,PX,aF,jX,KF,_F,OX,hY,aY,dY,DX,xX,MX,kX];WL();ee();var{renderSubcommandHelp:ZL,renderSubcommandGroupHelp:zY,renderCommandHelp:FL,renderMainHelp:Yve}=Md("sazabi");var XL=(e)=>Yve(e,{title:"Sazabi CLI",description:"Command-line interface for the Sazabi public API",examples:["sazabi auth login # Authenticate via browser",'sazabi messages send "Hello" # Start a new thread','sazabi messages send "Hi" -t <id> # Send a message to a thread',"sazabi logs tail --severities ERROR,WARN # Tail logs filtered by severity","sazabi threads list # List all threads"]});Vt();import*as zd from"node:fs";import*as vs from"node:path";import{fileURLToPath as Qve}from"node:url";var _Y=()=>{try{let e=vs.dirname(Qve(import.meta.url));for(let t=0;t<5;t++){let n=vs.join(e,"package.json");if(zd.existsSync(n)){let r=zd.readFileSync(n,"utf-8");return JSON.parse(r).version??"0.0.0"}e=vs.dirname(e)}return"0.0.0"}catch{return"0.0.0"}};var hSe=_Y();for(let e of AY)CY(e);var lSe=async()=>{let e=process.argv.slice(2);if(e[0]==="--get-completions"&&e[1]==="--"){let{getCompletions:d,parseCompletionContext:y}=await Promise.resolve().then(() => (MY(),UY)),p=y(e.slice(2)),f=await d(p);for(let k of f)if(k.description)console.log(`${k.value} ${k.description}`);else console.log(k.value);return}let t=[],n;for(let d=0;d<e.length;d++){let y=e[d];if(y==="--profile"){let p=e[d+1],f=e.includes("--json");if(p===void 0||p.startsWith("-")){let k=p===void 0?"--profile requires a value.":`--profile requires a value, but got '${p}'. Use '--profile <name>'.`;if(f)b(k);m(k)}n=p,d++}else if(y.startsWith("--profile=")){let p=y.slice(10),f=e.includes("--json");if(!p){if(f)b("--profile requires a value.");m("--profile requires a value.")}n=p}else t.push(y)}qZ(n);let r=t[0]==="--json",o=r?t.slice(1):t,i=r||o.includes("--json");if(o.includes("--version")||o.includes("-v")){console.log(`sazabi ${hSe}`);return}if(o.length===0){console.log(XL(ks()));return}if(o[0]?.startsWith("--")||o[0]==="-h"){if(o[0]==="--help"||o[0]==="-h"){console.log(XL(ks()));return}}let c=o[0];if(c&&!DY(c)){let y=c.startsWith("-")?`Unknown option: ${c}. Run 'sazabi -h' for usage.`:`Unknown command: ${c}. Run 'sazabi -h' for usage.`;if(i)b(y);throw m(y),Error("Unreachable")}if(!c)throw Error("Unexpected: commandName is undefined");let s=Dd(c);if(!s)throw m(`Unknown command: ${c}. Run 'sazabi -h' for usage.`),Error("Unreachable");let h=o[1]??"",l=o.slice(2);if(h==="--help"||h==="-h"){console.log(FL(s));return}if(!h&&s.subcommands&&!s.handler){console.log(FL(s));return}let u=s.subcommands?.[h];if(!u){if(s.handler){let d=h?[h,...l]:l;await s.handler(d)}else{let y=h.startsWith("-")?`Subcommand required. Run 'sazabi ${c} -h' for usage.`:`Unknown subcommand: ${h}. Run 'sazabi ${c} -h' for usage.`;if(i)b(y);throw m(y),Error("Unreachable")}return}if(u.subcommands){let d=l[0]??"",y=l.slice(1);if(d==="--help"||d==="-h"||!d&&!u.handler){console.log(zY(c,u));return}let p=u.subcommands[d];if(p){if(y.includes("--help")||y.includes("-h")){console.log(ZL(`${c} ${h}`,p));return}if(p.handler)await p.handler(y);return}if(u.handler){await u.handler(l);return}let k=d.startsWith("-")?`Subcommand required. Run 'sazabi ${c} ${h} -h' for usage.`:`Unknown subcommand: ${d}. Run 'sazabi ${c} ${h} -h' for usage.`;if(i)b(k);throw m(k),Error("Unreachable")}if(l.includes("--help")||l.includes("-h")){console.log(ZL(c,u));return}if(u.handler)await u.handler(l)};lSe().catch((e)=>{let t=process.argv.includes("--json"),n=`Unexpected error: ${String(e).replace(/\.$/,"")}. Try again, or re-run the command with --json for details.`;if(t)b(n);m(n)});