@keystrokehq/cli 0.0.165 → 0.0.167

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
@@ -1,2113 +0,0 @@
1
- #!/usr/bin/env node
2
- import { a as array, c as discriminatedUnion, d as object, f as record, g as url, h as unknown, l as literal, m as union, n as ZodType, o as boolean, p as string, r as _enum, s as custom, t as ZodNumber, u as number$1, v as _coercedNumber } from "./schemas-Bq8SXmZk.mjs";
3
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/coerce.js
4
- function number(params) {
5
- return _coercedNumber(ZodNumber, params);
6
- }
7
- //#endregion
8
- //#region ../../packages/shared/dist/index.mjs
9
- const ACTIVE_ORG_HEADER = "x-keystroke-org-id";
10
- /** Auth, session, and account-entry URL segments. */
11
- const AUTH_ACCOUNT_SLUGS = [
12
- "2fa",
13
- "accept-invite",
14
- "auth",
15
- "authorize",
16
- "callback",
17
- "callbacks",
18
- "confirm-email",
19
- "confirmation",
20
- "connect",
21
- "device",
22
- "email-verification",
23
- "forgot-password",
24
- "invite",
25
- "invites",
26
- "login",
27
- "logout",
28
- "magic-link",
29
- "mfa",
30
- "oauth",
31
- "onboarding",
32
- "password",
33
- "recovery",
34
- "register",
35
- "reset-password",
36
- "saml",
37
- "session",
38
- "sessions",
39
- "sign-in",
40
- "sign-up",
41
- "signin",
42
- "signout",
43
- "signup",
44
- "sso",
45
- "token",
46
- "tokens",
47
- "unlink",
48
- "verify",
49
- "verify-email"
50
- ];
51
- /** Org, workspace, billing, and account-management URL segments. */
52
- const ORG_ACCOUNT_SLUGS = [
53
- "account",
54
- "accounts",
55
- "billing",
56
- "console",
57
- "invoice",
58
- "invoices",
59
- "member",
60
- "members",
61
- "me",
62
- "org",
63
- "organization",
64
- "organizations",
65
- "orgs",
66
- "payment",
67
- "payments",
68
- "plan",
69
- "plans",
70
- "portal",
71
- "preferences",
72
- "profile",
73
- "settings",
74
- "subscription",
75
- "subscriptions",
76
- "team",
77
- "teams",
78
- "upgrade",
79
- "usage",
80
- "user",
81
- "users",
82
- "workspace",
83
- "workspaces"
84
- ];
85
- /** Product surfaces, resource types, and in-app navigation segments. */
86
- const PRODUCT_SLUGS = [
87
- "action",
88
- "actions",
89
- "activity",
90
- "agent",
91
- "agents",
92
- "analytics",
93
- "app",
94
- "apps",
95
- "artifact",
96
- "artifacts",
97
- "assistant",
98
- "assistants",
99
- "audit",
100
- "audit-log",
101
- "automation",
102
- "automations",
103
- "branch",
104
- "branches",
105
- "canvas",
106
- "chat",
107
- "chats",
108
- "connection",
109
- "connections",
110
- "create",
111
- "credential",
112
- "credentials",
113
- "dashboard",
114
- "deployment",
115
- "deployments",
116
- "examples",
117
- "execute",
118
- "execution",
119
- "executions",
120
- "explore",
121
- "get-started",
122
- "history",
123
- "inbox",
124
- "inspector",
125
- "integration",
126
- "integrations",
127
- "library",
128
- "logs",
129
- "marketplace",
130
- "mcp",
131
- "mcps",
132
- "new",
133
- "notifications",
134
- "observe",
135
- "plugin",
136
- "plugins",
137
- "primitive",
138
- "primitives",
139
- "project",
140
- "projects",
141
- "recents",
142
- "registry",
143
- "reports",
144
- "run",
145
- "runs",
146
- "runtime",
147
- "runtimes",
148
- "sandbox",
149
- "sandboxes",
150
- "search",
151
- "skill",
152
- "skills",
153
- "templates",
154
- "thread",
155
- "threads",
156
- "trigger",
157
- "triggers",
158
- "version",
159
- "versions",
160
- "workflow",
161
- "workflows"
162
- ];
163
- /** Marketing, docs, company, and go-to-market URL segments. */
164
- const MARKETING_SITE_SLUGS = [
165
- "about",
166
- "affiliates",
167
- "ai",
168
- "announcements",
169
- "anthropic",
170
- "blog",
171
- "book-demo",
172
- "brand",
173
- "campaigns",
174
- "career",
175
- "careers",
176
- "case-studies",
177
- "casestudies",
178
- "changelog",
179
- "chatgpt",
180
- "chrome-extension",
181
- "claude",
182
- "codex",
183
- "community",
184
- "company",
185
- "compare",
186
- "contact",
187
- "contribute",
188
- "creators",
189
- "customers",
190
- "demo",
191
- "demos",
192
- "discord",
193
- "docs",
194
- "documentation",
195
- "download",
196
- "downloads",
197
- "dust",
198
- "emerging-talent",
199
- "engineering-blog",
200
- "enterprise",
201
- "events",
202
- "experts",
203
- "extension",
204
- "faq",
205
- "faqs",
206
- "features",
207
- "forum",
208
- "glean",
209
- "grok",
210
- "guide",
211
- "guides",
212
- "gumloop",
213
- "handbook",
214
- "help",
215
- "help-center",
216
- "home",
217
- "how-it-works",
218
- "howitworks",
219
- "inspo",
220
- "intern",
221
- "investors",
222
- "jobs",
223
- "legal",
224
- "lindy",
225
- "llm",
226
- "llms",
227
- "love",
228
- "make",
229
- "manifesto",
230
- "media",
231
- "merch",
232
- "mission",
233
- "mobile",
234
- "models",
235
- "n8n",
236
- "news",
237
- "newsroom",
238
- "open",
239
- "open-claw",
240
- "open-source",
241
- "openai",
242
- "our-story",
243
- "overview",
244
- "partners",
245
- "pi",
246
- "pipedream",
247
- "platform",
248
- "press",
249
- "press-kit",
250
- "pricing",
251
- "privacy",
252
- "product",
253
- "products",
254
- "provider",
255
- "providers",
256
- "quick-start",
257
- "quickstart",
258
- "refer",
259
- "relay",
260
- "relay-app",
261
- "reporting",
262
- "request-demo",
263
- "resources",
264
- "roadmap",
265
- "schedule-demo",
266
- "security",
267
- "solutions",
268
- "stack-ai",
269
- "stackai",
270
- "startup",
271
- "startups",
272
- "status",
273
- "stories",
274
- "story",
275
- "students",
276
- "support",
277
- "swag",
278
- "switch",
279
- "talent",
280
- "terms",
281
- "testimonials",
282
- "thesis",
283
- "tines",
284
- "trust",
285
- "tutorials",
286
- "university",
287
- "use-case",
288
- "use-cases",
289
- "usecases",
290
- "versus",
291
- "vellum",
292
- "vs",
293
- "webinars",
294
- "workato",
295
- "xai",
296
- "yc",
297
- "zapier"
298
- ];
299
- /** Integrations, competitors, and partner brand slugs (marketing / integration pages). */
300
- const INTEGRATION_BRAND_SLUGS = [
301
- "airtable",
302
- "asana",
303
- "aws",
304
- "azure",
305
- "bun",
306
- "confluence",
307
- "copilot",
308
- "cursor",
309
- "databricks",
310
- "figma",
311
- "firebase",
312
- "fly",
313
- "gcp",
314
- "gemini",
315
- "github",
316
- "gitlab",
317
- "gmail",
318
- "heroku",
319
- "hubspot",
320
- "huggingface",
321
- "jira",
322
- "linear",
323
- "mailchimp",
324
- "meta",
325
- "mistral",
326
- "mixmax",
327
- "monday",
328
- "netlify",
329
- "neon",
330
- "notion",
331
- "npm",
332
- "outlook",
333
- "outreach",
334
- "perplexity",
335
- "planetscale",
336
- "pnpm",
337
- "postmark",
338
- "ramp",
339
- "railway",
340
- "render",
341
- "resend",
342
- "salesforce",
343
- "segment",
344
- "sendgrid",
345
- "shopify",
346
- "slack",
347
- "snowflake",
348
- "stripe",
349
- "supabase",
350
- "terraform",
351
- "trello",
352
- "turso",
353
- "twilio",
354
- "typeform",
355
- "vercel",
356
- "vscode",
357
- "windsurf",
358
- "yarn"
359
- ];
360
- /** Company, team, and department landing-page segments. */
361
- const COMPANY_TEAM_SLUGS = [
362
- "engineers",
363
- "engineering",
364
- "executives",
365
- "hc",
366
- "intern",
367
- "it",
368
- "leadership",
369
- "marketing",
370
- "ops",
371
- "revops",
372
- "sales",
373
- "services",
374
- "tech"
375
- ];
376
- /** Legal, trust, compliance, and policy URL segments. */
377
- const LEGAL_TRUST_SLUGS = [
378
- "accessibility",
379
- "agreement",
380
- "a11y",
381
- "bug-bounty",
382
- "compliance",
383
- "cookie-policy",
384
- "cookies",
385
- "disclose",
386
- "dpa",
387
- "eula",
388
- "gdpr",
389
- "hipaa",
390
- "iso",
391
- "msa",
392
- "pci",
393
- "responsible-disclosure",
394
- "sla",
395
- "soc2",
396
- "tos",
397
- "trust-center",
398
- "trustcenter",
399
- "vulnerability"
400
- ];
401
- /** Developer, API, CLI, and technical URL segments. */
402
- const DEVELOPER_TECH_SLUGS = [
403
- "api",
404
- "api-docs",
405
- "cli",
406
- "code",
407
- "config",
408
- "developer",
409
- "developer-tools",
410
- "developers",
411
- "dev-tools",
412
- "devtools",
413
- "dev",
414
- "dev-states",
415
- "graphql",
416
- "graphql-playground",
417
- "mcp-server",
418
- "mcp-servers",
419
- "openapi",
420
- "sdk",
421
- "swagger"
422
- ];
423
- /** Infra, ops, static assets, and system URL segments. */
424
- const INFRA_SYSTEM_SLUGS = [
425
- "acme-challenge",
426
- "admin",
427
- "apple-app-site-association",
428
- "assets",
429
- "batch",
430
- "cache",
431
- "cdn",
432
- "cron",
433
- "debug",
434
- "error",
435
- "errors",
436
- "favicon",
437
- "feed",
438
- "files",
439
- "health",
440
- "healthcheck",
441
- "healthz",
442
- "hooks",
443
- "internal",
444
- "item",
445
- "manifest",
446
- "metrics",
447
- "null",
448
- "ping",
449
- "prod",
450
- "public",
451
- "redirect",
452
- "robots",
453
- "rpc",
454
- "rss",
455
- "sharer",
456
- "sitemap",
457
- "staging",
458
- "static",
459
- "storage",
460
- "test",
461
- "undefined",
462
- "universal",
463
- "webhooks",
464
- "well-known",
465
- "www"
466
- ];
467
- /** Reserved slugs that are valid org names in theory but blocked for routing safety. */
468
- const ROUTING_SAFETY_SLUGS = [
469
- "alpha",
470
- "anonymous",
471
- "archive",
472
- "archived",
473
- "beta",
474
- "clone",
475
- "copy",
476
- "default",
477
- "deleted",
478
- "demo-org",
479
- "draft",
480
- "drafts",
481
- "duplicate",
482
- "early-access",
483
- "embed",
484
- "embedded",
485
- "export",
486
- "fork",
487
- "free",
488
- "guest",
489
- "import",
490
- "index",
491
- "list",
492
- "manage",
493
- "moderator",
494
- "newsletter",
495
- "owner",
496
- "preview",
497
- "previews",
498
- "private",
499
- "pro",
500
- "public-api",
501
- "publish",
502
- "published",
503
- "queue",
504
- "remove",
505
- "root",
506
- "sample",
507
- "samples",
508
- "selection",
509
- "share",
510
- "shared",
511
- "sponsor",
512
- "sponsors",
513
- "sponsorship",
514
- "subscribe",
515
- "super",
516
- "superuser",
517
- "system",
518
- "sys",
519
- "test-org",
520
- "trash",
521
- "unpublish",
522
- "unsubscribe",
523
- "upload",
524
- "uploads",
525
- "waitlist",
526
- "widget",
527
- "widgets",
528
- "worker",
529
- "workers"
530
- ];
531
- /**
532
- * URL segments reserved for global (non-org) routes — cannot be used as an org slug.
533
- * Prefer adding new entries to the category arrays above; the Set is the enforcement surface.
534
- */
535
- const RESERVED_ORGANIZATION_SLUGS = new Set([
536
- ...AUTH_ACCOUNT_SLUGS,
537
- ...ORG_ACCOUNT_SLUGS,
538
- ...PRODUCT_SLUGS,
539
- ...MARKETING_SITE_SLUGS,
540
- ...INTEGRATION_BRAND_SLUGS,
541
- ...COMPANY_TEAM_SLUGS,
542
- ...LEGAL_TRUST_SLUGS,
543
- ...DEVELOPER_TECH_SLUGS,
544
- ...INFRA_SYSTEM_SLUGS,
545
- ...ROUTING_SAFETY_SLUGS
546
- ]);
547
- /**
548
- * Base slug format: lowercase, 2-64 chars, alphanumeric + dashes.
549
- *
550
- * IMPORTANT: this is the schema for *reading* slugs (persisted rows, API
551
- * responses). It intentionally does NOT enforce the reserved-name list — an org
552
- * created before a name became reserved must still parse on read. Use
553
- * `ClaimableOrganizationSlugSchema` to validate slugs a user is trying to claim.
554
- */
555
- 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");
556
- /**
557
- * Slug validation for *claiming* a slug (organization create/rename). Adds the
558
- * reserved-name check on top of the base format. Never use this to parse
559
- * existing org data, or pre-existing orgs whose slug later became reserved would
560
- * fail to load.
561
- */
562
- const ClaimableOrganizationSlugSchema = OrganizationSlugSchema.refine((slug) => !RESERVED_ORGANIZATION_SLUGS.has(slug), "This slug is reserved");
563
- /** Same format as organization slugs — org-scoped, no global reserved list. */
564
- const ProjectSlugSchema = OrganizationSlugSchema;
565
- /** Browser→platform request budget (ping + small platform overhead). */
566
- const PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS = 17e3;
567
- /** Normalize a public origin URL (no trailing slash). */
568
- function originFromPublicUrl(value, fallback) {
569
- const trimmed = value?.trim();
570
- if (!trimmed) return fallback.replace(/\/+$/, "");
571
- return trimmed.replace(/\/+$/, "");
572
- }
573
- /** TCP port to bind for a local server, derived from a public URL. */
574
- function listenPortFromUrl(url, fallback) {
575
- const parsed = new URL(url);
576
- if (parsed.port) {
577
- const port = Number(parsed.port);
578
- if (Number.isFinite(port) && port > 0) return port;
579
- }
580
- if (parsed.protocol === "https:") return 443;
581
- if (parsed.protocol === "http:") return 80;
582
- return fallback;
583
- }
584
- /** Shorthand: listen port from `PUBLIC_*_URL` or fallback. */
585
- function listenPortFromPublicUrl(value, fallback) {
586
- const trimmed = value?.trim();
587
- if (!trimmed) return fallback;
588
- try {
589
- return listenPortFromUrl(trimmed, fallback);
590
- } catch {
591
- return fallback;
592
- }
593
- }
594
- /** On-disk path under the project root (packed in deploy artifacts when present). */
595
- const ROUTE_MANIFEST_REL_PATH = "dist/.keystroke/route-manifest.json";
596
- const StoredRouteManifestSkillSchema = object({
597
- slug: string(),
598
- name: string().optional(),
599
- description: string().optional(),
600
- moduleFile: string()
601
- });
602
- const serializedRouteManifestEntrySchema = discriminatedUnion("kind", [
603
- object({
604
- kind: literal("health"),
605
- method: literal("GET"),
606
- path: literal("/health")
607
- }),
608
- object({
609
- kind: literal("agent"),
610
- method: literal("POST"),
611
- path: string(),
612
- agentSlug: string(),
613
- moduleFile: string(),
614
- name: string().optional(),
615
- description: string().optional(),
616
- model: string(),
617
- systemPrompt: string(),
618
- toolCount: number$1().int().nonnegative(),
619
- credentialCount: number$1().int().nonnegative(),
620
- requestSchema: record(string(), unknown()),
621
- responseSchema: record(string(), unknown())
622
- }),
623
- object({
624
- kind: literal("agent-sessions-list"),
625
- method: literal("GET"),
626
- path: string(),
627
- agentSlug: string(),
628
- moduleFile: string()
629
- }),
630
- object({
631
- kind: literal("agent-session-detail"),
632
- method: literal("GET"),
633
- path: string(),
634
- agentSlug: string(),
635
- moduleFile: string()
636
- }),
637
- object({
638
- kind: literal("workflow"),
639
- method: literal("POST"),
640
- path: string(),
641
- workflowSlug: string(),
642
- workflowName: string().optional(),
643
- description: string().optional(),
644
- subscribable: boolean(),
645
- moduleFile: string(),
646
- requestSchema: record(string(), unknown()),
647
- responseSchema: record(string(), unknown())
648
- }),
649
- object({
650
- kind: literal("workflow-runs-list"),
651
- method: literal("GET"),
652
- path: string(),
653
- workflowSlug: string(),
654
- workflowName: string().optional(),
655
- moduleFile: string()
656
- }),
657
- object({
658
- kind: literal("workflow-run-detail"),
659
- method: literal("GET"),
660
- path: string(),
661
- workflowSlug: string(),
662
- workflowName: string().optional(),
663
- moduleFile: string()
664
- }),
665
- object({
666
- kind: literal("trigger-webhook"),
667
- method: literal("POST"),
668
- path: string(),
669
- attachmentIds: array(string()),
670
- moduleFile: string(),
671
- requestSchema: record(string(), unknown()),
672
- attachmentSchemas: record(string(), object({
673
- requestSchema: record(string(), unknown()),
674
- filterSchema: record(string(), unknown()).optional()
675
- })),
676
- responseSchema: record(string(), unknown())
677
- }),
678
- object({
679
- kind: literal("trigger-poll"),
680
- method: literal("POST"),
681
- path: string(),
682
- attachmentId: string(),
683
- moduleFile: string(),
684
- schedule: string(),
685
- responseSchema: record(string(), unknown())
686
- }),
687
- object({
688
- kind: literal("trigger-poll-group"),
689
- method: literal("POST"),
690
- path: string(),
691
- pollId: string(),
692
- attachmentIds: array(string()),
693
- moduleFile: string(),
694
- schedule: string(),
695
- responseSchema: record(string(), unknown())
696
- }),
697
- object({
698
- kind: literal("trigger-runs-list"),
699
- method: literal("GET"),
700
- path: string(),
701
- attachmentId: string(),
702
- moduleFile: string()
703
- }),
704
- object({
705
- kind: literal("trigger-run-detail"),
706
- method: literal("GET"),
707
- path: string(),
708
- attachmentId: string(),
709
- moduleFile: string()
710
- }),
711
- object({
712
- kind: literal("cron-schedule"),
713
- attachmentId: string(),
714
- moduleFile: string(),
715
- schedule: string()
716
- }),
717
- object({
718
- kind: literal("plugin"),
719
- method: _enum([
720
- "GET",
721
- "POST",
722
- "PUT",
723
- "PATCH",
724
- "DELETE"
725
- ]),
726
- path: string(),
727
- plugin: string()
728
- })
729
- ]);
730
- object({
731
- version: literal(1),
732
- entries: array(serializedRouteManifestEntrySchema),
733
- skills: array(StoredRouteManifestSkillSchema).default([]),
734
- integrations: array(string()).optional()
735
- });
736
- /** Messaging platforms that support agent gateway bindings. */
737
- const ChannelPlatformKeySchema = _enum(["slack"]);
738
- const ChannelReactionSupportSchema = _enum([
739
- "full",
740
- "read-only",
741
- "none"
742
- ]);
743
- const ChannelCardSupportSchema = _enum([
744
- "full",
745
- "partial",
746
- "none"
747
- ]);
748
- const ChannelStreamingSupportSchema = _enum([
749
- "native",
750
- "post-edit",
751
- "buffered",
752
- "drafts",
753
- "none"
754
- ]);
755
- const ChannelCapabilitiesSchema = object({
756
- mentions: boolean(),
757
- reactions: ChannelReactionSupportSchema,
758
- cards: ChannelCardSupportSchema,
759
- modals: boolean(),
760
- streaming: ChannelStreamingSupportSchema,
761
- dms: boolean()
762
- });
763
- const ChannelListenModeSchema = _enum([
764
- "mention",
765
- "all",
766
- "dm"
767
- ]);
768
- const ChannelBindingKindSchema = _enum([
769
- "public",
770
- "private",
771
- "dm",
772
- "group",
773
- "space"
774
- ]);
775
- const AppGatewaySchema = object({
776
- capabilities: ChannelCapabilitiesSchema,
777
- supportedModes: array(ChannelListenModeSchema).min(1),
778
- resourceNoun: object({
779
- singular: string().min(1),
780
- plural: string().min(1)
781
- }),
782
- supportsChannelDirectory: boolean(),
783
- webhookPathHint: string().min(1),
784
- docsUrl: string().url().optional(),
785
- tagline: string().min(1).optional()
786
- });
787
- /** Projected catalog row for the agent channels panel (derived from apps with `gateway`). */
788
- const ChannelPlatformSchema = object({
789
- key: ChannelPlatformKeySchema,
790
- name: string().min(1),
791
- appLogoId: string().min(1),
792
- fallbackDomain: string().min(1),
793
- description: string().min(1),
794
- tagline: string().min(1),
795
- authKind: _enum(["oauth", "api_key"]),
796
- credentialFields: array(object({
797
- key: string().min(1),
798
- label: string().min(1),
799
- placeholder: string().optional(),
800
- helpText: string().optional(),
801
- type: _enum([
802
- "text",
803
- "password",
804
- "textarea"
805
- ]),
806
- required: boolean(),
807
- prefix: string().optional()
808
- })),
809
- capabilities: ChannelCapabilitiesSchema,
810
- supportedModes: array(ChannelListenModeSchema).min(1),
811
- resourceNoun: object({
812
- singular: string().min(1),
813
- plural: string().min(1)
814
- }),
815
- webhookPathHint: string().min(1),
816
- supportsChannelDirectory: boolean(),
817
- docsUrl: string().url().optional()
818
- });
819
- const ChannelBindingSchema = object({
820
- id: string().min(1),
821
- channelId: string().min(1),
822
- channelName: string().min(1),
823
- channelKind: ChannelBindingKindSchema,
824
- mode: ChannelListenModeSchema,
825
- subscribeOnMention: boolean(),
826
- createdAt: string(),
827
- updatedAt: string()
828
- });
829
- const ChannelConnectionSchema = object({
830
- id: string().min(1),
831
- platform: ChannelPlatformKeySchema,
832
- agentId: string().min(1),
833
- accountLabel: string().min(1),
834
- accountId: string().min(1),
835
- connectedAt: string(),
836
- bindings: array(ChannelBindingSchema)
837
- });
838
- const ChannelDirectoryEntrySchema = object({
839
- id: string().min(1),
840
- name: string().min(1),
841
- kind: ChannelBindingKindSchema,
842
- memberCount: number$1().int().nonnegative().optional(),
843
- isArchived: boolean().optional()
844
- });
845
- const ChannelConnectionListResponseSchema = object({ connections: array(ChannelConnectionSchema) });
846
- const ChannelDirectoryListResponseSchema = object({ channels: array(ChannelDirectoryEntrySchema) });
847
- object({ teamName: string().min(1).optional() });
848
- const ChannelAccountListResponseSchema = object({ accounts: array(object({
849
- id: string().min(1),
850
- platform: ChannelPlatformKeySchema,
851
- label: string().min(1),
852
- connectedAt: string()
853
- })) });
854
- const NewChannelBindingInputSchema = object({
855
- channelId: string().min(1),
856
- channelName: string().min(1),
857
- channelKind: ChannelBindingKindSchema.optional(),
858
- mode: ChannelListenModeSchema.optional(),
859
- subscribeOnMention: boolean().optional()
860
- });
861
- const BindChannelBodySchema = object({
862
- platform: ChannelPlatformKeySchema,
863
- accountId: string().min(1),
864
- binding: NewChannelBindingInputSchema
865
- });
866
- const UpdateChannelBindingBodySchema = object({ patch: object({
867
- mode: ChannelListenModeSchema.optional(),
868
- subscribeOnMention: boolean().optional()
869
- }) });
870
- /** A single OAuth scope an app can request, with human copy for connect UI. */
871
- const OAuthScopeOptionSchema = object({
872
- name: string().min(1),
873
- description: string().min(1),
874
- defaultSelected: boolean().optional(),
875
- required: boolean().optional()
876
- });
877
- /** How an app authenticates when connecting credentials. */
878
- const AppAuthKindSchema = _enum(["oauth", "api_key"]);
879
- const ListAppsResponseSchema = object({ apps: array(object({
880
- id: string().min(1),
881
- name: string().min(1),
882
- description: string().min(1),
883
- category: string().min(1),
884
- integrationDescription: string().min(1),
885
- authKind: AppAuthKindSchema,
886
- oauthScopes: array(OAuthScopeOptionSchema),
887
- /** When present, the app supports agent gateway bindings (external channels). */
888
- gateway: AppGatewaySchema.optional()
889
- })) });
890
- /** How a credential instance is stored (`credential_instances.auth_kind`). */
891
- const CredentialAuthKindSchema = _enum(["api_key", "oauth_managed"]);
892
- /** Where a credential instance is stored (`credential_instances.scope_type`). */
893
- const CredentialScopeTypeSchema = _enum([
894
- "organization",
895
- "project",
896
- "user"
897
- ]);
898
- /**
899
- * Resolution chain step when an action/tool looks up credentials.
900
- * `selection` uses explicit instance ids; other levels map to {@link CredentialScopeType}.
901
- */
902
- const CredentialScopeLevelSchema = _enum([
903
- "selection",
904
- "organization",
905
- "project",
906
- "user"
907
- ]);
908
- CredentialAuthKindSchema.options;
909
- CredentialScopeTypeSchema.options;
910
- CredentialScopeLevelSchema.options;
911
- /** Default chain when `credential.static(...).scope()` is called with no args. */
912
- const DEFAULT_CREDENTIAL_RESOLUTION_CHAIN = ["organization", "project"];
913
- /** Scope of a platform app credential (maps to `credential_instances.scope_type`). */
914
- const AppCredentialScopeSchema = _enum([
915
- "user",
916
- "project",
917
- "organization"
918
- ]);
919
- /** How the credential was connected (OAuth vs manual api-key entry). */
920
- const AppCredentialConnectionKindSchema = _enum(["oauth", "manual"]);
921
- /** Connect-dialog permission preset for OAuth scope selection. */
922
- const OAuthPermissionModeSchema = _enum(["default", "restricted"]);
923
- const optionalTimestamp$1 = string().optional();
924
- const nullableOptionalTimestamp = string().nullable().optional();
925
- /**
926
- * Summary row for the apps/credentials table and credential detail page.
927
- * Plaintext secrets are never returned — only masked `keyPreviews`.
928
- */
929
- const AppCredentialSummarySchema = object({
930
- id: string().min(1),
931
- appId: string().min(1),
932
- label: string().min(1),
933
- scope: AppCredentialScopeSchema,
934
- lastRefreshedAt: string().nullable(),
935
- appName: string().min(1).optional(),
936
- projectId: string().min(1).optional(),
937
- projectName: string().min(1).optional(),
938
- status: string().optional(),
939
- createdAt: optionalTimestamp$1,
940
- lastUsedAt: nullableOptionalTimestamp,
941
- isDefault: boolean().optional(),
942
- connectionKind: AppCredentialConnectionKindSchema.optional(),
943
- ownerUserId: string().min(1).optional(),
944
- ownerName: string().min(1).optional(),
945
- ownerAvatarUrl: string().url().optional(),
946
- grantedScopes: array(string().min(1)).optional(),
947
- credentialKeys: array(string().min(1)).optional(),
948
- keyPreviews: record(string(), string()).optional(),
949
- expiresAt: optionalTimestamp$1
950
- });
951
- const credentialSecretValueSchema = record(string(), unknown()).refine((value) => Object.keys(value).length > 0, { message: "value must be a non-empty object" });
952
- function hasCredentialTarget(input) {
953
- return input.projects.length > 0 || input.createOrganizationCredential || input.createUserProvidedCredential;
954
- }
955
- function addMissingCredentialTargetIssue(ctx, path = ["projects"]) {
956
- ctx.addIssue({
957
- code: "custom",
958
- message: "At least one credential target is required",
959
- path
960
- });
961
- }
962
- /** Target fields shared by create and OAuth start flows. */
963
- const CredentialTargetsFieldsSchema = object({
964
- projects: array(string().min(1)).default([]),
965
- createOrganizationCredential: boolean().default(false),
966
- createUserProvidedCredential: boolean().default(false)
967
- });
968
- /** Input for starting an OAuth connection (connect dialog / CLI connect). */
969
- const StartOAuthConnectionInputSchema = CredentialTargetsFieldsSchema.extend({
970
- appId: string().min(1),
971
- scopes: array(string().min(1)),
972
- permissionMode: OAuthPermissionModeSchema
973
- });
974
- /** Result of starting an OAuth connection. */
975
- const StartOAuthConnectionResultSchema = object({
976
- status: _enum(["connected", "redirecting"]),
977
- authorizeUrl: string().url().nullable()
978
- });
979
- /** Request body for `POST /api/credentials` (manual api-key fan-out). */
980
- const CreateCredentialsRequestSchema = CredentialTargetsFieldsSchema.extend({
981
- appId: string().min(1),
982
- connectionKind: AppCredentialConnectionKindSchema,
983
- value: credentialSecretValueSchema.optional(),
984
- scopes: array(string().min(1)).optional()
985
- }).superRefine((input, ctx) => {
986
- if (!hasCredentialTarget(input)) addMissingCredentialTargetIssue(ctx);
987
- if (input.connectionKind === "manual" && !input.value) ctx.addIssue({
988
- code: "custom",
989
- message: "value is required for manual connections",
990
- path: ["value"]
991
- });
992
- if (input.connectionKind === "oauth") ctx.addIssue({
993
- code: "custom",
994
- message: "OAuth credentials are created via the OAuth callback",
995
- path: ["connectionKind"]
996
- });
997
- });
998
- /** Request body for `PATCH /api/credentials/:id`. */
999
- const UpdateCredentialRequestSchema = object({
1000
- label: string().trim().min(1).optional(),
1001
- isDefault: boolean().optional(),
1002
- value: credentialSecretValueSchema.optional()
1003
- }).refine((input) => input.label !== void 0 || input.isDefault !== void 0 || input.value !== void 0, { message: "At least one field is required" });
1004
- const ListCredentialsResponseSchema = object({ credentials: array(AppCredentialSummarySchema) });
1005
- const GetCredentialResponseSchema = object({ credential: AppCredentialSummarySchema });
1006
- const CreateCredentialsResponseSchema = object({ credentials: array(AppCredentialSummarySchema) });
1007
- const SubmitTeamRequestRequestSchema = object({
1008
- type: _enum([
1009
- "org-deletion",
1010
- "contact",
1011
- "enterprise-upgrade"
1012
- ]),
1013
- message: string().trim().max(5e3).optional()
1014
- });
1015
- object({ ok: literal(true) });
1016
- function isCredentialInput(value) {
1017
- if (typeof value !== "object" || value === null) return false;
1018
- const candidate = value;
1019
- return typeof candidate.key === "string" && CredentialAuthKindSchema.safeParse(candidate.kind).success && candidate.schema instanceof ZodType;
1020
- }
1021
- custom((value) => isCredentialInput(value), "must be a credential requirement");
1022
- function normalizeCredentialList(list) {
1023
- return list.map((item) => toCredentialRequirement(item));
1024
- }
1025
- function isCredentialRequirement(item) {
1026
- return "chain" in item;
1027
- }
1028
- function toCredentialRequirement(item) {
1029
- if (isCredentialRequirement(item)) return item;
1030
- return {
1031
- key: item.key,
1032
- kind: item.kind,
1033
- schema: item.schema,
1034
- chain: DEFAULT_CREDENTIAL_RESOLUTION_CHAIN,
1035
- ...item.tokenField !== void 0 ? { tokenField: item.tokenField } : {}
1036
- };
1037
- }
1038
- const OrganizationSlugErrorCodeSchema = _enum([
1039
- "slug_taken",
1040
- "slug_reserved",
1041
- "slug_invalid"
1042
- ]);
1043
- const SlugAvailabilityReasonSchema = _enum([
1044
- "taken",
1045
- "reserved",
1046
- "invalid"
1047
- ]);
1048
- const SlugAvailabilityResponseSchema = object({
1049
- slug: string(),
1050
- available: boolean(),
1051
- reason: SlugAvailabilityReasonSchema.optional(),
1052
- suggestion: OrganizationSlugSchema.optional()
1053
- });
1054
- object({
1055
- slug: string().trim().min(1),
1056
- excludeOrganizationId: string().min(1).optional()
1057
- });
1058
- const ProjectSlugAvailabilityReasonSchema = _enum(["taken", "invalid"]);
1059
- const ProjectSlugAvailabilityResponseSchema = object({
1060
- slug: string(),
1061
- available: boolean(),
1062
- reason: ProjectSlugAvailabilityReasonSchema.optional(),
1063
- suggestion: ProjectSlugSchema.optional()
1064
- });
1065
- object({
1066
- slug: string().trim().min(1),
1067
- excludeProjectId: string().min(1).optional()
1068
- });
1069
- const ProjectStatusSchema = _enum([
1070
- "inactive",
1071
- "starting",
1072
- "active",
1073
- "failed"
1074
- ]);
1075
- const OrganizationUserRoleSchema = _enum([
1076
- "owner",
1077
- "admin",
1078
- "builder"
1079
- ]);
1080
- const isoDateTime$5 = string().datetime();
1081
- const OrganizationSchema = object({
1082
- id: string(),
1083
- name: string(),
1084
- slug: OrganizationSlugSchema,
1085
- createdAt: isoDateTime$5,
1086
- updatedAt: isoDateTime$5
1087
- });
1088
- const ProjectSchema = object({
1089
- id: string(),
1090
- organizationId: string(),
1091
- name: string(),
1092
- slug: ProjectSlugSchema,
1093
- description: string().nullable(),
1094
- status: ProjectStatusSchema,
1095
- baseUrl: string().nullable(),
1096
- runtimeId: string().nullable(),
1097
- lastError: string().nullable(),
1098
- createdAt: isoDateTime$5,
1099
- updatedAt: isoDateTime$5
1100
- });
1101
- const UserOrganizationSchema = object({
1102
- organization: OrganizationSchema,
1103
- role: OrganizationUserRoleSchema
1104
- });
1105
- const ActiveOrganizationResponseSchema = object({ organization: UserOrganizationSchema.nullable() });
1106
- const ListOrganizationsResponseSchema = object({ organizations: array(UserOrganizationSchema) });
1107
- const CreateOrganizationRequestSchema = object({
1108
- name: string().trim().min(1),
1109
- /** Format-only at the wire boundary; reserved-name checks run in platform-database. */
1110
- slug: OrganizationSlugSchema.optional()
1111
- });
1112
- const UpdateOrganizationRequestSchema = object({
1113
- name: string().trim().min(1).optional(),
1114
- slug: ClaimableOrganizationSlugSchema.optional()
1115
- }).refine((data) => data.name !== void 0 || data.slug !== void 0, { message: "At least one field is required" });
1116
- const CreateOrganizationResponseSchema = object({ organization: UserOrganizationSchema });
1117
- const ListProjectsResponseSchema = object({ projects: array(ProjectSchema) });
1118
- const ProjectListMetricsSchema = object({
1119
- agentCount: number$1(),
1120
- workflowCount: number$1(),
1121
- skillCount: number$1(),
1122
- credentialCount: number$1(),
1123
- lastDeploymentAt: isoDateTime$5.nullable()
1124
- });
1125
- const ListProjectMetricsResponseSchema = object({ metrics: record(string(), ProjectListMetricsSchema) });
1126
- const CreateProjectRequestSchema = object({
1127
- name: string().trim().min(1),
1128
- description: string().trim().min(1).optional()
1129
- });
1130
- const UpdateProjectRequestSchema = object({
1131
- name: string().trim().min(1).optional(),
1132
- description: string().trim().optional(),
1133
- slug: ProjectSlugSchema.optional()
1134
- }).refine((data) => data.name !== void 0 || data.description !== void 0 || data.slug !== void 0, { message: "At least one field is required" });
1135
- const CreateProjectResponseSchema = object({ project: ProjectSchema });
1136
- const ProjectResponseSchema = object({ project: ProjectSchema });
1137
- const ProjectReachabilityResponseSchema = object({ reachable: boolean() });
1138
- const ValidationErrorDetailSchema = object({
1139
- path: string(),
1140
- message: string()
1141
- });
1142
- /** Machine-readable codes returned in standard API error bodies. */
1143
- const ErrorResponseCodeSchema = OrganizationSlugErrorCodeSchema.or(_enum(["needs_org_selection"]));
1144
- /** Standard JSON error body returned by the HTTP API. */
1145
- const ErrorResponseSchema = object({
1146
- error: string(),
1147
- code: ErrorResponseCodeSchema.optional(),
1148
- message: string().optional(),
1149
- details: array(ValidationErrorDetailSchema).optional()
1150
- });
1151
- const MessageOnlyErrorBodySchema = object({ message: string() });
1152
- /** Parse a JSON error body from the API. */
1153
- function parseErrorResponse(body) {
1154
- const parsed = ErrorResponseSchema.safeParse(body);
1155
- if (parsed.success) return parsed.data;
1156
- const messageOnly = MessageOnlyErrorBodySchema.safeParse(body);
1157
- if (messageOnly.success) return {
1158
- error: messageOnly.data.message,
1159
- message: messageOnly.data.message
1160
- };
1161
- }
1162
- const CredentialRunContextSchema = object({
1163
- orgId: string().min(1).optional(),
1164
- projectId: string().min(1).optional(),
1165
- userId: string().min(1).optional(),
1166
- userIds: record(string(), string()).optional(),
1167
- selection: record(string(), string()).optional()
1168
- });
1169
- const ThinkingLevelSchema = _enum([
1170
- "off",
1171
- "minimal",
1172
- "low",
1173
- "medium",
1174
- "high",
1175
- "xhigh"
1176
- ]);
1177
- const PromptInputSchema = object({
1178
- message: string().min(1),
1179
- sessionId: string().min(1).optional(),
1180
- subscriptionId: string().min(1).optional(),
1181
- context: CredentialRunContextSchema.optional(),
1182
- thinkingLevel: ThinkingLevelSchema.optional()
1183
- });
1184
- const PromptResponseSchema = object({
1185
- sessionId: string(),
1186
- messages: array(record(string(), unknown())),
1187
- error: string().nullable()
1188
- });
1189
- const SkipResponseSchema = object({
1190
- ok: literal(true),
1191
- skipped: literal(true)
1192
- });
1193
- const HealthResponseSchema = object({ ok: literal(true) });
1194
- object({ service: string() });
1195
- const ConnectProvidersResponseSchema = object({ providers: array(object({
1196
- key: string(),
1197
- mode: _enum(["authorize-url", "browser-redirect"]),
1198
- path: string(),
1199
- requiresAuth: boolean()
1200
- })) });
1201
- const ConnectAuthorizeUrlResponseSchema = object({ url: string() });
1202
- const QueuedRunResponseSchema = object({ runId: string() });
1203
- const QueuedAgentPromptResponseSchema = object({ sessionId: string() });
1204
- object({
1205
- workflows: array(string().min(1)).optional(),
1206
- attachments: array(string().min(1)).optional()
1207
- });
1208
- const PollRunMultiResponseSchema = object({ results: array(object({
1209
- attachmentKey: string(),
1210
- workflowKey: string(),
1211
- runId: string().optional(),
1212
- body: unknown().optional(),
1213
- queued: boolean(),
1214
- skipped: boolean().optional()
1215
- })) });
1216
- const PollRunResponseSchema = union([
1217
- record(string(), unknown()),
1218
- PollRunMultiResponseSchema,
1219
- SkipResponseSchema,
1220
- object({ runId: string() })
1221
- ]);
1222
- const RunSourceKindSchema = _enum([
1223
- "api",
1224
- "trigger",
1225
- "gateway",
1226
- "workflow",
1227
- "agent"
1228
- ]);
1229
- object({
1230
- kind: RunSourceKindSchema,
1231
- id: string().nullable()
1232
- });
1233
- const WorkflowRunStatusSchema = _enum([
1234
- "pending",
1235
- "running",
1236
- "sleeping",
1237
- "waiting_hook",
1238
- "completed",
1239
- "failed",
1240
- "canceled"
1241
- ]);
1242
- const WorkflowRunTriggerSchema = _enum([
1243
- "api",
1244
- "cron",
1245
- "webhook",
1246
- "poll",
1247
- "retry"
1248
- ]);
1249
- _enum([
1250
- "run_started",
1251
- "step_completed",
1252
- "step_failed",
1253
- "step_retrying",
1254
- "sleep_scheduled",
1255
- "sleep_completed",
1256
- "hook_created",
1257
- "hook_resumed",
1258
- "run_completed",
1259
- "run_failed",
1260
- "run_canceled"
1261
- ]);
1262
- const WorkflowRunSummarySchema = object({
1263
- id: string(),
1264
- status: WorkflowRunStatusSchema,
1265
- trigger: WorkflowRunTriggerSchema,
1266
- triggeredAt: string(),
1267
- startedAt: string().nullable(),
1268
- finishedAt: string().nullable(),
1269
- sourceKind: RunSourceKindSchema,
1270
- sourceId: string().nullable(),
1271
- triggerRunId: string().nullable(),
1272
- attachmentId: string().nullable()
1273
- });
1274
- const WorkflowRunRecordSchema = object({
1275
- id: string(),
1276
- workflowSlug: string(),
1277
- status: WorkflowRunStatusSchema,
1278
- trigger: WorkflowRunTriggerSchema,
1279
- triggeredAt: string(),
1280
- startedAt: string().nullable(),
1281
- finishedAt: string().nullable(),
1282
- sourceKind: RunSourceKindSchema,
1283
- sourceId: string().nullable(),
1284
- triggerRunId: string().nullable(),
1285
- attachmentId: string().nullable(),
1286
- parentWorkflowRunId: string().nullable(),
1287
- parentSpanId: string().nullable(),
1288
- input: unknown().nullable(),
1289
- output: unknown().nullable(),
1290
- error: unknown().nullable()
1291
- });
1292
- object({
1293
- limit: number().int().min(1).max(100).optional().default(20),
1294
- cursor: string().min(1).optional(),
1295
- status: WorkflowRunStatusSchema.optional(),
1296
- trigger: WorkflowRunTriggerSchema.optional()
1297
- });
1298
- const WorkflowRunListResponseSchema = object({
1299
- items: array(WorkflowRunSummarySchema),
1300
- nextCursor: string().nullable()
1301
- });
1302
- _enum([
1303
- "trigger",
1304
- "steps",
1305
- "trace"
1306
- ]);
1307
- object({ include: string().optional() });
1308
- const TriggerRunDetailSchema = object({
1309
- id: string(),
1310
- attachmentId: string(),
1311
- attachmentSlug: string().nullable(),
1312
- triggerType: _enum([
1313
- "cron",
1314
- "webhook",
1315
- "poll"
1316
- ]),
1317
- sourcePath: string().nullable(),
1318
- payload: unknown().nullable(),
1319
- triggeredAt: string()
1320
- });
1321
- const WorkflowStepRunSchema = object({
1322
- id: string(),
1323
- actionKey: string(),
1324
- output: unknown(),
1325
- completedAt: string()
1326
- });
1327
- const TraceTriggerSummarySchema = object({
1328
- triggerType: string(),
1329
- triggerRunId: string(),
1330
- workflowSlug: string().optional(),
1331
- agentSlug: string().optional(),
1332
- attachmentId: string().nullable().optional(),
1333
- attachmentSlug: string().nullable().optional(),
1334
- route: string().optional(),
1335
- sourcePath: string().nullable().optional()
1336
- }).nullable();
1337
- const TraceGatewaySummarySchema = object({
1338
- gatewayAttachmentId: string(),
1339
- gatewayAttachmentKey: string(),
1340
- threadId: string().optional(),
1341
- channelId: string().optional(),
1342
- mode: string().optional()
1343
- }).nullable();
1344
- const TraceSpanSchema = object({
1345
- id: string(),
1346
- traceId: string(),
1347
- parentSpanId: string().nullable(),
1348
- kind: string(),
1349
- refId: string(),
1350
- name: string(),
1351
- status: string(),
1352
- startedAt: string(),
1353
- finishedAt: string().nullable(),
1354
- metadata: unknown().nullable(),
1355
- error: unknown().nullable()
1356
- });
1357
- const TraceLogSchema = object({
1358
- id: string(),
1359
- traceId: string(),
1360
- spanId: string(),
1361
- seq: number$1(),
1362
- level: string(),
1363
- message: string(),
1364
- data: unknown().nullable(),
1365
- source: string(),
1366
- createdAt: string()
1367
- });
1368
- const TraceResponseSchema = object({
1369
- traceId: string(),
1370
- trigger: TraceTriggerSummarySchema,
1371
- gateway: TraceGatewaySummarySchema,
1372
- spans: array(TraceSpanSchema),
1373
- logs: array(TraceLogSchema)
1374
- });
1375
- const WorkflowRunDetailResponseSchema = object({
1376
- run: WorkflowRunRecordSchema,
1377
- trigger: TriggerRunDetailSchema.nullable(),
1378
- steps: array(WorkflowStepRunSchema),
1379
- trace: TraceResponseSchema.nullable()
1380
- });
1381
- const AgentSessionStatusSchema = _enum([
1382
- "running",
1383
- "completed",
1384
- "failed",
1385
- "canceled"
1386
- ]);
1387
- const AgentSessionSummarySchema = object({
1388
- id: string(),
1389
- status: AgentSessionStatusSchema,
1390
- source: RunSourceKindSchema,
1391
- sourceId: string().nullable(),
1392
- createdAt: string(),
1393
- updatedAt: string(),
1394
- messageCount: number$1()
1395
- });
1396
- const AgentSessionRecordSchema = object({
1397
- id: string(),
1398
- agentSlug: string(),
1399
- status: AgentSessionStatusSchema,
1400
- source: RunSourceKindSchema,
1401
- sourceId: string().nullable(),
1402
- createdAt: string(),
1403
- updatedAt: string(),
1404
- parentSpanId: string().nullable(),
1405
- messageCount: number$1(),
1406
- error: unknown().nullable()
1407
- });
1408
- object({
1409
- limit: number().int().min(1).max(100).optional().default(20),
1410
- cursor: string().min(1).optional(),
1411
- status: AgentSessionStatusSchema.optional(),
1412
- source: RunSourceKindSchema.optional()
1413
- });
1414
- const AgentSessionListResponseSchema = object({
1415
- items: array(AgentSessionSummarySchema),
1416
- nextCursor: string().nullable()
1417
- });
1418
- _enum([
1419
- "gateway",
1420
- "messages",
1421
- "events",
1422
- "trace"
1423
- ]);
1424
- object({ include: string().optional() });
1425
- const GatewaySessionDetailSchema = object({
1426
- threadId: string(),
1427
- attachmentId: string(),
1428
- attachmentSlug: string().nullable()
1429
- });
1430
- const AgentEventSchema = object({
1431
- id: string(),
1432
- sessionId: string(),
1433
- seq: number$1(),
1434
- eventType: string(),
1435
- payload: unknown(),
1436
- createdAt: string()
1437
- });
1438
- const AgentSessionDetailResponseSchema = object({
1439
- session: AgentSessionRecordSchema,
1440
- gateway: GatewaySessionDetailSchema.nullable(),
1441
- messages: array(record(string(), unknown())),
1442
- events: array(AgentEventSchema),
1443
- trace: TraceResponseSchema.nullable()
1444
- });
1445
- const SlackGatewayModeSchema = _enum([
1446
- "mention",
1447
- "channel",
1448
- "dm"
1449
- ]);
1450
- const GatewayAttachmentSourceSchema = object({
1451
- kind: literal("slack"),
1452
- mode: SlackGatewayModeSchema,
1453
- credentialKey: string(),
1454
- channelIds: array(string()).optional(),
1455
- subscribeOnMention: boolean()
1456
- });
1457
- const GatewayAttachmentRecordSchema = object({
1458
- id: string(),
1459
- key: string(),
1460
- agentKey: string(),
1461
- channelId: string(),
1462
- teamId: string().nullable().optional(),
1463
- platform: string(),
1464
- source: GatewayAttachmentSourceSchema,
1465
- registeredAt: string(),
1466
- updatedAt: string()
1467
- });
1468
- object({ attachments: array(GatewayAttachmentRecordSchema) });
1469
- const UpsertGatewayAttachmentBodySchema = object({
1470
- agentKey: string().min(1),
1471
- teamId: string().min(1).optional(),
1472
- mode: SlackGatewayModeSchema.optional(),
1473
- subscribeOnMention: boolean().optional()
1474
- });
1475
- object({ agents: array(object({
1476
- key: string(),
1477
- name: string().optional(),
1478
- route: string()
1479
- })) });
1480
- const HistoryRunKindSchema = _enum(["workflow", "agent"]);
1481
- const HistoryRunStatusSchema = _enum([
1482
- "pending",
1483
- "running",
1484
- "sleeping",
1485
- "waiting_hook",
1486
- "completed",
1487
- "failed",
1488
- "canceled"
1489
- ]);
1490
- const HistoryRunActorSchema = object({
1491
- userId: string(),
1492
- name: string(),
1493
- avatarUrl: string().nullable().optional()
1494
- });
1495
- const HistoryRunUsageLineItemSchema = object({
1496
- id: string(),
1497
- label: string(),
1498
- amountUsd: number$1()
1499
- });
1500
- const HistoryRunUsageSchema = object({
1501
- runDurationMs: number$1().nullable(),
1502
- lineItems: array(HistoryRunUsageLineItemSchema),
1503
- totalExcludingDurationUsd: number$1().nullable()
1504
- });
1505
- const HistoryRunSchema = object({
1506
- id: string(),
1507
- kind: HistoryRunKindSchema,
1508
- traceId: string().nullable(),
1509
- projectId: string(),
1510
- projectName: string(),
1511
- resourceKey: string(),
1512
- resourceId: string(),
1513
- resourceName: string(),
1514
- status: HistoryRunStatusSchema,
1515
- triggeredAt: string(),
1516
- timeInQueueMs: number$1().nullable(),
1517
- startedAt: string(),
1518
- finishedAt: string().nullable(),
1519
- durationMs: number$1().nullable(),
1520
- triggerLabel: string(),
1521
- triggerRaw: string(),
1522
- ranAs: HistoryRunActorSchema.nullable(),
1523
- modelsUsed: array(string()),
1524
- otherServicesUsed: array(string()),
1525
- totalCostUsd: number$1().nullable(),
1526
- messageCount: number$1().optional(),
1527
- stepCount: number$1().optional()
1528
- });
1529
- const HistoryTraceSpanSchema = object({
1530
- id: string(),
1531
- traceId: string(),
1532
- parentSpanId: string().nullable(),
1533
- kind: string(),
1534
- refId: string(),
1535
- name: string(),
1536
- status: string(),
1537
- startedAt: string(),
1538
- finishedAt: string().nullable(),
1539
- metadata: unknown().nullable(),
1540
- error: unknown().nullable()
1541
- });
1542
- const HistoryTraceLogSchema = object({
1543
- id: string(),
1544
- traceId: string(),
1545
- spanId: string(),
1546
- seq: number$1(),
1547
- level: string(),
1548
- message: string(),
1549
- data: unknown().nullable(),
1550
- source: string(),
1551
- createdAt: string()
1552
- });
1553
- const HistoryTraceTriggerSchema = object({
1554
- triggerType: string(),
1555
- triggerRunId: string(),
1556
- workflowKey: string().optional(),
1557
- agentKey: string().optional(),
1558
- attachmentId: string().nullable().optional(),
1559
- attachmentKey: string().nullable().optional(),
1560
- route: string().optional(),
1561
- sourcePath: string().nullable().optional()
1562
- }).nullable();
1563
- const HistoryTraceGatewaySchema = object({
1564
- gatewayAttachmentId: string(),
1565
- gatewayAttachmentKey: string(),
1566
- threadId: string().optional(),
1567
- channelId: string().optional(),
1568
- mode: string().optional()
1569
- }).nullable();
1570
- const HistoryTraceSchema = object({
1571
- traceId: string(),
1572
- trigger: HistoryTraceTriggerSchema,
1573
- gateway: HistoryTraceGatewaySchema,
1574
- spans: array(HistoryTraceSpanSchema),
1575
- logs: array(HistoryTraceLogSchema)
1576
- });
1577
- const HistoryWorkflowStepSchema = object({
1578
- id: string(),
1579
- actionKey: string(),
1580
- output: unknown(),
1581
- completedAt: string()
1582
- });
1583
- const HistoryRunDetailSchema = discriminatedUnion("kind", [object({
1584
- kind: literal("workflow"),
1585
- run: object({
1586
- id: string(),
1587
- workflowKey: string(),
1588
- status: HistoryRunStatusSchema,
1589
- trigger: string(),
1590
- triggeredAt: string(),
1591
- startedAt: string().nullable(),
1592
- finishedAt: string().nullable(),
1593
- input: unknown().nullable(),
1594
- output: unknown().nullable(),
1595
- error: unknown().nullable()
1596
- }),
1597
- trigger: object({
1598
- id: string(),
1599
- attachmentKey: string().nullable(),
1600
- triggerType: string(),
1601
- sourcePath: string().nullable(),
1602
- payload: unknown().nullable(),
1603
- triggeredAt: string()
1604
- }).nullable(),
1605
- steps: array(HistoryWorkflowStepSchema),
1606
- trace: HistoryTraceSchema.nullable(),
1607
- ranAs: HistoryRunActorSchema.nullable().optional(),
1608
- usage: HistoryRunUsageSchema.nullable().optional()
1609
- }), object({
1610
- kind: literal("agent"),
1611
- runId: string(),
1612
- session: object({
1613
- id: string(),
1614
- agentKey: string(),
1615
- status: HistoryRunStatusSchema,
1616
- source: _enum([
1617
- "api",
1618
- "gateway",
1619
- "trigger",
1620
- "workflow",
1621
- "agent"
1622
- ]),
1623
- sourceId: string().nullable(),
1624
- createdAt: string(),
1625
- updatedAt: string(),
1626
- messageCount: number$1(),
1627
- error: unknown().nullable()
1628
- }),
1629
- gateway: object({
1630
- threadId: string(),
1631
- attachmentKey: string().nullable()
1632
- }).nullable(),
1633
- messages: array(record(string(), unknown())),
1634
- trace: HistoryTraceSchema.nullable(),
1635
- ranAs: HistoryRunActorSchema.nullable().optional(),
1636
- usage: HistoryRunUsageSchema.nullable().optional()
1637
- })]);
1638
- const HistoryRunListQuerySchema = object({
1639
- project: string().min(1).optional(),
1640
- status: HistoryRunStatusSchema.optional(),
1641
- kind: HistoryRunKindSchema.optional()
1642
- });
1643
- const HistoryRunListResponseSchema = array(HistoryRunSchema);
1644
- const HistoryRunDetailResponseSchema = HistoryRunDetailSchema.nullable();
1645
- const HistoryRunCancelResponseSchema = HistoryRunSchema.nullable();
1646
- object({ subscriptions: array(object({
1647
- id: string(),
1648
- workflowKey: string(),
1649
- userId: string(),
1650
- enabled: boolean(),
1651
- createdAt: string(),
1652
- updatedAt: string()
1653
- })) });
1654
- object({
1655
- userId: string().min(1).optional(),
1656
- enabled: boolean().optional()
1657
- });
1658
- const CredentialInstanceRecordSchema = object({
1659
- id: string(),
1660
- key: string(),
1661
- scopeType: CredentialScopeTypeSchema,
1662
- scopeId: string().nullable(),
1663
- label: string().nullable(),
1664
- isDefault: boolean(),
1665
- authKind: CredentialAuthKindSchema
1666
- });
1667
- const CredentialInstanceListResponseSchema = object({ instances: array(CredentialInstanceRecordSchema) });
1668
- const CreateCredentialInstanceBodySchema = object({
1669
- key: string().min(1),
1670
- scopeType: CredentialScopeTypeSchema,
1671
- scopeId: string().nullable().optional(),
1672
- label: string().nullable().optional(),
1673
- isDefault: boolean().optional(),
1674
- value: record(string(), unknown()).refine((value) => Object.keys(value).length > 0, { message: "value must be a non-empty object" })
1675
- });
1676
- const UpdateCredentialInstanceBodySchema = object({
1677
- label: string().nullable().optional(),
1678
- isDefault: boolean().optional(),
1679
- value: record(string(), unknown()).refine((value) => Object.keys(value).length > 0, { message: "value must be a non-empty object" }).optional()
1680
- });
1681
- const TriggerRunTypeSchema = _enum([
1682
- "cron",
1683
- "webhook",
1684
- "poll"
1685
- ]);
1686
- const TriggerRunWorkflowSummarySchema = object({
1687
- id: string(),
1688
- status: WorkflowRunStatusSchema,
1689
- workflowSlug: string()
1690
- });
1691
- const TriggerRunAgentSessionSummarySchema = object({
1692
- id: string(),
1693
- agentSlug: string()
1694
- });
1695
- const TriggerRunSummarySchema = object({
1696
- id: string(),
1697
- triggerType: TriggerRunTypeSchema,
1698
- triggeredAt: string(),
1699
- sourcePath: string().nullable(),
1700
- workflowRun: TriggerRunWorkflowSummarySchema.nullable(),
1701
- agentSession: TriggerRunAgentSessionSummarySchema.nullable()
1702
- });
1703
- const TriggerRunRecordSchema = object({
1704
- id: string(),
1705
- attachmentId: string(),
1706
- attachmentSlug: string(),
1707
- triggerType: TriggerRunTypeSchema,
1708
- sourcePath: string().nullable(),
1709
- payload: unknown().nullable(),
1710
- triggeredAt: string()
1711
- });
1712
- object({
1713
- limit: number().int().min(1).max(100).optional().default(20),
1714
- cursor: string().min(1).optional(),
1715
- triggerType: TriggerRunTypeSchema.optional()
1716
- });
1717
- const TriggerRunListResponseSchema = object({
1718
- items: array(TriggerRunSummarySchema),
1719
- nextCursor: string().nullable()
1720
- });
1721
- _enum([
1722
- "workflows",
1723
- "agents",
1724
- "trace"
1725
- ]);
1726
- object({ include: string().optional() });
1727
- const TriggerRunAgentSessionDetailSchema = object({
1728
- id: string(),
1729
- agentSlug: string()
1730
- });
1731
- const TriggerRunDetailResponseSchema = object({
1732
- run: TriggerRunRecordSchema,
1733
- workflowRuns: array(WorkflowRunSummarySchema),
1734
- agentSessions: array(TriggerRunAgentSessionDetailSchema),
1735
- trace: TraceResponseSchema.nullable()
1736
- });
1737
- const TriggerTypeSchema = _enum([
1738
- "webhook",
1739
- "poll",
1740
- "cron"
1741
- ]);
1742
- const TriggerTargetKindSchema = _enum(["workflow", "agent"]);
1743
- const TriggerListItemSchema = object({
1744
- key: string(),
1745
- type: TriggerTypeSchema,
1746
- route: string().optional(),
1747
- webhookUrl: string().url().optional(),
1748
- targetKind: TriggerTargetKindSchema,
1749
- workflowKey: string().optional(),
1750
- agentKey: string().optional()
1751
- });
1752
- const TriggerListResponseSchema = object({ triggers: array(TriggerListItemSchema) });
1753
- object({ endpoint: string().min(1).optional() });
1754
- const TriggerDetailResponseSchema = TriggerListItemSchema;
1755
- const OrganizationMemberRoleSchema = _enum([
1756
- "owner",
1757
- "admin",
1758
- "builder"
1759
- ]);
1760
- const OrganizationMemberStatusSchema = _enum([
1761
- "invited",
1762
- "active",
1763
- "rejected",
1764
- "suspended"
1765
- ]);
1766
- const InvitableOrganizationMemberRoleSchema = _enum(["admin", "builder"]);
1767
- const isoDateTime$4 = string().datetime();
1768
- const OrganizationMemberSchema = object({
1769
- id: string(),
1770
- name: string(),
1771
- email: string().email(),
1772
- role: OrganizationMemberRoleSchema,
1773
- status: OrganizationMemberStatusSchema,
1774
- avatarUrl: string().optional(),
1775
- joinedAt: isoDateTime$4.optional(),
1776
- lastActiveAt: isoDateTime$4.nullable().optional()
1777
- });
1778
- const ListOrganizationMembersResponseSchema = object({ members: array(OrganizationMemberSchema) });
1779
- const InviteOrganizationMembersRequestSchema = object({
1780
- emails: array(string().trim().email()).min(1),
1781
- role: InvitableOrganizationMemberRoleSchema
1782
- });
1783
- const InviteOrganizationMemberResultStatusSchema = _enum([
1784
- "sent",
1785
- "already_member",
1786
- "pending",
1787
- "invalid"
1788
- ]);
1789
- const InviteOrganizationMembersResponseSchema = object({ results: array(object({
1790
- email: string(),
1791
- status: InviteOrganizationMemberResultStatusSchema,
1792
- invitationId: string().optional()
1793
- })) });
1794
- const UpdateOrganizationMemberRequestSchema = object({ role: InvitableOrganizationMemberRoleSchema });
1795
- const UpdateOrganizationMemberResponseSchema = object({ member: OrganizationMemberSchema });
1796
- const ListOrganizationInvitationsResponseSchema = object({ invitations: array(object({
1797
- id: string(),
1798
- organizationName: string(),
1799
- organizationSlug: OrganizationSlugSchema,
1800
- invitedByName: string().optional(),
1801
- invitedByEmail: string().email().optional(),
1802
- role: OrganizationMemberRoleSchema
1803
- })) });
1804
- const AcceptOrganizationInvitationResponseSchema = object({ organization: UserOrganizationSchema });
1805
- const DeclineOrganizationInvitationResponseSchema = object({ success: literal(true) });
1806
- const isoDateTime$3 = string().datetime();
1807
- const ApiKeyCreatorSchema = object({
1808
- id: string(),
1809
- name: string(),
1810
- email: string().email().optional(),
1811
- avatarUrl: string().optional(),
1812
- /** True when the creator user row no longer exists. */
1813
- deleted: boolean().optional()
1814
- });
1815
- const ApiKeySummarySchema = object({
1816
- id: string(),
1817
- name: string(),
1818
- keyPreview: string(),
1819
- createdAt: isoDateTime$3,
1820
- createdBy: ApiKeyCreatorSchema,
1821
- isCreatedByCurrentUser: boolean()
1822
- });
1823
- const ListApiKeysResponseSchema = object({ apiKeys: array(ApiKeySummarySchema) });
1824
- const CreateApiKeyRequestSchema = object({ name: string().trim().min(1).max(128) });
1825
- const CreateApiKeyResponseSchema = ApiKeySummarySchema.extend({ secret: string() });
1826
- const ProjectUserRoleSchema = _enum(["admin", "builder"]);
1827
- const ProjectInvitePermissionSchema = _enum(["admin", "all"]);
1828
- const ProjectMemberStatusSchema = _enum(["active", "invited"]);
1829
- const isoDateTime$2 = string().datetime();
1830
- const ProjectMemberSchema = object({
1831
- id: string(),
1832
- projectId: string(),
1833
- name: string(),
1834
- email: string().email(),
1835
- role: ProjectUserRoleSchema,
1836
- status: ProjectMemberStatusSchema,
1837
- image: string().nullable(),
1838
- createdAt: isoDateTime$2,
1839
- isCurrentUser: boolean().optional()
1840
- });
1841
- const ListProjectMembersResponseSchema = object({ members: array(ProjectMemberSchema) });
1842
- const InviteProjectMembersRequestSchema = object({
1843
- emails: array(string().trim().email()).min(1),
1844
- role: ProjectUserRoleSchema
1845
- });
1846
- const InviteProjectMemberResultStatusSchema = _enum([
1847
- "added",
1848
- "already_member",
1849
- "not_org_member",
1850
- "invalid"
1851
- ]);
1852
- const InviteProjectMembersResponseSchema = object({ results: array(object({
1853
- email: string(),
1854
- status: InviteProjectMemberResultStatusSchema
1855
- })) });
1856
- const UpdateProjectMemberRequestSchema = object({ role: ProjectUserRoleSchema });
1857
- const UpdateProjectMemberResponseSchema = object({ member: ProjectMemberSchema });
1858
- const ProjectSettingsSchema = object({
1859
- description: string(),
1860
- defaultRole: ProjectUserRoleSchema,
1861
- invitePermission: ProjectInvitePermissionSchema
1862
- });
1863
- const UpdateProjectSettingsRequestSchema = object({
1864
- description: string().optional(),
1865
- defaultRole: ProjectUserRoleSchema.optional(),
1866
- invitePermission: ProjectInvitePermissionSchema.optional()
1867
- }).refine((data) => data.description !== void 0 || data.defaultRole !== void 0 || data.invitePermission !== void 0, { message: "At least one field is required" });
1868
- const ProjectSettingsResponseSchema = object({ settings: ProjectSettingsSchema });
1869
- /** Custom avatar override; null means fall back to OAuth `users.image`. */
1870
- const UserAvatarSchema = object({ url: url().nullable() });
1871
- const UserAvatarPatchSchema = object({
1872
- /** Storage key returned from presign; null removes the custom override. */
1873
- storageKey: string().min(1).nullable() });
1874
- const PresignUserAvatarRequestSchema = object({ contentType: string().trim().min(1) });
1875
- const PresignUserAvatarResponseSchema = object({
1876
- uploadUrl: url(),
1877
- storageKey: string().min(1)
1878
- });
1879
- const UserInterfaceThemeSchema = _enum([
1880
- "system",
1881
- "light",
1882
- "dark"
1883
- ]);
1884
- const UserSurfaceContrastSchema = _enum(["off", "on"]);
1885
- const UserWorkspaceLayoutModeSchema = _enum(["default", "linear"]);
1886
- const UserWorkspaceFontSizeSchema = _enum(["default", "large"]);
1887
- const UserSidebarNavIconVisibilitySchema = _enum(["hidden", "visible"]);
1888
- const UserSidebarFooterChatRowVisibilitySchema = _enum(["hidden", "visible"]);
1889
- const UserWorkspaceFavoriteSchema = object({
1890
- kind: _enum([
1891
- "agent",
1892
- "workflow",
1893
- "skill",
1894
- "run"
1895
- ]),
1896
- resourceId: string().min(1)
1897
- });
1898
- const UserPreferencesSchema = object({
1899
- interfaceTheme: UserInterfaceThemeSchema,
1900
- surfaceContrast: UserSurfaceContrastSchema,
1901
- layoutMode: UserWorkspaceLayoutModeSchema,
1902
- fontSize: UserWorkspaceFontSizeSchema,
1903
- sidebar: object({
1904
- navIconVisibility: UserSidebarNavIconVisibilitySchema,
1905
- footerChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema,
1906
- hiddenNavItemIds: array(string()),
1907
- topNavItemOrderIds: array(string()),
1908
- workspaceNavItemOrderIds: array(string())
1909
- }),
1910
- favorites: array(UserWorkspaceFavoriteSchema),
1911
- projectOrderIds: array(string()),
1912
- projectDotColors: record(string(), string()),
1913
- onboardingTabVisible: boolean()
1914
- });
1915
- const UserSidebarPreferencesPatchSchema = object({
1916
- navIconVisibility: UserSidebarNavIconVisibilitySchema.optional(),
1917
- footerChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema.optional(),
1918
- hiddenNavItemIds: array(string()).optional(),
1919
- topNavItemOrderIds: array(string()).optional(),
1920
- workspaceNavItemOrderIds: array(string()).optional()
1921
- });
1922
- const UserPreferencesPatchSchema = object({
1923
- interfaceTheme: UserInterfaceThemeSchema.optional(),
1924
- surfaceContrast: UserSurfaceContrastSchema.optional(),
1925
- layoutMode: UserWorkspaceLayoutModeSchema.optional(),
1926
- fontSize: UserWorkspaceFontSizeSchema.optional(),
1927
- sidebar: UserSidebarPreferencesPatchSchema.optional(),
1928
- favorites: array(UserWorkspaceFavoriteSchema).optional(),
1929
- projectOrderIds: array(string()).optional(),
1930
- projectDotColors: record(string(), string()).optional(),
1931
- onboardingTabVisible: boolean().optional()
1932
- }).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" });
1933
- const OrganizationLogoVariantSchema = _enum(["light", "dark"]);
1934
- const OrganizationSidebarBrandingSchema = object({
1935
- customLogoEnabled: boolean(),
1936
- customLogoExplicitlyDisabled: boolean(),
1937
- logoLightUrl: url().nullable(),
1938
- logoDarkUrl: url().nullable(),
1939
- logoHeightPx: number$1().int().min(14).max(32)
1940
- });
1941
- const OrganizationSidebarBrandingPatchSchema = object({
1942
- customLogoEnabled: boolean().optional(),
1943
- customLogoExplicitlyDisabled: boolean().optional(),
1944
- logoLightStorageKey: string().min(1).nullable().optional(),
1945
- logoDarkStorageKey: string().min(1).nullable().optional(),
1946
- logoHeightPx: number$1().int().min(14).max(32).optional()
1947
- }).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" });
1948
- const PresignOrgLogoRequestSchema = object({
1949
- variant: OrganizationLogoVariantSchema,
1950
- contentType: string().trim().min(1)
1951
- });
1952
- const PresignOrgLogoResponseSchema = object({
1953
- uploadUrl: url(),
1954
- storageKey: string().min(1)
1955
- });
1956
- const ProjectArtifactStatusSchema = _enum(["pending", "ready"]);
1957
- const isoDateTime$1 = string().datetime();
1958
- const ProjectArtifactSchema = object({
1959
- id: string(),
1960
- projectId: string(),
1961
- storageKey: string(),
1962
- status: ProjectArtifactStatusSchema,
1963
- createdAt: isoDateTime$1,
1964
- updatedAt: isoDateTime$1
1965
- });
1966
- const CreateProjectArtifactResponseSchema = object({
1967
- artifact: ProjectArtifactSchema,
1968
- uploadUrl: string().url(),
1969
- expiresInSeconds: number$1().int().positive()
1970
- });
1971
- const CompleteProjectArtifactResponseSchema = object({
1972
- artifact: ProjectArtifactSchema,
1973
- project: ProjectSchema
1974
- });
1975
- const ListProjectDeploymentsResponseSchema = object({ deployments: array(object({
1976
- id: string(),
1977
- projectId: string(),
1978
- version: number$1().int().positive(),
1979
- deployedBy: string().nullable(),
1980
- deployedByEmail: string().optional(),
1981
- deployedByAvatarUrl: string().optional(),
1982
- createdAt: isoDateTime$1,
1983
- active: boolean()
1984
- })) });
1985
- const optionalCount = number$1().int().nonnegative().nullable().optional();
1986
- const optionalTimestamp = string().nullable().optional();
1987
- const AgentSummarySchema = object({
1988
- id: string().min(1),
1989
- slug: string().min(1),
1990
- name: string().min(1),
1991
- projectId: string().min(1),
1992
- updatedAt: string().min(1),
1993
- description: string().optional(),
1994
- sourcePath: string().min(1).optional(),
1995
- model: string().optional(),
1996
- toolCount: optionalCount,
1997
- credentialCount: optionalCount,
1998
- lastRunAt: optionalTimestamp
1999
- });
2000
- const WorkflowSummarySchema = object({
2001
- id: string().min(1),
2002
- slug: string().min(1),
2003
- name: string().min(1),
2004
- projectId: string().min(1),
2005
- updatedAt: string().min(1),
2006
- description: string().optional(),
2007
- sourcePath: string().min(1).optional(),
2008
- lastRunAt: optionalTimestamp
2009
- });
2010
- const SkillSummarySchema = object({
2011
- id: string().min(1),
2012
- slug: string().min(1),
2013
- name: string().min(1),
2014
- projectId: string().min(1),
2015
- updatedAt: string().min(1),
2016
- description: string().optional(),
2017
- sourcePath: string().min(1).optional()
2018
- });
2019
- const AgentSummaryListResponseSchema = array(AgentSummarySchema);
2020
- const AgentSummaryDetailResponseSchema = AgentSummarySchema.nullable();
2021
- const WorkflowSummaryListResponseSchema = array(WorkflowSummarySchema);
2022
- const WorkflowSummaryDetailResponseSchema = WorkflowSummarySchema.nullable();
2023
- const SkillSummaryListResponseSchema = array(SkillSummarySchema);
2024
- const SkillSummaryDetailResponseSchema = SkillSummarySchema.nullable();
2025
- const RecentResourceKindSchema = _enum([
2026
- "agent",
2027
- "workflow",
2028
- "skill"
2029
- ]);
2030
- const RecentResourceSourceSchema = _enum(["owned", "shared"]);
2031
- const RecentResourceListResponseSchema = array(object({
2032
- id: string().min(1),
2033
- resourceKind: RecentResourceKindSchema,
2034
- resourceId: string().min(1),
2035
- name: string().min(1),
2036
- description: string().optional(),
2037
- projectId: string().min(1),
2038
- projectName: string().min(1),
2039
- sourcePath: string().min(1).optional(),
2040
- source: RecentResourceSourceSchema,
2041
- lastOpenedAt: string().min(1),
2042
- lastModifiedAt: string().min(1)
2043
- }));
2044
- const isoDateTime = string().datetime();
2045
- const sha256Hex = string().regex(/^[a-f0-9]{64}$/, "Expected a lowercase hex sha256 digest");
2046
- /**
2047
- * A single entry in a deploy's file tree, as served to the dashboard. Carries
2048
- * no contents: `id` is a stable, path-derived handle used for selection and
2049
- * `?file=` deep links; `hash` is the content address used to fetch the bytes
2050
- * lazily and to cache them immutably in the browser.
2051
- */
2052
- const ProjectFileSummarySchema = object({
2053
- id: string(),
2054
- path: string().min(1),
2055
- hash: sha256Hex
2056
- });
2057
- /** Maps a runtime resource slug (agent/workflow/skill) to its source file path. */
2058
- const ProjectSourceResourceRefSchema = object({
2059
- slug: string().min(1),
2060
- path: string().min(1)
2061
- });
2062
- const ProjectSourceResourcesSchema = object({
2063
- agents: array(ProjectSourceResourceRefSchema).default([]),
2064
- workflows: array(ProjectSourceResourceRefSchema).default([]),
2065
- skills: array(ProjectSourceResourceRefSchema).default([])
2066
- });
2067
- const emptyResources = () => ({
2068
- agents: [],
2069
- workflows: [],
2070
- skills: []
2071
- });
2072
- /** Response for the file-tree listing of a project's active deploy. */
2073
- const ListProjectFilesResponseSchema = object({
2074
- artifactId: string().nullable(),
2075
- files: array(ProjectFileSummarySchema),
2076
- resources: ProjectSourceResourcesSchema.default(emptyResources())
2077
- });
2078
- object({
2079
- path: string().min(1),
2080
- contents: string(),
2081
- hash: sha256Hex
2082
- });
2083
- /** Request: ask the platform which blobs are missing and get presigned PUTs. */
2084
- const PresignProjectSourceRequestSchema = object({ blobs: array(object({
2085
- hash: sha256Hex,
2086
- size: number$1().int().nonnegative()
2087
- })) });
2088
- /** Response: presigned PUTs for the subset of blobs not already stored. */
2089
- const PresignProjectSourceResponseSchema = object({ uploads: array(object({
2090
- hash: sha256Hex,
2091
- url: string().url()
2092
- })) });
2093
- /** Request body the CLI sends to finalize a deploy's source manifest. */
2094
- const UploadProjectSourceManifestRequestSchema = object({ files: array(object({
2095
- path: string().min(1),
2096
- hash: sha256Hex
2097
- })) });
2098
- const UploadProjectSourceResponseSchema = object({
2099
- ok: literal(true),
2100
- fileCount: number$1().int().nonnegative()
2101
- });
2102
- object({
2103
- files: array(object({
2104
- id: string(),
2105
- path: string().min(1),
2106
- hash: sha256Hex
2107
- })),
2108
- generatedAt: isoDateTime
2109
- });
2110
- //#endregion
2111
- export { OrganizationSidebarBrandingPatchSchema as $, parseErrorResponse as $t, ErrorResponseSchema as A, UpdateCredentialInstanceBodySchema as At, InviteProjectMembersRequestSchema as B, UploadProjectSourceResponseSchema as Bt, CreateOrganizationResponseSchema as C, StartOAuthConnectionResultSchema as Ct, CredentialInstanceListResponseSchema as D, TriggerRunDetailResponseSchema as Dt, CreateProjectResponseSchema as E, TriggerListResponseSchema as Et, HistoryRunDetailResponseSchema as F, UpdateProjectMemberRequestSchema as Ft, ListOrganizationInvitationsResponseSchema as G, UserPreferencesSchema as Gt, ListApiKeysResponseSchema as H, UserAvatarPatchSchema as Ht, HistoryRunListQuerySchema as I, UpdateProjectMemberResponseSchema as It, ListProjectDeploymentsResponseSchema as J, WorkflowSummaryDetailResponseSchema as Jt, ListOrganizationMembersResponseSchema as K, WorkflowRunDetailResponseSchema as Kt, HistoryRunListResponseSchema as L, UpdateProjectRequestSchema as Lt, GetCredentialResponseSchema as M, UpdateOrganizationMemberRequestSchema as Mt, HealthResponseSchema as N, UpdateOrganizationMemberResponseSchema as Nt, CredentialInstanceRecordSchema as O, TriggerRunListResponseSchema as Ot, HistoryRunCancelResponseSchema as P, UpdateOrganizationRequestSchema as Pt, ListProjectsResponseSchema as Q, originFromPublicUrl as Qt, InviteOrganizationMembersRequestSchema as R, UpdateProjectSettingsRequestSchema as Rt, CreateOrganizationRequestSchema as S, StartOAuthConnectionInputSchema as St, CreateProjectRequestSchema as T, TriggerDetailResponseSchema as Tt, ListAppsResponseSchema as U, UserAvatarSchema as Ut, InviteProjectMembersResponseSchema as V, UpsertGatewayAttachmentBodySchema as Vt, ListCredentialsResponseSchema as W, UserPreferencesPatchSchema as Wt, ListProjectMembersResponseSchema as X, listenPortFromPublicUrl as Xt, ListProjectFilesResponseSchema as Y, WorkflowSummaryListResponseSchema as Yt, ListProjectMetricsResponseSchema as Z, normalizeCredentialList as Zt, CreateApiKeyRequestSchema as _, ROUTE_MANIFEST_REL_PATH as _t, AgentSessionListResponseSchema as a, PresignProjectSourceRequestSchema as at, CreateCredentialsRequestSchema as b, SkillSummaryListResponseSchema as bt, BindChannelBodySchema as c, PresignUserAvatarResponseSchema as ct, ChannelConnectionSchema as d, ProjectSettingsResponseSchema as dt, OrganizationSidebarBrandingSchema as et, ChannelDirectoryListResponseSchema as f, ProjectSlugAvailabilityResponseSchema as ft, ConnectProvidersResponseSchema as g, QueuedRunResponseSchema as gt, ConnectAuthorizeUrlResponseSchema as h, QueuedAgentPromptResponseSchema as ht, AgentSessionDetailResponseSchema as i, PresignOrgLogoResponseSchema as it, GatewayAttachmentRecordSchema as j, UpdateCredentialRequestSchema as jt, DeclineOrganizationInvitationResponseSchema as k, UpdateChannelBindingBodySchema as kt, ChannelAccountListResponseSchema as l, ProjectReachabilityResponseSchema as lt, CompleteProjectArtifactResponseSchema as m, PromptResponseSchema as mt, AcceptOrganizationInvitationResponseSchema as n, PollRunResponseSchema as nt, AgentSummaryDetailResponseSchema as o, PresignProjectSourceResponseSchema as ot, ChannelPlatformSchema as p, PromptInputSchema as pt, ListOrganizationsResponseSchema as q, WorkflowRunListResponseSchema as qt, ActiveOrganizationResponseSchema as r, PresignOrgLogoRequestSchema as rt, AgentSummaryListResponseSchema as s, PresignUserAvatarRequestSchema as st, ACTIVE_ORG_HEADER as t, PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS as tt, ChannelConnectionListResponseSchema as u, ProjectResponseSchema as ut, CreateApiKeyResponseSchema as v, RecentResourceListResponseSchema as vt, CreateProjectArtifactResponseSchema as w, SubmitTeamRequestRequestSchema as wt, CreateCredentialsResponseSchema as x, SlugAvailabilityResponseSchema as xt, CreateCredentialInstanceBodySchema as y, SkillSummaryDetailResponseSchema as yt, InviteOrganizationMembersResponseSchema as z, UploadProjectSourceManifestRequestSchema as zt };
2112
-
2113
- //# sourceMappingURL=dist-DtqmE5R_.mjs.map