@keystrokehq/keystroke 1.0.20 → 1.0.22

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 (55) hide show
  1. package/dist/action.cjs +1 -1
  2. package/dist/action.mjs +1 -1
  3. package/dist/agent.cjs +4 -4
  4. package/dist/agent.cjs.map +1 -1
  5. package/dist/agent.mjs +4 -4
  6. package/dist/agent.mjs.map +1 -1
  7. package/dist/app.cjs +1 -1
  8. package/dist/app.mjs +1 -1
  9. package/dist/client.cjs +1 -1
  10. package/dist/client.mjs +1 -1
  11. package/dist/config.d.cts +2 -2
  12. package/dist/config.d.cts.map +1 -1
  13. package/dist/config.d.mts +2 -2
  14. package/dist/config.d.mts.map +1 -1
  15. package/dist/credentials.cjs +1 -1
  16. package/dist/credentials.mjs +1 -1
  17. package/dist/{dist-CHlytoPR.cjs → dist-CE8Bys_M.cjs} +160 -3
  18. package/dist/dist-CE8Bys_M.cjs.map +1 -0
  19. package/dist/{dist-D_ZLF88C.mjs → dist-CYP5TXGO.mjs} +3 -3
  20. package/dist/{dist-D_ZLF88C.mjs.map → dist-CYP5TXGO.mjs.map} +1 -1
  21. package/dist/{dist-BF8uTixs.cjs → dist-CbLrJ50M.cjs} +65 -41
  22. package/dist/dist-CbLrJ50M.cjs.map +1 -0
  23. package/dist/{dist-BZaoAtmj.cjs → dist-CwfjWo4B.cjs} +3 -3
  24. package/dist/{dist-BZaoAtmj.cjs.map → dist-CwfjWo4B.cjs.map} +1 -1
  25. package/dist/{dist-Bqsbf3hX.mjs → dist-DN31JPna.mjs} +65 -41
  26. package/dist/dist-DN31JPna.mjs.map +1 -0
  27. package/dist/{dist-D0HbZRpR.mjs → dist-Kz_xVVMR.mjs} +160 -3
  28. package/dist/dist-Kz_xVVMR.mjs.map +1 -0
  29. package/dist/index-BTz2OMAM.d.cts.map +1 -1
  30. package/dist/index-Cq2F2XdS.d.mts.map +1 -1
  31. package/dist/index-WT4ULMiw.d.cts.map +1 -1
  32. package/dist/index-WT4ULMiw.d.mts.map +1 -1
  33. package/dist/{mistral-BAq-vJbL.cjs → mistral-BrDQAJSw.cjs} +2 -2
  34. package/dist/{mistral-BAq-vJbL.cjs.map → mistral-BrDQAJSw.cjs.map} +1 -1
  35. package/dist/{mistral-kplxV6Rf.mjs → mistral-j9b3vM0i.mjs} +2 -2
  36. package/dist/{mistral-kplxV6Rf.mjs.map → mistral-j9b3vM0i.mjs.map} +1 -1
  37. package/dist/{sse-DQi5Gnnd.mjs → sse-DUu9Naud.mjs} +2 -2
  38. package/dist/{sse-DQi5Gnnd.mjs.map → sse-DUu9Naud.mjs.map} +1 -1
  39. package/dist/{sse-5bXReLPW.cjs → sse-DaIihZIC.cjs} +2 -2
  40. package/dist/{sse-5bXReLPW.cjs.map → sse-DaIihZIC.cjs.map} +1 -1
  41. package/dist/trigger.cjs +68 -12
  42. package/dist/trigger.cjs.map +1 -1
  43. package/dist/trigger.d.cts +29 -5
  44. package/dist/trigger.d.cts.map +1 -1
  45. package/dist/trigger.d.mts +29 -5
  46. package/dist/trigger.d.mts.map +1 -1
  47. package/dist/trigger.mjs +66 -13
  48. package/dist/trigger.mjs.map +1 -1
  49. package/dist/workflow.cjs +1 -1
  50. package/dist/workflow.mjs +1 -1
  51. package/package.json +3 -3
  52. package/dist/dist-BF8uTixs.cjs.map +0 -1
  53. package/dist/dist-Bqsbf3hX.mjs.map +0 -1
  54. package/dist/dist-CHlytoPR.cjs.map +0 -1
  55. package/dist/dist-D0HbZRpR.mjs.map +0 -1
