@keystrokehq/cli 0.0.157 → 0.0.158

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dist-CiolnfBh.mjs","names":["core._coercedNumber","schemas.ZodNumber","z.string","z.object","z.discriminatedUnion","z.literal","z.number","z.record","z.unknown","z.boolean","z.array","z.enum","z.ZodType","z.custom","z.union","z.coerce.number","z.url"],"sources":["../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/coerce.js","../../../packages/shared/dist/index.mjs"],"sourcesContent":["import * as core from \"../core/index.js\";\nimport * as schemas from \"./schemas.js\";\nexport function string(params) {\n return core._coercedString(schemas.ZodString, params);\n}\nexport function number(params) {\n return core._coercedNumber(schemas.ZodNumber, params);\n}\nexport function boolean(params) {\n return core._coercedBoolean(schemas.ZodBoolean, params);\n}\nexport function bigint(params) {\n return core._coercedBigint(schemas.ZodBigInt, params);\n}\nexport function date(params) {\n return core._coercedDate(schemas.ZodDate, params);\n}\n","import { z } from \"zod\";\n//#region src/constants/conventions.ts\n/** File-layout rules shared by agents, workflows, triggers, and OpenAPI `x-keystroke`. */\nconst DISCOVERY_CONVENTIONS = {\n\tagents: {\n\t\tflat: \"{name}.ts → POST /agents/{name}\",\n\t\tnested: \"{path}/agent.ts or {path}/index.ts → POST /agents/{path}\",\n\t\thelpers: \"Other .ts files under nested folders are not mounted.\"\n\t},\n\tworkflows: {\n\t\tflat: \"{name}.ts → POST /workflows/{name}\",\n\t\tnested: \"{path}/workflow.ts or {path}/index.ts → POST /workflows/{path}\",\n\t\thelpers: \"Other .ts files under nested folders are not mounted.\"\n\t},\n\ttriggers: {\n\t\tflat: \"{name}.ts → trigger key {name}, attachment id {triggerKey}:{workflowKey}\",\n\t\tnested: \"{path}/trigger.ts or {path}/index.ts → trigger key {path}\",\n\t\thelpers: \"Reusable sources live under triggers/sources/ and are not discovered.\"\n\t},\n\topenapi: \"GET /openapi.json is built from the same discovery + mount loop as the live server.\"\n};\n//#endregion\n//#region src/constants/http.ts\nconst ACTIVE_ORG_COOKIE = \"keystroke-active-org-id\";\nconst ACTIVE_ORG_HEADER = \"x-keystroke-org-id\";\n//#endregion\n//#region src/organization-slug.ts\n/** Auth, session, and account-entry URL segments. */\nconst AUTH_ACCOUNT_SLUGS = [\n\t\"2fa\",\n\t\"accept-invite\",\n\t\"auth\",\n\t\"authorize\",\n\t\"callback\",\n\t\"callbacks\",\n\t\"confirm-email\",\n\t\"confirmation\",\n\t\"connect\",\n\t\"device\",\n\t\"email-verification\",\n\t\"forgot-password\",\n\t\"invite\",\n\t\"invites\",\n\t\"login\",\n\t\"logout\",\n\t\"magic-link\",\n\t\"mfa\",\n\t\"oauth\",\n\t\"onboarding\",\n\t\"password\",\n\t\"recovery\",\n\t\"register\",\n\t\"reset-password\",\n\t\"saml\",\n\t\"session\",\n\t\"sessions\",\n\t\"sign-in\",\n\t\"sign-up\",\n\t\"signin\",\n\t\"signout\",\n\t\"signup\",\n\t\"sso\",\n\t\"token\",\n\t\"tokens\",\n\t\"unlink\",\n\t\"verify\",\n\t\"verify-email\"\n];\n/** Org, workspace, billing, and account-management URL segments. */\nconst ORG_ACCOUNT_SLUGS = [\n\t\"account\",\n\t\"accounts\",\n\t\"billing\",\n\t\"console\",\n\t\"invoice\",\n\t\"invoices\",\n\t\"member\",\n\t\"members\",\n\t\"me\",\n\t\"org\",\n\t\"organization\",\n\t\"organizations\",\n\t\"orgs\",\n\t\"payment\",\n\t\"payments\",\n\t\"plan\",\n\t\"plans\",\n\t\"portal\",\n\t\"preferences\",\n\t\"profile\",\n\t\"settings\",\n\t\"subscription\",\n\t\"subscriptions\",\n\t\"team\",\n\t\"teams\",\n\t\"upgrade\",\n\t\"usage\",\n\t\"user\",\n\t\"users\",\n\t\"workspace\",\n\t\"workspaces\"\n];\n/** Product surfaces, resource types, and in-app navigation segments. */\nconst PRODUCT_SLUGS = [\n\t\"action\",\n\t\"actions\",\n\t\"activity\",\n\t\"agent\",\n\t\"agents\",\n\t\"analytics\",\n\t\"app\",\n\t\"apps\",\n\t\"artifact\",\n\t\"artifacts\",\n\t\"assistant\",\n\t\"assistants\",\n\t\"audit\",\n\t\"audit-log\",\n\t\"automation\",\n\t\"automations\",\n\t\"branch\",\n\t\"branches\",\n\t\"canvas\",\n\t\"chat\",\n\t\"chats\",\n\t\"connection\",\n\t\"connections\",\n\t\"create\",\n\t\"credential\",\n\t\"credentials\",\n\t\"dashboard\",\n\t\"deployment\",\n\t\"deployments\",\n\t\"examples\",\n\t\"execute\",\n\t\"execution\",\n\t\"executions\",\n\t\"explore\",\n\t\"get-started\",\n\t\"history\",\n\t\"inbox\",\n\t\"inspector\",\n\t\"integration\",\n\t\"integrations\",\n\t\"library\",\n\t\"logs\",\n\t\"marketplace\",\n\t\"mcp\",\n\t\"mcps\",\n\t\"new\",\n\t\"notifications\",\n\t\"observe\",\n\t\"plugin\",\n\t\"plugins\",\n\t\"primitive\",\n\t\"primitives\",\n\t\"project\",\n\t\"projects\",\n\t\"recents\",\n\t\"registry\",\n\t\"reports\",\n\t\"run\",\n\t\"runs\",\n\t\"runtime\",\n\t\"runtimes\",\n\t\"sandbox\",\n\t\"sandboxes\",\n\t\"search\",\n\t\"skill\",\n\t\"skills\",\n\t\"templates\",\n\t\"thread\",\n\t\"threads\",\n\t\"trigger\",\n\t\"triggers\",\n\t\"version\",\n\t\"versions\",\n\t\"workflow\",\n\t\"workflows\"\n];\n/** Marketing, docs, company, and go-to-market URL segments. */\nconst MARKETING_SITE_SLUGS = [\n\t\"about\",\n\t\"affiliates\",\n\t\"ai\",\n\t\"announcements\",\n\t\"anthropic\",\n\t\"blog\",\n\t\"book-demo\",\n\t\"brand\",\n\t\"campaigns\",\n\t\"career\",\n\t\"careers\",\n\t\"case-studies\",\n\t\"casestudies\",\n\t\"changelog\",\n\t\"chatgpt\",\n\t\"chrome-extension\",\n\t\"claude\",\n\t\"codex\",\n\t\"community\",\n\t\"company\",\n\t\"compare\",\n\t\"contact\",\n\t\"contribute\",\n\t\"creators\",\n\t\"customers\",\n\t\"demo\",\n\t\"demos\",\n\t\"discord\",\n\t\"docs\",\n\t\"documentation\",\n\t\"download\",\n\t\"downloads\",\n\t\"dust\",\n\t\"emerging-talent\",\n\t\"engineering-blog\",\n\t\"enterprise\",\n\t\"events\",\n\t\"experts\",\n\t\"extension\",\n\t\"faq\",\n\t\"faqs\",\n\t\"features\",\n\t\"forum\",\n\t\"glean\",\n\t\"grok\",\n\t\"guide\",\n\t\"guides\",\n\t\"gumloop\",\n\t\"handbook\",\n\t\"help\",\n\t\"help-center\",\n\t\"home\",\n\t\"how-it-works\",\n\t\"howitworks\",\n\t\"inspo\",\n\t\"intern\",\n\t\"investors\",\n\t\"jobs\",\n\t\"legal\",\n\t\"lindy\",\n\t\"llm\",\n\t\"llms\",\n\t\"love\",\n\t\"make\",\n\t\"manifesto\",\n\t\"media\",\n\t\"merch\",\n\t\"mission\",\n\t\"mobile\",\n\t\"models\",\n\t\"n8n\",\n\t\"news\",\n\t\"newsroom\",\n\t\"open\",\n\t\"open-claw\",\n\t\"open-source\",\n\t\"openai\",\n\t\"our-story\",\n\t\"overview\",\n\t\"partners\",\n\t\"pi\",\n\t\"pipedream\",\n\t\"platform\",\n\t\"press\",\n\t\"press-kit\",\n\t\"pricing\",\n\t\"privacy\",\n\t\"product\",\n\t\"products\",\n\t\"provider\",\n\t\"providers\",\n\t\"quick-start\",\n\t\"quickstart\",\n\t\"refer\",\n\t\"relay\",\n\t\"relay-app\",\n\t\"reporting\",\n\t\"request-demo\",\n\t\"resources\",\n\t\"roadmap\",\n\t\"schedule-demo\",\n\t\"security\",\n\t\"solutions\",\n\t\"stack-ai\",\n\t\"stackai\",\n\t\"startup\",\n\t\"startups\",\n\t\"status\",\n\t\"stories\",\n\t\"story\",\n\t\"students\",\n\t\"support\",\n\t\"swag\",\n\t\"switch\",\n\t\"talent\",\n\t\"terms\",\n\t\"testimonials\",\n\t\"thesis\",\n\t\"tines\",\n\t\"trust\",\n\t\"tutorials\",\n\t\"university\",\n\t\"use-case\",\n\t\"use-cases\",\n\t\"usecases\",\n\t\"versus\",\n\t\"vellum\",\n\t\"vs\",\n\t\"webinars\",\n\t\"workato\",\n\t\"xai\",\n\t\"yc\",\n\t\"zapier\"\n];\n/** Integrations, competitors, and partner brand slugs (marketing / integration pages). */\nconst INTEGRATION_BRAND_SLUGS = [\n\t\"airtable\",\n\t\"asana\",\n\t\"aws\",\n\t\"azure\",\n\t\"bun\",\n\t\"confluence\",\n\t\"copilot\",\n\t\"cursor\",\n\t\"databricks\",\n\t\"figma\",\n\t\"firebase\",\n\t\"fly\",\n\t\"gcp\",\n\t\"gemini\",\n\t\"github\",\n\t\"gitlab\",\n\t\"gmail\",\n\t\"heroku\",\n\t\"hubspot\",\n\t\"huggingface\",\n\t\"jira\",\n\t\"linear\",\n\t\"mailchimp\",\n\t\"meta\",\n\t\"mistral\",\n\t\"mixmax\",\n\t\"monday\",\n\t\"netlify\",\n\t\"neon\",\n\t\"notion\",\n\t\"npm\",\n\t\"outlook\",\n\t\"outreach\",\n\t\"perplexity\",\n\t\"planetscale\",\n\t\"pnpm\",\n\t\"postmark\",\n\t\"ramp\",\n\t\"railway\",\n\t\"render\",\n\t\"resend\",\n\t\"salesforce\",\n\t\"segment\",\n\t\"sendgrid\",\n\t\"shopify\",\n\t\"slack\",\n\t\"snowflake\",\n\t\"stripe\",\n\t\"supabase\",\n\t\"terraform\",\n\t\"trello\",\n\t\"turso\",\n\t\"twilio\",\n\t\"typeform\",\n\t\"vercel\",\n\t\"vscode\",\n\t\"windsurf\",\n\t\"yarn\"\n];\n/** Company, team, and department landing-page segments. */\nconst COMPANY_TEAM_SLUGS = [\n\t\"engineers\",\n\t\"engineering\",\n\t\"executives\",\n\t\"hc\",\n\t\"intern\",\n\t\"it\",\n\t\"leadership\",\n\t\"marketing\",\n\t\"ops\",\n\t\"revops\",\n\t\"sales\",\n\t\"services\",\n\t\"tech\"\n];\n/** Legal, trust, compliance, and policy URL segments. */\nconst LEGAL_TRUST_SLUGS = [\n\t\"accessibility\",\n\t\"agreement\",\n\t\"a11y\",\n\t\"bug-bounty\",\n\t\"compliance\",\n\t\"cookie-policy\",\n\t\"cookies\",\n\t\"disclose\",\n\t\"dpa\",\n\t\"eula\",\n\t\"gdpr\",\n\t\"hipaa\",\n\t\"iso\",\n\t\"msa\",\n\t\"pci\",\n\t\"responsible-disclosure\",\n\t\"sla\",\n\t\"soc2\",\n\t\"tos\",\n\t\"trust-center\",\n\t\"trustcenter\",\n\t\"vulnerability\"\n];\n/** Developer, API, CLI, and technical URL segments. */\nconst DEVELOPER_TECH_SLUGS = [\n\t\"api\",\n\t\"api-docs\",\n\t\"cli\",\n\t\"code\",\n\t\"config\",\n\t\"developer\",\n\t\"developer-tools\",\n\t\"developers\",\n\t\"dev-tools\",\n\t\"devtools\",\n\t\"dev\",\n\t\"dev-states\",\n\t\"graphql\",\n\t\"graphql-playground\",\n\t\"mcp-server\",\n\t\"mcp-servers\",\n\t\"openapi\",\n\t\"sdk\",\n\t\"swagger\"\n];\n/** Infra, ops, static assets, and system URL segments. */\nconst INFRA_SYSTEM_SLUGS = [\n\t\"acme-challenge\",\n\t\"admin\",\n\t\"apple-app-site-association\",\n\t\"assets\",\n\t\"batch\",\n\t\"cache\",\n\t\"cdn\",\n\t\"cron\",\n\t\"debug\",\n\t\"error\",\n\t\"errors\",\n\t\"favicon\",\n\t\"feed\",\n\t\"files\",\n\t\"health\",\n\t\"healthcheck\",\n\t\"healthz\",\n\t\"hooks\",\n\t\"internal\",\n\t\"item\",\n\t\"manifest\",\n\t\"metrics\",\n\t\"null\",\n\t\"ping\",\n\t\"prod\",\n\t\"public\",\n\t\"redirect\",\n\t\"robots\",\n\t\"rpc\",\n\t\"rss\",\n\t\"sharer\",\n\t\"sitemap\",\n\t\"staging\",\n\t\"static\",\n\t\"storage\",\n\t\"test\",\n\t\"undefined\",\n\t\"universal\",\n\t\"webhooks\",\n\t\"well-known\",\n\t\"www\"\n];\n/** Reserved slugs that are valid org names in theory but blocked for routing safety. */\nconst ROUTING_SAFETY_SLUGS = [\n\t\"alpha\",\n\t\"anonymous\",\n\t\"archive\",\n\t\"archived\",\n\t\"beta\",\n\t\"clone\",\n\t\"copy\",\n\t\"default\",\n\t\"deleted\",\n\t\"demo-org\",\n\t\"draft\",\n\t\"drafts\",\n\t\"duplicate\",\n\t\"early-access\",\n\t\"embed\",\n\t\"embedded\",\n\t\"export\",\n\t\"fork\",\n\t\"free\",\n\t\"guest\",\n\t\"import\",\n\t\"index\",\n\t\"list\",\n\t\"manage\",\n\t\"moderator\",\n\t\"newsletter\",\n\t\"owner\",\n\t\"preview\",\n\t\"previews\",\n\t\"private\",\n\t\"pro\",\n\t\"public-api\",\n\t\"publish\",\n\t\"published\",\n\t\"queue\",\n\t\"remove\",\n\t\"root\",\n\t\"sample\",\n\t\"samples\",\n\t\"selection\",\n\t\"share\",\n\t\"shared\",\n\t\"sponsor\",\n\t\"sponsors\",\n\t\"sponsorship\",\n\t\"subscribe\",\n\t\"super\",\n\t\"superuser\",\n\t\"system\",\n\t\"sys\",\n\t\"test-org\",\n\t\"trash\",\n\t\"unpublish\",\n\t\"unsubscribe\",\n\t\"upload\",\n\t\"uploads\",\n\t\"waitlist\",\n\t\"widget\",\n\t\"widgets\",\n\t\"worker\",\n\t\"workers\"\n];\n/**\n* URL segments reserved for global (non-org) routes — cannot be used as an org slug.\n* Prefer adding new entries to the category arrays above; the Set is the enforcement surface.\n*/\nconst RESERVED_ORGANIZATION_SLUGS = new Set([\n\t...AUTH_ACCOUNT_SLUGS,\n\t...ORG_ACCOUNT_SLUGS,\n\t...PRODUCT_SLUGS,\n\t...MARKETING_SITE_SLUGS,\n\t...INTEGRATION_BRAND_SLUGS,\n\t...COMPANY_TEAM_SLUGS,\n\t...LEGAL_TRUST_SLUGS,\n\t...DEVELOPER_TECH_SLUGS,\n\t...INFRA_SYSTEM_SLUGS,\n\t...ROUTING_SAFETY_SLUGS\n]);\n/**\n* Base slug format: lowercase, 2-64 chars, alphanumeric + dashes.\n*\n* IMPORTANT: this is the schema for *reading* slugs (persisted rows, API\n* responses). It intentionally does NOT enforce the reserved-name list — an org\n* created before a name became reserved must still parse on read. Use\n* `ClaimableOrganizationSlugSchema` to validate slugs a user is trying to claim.\n*/\nconst OrganizationSlugSchema = z.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\");\n/**\n* Slug validation for *claiming* a slug (organization create/rename). Adds the\n* reserved-name check on top of the base format. Never use this to parse\n* existing org data, or pre-existing orgs whose slug later became reserved would\n* fail to load.\n*/\nconst ClaimableOrganizationSlugSchema = OrganizationSlugSchema.refine((slug) => !RESERVED_ORGANIZATION_SLUGS.has(slug), \"This slug is reserved\");\nconst ORGANIZATION_NAME_APOSTROPHE_PATTERN = /[''\\u2018\\u2019]/g;\n/** Normalize a display name into slug-shaped text (may be empty or too short to claim). */\nfunction normalizeOrganizationNameToSlugBase(name) {\n\treturn name.trim().toLowerCase().replace(ORGANIZATION_NAME_APOSTROPHE_PATTERN, \"\").replace(/[^a-z0-9]+/g, \"-\").replace(/-+/g, \"-\").replace(/^-|-$/g, \"\");\n}\n/**\n* Live slug preview while typing an org name. Returns normalized text only —\n* no server-side `\"org\"` fallback when the preview is empty or under min length.\n*/\nfunction previewOrganizationSlugFromName(name) {\n\treturn normalizeOrganizationNameToSlugBase(name);\n}\n/** Derive a URL slug from a display name (not guaranteed unique). */\nfunction slugifyOrganizationName(name) {\n\tconst base = normalizeOrganizationNameToSlugBase(name);\n\tif (!base) return \"org\";\n\tconst parsed = OrganizationSlugSchema.safeParse(base);\n\treturn parsed.success ? parsed.data : \"org\";\n}\nfunction parseOrganizationSlug(input) {\n\treturn OrganizationSlugSchema.parse(input);\n}\n//#endregion\n//#region src/project-slug.ts\n/** Same format as organization slugs — org-scoped, no global reserved list. */\nconst ProjectSlugSchema = OrganizationSlugSchema;\n/** Derive a URL slug from a project display name (not guaranteed unique within the org). */\nfunction slugifyProjectName(name) {\n\tconst base = normalizeOrganizationNameToSlugBase(name);\n\tif (!base) return \"project\";\n\tconst parsed = ProjectSlugSchema.safeParse(base);\n\treturn parsed.success ? parsed.data : \"project\";\n}\nfunction parseProjectSlug(input) {\n\treturn ProjectSlugSchema.parse(input);\n}\n//#endregion\n//#region src/constants/projects.ts\n/** Platform wait for project /health before declaring unreachable. */\nconst PROJECT_PING_TIMEOUT_MS = 15e3;\n/** Browser→platform request budget (ping + small platform overhead). */\nconst PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS = 17e3;\n/** Pause between reachability checks after the previous check finishes. */\nconst PROJECT_REACHABILITY_RETRY_MS = 5e3;\n//#endregion\n//#region src/public-url.ts\n/** Normalize a public origin URL (no trailing slash). */\nfunction originFromPublicUrl(value, fallback) {\n\tconst trimmed = value?.trim();\n\tif (!trimmed) return fallback.replace(/\\/+$/, \"\");\n\treturn trimmed.replace(/\\/+$/, \"\");\n}\n/** TCP port to bind for a local server, derived from a public URL. */\nfunction listenPortFromUrl(url, fallback) {\n\tconst parsed = new URL(url);\n\tif (parsed.port) {\n\t\tconst port = Number(parsed.port);\n\t\tif (Number.isFinite(port) && port > 0) return port;\n\t}\n\tif (parsed.protocol === \"https:\") return 443;\n\tif (parsed.protocol === \"http:\") return 80;\n\treturn fallback;\n}\n/** Shorthand: listen port from `PUBLIC_*_URL` or fallback. */\nfunction listenPortFromPublicUrl(value, fallback) {\n\tconst trimmed = value?.trim();\n\tif (!trimmed) return fallback;\n\ttry {\n\t\treturn listenPortFromUrl(trimmed, fallback);\n\t} catch {\n\t\treturn fallback;\n\t}\n}\n//#endregion\n//#region src/tool-parameters.ts\n/** JSON Schema draft 2020-12 for LLM tool inputs (not OpenAPI 3.0). */\nfunction toolParameters(schema) {\n\treturn z.toJSONSchema(schema, { target: \"draft-2020-12\" });\n}\n//#endregion\n//#region src/constants/route-manifest.ts\n/** On-disk path under the project root (packed in deploy artifacts when present). */\nconst ROUTE_MANIFEST_REL_PATH = \"dist/.keystroke/route-manifest.json\";\n/** HTTP route served by the project server after bootstrap. */\nconst ROUTE_MANIFEST_HTTP_PATH = \"/.keystroke/route-manifest\";\n//#endregion\n//#region src/schemas/route-manifest.ts\nconst StoredRouteManifestSkillSchema = z.object({\n\tslug: z.string(),\n\tname: z.string().optional(),\n\tdescription: z.string().optional(),\n\tmoduleFile: z.string()\n});\nconst serializedRouteManifestEntrySchema = z.discriminatedUnion(\"kind\", [\n\tz.object({\n\t\tkind: z.literal(\"health\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.literal(\"/health\")\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"agent\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tagentSlug: z.string(),\n\t\tmoduleFile: z.string(),\n\t\tname: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tmodel: z.string(),\n\t\tsystemPrompt: z.string(),\n\t\ttoolCount: z.number().int().nonnegative(),\n\t\tcredentialCount: z.number().int().nonnegative(),\n\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"agent-sessions-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tagentSlug: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"agent-session-detail\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tagentSlug: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"workflow\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tworkflowSlug: z.string(),\n\t\tworkflowName: z.string().optional(),\n\t\tdescription: z.string().optional(),\n\t\tsubscribable: z.boolean(),\n\t\tmoduleFile: z.string(),\n\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"workflow-runs-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tworkflowSlug: z.string(),\n\t\tworkflowName: z.string().optional(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"workflow-run-detail\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tworkflowSlug: z.string(),\n\t\tworkflowName: z.string().optional(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-webhook\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tattachmentIds: z.array(z.string()),\n\t\tmoduleFile: z.string(),\n\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\tattachmentSchemas: z.record(z.string(), z.object({\n\t\t\trequestSchema: z.record(z.string(), z.unknown()),\n\t\t\tfilterSchema: z.record(z.string(), z.unknown()).optional()\n\t\t})),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-poll\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string(),\n\t\tschedule: z.string(),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-poll-group\"),\n\t\tmethod: z.literal(\"POST\"),\n\t\tpath: z.string(),\n\t\tpollId: z.string(),\n\t\tattachmentIds: z.array(z.string()),\n\t\tmoduleFile: z.string(),\n\t\tschedule: z.string(),\n\t\tresponseSchema: z.record(z.string(), z.unknown())\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-runs-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"trigger-run-detail\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"cron-schedule\"),\n\t\tattachmentId: z.string(),\n\t\tmoduleFile: z.string(),\n\t\tschedule: z.string()\n\t}),\n\tz.object({\n\t\tkind: z.literal(\"plugin\"),\n\t\tmethod: z.enum([\n\t\t\t\"GET\",\n\t\t\t\"POST\",\n\t\t\t\"PUT\",\n\t\t\t\"PATCH\",\n\t\t\t\"DELETE\"\n\t\t]),\n\t\tpath: z.string(),\n\t\tplugin: z.string()\n\t})\n]);\nconst StoredRouteManifestSchema = z.object({\n\tversion: z.literal(1),\n\tentries: z.array(serializedRouteManifestEntrySchema),\n\tskills: z.array(StoredRouteManifestSkillSchema).default([]),\n\tintegrations: z.array(z.string()).optional()\n});\nfunction parseStoredRouteManifest(value) {\n\treturn StoredRouteManifestSchema.parse(value);\n}\n//#endregion\n//#region src/schemas/channels.ts\n/** Messaging platforms that support agent gateway bindings. */\nconst ChannelPlatformKeySchema = z.enum([\"slack\"]);\nconst ChannelReactionSupportSchema = z.enum([\n\t\"full\",\n\t\"read-only\",\n\t\"none\"\n]);\nconst ChannelCardSupportSchema = z.enum([\n\t\"full\",\n\t\"partial\",\n\t\"none\"\n]);\nconst ChannelStreamingSupportSchema = z.enum([\n\t\"native\",\n\t\"post-edit\",\n\t\"buffered\",\n\t\"drafts\",\n\t\"none\"\n]);\nconst ChannelCapabilitiesSchema = z.object({\n\tmentions: z.boolean(),\n\treactions: ChannelReactionSupportSchema,\n\tcards: ChannelCardSupportSchema,\n\tmodals: z.boolean(),\n\tstreaming: ChannelStreamingSupportSchema,\n\tdms: z.boolean()\n});\nconst ChannelListenModeSchema = z.enum([\n\t\"mention\",\n\t\"all\",\n\t\"dm\"\n]);\nconst ChannelBindingKindSchema = z.enum([\n\t\"public\",\n\t\"private\",\n\t\"dm\",\n\t\"group\",\n\t\"space\"\n]);\nconst AppGatewaySchema = z.object({\n\tcapabilities: ChannelCapabilitiesSchema,\n\tsupportedModes: z.array(ChannelListenModeSchema).min(1),\n\tresourceNoun: z.object({\n\t\tsingular: z.string().min(1),\n\t\tplural: z.string().min(1)\n\t}),\n\tsupportsChannelDirectory: z.boolean(),\n\twebhookPathHint: z.string().min(1),\n\tdocsUrl: z.string().url().optional(),\n\ttagline: z.string().min(1).optional()\n});\n/** Projected catalog row for the agent channels panel (derived from apps with `gateway`). */\nconst ChannelPlatformSchema = z.object({\n\tkey: ChannelPlatformKeySchema,\n\tname: z.string().min(1),\n\tappLogoId: z.string().min(1),\n\tfallbackDomain: z.string().min(1),\n\tdescription: z.string().min(1),\n\ttagline: z.string().min(1),\n\tauthKind: z.enum([\"oauth\", \"api_key\"]),\n\tcredentialFields: z.array(z.object({\n\t\tkey: z.string().min(1),\n\t\tlabel: z.string().min(1),\n\t\tplaceholder: z.string().optional(),\n\t\thelpText: z.string().optional(),\n\t\ttype: z.enum([\n\t\t\t\"text\",\n\t\t\t\"password\",\n\t\t\t\"textarea\"\n\t\t]),\n\t\trequired: z.boolean(),\n\t\tprefix: z.string().optional()\n\t})),\n\tcapabilities: ChannelCapabilitiesSchema,\n\tsupportedModes: z.array(ChannelListenModeSchema).min(1),\n\tresourceNoun: z.object({\n\t\tsingular: z.string().min(1),\n\t\tplural: z.string().min(1)\n\t}),\n\twebhookPathHint: z.string().min(1),\n\tsupportsChannelDirectory: z.boolean(),\n\tdocsUrl: z.string().url().optional()\n});\nconst ChannelBindingSchema = z.object({\n\tid: z.string().min(1),\n\tchannelId: z.string().min(1),\n\tchannelName: z.string().min(1),\n\tchannelKind: ChannelBindingKindSchema,\n\tmode: ChannelListenModeSchema,\n\tsubscribeOnMention: z.boolean(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string()\n});\nconst ChannelConnectionSchema = z.object({\n\tid: z.string().min(1),\n\tplatform: ChannelPlatformKeySchema,\n\tagentId: z.string().min(1),\n\taccountLabel: z.string().min(1),\n\taccountId: z.string().min(1),\n\tconnectedAt: z.string(),\n\tbindings: z.array(ChannelBindingSchema)\n});\nconst ChannelDirectoryEntrySchema = z.object({\n\tid: z.string().min(1),\n\tname: z.string().min(1),\n\tkind: ChannelBindingKindSchema,\n\tmemberCount: z.number().int().nonnegative().optional(),\n\tisArchived: z.boolean().optional()\n});\nconst ChannelConnectionListResponseSchema = z.object({ connections: z.array(ChannelConnectionSchema) });\nconst ChannelDirectoryListResponseSchema = z.object({ channels: z.array(ChannelDirectoryEntrySchema) });\n/** Channel-relevant fields parsed from an OAuth connection's metadata blob. */\nconst ChannelAccountMetadataSchema = z.object({ teamName: z.string().min(1).optional() });\n/** OAuth workspace available for channel bindings (e.g. Slack team). */\nconst ChannelAccountSchema = z.object({\n\tid: z.string().min(1),\n\tplatform: ChannelPlatformKeySchema,\n\tlabel: z.string().min(1),\n\tconnectedAt: z.string()\n});\nconst ChannelAccountListResponseSchema = z.object({ accounts: z.array(ChannelAccountSchema) });\nconst NewChannelBindingInputSchema = z.object({\n\tchannelId: z.string().min(1),\n\tchannelName: z.string().min(1),\n\tchannelKind: ChannelBindingKindSchema.optional(),\n\tmode: ChannelListenModeSchema.optional(),\n\tsubscribeOnMention: z.boolean().optional()\n});\nconst BindChannelBodySchema = z.object({\n\tplatform: ChannelPlatformKeySchema,\n\taccountId: z.string().min(1),\n\tbinding: NewChannelBindingInputSchema\n});\nconst UpdateChannelBindingBodySchema = z.object({ patch: z.object({\n\tmode: ChannelListenModeSchema.optional(),\n\tsubscribeOnMention: z.boolean().optional()\n}) });\n//#endregion\n//#region src/schemas/apps.ts\n/** A single OAuth scope an app can request, with human copy for connect UI. */\nconst OAuthScopeOptionSchema = z.object({\n\tname: z.string().min(1),\n\tdescription: z.string().min(1),\n\tdefaultSelected: z.boolean().optional(),\n\trequired: z.boolean().optional()\n});\n/** How an app authenticates when connecting credentials. */\nconst AppAuthKindSchema = z.enum([\"oauth\", \"api_key\"]);\n/**\n* A connectable integration shown in the \"Connect an app\" picker. An \"app\" is\n* an integration / credential set — connected state is whether a credential exists.\n*/\nconst AppCatalogEntrySchema = z.object({\n\tid: z.string().min(1),\n\tname: z.string().min(1),\n\tdescription: z.string().min(1),\n\tcategory: z.string().min(1),\n\tintegrationDescription: z.string().min(1),\n\tauthKind: AppAuthKindSchema,\n\toauthScopes: z.array(OAuthScopeOptionSchema),\n\t/** When present, the app supports agent gateway bindings (external channels). */\n\tgateway: AppGatewaySchema.optional()\n});\nconst ListAppsResponseSchema = z.object({ apps: z.array(AppCatalogEntrySchema) });\n//#endregion\n//#region src/schemas/credentials.ts\n/** How a credential instance is stored (`credential_instances.auth_kind`). */\nconst CredentialAuthKindSchema = z.enum([\"api_key\", \"oauth_managed\"]);\n/** Where a credential instance is stored (`credential_instances.scope_type`). */\nconst CredentialScopeTypeSchema = z.enum([\n\t\"global\",\n\t\"organization\",\n\t\"project\",\n\t\"user\"\n]);\n/**\n* Resolution chain step when an action/tool looks up credentials.\n* `selection` uses explicit instance ids; other levels map to {@link CredentialScopeType}.\n*/\nconst CredentialScopeLevelSchema = z.enum([\n\t\"selection\",\n\t\"organization\",\n\t\"project\",\n\t\"user\"\n]);\nconst CREDENTIAL_AUTH_KINDS = CredentialAuthKindSchema.options;\nconst CREDENTIAL_SCOPE_TYPES = CredentialScopeTypeSchema.options;\nconst CREDENTIAL_SCOPE_LEVELS = CredentialScopeLevelSchema.options;\n/** Default chain when `credential.static(...).scope()` is called with no args. */\nconst DEFAULT_CREDENTIAL_RESOLUTION_CHAIN = [\"organization\", \"project\"];\nconst CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE = {\n\torganization: \"organization\",\n\tproject: \"project\",\n\tuser: \"user\"\n};\n//#endregion\n//#region src/schemas/app-credentials.ts\n/** Scope of a platform app credential (maps to `credential_instances.scope_type`). */\nconst AppCredentialScopeSchema = z.enum([\n\t\"user\",\n\t\"project\",\n\t\"organization\"\n]);\n/** How the credential was connected (OAuth vs manual api-key entry). */\nconst AppCredentialConnectionKindSchema = z.enum([\"oauth\", \"manual\"]);\n/** Connect-dialog permission preset for OAuth scope selection. */\nconst OAuthPermissionModeSchema = z.enum([\"default\", \"restricted\"]);\nconst optionalTimestamp$1 = z.string().optional();\nconst nullableOptionalTimestamp = z.string().nullable().optional();\n/**\n* Summary row for the apps/credentials table and credential detail page.\n* Plaintext secrets are never returned — only masked `keyPreviews`.\n*/\nconst AppCredentialSummarySchema = z.object({\n\tid: z.string().min(1),\n\tappId: z.string().min(1),\n\tlabel: z.string().min(1),\n\tscope: AppCredentialScopeSchema,\n\tlastRefreshedAt: z.string().nullable(),\n\tappName: z.string().min(1).optional(),\n\tprojectId: z.string().min(1).optional(),\n\tprojectName: z.string().min(1).optional(),\n\tstatus: z.string().optional(),\n\tcreatedAt: optionalTimestamp$1,\n\tlastUsedAt: nullableOptionalTimestamp,\n\tisDefault: z.boolean().optional(),\n\tconnectionKind: AppCredentialConnectionKindSchema.optional(),\n\townerUserId: z.string().min(1).optional(),\n\townerName: z.string().min(1).optional(),\n\townerAvatarUrl: z.string().url().optional(),\n\tgrantedScopes: z.array(z.string().min(1)).optional(),\n\tcredentialKeys: z.array(z.string().min(1)).optional(),\n\tkeyPreviews: z.record(z.string(), z.string()).optional(),\n\texpiresAt: optionalTimestamp$1\n});\nconst credentialSecretValueSchema = z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: \"value must be a non-empty object\" });\nfunction hasCredentialTarget(input) {\n\treturn input.projects.length > 0 || input.createOrganizationCredential || input.createUserProvidedCredential;\n}\nfunction addMissingCredentialTargetIssue(ctx, path = [\"projects\"]) {\n\tctx.addIssue({\n\t\tcode: \"custom\",\n\t\tmessage: \"At least one credential target is required\",\n\t\tpath\n\t});\n}\n/** Target fields shared by create and OAuth start flows. */\nconst CredentialTargetsFieldsSchema = z.object({\n\tprojects: z.array(z.string().min(1)).default([]),\n\tcreateOrganizationCredential: z.boolean().default(false),\n\tcreateUserProvidedCredential: z.boolean().default(false)\n});\n/** Input for starting an OAuth connection (connect dialog / CLI connect). */\nconst StartOAuthConnectionInputSchema = CredentialTargetsFieldsSchema.extend({\n\tappId: z.string().min(1),\n\tscopes: z.array(z.string().min(1)),\n\tpermissionMode: OAuthPermissionModeSchema\n});\n/** Result of starting an OAuth connection. */\nconst StartOAuthConnectionResultSchema = z.object({\n\tstatus: z.enum([\"connected\", \"redirecting\"]),\n\tauthorizeUrl: z.string().url().nullable()\n});\n/** Request body for `POST /api/credentials` (manual api-key fan-out). */\nconst CreateCredentialsRequestSchema = CredentialTargetsFieldsSchema.extend({\n\tappId: z.string().min(1),\n\tconnectionKind: AppCredentialConnectionKindSchema,\n\tvalue: credentialSecretValueSchema.optional(),\n\tscopes: z.array(z.string().min(1)).optional()\n}).superRefine((input, ctx) => {\n\tif (!hasCredentialTarget(input)) addMissingCredentialTargetIssue(ctx);\n\tif (input.connectionKind === \"manual\" && !input.value) ctx.addIssue({\n\t\tcode: \"custom\",\n\t\tmessage: \"value is required for manual connections\",\n\t\tpath: [\"value\"]\n\t});\n\tif (input.connectionKind === \"oauth\") ctx.addIssue({\n\t\tcode: \"custom\",\n\t\tmessage: \"OAuth credentials are created via the OAuth callback\",\n\t\tpath: [\"connectionKind\"]\n\t});\n});\n/** Request body for `PATCH /api/credentials/:id`. */\nconst UpdateCredentialRequestSchema = z.object({\n\tlabel: z.string().trim().min(1).optional(),\n\tisDefault: z.boolean().optional(),\n\tvalue: credentialSecretValueSchema.optional()\n}).refine((input) => input.label !== void 0 || input.isDefault !== void 0 || input.value !== void 0, { message: \"At least one field is required\" });\nconst ListCredentialsResponseSchema = z.object({ credentials: z.array(AppCredentialSummarySchema) });\nconst GetCredentialResponseSchema = z.object({ credential: AppCredentialSummarySchema });\nconst CreateCredentialsResponseSchema = z.object({ credentials: z.array(AppCredentialSummarySchema) });\n//#endregion\n//#region src/schemas/team-requests.ts\nconst TeamRequestTypeSchema = z.enum([\n\t\"org-deletion\",\n\t\"contact\",\n\t\"enterprise-upgrade\"\n]);\nconst SubmitTeamRequestRequestSchema = z.object({\n\ttype: TeamRequestTypeSchema,\n\tmessage: z.string().trim().max(5e3).optional()\n});\nconst SubmitTeamRequestResponseSchema = z.object({ ok: z.literal(true) });\n//#endregion\n//#region src/schemas/credential-spec.ts\nfunction isCredentialInput(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = value;\n\treturn typeof candidate.key === \"string\" && CredentialAuthKindSchema.safeParse(candidate.kind).success && candidate.schema instanceof z.ZodType;\n}\nconst credentialInputSchema = z.custom((value) => isCredentialInput(value), \"must be a credential requirement\");\nfunction createRef(kind, key, schema, options) {\n\tconst tokenField = options?.tokenField;\n\treturn {\n\t\tkind,\n\t\tkey,\n\t\tschema,\n\t\t...tokenField !== void 0 ? { tokenField } : {},\n\t\tscope(...chain) {\n\t\t\treturn {\n\t\t\t\tkey,\n\t\t\t\tkind,\n\t\t\t\tschema,\n\t\t\t\tchain: chain.length > 0 ? chain : DEFAULT_CREDENTIAL_RESOLUTION_CHAIN,\n\t\t\t\t...tokenField !== void 0 ? { tokenField } : {}\n\t\t\t};\n\t\t}\n\t};\n}\nfunction staticCredential(key, schema) {\n\treturn createRef(\"api_key\", key, schema instanceof z.ZodType ? schema : z.object(schema));\n}\nfunction oauthCredential(key, options) {\n\tconst tokenField = options?.tokenField ?? \"accessToken\";\n\treturn createRef(\"oauth_managed\", key, tokenField === \"accessToken\" ? z.object({ accessToken: z.string() }) : z.object({ [tokenField]: z.string() }), { tokenField });\n}\nconst credential = {\n\tstatic: staticCredential,\n\toauth: oauthCredential\n};\nfunction defineCredential(input) {\n\tif (input.kind === \"oauth\") return input.tokenField !== void 0 ? credential.oauth(input.key, { tokenField: input.tokenField }) : credential.oauth(input.key);\n\tif (\"schema\" in input) return credential.static(input.key, input.schema);\n\treturn credential.static(input.key, input.fields);\n}\nfunction normalizeCredentialList(list) {\n\treturn list.map((item) => toCredentialRequirement(item));\n}\nfunction isCredentialRequirement(item) {\n\treturn \"chain\" in item;\n}\nfunction toCredentialRequirement(item) {\n\tif (isCredentialRequirement(item)) return item;\n\treturn {\n\t\tkey: item.key,\n\t\tkind: item.kind,\n\t\tschema: item.schema,\n\t\tchain: DEFAULT_CREDENTIAL_RESOLUTION_CHAIN,\n\t\t...item.tokenField !== void 0 ? { tokenField: item.tokenField } : {}\n\t};\n}\n//#endregion\n//#region src/schemas/organizations.ts\n/** Canonical copy for slug collision errors (API + UI). */\nconst ORGANIZATION_SLUG_TAKEN_MESSAGE = \"That slug is already taken.\";\nconst PROJECT_SLUG_TAKEN_MESSAGE = \"That slug is already taken.\";\nconst OrganizationSlugErrorCodeSchema = z.enum([\n\t\"slug_taken\",\n\t\"slug_reserved\",\n\t\"slug_invalid\"\n]);\nconst SlugAvailabilityReasonSchema = z.enum([\n\t\"taken\",\n\t\"reserved\",\n\t\"invalid\"\n]);\nconst SlugAvailabilityResponseSchema = z.object({\n\tslug: z.string(),\n\tavailable: z.boolean(),\n\treason: SlugAvailabilityReasonSchema.optional(),\n\tsuggestion: OrganizationSlugSchema.optional()\n});\nconst SlugAvailabilityQuerySchema = z.object({\n\tslug: z.string().trim().min(1),\n\texcludeOrganizationId: z.string().min(1).optional()\n});\nconst ProjectSlugAvailabilityReasonSchema = z.enum([\"taken\", \"invalid\"]);\nconst ProjectSlugAvailabilityResponseSchema = z.object({\n\tslug: z.string(),\n\tavailable: z.boolean(),\n\treason: ProjectSlugAvailabilityReasonSchema.optional(),\n\tsuggestion: ProjectSlugSchema.optional()\n});\nconst ProjectSlugAvailabilityQuerySchema = z.object({\n\tslug: z.string().trim().min(1),\n\texcludeProjectId: z.string().min(1).optional()\n});\n/** Client-side instant validation before hitting the project slug availability endpoint. */\nfunction validateProjectSlug(slug) {\n\tconst normalized = slug.trim().toLowerCase();\n\tif (!normalized) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: \"Slug is required\"\n\t};\n\tconst parsed = ProjectSlugSchema.safeParse(normalized);\n\tif (!parsed.success) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: parsed.error.issues[0]?.message ?? \"Invalid slug\"\n\t};\n\treturn { valid: true };\n}\n/** Client-side instant validation before hitting the availability endpoint. */\nfunction validateClaimableOrganizationSlug(slug) {\n\tconst normalized = slug.trim().toLowerCase();\n\tif (!normalized) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: \"Slug is required\"\n\t};\n\tconst format = OrganizationSlugSchema.safeParse(normalized);\n\tif (!format.success) return {\n\t\tvalid: false,\n\t\treason: \"invalid\",\n\t\tmessage: format.error.issues[0]?.message ?? \"Invalid slug\"\n\t};\n\tif (RESERVED_ORGANIZATION_SLUGS.has(format.data)) return {\n\t\tvalid: false,\n\t\treason: \"reserved\",\n\t\tmessage: \"This slug is reserved\"\n\t};\n\treturn { valid: true };\n}\nfunction organizationSlugErrorCodeFromMessage(message) {\n\tif (message === \"That slug is already taken.\" || /already taken/i.test(message)) return \"slug_taken\";\n\tif (/reserved/i.test(message)) return \"slug_reserved\";\n\treturn \"slug_invalid\";\n}\nconst ProjectStatusSchema = z.enum([\n\t\"inactive\",\n\t\"starting\",\n\t\"active\",\n\t\"failed\"\n]);\nconst OrganizationUserRoleSchema = z.enum([\n\t\"owner\",\n\t\"admin\",\n\t\"builder\"\n]);\nconst isoDateTime$5 = z.string().datetime();\nconst OrganizationSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tslug: OrganizationSlugSchema,\n\tcreatedAt: isoDateTime$5,\n\tupdatedAt: isoDateTime$5\n});\nconst ProjectSchema = z.object({\n\tid: z.string(),\n\torganizationId: z.string(),\n\tname: z.string(),\n\tslug: ProjectSlugSchema,\n\tdescription: z.string().nullable(),\n\tstatus: ProjectStatusSchema,\n\tbaseUrl: z.string().nullable(),\n\truntimeId: z.string().nullable(),\n\tlastError: z.string().nullable(),\n\tcreatedAt: isoDateTime$5,\n\tupdatedAt: isoDateTime$5\n});\nconst UserOrganizationSchema = z.object({\n\torganization: OrganizationSchema,\n\trole: OrganizationUserRoleSchema\n});\nconst CurrentOrganizationResponseSchema = z.object({ organization: UserOrganizationSchema.nullable() });\nconst ActiveOrganizationResponseSchema = CurrentOrganizationResponseSchema;\nconst ListOrganizationsResponseSchema = z.object({ organizations: z.array(UserOrganizationSchema) });\nconst CreateOrganizationRequestSchema = z.object({\n\tname: z.string().trim().min(1),\n\t/** Format-only at the wire boundary; reserved-name checks run in platform-database. */\n\tslug: OrganizationSlugSchema.optional()\n});\nconst UpdateOrganizationRequestSchema = z.object({\n\tname: z.string().trim().min(1).optional(),\n\tslug: ClaimableOrganizationSlugSchema.optional()\n}).refine((data) => data.name !== void 0 || data.slug !== void 0, { message: \"At least one field is required\" });\nconst CreateOrganizationResponseSchema = z.object({ organization: UserOrganizationSchema });\nconst ListProjectsResponseSchema = z.object({ projects: z.array(ProjectSchema) });\nconst ProjectListMetricsSchema = z.object({\n\tagentCount: z.number(),\n\tworkflowCount: z.number(),\n\tskillCount: z.number(),\n\tcredentialCount: z.number(),\n\tlastDeploymentAt: isoDateTime$5.nullable()\n});\nconst ListProjectMetricsResponseSchema = z.object({ metrics: z.record(z.string(), ProjectListMetricsSchema) });\nconst CreateProjectRequestSchema = z.object({\n\tname: z.string().trim().min(1),\n\tdescription: z.string().trim().min(1).optional()\n});\nconst UpdateProjectRequestSchema = z.object({\n\tname: z.string().trim().min(1).optional(),\n\tdescription: z.string().trim().optional(),\n\tslug: ProjectSlugSchema.optional()\n}).refine((data) => data.name !== void 0 || data.description !== void 0 || data.slug !== void 0, { message: \"At least one field is required\" });\nconst CreateProjectResponseSchema = z.object({ project: ProjectSchema });\nconst ProjectResponseSchema = z.object({ project: ProjectSchema });\nconst ProjectReachabilityResponseSchema = z.object({ reachable: z.boolean() });\nfunction parseCreateOrganizationRequest(input) {\n\treturn CreateOrganizationRequestSchema.parse(input);\n}\n//#endregion\n//#region src/schemas/errors/schema.ts\nconst ValidationErrorDetailSchema = z.object({\n\tpath: z.string(),\n\tmessage: z.string()\n});\n/** Machine-readable codes returned in standard API error bodies. */\nconst ErrorResponseCodeSchema = OrganizationSlugErrorCodeSchema.or(z.enum([\"needs_org_selection\"]));\n/** Standard JSON error body returned by the HTTP API. */\nconst ErrorResponseSchema = z.object({\n\terror: z.string(),\n\tcode: ErrorResponseCodeSchema.optional(),\n\tmessage: z.string().optional(),\n\tdetails: z.array(ValidationErrorDetailSchema).optional()\n});\n//#endregion\n//#region src/schemas/errors/from-zod.ts\n/** Build the JSON body for HTTP 400 validation failures. */\nfunction validationErrorResponse(error, summary) {\n\treturn {\n\t\terror: summary,\n\t\tdetails: error.issues.map((issue) => ({\n\t\t\tpath: issue.path.join(\".\"),\n\t\t\tmessage: issue.message\n\t\t}))\n\t};\n}\n//#endregion\n//#region src/schemas/errors/parse.ts\nconst MessageOnlyErrorBodySchema = z.object({ message: z.string() });\n/** Parse a JSON error body from the API. */\nfunction parseErrorResponse(body) {\n\tconst parsed = ErrorResponseSchema.safeParse(body);\n\tif (parsed.success) return parsed.data;\n\tconst messageOnly = MessageOnlyErrorBodySchema.safeParse(body);\n\tif (messageOnly.success) return {\n\t\terror: messageOnly.data.message,\n\t\tmessage: messageOnly.data.message\n\t};\n}\n//#endregion\n//#region src/schemas/http.ts\nconst CredentialRunContextSchema = z.object({\n\torgId: z.string().min(1).optional(),\n\tprojectId: z.string().min(1).optional(),\n\tuserId: z.string().min(1).optional(),\n\tuserIds: z.record(z.string(), z.string()).optional(),\n\tselection: z.record(z.string(), z.string()).optional()\n});\nconst ThinkingLevelSchema = z.enum([\n\t\"off\",\n\t\"minimal\",\n\t\"low\",\n\t\"medium\",\n\t\"high\",\n\t\"xhigh\"\n]);\nconst PromptInputSchema = z.object({\n\tmessage: z.string().min(1),\n\tsessionId: z.string().min(1).optional(),\n\tsubscriptionId: z.string().min(1).optional(),\n\tcontext: CredentialRunContextSchema.optional(),\n\tthinkingLevel: ThinkingLevelSchema.optional()\n});\nconst PromptResponseSchema = z.object({\n\tsessionId: z.string(),\n\tmessages: z.array(z.record(z.string(), z.unknown())),\n\terror: z.string().nullable()\n});\nconst SkipResponseSchema = z.object({\n\tok: z.literal(true),\n\tskipped: z.literal(true)\n});\nconst HealthResponseSchema = z.object({ ok: z.literal(true) });\nconst PlatformInfoResponseSchema = z.object({ service: z.string() });\nconst ConnectProviderSchema = z.object({\n\tkey: z.string(),\n\tmode: z.enum([\"authorize-url\", \"browser-redirect\"]),\n\tpath: z.string(),\n\trequiresAuth: z.boolean()\n});\nconst ConnectProvidersResponseSchema = z.object({ providers: z.array(ConnectProviderSchema) });\nconst ConnectAuthorizeUrlResponseSchema = z.object({ url: z.string() });\nconst QueuedRunResponseSchema = z.object({ runId: z.string() });\nconst QueuedAgentPromptResponseSchema = z.object({ sessionId: z.string() });\nfunction parsePromptInput(input) {\n\treturn PromptInputSchema.parse(input);\n}\nconst PollRunRequestSchema = z.object({\n\tworkflows: z.array(z.string().min(1)).optional(),\n\tattachments: z.array(z.string().min(1)).optional()\n});\nconst PollAttachmentResultSchema = z.object({\n\tattachmentKey: z.string(),\n\tworkflowKey: z.string(),\n\trunId: z.string().optional(),\n\tbody: z.unknown().optional(),\n\tqueued: z.boolean(),\n\tskipped: z.boolean().optional()\n});\nconst PollRunMultiResponseSchema = z.object({ results: z.array(PollAttachmentResultSchema) });\nconst PollRunResponseSchema = z.union([\n\tz.record(z.string(), z.unknown()),\n\tPollRunMultiResponseSchema,\n\tSkipResponseSchema,\n\tz.object({ runId: z.string() })\n]);\nfunction parsePollRunRequest(body) {\n\tif (body === void 0 || body === null) return {};\n\treturn PollRunRequestSchema.parse(body);\n}\n//#endregion\n//#region src/schemas/runs.ts\nconst RunSourceKindSchema = z.enum([\n\t\"api\",\n\t\"trigger\",\n\t\"gateway\",\n\t\"workflow\",\n\t\"agent\"\n]);\nconst RunSourceSchema = z.object({\n\tkind: RunSourceKindSchema,\n\tid: z.string().nullable()\n});\n//#endregion\n//#region src/schemas/workflow-runs.ts\nconst WorkflowRunStatusSchema = z.enum([\n\t\"pending\",\n\t\"running\",\n\t\"sleeping\",\n\t\"waiting_hook\",\n\t\"completed\",\n\t\"failed\",\n\t\"canceled\"\n]);\nconst WorkflowRunTriggerSchema = z.enum([\n\t\"api\",\n\t\"cron\",\n\t\"webhook\",\n\t\"poll\",\n\t\"retry\"\n]);\n/**\n* Durable workflow event-log entry types. Shared so the persistence layer\n* (`@keystrokehq/database` schema) and the runtime-agnostic replay engine\n* (`@keystrokehq/workflow`) reference one definition instead of duplicating it.\n*/\nconst WorkflowEventTypeSchema = z.enum([\n\t\"run_started\",\n\t\"step_completed\",\n\t\"step_failed\",\n\t\"step_retrying\",\n\t\"sleep_scheduled\",\n\t\"sleep_completed\",\n\t\"hook_created\",\n\t\"hook_resumed\",\n\t\"run_completed\",\n\t\"run_failed\",\n\t\"run_canceled\"\n]);\nconst WorkflowRunSummarySchema = z.object({\n\tid: z.string(),\n\tstatus: WorkflowRunStatusSchema,\n\ttrigger: WorkflowRunTriggerSchema,\n\ttriggeredAt: z.string(),\n\tstartedAt: z.string().nullable(),\n\tfinishedAt: z.string().nullable(),\n\tsourceKind: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\ttriggerRunId: z.string().nullable(),\n\tattachmentId: z.string().nullable()\n});\nconst WorkflowRunRecordSchema = z.object({\n\tid: z.string(),\n\tworkflowSlug: z.string(),\n\tstatus: WorkflowRunStatusSchema,\n\ttrigger: WorkflowRunTriggerSchema,\n\ttriggeredAt: z.string(),\n\tstartedAt: z.string().nullable(),\n\tfinishedAt: z.string().nullable(),\n\tsourceKind: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\ttriggerRunId: z.string().nullable(),\n\tattachmentId: z.string().nullable(),\n\tparentWorkflowRunId: z.string().nullable(),\n\tparentSpanId: z.string().nullable(),\n\tinput: z.unknown().nullable(),\n\toutput: z.unknown().nullable(),\n\terror: z.unknown().nullable()\n});\nconst WorkflowRunListQuerySchema = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(20),\n\tcursor: z.string().min(1).optional(),\n\tstatus: WorkflowRunStatusSchema.optional(),\n\ttrigger: WorkflowRunTriggerSchema.optional()\n});\nconst WorkflowRunListResponseSchema = z.object({\n\titems: z.array(WorkflowRunSummarySchema),\n\tnextCursor: z.string().nullable()\n});\nconst WorkflowRunDetailIncludeSchema = z.enum([\n\t\"trigger\",\n\t\"steps\",\n\t\"trace\"\n]);\nconst WorkflowRunDetailQuerySchema = z.object({ include: z.string().optional() });\nconst DEFAULT_DETAIL_INCLUDE$2 = [\n\t\"trigger\",\n\t\"steps\",\n\t\"trace\"\n];\nfunction parseWorkflowRunDetailInclude(include) {\n\tif (!include?.trim()) return [...DEFAULT_DETAIL_INCLUDE$2];\n\tconst parsed = include.split(\",\").map((part) => part.trim()).filter((part) => WorkflowRunDetailIncludeSchema.options.includes(part));\n\treturn parsed.length > 0 ? parsed : [...DEFAULT_DETAIL_INCLUDE$2];\n}\nconst TriggerRunDetailSchema = z.object({\n\tid: z.string(),\n\tattachmentId: z.string(),\n\tattachmentSlug: z.string().nullable(),\n\ttriggerType: z.enum([\n\t\t\"cron\",\n\t\t\"webhook\",\n\t\t\"poll\"\n\t]),\n\tsourcePath: z.string().nullable(),\n\tpayload: z.unknown().nullable(),\n\ttriggeredAt: z.string()\n});\nconst WorkflowStepRunSchema = z.object({\n\tid: z.string(),\n\tactionKey: z.string(),\n\toutput: z.unknown(),\n\tcompletedAt: z.string()\n});\nconst TraceTriggerSummarySchema = z.object({\n\ttriggerType: z.string(),\n\ttriggerRunId: z.string(),\n\tworkflowSlug: z.string().optional(),\n\tagentSlug: z.string().optional(),\n\tattachmentId: z.string().nullable().optional(),\n\tattachmentSlug: z.string().nullable().optional(),\n\troute: z.string().optional(),\n\tsourcePath: z.string().nullable().optional()\n}).nullable();\nconst TraceGatewaySummarySchema = z.object({\n\tgatewayAttachmentId: z.string(),\n\tgatewayAttachmentKey: z.string(),\n\tthreadId: z.string().optional(),\n\tchannelId: z.string().optional(),\n\tmode: z.string().optional()\n}).nullable();\nconst TraceSpanSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tparentSpanId: z.string().nullable(),\n\tkind: z.string(),\n\trefId: z.string(),\n\tname: z.string(),\n\tstatus: z.string(),\n\tstartedAt: z.string(),\n\tfinishedAt: z.string().nullable(),\n\tmetadata: z.unknown().nullable(),\n\terror: z.unknown().nullable()\n});\nconst TraceLogSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tspanId: z.string(),\n\tseq: z.number(),\n\tlevel: z.string(),\n\tmessage: z.string(),\n\tdata: z.unknown().nullable(),\n\tsource: z.string(),\n\tcreatedAt: z.string()\n});\nconst TraceResponseSchema = z.object({\n\ttraceId: z.string(),\n\ttrigger: TraceTriggerSummarySchema,\n\tgateway: TraceGatewaySummarySchema,\n\tspans: z.array(TraceSpanSchema),\n\tlogs: z.array(TraceLogSchema)\n});\nconst WorkflowRunDetailResponseSchema = z.object({\n\trun: WorkflowRunRecordSchema,\n\ttrigger: TriggerRunDetailSchema.nullable(),\n\tsteps: z.array(WorkflowStepRunSchema),\n\ttrace: TraceResponseSchema.nullable()\n});\n//#endregion\n//#region src/schemas/agent-sessions.ts\nconst AgentSessionStatusSchema = z.enum([\n\t\"running\",\n\t\"completed\",\n\t\"failed\",\n\t\"canceled\"\n]);\nconst AgentSessionSummarySchema = z.object({\n\tid: z.string(),\n\tstatus: AgentSessionStatusSchema,\n\tsource: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tmessageCount: z.number()\n});\nconst AgentSessionRecordSchema = z.object({\n\tid: z.string(),\n\tagentSlug: z.string(),\n\tstatus: AgentSessionStatusSchema,\n\tsource: RunSourceKindSchema,\n\tsourceId: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tparentSpanId: z.string().nullable(),\n\tmessageCount: z.number(),\n\terror: z.unknown().nullable()\n});\nconst AgentSessionListQuerySchema = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(20),\n\tcursor: z.string().min(1).optional(),\n\tstatus: AgentSessionStatusSchema.optional(),\n\tsource: RunSourceKindSchema.optional()\n});\nconst AgentSessionListResponseSchema = z.object({\n\titems: z.array(AgentSessionSummarySchema),\n\tnextCursor: z.string().nullable()\n});\nconst AgentSessionDetailIncludeSchema = z.enum([\n\t\"gateway\",\n\t\"messages\",\n\t\"events\",\n\t\"trace\"\n]);\nconst AgentSessionDetailQuerySchema = z.object({ include: z.string().optional() });\nconst DEFAULT_DETAIL_INCLUDE$1 = [\n\t\"gateway\",\n\t\"messages\",\n\t\"trace\"\n];\nfunction parseAgentSessionDetailInclude(include) {\n\tif (!include?.trim()) return [...DEFAULT_DETAIL_INCLUDE$1];\n\tconst parsed = include.split(\",\").map((part) => part.trim()).filter((part) => AgentSessionDetailIncludeSchema.options.includes(part));\n\treturn parsed.length > 0 ? parsed : [...DEFAULT_DETAIL_INCLUDE$1];\n}\nconst GatewaySessionDetailSchema = z.object({\n\tthreadId: z.string(),\n\tattachmentId: z.string(),\n\tattachmentSlug: z.string().nullable()\n});\nconst AgentEventSchema = z.object({\n\tid: z.string(),\n\tsessionId: z.string(),\n\tseq: z.number(),\n\teventType: z.string(),\n\tpayload: z.unknown(),\n\tcreatedAt: z.string()\n});\nconst AgentSessionDetailResponseSchema = z.object({\n\tsession: AgentSessionRecordSchema,\n\tgateway: GatewaySessionDetailSchema.nullable(),\n\tmessages: z.array(z.record(z.string(), z.unknown())),\n\tevents: z.array(AgentEventSchema),\n\ttrace: TraceResponseSchema.nullable()\n});\n//#endregion\n//#region src/schemas/gateway-attachments.ts\nconst SlackGatewayModeSchema = z.enum([\n\t\"mention\",\n\t\"channel\",\n\t\"dm\"\n]);\nconst GatewayAttachmentSourceSchema = z.object({\n\tkind: z.literal(\"slack\"),\n\tmode: SlackGatewayModeSchema,\n\tcredentialKey: z.string(),\n\tchannelIds: z.array(z.string()).optional(),\n\tsubscribeOnMention: z.boolean()\n});\nconst GatewayAttachmentRecordSchema = z.object({\n\tid: z.string(),\n\tkey: z.string(),\n\tagentKey: z.string(),\n\tchannelId: z.string(),\n\tteamId: z.string().nullable().optional(),\n\tplatform: z.string(),\n\tsource: GatewayAttachmentSourceSchema,\n\tregisteredAt: z.string(),\n\tupdatedAt: z.string()\n});\nconst GatewayAttachmentListResponseSchema = z.object({ attachments: z.array(GatewayAttachmentRecordSchema) });\nconst UpsertGatewayAttachmentBodySchema = z.object({\n\tagentKey: z.string().min(1),\n\tteamId: z.string().min(1).optional(),\n\tmode: SlackGatewayModeSchema.optional(),\n\tsubscribeOnMention: z.boolean().optional()\n});\nconst AgentListItemSchema = z.object({\n\tkey: z.string(),\n\tname: z.string().optional(),\n\troute: z.string()\n});\nconst AgentListResponseSchema = z.object({ agents: z.array(AgentListItemSchema) });\n//#endregion\n//#region src/schemas/history.ts\nconst HistoryRunKindSchema = z.enum([\"workflow\", \"agent\"]);\nconst HistoryRunStatusSchema = z.enum([\n\t\"pending\",\n\t\"running\",\n\t\"sleeping\",\n\t\"waiting_hook\",\n\t\"completed\",\n\t\"failed\",\n\t\"canceled\"\n]);\nconst HistoryRunActorSchema = z.object({\n\tuserId: z.string(),\n\tname: z.string(),\n\tavatarUrl: z.string().nullable().optional()\n});\nconst HistoryRunUsageLineItemSchema = z.object({\n\tid: z.string(),\n\tlabel: z.string(),\n\tamountUsd: z.number()\n});\nconst HistoryRunUsageSchema = z.object({\n\trunDurationMs: z.number().nullable(),\n\tlineItems: z.array(HistoryRunUsageLineItemSchema),\n\ttotalExcludingDurationUsd: z.number().nullable()\n});\nconst HistoryRunSchema = z.object({\n\tid: z.string(),\n\tkind: HistoryRunKindSchema,\n\ttraceId: z.string().nullable(),\n\tprojectId: z.string(),\n\tprojectName: z.string(),\n\tresourceKey: z.string(),\n\tresourceId: z.string(),\n\tresourceName: z.string(),\n\tstatus: HistoryRunStatusSchema,\n\ttriggeredAt: z.string(),\n\ttimeInQueueMs: z.number().nullable(),\n\tstartedAt: z.string(),\n\tfinishedAt: z.string().nullable(),\n\tdurationMs: z.number().nullable(),\n\ttriggerLabel: z.string(),\n\ttriggerRaw: z.string(),\n\tranAs: HistoryRunActorSchema.nullable(),\n\tmodelsUsed: z.array(z.string()),\n\totherServicesUsed: z.array(z.string()),\n\ttotalCostUsd: z.number().nullable(),\n\tmessageCount: z.number().optional(),\n\tstepCount: z.number().optional()\n});\nconst HistoryTraceSpanSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tparentSpanId: z.string().nullable(),\n\tkind: z.string(),\n\trefId: z.string(),\n\tname: z.string(),\n\tstatus: z.string(),\n\tstartedAt: z.string(),\n\tfinishedAt: z.string().nullable(),\n\tmetadata: z.unknown().nullable(),\n\terror: z.unknown().nullable()\n});\nconst HistoryTraceLogSchema = z.object({\n\tid: z.string(),\n\ttraceId: z.string(),\n\tspanId: z.string(),\n\tseq: z.number(),\n\tlevel: z.string(),\n\tmessage: z.string(),\n\tdata: z.unknown().nullable(),\n\tsource: z.string(),\n\tcreatedAt: z.string()\n});\nconst HistoryTraceTriggerSchema = z.object({\n\ttriggerType: z.string(),\n\ttriggerRunId: z.string(),\n\tworkflowKey: z.string().optional(),\n\tagentKey: z.string().optional(),\n\tattachmentId: z.string().nullable().optional(),\n\tattachmentKey: z.string().nullable().optional(),\n\troute: z.string().optional(),\n\tsourcePath: z.string().nullable().optional()\n}).nullable();\nconst HistoryTraceGatewaySchema = z.object({\n\tgatewayAttachmentId: z.string(),\n\tgatewayAttachmentKey: z.string(),\n\tthreadId: z.string().optional(),\n\tchannelId: z.string().optional(),\n\tmode: z.string().optional()\n}).nullable();\nconst HistoryTraceSchema = z.object({\n\ttraceId: z.string(),\n\ttrigger: HistoryTraceTriggerSchema,\n\tgateway: HistoryTraceGatewaySchema,\n\tspans: z.array(HistoryTraceSpanSchema),\n\tlogs: z.array(HistoryTraceLogSchema)\n});\nconst HistoryWorkflowStepSchema = z.object({\n\tid: z.string(),\n\tactionKey: z.string(),\n\toutput: z.unknown(),\n\tcompletedAt: z.string()\n});\nconst HistoryWorkflowRunDetailSchema = z.object({\n\tkind: z.literal(\"workflow\"),\n\trun: z.object({\n\t\tid: z.string(),\n\t\tworkflowKey: z.string(),\n\t\tstatus: HistoryRunStatusSchema,\n\t\ttrigger: z.string(),\n\t\ttriggeredAt: z.string(),\n\t\tstartedAt: z.string().nullable(),\n\t\tfinishedAt: z.string().nullable(),\n\t\tinput: z.unknown().nullable(),\n\t\toutput: z.unknown().nullable(),\n\t\terror: z.unknown().nullable()\n\t}),\n\ttrigger: z.object({\n\t\tid: z.string(),\n\t\tattachmentKey: z.string().nullable(),\n\t\ttriggerType: z.string(),\n\t\tsourcePath: z.string().nullable(),\n\t\tpayload: z.unknown().nullable(),\n\t\ttriggeredAt: z.string()\n\t}).nullable(),\n\tsteps: z.array(HistoryWorkflowStepSchema),\n\ttrace: HistoryTraceSchema.nullable(),\n\tranAs: HistoryRunActorSchema.nullable().optional(),\n\tusage: HistoryRunUsageSchema.nullable().optional()\n});\nconst HistoryAgentSessionDetailSchema = z.object({\n\tkind: z.literal(\"agent\"),\n\tsession: z.object({\n\t\tid: z.string(),\n\t\tagentKey: z.string(),\n\t\tstatus: HistoryRunStatusSchema,\n\t\tsource: z.enum([\n\t\t\t\"api\",\n\t\t\t\"gateway\",\n\t\t\t\"trigger\",\n\t\t\t\"workflow\",\n\t\t\t\"agent\"\n\t\t]),\n\t\tsourceId: z.string().nullable(),\n\t\tcreatedAt: z.string(),\n\t\tupdatedAt: z.string(),\n\t\tmessageCount: z.number(),\n\t\terror: z.unknown().nullable()\n\t}),\n\tgateway: z.object({\n\t\tthreadId: z.string(),\n\t\tattachmentKey: z.string().nullable()\n\t}).nullable(),\n\tmessages: z.array(z.record(z.string(), z.unknown())),\n\ttrace: HistoryTraceSchema.nullable(),\n\tranAs: HistoryRunActorSchema.nullable().optional(),\n\tusage: HistoryRunUsageSchema.nullable().optional()\n});\nconst HistoryRunDetailSchema = z.discriminatedUnion(\"kind\", [HistoryWorkflowRunDetailSchema, HistoryAgentSessionDetailSchema]);\nconst HistoryRunListQuerySchema = z.object({\n\tproject: z.string().min(1).optional(),\n\tstatus: HistoryRunStatusSchema.optional(),\n\tkind: HistoryRunKindSchema.optional()\n});\nconst HistoryRunListResponseSchema = z.array(HistoryRunSchema);\nconst HistoryRunDetailResponseSchema = HistoryRunDetailSchema.nullable();\nconst HistoryRunCancelResponseSchema = HistoryRunSchema.nullable();\n//#endregion\n//#region src/schemas/workflow-deployments.ts\nconst WorkflowSubscriptionRecordSchema = z.object({\n\tid: z.string(),\n\tworkflowKey: z.string(),\n\tuserId: z.string(),\n\tenabled: z.boolean(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string()\n});\nconst WorkflowSubscriptionListResponseSchema = z.object({ subscriptions: z.array(WorkflowSubscriptionRecordSchema) });\nconst UpsertWorkflowSubscriptionBodySchema = z.object({\n\tuserId: z.string().min(1).optional(),\n\tenabled: z.boolean().optional()\n});\nconst CredentialInstanceRecordSchema = z.object({\n\tid: z.string(),\n\tkey: z.string(),\n\tscopeType: CredentialScopeTypeSchema,\n\tscopeId: z.string().nullable(),\n\tlabel: z.string().nullable(),\n\tisDefault: z.boolean(),\n\tauthKind: CredentialAuthKindSchema\n});\nconst CredentialInstanceListResponseSchema = z.object({ instances: z.array(CredentialInstanceRecordSchema) });\nconst CreateCredentialInstanceBodySchema = z.object({\n\tkey: z.string().min(1),\n\tscopeType: CredentialScopeTypeSchema,\n\tscopeId: z.string().nullable().optional(),\n\tlabel: z.string().nullable().optional(),\n\tisDefault: z.boolean().optional(),\n\tvalue: z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: \"value must be a non-empty object\" })\n});\nconst UpdateCredentialInstanceBodySchema = z.object({\n\tlabel: z.string().nullable().optional(),\n\tisDefault: z.boolean().optional(),\n\tvalue: z.record(z.string(), z.unknown()).refine((value) => Object.keys(value).length > 0, { message: \"value must be a non-empty object\" }).optional()\n});\n//#endregion\n//#region src/schemas/trigger-runs.ts\nconst TriggerRunTypeSchema = z.enum([\n\t\"cron\",\n\t\"webhook\",\n\t\"poll\"\n]);\nconst TriggerRunWorkflowSummarySchema = z.object({\n\tid: z.string(),\n\tstatus: WorkflowRunStatusSchema,\n\tworkflowSlug: z.string()\n});\nconst TriggerRunAgentSessionSummarySchema = z.object({\n\tid: z.string(),\n\tagentSlug: z.string()\n});\nconst TriggerRunSummarySchema = z.object({\n\tid: z.string(),\n\ttriggerType: TriggerRunTypeSchema,\n\ttriggeredAt: z.string(),\n\tsourcePath: z.string().nullable(),\n\tworkflowRun: TriggerRunWorkflowSummarySchema.nullable(),\n\tagentSession: TriggerRunAgentSessionSummarySchema.nullable()\n});\nconst TriggerRunRecordSchema = z.object({\n\tid: z.string(),\n\tattachmentId: z.string(),\n\tattachmentSlug: z.string(),\n\ttriggerType: TriggerRunTypeSchema,\n\tsourcePath: z.string().nullable(),\n\tpayload: z.unknown().nullable(),\n\ttriggeredAt: z.string()\n});\nconst TriggerRunListQuerySchema = z.object({\n\tlimit: z.coerce.number().int().min(1).max(100).optional().default(20),\n\tcursor: z.string().min(1).optional(),\n\ttriggerType: TriggerRunTypeSchema.optional()\n});\nconst TriggerRunListResponseSchema = z.object({\n\titems: z.array(TriggerRunSummarySchema),\n\tnextCursor: z.string().nullable()\n});\nconst TriggerRunDetailIncludeSchema = z.enum([\n\t\"workflows\",\n\t\"agents\",\n\t\"trace\"\n]);\nconst TriggerRunDetailQuerySchema = z.object({ include: z.string().optional() });\nconst DEFAULT_DETAIL_INCLUDE = [\n\t\"workflows\",\n\t\"agents\",\n\t\"trace\"\n];\nfunction parseTriggerRunDetailInclude(include) {\n\tif (!include?.trim()) return [...DEFAULT_DETAIL_INCLUDE];\n\tconst parsed = include.split(\",\").map((part) => part.trim()).filter((part) => TriggerRunDetailIncludeSchema.options.includes(part));\n\treturn parsed.length > 0 ? parsed : [...DEFAULT_DETAIL_INCLUDE];\n}\nconst TriggerRunAgentSessionDetailSchema = z.object({\n\tid: z.string(),\n\tagentSlug: z.string()\n});\nconst TriggerRunDetailResponseSchema = z.object({\n\trun: TriggerRunRecordSchema,\n\tworkflowRuns: z.array(WorkflowRunSummarySchema),\n\tagentSessions: z.array(TriggerRunAgentSessionDetailSchema),\n\ttrace: TraceResponseSchema.nullable()\n});\n//#endregion\n//#region src/schemas/triggers.ts\nconst TriggerTypeSchema = z.enum([\n\t\"webhook\",\n\t\"poll\",\n\t\"cron\"\n]);\nconst TriggerTargetKindSchema = z.enum([\"workflow\", \"agent\"]);\nconst TriggerListItemSchema = z.object({\n\tkey: z.string(),\n\ttype: TriggerTypeSchema,\n\troute: z.string().optional(),\n\twebhookUrl: z.string().url().optional(),\n\ttargetKind: TriggerTargetKindSchema,\n\tworkflowKey: z.string().optional(),\n\tagentKey: z.string().optional()\n});\nconst TriggerListResponseSchema = z.object({ triggers: z.array(TriggerListItemSchema) });\nconst TriggerListQuerySchema = z.object({ endpoint: z.string().min(1).optional() });\nconst TriggerDetailResponseSchema = TriggerListItemSchema;\n//#endregion\n//#region src/schemas/members.ts\nconst OrganizationMemberRoleSchema = z.enum([\n\t\"owner\",\n\t\"admin\",\n\t\"builder\"\n]);\nconst OrganizationMemberStatusSchema = z.enum([\n\t\"invited\",\n\t\"active\",\n\t\"rejected\",\n\t\"suspended\"\n]);\nconst InvitableOrganizationMemberRoleSchema = z.enum([\"admin\", \"builder\"]);\nconst isoDateTime$4 = z.string().datetime();\nconst OrganizationMemberSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\temail: z.string().email(),\n\trole: OrganizationMemberRoleSchema,\n\tstatus: OrganizationMemberStatusSchema,\n\tavatarUrl: z.string().optional(),\n\tjoinedAt: isoDateTime$4.optional(),\n\tlastActiveAt: isoDateTime$4.nullable().optional()\n});\nconst ListOrganizationMembersResponseSchema = z.object({ members: z.array(OrganizationMemberSchema) });\nconst InviteOrganizationMembersRequestSchema = z.object({\n\temails: z.array(z.string().trim().email()).min(1),\n\trole: InvitableOrganizationMemberRoleSchema\n});\nconst InviteOrganizationMemberResultStatusSchema = z.enum([\n\t\"sent\",\n\t\"already_member\",\n\t\"pending\",\n\t\"invalid\"\n]);\nconst InviteOrganizationMemberResultSchema = z.object({\n\temail: z.string(),\n\tstatus: InviteOrganizationMemberResultStatusSchema,\n\tinvitationId: z.string().optional()\n});\nconst InviteOrganizationMembersResponseSchema = z.object({ results: z.array(InviteOrganizationMemberResultSchema) });\nconst UpdateOrganizationMemberRequestSchema = z.object({ role: InvitableOrganizationMemberRoleSchema });\nconst UpdateOrganizationMemberResponseSchema = z.object({ member: OrganizationMemberSchema });\nconst OrganizationInvitationSchema = z.object({\n\tid: z.string(),\n\torganizationName: z.string(),\n\torganizationSlug: OrganizationSlugSchema,\n\tinvitedByName: z.string().optional(),\n\tinvitedByEmail: z.string().email().optional(),\n\trole: OrganizationMemberRoleSchema\n});\nconst ListOrganizationInvitationsResponseSchema = z.object({ invitations: z.array(OrganizationInvitationSchema) });\nconst AcceptOrganizationInvitationResponseSchema = z.object({ organization: UserOrganizationSchema });\nconst DeclineOrganizationInvitationResponseSchema = z.object({ success: z.literal(true) });\n/** Web path to auto-accept an invitation after sign-in (used in invite emails). */\nfunction organizationInvitationAcceptPath(invitationId) {\n\treturn `/organization/invitations?${new URLSearchParams({ accept: invitationId }).toString()}`;\n}\n//#endregion\n//#region src/schemas/api-keys.ts\nconst isoDateTime$3 = z.string().datetime();\nconst ApiKeyCreatorSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\temail: z.string().email().optional(),\n\tavatarUrl: z.string().optional(),\n\t/** True when the creator user row no longer exists. */\n\tdeleted: z.boolean().optional()\n});\nconst ApiKeySummarySchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tkeyPreview: z.string(),\n\tcreatedAt: isoDateTime$3,\n\tcreatedBy: ApiKeyCreatorSchema,\n\tisCreatedByCurrentUser: z.boolean()\n});\nconst ListApiKeysResponseSchema = z.object({ apiKeys: z.array(ApiKeySummarySchema) });\nconst CreateApiKeyRequestSchema = z.object({ name: z.string().trim().min(1).max(128) });\nconst CreateApiKeyResponseSchema = ApiKeySummarySchema.extend({ secret: z.string() });\n//#endregion\n//#region src/schemas/project-members.ts\nconst ProjectUserRoleSchema = z.enum([\"admin\", \"builder\"]);\nconst ProjectInvitePermissionSchema = z.enum([\"admin\", \"all\"]);\nconst ProjectMemberStatusSchema = z.enum([\"active\", \"invited\"]);\nconst isoDateTime$2 = z.string().datetime();\nconst ProjectMemberSchema = z.object({\n\tid: z.string(),\n\tprojectId: z.string(),\n\tname: z.string(),\n\temail: z.string().email(),\n\trole: ProjectUserRoleSchema,\n\tstatus: ProjectMemberStatusSchema,\n\timage: z.string().nullable(),\n\tcreatedAt: isoDateTime$2,\n\tisCurrentUser: z.boolean().optional()\n});\nconst ListProjectMembersResponseSchema = z.object({ members: z.array(ProjectMemberSchema) });\nconst InviteProjectMembersRequestSchema = z.object({\n\temails: z.array(z.string().trim().email()).min(1),\n\trole: ProjectUserRoleSchema\n});\nconst InviteProjectMemberResultStatusSchema = z.enum([\n\t\"added\",\n\t\"already_member\",\n\t\"not_org_member\",\n\t\"invalid\"\n]);\nconst InviteProjectMemberResultSchema = z.object({\n\temail: z.string(),\n\tstatus: InviteProjectMemberResultStatusSchema\n});\nconst InviteProjectMembersResponseSchema = z.object({ results: z.array(InviteProjectMemberResultSchema) });\nconst UpdateProjectMemberRequestSchema = z.object({ role: ProjectUserRoleSchema });\nconst UpdateProjectMemberResponseSchema = z.object({ member: ProjectMemberSchema });\nconst ProjectSettingsSchema = z.object({\n\tdescription: z.string(),\n\tdefaultRole: ProjectUserRoleSchema,\n\tinvitePermission: ProjectInvitePermissionSchema\n});\nconst UpdateProjectSettingsRequestSchema = z.object({\n\tdescription: z.string().optional(),\n\tdefaultRole: ProjectUserRoleSchema.optional(),\n\tinvitePermission: ProjectInvitePermissionSchema.optional()\n}).refine((data) => data.description !== void 0 || data.defaultRole !== void 0 || data.invitePermission !== void 0, { message: \"At least one field is required\" });\nconst ProjectSettingsResponseSchema = z.object({ settings: ProjectSettingsSchema });\n//#endregion\n//#region src/schemas/user-avatar.ts\n/** Custom avatar override; null means fall back to OAuth `users.image`. */\nconst UserAvatarSchema = z.object({ url: z.url().nullable() });\nconst UserAvatarPatchSchema = z.object({ \n/** Storage key returned from presign; null removes the custom override. */\nstorageKey: z.string().min(1).nullable() });\nconst PresignUserAvatarRequestSchema = z.object({ contentType: z.string().trim().min(1) });\nconst PresignUserAvatarResponseSchema = z.object({\n\tuploadUrl: z.url(),\n\tstorageKey: z.string().min(1)\n});\n//#endregion\n//#region src/schemas/user-preferences.ts\nconst UserInterfaceThemeSchema = z.enum([\n\t\"system\",\n\t\"light\",\n\t\"dark\"\n]);\nconst UserSurfaceContrastSchema = z.enum([\"off\", \"on\"]);\nconst UserWorkspaceLayoutModeSchema = z.enum([\"default\", \"linear\"]);\nconst UserWorkspaceFontSizeSchema = z.enum([\"default\", \"large\"]);\nconst UserSidebarNavIconVisibilitySchema = z.enum([\"hidden\", \"visible\"]);\nconst UserSidebarFooterChatRowVisibilitySchema = z.enum([\"hidden\", \"visible\"]);\nconst UserWorkspaceFavoriteKindSchema = z.enum([\n\t\"agent\",\n\t\"workflow\",\n\t\"skill\",\n\t\"run\"\n]);\nconst UserWorkspaceFavoriteSchema = z.object({\n\tkind: UserWorkspaceFavoriteKindSchema,\n\tresourceId: z.string().min(1)\n});\nconst UserSidebarPreferencesSchema = z.object({\n\tnavIconVisibility: UserSidebarNavIconVisibilitySchema,\n\tfooterChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema,\n\thiddenNavItemIds: z.array(z.string()),\n\ttopNavItemOrderIds: z.array(z.string()),\n\tworkspaceNavItemOrderIds: z.array(z.string())\n});\nconst UserPreferencesSchema = z.object({\n\tinterfaceTheme: UserInterfaceThemeSchema,\n\tsurfaceContrast: UserSurfaceContrastSchema,\n\tlayoutMode: UserWorkspaceLayoutModeSchema,\n\tfontSize: UserWorkspaceFontSizeSchema,\n\tsidebar: UserSidebarPreferencesSchema,\n\tfavorites: z.array(UserWorkspaceFavoriteSchema),\n\tprojectOrderIds: z.array(z.string()),\n\tprojectDotColors: z.record(z.string(), z.string()),\n\tonboardingTabVisible: z.boolean()\n});\nconst UserSidebarPreferencesPatchSchema = z.object({\n\tnavIconVisibility: UserSidebarNavIconVisibilitySchema.optional(),\n\tfooterChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema.optional(),\n\thiddenNavItemIds: z.array(z.string()).optional(),\n\ttopNavItemOrderIds: z.array(z.string()).optional(),\n\tworkspaceNavItemOrderIds: z.array(z.string()).optional()\n});\nconst UserPreferencesPatchSchema = z.object({\n\tinterfaceTheme: UserInterfaceThemeSchema.optional(),\n\tsurfaceContrast: UserSurfaceContrastSchema.optional(),\n\tlayoutMode: UserWorkspaceLayoutModeSchema.optional(),\n\tfontSize: UserWorkspaceFontSizeSchema.optional(),\n\tsidebar: UserSidebarPreferencesPatchSchema.optional(),\n\tfavorites: z.array(UserWorkspaceFavoriteSchema).optional(),\n\tprojectOrderIds: z.array(z.string()).optional(),\n\tprojectDotColors: z.record(z.string(), z.string()).optional(),\n\tonboardingTabVisible: z.boolean().optional()\n}).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\" });\nconst DEFAULT_USER_SIDEBAR_PREFERENCES = {\n\tnavIconVisibility: \"visible\",\n\tfooterChatRowVisibility: \"visible\",\n\thiddenNavItemIds: [\"registry\"],\n\ttopNavItemOrderIds: [],\n\tworkspaceNavItemOrderIds: []\n};\nconst DEFAULT_USER_PREFERENCES = {\n\tinterfaceTheme: \"system\",\n\tsurfaceContrast: \"on\",\n\tlayoutMode: \"linear\",\n\tfontSize: \"default\",\n\tsidebar: DEFAULT_USER_SIDEBAR_PREFERENCES,\n\tfavorites: [],\n\tprojectOrderIds: [],\n\tprojectDotColors: {},\n\tonboardingTabVisible: true\n};\nfunction normalizeInterfaceTheme(value) {\n\tif (value === \"light\" || value === \"dark\") return value;\n\treturn \"system\";\n}\nfunction normalizeSurfaceContrast(value) {\n\treturn value === \"off\" ? \"off\" : \"on\";\n}\nfunction normalizeLayoutMode(value) {\n\treturn value === \"default\" ? \"default\" : \"linear\";\n}\nfunction normalizeFontSize(value) {\n\treturn value === \"large\" ? \"large\" : \"default\";\n}\nfunction normalizeStringList(value) {\n\tif (!Array.isArray(value)) return [];\n\treturn Array.from(new Set(value.filter((item) => typeof item === \"string\")));\n}\nfunction normalizeHiddenNavItemIds(value) {\n\tif (!Array.isArray(value)) return DEFAULT_USER_SIDEBAR_PREFERENCES.hiddenNavItemIds;\n\treturn normalizeStringList(value);\n}\nfunction normalizeSidebarPreferences(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_USER_SIDEBAR_PREFERENCES;\n\tconst sidebar = value;\n\treturn {\n\t\tnavIconVisibility: sidebar.navIconVisibility === \"visible\" ? \"visible\" : \"hidden\",\n\t\tfooterChatRowVisibility: sidebar.footerChatRowVisibility === \"hidden\" ? \"hidden\" : \"visible\",\n\t\thiddenNavItemIds: normalizeHiddenNavItemIds(sidebar.hiddenNavItemIds),\n\t\ttopNavItemOrderIds: normalizeStringList(sidebar.topNavItemOrderIds),\n\t\tworkspaceNavItemOrderIds: normalizeStringList(sidebar.workspaceNavItemOrderIds)\n\t};\n}\nfunction isWorkspaceFavoriteKind(value) {\n\treturn value === \"agent\" || value === \"workflow\" || value === \"skill\" || value === \"run\";\n}\nfunction normalizeFavorites(value) {\n\tif (!Array.isArray(value)) return [];\n\tconst seenKeys = /* @__PURE__ */ new Set();\n\tconst favorites = [];\n\tfor (const item of value) {\n\t\tif (!item || typeof item !== \"object\") continue;\n\t\tconst favorite = item;\n\t\tif (typeof favorite.kind !== \"string\" || !isWorkspaceFavoriteKind(favorite.kind) || typeof favorite.resourceId !== \"string\" || favorite.resourceId.length === 0) continue;\n\t\tconst key = `${favorite.kind}:${favorite.resourceId}`;\n\t\tif (seenKeys.has(key)) continue;\n\t\tseenKeys.add(key);\n\t\tfavorites.push({\n\t\t\tkind: favorite.kind,\n\t\t\tresourceId: favorite.resourceId\n\t\t});\n\t}\n\treturn favorites;\n}\nfunction normalizeProjectDotColors(value) {\n\tif (!value || typeof value !== \"object\" || Array.isArray(value)) return {};\n\treturn Object.fromEntries(Object.entries(value).filter((entry) => typeof entry[0] === \"string\" && typeof entry[1] === \"string\"));\n}\nfunction normalizeOnboardingTabVisible(value) {\n\treturn typeof value === \"boolean\" ? value : DEFAULT_USER_PREFERENCES.onboardingTabVisible;\n}\nfunction normalizeUserPreferences(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_USER_PREFERENCES;\n\tconst preferences = value;\n\treturn UserPreferencesSchema.parse({\n\t\tinterfaceTheme: normalizeInterfaceTheme(preferences.interfaceTheme),\n\t\tsurfaceContrast: normalizeSurfaceContrast(preferences.surfaceContrast),\n\t\tlayoutMode: normalizeLayoutMode(preferences.layoutMode),\n\t\tfontSize: normalizeFontSize(preferences.fontSize),\n\t\tsidebar: normalizeSidebarPreferences(preferences.sidebar),\n\t\tfavorites: normalizeFavorites(preferences.favorites),\n\t\tprojectOrderIds: normalizeStringList(preferences.projectOrderIds),\n\t\tprojectDotColors: normalizeProjectDotColors(preferences.projectDotColors),\n\t\tonboardingTabVisible: normalizeOnboardingTabVisible(preferences.onboardingTabVisible)\n\t});\n}\nfunction mergeUserPreferences(current, patch) {\n\treturn normalizeUserPreferences({\n\t\t...current,\n\t\t...patch,\n\t\tsidebar: patch.sidebar ? {\n\t\t\t...current.sidebar,\n\t\t\t...patch.sidebar\n\t\t} : current.sidebar\n\t});\n}\n//#endregion\n//#region src/schemas/organization-branding.ts\nconst OrganizationLogoVariantSchema = z.enum([\"light\", \"dark\"]);\nconst DEFAULT_LOGO_HEIGHT_PX = 20;\nconst MIN_LOGO_HEIGHT_PX = 14;\nconst MAX_LOGO_HEIGHT_PX = 32;\nconst OrganizationSidebarBrandingSchema = z.object({\n\tcustomLogoEnabled: z.boolean(),\n\tcustomLogoExplicitlyDisabled: z.boolean(),\n\tlogoLightUrl: z.url().nullable(),\n\tlogoDarkUrl: z.url().nullable(),\n\tlogoHeightPx: z.number().int().min(14).max(32)\n});\nconst OrganizationSidebarBrandingPatchSchema = z.object({\n\tcustomLogoEnabled: z.boolean().optional(),\n\tcustomLogoExplicitlyDisabled: z.boolean().optional(),\n\tlogoLightStorageKey: z.string().min(1).nullable().optional(),\n\tlogoDarkStorageKey: z.string().min(1).nullable().optional(),\n\tlogoHeightPx: z.number().int().min(14).max(32).optional()\n}).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\" });\nconst PresignOrgLogoRequestSchema = z.object({\n\tvariant: OrganizationLogoVariantSchema,\n\tcontentType: z.string().trim().min(1)\n});\nconst PresignOrgLogoResponseSchema = z.object({\n\tuploadUrl: z.url(),\n\tstorageKey: z.string().min(1)\n});\nconst DEFAULT_ORGANIZATION_SIDEBAR_BRANDING = {\n\tcustomLogoEnabled: false,\n\tcustomLogoExplicitlyDisabled: false,\n\tlogoLightUrl: null,\n\tlogoDarkUrl: null,\n\tlogoHeightPx: 20\n};\nfunction normalizeLogoUrl(value) {\n\tif (typeof value !== \"string\") return null;\n\ttry {\n\t\tconst url = new URL(value);\n\t\tif (url.protocol !== \"http:\" && url.protocol !== \"https:\") return null;\n\t\treturn url.toString();\n\t} catch {\n\t\treturn null;\n\t}\n}\nfunction normalizeCustomLogoEnabled(value, branding) {\n\tconst hasCustomLogo = Boolean(normalizeLogoUrl(branding.logoLightUrl) || normalizeLogoUrl(branding.logoDarkUrl));\n\tif (branding.customLogoExplicitlyDisabled === true) return false;\n\tif (typeof value === \"boolean\") return value || hasCustomLogo;\n\treturn hasCustomLogo;\n}\nfunction normalizeLogoHeightPx(value) {\n\tif (typeof value !== \"number\" || !Number.isFinite(value)) return DEFAULT_ORGANIZATION_SIDEBAR_BRANDING.logoHeightPx;\n\treturn Math.min(32, Math.max(14, Math.round(value)));\n}\nfunction normalizeOrganizationSidebarBranding(value) {\n\tif (!value || typeof value !== \"object\") return DEFAULT_ORGANIZATION_SIDEBAR_BRANDING;\n\tconst branding = value;\n\treturn OrganizationSidebarBrandingSchema.parse({\n\t\tcustomLogoEnabled: normalizeCustomLogoEnabled(branding.customLogoEnabled, branding),\n\t\tcustomLogoExplicitlyDisabled: branding.customLogoExplicitlyDisabled === true,\n\t\tlogoLightUrl: normalizeLogoUrl(branding.logoLightUrl),\n\t\tlogoDarkUrl: normalizeLogoUrl(branding.logoDarkUrl),\n\t\tlogoHeightPx: normalizeLogoHeightPx(branding.logoHeightPx)\n\t});\n}\nfunction mergeOrganizationSidebarBranding(current, patch) {\n\treturn normalizeOrganizationSidebarBranding({\n\t\t...current,\n\t\t...patch\n\t});\n}\n//#endregion\n//#region src/schemas/project-artifacts.ts\nconst ProjectArtifactStatusSchema = z.enum([\"pending\", \"ready\"]);\nconst isoDateTime$1 = z.string().datetime();\nconst ProjectArtifactSchema = z.object({\n\tid: z.string(),\n\tprojectId: z.string(),\n\tstorageKey: z.string(),\n\tstatus: ProjectArtifactStatusSchema,\n\tcreatedAt: isoDateTime$1,\n\tupdatedAt: isoDateTime$1\n});\nconst CreateProjectArtifactResponseSchema = z.object({\n\tartifact: ProjectArtifactSchema,\n\tuploadUrl: z.string().url(),\n\texpiresInSeconds: z.number().int().positive()\n});\nconst CompleteProjectArtifactResponseSchema = z.object({\n\tartifact: ProjectArtifactSchema,\n\tproject: ProjectSchema\n});\nconst ProjectDeploymentSchema = z.object({\n\tid: z.string(),\n\tprojectId: z.string(),\n\tversion: z.number().int().positive(),\n\tdeployedBy: z.string().nullable(),\n\tdeployedByEmail: z.string().optional(),\n\tdeployedByAvatarUrl: z.string().optional(),\n\tcreatedAt: isoDateTime$1,\n\tactive: z.boolean()\n});\nconst ListProjectDeploymentsResponseSchema = z.object({ deployments: z.array(ProjectDeploymentSchema) });\n//#endregion\n//#region src/schemas/platform-resources.ts\nconst PLATFORM_RESOURCE_UNSUPPORTED_TEXT = \"Not Supported\";\nconst PLATFORM_RESOURCE_UNSUPPORTED_TIMESTAMP = \"0000\";\nconst PLATFORM_RESOURCE_UNSUPPORTED_COUNT = 0;\nconst optionalCount = z.number().int().nonnegative().nullable().optional();\nconst optionalTimestamp = z.string().nullable().optional();\nconst AgentSummarySchema = z.object({\n\tid: z.string().min(1),\n\tslug: z.string().min(1),\n\tname: z.string().min(1),\n\tprojectId: z.string().min(1),\n\tupdatedAt: z.string().min(1),\n\tdescription: z.string().optional(),\n\tsourcePath: z.string().min(1).optional(),\n\tmodel: z.string().optional(),\n\ttoolCount: optionalCount,\n\tcredentialCount: optionalCount,\n\tlastRunAt: optionalTimestamp\n});\nconst WorkflowSummarySchema = z.object({\n\tid: z.string().min(1),\n\tslug: z.string().min(1),\n\tname: z.string().min(1),\n\tprojectId: z.string().min(1),\n\tupdatedAt: z.string().min(1),\n\tdescription: z.string().optional(),\n\tsourcePath: z.string().min(1).optional(),\n\tlastRunAt: optionalTimestamp\n});\nconst SkillSummarySchema = z.object({\n\tid: z.string().min(1),\n\tslug: z.string().min(1),\n\tname: z.string().min(1),\n\tprojectId: z.string().min(1),\n\tupdatedAt: z.string().min(1),\n\tdescription: z.string().optional(),\n\tsourcePath: z.string().min(1).optional()\n});\nconst AgentSummaryListResponseSchema = z.array(AgentSummarySchema);\nconst AgentSummaryDetailResponseSchema = AgentSummarySchema.nullable();\nconst WorkflowSummaryListResponseSchema = z.array(WorkflowSummarySchema);\nconst WorkflowSummaryDetailResponseSchema = WorkflowSummarySchema.nullable();\nconst SkillSummaryListResponseSchema = z.array(SkillSummarySchema);\nconst SkillSummaryDetailResponseSchema = SkillSummarySchema.nullable();\nconst RecentResourceKindSchema = z.enum([\n\t\"agent\",\n\t\"workflow\",\n\t\"skill\"\n]);\nconst RecentResourceSourceSchema = z.enum([\"owned\", \"shared\"]);\nconst RecentResourceSchema = z.object({\n\tid: z.string().min(1),\n\tresourceKind: RecentResourceKindSchema,\n\tresourceId: z.string().min(1),\n\tname: z.string().min(1),\n\tdescription: z.string().optional(),\n\tprojectId: z.string().min(1),\n\tprojectName: z.string().min(1),\n\tsourcePath: z.string().min(1).optional(),\n\tsource: RecentResourceSourceSchema,\n\tlastOpenedAt: z.string().min(1),\n\tlastModifiedAt: z.string().min(1)\n});\nconst RecentResourceListResponseSchema = z.array(RecentResourceSchema);\n//#endregion\n//#region src/schemas/project-files.ts\nconst isoDateTime = z.string().datetime();\nconst sha256Hex = z.string().regex(/^[a-f0-9]{64}$/, \"Expected a lowercase hex sha256 digest\");\n/**\n* A single entry in a deploy's file tree, as served to the dashboard. Carries\n* no contents: `id` is a stable, path-derived handle used for selection and\n* `?file=` deep links; `hash` is the content address used to fetch the bytes\n* lazily and to cache them immutably in the browser.\n*/\nconst ProjectFileSummarySchema = z.object({\n\tid: z.string(),\n\tpath: z.string().min(1),\n\thash: sha256Hex\n});\n/** Maps a runtime resource slug (agent/workflow/skill) to its source file path. */\nconst ProjectSourceResourceRefSchema = z.object({\n\tslug: z.string().min(1),\n\tpath: z.string().min(1)\n});\nconst ProjectSourceResourcesSchema = z.object({\n\tagents: z.array(ProjectSourceResourceRefSchema).default([]),\n\tworkflows: z.array(ProjectSourceResourceRefSchema).default([]),\n\tskills: z.array(ProjectSourceResourceRefSchema).default([])\n});\nconst emptyResources = () => ({\n\tagents: [],\n\tworkflows: [],\n\tskills: []\n});\n/** Response for the file-tree listing of a project's active deploy. */\nconst ListProjectFilesResponseSchema = z.object({\n\tartifactId: z.string().nullable(),\n\tfiles: z.array(ProjectFileSummarySchema),\n\tresources: ProjectSourceResourcesSchema.default(emptyResources())\n});\n/**\n* Raw source file as collected by the CLI at deploy time. `hash` is the content\n* address (sha256 of `contents`) used for dedup and immutable storage.\n*/\nconst ProjectSourceFileSchema = z.object({\n\tpath: z.string().min(1),\n\tcontents: z.string(),\n\thash: sha256Hex\n});\n/** A blob the CLI may need to upload, keyed by content hash. */\nconst SourceBlobRefSchema = z.object({\n\thash: sha256Hex,\n\tsize: z.number().int().nonnegative()\n});\n/** Request: ask the platform which blobs are missing and get presigned PUTs. */\nconst PresignProjectSourceRequestSchema = z.object({ blobs: z.array(SourceBlobRefSchema) });\nconst PresignedBlobUploadSchema = z.object({\n\thash: sha256Hex,\n\turl: z.string().url()\n});\n/** Response: presigned PUTs for the subset of blobs not already stored. */\nconst PresignProjectSourceResponseSchema = z.object({ uploads: z.array(PresignedBlobUploadSchema) });\n/** A file reference in a manifest upload: where the path's content lives. */\nconst ManifestFileRefSchema = z.object({\n\tpath: z.string().min(1),\n\thash: sha256Hex\n});\n/** Request body the CLI sends to finalize a deploy's source manifest. */\nconst UploadProjectSourceManifestRequestSchema = z.object({ files: z.array(ManifestFileRefSchema) });\nconst UploadProjectSourceResponseSchema = z.object({\n\tok: z.literal(true),\n\tfileCount: z.number().int().nonnegative()\n});\n/** A file entry as persisted in the stored manifest (path-derived id added). */\nconst StoredManifestFileSchema = z.object({\n\tid: z.string(),\n\tpath: z.string().min(1),\n\thash: sha256Hex\n});\n/** The immutable per-deploy manifest persisted to object storage. */\nconst StoredProjectSourceManifestSchema = z.object({\n\tfiles: z.array(StoredManifestFileSchema),\n\tgeneratedAt: isoDateTime\n});\nconst LANGUAGE_BY_EXTENSION = {\n\tts: \"typescript\",\n\tmts: \"typescript\",\n\tcts: \"typescript\",\n\ttsx: \"tsx\",\n\tjs: \"javascript\",\n\tmjs: \"javascript\",\n\tcjs: \"javascript\",\n\tjsx: \"jsx\",\n\tjson: \"json\",\n\tmd: \"markdown\",\n\tmdx: \"markdown\",\n\tcss: \"css\",\n\thtml: \"html\",\n\tyml: \"yaml\",\n\tyaml: \"yaml\",\n\ttoml: \"toml\",\n\ttxt: \"text\",\n\tsh: \"shell\",\n\tenv: \"shell\"\n};\n/** Best-effort syntax-highlight hint derived from a file path's extension. */\nfunction projectFileLanguage(path) {\n\tconst base = path.split(\"/\").at(-1) ?? path;\n\treturn LANGUAGE_BY_EXTENSION[base.includes(\".\") ? (base.split(\".\").at(-1) ?? \"\").toLowerCase() : \"\"];\n}\n/** Stable, path-derived file id (used by the web for selection + deep links). */\nfunction projectFileId(path) {\n\treturn `file-${path.trim().replace(/^\\.?\\/+/, \"\").replace(/[^a-zA-Z0-9]+/g, \"-\").replace(/^-+|-+$/g, \"\").toLowerCase()}`;\n}\n//#endregion\n//#region src/mappers/organizations.ts\nfunction mapOrganization(row) {\n\treturn OrganizationSchema.parse({\n\t\tid: row.id,\n\t\tname: row.name,\n\t\tslug: row.slug,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tupdatedAt: row.updatedAt.toISOString()\n\t});\n}\nfunction mapProject(row) {\n\treturn ProjectSchema.parse({\n\t\tid: row.id,\n\t\torganizationId: row.organizationId,\n\t\tname: row.name,\n\t\tslug: row.slug,\n\t\tdescription: row.description,\n\t\tstatus: row.status,\n\t\tbaseUrl: row.baseUrl,\n\t\truntimeId: row.runtimeId,\n\t\tlastError: row.lastError,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tupdatedAt: row.updatedAt.toISOString()\n\t});\n}\nfunction mapUserOrganization(row) {\n\treturn UserOrganizationSchema.parse({\n\t\torganization: mapOrganization(row.organization),\n\t\trole: row.role\n\t});\n}\n//#endregion\n//#region src/mappers/members.ts\nfunction mapOrganizationMember(row) {\n\treturn OrganizationMemberSchema.parse({\n\t\tid: row.id,\n\t\tname: row.name,\n\t\temail: row.email,\n\t\trole: row.role,\n\t\tstatus: row.status,\n\t\t...row.image ? { avatarUrl: row.image } : {},\n\t\tjoinedAt: row.createdAt.toISOString(),\n\t\tlastActiveAt: null\n\t});\n}\nfunction mapOrganizationInvitation(row) {\n\treturn OrganizationInvitationSchema.parse({\n\t\tid: row.id,\n\t\torganizationName: row.organizationName,\n\t\torganizationSlug: row.organizationSlug,\n\t\trole: row.role,\n\t\t...row.invitedByName ? { invitedByName: row.invitedByName } : {},\n\t\t...row.invitedByEmail ? { invitedByEmail: row.invitedByEmail } : {}\n\t});\n}\n//#endregion\n//#region src/mappers/project-members.ts\nfunction mapProjectMember(row, options) {\n\treturn ProjectMemberSchema.parse({\n\t\tid: row.id,\n\t\tprojectId: row.projectId,\n\t\tname: row.name,\n\t\temail: row.email,\n\t\trole: row.role,\n\t\tstatus: row.status,\n\t\timage: row.image,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tisCurrentUser: options?.isCurrentUser\n\t});\n}\nfunction mapProjectSettings(row) {\n\treturn {\n\t\tdescription: row.description ?? \"\",\n\t\tdefaultRole: row.defaultMemberRole,\n\t\tinvitePermission: row.invitePermission\n\t};\n}\n//#endregion\n//#region src/mappers/project-artifacts.ts\nfunction mapProjectArtifact(row) {\n\treturn ProjectArtifactSchema.parse({\n\t\tid: row.id,\n\t\tprojectId: row.projectId,\n\t\tstorageKey: row.storageKey,\n\t\tstatus: row.status,\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tupdatedAt: row.updatedAt.toISOString()\n\t});\n}\n//#endregion\n//#region src/mappers/project-deployments.ts\nfunction mapProjectDeployment(row) {\n\treturn ProjectDeploymentSchema.parse({\n\t\tid: row.id,\n\t\tprojectId: row.projectId,\n\t\tversion: row.version,\n\t\tdeployedBy: row.deployedByName,\n\t\t...row.deployedByEmail ? { deployedByEmail: row.deployedByEmail } : {},\n\t\t...row.deployedByAvatarUrl ? { deployedByAvatarUrl: row.deployedByAvatarUrl } : {},\n\t\tcreatedAt: row.createdAt.toISOString(),\n\t\tactive: row.active\n\t});\n}\n//#endregion\nexport { ACTIVE_ORG_COOKIE, ACTIVE_ORG_HEADER, AcceptOrganizationInvitationResponseSchema, ActiveOrganizationResponseSchema, AgentListResponseSchema, AgentSessionDetailQuerySchema, AgentSessionDetailResponseSchema, AgentSessionListQuerySchema, AgentSessionListResponseSchema, AgentSummaryDetailResponseSchema, AgentSummaryListResponseSchema, AgentSummarySchema, ApiKeyCreatorSchema, ApiKeySummarySchema, AppAuthKindSchema, AppCatalogEntrySchema, AppCredentialConnectionKindSchema, AppCredentialScopeSchema, AppCredentialSummarySchema, AppGatewaySchema, BindChannelBodySchema, CREDENTIAL_AUTH_KINDS, CREDENTIAL_SCOPE_LEVELS, CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE, CREDENTIAL_SCOPE_TYPES, ChannelAccountListResponseSchema, ChannelAccountMetadataSchema, ChannelAccountSchema, ChannelBindingKindSchema, ChannelBindingSchema, ChannelCapabilitiesSchema, ChannelCardSupportSchema, ChannelConnectionListResponseSchema, ChannelConnectionSchema, ChannelDirectoryEntrySchema, ChannelDirectoryListResponseSchema, ChannelListenModeSchema, ChannelPlatformKeySchema, ChannelPlatformSchema, ChannelReactionSupportSchema, ChannelStreamingSupportSchema, ClaimableOrganizationSlugSchema, CompleteProjectArtifactResponseSchema, ConnectAuthorizeUrlResponseSchema, ConnectProvidersResponseSchema, CreateApiKeyRequestSchema, CreateApiKeyResponseSchema, CreateCredentialInstanceBodySchema, CreateCredentialsRequestSchema, CreateCredentialsResponseSchema, CreateOrganizationRequestSchema, CreateOrganizationResponseSchema, CreateProjectArtifactResponseSchema, CreateProjectRequestSchema, CreateProjectResponseSchema, CredentialAuthKindSchema, CredentialInstanceListResponseSchema, CredentialInstanceRecordSchema, CredentialScopeLevelSchema, CredentialScopeTypeSchema, CredentialTargetsFieldsSchema, CurrentOrganizationResponseSchema, DEFAULT_CREDENTIAL_RESOLUTION_CHAIN, DEFAULT_LOGO_HEIGHT_PX, DEFAULT_ORGANIZATION_SIDEBAR_BRANDING, DEFAULT_USER_PREFERENCES, DISCOVERY_CONVENTIONS, DeclineOrganizationInvitationResponseSchema, ErrorResponseCodeSchema, ErrorResponseSchema, GatewayAttachmentListResponseSchema, GatewayAttachmentRecordSchema, GetCredentialResponseSchema, HealthResponseSchema, HistoryAgentSessionDetailSchema, HistoryRunCancelResponseSchema, HistoryRunDetailResponseSchema, HistoryRunDetailSchema, HistoryRunKindSchema, HistoryRunListQuerySchema, HistoryRunListResponseSchema, HistoryRunSchema, HistoryRunStatusSchema, HistoryTraceSchema, HistoryWorkflowRunDetailSchema, InvitableOrganizationMemberRoleSchema, InviteOrganizationMembersRequestSchema, InviteOrganizationMembersResponseSchema, InviteProjectMembersRequestSchema, InviteProjectMembersResponseSchema, ListApiKeysResponseSchema, ListAppsResponseSchema, ListCredentialsResponseSchema, ListOrganizationInvitationsResponseSchema, ListOrganizationMembersResponseSchema, ListOrganizationsResponseSchema, ListProjectDeploymentsResponseSchema, ListProjectFilesResponseSchema, ListProjectMembersResponseSchema, ListProjectMetricsResponseSchema, ListProjectsResponseSchema, MAX_LOGO_HEIGHT_PX, MIN_LOGO_HEIGHT_PX, ManifestFileRefSchema, NewChannelBindingInputSchema, OAuthPermissionModeSchema, OAuthScopeOptionSchema, ORGANIZATION_SLUG_TAKEN_MESSAGE, OrganizationInvitationSchema, OrganizationLogoVariantSchema, OrganizationMemberRoleSchema, OrganizationMemberSchema, OrganizationMemberStatusSchema, OrganizationSchema, OrganizationSidebarBrandingPatchSchema, OrganizationSidebarBrandingSchema, OrganizationSlugErrorCodeSchema, OrganizationSlugSchema, OrganizationUserRoleSchema, PLATFORM_RESOURCE_UNSUPPORTED_COUNT, PLATFORM_RESOURCE_UNSUPPORTED_TEXT, PLATFORM_RESOURCE_UNSUPPORTED_TIMESTAMP, PROJECT_PING_TIMEOUT_MS, PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, PROJECT_REACHABILITY_RETRY_MS, PROJECT_SLUG_TAKEN_MESSAGE, PlatformInfoResponseSchema, PollRunRequestSchema, PollRunResponseSchema, PresignOrgLogoRequestSchema, PresignOrgLogoResponseSchema, PresignProjectSourceRequestSchema, PresignProjectSourceResponseSchema, PresignUserAvatarRequestSchema, PresignUserAvatarResponseSchema, PresignedBlobUploadSchema, ProjectArtifactSchema, ProjectArtifactStatusSchema, ProjectDeploymentSchema, ProjectFileSummarySchema, ProjectInvitePermissionSchema, ProjectListMetricsSchema, ProjectMemberSchema, ProjectMemberStatusSchema, ProjectReachabilityResponseSchema, ProjectResponseSchema, ProjectSchema, ProjectSettingsResponseSchema, ProjectSettingsSchema, ProjectSlugAvailabilityQuerySchema, ProjectSlugAvailabilityReasonSchema, ProjectSlugAvailabilityResponseSchema, ProjectSlugSchema, ProjectSourceFileSchema, ProjectSourceResourceRefSchema, ProjectSourceResourcesSchema, ProjectStatusSchema, ProjectUserRoleSchema, PromptInputSchema, PromptResponseSchema, QueuedAgentPromptResponseSchema, QueuedRunResponseSchema, RESERVED_ORGANIZATION_SLUGS, ROUTE_MANIFEST_HTTP_PATH, ROUTE_MANIFEST_REL_PATH, RecentResourceKindSchema, RecentResourceListResponseSchema, RecentResourceSchema, RecentResourceSourceSchema, RunSourceKindSchema, RunSourceSchema, SkillSummaryDetailResponseSchema, SkillSummaryListResponseSchema, SkillSummarySchema, SkipResponseSchema, SlugAvailabilityQuerySchema, SlugAvailabilityReasonSchema, SlugAvailabilityResponseSchema, SourceBlobRefSchema, StartOAuthConnectionInputSchema, StartOAuthConnectionResultSchema, StoredManifestFileSchema, StoredProjectSourceManifestSchema, StoredRouteManifestSchema, StoredRouteManifestSkillSchema, SubmitTeamRequestRequestSchema, SubmitTeamRequestResponseSchema, TeamRequestTypeSchema, TriggerDetailResponseSchema, TriggerListItemSchema, TriggerListQuerySchema, TriggerListResponseSchema, TriggerRunDetailQuerySchema, TriggerRunDetailResponseSchema, TriggerRunListQuerySchema, TriggerRunListResponseSchema, TriggerTypeSchema, UpdateChannelBindingBodySchema, UpdateCredentialInstanceBodySchema, UpdateCredentialRequestSchema, UpdateOrganizationMemberRequestSchema, UpdateOrganizationMemberResponseSchema, UpdateOrganizationRequestSchema, UpdateProjectMemberRequestSchema, UpdateProjectMemberResponseSchema, UpdateProjectRequestSchema, UpdateProjectSettingsRequestSchema, UploadProjectSourceManifestRequestSchema, UploadProjectSourceResponseSchema, UpsertGatewayAttachmentBodySchema, UpsertWorkflowSubscriptionBodySchema, UserAvatarPatchSchema, UserAvatarSchema, UserInterfaceThemeSchema, UserOrganizationSchema, UserPreferencesPatchSchema, UserPreferencesSchema, UserSidebarFooterChatRowVisibilitySchema, UserSidebarNavIconVisibilitySchema, UserSidebarPreferencesPatchSchema, UserSidebarPreferencesSchema, UserSurfaceContrastSchema, UserWorkspaceFavoriteKindSchema, UserWorkspaceFavoriteSchema, UserWorkspaceFontSizeSchema, UserWorkspaceLayoutModeSchema, ValidationErrorDetailSchema, WorkflowEventTypeSchema, WorkflowRunDetailQuerySchema, WorkflowRunDetailResponseSchema, WorkflowRunListQuerySchema, WorkflowRunListResponseSchema, WorkflowSubscriptionListResponseSchema, WorkflowSubscriptionRecordSchema, WorkflowSummaryDetailResponseSchema, WorkflowSummaryListResponseSchema, WorkflowSummarySchema, credential, credentialInputSchema, defineCredential, isCredentialInput, listenPortFromPublicUrl, listenPortFromUrl, mapOrganization, mapOrganizationInvitation, mapOrganizationMember, mapProject, mapProjectArtifact, mapProjectDeployment, mapProjectMember, mapProjectSettings, mapUserOrganization, mergeOrganizationSidebarBranding, mergeUserPreferences, normalizeCredentialList, normalizeLogoUrl, normalizeOrganizationSidebarBranding, normalizeUserPreferences, organizationInvitationAcceptPath, organizationSlugErrorCodeFromMessage, originFromPublicUrl, parseAgentSessionDetailInclude, parseCreateOrganizationRequest, parseErrorResponse, parseOrganizationSlug, parsePollRunRequest, parseProjectSlug, parsePromptInput, parseStoredRouteManifest, parseTriggerRunDetailInclude, parseWorkflowRunDetailInclude, previewOrganizationSlugFromName, projectFileId, projectFileLanguage, slugifyOrganizationName, slugifyProjectName, toCredentialRequirement, toolParameters, validateClaimableOrganizationSlug, validateProjectSlug, validationErrorResponse };\n\n//# sourceMappingURL=index.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;AAKA,SAAgB,OAAO,QAAQ;CAC3B,OAAOA,eAAoBC,WAAmB,MAAM;AACxD;;;ACiBA,MAAM,oBAAoB;;AAI1B,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,oBAAoB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,gBAAgB;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,0BAA0B;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,oBAAoB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,uBAAuB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAEA,MAAM,qBAAqB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;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AAqB,EAAE,CAAC;AACnG,MAAM,oCAAoCC,OAAS;CAClD,IAAIE,QAAU,IAAI;CAClB,WAAWC,SAAS,EAAE,IAAI,EAAE,YAAY;AACzC,CAAC;AAQyCH,OAAS;CAClD,OAAOO,MAPyBP,OAAS;EACzC,IAAID,OAAS;EACb,MAAMA,OAAS,EAAE,IAAI,CAAC;EACtB,MAAM;CACP,CAGgB,CAAwB;CACvC,aAAa;AACd,CAAC"}
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { $ as OrganizationSidebarBrandingPatchSchema, $t as parseErrorResponse, A as ErrorResponseSchema, At as UpdateCredentialInstanceBodySchema, B as InviteProjectMembersRequestSchema, Bt as UploadProjectSourceResponseSchema, C as CreateOrganizationResponseSchema, Ct as StartOAuthConnectionResultSchema, D as CredentialInstanceListResponseSchema, Dt as TriggerRunDetailResponseSchema, E as CreateProjectResponseSchema, Et as TriggerListResponseSchema, F as HistoryRunDetailResponseSchema, Ft as UpdateProjectMemberRequestSchema, G as ListOrganizationInvitationsResponseSchema, Gt as UserPreferencesSchema, H as ListApiKeysResponseSchema, Ht as UserAvatarPatchSchema, I as HistoryRunListQuerySchema, It as UpdateProjectMemberResponseSchema, J as ListProjectDeploymentsResponseSchema, Jt as WorkflowSummaryDetailResponseSchema, K as ListOrganizationMembersResponseSchema, Kt as WorkflowRunDetailResponseSchema, L as HistoryRunListResponseSchema, Lt as UpdateProjectRequestSchema, M as GetCredentialResponseSchema, Mt as UpdateOrganizationMemberRequestSchema, N as HealthResponseSchema, Nt as UpdateOrganizationMemberResponseSchema, O as CredentialInstanceRecordSchema, Ot as TriggerRunListResponseSchema, P as HistoryRunCancelResponseSchema, Pt as UpdateOrganizationRequestSchema, Q as ListProjectsResponseSchema, Qt as originFromPublicUrl, R as InviteOrganizationMembersRequestSchema, Rt as UpdateProjectSettingsRequestSchema, S as CreateOrganizationRequestSchema, St as StartOAuthConnectionInputSchema, T as CreateProjectRequestSchema, Tt as TriggerDetailResponseSchema, U as ListAppsResponseSchema, Ut as UserAvatarSchema, V as InviteProjectMembersResponseSchema, Vt as UpsertGatewayAttachmentBodySchema, W as ListCredentialsResponseSchema, Wt as UserPreferencesPatchSchema, X as ListProjectMembersResponseSchema, Xt as listenPortFromPublicUrl, Y as ListProjectFilesResponseSchema, Yt as WorkflowSummaryListResponseSchema, Z as ListProjectMetricsResponseSchema, _ as CreateApiKeyRequestSchema, _t as ROUTE_MANIFEST_REL_PATH, a as AgentSessionListResponseSchema, at as PresignProjectSourceRequestSchema, b as CreateCredentialsRequestSchema, bt as SkillSummaryListResponseSchema, c as BindChannelBodySchema, ct as PresignUserAvatarResponseSchema, d as ChannelConnectionSchema, dt as ProjectSettingsResponseSchema, et as OrganizationSidebarBrandingSchema, f as ChannelDirectoryListResponseSchema, ft as ProjectSlugAvailabilityResponseSchema, g as ConnectProvidersResponseSchema, gt as QueuedRunResponseSchema, h as ConnectAuthorizeUrlResponseSchema, ht as QueuedAgentPromptResponseSchema, i as AgentSessionDetailResponseSchema, it as PresignOrgLogoResponseSchema, j as GatewayAttachmentRecordSchema, jt as UpdateCredentialRequestSchema, k as DeclineOrganizationInvitationResponseSchema, kt as UpdateChannelBindingBodySchema, l as ChannelAccountListResponseSchema, lt as ProjectReachabilityResponseSchema, m as CompleteProjectArtifactResponseSchema, mt as PromptResponseSchema, n as AcceptOrganizationInvitationResponseSchema, nt as PollRunResponseSchema, o as AgentSummaryDetailResponseSchema, ot as PresignProjectSourceResponseSchema, p as ChannelPlatformSchema, pt as PromptInputSchema, q as ListOrganizationsResponseSchema, qt as WorkflowRunListResponseSchema, r as ActiveOrganizationResponseSchema, rt as PresignOrgLogoRequestSchema, s as AgentSummaryListResponseSchema, st as PresignUserAvatarRequestSchema, t as ACTIVE_ORG_HEADER, tt as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, u as ChannelConnectionListResponseSchema, ut as ProjectResponseSchema, v as CreateApiKeyResponseSchema, vt as RecentResourceListResponseSchema, w as CreateProjectArtifactResponseSchema, wt as SubmitTeamRequestRequestSchema, x as CreateCredentialsResponseSchema, xt as SlugAvailabilityResponseSchema, y as CreateCredentialInstanceBodySchema, yt as SkillSummaryDetailResponseSchema, z as InviteOrganizationMembersResponseSchema, zt as UploadProjectSourceManifestRequestSchema } from "./dist-BQXd3jdL.mjs";
2
+ import { $ as OrganizationSidebarBrandingPatchSchema, $t as parseErrorResponse, A as ErrorResponseSchema, At as UpdateCredentialInstanceBodySchema, B as InviteProjectMembersRequestSchema, Bt as UploadProjectSourceResponseSchema, C as CreateOrganizationResponseSchema, Ct as StartOAuthConnectionResultSchema, D as CredentialInstanceListResponseSchema, Dt as TriggerRunDetailResponseSchema, E as CreateProjectResponseSchema, Et as TriggerListResponseSchema, F as HistoryRunDetailResponseSchema, Ft as UpdateProjectMemberRequestSchema, G as ListOrganizationInvitationsResponseSchema, Gt as UserPreferencesSchema, H as ListApiKeysResponseSchema, Ht as UserAvatarPatchSchema, I as HistoryRunListQuerySchema, It as UpdateProjectMemberResponseSchema, J as ListProjectDeploymentsResponseSchema, Jt as WorkflowSummaryDetailResponseSchema, K as ListOrganizationMembersResponseSchema, Kt as WorkflowRunDetailResponseSchema, L as HistoryRunListResponseSchema, Lt as UpdateProjectRequestSchema, M as GetCredentialResponseSchema, Mt as UpdateOrganizationMemberRequestSchema, N as HealthResponseSchema, Nt as UpdateOrganizationMemberResponseSchema, O as CredentialInstanceRecordSchema, Ot as TriggerRunListResponseSchema, P as HistoryRunCancelResponseSchema, Pt as UpdateOrganizationRequestSchema, Q as ListProjectsResponseSchema, Qt as originFromPublicUrl, R as InviteOrganizationMembersRequestSchema, Rt as UpdateProjectSettingsRequestSchema, S as CreateOrganizationRequestSchema, St as StartOAuthConnectionInputSchema, T as CreateProjectRequestSchema, Tt as TriggerDetailResponseSchema, U as ListAppsResponseSchema, Ut as UserAvatarSchema, V as InviteProjectMembersResponseSchema, Vt as UpsertGatewayAttachmentBodySchema, W as ListCredentialsResponseSchema, Wt as UserPreferencesPatchSchema, X as ListProjectMembersResponseSchema, Xt as listenPortFromPublicUrl, Y as ListProjectFilesResponseSchema, Yt as WorkflowSummaryListResponseSchema, Z as ListProjectMetricsResponseSchema, _ as CreateApiKeyRequestSchema, _t as ROUTE_MANIFEST_REL_PATH, a as AgentSessionListResponseSchema, at as PresignProjectSourceRequestSchema, b as CreateCredentialsRequestSchema, bt as SkillSummaryListResponseSchema, c as BindChannelBodySchema, ct as PresignUserAvatarResponseSchema, d as ChannelConnectionSchema, dt as ProjectSettingsResponseSchema, et as OrganizationSidebarBrandingSchema, f as ChannelDirectoryListResponseSchema, ft as ProjectSlugAvailabilityResponseSchema, g as ConnectProvidersResponseSchema, gt as QueuedRunResponseSchema, h as ConnectAuthorizeUrlResponseSchema, ht as QueuedAgentPromptResponseSchema, i as AgentSessionDetailResponseSchema, it as PresignOrgLogoResponseSchema, j as GatewayAttachmentRecordSchema, jt as UpdateCredentialRequestSchema, k as DeclineOrganizationInvitationResponseSchema, kt as UpdateChannelBindingBodySchema, l as ChannelAccountListResponseSchema, lt as ProjectReachabilityResponseSchema, m as CompleteProjectArtifactResponseSchema, mt as PromptResponseSchema, n as AcceptOrganizationInvitationResponseSchema, nt as PollRunResponseSchema, o as AgentSummaryDetailResponseSchema, ot as PresignProjectSourceResponseSchema, p as ChannelPlatformSchema, pt as PromptInputSchema, q as ListOrganizationsResponseSchema, qt as WorkflowRunListResponseSchema, r as ActiveOrganizationResponseSchema, rt as PresignOrgLogoRequestSchema, s as AgentSummaryListResponseSchema, st as PresignUserAvatarRequestSchema, t as ACTIVE_ORG_HEADER, tt as PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, u as ChannelConnectionListResponseSchema, ut as ProjectResponseSchema, v as CreateApiKeyResponseSchema, vt as RecentResourceListResponseSchema, w as CreateProjectArtifactResponseSchema, wt as SubmitTeamRequestRequestSchema, x as CreateCredentialsResponseSchema, xt as SlugAvailabilityResponseSchema, y as CreateCredentialInstanceBodySchema, yt as SkillSummaryDetailResponseSchema, z as InviteOrganizationMembersResponseSchema, zt as UploadProjectSourceManifestRequestSchema } from "./dist-CiolnfBh.mjs";
3
3
  import { t as walkProject } from "./walk-project-171B4cvO-DJy3qZKd.mjs";
