@longzai-intelligence-workflow/core 0.0.1

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 (62) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +14 -0
  3. package/coverage/.lcov.info.0d8fc8c4f6acaa77.tmp +159 -0
  4. package/coverage/.lcov.info.1ca0aee1c681607a.tmp +61 -0
  5. package/coverage/.lcov.info.5a9690152fb62c73.tmp +159 -0
  6. package/coverage/.lcov.info.984d9ad89a4b1598.tmp +12 -0
  7. package/coverage/.lcov.info.a607374a9831c63e.tmp +61 -0
  8. package/coverage/.lcov.info.b58246c9a6df7fc5.tmp +167 -0
  9. package/coverage/.lcov.info.b5f068b7c1d63f36.tmp +12 -0
  10. package/coverage/.lcov.info.bbac83a4ec8a1294.tmp +159 -0
  11. package/coverage/.lcov.info.bf3e6cf9d98abfc0.tmp +159 -0
  12. package/coverage/.lcov.info.fb2d882b78dc47d4.tmp +169 -0
  13. package/coverage/lcov.info +169 -0
  14. package/dist/index.d.ts +577 -0
  15. package/dist/index.js +8 -0
  16. package/dist/schemas-D0Zuq8_5.js +1 -0
  17. package/dist/schemas.d.ts +684 -0
  18. package/dist/schemas.js +1 -0
  19. package/docs/overview.md +17 -0
  20. package/lzi-builder.config.ts +13 -0
  21. package/lzi-dev.config.ts +7 -0
  22. package/oxlint.config.ts +6 -0
  23. package/package.json +38 -0
  24. package/src/__tests__/helpers/setup.ts +9 -0
  25. package/src/__tests__/unit/constants.test.ts +129 -0
  26. package/src/__tests__/unit/utils.test.ts +156 -0
  27. package/src/__tests__/work-item-rules.test.ts +90 -0
  28. package/src/constants/index.ts +1 -0
  29. package/src/constants/workflow.ts +114 -0
  30. package/src/index.ts +16 -0
  31. package/src/ports/action-executor.port.ts +73 -0
  32. package/src/ports/feed-event.port.ts +74 -0
  33. package/src/ports/index.ts +9 -0
  34. package/src/schemas/action-executor.schema.ts +209 -0
  35. package/src/schemas/api.schema.ts +11 -0
  36. package/src/schemas/definition.schema.ts +53 -0
  37. package/src/schemas/feed-event-trigger.schema.ts +102 -0
  38. package/src/schemas/index.ts +8 -0
  39. package/src/schemas/instance.schema.ts +47 -0
  40. package/src/schemas/monitoring.schema.ts +53 -0
  41. package/src/schemas/trigger.schema.ts +26 -0
  42. package/src/schemas/workflow-doc.schema.ts +365 -0
  43. package/src/types/action-executor.ts +64 -0
  44. package/src/types/api.ts +10 -0
  45. package/src/types/definition.ts +49 -0
  46. package/src/types/feed-event-trigger.ts +38 -0
  47. package/src/types/index.ts +6 -0
  48. package/src/types/instance.ts +49 -0
  49. package/src/types/monitoring.ts +54 -0
  50. package/src/types/trigger.ts +39 -0
  51. package/src/utils/dag.utils.ts +95 -0
  52. package/src/utils/declaration-frontmatter.utils.ts +138 -0
  53. package/src/utils/index.ts +19 -0
  54. package/src/utils/work-item-rules.utils.ts +194 -0
  55. package/tsconfig/.cache/build.tsbuildinfo +1 -0
  56. package/tsconfig/.cache/node.tsbuildinfo +1 -0
  57. package/tsconfig/.cache/test.tsbuildinfo +1 -0
  58. package/tsconfig/app.json +12 -0
  59. package/tsconfig/build.json +15 -0
  60. package/tsconfig/node.json +12 -0
  61. package/tsconfig/test.json +15 -0
  62. package/tsconfig.json +15 -0
