@keystrokehq/cli 0.0.164 → 0.0.166

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 (38) hide show
  1. package/README.md +11 -0
  2. package/dist/dist-BMPry9tj.mjs +577 -0
  3. package/dist/dist-BMPry9tj.mjs.map +1 -0
  4. package/dist/dist-CegYAHE0.mjs +3 -0
  5. package/dist/{schemas-Bq8SXmZk.mjs → dist-D_0UmqFb.mjs} +2113 -6
  6. package/dist/dist-D_0UmqFb.mjs.map +1 -0
  7. package/dist/{dist-CgV0MxBq.mjs → dist-WoxxHzM6.mjs} +123 -25
  8. package/dist/dist-WoxxHzM6.mjs.map +1 -0
  9. package/dist/index.mjs +147 -37
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/{maybe-auto-update-CIcDJRrg.mjs → maybe-auto-update-B03C4E8i.mjs} +2 -2
  12. package/dist/{maybe-auto-update-CIcDJRrg.mjs.map → maybe-auto-update-B03C4E8i.mjs.map} +1 -1
  13. package/dist/skills-bundle/_AGENTS.md +7 -3
  14. package/dist/skills-bundle/skills/keystroke-actions/SKILL.md +1 -1
  15. package/dist/skills-bundle/skills/keystroke-actions/references/catalog-and-imports.md +2 -3
  16. package/dist/skills-bundle/skills/keystroke-agents/references/tools-mcp-codemode.md +1 -1
  17. package/dist/skills-bundle/skills/keystroke-cli/SKILL.md +4 -2
  18. package/dist/skills-bundle/skills/keystroke-deploy/SKILL.md +92 -0
  19. package/dist/skills-bundle/skills/keystroke-deploy/references/build-and-full-deploy.md +28 -0
  20. package/dist/skills-bundle/skills/keystroke-deploy/references/filtered-deploy.md +49 -0
  21. package/dist/skills-bundle/skills/keystroke-deploy/references/wip-ignore.md +32 -0
  22. package/dist/skills-bundle/skills/keystroke-gateways/SKILL.md +5 -6
  23. package/dist/skills-bundle/skills/keystroke-gateways/references/slack-setup.md +0 -11
  24. package/dist/templates/hello-world/README.md +1 -1
  25. package/dist/templates/hello-world/keystroke.config.ts +1 -5
  26. package/dist/{version-DdbxgFWa.mjs → version-FrEOAEU7.mjs} +2 -2
  27. package/dist/{version-DdbxgFWa.mjs.map → version-FrEOAEU7.mjs.map} +1 -1
  28. package/package.json +1 -1
  29. package/dist/discovery-DV7FkTRA-JYiC_9cY.mjs +0 -71
  30. package/dist/discovery-DV7FkTRA-JYiC_9cY.mjs.map +0 -1
  31. package/dist/dist-CgV0MxBq.mjs.map +0 -1
  32. package/dist/dist-DtqmE5R_.mjs +0 -2113
  33. package/dist/dist-DtqmE5R_.mjs.map +0 -1
  34. package/dist/dist-sXdjEZpP.mjs +0 -293
  35. package/dist/dist-sXdjEZpP.mjs.map +0 -1
  36. package/dist/schemas-Bq8SXmZk.mjs.map +0 -1
  37. package/dist/walk-project-171B4cvO-DKtupJ6Z.mjs +0 -102
  38. package/dist/walk-project-171B4cvO-DKtupJ6Z.mjs.map +0 -1
@@ -605,7 +605,7 @@ const string$1 = (params) => {
605
605
  return new RegExp(`^${regex}$`);
606
606
  };
607
607
  const integer = /^-?\d+$/;
608
- const number$1 = /^-?\d+(?:\.\d+)?$/;
608
+ const number$2 = /^-?\d+(?:\.\d+)?$/;
609
609
  const boolean$1 = /^(?:true|false)$/i;
610
610
  const lowercase = /^[^A-Z]*$/;
611
611
  const uppercase = /^[^a-z]*$/;
@@ -1379,7 +1379,7 @@ const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
1379
1379
  });
1380
1380
  const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
1381
1381
  $ZodType.init(inst, def);
1382
- inst._zod.pattern = inst._zod.bag.pattern ?? number$1;
1382
+ inst._zod.pattern = inst._zod.bag.pattern ?? number$2;
1383
1383
  inst._zod.parse = (payload, _ctx) => {
1384
1384
  if (def.coerce) try {
1385
1385
  payload.value = Number(payload.value);
@@ -2081,7 +2081,7 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
2081
2081
  issues: []
2082
2082
  }, ctx);
2083
2083
  if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