4
4
  import { a as installPlaygroundDependencies, i as installDependencies, n as buildPlaygroundWorkspace, o as resolvePackageManager, s as resolveCliRoot, t as readCliVersion } from "./version-DESgLEkE.mjs";
5
5
  import { createRequire } from "node:module";
@@ -3629,6 +3629,16 @@ function createAgentsResource(http) {
3629
3629
  } catch (error) {
3630
3630
  throw await toPlatformError(error);
3631
3631
  }
3632
+ },
3633
+ async cancelSession(sessionId) {
3634
+ try {
3635
+ const response = await http.post(`api/agents/sessions/${encodeURIComponent(sessionId)}/cancel`);
3636
+ if (response.status === 404) return null;
3637
+ const data = await response.json();
3638
+ return HistoryRunCancelResponseSchema.parse(data);
3639
+ } catch (error) {
3640
+ throw await toPlatformError(error);
3641
+ }
3632
3642
  }
3633
3643
  };
3634
3644
  }
@@ -3722,6 +3732,16 @@ function createWorkflowsResource(http) {
3722
3732
  } catch (error) {
3723
3733
  throw await toPlatformError(error);
3724
3734
  }
3735
+ },
3736
+ async cancelRun(runId) {
3737
+ try {
3738
+ const response = await http.post(`api/workflows/runs/${encodeURIComponent(runId)}/cancel`);
3739
+ if (response.status === 404) return null;
3740
+ const data = await response.json();
3741
+ return HistoryRunCancelResponseSchema.parse(data);
3742
+ } catch (error) {
3743
+ throw await toPlatformError(error);
3744
+ }
3725
3745
  }
