@keystrokehq/keystroke 0.0.99 → 0.0.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/action.cjs +1 -1
  2. package/dist/action.mjs +1 -1
  3. package/dist/agent.cjs +5 -5
  4. package/dist/agent.cjs.map +1 -1
  5. package/dist/agent.d.cts +3 -274
  6. package/dist/agent.d.mts +3 -274
  7. package/dist/agent.mjs +5 -5
  8. package/dist/agent.mjs.map +1 -1
  9. package/dist/credentials.cjs +1 -1
  10. package/dist/credentials.mjs +1 -1
  11. package/dist/{dist-B1fqDXYa.mjs → dist-CAGgGvND.mjs} +41 -8
  12. package/dist/dist-CAGgGvND.mjs.map +1 -0
  13. package/dist/{dist-T7a5DjzV.cjs → dist-DG2RS68d.cjs} +41 -8
  14. package/dist/dist-DG2RS68d.cjs.map +1 -0
  15. package/dist/{dist-ByV6mHKd.cjs → dist-DJhg5KTL.cjs} +120 -41
  16. package/dist/{dist-ByV6mHKd.cjs.map → dist-DJhg5KTL.cjs.map} +1 -1
  17. package/dist/{dist-CxaI84Ch.cjs → dist-DKGeSeMa.cjs} +3 -3
  18. package/dist/{dist-CxaI84Ch.cjs.map → dist-DKGeSeMa.cjs.map} +1 -1
  19. package/dist/{dist-BML_gJSh.mjs → dist-DzfOPx7X.mjs} +115 -42
  20. package/dist/{dist-BML_gJSh.mjs.map → dist-DzfOPx7X.mjs.map} +1 -1
  21. package/dist/{dist-CiaGdqFg.mjs → dist-cDEt5yzO.mjs} +3 -3
  22. package/dist/{dist-CiaGdqFg.mjs.map → dist-cDEt5yzO.mjs.map} +1 -1
  23. package/dist/index-CBgXyNH2.d.mts +275 -0
  24. package/dist/index-CBgXyNH2.d.mts.map +1 -0
  25. package/dist/index-CiuCYKLw.d.cts.map +1 -1
  26. package/dist/index-CiuCYKLw.d.mts.map +1 -1
  27. package/dist/index-L5a2mf72.d.cts +275 -0
  28. package/dist/index-L5a2mf72.d.cts.map +1 -0
  29. package/dist/{mistral-BLRy436m.cjs → mistral-9mfXttcp.cjs} +2 -2
  30. package/dist/{mistral-BLRy436m.cjs.map → mistral-9mfXttcp.cjs.map} +1 -1
  31. package/dist/{mistral-CI7CQc_C.mjs → mistral-CGHbHFQG.mjs} +2 -2
  32. package/dist/{mistral-CI7CQc_C.mjs.map → mistral-CGHbHFQG.mjs.map} +1 -1
  33. package/dist/{sse-Bxvdniu5.mjs → sse-CcbP5P9d.mjs} +2 -2
  34. package/dist/{sse-Bxvdniu5.mjs.map → sse-CcbP5P9d.mjs.map} +1 -1
  35. package/dist/{sse-DGaTY14k.cjs → sse-DSHssCpN.cjs} +2 -2
  36. package/dist/{sse-DGaTY14k.cjs.map → sse-DSHssCpN.cjs.map} +1 -1
  37. package/dist/trigger.cjs +67 -30
  38. package/dist/trigger.cjs.map +1 -1
  39. package/dist/trigger.d.cts +37 -22
  40. package/dist/trigger.d.cts.map +1 -1
  41. package/dist/trigger.d.mts +37 -22
  42. package/dist/trigger.d.mts.map +1 -1
  43. package/dist/trigger.mjs +65 -31
  44. package/dist/trigger.mjs.map +1 -1
  45. package/dist/workflow.cjs +1 -1
  46. package/dist/workflow.mjs +1 -1
  47. package/package.json +1 -1
  48. package/dist/agent.d.cts.map +0 -1
  49. package/dist/agent.d.mts.map +0 -1
  50. package/dist/dist-B1fqDXYa.mjs.map +0 -1
  51. package/dist/dist-T7a5DjzV.cjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("./dist-T7a5DjzV.cjs");
2
+ const require_dist = require("./dist-DG2RS68d.cjs");
3
3
  exports.CREDENTIAL_SCOPE_LEVELS = require_dist.CREDENTIAL_SCOPE_LEVELS;
4
4
  exports.DEFAULT_CREDENTIAL_RESOLUTION_CHAIN = require_dist.DEFAULT_CREDENTIAL_RESOLUTION_CHAIN;
5
5
  exports.credential = require_dist.credential;