2084
- if (typeof key === "string" && number$1.test(key) && keyResult.issues.length) {
2084
+ if (typeof key === "string" && number$2.test(key) && keyResult.issues.length) {
2085
2085
  const retryResult = def.keyType._zod.run({
2086
2086
  value: Number(key),
2087
2087
  issues: []
@@ -4229,7 +4229,7 @@ const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
4229
4229
  inst.isFinite = true;
4230
4230
  inst.format = bag.format ?? null;
4231
4231
  });
4232
- function number(params) {
4232
+ function number$1(params) {
4233
4233
  return /* @__PURE__ */ _number(ZodNumber, params);
4234
4234
  }
4235
4235
  const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
@@ -4671,6 +4671,2113 @@ function superRefine(fn, params) {
4671
4671
  return /* @__PURE__ */ _superRefine(fn, params);
4672
4672
  }
4673
4673
  //#endregion
4674
- export { toJSONSchema as _, array as a, discriminatedUnion as c, object as d, record as f, url as g, unknown as h, _function as i, literal as l, union as m, ZodType as n, boolean as o, string as p, _enum as r, custom as s, ZodNumber as t, number as u, _coercedNumber as v };
4674
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/coerce.js
4675
+ function number(params) {
4676
+ return /* @__PURE__ */ _coercedNumber(ZodNumber, params);
4677
+ }
4678
+ //#endregion
4679
+ //#region ../../packages/shared/dist/index.mjs
4680
+ const ACTIVE_ORG_HEADER = "x-keystroke-org-id";
4681
+ /** Auth, session, and account-entry URL segments. */
4682
+ const AUTH_ACCOUNT_SLUGS = [
4683
+ "2fa",
4684
+ "accept-invite",
4685
+ "auth",
4686
+ "authorize",
4687
+ "callback",
4688
+ "callbacks",
4689
+ "confirm-email",
4690
+ "confirmation",
4691
+ "connect",
4692
+ "device",
4693
+ "email-verification",
4694
+ "forgot-password",
4695
+ "invite",
4696
+ "invites",
4697
+ "login",
4698
+ "logout",
4699
+ "magic-link",
4700
+ "mfa",
4701
+ "oauth",
4702
+ "onboarding",
4703
+ "password",
4704
+ "recovery",
4705
+ "register",
4706
+ "reset-password",
4707
+ "saml",
4708
+ "session",
4709
+ "sessions",
4710
+ "sign-in",
4711
+ "sign-up",
4712
+ "signin",
4713
+ "signout",
4714
+ "signup",
4715
+ "sso",
4716
+ "token",
4717
+ "tokens",
4718
+ "unlink",
4719
+ "verify",
4720
+ "verify-email"
4721
+ ];
4722
+ /** Org, workspace, billing, and account-management URL segments. */
4723
+ const ORG_ACCOUNT_SLUGS = [
4724
+ "account",
4725
+ "accounts",
4726
+ "billing",
4727
+ "console",
4728
+ "invoice",
4729
+ "invoices",
4730
+ "member",
4731
+ "members",
4732
+ "me",
4733
+ "org",
4734
+ "organization",
4735
+ "organizations",
4736
+ "orgs",
4737
+ "payment",
4738
+ "payments",
4739
+ "plan",
4740
+ "plans",
4741
+ "portal",
4742
+ "preferences",
4743
+ "profile",
4744
+ "settings",
4745
+ "subscription",
4746
+ "subscriptions",
4747
+ "team",
4748
+ "teams",
4749
+ "upgrade",
4750
+ "usage",
4751
+ "user",
4752
+ "users",
4753
+ "workspace",
4754
+ "workspaces"
4755
+ ];
4756
+ /** Product surfaces, resource types, and in-app navigation segments. */
4757
+ const PRODUCT_SLUGS = [
4758
+ "action",
4759
+ "actions",
4760
+ "activity",
4761
+ "agent",
4762
+ "agents",
4763
+ "analytics",
4764
+ "app",
4765
+ "apps",
4766
+ "artifact",
4767
+ "artifacts",
4768
+ "assistant",
4769
+ "assistants",
4770
+ "audit",
4771
+ "audit-log",
4772
+ "automation",
4773
+ "automations",
4774
+ "branch",
4775
+ "branches",
4776
+ "canvas",
4777
+ "chat",
4778
+ "chats",
4779
+ "connection",
4780
+ "connections",
4781
+ "create",
4782
+ "credential",
4783
+ "credentials",
4784
+ "dashboard",
4785
+ "deployment",
4786
+ "deployments",
4787
+ "examples",
4788
+ "execute",
4789
+ "execution",
4790
+ "executions",
4791
+ "explore",
4792
+ "get-started",
4793
+ "history",
4794
+ "inbox",
4795
+ "inspector",
4796
+ "integration",
4797
+ "integrations",
4798
+ "library",
4799
+ "logs",
4800
+ "marketplace",
4801
+ "mcp",
4802
+ "mcps",
4803
+ "new",
4804
+ "notifications",
4805
+ "observe",
4806
+ "plugin",
4807
+ "plugins",
4808
+ "primitive",
4809
+ "primitives",
4810
+ "project",
4811
+ "projects",
4812
+ "recents",
4813
+ "registry",
4814
+ "reports",
4815
+ "run",
4816
+ "runs",
4817
+ "runtime",
4818
+ "runtimes",
4819
+ "sandbox",
4820
+ "sandboxes",
4821
+ "search",
4822
+ "skill",
4823
+ "skills",
4824
+ "templates",
4825
+ "thread",
4826
+ "threads",
4827
+ "trigger",
4828
+ "triggers",
4829
+ "version",
4830
+ "versions",
4831
+ "workflow",
4832
+ "workflows"
4833
+ ];
4834
+ /** Marketing, docs, company, and go-to-market URL segments. */
4835
+ const MARKETING_SITE_SLUGS = [
4836
+ "about",
4837
+ "affiliates",
4838
+ "ai",
4839
+ "announcements",
4840
+ "anthropic",
4841
+ "blog",
4842
+ "book-demo",
4843
+ "brand",
4844
+ "campaigns",
4845
+ "career",
4846
+ "careers",
4847
+ "case-studies",
4848
+ "casestudies",
4849
+ "changelog",
4850
+ "chatgpt",
4851
+ "chrome-extension",
4852
+ "claude",
4853
+ "codex",
4854
+ "community",
4855
+ "company",
4856
+ "compare",
4857
+ "contact",
4858
+ "contribute",
4859
+ "creators",
4860
+ "customers",
4861
+ "demo",
4862
+ "demos",
4863
+ "discord",
4864
+ "docs",
4865
+ "documentation",
4866
+ "download",
4867
+ "downloads",
4868
+ "dust",
4869
+ "emerging-talent",
4870
+ "engineering-blog",
4871
+ "enterprise",
4872
+ "events",
4873
+ "experts",
4874
+ "extension",
4875
+ "faq",
4876
+ "faqs",
4877
+ "features",
4878
+ "forum",
4879
+ "glean",
4880
+ "grok",
4881
+ "guide",
4882
+ "guides",
4883
+ "gumloop",
4884
+ "handbook",
4885
+ "help",
4886
+ "help-center",
4887
+ "home",
4888
+ "how-it-works",
4889
+ "howitworks",
4890
+ "inspo",
4891
+ "intern",
4892
+ "investors",
4893
+ "jobs",
4894
+ "legal",
4895
+ "lindy",
4896
+ "llm",
4897
+ "llms",
4898
+ "love",
4899
+ "make",
4900
+ "manifesto",
4901
+ "media",
4902
+ "merch",
4903
+ "mission",
4904
+ "mobile",
4905
+ "models",
4906
+ "n8n",
4907
+ "news",
4908
+ "newsroom",
4909
+ "open",
4910
+ "open-claw",
4911
+ "open-source",
4912
+ "openai",
4913
+ "our-story",
4914
+ "overview",
4915
+ "partners",
4916
+ "pi",
4917
+ "pipedream",
4918
+ "platform",
4919
+ "press",
4920
+ "press-kit",
4921
+ "pricing",
4922
+ "privacy",
4923
+ "product",
4924
+ "products",
4925
+ "provider",
4926
+ "providers",
4927
+ "quick-start",
4928
+ "quickstart",
4929
+ "refer",
4930
+ "relay",
4931
+ "relay-app",
4932
+ "reporting",
4933
+ "request-demo",
4934
+ "resources",
4935
+ "roadmap",
4936
+ "schedule-demo",
4937
+ "security",
4938
+ "solutions",
4939
+ "stack-ai",
4940
+ "stackai",
4941
+ "startup",
4942
+ "startups",
4943
+ "status",
4944
+ "stories",
4945
+ "story",
4946
+ "students",
4947
+ "support",
4948
+ "swag",
4949
+ "switch",
4950
+ "talent",
4951
+ "terms",
4952
+ "testimonials",
4953
+ "thesis",
4954
+ "tines",
4955
+ "trust",
4956
+ "tutorials",
4957
+ "university",
4958
+ "use-case",
4959
+ "use-cases",
4960
+ "usecases",
4961
+ "versus",
4962
+ "vellum",
4963
+ "vs",
4964
+ "webinars",
4965
+ "workato",
4966
+ "xai",
4967
+ "yc",
4968
+ "zapier"
4969
+ ];
4970
+ /** Integrations, competitors, and partner brand slugs (marketing / integration pages). */
4971
+ const INTEGRATION_BRAND_SLUGS = [
4972
+ "airtable",
4973
+ "asana",
4974
+ "aws",
4975
+ "azure",
4976
+ "bun",
4977
+ "confluence",
4978
+ "copilot",
4979
+ "cursor",
4980
+ "databricks",
4981
+ "figma",
4982
+ "firebase",
4983
+ "fly",
4984
+ "gcp",
4985
+ "gemini",
4986
+ "github",
4987
+ "gitlab",
4988
+ "gmail",
4989
+ "heroku",
4990
+ "hubspot",
4991
+ "huggingface",
4992
+ "jira",
4993
+ "linear",
4994
+ "mailchimp",
4995
+ "meta",
4996
+ "mistral",
4997
+ "mixmax",
4998
+ "monday",
4999
+ "netlify",
5000
+ "neon",
5001
+ "notion",
5002
+ "npm",
5003
+ "outlook",
5004
+ "outreach",
5005
+ "perplexity",
5006
+ "planetscale",
5007
+ "pnpm",
5008
+ "postmark",
5009
+ "ramp",
5010
+ "railway",
5011
+ "render",
5012
+ "resend",
5013
+ "salesforce",
5014
+ "segment",
5015
+ "sendgrid",
5016
+ "shopify",
5017
+ "slack",
5018
+ "snowflake",
5019
+ "stripe",
5020
+ "supabase",
5021
+ "terraform",
5022
+ "trello",
5023
+ "turso",
5024
+ "twilio",
5025
+ "typeform",
5026
+ "vercel",
5027
+ "vscode",
5028
+ "windsurf",
5029
+ "yarn"
5030
+ ];
5031
+ /** Company, team, and department landing-page segments. */
5032
+ const COMPANY_TEAM_SLUGS = [
5033
+ "engineers",
5034
+ "engineering",
5035
+ "executives",
5036
+ "hc",
5037
+ "intern",
5038
+ "it",
5039
+ "leadership",
5040
+ "marketing",
5041
+ "ops",
5042
+ "revops",
5043
+ "sales",
5044
+ "services",
5045
+ "tech"
5046
+ ];
5047
+ /** Legal, trust, compliance, and policy URL segments. */
5048
+ const LEGAL_TRUST_SLUGS = [
5049
+ "accessibility",
5050
+ "agreement",
5051
+ "a11y",
5052
+ "bug-bounty",
5053
+ "compliance",
5054
+ "cookie-policy",
5055
+ "cookies",
5056
+ "disclose",
5057
+ "dpa",
5058
+ "eula",
5059
+ "gdpr",
5060
+ "hipaa",
5061
+ "iso",
5062
+ "msa",
5063
+ "pci",
5064
+ "responsible-disclosure",
5065
+ "sla",
5066
+ "soc2",
5067
+ "tos",
5068
+ "trust-center",
5069
+ "trustcenter",
5070
+ "vulnerability"
5071
+ ];
5072
+ /** Developer, API, CLI, and technical URL segments. */
5073
+ const DEVELOPER_TECH_SLUGS = [
5074
+ "api",
5075
+ "api-docs",
5076
+ "cli",
5077
+ "code",
5078
+ "config",
5079
+ "developer",
5080
+ "developer-tools",
5081
+ "developers",
5082
+ "dev-tools",
5083
+ "devtools",
5084
+ "dev",
5085
+ "dev-states",
5086
+ "graphql",
5087
+ "graphql-playground",
5088
+ "mcp-server",
5089
+ "mcp-servers",
5090
+ "openapi",
5091
+ "sdk",
5092
+ "swagger"
5093
+ ];
5094
+ /** Infra, ops, static assets, and system URL segments. */
5095
+ const INFRA_SYSTEM_SLUGS = [
5096
+ "acme-challenge",
5097
+ "admin",
5098
+ "apple-app-site-association",
5099
+ "assets",
5100
+ "batch",
5101
+ "cache",
5102
+ "cdn",
5103
+ "cron",
5104
+ "debug",
5105
+ "error",
5106
+ "errors",
5107
+ "favicon",
5108
+ "feed",
5109
+ "files",
5110
+ "health",
5111
+ "healthcheck",
5112
+ "healthz",
5113
+ "hooks",
5114
+ "internal",
5115
+ "item",
5116
+ "manifest",
5117
+ "metrics",
5118
+ "null",
5119
+ "ping",
5120
+ "prod",
5121
+ "public",
5122
+ "redirect",
5123
+ "robots",
5124
+ "rpc",
5125
+ "rss",
5126
+ "sharer",
5127
+ "sitemap",
5128
+ "staging",
5129
+ "static",
5130
+ "storage",
5131
+ "test",
5132
+ "undefined",
5133
+ "universal",
5134
+ "webhooks",
5135
+ "well-known",
5136
+ "www"
5137
+ ];
5138
+ /** Reserved slugs that are valid org names in theory but blocked for routing safety. */
5139
+ const ROUTING_SAFETY_SLUGS = [
5140
+ "alpha",
5141
+ "anonymous",
5142
+ "archive",
5143
+ "archived",
5144
+ "beta",
5145
+ "clone",
5146
+ "copy",
5147
+ "default",
5148
+ "deleted",
5149
+ "demo-org",
5150
+ "draft",
5151
+ "drafts",
5152
+ "duplicate",
5153
+ "early-access",
5154
+ "embed",
5155
+ "embedded",
5156
+ "export",
5157
+ "fork",
5158
+ "free",
5159
+ "guest",
5160
+ "import",
5161
+ "index",
5162
+ "list",
5163
+ "manage",
5164
+ "moderator",
5165
+ "newsletter",
5166
+ "owner",
5167
+ "preview",
5168
+ "previews",
5169
+ "private",
5170
+ "pro",
5171
+ "public-api",
5172
+ "publish",
5173
+ "published",
5174
+ "queue",
5175
+ "remove",
5176
+ "root",
5177
+ "sample",
5178
+ "samples",
5179
+ "selection",
5180
+ "share",
5181
+ "shared",
5182
+ "sponsor",
5183
+ "sponsors",
5184
+ "sponsorship",
5185
+ "subscribe",
5186
+ "super",
5187
+ "superuser",
5188
+ "system",
5189
+ "sys",
5190
+ "test-org",
5191
+ "trash",
5192
+ "unpublish",
5193
+ "unsubscribe",
5194
+ "upload",
5195
+ "uploads",
5196
+ "waitlist",
5197
+ "widget",
5198
+ "widgets",
5199
+ "worker",
5200
+ "workers"
5201
+ ];
5202
+ /**
5203
+ * URL segments reserved for global (non-org) routes — cannot be used as an org slug.
5204
+ * Prefer adding new entries to the category arrays above; the Set is the enforcement surface.
5205
+ */
5206
+ const RESERVED_ORGANIZATION_SLUGS = new Set([
5207
+ ...AUTH_ACCOUNT_SLUGS,
5208
+ ...ORG_ACCOUNT_SLUGS,
5209
+ ...PRODUCT_SLUGS,
5210
+ ...MARKETING_SITE_SLUGS,
5211
+ ...INTEGRATION_BRAND_SLUGS,
5212
+ ...COMPANY_TEAM_SLUGS,
5213
+ ...LEGAL_TRUST_SLUGS,
5214
+ ...DEVELOPER_TECH_SLUGS,
5215
+ ...INFRA_SYSTEM_SLUGS,
5216
+ ...ROUTING_SAFETY_SLUGS
5217
+ ]);
5218
+ /**
5219
+ * Base slug format: lowercase, 2-64 chars, alphanumeric + dashes.
5220
+ *
5221
+ * IMPORTANT: this is the schema for *reading* slugs (persisted rows, API
5222
+ * responses). It intentionally does NOT enforce the reserved-name list — an org
5223
+ * created before a name became reserved must still parse on read. Use
5224
+ * `ClaimableOrganizationSlugSchema` to validate slugs a user is trying to claim.
5225
+ */
5226
+ const OrganizationSlugSchema = string().trim().toLowerCase().min(2, "Slug must be at least 2 characters").max(64, "Slug must be at most 64 characters").regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "Use lowercase letters, numbers, and dashes only");
5227
+ /**
5228
+ * Slug validation for *claiming* a slug (organization create/rename). Adds the
5229
+ * reserved-name check on top of the base format. Never use this to parse
5230
+ * existing org data, or pre-existing orgs whose slug later became reserved would
5231
+ * fail to load.
5232
+ */
5233
+ const ClaimableOrganizationSlugSchema = OrganizationSlugSchema.refine((slug) => !RESERVED_ORGANIZATION_SLUGS.has(slug), "This slug is reserved");
5234
+ /** Same format as organization slugs — org-scoped, no global reserved list. */
5235
+ const ProjectSlugSchema = OrganizationSlugSchema;
5236
+ /** Browser→platform request budget (ping + small platform overhead). */
5237
+ const PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS = 17e3;
5238
+ /** Normalize a public origin URL (no trailing slash). */
5239
+ function originFromPublicUrl(value, fallback) {
5240
+ const trimmed = value?.trim();
5241
+ if (!trimmed) return fallback.replace(/\/+$/, "");
5242
+ return trimmed.replace(/\/+$/, "");
5243
+ }
5244
+ /** TCP port to bind for a local server, derived from a public URL. */
5245
+ function listenPortFromUrl(url, fallback) {
5246
+ const parsed = new URL(url);
5247
+ if (parsed.port) {
5248
+ const port = Number(parsed.port);
5249
+ if (Number.isFinite(port) && port > 0) return port;
5250
+ }
5251
+ if (parsed.protocol === "https:") return 443;
5252
+ if (parsed.protocol === "http:") return 80;
5253
+ return fallback;
5254
+ }
5255
+ /** Shorthand: listen port from `PUBLIC_*_URL` or fallback. */
5256
+ function listenPortFromPublicUrl(value, fallback) {
5257
+ const trimmed = value?.trim();
5258
+ if (!trimmed) return fallback;
5259
+ try {
5260
+ return listenPortFromUrl(trimmed, fallback);
5261
+ } catch {
5262
+ return fallback;
5263
+ }
5264
+ }
5265
+ /** On-disk path under the project root (packed in deploy artifacts when present). */
5266
+ const ROUTE_MANIFEST_REL_PATH = "dist/.keystroke/route-manifest.json";
5267
+ const StoredRouteManifestSkillSchema = object({
5268
+ slug: string(),
5269
+ name: string().optional(),
5270
+ description: string().optional(),
5271
+ moduleFile: string()
5272
+ });
5273
+ const serializedRouteManifestEntrySchema = discriminatedUnion("kind", [
5274
+ object({
5275
+ kind: literal("health"),
5276
+ method: literal("GET"),
5277
+ path: literal("/health")
5278
+ }),
5279
+ object({
5280
+ kind: literal("agent"),
5281
+ method: literal("POST"),
5282
+ path: string(),
5283
+ agentSlug: string(),
5284
+ moduleFile: string(),
5285
+ name: string().optional(),
5286
+ description: string().optional(),
5287
+ model: string(),
5288
+ systemPrompt: string(),
5289
+ toolCount: number$1().int().nonnegative(),
5290
+ credentialCount: number$1().int().nonnegative(),
5291
+ requestSchema: record(string(), unknown()),
5292
+ responseSchema: record(string(), unknown())
5293
+ }),
5294
+ object({
5295
+ kind: literal("agent-sessions-list"),
5296
+ method: literal("GET"),
5297
+ path: string(),
5298
+ agentSlug: string(),
5299
+ moduleFile: string()
5300
+ }),
5301
+ object({
5302
+ kind: literal("agent-session-detail"),
5303
+ method: literal("GET"),
5304
+ path: string(),
5305
+ agentSlug: string(),
5306
+ moduleFile: string()
5307
+ }),
5308
+ object({
5309
+ kind: literal("workflow"),
5310
+ method: literal("POST"),
5311
+ path: string(),
5312
+ workflowSlug: string(),
5313
+ workflowName: string().optional(),
5314
+ description: string().optional(),
5315
+ subscribable: boolean(),
5316
+ moduleFile: string(),
5317
+ requestSchema: record(string(), unknown()),
5318
+ responseSchema: record(string(), unknown())
5319
+ }),
5320
+ object({
5321
+ kind: literal("workflow-runs-list"),
5322
+ method: literal("GET"),
5323
+ path: string(),
5324
+ workflowSlug: string(),
5325
+ workflowName: string().optional(),
5326
+ moduleFile: string()
5327
+ }),
5328
+ object({
5329
+ kind: literal("workflow-run-detail"),
5330
+ method: literal("GET"),
5331
+ path: string(),
5332
+ workflowSlug: string(),
5333
+ workflowName: string().optional(),
5334
+ moduleFile: string()
5335
+ }),
5336
+ object({
5337
+ kind: literal("trigger-webhook"),
5338
+ method: literal("POST"),
5339
+ path: string(),
5340
+ attachmentIds: array(string()),
5341
+ moduleFile: string(),
5342
+ requestSchema: record(string(), unknown()),
5343
+ attachmentSchemas: record(string(), object({
5344
+ requestSchema: record(string(), unknown()),
5345
+ filterSchema: record(string(), unknown()).optional()
5346
+ })),
5347
+ responseSchema: record(string(), unknown())
5348
+ }),
5349
+ object({
5350
+ kind: literal("trigger-poll"),
5351
+ method: literal("POST"),
5352
+ path: string(),
5353
+ attachmentId: string(),
5354
+ moduleFile: string(),
5355
+ schedule: string(),
5356
+ responseSchema: record(string(), unknown())
5357
+ }),
5358
+ object({
5359
+ kind: literal("trigger-poll-group"),
5360
+ method: literal("POST"),
5361
+ path: string(),
5362
+ pollId: string(),
5363
+ attachmentIds: array(string()),
5364
+ moduleFile: string(),
5365
+ schedule: string(),
5366
+ responseSchema: record(string(), unknown())
5367
+ }),
5368
+ object({
5369
+ kind: literal("trigger-runs-list"),
5370
+ method: literal("GET"),
5371
+ path: string(),
5372
+ attachmentId: string(),
5373
+ moduleFile: string()
5374
+ }),
5375
+ object({
5376
+ kind: literal("trigger-run-detail"),
5377
+ method: literal("GET"),
5378
+ path: string(),
5379
+ attachmentId: string(),
5380
+ moduleFile: string()
5381
+ }),
5382
+ object({
5383
+ kind: literal("cron-schedule"),
5384
+ attachmentId: string(),
5385
+ moduleFile: string(),
5386
+ schedule: string()
5387
+ }),
5388
+ object({
5389
+ kind: literal("plugin"),
5390
+ method: _enum([
5391
+ "GET",
5392
+ "POST",
5393
+ "PUT",
5394
+ "PATCH",
5395
+ "DELETE"
5396
+ ]),
5397
+ path: string(),
5398
+ plugin: string()
5399
+ })
5400
+ ]);
5401
+ const StoredRouteManifestSchema = object({
5402
+ version: literal(1),
5403
+ entries: array(serializedRouteManifestEntrySchema),
5404
+ skills: array(StoredRouteManifestSkillSchema).default([]),
5405
+ integrations: array(string()).optional()
5406
+ });
5407
+ /** Messaging platforms that support agent gateway bindings. */
5408
+ const ChannelPlatformKeySchema = _enum(["slack"]);
5409
+ const ChannelReactionSupportSchema = _enum([
5410
+ "full",
5411
+ "read-only",
5412
+ "none"
5413
+ ]);
5414
+ const ChannelCardSupportSchema = _enum([
5415
+ "full",
5416
+ "partial",
5417
+ "none"
5418
+ ]);
5419
+ const ChannelStreamingSupportSchema = _enum([
5420
+ "native",
5421
+ "post-edit",
5422
+ "buffered",
5423
+ "drafts",
5424
+ "none"
5425
+ ]);
5426
+ const ChannelCapabilitiesSchema = object({
5427
+ mentions: boolean(),
5428
+ reactions: ChannelReactionSupportSchema,
5429
+ cards: ChannelCardSupportSchema,
5430
+ modals: boolean(),
5431
+ streaming: ChannelStreamingSupportSchema,
5432
+ dms: boolean()
5433
+ });
5434
+ const ChannelListenModeSchema = _enum([
5435
+ "mention",
5436
+ "all",
5437
+ "dm"
5438
+ ]);
5439
+ const ChannelBindingKindSchema = _enum([
5440
+ "public",
5441
+ "private",
5442
+ "dm",
5443
+ "group",
5444
+ "space"
5445
+ ]);
5446
+ const AppGatewaySchema = object({
5447
+ capabilities: ChannelCapabilitiesSchema,
5448
+ supportedModes: array(ChannelListenModeSchema).min(1),
5449
+ resourceNoun: object({
5450
+ singular: string().min(1),
5451
+ plural: string().min(1)
5452
+ }),
5453
+ supportsChannelDirectory: boolean(),
5454
+ webhookPathHint: string().min(1),
5455
+ docsUrl: string().url().optional(),
5456
+ tagline: string().min(1).optional()
5457
+ });
5458
+ /** Projected catalog row for the agent channels panel (derived from apps with `gateway`). */
5459
+ const ChannelPlatformSchema = object({
5460
+ key: ChannelPlatformKeySchema,
5461
+ name: string().min(1),
5462
+ appLogoId: string().min(1),
5463
+ fallbackDomain: string().min(1),
5464
+ description: string().min(1),
5465
+ tagline: string().min(1),
5466
+ authKind: _enum(["oauth", "api_key"]),
5467
+ credentialFields: array(object({
5468
+ key: string().min(1),
5469
+ label: string().min(1),
5470
+ placeholder: string().optional(),
5471
+ helpText: string().optional(),
5472
+ type: _enum([
5473
+ "text",
5474
+ "password",
5475
+ "textarea"
5476
+ ]),
5477
+ required: boolean(),
5478
+ prefix: string().optional()
5479
+ })),
5480
+ capabilities: ChannelCapabilitiesSchema,
5481
+ supportedModes: array(ChannelListenModeSchema).min(1),
5482
+ resourceNoun: object({
5483
+ singular: string().min(1),
5484
+ plural: string().min(1)
5485
+ }),
5486
+ webhookPathHint: string().min(1),
5487
+ supportsChannelDirectory: boolean(),
5488
+ docsUrl: string().url().optional()
5489
+ });
5490
+ const ChannelBindingSchema = object({
5491
+ id: string().min(1),
5492
+ channelId: string().min(1),
5493
+ channelName: string().min(1),
5494
+ channelKind: ChannelBindingKindSchema,
5495
+ mode: ChannelListenModeSchema,
5496
+ subscribeOnMention: boolean(),
5497
+ createdAt: string(),
5498
+ updatedAt: string()
5499
+ });
5500
+ const ChannelConnectionSchema = object({
5501
+ id: string().min(1),
5502
+ platform: ChannelPlatformKeySchema,
5503
+ agentId: string().min(1),
5504
+ accountLabel: string().min(1),
5505
+ accountId: string().min(1),
5506
+ connectedAt: string(),
5507
+ bindings: array(ChannelBindingSchema)
5508
+ });
5509
+ const ChannelDirectoryEntrySchema = object({
5510
+ id: string().min(1),
5511
+ name: string().min(1),
5512
+ kind: ChannelBindingKindSchema,
5513
+ memberCount: number$1().int().nonnegative().optional(),
5514
+ isArchived: boolean().optional()
5515
+ });
5516
+ const ChannelConnectionListResponseSchema = object({ connections: array(ChannelConnectionSchema) });
5517
+ const ChannelDirectoryListResponseSchema = object({ channels: array(ChannelDirectoryEntrySchema) });
5518
+ object({ teamName: string().min(1).optional() });
5519
+ const ChannelAccountListResponseSchema = object({ accounts: array(object({
5520
+ id: string().min(1),
5521
+ platform: ChannelPlatformKeySchema,
5522
+ label: string().min(1),
5523
+ connectedAt: string()
5524
+ })) });
5525
+ const NewChannelBindingInputSchema = object({
5526
+ channelId: string().min(1),
5527
+ channelName: string().min(1),
5528
+ channelKind: ChannelBindingKindSchema.optional(),
5529
+ mode: ChannelListenModeSchema.optional(),
5530
+ subscribeOnMention: boolean().optional()
5531
+ });
5532
+ const BindChannelBodySchema = object({
5533
+ platform: ChannelPlatformKeySchema,
5534
+ accountId: string().min(1),
5535
+ binding: NewChannelBindingInputSchema
5536
+ });
5537
+ const UpdateChannelBindingBodySchema = object({ patch: object({
5538
+ mode: ChannelListenModeSchema.optional(),
5539
+ subscribeOnMention: boolean().optional()
5540
+ }) });
5541
+ /** A single OAuth scope an app can request, with human copy for connect UI. */
5542
+ const OAuthScopeOptionSchema = object({
5543
+ name: string().min(1),
5544
+ description: string().min(1),
5545
+ defaultSelected: boolean().optional(),
5546
+ required: boolean().optional()
5547
+ });
5548
+ /** How an app authenticates when connecting credentials. */
5549
+ const AppAuthKindSchema = _enum(["oauth", "api_key"]);
5550
+ const ListAppsResponseSchema = object({ apps: array(object({
5551
+ id: string().min(1),
5552
+ name: string().min(1),
5553
+ description: string().min(1),
5554
+ category: string().min(1),
5555
+ integrationDescription: string().min(1),
5556
+ authKind: AppAuthKindSchema,
5557
+ oauthScopes: array(OAuthScopeOptionSchema),
5558
+ /** When present, the app supports agent gateway bindings (external channels). */
5559
+ gateway: AppGatewaySchema.optional()
5560
+ })) });
5561
+ /** How a credential instance is stored (`credential_instances.auth_kind`). */
5562
+ const CredentialAuthKindSchema = _enum(["api_key", "oauth_managed"]);
5563
+ /** Where a credential instance is stored (`credential_instances.scope_type`). */
5564
+ const CredentialScopeTypeSchema = _enum([
5565
+ "organization",
5566
+ "project",
5567
+ "user"
5568
+ ]);
5569
+ /**
5570
+ * Resolution chain step when an action/tool looks up credentials.
5571
+ * `selection` uses explicit instance ids; other levels map to {@link CredentialScopeType}.
5572
+ */
5573
+ const CredentialScopeLevelSchema = _enum([
5574
+ "selection",
5575
+ "organization",
5576
+ "project",
5577
+ "user"
5578
+ ]);
5579
+ CredentialAuthKindSchema.options;
5580
+ CredentialScopeTypeSchema.options;
5581
+ CredentialScopeLevelSchema.options;
5582
+ /** Default chain when `credential.static(...).scope()` is called with no args. */
5583
+ const DEFAULT_CREDENTIAL_RESOLUTION_CHAIN = ["organization", "project"];
5584
+ /** Scope of a platform app credential (maps to `credential_instances.scope_type`). */
5585
+ const AppCredentialScopeSchema = _enum([
5586
+ "user",
5587
+ "project",
5588
+ "organization"
5589
+ ]);
5590
+ /** How the credential was connected (OAuth vs manual api-key entry). */
5591
+ const AppCredentialConnectionKindSchema = _enum(["oauth", "manual"]);
5592
+ /** Connect-dialog permission preset for OAuth scope selection. */
5593
+ const OAuthPermissionModeSchema = _enum(["default", "restricted"]);
5594
+ const optionalTimestamp$1 = string().optional();
5595
+ const nullableOptionalTimestamp = string().nullable().optional();
5596
+ /**
5597
+ * Summary row for the apps/credentials table and credential detail page.
5598
+ * Plaintext secrets are never returned — only masked `keyPreviews`.
5599
+ */
5600
+ const AppCredentialSummarySchema = object({
5601
+ id: string().min(1),
5602
+ appId: string().min(1),
5603
+ label: string().min(1),
5604
+ scope: AppCredentialScopeSchema,
5605
+ lastRefreshedAt: string().nullable(),
5606
+ appName: string().min(1).optional(),
5607
+ projectId: string().min(1).optional(),
5608
+ projectName: string().min(1).optional(),
5609
+ status: string().optional(),
5610
+ createdAt: optionalTimestamp$1,
5611
+ lastUsedAt: nullableOptionalTimestamp,
5612
+ isDefault: boolean().optional(),
5613
+ connectionKind: AppCredentialConnectionKindSchema.optional(),
5614
+ ownerUserId: string().min(1).optional(),
5615
+ ownerName: string().min(1).optional(),
5616
+ ownerAvatarUrl: string().url().optional(),
5617
+ grantedScopes: array(string().min(1)).optional(),
5618
+ credentialKeys: array(string().min(1)).optional(),
5619
+ keyPreviews: record(string(), string()).optional(),
5620
+ expiresAt: optionalTimestamp$1
5621
+ });
5622
+ const credentialSecretValueSchema = record(string(), unknown()).refine((value) => Object.keys(value).length > 0, { message: "value must be a non-empty object" });
5623
+ function hasCredentialTarget(input) {
5624
+ return input.projects.length > 0 || input.createOrganizationCredential || input.createUserProvidedCredential;
5625
+ }
5626
+ function addMissingCredentialTargetIssue(ctx, path = ["projects"]) {
5627
+ ctx.addIssue({
5628
+ code: "custom",
5629
+ message: "At least one credential target is required",
5630
+ path
5631
+ });
5632
+ }
5633
+ /** Target fields shared by create and OAuth start flows. */
5634
+ const CredentialTargetsFieldsSchema = object({
5635
+ projects: array(string().min(1)).default([]),
5636
+ createOrganizationCredential: boolean().default(false),
5637
+ createUserProvidedCredential: boolean().default(false)
5638
+ });
5639
+ /** Input for starting an OAuth connection (connect dialog / CLI connect). */
5640
+ const StartOAuthConnectionInputSchema = CredentialTargetsFieldsSchema.extend({
5641
+ appId: string().min(1),
5642
+ scopes: array(string().min(1)),
5643
+ permissionMode: OAuthPermissionModeSchema
5644
+ });
5645
+ /** Result of starting an OAuth connection. */
5646
+ const StartOAuthConnectionResultSchema = object({
5647
+ status: _enum(["connected", "redirecting"]),
5648
+ authorizeUrl: string().url().nullable()
5649
+ });
5650
+ /** Request body for `POST /api/credentials` (manual api-key fan-out). */
5651
+ const CreateCredentialsRequestSchema = CredentialTargetsFieldsSchema.extend({
5652
+ appId: string().min(1),
5653
+ connectionKind: AppCredentialConnectionKindSchema,
5654
+ value: credentialSecretValueSchema.optional(),
5655
+ scopes: array(string().min(1)).optional()
5656
+ }).superRefine((input, ctx) => {
5657
+ if (!hasCredentialTarget(input)) addMissingCredentialTargetIssue(ctx);
5658
+ if (input.connectionKind === "manual" && !input.value) ctx.addIssue({
5659
+ code: "custom",
5660
+ message: "value is required for manual connections",
5661
+ path: ["value"]
5662
+ });
5663
+ if (input.connectionKind === "oauth") ctx.addIssue({
5664
+ code: "custom",
5665
+ message: "OAuth credentials are created via the OAuth callback",
5666
+ path: ["connectionKind"]
5667
+ });
5668
+ });
5669
+ /** Request body for `PATCH /api/credentials/:id`. */
5670
+ const UpdateCredentialRequestSchema = object({
5671
+ label: string().trim().min(1).optional(),
5672
+ isDefault: boolean().optional(),
5673
+ value: credentialSecretValueSchema.optional()
5674
+ }).refine((input) => input.label !== void 0 || input.isDefault !== void 0 || input.value !== void 0, { message: "At least one field is required" });
5675
+ const ListCredentialsResponseSchema = object({ credentials: array(AppCredentialSummarySchema) });
5676
+ const GetCredentialResponseSchema = object({ credential: AppCredentialSummarySchema });
5677
+ const CreateCredentialsResponseSchema = object({ credentials: array(AppCredentialSummarySchema) });
5678
+ const SubmitTeamRequestRequestSchema = object({
5679
+ type: _enum([
5680
+ "org-deletion",
5681
+ "contact",
5682
+ "enterprise-upgrade"
5683
+ ]),
5684
+ message: string().trim().max(5e3).optional()
5685
+ });
5686
+ object({ ok: literal(true) });
5687
+ function normalizeCredentialList(list) {
5688
+ return list.map((item) => toCredentialRequirement(item));
5689
+ }
5690
+ function isCredentialRequirement(item) {
5691
+ return "chain" in item;
5692
+ }
5693
+ function toCredentialRequirement(item) {
5694
+ if (isCredentialRequirement(item)) return item;
5695
+ return {
5696
+ key: item.key,
5697
+ kind: item.kind,
5698
+ schema: item.schema,
5699
+ chain: DEFAULT_CREDENTIAL_RESOLUTION_CHAIN,
5700
+ ...item.tokenField !== void 0 ? { tokenField: item.tokenField } : {}
5701
+ };
5702
+ }
5703
+ const OrganizationSlugErrorCodeSchema = _enum([
5704
+ "slug_taken",
5705
+ "slug_reserved",
5706
+ "slug_invalid"
5707
+ ]);
5708
+ const SlugAvailabilityReasonSchema = _enum([
5709
+ "taken",
5710
+ "reserved",
5711
+ "invalid"
5712
+ ]);
5713
+ const SlugAvailabilityResponseSchema = object({
5714
+ slug: string(),
5715
+ available: boolean(),
5716
+ reason: SlugAvailabilityReasonSchema.optional(),
5717
+ suggestion: OrganizationSlugSchema.optional()
5718
+ });
5719
+ object({
5720
+ slug: string().trim().min(1),
5721
+ excludeOrganizationId: string().min(1).optional()
5722
+ });
5723
+ const ProjectSlugAvailabilityReasonSchema = _enum(["taken", "invalid"]);
5724
+ const ProjectSlugAvailabilityResponseSchema = object({
5725
+ slug: string(),
5726
+ available: boolean(),
5727
+ reason: ProjectSlugAvailabilityReasonSchema.optional(),
5728
+ suggestion: ProjectSlugSchema.optional()
5729
+ });
5730
+ object({
5731
+ slug: string().trim().min(1),
5732
+ excludeProjectId: string().min(1).optional()
5733
+ });
5734
+ const ProjectStatusSchema = _enum([
5735
+ "inactive",
5736
+ "starting",
5737
+ "active",
5738
+ "failed"
5739
+ ]);
5740
+ const OrganizationUserRoleSchema = _enum([
5741
+ "owner",
5742
+ "admin",
5743
+ "builder"
5744
+ ]);
5745
+ const isoDateTime$5 = string().datetime();
5746
+ const OrganizationSchema = object({
5747
+ id: string(),
5748
+ name: string(),
5749
+ slug: OrganizationSlugSchema,
5750
+ createdAt: isoDateTime$5,
5751
+ updatedAt: isoDateTime$5
5752
+ });
5753
+ const ProjectSchema = object({
5754
+ id: string(),
5755
+ organizationId: string(),
5756
+ name: string(),
5757
+ slug: ProjectSlugSchema,
5758
+ description: string().nullable(),
5759
+ status: ProjectStatusSchema,
5760
+ baseUrl: string().nullable(),
5761
+ runtimeId: string().nullable(),
5762
+ lastError: string().nullable(),
5763
+ createdAt: isoDateTime$5,
5764
+ updatedAt: isoDateTime$5
5765
+ });
5766
+ const UserOrganizationSchema = object({
5767
+ organization: OrganizationSchema,
5768
+ role: OrganizationUserRoleSchema
5769
+ });
5770
+ const ActiveOrganizationResponseSchema = object({ organization: UserOrganizationSchema.nullable() });
5771
+ const ListOrganizationsResponseSchema = object({ organizations: array(UserOrganizationSchema) });
5772
+ const CreateOrganizationRequestSchema = object({
5773
+ name: string().trim().min(1),
5774
+ /** Format-only at the wire boundary; reserved-name checks run in platform-database. */
5775
+ slug: OrganizationSlugSchema.optional()
5776
+ });
5777
+ const UpdateOrganizationRequestSchema = object({
5778
+ name: string().trim().min(1).optional(),
5779
+ slug: ClaimableOrganizationSlugSchema.optional()
5780
+ }).refine((data) => data.name !== void 0 || data.slug !== void 0, { message: "At least one field is required" });
5781
+ const CreateOrganizationResponseSchema = object({ organization: UserOrganizationSchema });
5782
+ const ListProjectsResponseSchema = object({ projects: array(ProjectSchema) });
5783
+ const ProjectListMetricsSchema = object({
5784
+ agentCount: number$1(),
5785
+ workflowCount: number$1(),
5786
+ skillCount: number$1(),
5787
+ credentialCount: number$1(),
5788
+ lastDeploymentAt: isoDateTime$5.nullable()
5789
+ });
5790
+ const ListProjectMetricsResponseSchema = object({ metrics: record(string(), ProjectListMetricsSchema) });
5791
+ const CreateProjectRequestSchema = object({
5792
+ name: string().trim().min(1),
5793
+ description: string().trim().min(1).optional()
5794
+ });
5795
+ const UpdateProjectRequestSchema = object({
5796
+ name: string().trim().min(1).optional(),
5797
+ description: string().trim().optional(),
5798
+ slug: ProjectSlugSchema.optional()
5799
+ }).refine((data) => data.name !== void 0 || data.description !== void 0 || data.slug !== void 0, { message: "At least one field is required" });
5800
+ const CreateProjectResponseSchema = object({ project: ProjectSchema });
5801
+ const ProjectResponseSchema = object({ project: ProjectSchema });
5802
+ const ProjectReachabilityResponseSchema = object({ reachable: boolean() });
5803
+ const ValidationErrorDetailSchema = object({
5804
+ path: string(),
5805
+ message: string()
5806
+ });
5807
+ /** Machine-readable codes returned in standard API error bodies. */
5808
+ const ErrorResponseCodeSchema = OrganizationSlugErrorCodeSchema.or(_enum(["needs_org_selection"]));
5809
+ /** Standard JSON error body returned by the HTTP API. */
5810
+ const ErrorResponseSchema = object({
5811
+ error: string(),
5812
+ code: ErrorResponseCodeSchema.optional(),
5813
+ message: string().optional(),
5814
+ details: array(ValidationErrorDetailSchema).optional()
5815
+ });
5816
+ const MessageOnlyErrorBodySchema = object({ message: string() });
5817
+ /** Parse a JSON error body from the API. */
5818
+ function parseErrorResponse(body) {
5819
+ const parsed = ErrorResponseSchema.safeParse(body);
5820
+ if (parsed.success) return parsed.data;
5821
+ const messageOnly = MessageOnlyErrorBodySchema.safeParse(body);
5822
+ if (messageOnly.success) return {
5823
+ error: messageOnly.data.message,
5824
+ message: messageOnly.data.message
5825
+ };
5826
+ }
5827
+ const CredentialRunContextSchema = object({
5828
+ orgId: string().min(1).optional(),
5829
+ projectId: string().min(1).optional(),
5830
+ userId: string().min(1).optional(),
5831
+ userIds: record(string(), string()).optional(),
5832
+ selection: record(string(), string()).optional()
5833
+ });
5834
+ const ThinkingLevelSchema = _enum([
5835
+ "off",
5836
+ "minimal",
5837
+ "low",
5838
+ "medium",
5839
+ "high",
5840
+ "xhigh"
5841
+ ]);
5842
+ const PromptInputSchema = object({
5843
+ message: string().min(1),
5844
+ sessionId: string().min(1).optional(),
5845
+ subscriptionId: string().min(1).optional(),
5846
+ context: CredentialRunContextSchema.optional(),
5847
+ thinkingLevel: ThinkingLevelSchema.optional()
5848
+ });
5849
+ const PromptResponseSchema = object({
5850
+ sessionId: string(),
5851
+ messages: array(record(string(), unknown())),
5852
+ error: string().nullable()
5853
+ });
5854
+ const SkipResponseSchema = object({
5855
+ ok: literal(true),
5856
+ skipped: literal(true)
5857
+ });
5858
+ const HealthResponseSchema = object({ ok: literal(true) });
5859
+ object({ service: string() });
5860
+ const ConnectProvidersResponseSchema = object({ providers: array(object({
5861
+ key: string(),
5862
+ mode: _enum(["authorize-url", "browser-redirect"]),
5863
+ path: string(),
5864
+ requiresAuth: boolean()
5865
+ })) });
5866
+ const ConnectAuthorizeUrlResponseSchema = object({ url: string() });
5867
+ const QueuedRunResponseSchema = object({ runId: string() });
5868
+ const QueuedAgentPromptResponseSchema = object({ sessionId: string() });
5869
+ object({
5870
+ workflows: array(string().min(1)).optional(),
5871
+ attachments: array(string().min(1)).optional()
5872
+ });
5873
+ const PollRunMultiResponseSchema = object({ results: array(object({
5874
+ attachmentKey: string(),
5875
+ workflowKey: string(),
5876
+ runId: string().optional(),
5877
+ body: unknown().optional(),
5878
+ queued: boolean(),
5879
+ skipped: boolean().optional()
5880
+ })) });
5881
+ const PollRunResponseSchema = union([
5882
+ record(string(), unknown()),
5883
+ PollRunMultiResponseSchema,
5884
+ SkipResponseSchema,
5885
+ object({ runId: string() })
5886
+ ]);
5887
+ const RunSourceKindSchema = _enum([
5888
+ "api",
5889
+ "trigger",
5890
+ "gateway",
5891
+ "workflow",
5892
+ "agent"
5893
+ ]);
5894
+ object({
5895
+ kind: RunSourceKindSchema,
5896
+ id: string().nullable()
5897
+ });
5898
+ const WorkflowRunStatusSchema = _enum([
5899
+ "pending",
5900
+ "running",
5901
+ "sleeping",
5902
+ "waiting_hook",
5903
+ "completed",
5904
+ "failed",
5905
+ "canceled"
5906
+ ]);
5907
+ const WorkflowRunTriggerSchema = _enum([
5908
+ "api",
5909
+ "cron",
5910
+ "webhook",
5911
+ "poll",
5912
+ "retry"
5913
+ ]);
5914
+ _enum([
5915
+ "run_started",
5916
+ "step_completed",
5917
+ "step_failed",
5918
+ "step_retrying",
5919
+ "sleep_scheduled",
5920
+ "sleep_completed",
5921
+ "hook_created",
5922
+ "hook_resumed",
5923
+ "run_completed",
5924
+ "run_failed",
5925
+ "run_canceled"
5926
+ ]);
5927
+ const WorkflowRunSummarySchema = object({
5928
+ id: string(),
5929
+ status: WorkflowRunStatusSchema,
5930
+ trigger: WorkflowRunTriggerSchema,
5931
+ triggeredAt: string(),
5932
+ startedAt: string().nullable(),
5933
+ finishedAt: string().nullable(),
5934
+ sourceKind: RunSourceKindSchema,
5935
+ sourceId: string().nullable(),
5936
+ triggerRunId: string().nullable(),
5937
+ attachmentId: string().nullable()
5938
+ });
5939
+ const WorkflowRunRecordSchema = object({
5940
+ id: string(),
5941
+ workflowSlug: string(),
5942
+ status: WorkflowRunStatusSchema,
5943
+ trigger: WorkflowRunTriggerSchema,
5944
+ triggeredAt: string(),
5945
+ startedAt: string().nullable(),
5946
+ finishedAt: string().nullable(),
5947
+ sourceKind: RunSourceKindSchema,
5948
+ sourceId: string().nullable(),
5949
+ triggerRunId: string().nullable(),
5950
+ attachmentId: string().nullable(),
5951
+ parentWorkflowRunId: string().nullable(),
5952
+ parentSpanId: string().nullable(),
5953
+ input: unknown().nullable(),
5954
+ output: unknown().nullable(),
5955
+ error: unknown().nullable()
5956
+ });
5957
+ object({
5958
+ limit: number().int().min(1).max(100).optional().default(20),
5959
+ cursor: string().min(1).optional(),
5960
+ status: WorkflowRunStatusSchema.optional(),
5961
+ trigger: WorkflowRunTriggerSchema.optional()
5962
+ });
5963
+ const WorkflowRunListResponseSchema = object({
5964
+ items: array(WorkflowRunSummarySchema),
5965
+ nextCursor: string().nullable()
5966
+ });
5967
+ _enum([
5968
+ "trigger",
5969
+ "steps",
5970
+ "trace"
5971
+ ]);
5972
+ object({ include: string().optional() });
5973
+ const TriggerRunDetailSchema = object({
5974
+ id: string(),
5975
+ attachmentId: string(),
5976
+ attachmentSlug: string().nullable(),
5977
+ triggerType: _enum([
5978
+ "cron",
5979
+ "webhook",
5980
+ "poll"
5981
+ ]),
5982
+ sourcePath: string().nullable(),
5983
+ payload: unknown().nullable(),
5984
+ triggeredAt: string()
5985
+ });
5986
+ const WorkflowStepRunSchema = object({
5987
+ id: string(),
5988
+ actionKey: string(),
5989
+ output: unknown(),
5990
+ completedAt: string()
5991
+ });
5992
+ const TraceTriggerSummarySchema = object({
5993
+ triggerType: string(),
5994
+ triggerRunId: string(),
5995
+ workflowSlug: string().optional(),
5996
+ agentSlug: string().optional(),
5997
+ attachmentId: string().nullable().optional(),
5998
+ attachmentSlug: string().nullable().optional(),
5999
+ route: string().optional(),
6000
+ sourcePath: string().nullable().optional()
6001
+ }).nullable();
6002
+ const TraceGatewaySummarySchema = object({
6003
+ gatewayAttachmentId: string(),
6004
+ gatewayAttachmentKey: string(),
6005
+ threadId: string().optional(),
6006
+ channelId: string().optional(),
6007
+ mode: string().optional()
6008
+ }).nullable();
6009
+ const TraceSpanSchema = object({
6010
+ id: string(),
6011
+ traceId: string(),
6012
+ parentSpanId: string().nullable(),
6013
+ kind: string(),
6014
+ refId: string(),
6015
+ name: string(),
6016
+ status: string(),
6017
+ startedAt: string(),
6018
+ finishedAt: string().nullable(),
6019
+ metadata: unknown().nullable(),
6020
+ error: unknown().nullable()
6021
+ });
6022
+ const TraceLogSchema = object({
6023
+ id: string(),
6024
+ traceId: string(),
6025
+ spanId: string(),
6026
+ seq: number$1(),
6027
+ level: string(),
6028
+ message: string(),
6029
+ data: unknown().nullable(),
6030
+ source: string(),
6031
+ createdAt: string()
6032
+ });
6033
+ const TraceResponseSchema = object({
6034
+ traceId: string(),
6035
+ trigger: TraceTriggerSummarySchema,
6036
+ gateway: TraceGatewaySummarySchema,
6037
+ spans: array(TraceSpanSchema),
6038
+ logs: array(TraceLogSchema)
6039
+ });
6040
+ const WorkflowRunDetailResponseSchema = object({
6041
+ run: WorkflowRunRecordSchema,
6042
+ trigger: TriggerRunDetailSchema.nullable(),
6043
+ steps: array(WorkflowStepRunSchema),
6044
+ trace: TraceResponseSchema.nullable()
6045
+ });
6046
+ const AgentSessionStatusSchema = _enum([
6047
+ "running",
6048
+ "completed",
6049
+ "failed",
6050
+ "canceled"
6051
+ ]);
6052
+ const AgentSessionSummarySchema = object({
6053
+ id: string(),
6054
+ status: AgentSessionStatusSchema,
6055
+ source: RunSourceKindSchema,
6056
+ sourceId: string().nullable(),
6057
+ createdAt: string(),
6058
+ updatedAt: string(),
6059
+ messageCount: number$1()
6060
+ });
6061
+ const AgentSessionRecordSchema = object({
6062
+ id: string(),
6063
+ agentSlug: string(),
6064
+ status: AgentSessionStatusSchema,
6065
+ source: RunSourceKindSchema,
6066
+ sourceId: string().nullable(),
6067
+ createdAt: string(),
6068
+ updatedAt: string(),
6069
+ parentSpanId: string().nullable(),
6070
+ messageCount: number$1(),
6071
+ error: unknown().nullable()
6072
+ });
6073
+ object({
6074
+ limit: number().int().min(1).max(100).optional().default(20),
6075
+ cursor: string().min(1).optional(),
6076
+ status: AgentSessionStatusSchema.optional(),
6077
+ source: RunSourceKindSchema.optional()
6078
+ });
6079
+ const AgentSessionListResponseSchema = object({
6080
+ items: array(AgentSessionSummarySchema),
6081
+ nextCursor: string().nullable()
6082
+ });
6083
+ _enum([
6084
+ "gateway",
6085
+ "messages",
6086
+ "events",
6087
+ "trace"
6088
+ ]);
6089
+ object({ include: string().optional() });
6090
+ const GatewaySessionDetailSchema = object({
6091
+ threadId: string(),
6092
+ attachmentId: string(),
6093
+ attachmentSlug: string().nullable()
6094
+ });
6095
+ const AgentEventSchema = object({
6096
+ id: string(),
6097
+ sessionId: string(),
6098
+ seq: number$1(),
6099
+ eventType: string(),
6100
+ payload: unknown(),
6101
+ createdAt: string()
6102
+ });
6103
+ const AgentSessionDetailResponseSchema = object({
6104
+ session: AgentSessionRecordSchema,
6105
+ gateway: GatewaySessionDetailSchema.nullable(),
6106
+ messages: array(record(string(), unknown())),
6107
+ events: array(AgentEventSchema),
6108
+ trace: TraceResponseSchema.nullable()
6109
+ });
6110
+ const SlackGatewayModeSchema = _enum([
6111
+ "mention",
6112
+ "channel",
6113
+ "dm"
6114
+ ]);
6115
+ const GatewayAttachmentSourceSchema = object({
6116
+ kind: literal("slack"),
6117
+ mode: SlackGatewayModeSchema,
6118
+ credentialKey: string(),
6119
+ channelIds: array(string()).optional(),
6120
+ subscribeOnMention: boolean()
6121
+ });
6122
+ const GatewayAttachmentRecordSchema = object({
6123
+ id: string(),
6124
+ key: string(),
6125
+ agentKey: string(),
6126
+ channelId: string(),
6127
+ teamId: string().nullable().optional(),
6128
+ platform: string(),
6129
+ source: GatewayAttachmentSourceSchema,
6130
+ registeredAt: string(),
6131
+ updatedAt: string()
6132
+ });
6133
+ object({ attachments: array(GatewayAttachmentRecordSchema) });
6134
+ const UpsertGatewayAttachmentBodySchema = object({
6135
+ agentKey: string().min(1),
6136
+ teamId: string().min(1).optional(),
6137
+ mode: SlackGatewayModeSchema.optional(),
6138
+ subscribeOnMention: boolean().optional()
6139
+ });
6140
+ object({ agents: array(object({
6141
+ key: string(),
6142
+ name: string().optional(),
6143
+ route: string()
6144
+ })) });
6145
+ const HistoryRunKindSchema = _enum(["workflow", "agent"]);
6146
+ const HistoryRunStatusSchema = _enum([
6147
+ "pending",
6148
+ "running",
6149
+ "sleeping",
6150
+ "waiting_hook",
6151
+ "completed",
6152
+ "failed",
6153
+ "canceled"
6154
+ ]);
6155
+ const HistoryRunActorSchema = object({
6156
+ userId: string(),
6157
+ name: string(),
6158
+ avatarUrl: string().nullable().optional()
6159
+ });
6160
+ const HistoryRunUsageLineItemSchema = object({
6161
+ id: string(),
6162
+ label: string(),
6163
+ amountUsd: number$1()
6164
+ });
6165
+ const HistoryRunUsageSchema = object({
6166
+ runDurationMs: number$1().nullable(),
6167
+ lineItems: array(HistoryRunUsageLineItemSchema),
6168
+ totalExcludingDurationUsd: number$1().nullable()
6169
+ });
6170
+ const HistoryRunSchema = object({
6171
+ id: string(),
6172
+ kind: HistoryRunKindSchema,
6173
+ traceId: string().nullable(),
6174
+ projectId: string(),
6175
+ projectName: string(),
6176
+ resourceKey: string(),
6177
+ resourceId: string(),
6178
+ resourceName: string(),
6179
+ status: HistoryRunStatusSchema,
6180
+ triggeredAt: string(),
6181
+ timeInQueueMs: number$1().nullable(),
6182
+ startedAt: string(),
6183
+ finishedAt: string().nullable(),
6184
+ durationMs: number$1().nullable(),
6185
+ triggerLabel: string(),
6186
+ triggerRaw: string(),
6187
+ ranAs: HistoryRunActorSchema.nullable(),
6188
+ modelsUsed: array(string()),
6189
+ otherServicesUsed: array(string()),
6190
+ totalCostUsd: number$1().nullable(),
6191
+ messageCount: number$1().optional(),
6192
+ stepCount: number$1().optional()
6193
+ });
6194
+ const HistoryTraceSpanSchema = object({
6195
+ id: string(),
6196
+ traceId: string(),
6197
+ parentSpanId: string().nullable(),
6198
+ kind: string(),
6199
+ refId: string(),
6200
+ name: string(),
6201
+ status: string(),
6202
+ startedAt: string(),
6203
+ finishedAt: string().nullable(),
6204
+ metadata: unknown().nullable(),
6205
+ error: unknown().nullable()
6206
+ });
6207
+ const HistoryTraceLogSchema = object({
6208
+ id: string(),
6209
+ traceId: string(),
6210
+ spanId: string(),
6211
+ seq: number$1(),
6212
+ level: string(),
6213
+ message: string(),
6214
+ data: unknown().nullable(),
6215
+ source: string(),
6216
+ createdAt: string()
6217
+ });
6218
+ const HistoryTraceTriggerSchema = object({
6219
+ triggerType: string(),
6220
+ triggerRunId: string(),
6221
+ workflowKey: string().optional(),
6222
+ agentKey: string().optional(),
6223
+ attachmentId: string().nullable().optional(),
6224
+ attachmentKey: string().nullable().optional(),
6225
+ route: string().optional(),
6226
+ sourcePath: string().nullable().optional()
6227
+ }).nullable();
6228
+ const HistoryTraceGatewaySchema = object({
6229
+ gatewayAttachmentId: string(),
6230
+ gatewayAttachmentKey: string(),
6231
+ threadId: string().optional(),
6232
+ channelId: string().optional(),
6233
+ mode: string().optional()
6234
+ }).nullable();
6235
+ const HistoryTraceSchema = object({
6236
+ traceId: string(),
6237
+ trigger: HistoryTraceTriggerSchema,
6238
+ gateway: HistoryTraceGatewaySchema,
6239
+ spans: array(HistoryTraceSpanSchema),
6240
+ logs: array(HistoryTraceLogSchema)
6241
+ });
6242
+ const HistoryWorkflowStepSchema = object({
6243
+ id: string(),
6244
+ actionKey: string(),
6245
+ output: unknown(),
6246
+ completedAt: string()
6247
+ });
6248
+ const HistoryRunDetailSchema = discriminatedUnion("kind", [object({
6249
+ kind: literal("workflow"),
6250
+ run: object({
6251
+ id: string(),
6252
+ workflowKey: string(),
6253
+ status: HistoryRunStatusSchema,
6254
+ trigger: string(),
6255
+ triggeredAt: string(),
6256
+ startedAt: string().nullable(),
6257
+ finishedAt: string().nullable(),
6258
+ input: unknown().nullable(),
6259
+ output: unknown().nullable(),
6260
+ error: unknown().nullable()
6261
+ }),
6262
+ trigger: object({
6263
+ id: string(),
6264
+ attachmentKey: string().nullable(),
6265
+ triggerType: string(),
6266
+ sourcePath: string().nullable(),
6267
+ payload: unknown().nullable(),
6268
+ triggeredAt: string()
6269
+ }).nullable(),
6270
+ steps: array(HistoryWorkflowStepSchema),
6271
+ trace: HistoryTraceSchema.nullable(),
6272
+ ranAs: HistoryRunActorSchema.nullable().optional(),
6273
+ usage: HistoryRunUsageSchema.nullable().optional()
6274
+ }), object({
6275
+ kind: literal("agent"),
6276
+ runId: string(),
6277
+ session: object({
6278
+ id: string(),
6279
+ agentKey: string(),
6280
+ status: HistoryRunStatusSchema,
6281
+ source: _enum([
6282
+ "api",
6283
+ "gateway",
6284
+ "trigger",
6285
+ "workflow",
6286
+ "agent"
6287
+ ]),
6288
+ sourceId: string().nullable(),
6289
+ createdAt: string(),
6290
+ updatedAt: string(),
6291
+ messageCount: number$1(),
6292
+ error: unknown().nullable()
6293
+ }),
6294
+ gateway: object({
6295
+ threadId: string(),
6296
+ attachmentKey: string().nullable()
6297
+ }).nullable(),
6298
+ messages: array(record(string(), unknown())),
6299
+ trace: HistoryTraceSchema.nullable(),
6300
+ ranAs: HistoryRunActorSchema.nullable().optional(),
6301
+ usage: HistoryRunUsageSchema.nullable().optional()
6302
+ })]);
6303
+ const HistoryRunListQuerySchema = object({
6304
+ project: string().min(1).optional(),
6305
+ status: HistoryRunStatusSchema.optional(),
6306
+ kind: HistoryRunKindSchema.optional()
6307
+ });
6308
+ const HistoryRunListResponseSchema = array(HistoryRunSchema);
6309
+ const HistoryRunDetailResponseSchema = HistoryRunDetailSchema.nullable();
6310
+ const HistoryRunCancelResponseSchema = HistoryRunSchema.nullable();
6311
+ object({ subscriptions: array(object({
6312
+ id: string(),
6313
+ workflowKey: string(),
6314
+ userId: string(),
6315
+ enabled: boolean(),
6316
+ createdAt: string(),
6317
+ updatedAt: string()
6318
+ })) });
6319
+ object({
6320
+ userId: string().min(1).optional(),
6321
+ enabled: boolean().optional()
6322
+ });
6323
+ const CredentialInstanceRecordSchema = object({
6324
+ id: string(),
6325
+ key: string(),
6326
+ scopeType: CredentialScopeTypeSchema,
6327
+ scopeId: string().nullable(),
6328
+ label: string().nullable(),
6329
+ isDefault: boolean(),
6330
+ authKind: CredentialAuthKindSchema
6331
+ });
6332
+ const CredentialInstanceListResponseSchema = object({ instances: array(CredentialInstanceRecordSchema) });
6333
+ const CreateCredentialInstanceBodySchema = object({
6334
+ key: string().min(1),
6335
+ scopeType: CredentialScopeTypeSchema,
6336
+ scopeId: string().nullable().optional(),
6337
+ label: string().nullable().optional(),
6338
+ isDefault: boolean().optional(),
6339
+ value: record(string(), unknown()).refine((value) => Object.keys(value).length > 0, { message: "value must be a non-empty object" })
6340
+ });
6341
+ const UpdateCredentialInstanceBodySchema = object({
6342
+ label: string().nullable().optional(),
6343
+ isDefault: boolean().optional(),
6344
+ value: record(string(), unknown()).refine((value) => Object.keys(value).length > 0, { message: "value must be a non-empty object" }).optional()
6345
+ });
6346
+ const TriggerRunTypeSchema = _enum([
6347
+ "cron",
6348
+ "webhook",
6349
+ "poll"
6350
+ ]);
6351
+ const TriggerRunWorkflowSummarySchema = object({
6352
+ id: string(),
6353
+ status: WorkflowRunStatusSchema,
6354
+ workflowSlug: string()
6355
+ });
6356
+ const TriggerRunAgentSessionSummarySchema = object({
6357
+ id: string(),
6358
+ agentSlug: string()
6359
+ });
6360
+ const TriggerRunSummarySchema = object({
6361
+ id: string(),
6362
+ triggerType: TriggerRunTypeSchema,
6363
+ triggeredAt: string(),
6364
+ sourcePath: string().nullable(),
6365
+ workflowRun: TriggerRunWorkflowSummarySchema.nullable(),
6366
+ agentSession: TriggerRunAgentSessionSummarySchema.nullable()
6367
+ });
6368
+ const TriggerRunRecordSchema = object({
6369
+ id: string(),
6370
+ attachmentId: string(),
6371
+ attachmentSlug: string(),
6372
+ triggerType: TriggerRunTypeSchema,
6373
+ sourcePath: string().nullable(),
6374
+ payload: unknown().nullable(),
6375
+ triggeredAt: string()
6376
+ });
6377
+ object({
6378
+ limit: number().int().min(1).max(100).optional().default(20),
6379
+ cursor: string().min(1).optional(),
6380
+ triggerType: TriggerRunTypeSchema.optional()
6381
+ });
6382
+ const TriggerRunListResponseSchema = object({
6383
+ items: array(TriggerRunSummarySchema),
6384
+ nextCursor: string().nullable()
6385
+ });
6386
+ _enum([
6387
+ "workflows",
6388
+ "agents",
6389
+ "trace"
6390
+ ]);
6391
+ object({ include: string().optional() });
6392
+ const TriggerRunAgentSessionDetailSchema = object({
6393
+ id: string(),
6394
+ agentSlug: string()
6395
+ });
6396
+ const TriggerRunDetailResponseSchema = object({
6397
+ run: TriggerRunRecordSchema,
6398
+ workflowRuns: array(WorkflowRunSummarySchema),
6399
+ agentSessions: array(TriggerRunAgentSessionDetailSchema),
6400
+ trace: TraceResponseSchema.nullable()
6401
+ });
6402
+ const TriggerTypeSchema = _enum([
6403
+ "webhook",
6404
+ "poll",
6405
+ "cron"
6406
+ ]);
6407
+ const TriggerTargetKindSchema = _enum(["workflow", "agent"]);
6408
+ const TriggerListItemSchema = object({
6409
+ key: string(),
6410
+ type: TriggerTypeSchema,
6411
+ route: string().optional(),
6412
+ webhookUrl: string().url().optional(),
6413
+ targetKind: TriggerTargetKindSchema,
6414
+ workflowKey: string().optional(),
6415
+ agentKey: string().optional()
6416
+ });
6417
+ const TriggerListResponseSchema = object({ triggers: array(TriggerListItemSchema) });
6418
+ object({ endpoint: string().min(1).optional() });
6419
+ const TriggerDetailResponseSchema = TriggerListItemSchema;
6420
+ const OrganizationMemberRoleSchema = _enum([
6421
+ "owner",
6422
+ "admin",
6423
+ "builder"
6424
+ ]);
6425
+ const OrganizationMemberStatusSchema = _enum([
6426
+ "invited",
6427
+ "active",
6428
+ "rejected",
6429
+ "suspended"
6430
+ ]);
6431
+ const InvitableOrganizationMemberRoleSchema = _enum(["admin", "builder"]);
6432
+ const isoDateTime$4 = string().datetime();
6433
+ const OrganizationMemberSchema = object({
6434
+ id: string(),
6435
+ name: string(),
6436
+ email: string().email(),
6437
+ role: OrganizationMemberRoleSchema,
6438
+ status: OrganizationMemberStatusSchema,
6439
+ avatarUrl: string().optional(),
6440
+ joinedAt: isoDateTime$4.optional(),
6441
+ lastActiveAt: isoDateTime$4.nullable().optional()
6442
+ });
6443
+ const ListOrganizationMembersResponseSchema = object({ members: array(OrganizationMemberSchema) });
6444
+ const InviteOrganizationMembersRequestSchema = object({
6445
+ emails: array(string().trim().email()).min(1),
6446
+ role: InvitableOrganizationMemberRoleSchema
6447
+ });
6448
+ const InviteOrganizationMemberResultStatusSchema = _enum([
6449
+ "sent",
6450
+ "already_member",
6451
+ "pending",
6452
+ "invalid"
6453
+ ]);
6454
+ const InviteOrganizationMembersResponseSchema = object({ results: array(object({
6455
+ email: string(),
6456
+ status: InviteOrganizationMemberResultStatusSchema,
6457
+ invitationId: string().optional()
6458
+ })) });
6459
+ const UpdateOrganizationMemberRequestSchema = object({ role: InvitableOrganizationMemberRoleSchema });
6460
+ const UpdateOrganizationMemberResponseSchema = object({ member: OrganizationMemberSchema });
6461
+ const ListOrganizationInvitationsResponseSchema = object({ invitations: array(object({
6462
+ id: string(),
6463
+ organizationName: string(),
6464
+ organizationSlug: OrganizationSlugSchema,
6465
+ invitedByName: string().optional(),
6466
+ invitedByEmail: string().email().optional(),
6467
+ role: OrganizationMemberRoleSchema
6468
+ })) });
6469
+ const AcceptOrganizationInvitationResponseSchema = object({ organization: UserOrganizationSchema });
6470
+ const DeclineOrganizationInvitationResponseSchema = object({ success: literal(true) });
6471
+ const isoDateTime$3 = string().datetime();
6472
+ const ApiKeyCreatorSchema = object({
6473
+ id: string(),
6474
+ name: string(),
6475
+ email: string().email().optional(),
6476
+ avatarUrl: string().optional(),
6477
+ /** True when the creator user row no longer exists. */
6478
+ deleted: boolean().optional()
6479
+ });
6480
+ const ApiKeySummarySchema = object({
6481
+ id: string(),
6482
+ name: string(),
6483
+ keyPreview: string(),
6484
+ createdAt: isoDateTime$3,
6485
+ createdBy: ApiKeyCreatorSchema,
6486
+ isCreatedByCurrentUser: boolean()
6487
+ });
6488
+ const ListApiKeysResponseSchema = object({ apiKeys: array(ApiKeySummarySchema) });
6489
+ const CreateApiKeyRequestSchema = object({ name: string().trim().min(1).max(128) });
6490
+ const CreateApiKeyResponseSchema = ApiKeySummarySchema.extend({ secret: string() });
6491
+ const ProjectUserRoleSchema = _enum(["admin", "builder"]);
6492
+ const ProjectInvitePermissionSchema = _enum(["admin", "all"]);
6493
+ const ProjectMemberStatusSchema = _enum(["active", "invited"]);
6494
+ const isoDateTime$2 = string().datetime();
6495
+ const ProjectMemberSchema = object({
6496
+ id: string(),
6497
+ projectId: string(),
6498
+ name: string(),
6499
+ email: string().email(),
6500
+ role: ProjectUserRoleSchema,
6501
+ status: ProjectMemberStatusSchema,
6502
+ image: string().nullable(),
6503
+ createdAt: isoDateTime$2,
6504
+ isCurrentUser: boolean().optional()
6505
+ });
6506
+ const ListProjectMembersResponseSchema = object({ members: array(ProjectMemberSchema) });
6507
+ const InviteProjectMembersRequestSchema = object({
6508
+ emails: array(string().trim().email()).min(1),
6509
+ role: ProjectUserRoleSchema
6510
+ });
6511
+ const InviteProjectMemberResultStatusSchema = _enum([
6512
+ "added",
6513
+ "already_member",
6514
+ "not_org_member",
6515
+ "invalid"
6516
+ ]);
6517
+ const InviteProjectMembersResponseSchema = object({ results: array(object({
6518
+ email: string(),
6519
+ status: InviteProjectMemberResultStatusSchema
6520
+ })) });
6521
+ const UpdateProjectMemberRequestSchema = object({ role: ProjectUserRoleSchema });
6522
+ const UpdateProjectMemberResponseSchema = object({ member: ProjectMemberSchema });
6523
+ const ProjectSettingsSchema = object({
6524
+ description: string(),
6525
+ defaultRole: ProjectUserRoleSchema,
6526
+ invitePermission: ProjectInvitePermissionSchema
6527
+ });
6528
+ const UpdateProjectSettingsRequestSchema = object({
6529
+ description: string().optional(),
6530
+ defaultRole: ProjectUserRoleSchema.optional(),
6531
+ invitePermission: ProjectInvitePermissionSchema.optional()
6532
+ }).refine((data) => data.description !== void 0 || data.defaultRole !== void 0 || data.invitePermission !== void 0, { message: "At least one field is required" });
6533
+ const ProjectSettingsResponseSchema = object({ settings: ProjectSettingsSchema });
6534
+ /** Custom avatar override; null means fall back to OAuth `users.image`. */
6535
+ const UserAvatarSchema = object({ url: url().nullable() });
6536
+ const UserAvatarPatchSchema = object({
6537
+ /** Storage key returned from presign; null removes the custom override. */
6538
+ storageKey: string().min(1).nullable() });
6539
+ const PresignUserAvatarRequestSchema = object({ contentType: string().trim().min(1) });
6540
+ const PresignUserAvatarResponseSchema = object({
6541
+ uploadUrl: url(),
6542
+ storageKey: string().min(1)
6543
+ });
6544
+ const UserInterfaceThemeSchema = _enum([
6545
+ "system",
6546
+ "light",
6547
+ "dark"
6548
+ ]);
6549
+ const UserSurfaceContrastSchema = _enum(["off", "on"]);
6550
+ const UserWorkspaceLayoutModeSchema = _enum(["default", "linear"]);
6551
+ const UserWorkspaceFontSizeSchema = _enum(["default", "large"]);
6552
+ const UserSidebarNavIconVisibilitySchema = _enum(["hidden", "visible"]);
6553
+ const UserSidebarFooterChatRowVisibilitySchema = _enum(["hidden", "visible"]);
6554
+ const UserWorkspaceFavoriteSchema = object({
6555
+ kind: _enum([
6556
+ "agent",
6557
+ "workflow",
6558
+ "skill",
6559
+ "run"
6560
+ ]),
6561
+ resourceId: string().min(1)
6562
+ });
6563
+ const UserPreferencesSchema = object({
6564
+ interfaceTheme: UserInterfaceThemeSchema,
6565
+ surfaceContrast: UserSurfaceContrastSchema,
6566
+ layoutMode: UserWorkspaceLayoutModeSchema,
6567
+ fontSize: UserWorkspaceFontSizeSchema,
6568
+ sidebar: object({
6569
+ navIconVisibility: UserSidebarNavIconVisibilitySchema,
6570
+ footerChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema,
6571
+ hiddenNavItemIds: array(string()),
6572
+ topNavItemOrderIds: array(string()),
6573
+ workspaceNavItemOrderIds: array(string())
6574
+ }),
6575
+ favorites: array(UserWorkspaceFavoriteSchema),
6576
+ projectOrderIds: array(string()),
6577
+ projectDotColors: record(string(), string()),
6578
+ onboardingTabVisible: boolean()
6579
+ });
6580
+ const UserSidebarPreferencesPatchSchema = object({
6581
+ navIconVisibility: UserSidebarNavIconVisibilitySchema.optional(),
6582
+ footerChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema.optional(),
6583
+ hiddenNavItemIds: array(string()).optional(),
6584
+ topNavItemOrderIds: array(string()).optional(),
6585
+ workspaceNavItemOrderIds: array(string()).optional()
6586
+ });
6587
+ const UserPreferencesPatchSchema = object({
6588
+ interfaceTheme: UserInterfaceThemeSchema.optional(),
6589
+ surfaceContrast: UserSurfaceContrastSchema.optional(),
6590
+ layoutMode: UserWorkspaceLayoutModeSchema.optional(),
6591
+ fontSize: UserWorkspaceFontSizeSchema.optional(),
6592
+ sidebar: UserSidebarPreferencesPatchSchema.optional(),
6593
+ favorites: array(UserWorkspaceFavoriteSchema).optional(),
6594
+ projectOrderIds: array(string()).optional(),
6595
+ projectDotColors: record(string(), string()).optional(),
6596
+ onboardingTabVisible: boolean().optional()
6597
+ }).refine((value) => value.interfaceTheme !== void 0 || value.surfaceContrast !== void 0 || value.layoutMode !== void 0 || value.fontSize !== void 0 || value.sidebar !== void 0 || value.favorites !== void 0 || value.projectOrderIds !== void 0 || value.projectDotColors !== void 0 || value.onboardingTabVisible !== void 0, { message: "At least one preference field is required" });
6598
+ const OrganizationLogoVariantSchema = _enum(["light", "dark"]);
6599
+ const OrganizationSidebarBrandingSchema = object({
6600
+ customLogoEnabled: boolean(),
6601
+ customLogoExplicitlyDisabled: boolean(),
6602
+ logoLightUrl: url().nullable(),
6603
+ logoDarkUrl: url().nullable(),
6604
+ logoHeightPx: number$1().int().min(14).max(32)
6605
+ });
6606
+ const OrganizationSidebarBrandingPatchSchema = object({
6607
+ customLogoEnabled: boolean().optional(),
6608
+ customLogoExplicitlyDisabled: boolean().optional(),
6609
+ logoLightStorageKey: string().min(1).nullable().optional(),
6610
+ logoDarkStorageKey: string().min(1).nullable().optional(),
6611
+ logoHeightPx: number$1().int().min(14).max(32).optional()
6612
+ }).refine((value) => value.customLogoEnabled !== void 0 || value.customLogoExplicitlyDisabled !== void 0 || value.logoLightStorageKey !== void 0 || value.logoDarkStorageKey !== void 0 || value.logoHeightPx !== void 0, { message: "At least one branding field is required" });
6613
+ const PresignOrgLogoRequestSchema = object({
6614
+ variant: OrganizationLogoVariantSchema,
6615
+ contentType: string().trim().min(1)
6616
+ });
6617
+ const PresignOrgLogoResponseSchema = object({
6618
+ uploadUrl: url(),
6619
+ storageKey: string().min(1)
6620
+ });
6621
+ const ProjectArtifactStatusSchema = _enum(["pending", "ready"]);
6622
+ const isoDateTime$1 = string().datetime();
6623
+ const ProjectArtifactSchema = object({
6624
+ id: string(),
6625
+ projectId: string(),
6626
+ storageKey: string(),
6627
+ status: ProjectArtifactStatusSchema,
6628
+ createdAt: isoDateTime$1,
6629
+ updatedAt: isoDateTime$1
6630
+ });
6631
+ const CreateProjectArtifactResponseSchema = object({
6632
+ artifact: ProjectArtifactSchema,
6633
+ uploadUrl: string().url(),
6634
+ expiresInSeconds: number$1().int().positive()
6635
+ });
6636
+ const CompleteProjectArtifactResponseSchema = object({
6637
+ artifact: ProjectArtifactSchema,
6638
+ project: ProjectSchema
6639
+ });
6640
+ const DownloadActiveProjectArtifactResponseSchema = object({
6641
+ artifactId: string(),
6642
+ downloadUrl: string().url(),
6643
+ expiresInSeconds: number$1().int().positive()
6644
+ });
6645
+ const ListProjectDeploymentsResponseSchema = object({ deployments: array(object({
6646
+ id: string(),
6647
+ projectId: string(),
6648
+ version: number$1().int().positive(),
6649
+ deployedBy: string().nullable(),
6650
+ deployedByEmail: string().optional(),
6651
+ deployedByAvatarUrl: string().optional(),
6652
+ createdAt: isoDateTime$1,
6653
+ active: boolean()
6654
+ })) });
6655
+ const optionalCount = number$1().int().nonnegative().nullable().optional();
6656
+ const optionalTimestamp = string().nullable().optional();
6657
+ const AgentSummarySchema = object({
6658
+ id: string().min(1),
6659
+ slug: string().min(1),
6660
+ name: string().min(1),
6661
+ projectId: string().min(1),
6662
+ updatedAt: string().min(1),
6663
+ description: string().optional(),
6664
+ sourcePath: string().min(1).optional(),
6665
+ model: string().optional(),
6666
+ toolCount: optionalCount,
6667
+ credentialCount: optionalCount,
6668
+ lastRunAt: optionalTimestamp
6669
+ });
6670
+ const WorkflowSummarySchema = object({
6671
+ id: string().min(1),
6672
+ slug: string().min(1),
6673
+ name: string().min(1),
6674
+ projectId: string().min(1),
6675
+ updatedAt: string().min(1),
6676
+ description: string().optional(),
6677
+ sourcePath: string().min(1).optional(),
6678
+ lastRunAt: optionalTimestamp
6679
+ });
6680
+ const SkillSummarySchema = object({
6681
+ id: string().min(1),
6682
+ slug: string().min(1),
6683
+ name: string().min(1),
6684
+ projectId: string().min(1),
6685
+ updatedAt: string().min(1),
6686
+ description: string().optional(),
6687
+ sourcePath: string().min(1).optional()
6688
+ });
6689
+ const AgentSummaryListResponseSchema = array(AgentSummarySchema);
6690
+ const AgentSummaryDetailResponseSchema = AgentSummarySchema.nullable();
6691
+ const WorkflowSummaryListResponseSchema = array(WorkflowSummarySchema);
6692
+ const WorkflowSummaryDetailResponseSchema = WorkflowSummarySchema.nullable();
6693
+ const SkillSummaryListResponseSchema = array(SkillSummarySchema);
6694
+ const SkillSummaryDetailResponseSchema = SkillSummarySchema.nullable();
6695
+ const RecentResourceKindSchema = _enum([
6696
+ "agent",
6697
+ "workflow",
6698
+ "skill"
6699
+ ]);
6700
+ const RecentResourceSourceSchema = _enum(["owned", "shared"]);
6701
+ const RecentResourceListResponseSchema = array(object({
6702
+ id: string().min(1),
6703
+ resourceKind: RecentResourceKindSchema,
6704
+ resourceId: string().min(1),
6705
+ name: string().min(1),
6706
+ description: string().optional(),
6707
+ projectId: string().min(1),
6708
+ projectName: string().min(1),
6709
+ sourcePath: string().min(1).optional(),
6710
+ source: RecentResourceSourceSchema,
6711
+ lastOpenedAt: string().min(1),
6712
+ lastModifiedAt: string().min(1)
6713
+ }));
6714
+ const isoDateTime = string().datetime();
6715
+ const sha256Hex = string().regex(/^[a-f0-9]{64}$/, "Expected a lowercase hex sha256 digest");
6716
+ /**
6717
+ * A single entry in a deploy's file tree, as served to the dashboard. Carries
6718
+ * no contents: `id` is a stable, path-derived handle used for selection and
6719
+ * `?file=` deep links; `hash` is the content address used to fetch the bytes
6720
+ * lazily and to cache them immutably in the browser.
6721
+ */
6722
+ const ProjectFileSummarySchema = object({
6723
+ id: string(),
6724
+ path: string().min(1),
6725
+ hash: sha256Hex
6726
+ });
6727
+ /** Maps a runtime resource slug (agent/workflow/skill) to its source file path. */
6728
+ const ProjectSourceResourceRefSchema = object({
6729
+ slug: string().min(1),
6730
+ path: string().min(1)
6731
+ });
6732
+ const ProjectSourceResourcesSchema = object({
6733
+ agents: array(ProjectSourceResourceRefSchema).default([]),
6734
+ workflows: array(ProjectSourceResourceRefSchema).default([]),
6735
+ skills: array(ProjectSourceResourceRefSchema).default([])
6736
+ });
6737
+ const emptyResources = () => ({
6738
+ agents: [],
6739
+ workflows: [],
6740
+ skills: []
6741
+ });
6742
+ /** Response for the file-tree listing of a project's active deploy. */
6743
+ const ListProjectFilesResponseSchema = object({
6744
+ artifactId: string().nullable(),
6745
+ files: array(ProjectFileSummarySchema),
6746
+ resources: ProjectSourceResourcesSchema.default(emptyResources())
6747
+ });
6748
+ object({
6749
+ path: string().min(1),
6750
+ contents: string(),
6751
+ hash: sha256Hex
6752
+ });
6753
+ /** Request: ask the platform which blobs are missing and get presigned PUTs. */
6754
+ const PresignProjectSourceRequestSchema = object({ blobs: array(object({
6755
+ hash: sha256Hex,
6756
+ size: number$1().int().nonnegative()
6757
+ })) });
6758
+ /** Response: presigned PUTs for the subset of blobs not already stored. */
6759
+ const PresignProjectSourceResponseSchema = object({ uploads: array(object({
6760
+ hash: sha256Hex,
6761
+ url: string().url()
6762
+ })) });
6763
+ /** Request body the CLI sends to finalize a deploy's source manifest. */
6764
+ const UploadProjectSourceManifestRequestSchema = object({ files: array(object({
6765
+ path: string().min(1),
6766
+ hash: sha256Hex
6767
+ })) });
6768
+ const UploadProjectSourceResponseSchema = object({
6769
+ ok: literal(true),
6770
+ fileCount: number$1().int().nonnegative()
6771
+ });
6772
+ object({
6773
+ files: array(object({
6774
+ id: string(),
6775
+ path: string().min(1),
6776
+ hash: sha256Hex
6777
+ })),
6778
+ generatedAt: isoDateTime
6779
+ });
6780
+ //#endregion
6781
+ export { ListProjectsResponseSchema as $, normalizeCredentialList as $t, DownloadActiveProjectArtifactResponseSchema as A, TriggerRunListResponseSchema as At, InviteOrganizationMembersResponseSchema as B, UpdateProjectSettingsRequestSchema as Bt, CreateOrganizationResponseSchema as C, StartOAuthConnectionInputSchema as Ct, CredentialInstanceListResponseSchema as D, TriggerDetailResponseSchema as Dt, CreateProjectResponseSchema as E, SubmitTeamRequestRequestSchema as Et, HistoryRunCancelResponseSchema as F, UpdateOrganizationMemberResponseSchema as Ft, ListCredentialsResponseSchema as G, UserAvatarSchema as Gt, InviteProjectMembersResponseSchema as H, UploadProjectSourceResponseSchema as Ht, HistoryRunDetailResponseSchema as I, UpdateOrganizationRequestSchema as It, ListOrganizationsResponseSchema as J, WorkflowRunDetailResponseSchema as Jt, ListOrganizationInvitationsResponseSchema as K, UserPreferencesPatchSchema as Kt, HistoryRunListQuerySchema as L, UpdateProjectMemberRequestSchema as Lt, GatewayAttachmentRecordSchema as M, UpdateCredentialInstanceBodySchema as Mt, GetCredentialResponseSchema as N, UpdateCredentialRequestSchema as Nt, CredentialInstanceRecordSchema as O, TriggerListResponseSchema as Ot, HealthResponseSchema as P, UpdateOrganizationMemberRequestSchema as Pt, ListProjectMetricsResponseSchema as Q, listenPortFromPublicUrl as Qt, HistoryRunListResponseSchema as R, UpdateProjectMemberResponseSchema as Rt, CreateOrganizationRequestSchema as S, SlugAvailabilityResponseSchema as St, CreateProjectRequestSchema as T, StoredRouteManifestSchema as Tt, ListApiKeysResponseSchema as U, UpsertGatewayAttachmentBodySchema as Ut, InviteProjectMembersRequestSchema as V, UploadProjectSourceManifestRequestSchema as Vt, ListAppsResponseSchema as W, UserAvatarPatchSchema as Wt, ListProjectFilesResponseSchema as X, WorkflowSummaryDetailResponseSchema as Xt, ListProjectDeploymentsResponseSchema as Y, WorkflowRunListResponseSchema as Yt, ListProjectMembersResponseSchema as Z, WorkflowSummaryListResponseSchema as Zt, CreateApiKeyRequestSchema as _, QueuedRunResponseSchema as _t, AgentSessionListResponseSchema as a, custom as an, PresignOrgLogoResponseSchema as at, CreateCredentialsRequestSchema as b, SkillSummaryDetailResponseSchema as bt, BindChannelBodySchema as c, object as cn, PresignUserAvatarRequestSchema as ct, ChannelConnectionSchema as d, toJSONSchema as dn, ProjectResponseSchema as dt, originFromPublicUrl as en, OrganizationSidebarBrandingPatchSchema as et, ChannelDirectoryListResponseSchema as f, ProjectSettingsResponseSchema as ft, ConnectProvidersResponseSchema as g, QueuedAgentPromptResponseSchema as gt, ConnectAuthorizeUrlResponseSchema as h, PromptResponseSchema as ht, AgentSessionDetailResponseSchema as i, array as in, PresignOrgLogoRequestSchema as it, ErrorResponseSchema as j, UpdateChannelBindingBodySchema as jt, DeclineOrganizationInvitationResponseSchema as k, TriggerRunDetailResponseSchema as kt, ChannelAccountListResponseSchema as l, string as ln, PresignUserAvatarResponseSchema as lt, CompleteProjectArtifactResponseSchema as m, PromptInputSchema as mt, AcceptOrganizationInvitationResponseSchema as n, ZodType as nn, PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS as nt, AgentSummaryDetailResponseSchema as o, discriminatedUnion as on, PresignProjectSourceRequestSchema as ot, ChannelPlatformSchema as p, ProjectSlugAvailabilityResponseSchema as pt, ListOrganizationMembersResponseSchema as q, UserPreferencesSchema as qt, ActiveOrganizationResponseSchema as r, _function as rn, PollRunResponseSchema as rt, AgentSummaryListResponseSchema as s, literal as sn, PresignProjectSourceResponseSchema as st, ACTIVE_ORG_HEADER as t, parseErrorResponse as tn, OrganizationSidebarBrandingSchema as tt, ChannelConnectionListResponseSchema as u, union as un, ProjectReachabilityResponseSchema as ut, CreateApiKeyResponseSchema as v, ROUTE_MANIFEST_REL_PATH as vt, CreateProjectArtifactResponseSchema as w, StartOAuthConnectionResultSchema as wt, CreateCredentialsResponseSchema as x, SkillSummaryListResponseSchema as xt, CreateCredentialInstanceBodySchema as y, RecentResourceListResponseSchema as yt, InviteOrganizationMembersRequestSchema as z, UpdateProjectRequestSchema as zt };
4675
6782
 
4676
- //# sourceMappingURL=schemas-Bq8SXmZk.mjs.map
6783
+ //# sourceMappingURL=dist-D_0UmqFb.mjs.map