3726
3746
  };
3727
3747
  }
@@ -4030,16 +4050,6 @@ function createHistoryResource(http) {
4030
4050
  } catch (error) {
4031
4051
  throw await toPlatformError(error);
4032
4052
  }
4033
- },
4034
- async cancel(runId) {
4035
- try {
4036
- const response = await http.post(`api/history/${encodeURIComponent(runId)}/cancel`);
4037
- if (response.status === 404) return null;
4038
- const data = await response.json();
4039
- return HistoryRunCancelResponseSchema.parse(data);
4040
- } catch (error) {
4041
- throw await toPlatformError(error);
4042
- }
4043
4053
  }
4044
4054
  };
4045
4055
  }
@@ -4722,32 +4732,6 @@ function registerAgentPromptCommand(agent) {
4722
4732
  }));
4723
4733
  }
4724
4734
  //#endregion
4725
- //#region src/commands/agent/sessions.ts
4726
- function registerAgentSessionsCommand(agent) {
4727
- const sessions = agent.command("sessions").description("List and inspect agent sessions");
4728
- sessions.command("list").description("List sessions for an agent").argument("<agentId>", "Agent key / route id").option("--limit <n>", "Page size (1–100)", "20").option("--cursor <cursor>", "Pagination cursor from a previous page").option("--status <status>", "Filter by status (running, completed, failed)").option("--source <source>", "Filter by source (api, gateway)").action((agentId, options) => runProjectCliCommand("List agent sessions failed", async ({ client }) => {
4729
- const result = await client.agents.listSessions(agentId, {
4730
- limit: Number(options.limit),
4731
- ...options.cursor ? { cursor: options.cursor } : {},
4732
- ...options.status ? { status: options.status } : {},
4733
- ...options.source ? { source: options.source } : {}
4734
- });
4735
- process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
4736
- }));
4737
- sessions.command("get").description("Get full details for an agent session").argument("<agentId>", "Agent key / route id").argument("<sessionId>", "Agent session id").option("--include <parts>", "Comma-separated: gateway, messages, events, trace").action((agentId, sessionId, options) => runProjectCliCommand("Get agent session failed", async ({ client }) => {
4738
- const result = await client.agents.getSession(agentId, sessionId, { include: options.include });
4739
- process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
4740
- }));
4741
- }
4742
- //#endregion
4743
- //#region src/commands/agent/index.ts
4744
- function registerAgentCommand(program) {
4745
- const agent = program.command("agent").description("Invoke and inspect agents");
4746
- registerAgentListCommand(agent);
4747
- registerAgentPromptCommand(agent);
4748
- registerAgentSessionsCommand(agent);
4749
- }
4750
- //#endregion
4751
4735
  //#region src/commands/project/run-project.ts