@@ -1,2 +1,2 @@
1
- import { _ as credentialInputSchema, b as normalizeCredentialList, g as credential, h as DEFAULT_CREDENTIAL_RESOLUTION_CHAIN, p as CREDENTIAL_SCOPE_LEVELS, v as defineCredential, x as toCredentialRequirement, y as isCredentialInput } from "./dist-B1fqDXYa.mjs";
1
+ import { _ as credentialInputSchema, b as normalizeCredentialList, g as credential, h as DEFAULT_CREDENTIAL_RESOLUTION_CHAIN, p as CREDENTIAL_SCOPE_LEVELS, v as defineCredential, x as toCredentialRequirement, y as isCredentialInput } from "./dist-CAGgGvND.mjs";
2
2
  export { CREDENTIAL_SCOPE_LEVELS, DEFAULT_CREDENTIAL_RESOLUTION_CHAIN, credential, credentialInputSchema, defineCredential, isCredentialInput, normalizeCredentialList, toCredentialRequirement };
@@ -911,6 +911,17 @@ z.union([
911
911
  SkipResponseSchema,
912
912
  z.object({ runId: z.string() })
913
913
  ]);
914
+ const RunSourceKindSchema = z.enum([
915
+ "api",
916
+ "trigger",
917
+ "gateway",
918
+ "workflow",
919
+ "agent"
920
+ ]);
921
+ z.object({
922
+ kind: RunSourceKindSchema,
923
+ id: z.string().nullable()
924
+ });
914
925
  const WorkflowRunStatusSchema = z.enum([
915
926
  "pending",
916
927
  "running",
@@ -943,6 +954,8 @@ const WorkflowRunSummarySchema = z.object({
943
954
  triggeredAt: z.string(),
944
955
  startedAt: z.string().nullable(),
945
956
  finishedAt: z.string().nullable(),
957
+ sourceKind: RunSourceKindSchema,
958
+ sourceId: z.string().nullable(),
946
959
  triggerRunId: z.string().nullable(),
947
960
  attachmentId: z.string().nullable()
948
961
  });
@@ -954,6 +967,8 @@ const WorkflowRunRecordSchema = z.object({
954
967
  triggeredAt: z.string(),
955
968
  startedAt: z.string().nullable(),
956
969
  finishedAt: z.string().nullable(),
970
+ sourceKind: RunSourceKindSchema,
971
+ sourceId: z.string().nullable(),
957
972
  triggerRunId: z.string().nullable(),
958
973
  attachmentId: z.string().nullable(),
959
974
  parentWorkflowRunId: z.string().nullable(),
@@ -1056,11 +1071,11 @@ const AgentSessionStatusSchema = z.enum([
1056
1071
  "completed",
1057
1072
  "failed"
1058
1073
  ]);
1059
- const AgentSessionSourceSchema = z.enum(["api", "gateway"]);
1060
1074
  const AgentSessionSummarySchema = z.object({
1061
1075
  id: z.string(),
1062
1076
  status: AgentSessionStatusSchema,
1063
- source: AgentSessionSourceSchema,
1077
+ source: RunSourceKindSchema,
1078
+ sourceId: z.string().nullable(),
1064
1079
  createdAt: z.string(),
1065
1080
  updatedAt: z.string(),
1066
1081
  messageCount: z.number()
@@ -1069,7 +1084,8 @@ const AgentSessionRecordSchema = z.object({
1069
1084
  id: z.string(),
1070
1085
  agentKey: z.string(),
1071
1086
  status: AgentSessionStatusSchema,
1072
- source: AgentSessionSourceSchema,
1087
+ source: RunSourceKindSchema,
1088
+ sourceId: z.string().nullable(),
1073
1089
  createdAt: z.string(),
1074
1090
  updatedAt: z.string(),
1075
1091
  parentSpanId: z.string().nullable(),
@@ -1080,7 +1096,7 @@ z.object({
1080
1096
  limit: z.coerce.number().int().min(1).max(100).optional().default(20),
1081
1097
  cursor: z.string().min(1).optional(),
1082
1098
  status: AgentSessionStatusSchema.optional(),
1083
- source: AgentSessionSourceSchema.optional()
1099
+ source: RunSourceKindSchema.optional()
1084
1100
  });
1085
1101
  z.object({
1086
1102
  items: z.array(AgentSessionSummarySchema),
@@ -1193,12 +1209,17 @@ const TriggerRunWorkflowSummarySchema = z.object({
1193
1209
  status: WorkflowRunStatusSchema,
1194
1210
  workflowKey: z.string()
1195
1211
  });
1212
+ const TriggerRunAgentSessionSummarySchema = z.object({
1213
+ id: z.string(),
1214
+ agentKey: z.string()
1215
+ });
1196
1216
  const TriggerRunSummarySchema = z.object({
1197
1217
  id: z.string(),
1198
1218
  triggerType: TriggerRunTypeSchema,
1199
1219
  triggeredAt: z.string(),
1200
1220
  sourcePath: z.string().nullable(),
1201
- workflowRun: TriggerRunWorkflowSummarySchema.nullable()
1221
+ workflowRun: TriggerRunWorkflowSummarySchema.nullable(),
1222
+ agentSession: TriggerRunAgentSessionSummarySchema.nullable()
1202
1223
  });
1203
1224
  const TriggerRunRecordSchema = z.object({
1204
1225
  id: z.string(),
@@ -1218,11 +1239,20 @@ z.object({
1218
1239
  items: z.array(TriggerRunSummarySchema),
1219
1240
  nextCursor: z.string().nullable()
1220
1241
  });
1221
- z.enum(["workflows", "trace"]);
1242
+ z.enum([
1243
+ "workflows",
1244
+ "agents",
1245
+ "trace"
1246
+ ]);
1222
1247
  z.object({ include: z.string().optional() });
1248
+ const TriggerRunAgentSessionDetailSchema = z.object({
1249
+ id: z.string(),
1250
+ agentKey: z.string()
1251
+ });
1223
1252
  z.object({
1224
1253
  run: TriggerRunRecordSchema,
1225
1254
  workflowRuns: z.array(WorkflowRunSummarySchema),
1255
+ agentSessions: z.array(TriggerRunAgentSessionDetailSchema),
1226
1256
  trace: TraceResponseSchema.nullable()
1227
1257
  });
1228
1258
  const TriggerTypeSchema = z.enum([
@@ -1230,12 +1260,15 @@ const TriggerTypeSchema = z.enum([
1230
1260
  "poll",
1231
1261
  "cron"
1232
1262
  ]);
1263
+ const TriggerTargetKindSchema = z.enum(["workflow", "agent"]);
1233
1264
  const TriggerListItemSchema = z.object({
1234
1265
  key: z.string(),
1235
1266
  type: TriggerTypeSchema,
1236
1267
  route: z.string().optional(),
1237
1268
  webhookUrl: z.string().url().optional(),
1238
- workflowKey: z.string()
1269
+ targetKind: TriggerTargetKindSchema,
1270
+ workflowKey: z.string().optional(),
1271
+ agentKey: z.string().optional()
1239
1272
  });
1240
1273
  z.object({ triggers: z.array(TriggerListItemSchema) });
1241
1274
  z.object({ endpoint: z.string().min(1).optional() });
@@ -1499,4 +1532,4 @@ function resolveActionTool(action, options) {
1499
1532
  //#endregion
1500
1533
  export { credentialInputSchema as _, getActionCredentialRequirements as a, normalizeCredentialList as b, isStepInvocation as c, runOutsideActionExecution as d, runWithinActionExecution as f, credential as g, DEFAULT_CREDENTIAL_RESOLUTION_CHAIN as h, executeAction as i, registerWorkflowRunGetter as l, CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE as m, createStepInvocation as n, getWorkflowRunHandle as o, CREDENTIAL_SCOPE_LEVELS as p, defineAction as r, isAction as s, actionCoreSchema as t, resolveActionTool as u, defineCredential as v, toCredentialRequirement as x, isCredentialInput as y };
1501
1534
 
1502
- //# sourceMappingURL=dist-B1fqDXYa.mjs.map
1535
+ //# sourceMappingURL=dist-CAGgGvND.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dist-CAGgGvND.mjs","names":[],"sources":["../../shared/dist/index.mjs","../../action/dist/index.mjs"],"sourcesContent":["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\");\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(/[^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/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/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 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\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(\"agent-sessions-list\"),\n\t\tmethod: z.literal(\"GET\"),\n\t\tpath: z.string(),\n\t\tagentId: 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\tagentId: 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\tworkflowId: z.string(),\n\t\tworkflowName: z.string().optional(),\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\tworkflowId: 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\tworkflowId: 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\tintegrations: z.array(z.string()).optional()\n});\nfunction parseStoredRouteManifest(value) {\n\treturn StoredRouteManifestSchema.parse(value);\n}\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/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 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});\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$2 = z.string().datetime();\nconst OrganizationSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tslug: OrganizationSlugSchema,\n\tcreatedAt: isoDateTime$2,\n\tupdatedAt: isoDateTime$2\n});\nconst ProjectSchema = z.object({\n\tid: z.string(),\n\torganizationId: z.string(),\n\tname: z.string(),\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$2,\n\tupdatedAt: isoDateTime$2\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 SetActiveOrganizationRequestSchema = z.object({ organizationId: z.string().min(1) });\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({ slug: ClaimableOrganizationSlugSchema });\nconst CreateOrganizationResponseSchema = z.object({ organization: UserOrganizationSchema });\nconst ListProjectsResponseSchema = z.object({ projects: z.array(ProjectSchema) });\nconst CreateProjectRequestSchema = z.object({\n\tname: z.string().trim().min(1),\n\tdescription: z.string().trim().min(1).optional()\n});\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\"completed\",\n\t\"failed\"\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]);\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\tworkflowKey: 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\tattachmentKey: 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\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 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]);\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\tagentKey: 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\tattachmentKey: 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\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\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/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\tworkflowKey: z.string()\n});\nconst TriggerRunAgentSessionSummarySchema = z.object({\n\tid: z.string(),\n\tagentKey: 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\tattachmentKey: 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\tagentKey: 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$1 = 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$1.optional(),\n\tlastActiveAt: isoDateTime$1.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/project-artifacts.ts\nconst ProjectArtifactStatusSchema = z.enum([\"pending\", \"ready\"]);\nconst isoDateTime = 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,\n\tupdatedAt: isoDateTime\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});\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\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-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\nexport { ACTIVE_ORG_COOKIE, ACTIVE_ORG_HEADER, AcceptOrganizationInvitationResponseSchema, ActiveOrganizationResponseSchema, AgentListResponseSchema, AgentSessionDetailQuerySchema, AgentSessionDetailResponseSchema, AgentSessionListQuerySchema, AgentSessionListResponseSchema, CREDENTIAL_AUTH_KINDS, CREDENTIAL_SCOPE_LEVELS, CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE, CREDENTIAL_SCOPE_TYPES, ClaimableOrganizationSlugSchema, CompleteProjectArtifactResponseSchema, ConnectAuthorizeUrlResponseSchema, ConnectProvidersResponseSchema, CreateCredentialInstanceBodySchema, CreateOrganizationRequestSchema, CreateOrganizationResponseSchema, CreateProjectArtifactResponseSchema, CreateProjectRequestSchema, CreateProjectResponseSchema, CredentialAuthKindSchema, CredentialInstanceListResponseSchema, CredentialInstanceRecordSchema, CredentialScopeLevelSchema, CredentialScopeTypeSchema, CurrentOrganizationResponseSchema, DEFAULT_CREDENTIAL_RESOLUTION_CHAIN, DISCOVERY_CONVENTIONS, DeclineOrganizationInvitationResponseSchema, ErrorResponseCodeSchema, ErrorResponseSchema, GatewayAttachmentListResponseSchema, GatewayAttachmentRecordSchema, HealthResponseSchema, InvitableOrganizationMemberRoleSchema, InviteOrganizationMembersRequestSchema, InviteOrganizationMembersResponseSchema, ListOrganizationInvitationsResponseSchema, ListOrganizationMembersResponseSchema, ListOrganizationsResponseSchema, ListProjectsResponseSchema, ORGANIZATION_SLUG_TAKEN_MESSAGE, OrganizationInvitationSchema, OrganizationMemberRoleSchema, OrganizationMemberSchema, OrganizationMemberStatusSchema, OrganizationSchema, OrganizationSlugErrorCodeSchema, OrganizationSlugSchema, OrganizationUserRoleSchema, PROJECT_PING_TIMEOUT_MS, PROJECT_REACHABILITY_REQUEST_TIMEOUT_MS, PROJECT_REACHABILITY_RETRY_MS, PlatformInfoResponseSchema, PollRunRequestSchema, PollRunResponseSchema, ProjectArtifactSchema, ProjectArtifactStatusSchema, ProjectReachabilityResponseSchema, ProjectResponseSchema, ProjectSchema, ProjectStatusSchema, PromptInputSchema, PromptResponseSchema, QueuedAgentPromptResponseSchema, QueuedRunResponseSchema, RESERVED_ORGANIZATION_SLUGS, ROUTE_MANIFEST_HTTP_PATH, ROUTE_MANIFEST_REL_PATH, RunSourceKindSchema, RunSourceSchema, SetActiveOrganizationRequestSchema, SkipResponseSchema, SlugAvailabilityQuerySchema, SlugAvailabilityReasonSchema, SlugAvailabilityResponseSchema, StoredRouteManifestSchema, TriggerDetailResponseSchema, TriggerListItemSchema, TriggerListQuerySchema, TriggerListResponseSchema, TriggerRunDetailQuerySchema, TriggerRunDetailResponseSchema, TriggerRunListQuerySchema, TriggerRunListResponseSchema, TriggerTypeSchema, UpdateCredentialInstanceBodySchema, UpdateOrganizationMemberRequestSchema, UpdateOrganizationMemberResponseSchema, UpdateOrganizationRequestSchema, UpsertGatewayAttachmentBodySchema, UpsertWorkflowSubscriptionBodySchema, UserOrganizationSchema, ValidationErrorDetailSchema, WorkflowEventTypeSchema, WorkflowRunDetailQuerySchema, WorkflowRunDetailResponseSchema, WorkflowRunListQuerySchema, WorkflowRunListResponseSchema, WorkflowSubscriptionListResponseSchema, WorkflowSubscriptionRecordSchema, credential, credentialInputSchema, defineCredential, isCredentialInput, listenPortFromPublicUrl, listenPortFromUrl, mapOrganization, mapOrganizationInvitation, mapOrganizationMember, mapProject, mapProjectArtifact, mapUserOrganization, normalizeCredentialList, organizationInvitationAcceptPath, organizationSlugErrorCodeFromMessage, originFromPublicUrl, parseAgentSessionDetailInclude, parseCreateOrganizationRequest, parseErrorResponse, parseOrganizationSlug, parsePollRunRequest, parsePromptInput, parseStoredRouteManifest, parseTriggerRunDetailInclude, parseWorkflowRunDetailInclude, previewOrganizationSlugFromName, slugifyOrganizationName, toCredentialRequirement, validateClaimableOrganizationSlug, validationErrorResponse };\n\n//# sourceMappingURL=index.mjs.map","import { z } from \"zod\";\nimport { CREDENTIAL_SCOPE_LEVELS, DEFAULT_CREDENTIAL_RESOLUTION_CHAIN, credential, credentialInputSchema, defineCredential, isCredentialInput, normalizeCredentialList, toCredentialRequirement } from \"@keystrokehq/shared\";\nimport { AsyncLocalStorage } from \"node:async_hooks\";\n//#region src/action-definition.ts\nconst zodSchema = z.custom((v) => v instanceof z.ZodType, \"must be a Zod schema\");\n/** Runtime validation for an unbranded action definition. */\nconst actionCoreSchema = z.object({\n\tkey: z.string().trim().min(1),\n\tname: z.string().trim().min(1),\n\tdescription: z.string().optional(),\n\tinput: zodSchema,\n\toutput: zodSchema,\n\tcredentials: z.array(credentialInputSchema).optional(),\n\trun: z.function()\n});\nconst ACTION = Symbol.for(\"keystroke.action\");\n/**\n* Validates brand + shape via `actionCoreSchema` so discovery and guards reject\n* malformed definitions.\n*/\nfunction isAction(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tif (!(ACTION in value) || value[ACTION] !== true) return false;\n\treturn actionCoreSchema.safeParse(value).success;\n}\nfunction getActionCredentialRequirements(action) {\n\treturn action.credentials;\n}\n//#endregion\n//#region src/action-execution-context.ts\n/**\n* Tracks the action whose `run` is currently executing. Actions are leaf units:\n* orchestration belongs in workflows, not inside another action. We use this to\n* reject an action that tries to invoke another action's `run` (directly or as a\n* step) while one is already on the stack.\n*/\nconst executingAction = new AsyncLocalStorage();\n/**\n* Runs an action's `run` body. Throws if another action is already executing in\n* the current async context — that means an action called another action.\n*/\nfunction runWithinActionExecution(actionKey, run) {\n\tconst parentKey = executingAction.getStore();\n\tif (parentKey !== void 0) throw new Error(`Action \"${actionKey}\" was invoked from inside action \"${parentKey}\". Actions are leaf units — an action must not call another action. Orchestrate actions in a workflow (src/workflows/), or attach the action directly as an agent tool (src/agents/).`);\n\treturn executingAction.run(actionKey, run);\n}\n/**\n* Resets the action-execution context for the duration of `fn`. Agent tool calls\n* are fresh top-level executions even when the agent was prompted from inside an\n* action, so calling actions as agent tools must not trip the guard.\n*/\nfunction runOutsideActionExecution(fn) {\n\treturn executingAction.exit(fn);\n}\n//#endregion\n//#region src/workflow-run-registry.ts\nconst REGISTRY_KEY = Symbol.for(\"keystroke.workflowRunGetter\");\nfunction registry() {\n\tconst globalScope = globalThis;\n\tif (!globalScope[REGISTRY_KEY]) globalScope[REGISTRY_KEY] = {};\n\treturn globalScope[REGISTRY_KEY];\n}\nfunction registerWorkflowRunGetter(fn) {\n\tregistry().getter = fn;\n}\nfunction getWorkflowRunHandle() {\n\treturn registry().getter?.();\n}\n//#endregion\n//#region src/step-invocation.ts\nfunction buildSelectionForAction(action, instanceId) {\n\tif (!action.credentials?.length) return {};\n\tconst requirements = normalizeCredentialList(action.credentials);\n\treturn Object.fromEntries(requirements.map((requirement) => [requirement.key, instanceId]));\n}\nfunction executeStep(state) {\n\tif (state.input === void 0) throw new Error(`Step \"${state.action.key}\" has no input. Call .run(input) before awaiting or chaining .scope().`);\n\tconst handle = getWorkflowRunHandle();\n\tif (!handle) throw new Error(`Step \"${state.action.key}\" must run inside a workflow or be called as .run(input, credentials) in tests.`);\n\treturn handle.actionRunner(state.action, state.input, {\n\t\tid: state.id,\n\t\tcredentialChain: state.chain,\n\t\tcredentialSelection: state.selection\n\t});\n}\nfunction isStepInvocation(value) {\n\treturn typeof value === \"object\" && value !== null && \"then\" in value && typeof value.then === \"function\" && \"scope\" in value && typeof value.scope === \"function\";\n}\nfunction createStepInvocation(state) {\n\treturn {\n\t\tscope(...chain) {\n\t\t\treturn createStepInvocation({\n\t\t\t\t...state,\n\t\t\t\tchain: chain.length > 0 ? chain : state.chain\n\t\t\t});\n\t\t},\n\t\tselect(instanceIdOrMap) {\n\t\t\tconst nextSelection = typeof instanceIdOrMap === \"string\" ? buildSelectionForAction(state.action, instanceIdOrMap) : instanceIdOrMap;\n\t\t\treturn createStepInvocation({\n\t\t\t\t...state,\n\t\t\t\tselection: {\n\t\t\t\t\t...state.selection,\n\t\t\t\t\t...nextSelection\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\trun(input) {\n\t\t\treturn createStepInvocation({\n\t\t\t\t...state,\n\t\t\t\tinput\n\t\t\t});\n\t\t},\n\t\tstepId(id) {\n\t\t\treturn createStepInvocation({\n\t\t\t\t...state,\n\t\t\t\tid\n\t\t\t});\n\t\t},\n\t\tthen(onfulfilled, onrejected) {\n\t\t\treturn executeStep(state).then(onfulfilled, onrejected);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/define-action.ts\nfunction attachStepApi(action) {\n\tconst execute = action.run.bind(action);\n\tconst stepAction = action;\n\treturn {\n\t\t...action,\n\t\trun(input, credentials) {\n\t\t\tif (credentials !== void 0) return execute(input, credentials);\n\t\t\treturn createStepInvocation({\n\t\t\t\taction: stepAction,\n\t\t\t\tinput\n\t\t\t});\n\t\t},\n\t\tscope(...chain) {\n\t\t\treturn createStepInvocation({\n\t\t\t\taction: stepAction,\n\t\t\t\tinput: void 0,\n\t\t\t\tchain\n\t\t\t});\n\t\t}\n\t};\n}\nfunction defineAction(def) {\n\tconst result = actionCoreSchema.safeParse(def);\n\tif (!result.success) throw new Error(`Invalid action definition: ${formatIssues(result.error.issues)}`);\n\tconst guardedRun = (input, credentials) => runWithinActionExecution(result.data.key, () => def.run(input, credentials));\n\treturn attachStepApi({\n\t\t...result.data,\n\t\trun: guardedRun,\n\t\tcredentials: def.credentials,\n\t\t[ACTION]: true\n\t});\n}\nfunction formatIssues(issues) {\n\treturn issues.map((issue) => {\n\t\treturn `${issue.path.length > 0 ? `${issue.path.join(\".\")}: ` : \"\"}${issue.message}`;\n\t}).join(\"; \");\n}\n//#endregion\n//#region src/execute-action.ts\nasync function executeAction(action, input, credentials = {}) {\n\tconst validatedInput = action.input.parse(input);\n\tconst result = await action.run(validatedInput, credentials);\n\treturn action.output.parse(result);\n}\n//#endregion\n//#region src/resolve-action-tool.ts\nfunction resolveActionTool(action, options) {\n\tconst consumer = options?.consumer ?? {\n\t\tkind: \"tool\",\n\t\tname: action.key\n\t};\n\treturn {\n\t\tname: action.key,\n\t\tlabel: action.name,\n\t\tdescription: action.description ?? action.name,\n\t\tparameters: z.toJSONSchema(action.input, { target: \"openapi-3.0\" }),\n\t\tasync execute(_toolCallId, params, _signal) {\n\t\t\tconst requirements = getActionCredentialRequirements(action);\n\t\t\tlet credentials = {};\n\t\t\tif (requirements?.length) {\n\t\t\t\tif (!options?.resolveCredentials) throw new Error(`Missing credential resolver for action \"${action.key}\"`);\n\t\t\t\tcredentials = await options.resolveCredentials(requirements, consumer, options.contextOverride);\n\t\t\t}\n\t\t\tconst output = await runOutsideActionExecution(() => executeAction(action, params, credentials));\n\t\t\treturn {\n\t\t\t\tcontent: [{\n\t\t\t\t\ttype: \"text\",\n\t\t\t\t\ttext: JSON.stringify(output)\n\t\t\t\t}],\n\t\t\t\tdetails: output\n\t\t\t};\n\t\t}\n\t};\n}\n//#endregion\nexport { CREDENTIAL_SCOPE_LEVELS, DEFAULT_CREDENTIAL_RESOLUTION_CHAIN, actionCoreSchema, createStepInvocation, credential, credentialInputSchema, defineAction, defineCredential, executeAction, getActionCredentialRequirements, getWorkflowRunHandle, isAction, isCredentialInput, isStepInvocation, normalizeCredentialList, registerWorkflowRunGetter, resolveActionTool, runOutsideActionExecution, runWithinActionExecution, toCredentialRequirement };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;AA4BA,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;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;CAC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;CACA,OAAO;EACN,MAAM,OAAO;EACb,OAAO,OAAO;EACd,aAAa,OAAO,eAAe,OAAO;EAC1C,YAAY,EAAE,aAAa,OAAO,OAAO,EAAE,QAAQ,cAAc,CAAC;EAClE,MAAM,QAAQ,aAAa,QAAQ,SAAS;GAC3C,MAAM,eAAe,gCAAgC,MAAM;GAC3D,IAAI,cAAc,CAAC;GACnB,IAAI,cAAc,QAAQ;IACzB,IAAI,CAAC,SAAS,oBAAoB,MAAM,IAAI,MAAM,2CAA2C,OAAO,IAAI,EAAE;IAC1G,cAAc,MAAM,QAAQ,mBAAmB,cAAc,UAAU,QAAQ,eAAe;GAC/F;GACA,MAAM,SAAS,MAAM,gCAAgC,cAAc,QAAQ,QAAQ,WAAW,CAAC;GAC/F,OAAO;IACN,SAAS,CAAC;KACT,MAAM;KACN,MAAM,KAAK,UAAU,MAAM;IAC5B,CAAC;IACD,SAAS;GACV;EACD;CACD;AACD"}
@@ -911,6 +911,17 @@ zod.z.union([
911
911
  SkipResponseSchema,
912
912
  zod.z.object({ runId: zod.z.string() })
913
913
  ]);
914
+ const RunSourceKindSchema = zod.z.enum([
915
+ "api",
916
+ "trigger",
917
+ "gateway",
918
+ "workflow",
919
+ "agent"
920
+ ]);
921
+ zod.z.object({
922
+ kind: RunSourceKindSchema,
923
+ id: zod.z.string().nullable()
924
+ });
914
925
  const WorkflowRunStatusSchema = zod.z.enum([
915
926
  "pending",
916
927
  "running",
@@ -943,6 +954,8 @@ const WorkflowRunSummarySchema = zod.z.object({
943
954
  triggeredAt: zod.z.string(),
944
955
  startedAt: zod.z.string().nullable(),
945
956
  finishedAt: zod.z.string().nullable(),
957
+ sourceKind: RunSourceKindSchema,
958
+ sourceId: zod.z.string().nullable(),
946
959
  triggerRunId: zod.z.string().nullable(),
947
960
  attachmentId: zod.z.string().nullable()
948
961
  });
@@ -954,6 +967,8 @@ const WorkflowRunRecordSchema = zod.z.object({
954
967
  triggeredAt: zod.z.string(),
955
968
  startedAt: zod.z.string().nullable(),
956
969
  finishedAt: zod.z.string().nullable(),
970
+ sourceKind: RunSourceKindSchema,
971
+ sourceId: zod.z.string().nullable(),
957
972
  triggerRunId: zod.z.string().nullable(),
958
973
  attachmentId: zod.z.string().nullable(),
959
974
  parentWorkflowRunId: zod.z.string().nullable(),
@@ -1056,11 +1071,11 @@ const AgentSessionStatusSchema = zod.z.enum([
1056
1071
  "completed",
1057
1072
  "failed"
1058
1073
  ]);
1059
- const AgentSessionSourceSchema = zod.z.enum(["api", "gateway"]);
1060
1074
  const AgentSessionSummarySchema = zod.z.object({
1061
1075
  id: zod.z.string(),
1062
1076
  status: AgentSessionStatusSchema,
1063
- source: AgentSessionSourceSchema,
1077
+ source: RunSourceKindSchema,
1078
+ sourceId: zod.z.string().nullable(),
1064
1079
  createdAt: zod.z.string(),
1065
1080
  updatedAt: zod.z.string(),
1066
1081
  messageCount: zod.z.number()
@@ -1069,7 +1084,8 @@ const AgentSessionRecordSchema = zod.z.object({
1069
1084
  id: zod.z.string(),
1070
1085
  agentKey: zod.z.string(),
1071
1086
  status: AgentSessionStatusSchema,
1072
- source: AgentSessionSourceSchema,
1087
+ source: RunSourceKindSchema,
1088
+ sourceId: zod.z.string().nullable(),
1073
1089
  createdAt: zod.z.string(),
1074
1090
  updatedAt: zod.z.string(),
1075
1091
  parentSpanId: zod.z.string().nullable(),
@@ -1080,7 +1096,7 @@ zod.z.object({
1080
1096
  limit: zod.z.coerce.number().int().min(1).max(100).optional().default(20),
1081
1097
  cursor: zod.z.string().min(1).optional(),
1082
1098
  status: AgentSessionStatusSchema.optional(),
1083
- source: AgentSessionSourceSchema.optional()
1099
+ source: RunSourceKindSchema.optional()
1084
1100
  });
1085
1101
  zod.z.object({
1086
1102
  items: zod.z.array(AgentSessionSummarySchema),
@@ -1193,12 +1209,17 @@ const TriggerRunWorkflowSummarySchema = zod.z.object({
1193
1209
  status: WorkflowRunStatusSchema,
1194
1210
  workflowKey: zod.z.string()
1195
1211
  });
1212
+ const TriggerRunAgentSessionSummarySchema = zod.z.object({
1213
+ id: zod.z.string(),
1214
+ agentKey: zod.z.string()
1215
+ });
1196
1216
  const TriggerRunSummarySchema = zod.z.object({
1197
1217
  id: zod.z.string(),
1198
1218
  triggerType: TriggerRunTypeSchema,
1199
1219
  triggeredAt: zod.z.string(),
1200
1220
  sourcePath: zod.z.string().nullable(),
1201
- workflowRun: TriggerRunWorkflowSummarySchema.nullable()
1221
+ workflowRun: TriggerRunWorkflowSummarySchema.nullable(),
1222
+ agentSession: TriggerRunAgentSessionSummarySchema.nullable()
1202
1223
  });
1203
1224
  const TriggerRunRecordSchema = zod.z.object({
1204
1225
  id: zod.z.string(),
@@ -1218,11 +1239,20 @@ zod.z.object({
1218
1239
  items: zod.z.array(TriggerRunSummarySchema),
1219
1240
  nextCursor: zod.z.string().nullable()
1220
1241
  });
1221
- zod.z.enum(["workflows", "trace"]);
1242
+ zod.z.enum([
1243
+ "workflows",
1244
+ "agents",
1245
+ "trace"
1246
+ ]);
1222
1247
  zod.z.object({ include: zod.z.string().optional() });
1248
+ const TriggerRunAgentSessionDetailSchema = zod.z.object({
1249
+ id: zod.z.string(),
1250
+ agentKey: zod.z.string()
1251
+ });
1223
1252
  zod.z.object({
1224
1253
  run: TriggerRunRecordSchema,
1225
1254
  workflowRuns: zod.z.array(WorkflowRunSummarySchema),
1255
+ agentSessions: zod.z.array(TriggerRunAgentSessionDetailSchema),
1226
1256
  trace: TraceResponseSchema.nullable()
1227
1257
  });
1228
1258
  const TriggerTypeSchema = zod.z.enum([
@@ -1230,12 +1260,15 @@ const TriggerTypeSchema = zod.z.enum([
1230
1260
  "poll",
1231
1261
  "cron"
1232
1262
  ]);
1263
+ const TriggerTargetKindSchema = zod.z.enum(["workflow", "agent"]);
1233
1264
  const TriggerListItemSchema = zod.z.object({
1234
1265
  key: zod.z.string(),
1235
1266
  type: TriggerTypeSchema,
1236
1267
  route: zod.z.string().optional(),
1237
1268
  webhookUrl: zod.z.string().url().optional(),
1238
- workflowKey: zod.z.string()
1269
+ targetKind: TriggerTargetKindSchema,
1270
+ workflowKey: zod.z.string().optional(),
1271
+ agentKey: zod.z.string().optional()
1239
1272
  });
1240
1273
  zod.z.object({ triggers: zod.z.array(TriggerListItemSchema) });
1241
1274
  zod.z.object({ endpoint: zod.z.string().min(1).optional() });
@@ -1624,4 +1657,4 @@ Object.defineProperty(exports, "toCredentialRequirement", {
1624
1657
  }
1625
1658
  });
1626
1659
 
1627
- //# sourceMappingURL=dist-T7a5DjzV.cjs.map
1660
+ //# sourceMappingURL=dist-DG2RS68d.cjs.map