@@ -0,0 +1,74 @@
1
+ /**
2
+ * feed 事件端口契约(W-2,Phase 2)
3
+ *
4
+ * 定义工作流引擎订阅 feed 事件的端口契约。
5
+ * feed 项目 F-2 完成事件端口暴露后,需提供实现此端口的事件总线适配器,
6
+ * 供 trigger 子插件在 type='feed.event' 时订阅 feed 事件。
7
+ *
8
+ * C1 合规:本端口为零框架依赖的纯类型契约,由 feed 项目的实现层提供具体实现。
9
+ */
10
+
11
+ import type { FeedEventFilter, FeedEventName, FeedEventPayload } from '../types';
12
+
13
+ /**
14
+ * feed 事件订阅句柄
15
+ *
16
+ * 由 subscribe 方法返回,调用 unsubscribe 取消订阅。
17
+ */
18
+ export type FeedEventSubscription = {
19
+ /**
20
+ * 取消订阅,释放底层资源
21
+ */
22
+ unsubscribe: () => Promise<void> | void;
23
+ };
24
+
25
+ /**
26
+ * feed 事件处理器
27
+ *
28
+ * 事件到达时被调用,接收事件 payload。
29
+ * 工作流引擎在此处理器中启动新的工作流实例并注入 payload 作为上下文输入。
30
+ */
31
+ export type FeedEventHandler = {
32
+ /**
33
+ * 事件处理回调
34
+ *
35
+ * @param payload - feed 事件 payload
36
+ */
37
+ handle: (payload: FeedEventPayload) => Promise<void> | void;
38
+ };
39
+
40
+ /**
41
+ * feed 事件端口
42
+ *
43
+ * 工作流引擎通过此端口订阅 feed 事件总线,
44
+ * 当 feed 项目有新条目/抓取/过滤/行业识别事件时触发回调。
45
+ *
46
+ * 依赖 feed 项目 F-2 暴露事件端口实现。
47
+ */
48
+ export type FeedEventPort = {
49
+ /**
50
+ * 订阅指定 feed 事件
51
+ *
52
+ * @param eventName - 订阅的事件名称
53
+ * @param handler - 事件处理器
54
+ * @param filter - 可选事件过滤条件
55
+ * @returns 订阅句柄,用于取消订阅
56
+ */
57
+ subscribe: (
58
+ eventName: FeedEventName,
59
+ handler: FeedEventHandler,
60
+ filter?: FeedEventFilter,
61
+ ) => Promise<FeedEventSubscription>;
62
+
63
+ /**
64
+ * 检查 feed 事件端口是否可用
65
+ *
66
+ * @returns 端口是否可用
67
+ */
68
+ isAvailable: () => Promise<boolean>;
69
+ };
70
+
71
+ /**
72
+ * feed 事件端口 DI 令牌
73
+ */
74
+ export const FEED_EVENT_PORT_TOKEN = Symbol('FEED_EVENT_PORT_TOKEN');
@@ -0,0 +1,9 @@
1
+ /**
2
+ * workflow core 端口契约导出
3
+ *
4
+ * 汇总导出工作流领域的端口契约,供适配器层实现。
5
+ * 端口契约为零框架依赖的纯类型定义,符合 C1 合规要求。
6
+ */
7
+
8
+ export * from './feed-event.port';
9
+ export * from './action-executor.port';
@@ -0,0 +1,209 @@
1
+ /**
2
+ * action 执行器 Schema 定义(W-3,Phase 2)
3
+ *
4
+ * 定义工作流内置 action 执行器的 Zod Schema 契约,
5
+ * 供 execution 子插件注册 action handler 时使用。
6
+ *
7
+ * 支持的 action 类型:
8
+ * - feed.applyTags:调用 feed F-2 applyTags,为条目打标签
9
+ * - feed.summarize:调用 feed F-3 summarize,生成摘要
10
+ * - llm.complete:调用 agent LlmCompletePort,完成文本
11
+ * - webhook.send:调用 webhook 项目,发送 webhook 请求
12
+ *
13
+ * D-08 决策:不暴露 DSL 编辑 UI,action 通过自然语言编译的 DSL 执行。
14
+ */
15
+
16
+ import { z } from 'zod';
17
+
18
+ import { ACTION_TYPES } from '../constants/workflow';
19
+
20
+ /**
21
+ * action 类型 Schema
22
+ *
23
+ * 内置 action 类型枚举。
24
+ */
25
+ export const actionTypeSchema = z.enum(ACTION_TYPES);
26
+
27
+ /**
28
+ * feed.applyTags action 输入 Schema
29
+ *
30
+ * 调用 feed F-2 applyTags 为指定条目打标签。
31
+ */
32
+ export const feedApplyTagsActionSchema = z.object({
33
+ /**
34
+ * action 类型,固定为 'feed.applyTags'
35
+ */
36
+ type: z.literal('feed.applyTags'),
37
+
38
+ /**
39
+ * 目标 feed 条目 ID
40
+ */
41
+ itemId: z.string(),
42
+
43
+ /**
44
+ * 待应用的标签列表
45
+ */
46
+ tags: z.array(z.string()),
47
+
48
+ /**
49
+ * 标签来源(默认 'workflow')
50
+ */
51
+ source: z.enum(['manual', 'rule', 'workflow']).optional(),
52
+ });
53
+
54
+ /**
55
+ * feed.summarize action 输入 Schema
56
+ *
57
+ * 调用 feed F-3 summarize 生成指定条目的摘要。
58
+ */
59
+ export const feedSummarizeActionSchema = z.object({
60
+ /**
61
+ * action 类型,固定为 'feed.summarize'
62
+ */
63
+ type: z.literal('feed.summarize'),
64
+
65
+ /**
66
+ * 目标 feed 条目 ID
67
+ */
68
+ itemId: z.string(),
69
+
70
+ /**
71
+ * 摘要级别
72
+ *
73
+ * - micro:超短摘要(卡片展示)
74
+ * - short:短摘要
75
+ * - structured:结构化摘要
76
+ */
77
+ level: z.enum(['micro', 'short', 'structured']),
78
+ });
79
+
80
+ /**
81
+ * llm.complete action 输入 Schema
82
+ *
83
+ * 调用 agent LlmCompletePort 完成文本生成。
84
+ * D-07 决策:默认走 anthropic provider。
85
+ */
86
+ export const llmCompleteActionSchema = z.object({
87
+ /**
88
+ * action 类型,固定为 'llm.complete'
89
+ */
90
+ type: z.literal('llm.complete'),
91
+
92
+ /**
93
+ * 用户输入的文本提示
94
+ */
95
+ prompt: z.string(),
96
+
97
+ /**
98
+ * 系统提示词,用于设定 LLM 角色 or 任务上下文
99
+ */
100
+ systemPrompt: z.string().optional(),
101
+
102
+ /**
103
+ * 最大生成 token 数
104
+ */
105
+ maxTokens: z.number().optional(),
106
+
107
+ /**
108
+ * 采样温度,控制输出随机性,取值范围 0-1
109
+ */
110
+ temperature: z.number().min(0).max(1).optional(),
111
+ });
112
+
113
+ /**
114
+ * webhook.send action 输入 Schema
115
+ *
116
+ * 调用 webhook 项目发送 webhook 请求。
117
+ */
118
+ export const webhookSendActionSchema = z.object({
119
+ /**
120
+ * action 类型,固定为 'webhook.send'
121
+ */
122
+ type: z.literal('webhook.send'),
123
+
124
+ /**
125
+ * 目标 webhook URL
126
+ */
127
+ url: z.string(),
128
+
129
+ /**
130
+ * HTTP 方法(默认 POST)
131
+ */
132
+ method: z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']).optional(),
133
+
134
+ /**
135
+ * 请求头
136
+ */
137
+ headers: z.record(z.string(), z.string()).optional(),
138
+
139
+ /**
140
+ * 请求体
141
+ */
142
+ body: z.unknown().optional(),
143
+ });
144
+
145
+ /**
146
+ * action 联合类型 Schema
147
+ *
148
+ * 通过 discriminatedUnion 按 type 字段区分具体 action 类型。
149
+ */
150
+ export const actionSchema = z.discriminatedUnion('type', [
151
+ feedApplyTagsActionSchema,
152
+ feedSummarizeActionSchema,
153
+ llmCompleteActionSchema,
154
+ webhookSendActionSchema,
155
+ ]);
156
+
157
+ /**
158
+ * action 执行上下文 Schema
159
+ *
160
+ * 工作流引擎在执行 action 节点时传入的上下文信息。
161
+ */
162
+ export const actionContextSchema = z.object({
163
+ /**
164
+ * 工作流实例 ID
165
+ */
166
+ instanceId: z.string(),
167
+
168
+ /**
169
+ * 工作流定义 ID
170
+ */
171
+ definitionId: z.string(),
172
+
173
+ /**
174
+ * 当前节点 ID
175
+ */
176
+ nodeId: z.string(),
177
+
178
+ /**
179
+ * 工作流变量(运行时上下文)
180
+ */
181
+ variables: z.record(z.string(), z.unknown()),
182
+
183
+ /**
184
+ * 上一节点的输出(作为当前 action 的输入)
185
+ */
186
+ input: z.unknown(),
187
+ });
188
+
189
+ /**
190
+ * action 执行结果 Schema
191
+ *
192
+ * action handler 执行完成后返回的结果。
193
+ */
194
+ export const actionResultSchema = z.object({
195
+ /**
196
+ * 是否执行成功
197
+ */
198
+ success: z.boolean(),
199
+
200
+ /**
201
+ * 执行输出数据(成功时)
202
+ */
203
+ data: z.unknown().optional(),
204
+
205
+ /**
206
+ * 错误信息(失败时)
207
+ */
208
+ error: z.string().optional(),
209
+ });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 通用 API Schema 已清理
3
+ *
4
+ * 历史上此文件导出 apiResponseSchema、paginatedResponseSchema、paginationInfoSchema、
5
+ * apiErrorSchema 等通用 API Zod Schema,但经核查无任何外部消费方
6
+ * (apps/web 与 packages/sdk 均在各自模块内本地定义 apiResponseSchema,
7
+ * 或使用 packages/sdk/src/schemas/error.schema.ts 提供的 ApiResponseSchema/PaginatedResponseSchema)。
8
+ *
9
+ * 为清理死代码,此文件内容已被清空,文件本身保留以维持包结构骨架。
10
+ */
11
+ export {};
@@ -0,0 +1,53 @@
1
+ import { z } from 'zod';
2
+
3
+ import { NODE_TYPES } from '../constants/workflow';
4
+
5
+ export const workflowNodeDtoSchema = z.object({
6
+ nodeId: z.string(),
7
+ name: z.string(),
8
+ type: z.enum(NODE_TYPES),
9
+ properties: z.record(z.string(), z.unknown()),
10
+ position: z.object({ x: z.number(), y: z.number() }),
11
+ });
12
+
13
+ export const workflowEdgeDtoSchema = z.object({
14
+ edgeId: z.string(),
15
+ sourceNodeId: z.string(),
16
+ targetNodeId: z.string(),
17
+ condition: z.string().optional(),
18
+ label: z.string().optional(),
19
+ });
20
+
21
+ export const stateTransitionDtoSchema = z.object({
22
+ from: z.string(),
23
+ to: z.string(),
24
+ event: z.string(),
25
+ guard: z.string().optional(),
26
+ action: z.string().optional(),
27
+ });
28
+
29
+ export const createDefinitionInputSchema = z.object({
30
+ name: z.string(),
31
+ description: z.string().optional(),
32
+ nodes: z.array(workflowNodeDtoSchema),
33
+ edges: z.array(workflowEdgeDtoSchema),
34
+ initialState: z.string(),
35
+ states: z.array(z.string()),
36
+ transitions: z.array(stateTransitionDtoSchema),
37
+ });
38
+
39
+ export const updateDefinitionInputSchema = createDefinitionInputSchema.partial();
40
+
41
+ export const definitionDtoSchema = z.object({
42
+ id: z.string(),
43
+ name: z.string(),
44
+ description: z.string().nullable(),
45
+ version: z.number(),
46
+ nodes: z.array(workflowNodeDtoSchema),
47
+ edges: z.array(workflowEdgeDtoSchema),
48
+ initialState: z.string(),
49
+ states: z.array(z.string()),
50
+ publishedAt: z.string().nullable(),
51
+ createdAt: z.string(),
52
+ updatedAt: z.string(),
53
+ });
@@ -0,0 +1,102 @@
1
+ /**
2
+ * feed 事件触发器 Schema 定义(W-2,Phase 2)
3
+ *
4
+ * 定义 feed 事件触发器的 Zod Schema 契约,供 trigger 子插件扩展
5
+ * type: 'feed.event' 触发器类型时使用。
6
+ *
7
+ * D-08 决策:仅自然语言输入,DSL 由系统编译,不暴露 DSL 编辑 UI,
8
+ * 故 feed 事件触发器配置由系统编译的 DSL 携带,不暴露编辑端点。
9
+ *
10
+ * 依赖 feed 项目 F-2 暴露的事件端口(FeedEventPort)。
11
+ */
12
+
13
+ import { z } from 'zod';
14
+
15
+ import { FEED_EVENT_NAMES } from '../constants/workflow';
16
+
17
+ /**
18
+ * feed 事件名称 Schema
19
+ *
20
+ * 枚举 feed 项目暴露的可订阅事件名称。
21
+ */
22
+ export const feedEventNameSchema = z.enum(FEED_EVENT_NAMES);
23
+
24
+ /**
25
+ * feed 事件过滤条件 Schema
26
+ *
27
+ * 用于在订阅 feed 事件时按信息源、订阅、行业、标签过滤,
28
+ * 仅匹配的事件才会触发工作流。
29
+ */
30
+ export const feedEventFilterSchema = z
31
+ .object({
32
+ /**
33
+ * 信息源 ID 过滤
34
+ */
35
+ sourceId: z.string().optional(),
36
+
37
+ /**
38
+ * 订阅 ID 过滤
39
+ */
40
+ subscriptionId: z.string().optional(),
41
+
42
+ /**
43
+ * 行业过滤
44
+ */
45
+ industry: z.string().optional(),
46
+
47
+ /**
48
+ * 标签过滤(匹配任一标签)
49
+ */
50
+ tags: z.array(z.string()).optional(),
51
+ })
52
+ .optional();
53
+
54
+ /**
55
+ * feed 事件触发器配置 Schema
56
+ *
57
+ * 工作流 trigger.type 为 'feed.event' 时的配置结构,
58
+ * 描述订阅的事件名称与可选过滤条件。
59
+ */
60
+ export const feedEventTriggerSchema = z.object({
61
+ /**
62
+ * 触发器类型,固定为 'feed.event'
63
+ */
64
+ type: z.literal('feed.event'),
65
+
66
+ /**
67
+ * 订阅的 feed 事件名称
68
+ */
69
+ eventName: feedEventNameSchema,
70
+
71
+ /**
72
+ * 事件过滤条件(可选)
73
+ */
74
+ filter: feedEventFilterSchema,
75
+ });
76
+
77
+ /**
78
+ * feed 事件 payload Schema
79
+ *
80
+ * feed 项目 F-2 在事件触发时传递给工作流上下文的事件数据结构。
81
+ */
82
+ export const feedEventPayloadSchema = z.object({
83
+ /**
84
+ * 触发的事件名称
85
+ */
86
+ eventName: feedEventNameSchema,
87
+
88
+ /**
89
+ * 关联的 feed 条目 ID(item.ingested/item.filtered/industry.detected 时存在)
90
+ */
91
+ itemId: z.string().optional(),
92
+
93
+ /**
94
+ * 关联的信息源 ID(source.fetched 时存在)
95
+ */
96
+ sourceId: z.string().optional(),
97
+
98
+ /**
99
+ * 事件附加数据
100
+ */
101
+ data: z.record(z.string(), z.unknown()),
102
+ });
@@ -0,0 +1,8 @@
1
+ export * from './definition.schema';
2
+ export * from './workflow-doc.schema';
3
+ export * from './instance.schema';
4
+ export * from './trigger.schema';
5
+ export * from './monitoring.schema';
6
+ export * from './feed-event-trigger.schema';
7
+ export * from './action-executor.schema';
8
+ export * from './workflow-doc.schema';
@@ -0,0 +1,47 @@
1
+ import { z } from 'zod';
2
+
3
+ import { INSTANCE_STATUSES, NODE_EXECUTION_STATUSES } from '../constants/workflow';
4
+
5
+ export const instanceStatusDtoSchema = z.enum(INSTANCE_STATUSES);
6
+
7
+ export const nodeExecutionStatusDtoSchema = z.enum(NODE_EXECUTION_STATUSES);
8
+
9
+ export const nodeExecutionDtoSchema = z.object({
10
+ id: z.string(),
11
+ instanceId: z.string(),
12
+ nodeId: z.string(),
13
+ nodeName: z.string(),
14
+ nodeType: z.string(),
15
+ status: nodeExecutionStatusDtoSchema,
16
+ startedAt: z.string().nullable(),
17
+ completedAt: z.string().nullable(),
18
+ error: z.string().nullable(),
19
+ createdAt: z.string(),
20
+ });
21
+
22
+ export const instanceDtoSchema = z.object({
23
+ id: z.string(),
24
+ definitionId: z.string(),
25
+ definitionVersion: z.number(),
26
+ status: instanceStatusDtoSchema,
27
+ currentState: z.string(),
28
+ previousState: z.string().nullable(),
29
+ currentNodeId: z.string().nullable(),
30
+ variables: z.record(z.string(), z.unknown()),
31
+ startedAt: z.string().nullable(),
32
+ completedAt: z.string().nullable(),
33
+ createdAt: z.string(),
34
+ updatedAt: z.string(),
35
+ });
36
+
37
+ export const createInstanceInputSchema = z.object({
38
+ definitionId: z.string(),
39
+ input: z.record(z.string(), z.unknown()).optional(),
40
+ });
41
+
42
+ export const instanceQueryParamsSchema = z.object({
43
+ status: instanceStatusDtoSchema.optional(),
44
+ definitionId: z.string().optional(),
45
+ page: z.number().optional(),
46
+ pageSize: z.number().optional(),
47
+ });
@@ -0,0 +1,53 @@
1
+ import { z } from 'zod';
2
+
3
+ import { ALERT_TYPES, METRIC_TYPES } from '../constants/workflow';
4
+
5
+ export const alertTypeDtoSchema = z.enum(ALERT_TYPES);
6
+
7
+ export const metricTypeDtoSchema = z.enum(METRIC_TYPES);
8
+
9
+ export const auditLogDtoSchema = z.object({
10
+ id: z.string(),
11
+ instanceId: z.string(),
12
+ nodeId: z.string().nullable(),
13
+ action: z.string(),
14
+ fromStatus: z.string().nullable(),
15
+ toStatus: z.string(),
16
+ operator: z.string().nullable(),
17
+ detail: z.record(z.string(), z.unknown()),
18
+ createdAt: z.string(),
19
+ });
20
+
21
+ export const alertDtoSchema = z.object({
22
+ id: z.string(),
23
+ definitionId: z.string(),
24
+ type: alertTypeDtoSchema,
25
+ threshold: z.number(),
26
+ notifyConfig: z.record(z.string(), z.unknown()),
27
+ enabled: z.boolean(),
28
+ lastTriggeredAt: z.string().nullable(),
29
+ createdAt: z.string(),
30
+ updatedAt: z.string(),
31
+ });
32
+
33
+ export const performanceMetricDtoSchema = z.object({
34
+ id: z.string(),
35
+ definitionId: z.string(),
36
+ metricType: metricTypeDtoSchema,
37
+ value: z.number(),
38
+ period: z.string(),
39
+ calculatedAt: z.string(),
40
+ });
41
+
42
+ export const trendPointDtoSchema = z.object({
43
+ date: z.string(),
44
+ value: z.number(),
45
+ });
46
+
47
+ export const monitoringDashboardDtoSchema = z.object({
48
+ runningInstances: z.number(),
49
+ successRate: z.number(),
50
+ avgDuration: z.number(),
51
+ failureAlerts: z.number(),
52
+ trend: z.array(trendPointDtoSchema),
53
+ });
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+
3
+ import { TRIGGER_TYPES } from '../constants/workflow';
4
+
5
+ export const triggerTypeDtoSchema = z.enum(TRIGGER_TYPES);
6
+
7
+ export const triggerDtoSchema = z.object({
8
+ id: z.string(),
9
+ definitionId: z.string(),
10
+ name: z.string(),
11
+ type: triggerTypeDtoSchema,
12
+ config: z.record(z.string(), z.unknown()),
13
+ enabled: z.boolean(),
14
+ lastTriggeredAt: z.string().nullable(),
15
+ createdAt: z.string(),
16
+ updatedAt: z.string(),
17
+ });
18
+
19
+ export const createTriggerInputSchema = z.object({
20
+ definitionId: z.string(),
21
+ name: z.string(),
22
+ type: triggerTypeDtoSchema,
23
+ config: z.record(z.string(), z.unknown()),
24
+ });
25
+
26
+ export const updateTriggerInputSchema = createTriggerInputSchema.partial();