4752
4736
  async function withActivePlatformClient(config, fn) {
4753
4737
  const platform = createCliPlatformClient(config);
@@ -4817,6 +4801,52 @@ async function runProjectDelete(config, projectId) {
4817
4801
  });
4818
4802
  }
4819
4803
  //#endregion
4804
+ //#region src/commands/agent/cancel-session.ts
4805
+ async function runAgentSessionCancel(config, sessionId) {
4806
+ await withActivePlatformClient(config, async (platform) => {
4807
+ const run = await platform.agents.cancelSession(sessionId);
4808
+ process.stdout.write(`${JSON.stringify(run, null, 2)}\n`);
4809
+ });
4810
+ }
4811
+ //#endregion
4812
+ //#region src/commands/agent/sessions.ts
4813
+ function registerAgentSessionsCommand(agent) {
4814
+ const sessions = agent.command("sessions").description("List and inspect agent sessions");
4815
+ sessions.command("list").description("List sessions for an agent").argument("<agentId>", "Agent key / route id").option("--limit <n>", "Page size (1–100)", "20").option("--cursor <cursor>", "Pagination cursor from a previous page").option("--status <status>", "Filter by status (running, completed, failed)").option("--source <source>", "Filter by source (api, gateway)").action((agentId, options) => runProjectCliCommand("List agent sessions failed", async ({ client }) => {
4816
+ const result = await client.agents.listSessions(agentId, {
4817
+ limit: Number(options.limit),
4818
+ ...options.cursor ? { cursor: options.cursor } : {},
4819
+ ...options.status ? { status: options.status } : {},
4820
+ ...options.source ? { source: options.source } : {}
4821
+ });
4822
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
4823
+ }));
4824
+ sessions.command("get").description("Get full details for an agent session").argument("<agentId>", "Agent key / route id").argument("<sessionId>", "Agent session id").option("--include <parts>", "Comma-separated: gateway, messages, events, trace").action((agentId, sessionId, options) => runProjectCliCommand("Get agent session failed", async ({ client }) => {
4825
+ const result = await client.agents.getSession(agentId, sessionId, { include: options.include });
4826
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
4827
+ }));
4828
+ sessions.command("cancel").description("Cancel a running agent session").argument("<sessionId>", "Agent session id").action(async (sessionId) => {
4829
+ const config = createCliConfig();
4830
+ try {
4831
+ await runAgentSessionCancel(config, sessionId);
4832
+ } catch (error) {
4833
+ process.stderr.write(`${formatCliError(error, "Cancel agent session failed", {
4834
+ serverUrl: getPlatformUrl(config),
4835
+ webUrl: getWebUrl(config)
4836
+ })}\n`);
4837
+ process.exitCode = 1;
4838
+ }
4839
+ });
4840
+ }
4841
+ //#endregion
4842
+ //#region src/commands/agent/index.ts
4843
+ function registerAgentCommand(program) {
4844
+ const agent = program.command("agent").description("Invoke and inspect agents");
4845
+ registerAgentListCommand(agent);
4846
+ registerAgentPromptCommand(agent);
4847
+ registerAgentSessionsCommand(agent);
4848
+ }
4849
+ //#endregion
4820
4850
  //#region src/commands/api-key/run-api-key.ts