@@ -704,13 +704,17 @@ const storedRouteManifestEntryV2Schema = z.discriminatedUnion("kind", [
704
704
  endpoint: z.string(),
705
705
  attachmentIds: z.array(z.string()),
706
706
  moduleFile: z.string(),
707
+ /** sha256 of the trigger source file, baked at build time for overview change-detection. */
708
+ sourceHash: z.string().optional(),
707
709
  attachmentSchemas: attachmentSchemasSchema,
708
710
  attachmentMeta: attachmentMetaSchema.optional()
709
711
  }),
710
712
  z.object({
711
713
  kind: z.literal("trigger-poll"),
712
714
  attachmentId: z.string(),
715
+ attachmentIds: z.array(z.string()),
713
716
  moduleFile: z.string(),
717
+ sourceHash: z.string().optional(),
714
718
  schedule: z.string(),
715
719
  name: z.string().optional(),
716
720
  description: z.string().optional()
@@ -725,7 +729,9 @@ const storedRouteManifestEntryV2Schema = z.discriminatedUnion("kind", [
725
729
  z.object({
726
730
  kind: z.literal("cron-schedule"),
727
731
  attachmentId: z.string(),
732
+ attachmentIds: z.array(z.string()),
728
733
  moduleFile: z.string(),
734
+ sourceHash: z.string().optional(),
729
735
  schedule: z.string(),
730
736
  name: z.string().optional(),
731
737
  description: z.string().optional()
@@ -1938,6 +1944,18 @@ const TriggerRunTypeSchema = z.enum([
1938
1944
  "webhook",
1939
1945
  "poll"
1940
1946
  ]);
1947
+ const TriggerRunOutcomeSchema = z.enum([
1948
+ "dispatched",
1949
+ "skipped",
1950
+ "failed"
1951
+ ]);
1952
+ const TriggerRunReasonSchema = z.enum([
1953
+ "filter_rejected",
1954
+ "transform_undefined",
1955
+ "invalid_payload",
1956
+ "source_error",
1957
+ "handler_error"
1958
+ ]);
1941
1959
  const TriggerRunWorkflowSummarySchema = z.object({
1942
1960
  id: z.string(),
1943
1961
  status: WorkflowRunStatusSchema,
@@ -1952,8 +1970,13 @@ const TriggerRunSummarySchema = z.object({
1952
1970
  triggerType: TriggerRunTypeSchema,
1953
1971
  triggeredAt: z.string(),
1954
1972
  sourcePath: z.string().nullable(),
1955
- workflowRun: TriggerRunWorkflowSummarySchema.nullable(),
1956
- agentSession: TriggerRunAgentSessionSummarySchema.nullable()
1973
+ outcome: TriggerRunOutcomeSchema,
1974
+ reason: TriggerRunReasonSchema.nullable(),
1975
+ detail: z.string().nullable(),
1976
+ /** Workflow runs dispatched by this fire (fan-out → one per matched workflow attachment). */
1977
+ workflowRuns: z.array(TriggerRunWorkflowSummarySchema),
1978
+ /** Agent sessions dispatched by this fire (fan-out → one per matched agent attachment). */
1979
+ agentSessions: z.array(TriggerRunAgentSessionSummarySchema)
1957
1980
  });
1958
1981
  const TriggerRunRecordSchema = z.object({
1959
1982
  id: z.string(),
@@ -1961,6 +1984,9 @@ const TriggerRunRecordSchema = z.object({
1961
1984
  attachmentSlug: z.string(),
1962
1985
  triggerType: TriggerRunTypeSchema,
1963
1986
  sourcePath: z.string().nullable(),
1987
+ outcome: TriggerRunOutcomeSchema,
1988
+ reason: TriggerRunReasonSchema.nullable(),
1989
+ detail: z.string().nullable(),
1964
1990
  payload: z.unknown().nullable(),
1965
1991
  triggeredAt: z.string()
1966
1992
  });
@@ -1995,11 +2021,15 @@ const TriggerTypeSchema = z.enum([
1995
2021
  "cron"
1996
2022
  ]);
1997
2023
  const TriggerTargetKindSchema = z.enum(["workflow", "agent"]);
2024
+ const TriggerStatusSchema = z.enum(["active", "disabled"]);
1998
2025
  const TriggerListItemSchema = z.object({
1999
2026
  slug: z.string(),
2000
2027
  name: z.string().optional(),
2001
2028
  description: z.string().optional(),
2002
2029
  type: TriggerTypeSchema,
2030
+ status: TriggerStatusSchema.optional(),
2031
+ schedule: z.string().nullable().optional(),
2032
+ sourcePath: z.string().optional(),
2003
2033
  route: z.string().optional(),
2004
2034
  webhookUrl: z.string().url().optional(),
2005
2035
  targetKind: TriggerTargetKindSchema,
@@ -2008,6 +2038,133 @@ const TriggerListItemSchema = z.object({
2008
2038
  });
2009
2039
  z.object({ triggers: z.array(TriggerListItemSchema) });
2010
2040
  z.object({ endpoint: z.string().min(1).optional() });
2041
+ const TriggerAssignmentSchema = z.object({
2042
+ kind: TriggerTargetKindSchema,
2043
+ id: z.string(),
2044
+ slug: z.string(),
2045
+ name: z.string()
2046
+ });
2047
+ /** Status of the downstream run/session a dispatched fire produced. */
2048
+ const WorkspaceTriggerRunStatusSchema = z.enum([
2049
+ "completed",
2050
+ "running",
2051
+ "failed"
2052
+ ]);
2053
+ /**
2054
+ * Categorical reason a fire was recorded but produced no downstream run. These map
2055
+ * from the persisted `trigger_runs.reason` enum onto the labels the UI renders.
2056
+ */
2057
+ const WorkspaceTriggerSkipReasonSchema = z.enum([
2058
+ "filtered",
2059
+ "no_new_data",
2060
+ "transform_undefined"
2061
+ ]);
2062
+ /**
2063
+ * A single downstream run/session a dispatched fire produced. A fan-out fire can
2064
+ * dispatch several of these (multiple workflows and/or agents off one source event).
2065
+ */
2066
+ const WorkspaceTriggerRunTargetSchema = z.discriminatedUnion("kind", [z.object({
2067
+ kind: z.literal("workflow"),
2068
+ runId: z.string(),
2069
+ workflowId: z.string(),
2070
+ status: WorkspaceTriggerRunStatusSchema,
2071
+ name: z.string()
2072
+ }), z.object({
2073
+ kind: z.literal("agent"),
2074
+ sessionId: z.string(),
2075
+ agentId: z.string(),
2076
+ status: WorkspaceTriggerRunStatusSchema,
2077
+ name: z.string()
2078
+ })]);
2079
+ /**
2080
+ * Outcome of a single trigger fire — drives the run-history row presentation. Every
2081
+ * recorded fire either dispatched one or more workflow/agent targets, was skipped by
2082
+ * trigger logic, or failed before any target ran.
2083
+ */
2084
+ const WorkspaceTriggerRunOutcomeSchema = z.discriminatedUnion("kind", [
2085
+ z.object({
2086
+ kind: z.literal("dispatched"),
2087
+ targets: z.array(WorkspaceTriggerRunTargetSchema)
2088
+ }),
2089
+ z.object({
2090
+ kind: z.literal("skipped"),
2091
+ reason: WorkspaceTriggerSkipReasonSchema
2092
+ }),
2093
+ z.object({
2094
+ kind: z.literal("failed"),
2095
+ error: z.string()
2096
+ })
2097
+ ]);
2098
+ const WorkspaceTriggerSummarySchema = z.object({
2099
+ /** `triggers.id` UUID for the trigger row. */
2100
+ id: z.string(),
2101
+ slug: z.string(),
2102
+ name: z.string(),
2103
+ description: z.string().nullable(),
2104
+ type: TriggerTypeSchema,
2105
+ status: TriggerStatusSchema,
2106
+ projectId: z.string(),
2107
+ projectName: z.string(),
2108
+ /** Webhook ingress URL (webhook triggers only). */
2109
+ webhookUrl: z.string().nullable(),
2110
+ /** Cron expression or poll cadence label (cron/poll triggers only). */
2111
+ schedule: z.string().nullable(),
2112
+ /** Workflows + agents currently bound to this source. */
2113
+ assignments: z.array(TriggerAssignmentSchema),
2114
+ lastFiredAt: z.string().nullable(),
2115
+ fireCount: z.number().int().nonnegative(),
2116
+ createdAt: z.string()
2117
+ });
2118
+ WorkspaceTriggerSummarySchema.extend({
2119
+ /** Source module file path, relative to the project root. */
2120
+ sourcePath: z.string() });
2121
+ z.array(WorkspaceTriggerSummarySchema);
2122
+ const WorkspaceTriggerRunSummarySchema = z.object({
2123
+ id: z.string(),
2124
+ triggerType: TriggerTypeSchema,
2125
+ triggeredAt: z.string(),
2126
+ /** Poll/webhook source path or endpoint that produced the fire. */
2127
+ sourcePath: z.string().nullable(),
2128
+ outcome: WorkspaceTriggerRunOutcomeSchema
2129
+ });
2130
+ z.object({
2131
+ items: z.array(WorkspaceTriggerRunSummarySchema),
2132
+ nextCursor: z.string().nullable()
2133
+ });
2134
+ z.object({
2135
+ path: z.string(),
2136
+ contents: z.string()
2137
+ });
2138
+ /** Whether the LLM overview is still being produced, finished, or errored. */
2139
+ const WorkspaceTriggerOverviewStatusSchema = z.enum([
2140
+ "generating",
2141
+ "ready",
2142
+ "failed"
2143
+ ]);
2144
+ z.object({
2145
+ status: WorkspaceTriggerOverviewStatusSchema,
2146
+ markdown: z.string(),
2147
+ hash: z.string(),
2148
+ generatedAt: z.string().nullable(),
2149
+ model: z.string()
2150
+ });
2151
+ /** Inputs the worker feeds the LLM to generate a trigger overview. */
2152
+ const TriggerOverviewInputSchema = z.object({
2153
+ name: z.string(),
2154
+ description: z.string().nullable(),
2155
+ type: TriggerTypeSchema,
2156
+ schedule: z.string().nullable(),
2157
+ sourcePath: z.string(),
2158
+ sourceContents: z.string(),
2159
+ assignments: z.array(TriggerAssignmentSchema)
2160
+ });
2161
+ z.object({
2162
+ triggerId: z.string(),
2163
+ projectId: z.string(),
2164
+ triggerHash: z.string(),
2165
+ model: z.string(),
2166
+ input: TriggerOverviewInputSchema
2167
+ });
2011
2168
  const OrganizationMemberRoleSchema = z.enum([
2012
2169
  "owner",
2013
2170
  "admin",
@@ -2633,4 +2790,4 @@ function getRegisteredProjectScopeId() {
2633
2790
  //#endregion
2634
2791
  export { toCredentialRequirement as A, credential as C, isCredentialInput as D, formatMcpToolErrorMessage as E, mcpEntityId as O, buildConnectDeeplink as S, defineCredential as T, runWithMcpCredentialContext as _, getActionCredentialRequirements as a, CREDENTIAL_SCOPE_TYPES as b, getRunSignal as c, isStepInvocation as d, isWithinActionExecution as f, runOutsideActionExecution as g, resolveActionTool as h, executeAction as i, toolParameters as j, normalizeCredentialList as k, getWorkflowRunHandle as l, registerWorkflowRunGetter as m, createStepInvocation as n, getRegisteredMcpCredentialContext as o, registerProjectScopeGetter as p, defineAction as r, getRegisteredProjectScopeId as s, actionCoreSchema as t, isAction as u, runWithRunSignal as v, credentialInputSchema as w, ExecuteKeystrokeToolErrorResponseSchema as x, runWithinActionExecution as y };
2635
2792
 
2636
- //# sourceMappingURL=dist-D0HbZRpR.mjs.map
2793
+ //# sourceMappingURL=dist-Kz_xVVMR.mjs.map