4821
4851
  async function runApiKeyList(config) {
4822
4852
  await withActivePlatformClient(config, async (platform) => {
@@ -5530,7 +5560,7 @@ function registerBuildCommand(program) {
5530
5560
  program.command("build").description("Build the keystroke project for production").option("--dir <path>", "Project directory", process.cwd()).action(async (options) => {
5531
5561
  try {
5532
5562
  const root = resolveProjectRoot(options.dir);
5533
- const { buildApp } = await import("./dist-BQ0CIkZY.mjs");
5563
+ const { buildApp } = await import("./dist-BywyQuA2.mjs");
5534
5564
  await buildApp({ root });
5535
5565
  process.stdout.write(`Built ${root}\n`);
5536
5566
  } catch (error) {
@@ -5627,7 +5657,7 @@ async function runDeploy(options) {
5627
5657
  const client = createCliPlatformClient(config);
5628
5658
  let source;
5629
5659
  if (!options.skipBuild) {
5630
- const { buildApp } = await import("./dist-BQ0CIkZY.mjs");
5660
+ const { buildApp } = await import("./dist-BywyQuA2.mjs");
5631
5661
  source = { files: (await buildApp({
5632
5662
  root,
5633
5663
  collectSources: true,
@@ -5727,7 +5757,7 @@ function runtimeChildEnv(parentEnv, overrides) {
5727
5757
  //#region src/project/bootstrap-run.ts
5728
5758
  /** Node args + env for `@keystrokehq/build` bootstrap (shared by start + dev). */
5729
5759
  async function resolveBootstrapRun(options) {
5730
- const { resolveRuntimeBuildArtifact } = await import("./dist-BQ0CIkZY.mjs");
5760
+ const { resolveRuntimeBuildArtifact } = await import("./dist-BywyQuA2.mjs");
5731
5761
  const loader = pathToFileURL(resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/runtime-loader.mjs")).href;
5732
5762
  const bootstrap = resolveRuntimeBuildArtifact(options.runtimeNodeModules, "dist/bootstrap.mjs");
5733
5763
  const args = [`--import=${loader}`];
@@ -5877,7 +5907,7 @@ async function runDev(options) {
5877
5907
  process.on("SIGINT", shutdown);
5878
5908
  process.on("SIGTERM", shutdown);
5879
5909
  try {
5880
- const { watchApp } = await import("./dist-BQ0CIkZY.mjs");
5910
+ const { watchApp } = await import("./dist-BywyQuA2.mjs");
5881
5911
  await watchApp({
5882
5912
  root,
5883
5913
  clean: false,
@@ -5919,16 +5949,10 @@ async function runHistoryGet(config, runId) {
5919
5949
  process.stdout.write(`${JSON.stringify(run, null, 2)}\n`);
5920
5950
  });
5921
5951
  }
5922
- async function runHistoryCancel(config, runId) {
5923
- await withActivePlatformClient(config, async (platform) => {
5924
- const run = await platform.history.cancel(runId);
5925
- process.stdout.write(`${JSON.stringify(run, null, 2)}\n`);
5926
- });
5927
- }
5928
5952
  //#endregion
5929
5953
  //#region src/commands/history/index.ts
5930
5954
  function registerHistoryCommand(program) {
5931
- const history = program.command("history").description("List, inspect, and cancel platform run history");
5955
+ const history = program.command("history").description("List and inspect platform run history");
5932
5956
  history.command("list").description("List runs across projects in the active organization").option("--project <id>", "Filter by project id").option("--status <status>", "Filter by status (pending, running, sleeping, waiting_hook, completed, failed, canceled)").option("--kind <kind>", "Filter by kind (workflow or agent)").option("--admin", "List all org resources (org owner or admin only)").action(async (options) => {
5933
5957
  const config = createCliConfig();
5934
5958
  try {
@@ -5958,18 +5982,6 @@ function registerHistoryCommand(program) {
5958
5982
  process.exitCode = 1;
5959
5983
  }
5960
5984
  });
5961
- history.command("cancel").description("Cancel a pending workflow run").argument("<runId>", "Run id").action(async (runId) => {
5962
- const config = createCliConfig();
5963
- try {
5964
- await runHistoryCancel(config, runId);
5965
- } catch (error) {
5966
- process.stderr.write(`${formatCliError(error, "Cancel history run failed", {
5967
- serverUrl: getPlatformUrl(config),
5968
- webUrl: getWebUrl(config)
5969
- })}\n`);
5970
- process.exitCode = 1;
5971
- }
5972
- });
5973
5985
  }
5974
5986
  //#endregion
5975
5987
  //#region src/commands/health.ts
@@ -6723,7 +6735,7 @@ async function runStart(options) {
6723
6735
  const apiPort = Number(new URL(serverUrl).port || 80);
6724
6736
  const runtimeNodeModules = resolveCliRuntimeNodeModules(resolveCliRoot(import.meta.url));
6725
6737
  ensureNativeDeps(runtimeNodeModules);
6726
- const { buildApp } = await import("./dist-BQ0CIkZY.mjs");
6738
+ const { buildApp } = await import("./dist-BywyQuA2.mjs");
6727
6739
  await buildApp({
6728
6740
  root,
6729
6741
  clean: false
@@ -6849,6 +6861,14 @@ Examples:
6849
6861
  } }));
6850
6862
  }
6851
6863
  //#endregion
6864
+ //#region src/commands/workflow/cancel-run.ts
6865
+ async function runWorkflowRunCancel(config, runId) {
6866
+ await withActivePlatformClient(config, async (platform) => {
6867
+ const run = await platform.workflows.cancelRun(runId);
6868
+ process.stdout.write(`${JSON.stringify(run, null, 2)}\n`);
6869
+ });
6870
+ }
6871
+ //#endregion
6852
6872
  //#region src/commands/workflow/runs.ts
6853
6873
  function registerWorkflowRunsCommand(workflow) {
6854
6874
  const runs = workflow.command("runs").description("List and inspect workflow runs");
@@ -6865,6 +6885,18 @@ function registerWorkflowRunsCommand(workflow) {
6865
6885
  const result = await client.workflows.getRun(workflowId, runId, { include: options.include });
6866
6886
  process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
6867
6887
  }));
6888
+ runs.command("cancel").description("Cancel a running or queued workflow run").argument("<runId>", "Workflow run id").action(async (runId) => {
6889
+ const config = createCliConfig();
6890
+ try {
6891
+ await runWorkflowRunCancel(config, runId);
6892
+ } catch (error) {
6893
+ process.stderr.write(`${formatCliError(error, "Cancel workflow run failed", {
6894
+ serverUrl: getPlatformUrl(config),
6895
+ webUrl: getWebUrl(config)
6896
+ })}\n`);
6897
+ process.exitCode = 1;
6898
+ }
6899
+ });
6868
6900
  }
6869
6901
  //#endregion
6870
6902
  //#region src/commands/workflow/index.ts