@nebulaos/core 0.1.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 (150) hide show
  1. package/README.md +206 -0
  2. package/dist/__tests__/mocks/mock-provider.d.ts +15 -0
  3. package/dist/__tests__/mocks/mock-provider.js +44 -0
  4. package/dist/agent/Agent.d.ts +96 -0
  5. package/dist/agent/Agent.js +861 -0
  6. package/dist/agent/BaseAgent.d.ts +53 -0
  7. package/dist/agent/BaseAgent.js +126 -0
  8. package/dist/agent/events/events.d.ts +14 -0
  9. package/dist/agent/events/events.js +2 -0
  10. package/dist/agent/events/events.spec.d.ts +1 -0
  11. package/dist/agent/events/events.spec.js +75 -0
  12. package/dist/agent/instruction/index.d.ts +23 -0
  13. package/dist/agent/instruction/index.js +76 -0
  14. package/dist/agent/memory/in-memory.d.ts +24 -0
  15. package/dist/agent/memory/in-memory.js +78 -0
  16. package/dist/agent/memory/index.d.ts +2 -0
  17. package/dist/agent/memory/index.js +18 -0
  18. package/dist/agent/memory/memory.d.ts +43 -0
  19. package/dist/agent/memory/memory.js +7 -0
  20. package/dist/agent/provider/file-parts.spec.d.ts +1 -0
  21. package/dist/agent/provider/file-parts.spec.js +83 -0
  22. package/dist/agent/provider/index.d.ts +130 -0
  23. package/dist/agent/provider/index.js +8 -0
  24. package/dist/agent/skills/index.d.ts +61 -0
  25. package/dist/agent/skills/index.js +9 -0
  26. package/dist/agent/tools/index.d.ts +35 -0
  27. package/dist/agent/tools/index.js +87 -0
  28. package/dist/cost/add-cost.d.ts +10 -0
  29. package/dist/cost/add-cost.js +80 -0
  30. package/dist/cost/add-cost.spec.d.ts +1 -0
  31. package/dist/cost/add-cost.spec.js +36 -0
  32. package/dist/cost/index.d.ts +1 -0
  33. package/dist/cost/index.js +17 -0
  34. package/dist/domain-events/index.d.ts +16 -0
  35. package/dist/domain-events/index.js +38 -0
  36. package/dist/eval/index.d.ts +19 -0
  37. package/dist/eval/index.js +24 -0
  38. package/dist/events/base.d.ts +5 -0
  39. package/dist/events/base.js +2 -0
  40. package/dist/events/schemas.d.ts +3463 -0
  41. package/dist/events/schemas.js +244 -0
  42. package/dist/execution-context/index.d.ts +21 -0
  43. package/dist/execution-context/index.js +17 -0
  44. package/dist/index.cjs +2958 -0
  45. package/dist/index.cjs.map +1 -0
  46. package/dist/index.d.cts +3425 -0
  47. package/dist/index.d.ts +22 -0
  48. package/dist/index.js +53 -0
  49. package/dist/index.js.map +1 -0
  50. package/dist/lgpd/index.d.ts +7 -0
  51. package/dist/lgpd/index.js +21 -0
  52. package/dist/logger/agent-logger.d.ts +16 -0
  53. package/dist/logger/agent-logger.js +110 -0
  54. package/dist/logger/formatters.d.ts +32 -0
  55. package/dist/logger/formatters.js +146 -0
  56. package/dist/logger/index.d.ts +30 -0
  57. package/dist/logger/index.js +88 -0
  58. package/dist/logger/styles.d.ts +46 -0
  59. package/dist/logger/styles.js +53 -0
  60. package/dist/logger/workflow-logger.d.ts +16 -0
  61. package/dist/logger/workflow-logger.js +79 -0
  62. package/dist/multi-agent/agent-as-tool/AgentAsTool.d.ts +16 -0
  63. package/dist/multi-agent/agent-as-tool/AgentAsTool.js +54 -0
  64. package/dist/multi-agent/agent-as-tool/AgentAsTool.spec.d.ts +1 -0
  65. package/dist/multi-agent/agent-as-tool/AgentAsTool.spec.js +76 -0
  66. package/dist/multi-agent/committee-team/CommitteeTeam.d.ts +16 -0
  67. package/dist/multi-agent/committee-team/CommitteeTeam.js +150 -0
  68. package/dist/multi-agent/committee-team/CommitteeTeam.spec.d.ts +1 -0
  69. package/dist/multi-agent/committee-team/CommitteeTeam.spec.js +43 -0
  70. package/dist/multi-agent/handoff-team/HandoffTeam.d.ts +16 -0
  71. package/dist/multi-agent/handoff-team/HandoffTeam.js +185 -0
  72. package/dist/multi-agent/handoff-team/HandoffTeam.spec.d.ts +1 -0
  73. package/dist/multi-agent/handoff-team/HandoffTeam.spec.js +105 -0
  74. package/dist/multi-agent/hierarchical-team/HierarchicalTeam.d.ts +18 -0
  75. package/dist/multi-agent/hierarchical-team/HierarchicalTeam.js +164 -0
  76. package/dist/multi-agent/hierarchical-team/HierarchicalTeam.spec.d.ts +1 -0
  77. package/dist/multi-agent/hierarchical-team/HierarchicalTeam.spec.js +53 -0
  78. package/dist/multi-agent/index.d.ts +10 -0
  79. package/dist/multi-agent/index.js +26 -0
  80. package/dist/multi-agent/pipeline-team/PipelineTeam.d.ts +13 -0
  81. package/dist/multi-agent/pipeline-team/PipelineTeam.js +104 -0
  82. package/dist/multi-agent/pipeline-team/PipelineTeam.spec.d.ts +1 -0
  83. package/dist/multi-agent/pipeline-team/PipelineTeam.spec.js +54 -0
  84. package/dist/multi-agent/router-team/RouterTeam.d.ts +15 -0
  85. package/dist/multi-agent/router-team/RouterTeam.js +153 -0
  86. package/dist/multi-agent/router-team/RouterTeam.spec.d.ts +1 -0
  87. package/dist/multi-agent/router-team/RouterTeam.spec.js +69 -0
  88. package/dist/multi-agent/types/index.d.ts +349 -0
  89. package/dist/multi-agent/types/index.js +79 -0
  90. package/dist/multi-agent/utils/guardrails.d.ts +6 -0
  91. package/dist/multi-agent/utils/guardrails.js +34 -0
  92. package/dist/multi-agent/utils/memory.d.ts +8 -0
  93. package/dist/multi-agent/utils/memory.js +40 -0
  94. package/dist/multi-agent/utils/prompts.d.ts +4 -0
  95. package/dist/multi-agent/utils/prompts.js +25 -0
  96. package/dist/tracing/index.d.ts +89 -0
  97. package/dist/tracing/index.js +188 -0
  98. package/dist/tsup.config.d.ts +2 -0
  99. package/dist/tsup.config.js +11 -0
  100. package/dist/utils/schema-to-zod.d.ts +7 -0
  101. package/dist/utils/schema-to-zod.js +36 -0
  102. package/dist/workflow/Workflow.d.ts +106 -0
  103. package/dist/workflow/Workflow.js +204 -0
  104. package/dist/workflow/adapters.d.ts +61 -0
  105. package/dist/workflow/adapters.js +29 -0
  106. package/dist/workflow/definition/DefinitionBuilder.d.ts +9 -0
  107. package/dist/workflow/definition/DefinitionBuilder.js +91 -0
  108. package/dist/workflow/definition/DefinitionBuilder.spec.d.ts +1 -0
  109. package/dist/workflow/definition/DefinitionBuilder.spec.js +66 -0
  110. package/dist/workflow/definition/DefinitionHasher.d.ts +8 -0
  111. package/dist/workflow/definition/DefinitionHasher.js +11 -0
  112. package/dist/workflow/definition/DefinitionHasher.spec.d.ts +1 -0
  113. package/dist/workflow/definition/DefinitionHasher.spec.js +28 -0
  114. package/dist/workflow/definition/types.d.ts +27 -0
  115. package/dist/workflow/definition/types.js +2 -0
  116. package/dist/workflow/events.d.ts +9 -0
  117. package/dist/workflow/events.js +2 -0
  118. package/dist/workflow/execution/AgentNodeIntegration.spec.d.ts +1 -0
  119. package/dist/workflow/execution/AgentNodeIntegration.spec.js +50 -0
  120. package/dist/workflow/execution/NodeExecutor.d.ts +9 -0
  121. package/dist/workflow/execution/NodeExecutor.js +43 -0
  122. package/dist/workflow/execution/NodeExecutor.spec.d.ts +1 -0
  123. package/dist/workflow/execution/NodeExecutor.spec.js +45 -0
  124. package/dist/workflow/execution/WorkflowEventBus.d.ts +14 -0
  125. package/dist/workflow/execution/WorkflowEventBus.js +42 -0
  126. package/dist/workflow/execution/WorkflowEventBus.spec.d.ts +1 -0
  127. package/dist/workflow/execution/WorkflowEventBus.spec.js +78 -0
  128. package/dist/workflow/execution/WorkflowRunner.d.ts +26 -0
  129. package/dist/workflow/execution/WorkflowRunner.js +212 -0
  130. package/dist/workflow/execution/WorkflowRunner.spec.d.ts +1 -0
  131. package/dist/workflow/execution/WorkflowRunner.spec.js +92 -0
  132. package/dist/workflow/execution/WorkflowTelemetry.d.ts +13 -0
  133. package/dist/workflow/execution/WorkflowTelemetry.js +43 -0
  134. package/dist/workflow/execution/WorkflowTelemetry.spec.d.ts +1 -0
  135. package/dist/workflow/execution/WorkflowTelemetry.spec.js +31 -0
  136. package/dist/workflow/graph/NodeNameRegistry.d.ts +20 -0
  137. package/dist/workflow/graph/NodeNameRegistry.js +21 -0
  138. package/dist/workflow/graph/NodeNameRegistry.spec.d.ts +1 -0
  139. package/dist/workflow/graph/NodeNameRegistry.spec.js +18 -0
  140. package/dist/workflow/graph/WorkflowGraph.d.ts +14 -0
  141. package/dist/workflow/graph/WorkflowGraph.js +23 -0
  142. package/dist/workflow/graph/nodes.d.ts +26 -0
  143. package/dist/workflow/graph/nodes.js +2 -0
  144. package/dist/workflow/queue/WorkflowQueueService.d.ts +22 -0
  145. package/dist/workflow/queue/WorkflowQueueService.js +47 -0
  146. package/dist/workflow/state/WorkflowStateService.d.ts +7 -0
  147. package/dist/workflow/state/WorkflowStateService.js +20 -0
  148. package/dist/workflow/types.d.ts +16 -0
  149. package/dist/workflow/types.js +2 -0
  150. package/package.json +56 -0
@@ -0,0 +1,3463 @@
1
+ import { z } from "zod";
2
+ export declare const TraceContextSchema: z.ZodObject<{
3
+ traceId: z.ZodString;
4
+ spanId: z.ZodString;
5
+ parentSpanId: z.ZodOptional<z.ZodString>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ traceId: string;
8
+ spanId: string;
9
+ parentSpanId?: string | undefined;
10
+ }, {
11
+ traceId: string;
12
+ spanId: string;
13
+ parentSpanId?: string | undefined;
14
+ }>;
15
+ export declare const EventCommonSchema: z.ZodObject<{
16
+ type: z.ZodString;
17
+ timestamp: z.ZodString;
18
+ trace: z.ZodObject<{
19
+ traceId: z.ZodString;
20
+ spanId: z.ZodString;
21
+ parentSpanId: z.ZodOptional<z.ZodString>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ traceId: string;
24
+ spanId: string;
25
+ parentSpanId?: string | undefined;
26
+ }, {
27
+ traceId: string;
28
+ spanId: string;
29
+ parentSpanId?: string | undefined;
30
+ }>;
31
+ correlationId: z.ZodOptional<z.ZodString>;
32
+ executionId: z.ZodOptional<z.ZodString>;
33
+ rootExecutionId: z.ZodOptional<z.ZodString>;
34
+ parentExecutionId: z.ZodOptional<z.ZodString>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ type: string;
37
+ timestamp: string;
38
+ trace: {
39
+ traceId: string;
40
+ spanId: string;
41
+ parentSpanId?: string | undefined;
42
+ };
43
+ correlationId?: string | undefined;
44
+ executionId?: string | undefined;
45
+ rootExecutionId?: string | undefined;
46
+ parentExecutionId?: string | undefined;
47
+ }, {
48
+ type: string;
49
+ timestamp: string;
50
+ trace: {
51
+ traceId: string;
52
+ spanId: string;
53
+ parentSpanId?: string | undefined;
54
+ };
55
+ correlationId?: string | undefined;
56
+ executionId?: string | undefined;
57
+ rootExecutionId?: string | undefined;
58
+ parentExecutionId?: string | undefined;
59
+ }>;
60
+ export declare const UsageSchema: z.ZodObject<{
61
+ promptTokens: z.ZodNumber;
62
+ completionTokens: z.ZodNumber;
63
+ totalTokens: z.ZodNumber;
64
+ reasoningTokens: z.ZodOptional<z.ZodNumber>;
65
+ }, "strip", z.ZodTypeAny, {
66
+ promptTokens: number;
67
+ completionTokens: number;
68
+ totalTokens: number;
69
+ reasoningTokens?: number | undefined;
70
+ }, {
71
+ promptTokens: number;
72
+ completionTokens: number;
73
+ totalTokens: number;
74
+ reasoningTokens?: number | undefined;
75
+ }>;
76
+ export declare const ErrorSchema: z.ZodObject<{
77
+ name: z.ZodOptional<z.ZodString>;
78
+ message: z.ZodString;
79
+ code: z.ZodOptional<z.ZodString>;
80
+ stack: z.ZodOptional<z.ZodString>;
81
+ details: z.ZodOptional<z.ZodAny>;
82
+ }, "strip", z.ZodTypeAny, {
83
+ message: string;
84
+ name?: string | undefined;
85
+ code?: string | undefined;
86
+ stack?: string | undefined;
87
+ details?: any;
88
+ }, {
89
+ message: string;
90
+ name?: string | undefined;
91
+ code?: string | undefined;
92
+ stack?: string | undefined;
93
+ details?: any;
94
+ }>;
95
+ export declare const ModelSchema: z.ZodObject<{
96
+ provider: z.ZodString;
97
+ model: z.ZodString;
98
+ temperature: z.ZodOptional<z.ZodNumber>;
99
+ maxTokens: z.ZodOptional<z.ZodNumber>;
100
+ topP: z.ZodOptional<z.ZodNumber>;
101
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
102
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
103
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
104
+ provider: z.ZodString;
105
+ model: z.ZodString;
106
+ temperature: z.ZodOptional<z.ZodNumber>;
107
+ maxTokens: z.ZodOptional<z.ZodNumber>;
108
+ topP: z.ZodOptional<z.ZodNumber>;
109
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
110
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
111
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
112
+ provider: z.ZodString;
113
+ model: z.ZodString;
114
+ temperature: z.ZodOptional<z.ZodNumber>;
115
+ maxTokens: z.ZodOptional<z.ZodNumber>;
116
+ topP: z.ZodOptional<z.ZodNumber>;
117
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
118
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
119
+ }, z.ZodTypeAny, "passthrough">>;
120
+ export declare const AgentExecutionStartSchema: z.ZodObject<{
121
+ timestamp: z.ZodString;
122
+ trace: z.ZodObject<{
123
+ traceId: z.ZodString;
124
+ spanId: z.ZodString;
125
+ parentSpanId: z.ZodOptional<z.ZodString>;
126
+ }, "strip", z.ZodTypeAny, {
127
+ traceId: string;
128
+ spanId: string;
129
+ parentSpanId?: string | undefined;
130
+ }, {
131
+ traceId: string;
132
+ spanId: string;
133
+ parentSpanId?: string | undefined;
134
+ }>;
135
+ correlationId: z.ZodOptional<z.ZodString>;
136
+ executionId: z.ZodOptional<z.ZodString>;
137
+ rootExecutionId: z.ZodOptional<z.ZodString>;
138
+ parentExecutionId: z.ZodOptional<z.ZodString>;
139
+ } & {
140
+ type: z.ZodLiteral<"agent:execution:start">;
141
+ data: z.ZodObject<{
142
+ agentId: z.ZodString;
143
+ agentName: z.ZodString;
144
+ input: z.ZodOptional<z.ZodAny>;
145
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
146
+ }, "strip", z.ZodTypeAny, {
147
+ agentId: string;
148
+ agentName: string;
149
+ input?: any;
150
+ metadata?: Record<string, any> | undefined;
151
+ }, {
152
+ agentId: string;
153
+ agentName: string;
154
+ input?: any;
155
+ metadata?: Record<string, any> | undefined;
156
+ }>;
157
+ }, "strip", z.ZodTypeAny, {
158
+ type: "agent:execution:start";
159
+ timestamp: string;
160
+ trace: {
161
+ traceId: string;
162
+ spanId: string;
163
+ parentSpanId?: string | undefined;
164
+ };
165
+ data: {
166
+ agentId: string;
167
+ agentName: string;
168
+ input?: any;
169
+ metadata?: Record<string, any> | undefined;
170
+ };
171
+ correlationId?: string | undefined;
172
+ executionId?: string | undefined;
173
+ rootExecutionId?: string | undefined;
174
+ parentExecutionId?: string | undefined;
175
+ }, {
176
+ type: "agent:execution:start";
177
+ timestamp: string;
178
+ trace: {
179
+ traceId: string;
180
+ spanId: string;
181
+ parentSpanId?: string | undefined;
182
+ };
183
+ data: {
184
+ agentId: string;
185
+ agentName: string;
186
+ input?: any;
187
+ metadata?: Record<string, any> | undefined;
188
+ };
189
+ correlationId?: string | undefined;
190
+ executionId?: string | undefined;
191
+ rootExecutionId?: string | undefined;
192
+ parentExecutionId?: string | undefined;
193
+ }>;
194
+ export declare const AgentExecutionEndSchema: z.ZodObject<{
195
+ timestamp: z.ZodString;
196
+ trace: z.ZodObject<{
197
+ traceId: z.ZodString;
198
+ spanId: z.ZodString;
199
+ parentSpanId: z.ZodOptional<z.ZodString>;
200
+ }, "strip", z.ZodTypeAny, {
201
+ traceId: string;
202
+ spanId: string;
203
+ parentSpanId?: string | undefined;
204
+ }, {
205
+ traceId: string;
206
+ spanId: string;
207
+ parentSpanId?: string | undefined;
208
+ }>;
209
+ correlationId: z.ZodOptional<z.ZodString>;
210
+ executionId: z.ZodOptional<z.ZodString>;
211
+ rootExecutionId: z.ZodOptional<z.ZodString>;
212
+ parentExecutionId: z.ZodOptional<z.ZodString>;
213
+ } & {
214
+ type: z.ZodLiteral<"agent:execution:end">;
215
+ data: z.ZodObject<{
216
+ agentId: z.ZodString;
217
+ agentName: z.ZodString;
218
+ status: z.ZodEnum<["success", "error", "truncated"]>;
219
+ output: z.ZodOptional<z.ZodAny>;
220
+ durationMs: z.ZodNumber;
221
+ usage: z.ZodOptional<z.ZodObject<{
222
+ promptTokens: z.ZodNumber;
223
+ completionTokens: z.ZodNumber;
224
+ totalTokens: z.ZodNumber;
225
+ reasoningTokens: z.ZodOptional<z.ZodNumber>;
226
+ }, "strip", z.ZodTypeAny, {
227
+ promptTokens: number;
228
+ completionTokens: number;
229
+ totalTokens: number;
230
+ reasoningTokens?: number | undefined;
231
+ }, {
232
+ promptTokens: number;
233
+ completionTokens: number;
234
+ totalTokens: number;
235
+ reasoningTokens?: number | undefined;
236
+ }>>;
237
+ }, "strip", z.ZodTypeAny, {
238
+ status: "error" | "success" | "truncated";
239
+ agentId: string;
240
+ agentName: string;
241
+ durationMs: number;
242
+ output?: any;
243
+ usage?: {
244
+ promptTokens: number;
245
+ completionTokens: number;
246
+ totalTokens: number;
247
+ reasoningTokens?: number | undefined;
248
+ } | undefined;
249
+ }, {
250
+ status: "error" | "success" | "truncated";
251
+ agentId: string;
252
+ agentName: string;
253
+ durationMs: number;
254
+ output?: any;
255
+ usage?: {
256
+ promptTokens: number;
257
+ completionTokens: number;
258
+ totalTokens: number;
259
+ reasoningTokens?: number | undefined;
260
+ } | undefined;
261
+ }>;
262
+ }, "strip", z.ZodTypeAny, {
263
+ type: "agent:execution:end";
264
+ timestamp: string;
265
+ trace: {
266
+ traceId: string;
267
+ spanId: string;
268
+ parentSpanId?: string | undefined;
269
+ };
270
+ data: {
271
+ status: "error" | "success" | "truncated";
272
+ agentId: string;
273
+ agentName: string;
274
+ durationMs: number;
275
+ output?: any;
276
+ usage?: {
277
+ promptTokens: number;
278
+ completionTokens: number;
279
+ totalTokens: number;
280
+ reasoningTokens?: number | undefined;
281
+ } | undefined;
282
+ };
283
+ correlationId?: string | undefined;
284
+ executionId?: string | undefined;
285
+ rootExecutionId?: string | undefined;
286
+ parentExecutionId?: string | undefined;
287
+ }, {
288
+ type: "agent:execution:end";
289
+ timestamp: string;
290
+ trace: {
291
+ traceId: string;
292
+ spanId: string;
293
+ parentSpanId?: string | undefined;
294
+ };
295
+ data: {
296
+ status: "error" | "success" | "truncated";
297
+ agentId: string;
298
+ agentName: string;
299
+ durationMs: number;
300
+ output?: any;
301
+ usage?: {
302
+ promptTokens: number;
303
+ completionTokens: number;
304
+ totalTokens: number;
305
+ reasoningTokens?: number | undefined;
306
+ } | undefined;
307
+ };
308
+ correlationId?: string | undefined;
309
+ executionId?: string | undefined;
310
+ rootExecutionId?: string | undefined;
311
+ parentExecutionId?: string | undefined;
312
+ }>;
313
+ export declare const AgentExecutionErrorSchema: z.ZodObject<{
314
+ timestamp: z.ZodString;
315
+ trace: z.ZodObject<{
316
+ traceId: z.ZodString;
317
+ spanId: z.ZodString;
318
+ parentSpanId: z.ZodOptional<z.ZodString>;
319
+ }, "strip", z.ZodTypeAny, {
320
+ traceId: string;
321
+ spanId: string;
322
+ parentSpanId?: string | undefined;
323
+ }, {
324
+ traceId: string;
325
+ spanId: string;
326
+ parentSpanId?: string | undefined;
327
+ }>;
328
+ correlationId: z.ZodOptional<z.ZodString>;
329
+ executionId: z.ZodOptional<z.ZodString>;
330
+ rootExecutionId: z.ZodOptional<z.ZodString>;
331
+ parentExecutionId: z.ZodOptional<z.ZodString>;
332
+ } & {
333
+ type: z.ZodLiteral<"agent:execution:error">;
334
+ data: z.ZodObject<{
335
+ agentId: z.ZodString;
336
+ agentName: z.ZodString;
337
+ error: z.ZodObject<{
338
+ name: z.ZodOptional<z.ZodString>;
339
+ message: z.ZodString;
340
+ code: z.ZodOptional<z.ZodString>;
341
+ stack: z.ZodOptional<z.ZodString>;
342
+ details: z.ZodOptional<z.ZodAny>;
343
+ }, "strip", z.ZodTypeAny, {
344
+ message: string;
345
+ name?: string | undefined;
346
+ code?: string | undefined;
347
+ stack?: string | undefined;
348
+ details?: any;
349
+ }, {
350
+ message: string;
351
+ name?: string | undefined;
352
+ code?: string | undefined;
353
+ stack?: string | undefined;
354
+ details?: any;
355
+ }>;
356
+ durationMs: z.ZodOptional<z.ZodNumber>;
357
+ }, "strip", z.ZodTypeAny, {
358
+ error: {
359
+ message: string;
360
+ name?: string | undefined;
361
+ code?: string | undefined;
362
+ stack?: string | undefined;
363
+ details?: any;
364
+ };
365
+ agentId: string;
366
+ agentName: string;
367
+ durationMs?: number | undefined;
368
+ }, {
369
+ error: {
370
+ message: string;
371
+ name?: string | undefined;
372
+ code?: string | undefined;
373
+ stack?: string | undefined;
374
+ details?: any;
375
+ };
376
+ agentId: string;
377
+ agentName: string;
378
+ durationMs?: number | undefined;
379
+ }>;
380
+ }, "strip", z.ZodTypeAny, {
381
+ type: "agent:execution:error";
382
+ timestamp: string;
383
+ trace: {
384
+ traceId: string;
385
+ spanId: string;
386
+ parentSpanId?: string | undefined;
387
+ };
388
+ data: {
389
+ error: {
390
+ message: string;
391
+ name?: string | undefined;
392
+ code?: string | undefined;
393
+ stack?: string | undefined;
394
+ details?: any;
395
+ };
396
+ agentId: string;
397
+ agentName: string;
398
+ durationMs?: number | undefined;
399
+ };
400
+ correlationId?: string | undefined;
401
+ executionId?: string | undefined;
402
+ rootExecutionId?: string | undefined;
403
+ parentExecutionId?: string | undefined;
404
+ }, {
405
+ type: "agent:execution:error";
406
+ timestamp: string;
407
+ trace: {
408
+ traceId: string;
409
+ spanId: string;
410
+ parentSpanId?: string | undefined;
411
+ };
412
+ data: {
413
+ error: {
414
+ message: string;
415
+ name?: string | undefined;
416
+ code?: string | undefined;
417
+ stack?: string | undefined;
418
+ details?: any;
419
+ };
420
+ agentId: string;
421
+ agentName: string;
422
+ durationMs?: number | undefined;
423
+ };
424
+ correlationId?: string | undefined;
425
+ executionId?: string | undefined;
426
+ rootExecutionId?: string | undefined;
427
+ parentExecutionId?: string | undefined;
428
+ }>;
429
+ export declare const AgentLLMCallSchema: z.ZodObject<{
430
+ timestamp: z.ZodString;
431
+ trace: z.ZodObject<{
432
+ traceId: z.ZodString;
433
+ spanId: z.ZodString;
434
+ parentSpanId: z.ZodOptional<z.ZodString>;
435
+ }, "strip", z.ZodTypeAny, {
436
+ traceId: string;
437
+ spanId: string;
438
+ parentSpanId?: string | undefined;
439
+ }, {
440
+ traceId: string;
441
+ spanId: string;
442
+ parentSpanId?: string | undefined;
443
+ }>;
444
+ correlationId: z.ZodOptional<z.ZodString>;
445
+ executionId: z.ZodOptional<z.ZodString>;
446
+ rootExecutionId: z.ZodOptional<z.ZodString>;
447
+ parentExecutionId: z.ZodOptional<z.ZodString>;
448
+ } & {
449
+ type: z.ZodLiteral<"agent:llm:call">;
450
+ data: z.ZodObject<{
451
+ agentId: z.ZodString;
452
+ agentName: z.ZodString;
453
+ step: z.ZodNumber;
454
+ model: z.ZodObject<{
455
+ provider: z.ZodString;
456
+ model: z.ZodString;
457
+ temperature: z.ZodOptional<z.ZodNumber>;
458
+ maxTokens: z.ZodOptional<z.ZodNumber>;
459
+ topP: z.ZodOptional<z.ZodNumber>;
460
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
461
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
462
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
463
+ provider: z.ZodString;
464
+ model: z.ZodString;
465
+ temperature: z.ZodOptional<z.ZodNumber>;
466
+ maxTokens: z.ZodOptional<z.ZodNumber>;
467
+ topP: z.ZodOptional<z.ZodNumber>;
468
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
469
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
470
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
471
+ provider: z.ZodString;
472
+ model: z.ZodString;
473
+ temperature: z.ZodOptional<z.ZodNumber>;
474
+ maxTokens: z.ZodOptional<z.ZodNumber>;
475
+ topP: z.ZodOptional<z.ZodNumber>;
476
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
477
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
478
+ }, z.ZodTypeAny, "passthrough">>;
479
+ messages: z.ZodArray<z.ZodAny, "many">;
480
+ tools: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
481
+ responseFormat: z.ZodOptional<z.ZodAny>;
482
+ }, "strip", z.ZodTypeAny, {
483
+ model: {
484
+ provider: string;
485
+ model: string;
486
+ temperature?: number | undefined;
487
+ maxTokens?: number | undefined;
488
+ topP?: number | undefined;
489
+ frequencyPenalty?: number | undefined;
490
+ presencePenalty?: number | undefined;
491
+ } & {
492
+ [k: string]: unknown;
493
+ };
494
+ agentId: string;
495
+ agentName: string;
496
+ step: number;
497
+ messages: any[];
498
+ responseFormat?: any;
499
+ tools?: any[] | undefined;
500
+ }, {
501
+ model: {
502
+ provider: string;
503
+ model: string;
504
+ temperature?: number | undefined;
505
+ maxTokens?: number | undefined;
506
+ topP?: number | undefined;
507
+ frequencyPenalty?: number | undefined;
508
+ presencePenalty?: number | undefined;
509
+ } & {
510
+ [k: string]: unknown;
511
+ };
512
+ agentId: string;
513
+ agentName: string;
514
+ step: number;
515
+ messages: any[];
516
+ responseFormat?: any;
517
+ tools?: any[] | undefined;
518
+ }>;
519
+ }, "strip", z.ZodTypeAny, {
520
+ type: "agent:llm:call";
521
+ timestamp: string;
522
+ trace: {
523
+ traceId: string;
524
+ spanId: string;
525
+ parentSpanId?: string | undefined;
526
+ };
527
+ data: {
528
+ model: {
529
+ provider: string;
530
+ model: string;
531
+ temperature?: number | undefined;
532
+ maxTokens?: number | undefined;
533
+ topP?: number | undefined;
534
+ frequencyPenalty?: number | undefined;
535
+ presencePenalty?: number | undefined;
536
+ } & {
537
+ [k: string]: unknown;
538
+ };
539
+ agentId: string;
540
+ agentName: string;
541
+ step: number;
542
+ messages: any[];
543
+ responseFormat?: any;
544
+ tools?: any[] | undefined;
545
+ };
546
+ correlationId?: string | undefined;
547
+ executionId?: string | undefined;
548
+ rootExecutionId?: string | undefined;
549
+ parentExecutionId?: string | undefined;
550
+ }, {
551
+ type: "agent:llm:call";
552
+ timestamp: string;
553
+ trace: {
554
+ traceId: string;
555
+ spanId: string;
556
+ parentSpanId?: string | undefined;
557
+ };
558
+ data: {
559
+ model: {
560
+ provider: string;
561
+ model: string;
562
+ temperature?: number | undefined;
563
+ maxTokens?: number | undefined;
564
+ topP?: number | undefined;
565
+ frequencyPenalty?: number | undefined;
566
+ presencePenalty?: number | undefined;
567
+ } & {
568
+ [k: string]: unknown;
569
+ };
570
+ agentId: string;
571
+ agentName: string;
572
+ step: number;
573
+ messages: any[];
574
+ responseFormat?: any;
575
+ tools?: any[] | undefined;
576
+ };
577
+ correlationId?: string | undefined;
578
+ executionId?: string | undefined;
579
+ rootExecutionId?: string | undefined;
580
+ parentExecutionId?: string | undefined;
581
+ }>;
582
+ export declare const AgentLLMResponseSchema: z.ZodObject<{
583
+ timestamp: z.ZodString;
584
+ trace: z.ZodObject<{
585
+ traceId: z.ZodString;
586
+ spanId: z.ZodString;
587
+ parentSpanId: z.ZodOptional<z.ZodString>;
588
+ }, "strip", z.ZodTypeAny, {
589
+ traceId: string;
590
+ spanId: string;
591
+ parentSpanId?: string | undefined;
592
+ }, {
593
+ traceId: string;
594
+ spanId: string;
595
+ parentSpanId?: string | undefined;
596
+ }>;
597
+ correlationId: z.ZodOptional<z.ZodString>;
598
+ executionId: z.ZodOptional<z.ZodString>;
599
+ rootExecutionId: z.ZodOptional<z.ZodString>;
600
+ parentExecutionId: z.ZodOptional<z.ZodString>;
601
+ } & {
602
+ type: z.ZodLiteral<"agent:llm:response">;
603
+ data: z.ZodObject<{
604
+ agentId: z.ZodString;
605
+ agentName: z.ZodString;
606
+ step: z.ZodNumber;
607
+ model: z.ZodObject<{
608
+ provider: z.ZodString;
609
+ model: z.ZodString;
610
+ temperature: z.ZodOptional<z.ZodNumber>;
611
+ maxTokens: z.ZodOptional<z.ZodNumber>;
612
+ topP: z.ZodOptional<z.ZodNumber>;
613
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
614
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
615
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
616
+ provider: z.ZodString;
617
+ model: z.ZodString;
618
+ temperature: z.ZodOptional<z.ZodNumber>;
619
+ maxTokens: z.ZodOptional<z.ZodNumber>;
620
+ topP: z.ZodOptional<z.ZodNumber>;
621
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
622
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
623
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
624
+ provider: z.ZodString;
625
+ model: z.ZodString;
626
+ temperature: z.ZodOptional<z.ZodNumber>;
627
+ maxTokens: z.ZodOptional<z.ZodNumber>;
628
+ topP: z.ZodOptional<z.ZodNumber>;
629
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
630
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
631
+ }, z.ZodTypeAny, "passthrough">>;
632
+ content: z.ZodAny;
633
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
634
+ finishReason: z.ZodOptional<z.ZodString>;
635
+ usage: z.ZodOptional<z.ZodObject<{
636
+ promptTokens: z.ZodNumber;
637
+ completionTokens: z.ZodNumber;
638
+ totalTokens: z.ZodNumber;
639
+ reasoningTokens: z.ZodOptional<z.ZodNumber>;
640
+ }, "strip", z.ZodTypeAny, {
641
+ promptTokens: number;
642
+ completionTokens: number;
643
+ totalTokens: number;
644
+ reasoningTokens?: number | undefined;
645
+ }, {
646
+ promptTokens: number;
647
+ completionTokens: number;
648
+ totalTokens: number;
649
+ reasoningTokens?: number | undefined;
650
+ }>>;
651
+ durationMs: z.ZodOptional<z.ZodNumber>;
652
+ }, "strip", z.ZodTypeAny, {
653
+ model: {
654
+ provider: string;
655
+ model: string;
656
+ temperature?: number | undefined;
657
+ maxTokens?: number | undefined;
658
+ topP?: number | undefined;
659
+ frequencyPenalty?: number | undefined;
660
+ presencePenalty?: number | undefined;
661
+ } & {
662
+ [k: string]: unknown;
663
+ };
664
+ agentId: string;
665
+ agentName: string;
666
+ step: number;
667
+ finishReason?: string | undefined;
668
+ durationMs?: number | undefined;
669
+ usage?: {
670
+ promptTokens: number;
671
+ completionTokens: number;
672
+ totalTokens: number;
673
+ reasoningTokens?: number | undefined;
674
+ } | undefined;
675
+ content?: any;
676
+ toolCalls?: any[] | undefined;
677
+ }, {
678
+ model: {
679
+ provider: string;
680
+ model: string;
681
+ temperature?: number | undefined;
682
+ maxTokens?: number | undefined;
683
+ topP?: number | undefined;
684
+ frequencyPenalty?: number | undefined;
685
+ presencePenalty?: number | undefined;
686
+ } & {
687
+ [k: string]: unknown;
688
+ };
689
+ agentId: string;
690
+ agentName: string;
691
+ step: number;
692
+ finishReason?: string | undefined;
693
+ durationMs?: number | undefined;
694
+ usage?: {
695
+ promptTokens: number;
696
+ completionTokens: number;
697
+ totalTokens: number;
698
+ reasoningTokens?: number | undefined;
699
+ } | undefined;
700
+ content?: any;
701
+ toolCalls?: any[] | undefined;
702
+ }>;
703
+ }, "strip", z.ZodTypeAny, {
704
+ type: "agent:llm:response";
705
+ timestamp: string;
706
+ trace: {
707
+ traceId: string;
708
+ spanId: string;
709
+ parentSpanId?: string | undefined;
710
+ };
711
+ data: {
712
+ model: {
713
+ provider: string;
714
+ model: string;
715
+ temperature?: number | undefined;
716
+ maxTokens?: number | undefined;
717
+ topP?: number | undefined;
718
+ frequencyPenalty?: number | undefined;
719
+ presencePenalty?: number | undefined;
720
+ } & {
721
+ [k: string]: unknown;
722
+ };
723
+ agentId: string;
724
+ agentName: string;
725
+ step: number;
726
+ finishReason?: string | undefined;
727
+ durationMs?: number | undefined;
728
+ usage?: {
729
+ promptTokens: number;
730
+ completionTokens: number;
731
+ totalTokens: number;
732
+ reasoningTokens?: number | undefined;
733
+ } | undefined;
734
+ content?: any;
735
+ toolCalls?: any[] | undefined;
736
+ };
737
+ correlationId?: string | undefined;
738
+ executionId?: string | undefined;
739
+ rootExecutionId?: string | undefined;
740
+ parentExecutionId?: string | undefined;
741
+ }, {
742
+ type: "agent:llm:response";
743
+ timestamp: string;
744
+ trace: {
745
+ traceId: string;
746
+ spanId: string;
747
+ parentSpanId?: string | undefined;
748
+ };
749
+ data: {
750
+ model: {
751
+ provider: string;
752
+ model: string;
753
+ temperature?: number | undefined;
754
+ maxTokens?: number | undefined;
755
+ topP?: number | undefined;
756
+ frequencyPenalty?: number | undefined;
757
+ presencePenalty?: number | undefined;
758
+ } & {
759
+ [k: string]: unknown;
760
+ };
761
+ agentId: string;
762
+ agentName: string;
763
+ step: number;
764
+ finishReason?: string | undefined;
765
+ durationMs?: number | undefined;
766
+ usage?: {
767
+ promptTokens: number;
768
+ completionTokens: number;
769
+ totalTokens: number;
770
+ reasoningTokens?: number | undefined;
771
+ } | undefined;
772
+ content?: any;
773
+ toolCalls?: any[] | undefined;
774
+ };
775
+ correlationId?: string | undefined;
776
+ executionId?: string | undefined;
777
+ rootExecutionId?: string | undefined;
778
+ parentExecutionId?: string | undefined;
779
+ }>;
780
+ export declare const AgentToolCallSchema: z.ZodObject<{
781
+ timestamp: z.ZodString;
782
+ trace: z.ZodObject<{
783
+ traceId: z.ZodString;
784
+ spanId: z.ZodString;
785
+ parentSpanId: z.ZodOptional<z.ZodString>;
786
+ }, "strip", z.ZodTypeAny, {
787
+ traceId: string;
788
+ spanId: string;
789
+ parentSpanId?: string | undefined;
790
+ }, {
791
+ traceId: string;
792
+ spanId: string;
793
+ parentSpanId?: string | undefined;
794
+ }>;
795
+ correlationId: z.ZodOptional<z.ZodString>;
796
+ executionId: z.ZodOptional<z.ZodString>;
797
+ rootExecutionId: z.ZodOptional<z.ZodString>;
798
+ parentExecutionId: z.ZodOptional<z.ZodString>;
799
+ } & {
800
+ type: z.ZodLiteral<"agent:tool:call">;
801
+ data: z.ZodObject<{
802
+ agentId: z.ZodString;
803
+ agentName: z.ZodString;
804
+ toolName: z.ZodString;
805
+ toolCallId: z.ZodString;
806
+ args: z.ZodAny;
807
+ }, "strip", z.ZodTypeAny, {
808
+ agentId: string;
809
+ agentName: string;
810
+ toolName: string;
811
+ toolCallId: string;
812
+ args?: any;
813
+ }, {
814
+ agentId: string;
815
+ agentName: string;
816
+ toolName: string;
817
+ toolCallId: string;
818
+ args?: any;
819
+ }>;
820
+ }, "strip", z.ZodTypeAny, {
821
+ type: "agent:tool:call";
822
+ timestamp: string;
823
+ trace: {
824
+ traceId: string;
825
+ spanId: string;
826
+ parentSpanId?: string | undefined;
827
+ };
828
+ data: {
829
+ agentId: string;
830
+ agentName: string;
831
+ toolName: string;
832
+ toolCallId: string;
833
+ args?: any;
834
+ };
835
+ correlationId?: string | undefined;
836
+ executionId?: string | undefined;
837
+ rootExecutionId?: string | undefined;
838
+ parentExecutionId?: string | undefined;
839
+ }, {
840
+ type: "agent:tool:call";
841
+ timestamp: string;
842
+ trace: {
843
+ traceId: string;
844
+ spanId: string;
845
+ parentSpanId?: string | undefined;
846
+ };
847
+ data: {
848
+ agentId: string;
849
+ agentName: string;
850
+ toolName: string;
851
+ toolCallId: string;
852
+ args?: any;
853
+ };
854
+ correlationId?: string | undefined;
855
+ executionId?: string | undefined;
856
+ rootExecutionId?: string | undefined;
857
+ parentExecutionId?: string | undefined;
858
+ }>;
859
+ export declare const AgentToolResultSchema: z.ZodObject<{
860
+ timestamp: z.ZodString;
861
+ trace: z.ZodObject<{
862
+ traceId: z.ZodString;
863
+ spanId: z.ZodString;
864
+ parentSpanId: z.ZodOptional<z.ZodString>;
865
+ }, "strip", z.ZodTypeAny, {
866
+ traceId: string;
867
+ spanId: string;
868
+ parentSpanId?: string | undefined;
869
+ }, {
870
+ traceId: string;
871
+ spanId: string;
872
+ parentSpanId?: string | undefined;
873
+ }>;
874
+ correlationId: z.ZodOptional<z.ZodString>;
875
+ executionId: z.ZodOptional<z.ZodString>;
876
+ rootExecutionId: z.ZodOptional<z.ZodString>;
877
+ parentExecutionId: z.ZodOptional<z.ZodString>;
878
+ } & {
879
+ type: z.ZodLiteral<"agent:tool:result">;
880
+ data: z.ZodObject<{
881
+ agentId: z.ZodString;
882
+ agentName: z.ZodString;
883
+ toolName: z.ZodString;
884
+ toolCallId: z.ZodString;
885
+ output: z.ZodOptional<z.ZodAny>;
886
+ error: z.ZodOptional<z.ZodString>;
887
+ durationMs: z.ZodOptional<z.ZodNumber>;
888
+ }, "strip", z.ZodTypeAny, {
889
+ agentId: string;
890
+ agentName: string;
891
+ toolName: string;
892
+ toolCallId: string;
893
+ error?: string | undefined;
894
+ output?: any;
895
+ durationMs?: number | undefined;
896
+ }, {
897
+ agentId: string;
898
+ agentName: string;
899
+ toolName: string;
900
+ toolCallId: string;
901
+ error?: string | undefined;
902
+ output?: any;
903
+ durationMs?: number | undefined;
904
+ }>;
905
+ }, "strip", z.ZodTypeAny, {
906
+ type: "agent:tool:result";
907
+ timestamp: string;
908
+ trace: {
909
+ traceId: string;
910
+ spanId: string;
911
+ parentSpanId?: string | undefined;
912
+ };
913
+ data: {
914
+ agentId: string;
915
+ agentName: string;
916
+ toolName: string;
917
+ toolCallId: string;
918
+ error?: string | undefined;
919
+ output?: any;
920
+ durationMs?: number | undefined;
921
+ };
922
+ correlationId?: string | undefined;
923
+ executionId?: string | undefined;
924
+ rootExecutionId?: string | undefined;
925
+ parentExecutionId?: string | undefined;
926
+ }, {
927
+ type: "agent:tool:result";
928
+ timestamp: string;
929
+ trace: {
930
+ traceId: string;
931
+ spanId: string;
932
+ parentSpanId?: string | undefined;
933
+ };
934
+ data: {
935
+ agentId: string;
936
+ agentName: string;
937
+ toolName: string;
938
+ toolCallId: string;
939
+ error?: string | undefined;
940
+ output?: any;
941
+ durationMs?: number | undefined;
942
+ };
943
+ correlationId?: string | undefined;
944
+ executionId?: string | undefined;
945
+ rootExecutionId?: string | undefined;
946
+ parentExecutionId?: string | undefined;
947
+ }>;
948
+ export declare const WorkflowRunStartSchema: z.ZodObject<{
949
+ timestamp: z.ZodString;
950
+ trace: z.ZodObject<{
951
+ traceId: z.ZodString;
952
+ spanId: z.ZodString;
953
+ parentSpanId: z.ZodOptional<z.ZodString>;
954
+ }, "strip", z.ZodTypeAny, {
955
+ traceId: string;
956
+ spanId: string;
957
+ parentSpanId?: string | undefined;
958
+ }, {
959
+ traceId: string;
960
+ spanId: string;
961
+ parentSpanId?: string | undefined;
962
+ }>;
963
+ correlationId: z.ZodOptional<z.ZodString>;
964
+ executionId: z.ZodOptional<z.ZodString>;
965
+ rootExecutionId: z.ZodOptional<z.ZodString>;
966
+ parentExecutionId: z.ZodOptional<z.ZodString>;
967
+ } & {
968
+ type: z.ZodLiteral<"workflow:run:start">;
969
+ data: z.ZodObject<{
970
+ workflowId: z.ZodString;
971
+ definitionVersion: z.ZodString;
972
+ input: z.ZodOptional<z.ZodAny>;
973
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
974
+ }, "strip", z.ZodTypeAny, {
975
+ workflowId: string;
976
+ definitionVersion: string;
977
+ input?: any;
978
+ metadata?: Record<string, any> | undefined;
979
+ }, {
980
+ workflowId: string;
981
+ definitionVersion: string;
982
+ input?: any;
983
+ metadata?: Record<string, any> | undefined;
984
+ }>;
985
+ }, "strip", z.ZodTypeAny, {
986
+ type: "workflow:run:start";
987
+ timestamp: string;
988
+ trace: {
989
+ traceId: string;
990
+ spanId: string;
991
+ parentSpanId?: string | undefined;
992
+ };
993
+ data: {
994
+ workflowId: string;
995
+ definitionVersion: string;
996
+ input?: any;
997
+ metadata?: Record<string, any> | undefined;
998
+ };
999
+ correlationId?: string | undefined;
1000
+ executionId?: string | undefined;
1001
+ rootExecutionId?: string | undefined;
1002
+ parentExecutionId?: string | undefined;
1003
+ }, {
1004
+ type: "workflow:run:start";
1005
+ timestamp: string;
1006
+ trace: {
1007
+ traceId: string;
1008
+ spanId: string;
1009
+ parentSpanId?: string | undefined;
1010
+ };
1011
+ data: {
1012
+ workflowId: string;
1013
+ definitionVersion: string;
1014
+ input?: any;
1015
+ metadata?: Record<string, any> | undefined;
1016
+ };
1017
+ correlationId?: string | undefined;
1018
+ executionId?: string | undefined;
1019
+ rootExecutionId?: string | undefined;
1020
+ parentExecutionId?: string | undefined;
1021
+ }>;
1022
+ export declare const WorkflowRunEndSchema: z.ZodObject<{
1023
+ timestamp: z.ZodString;
1024
+ trace: z.ZodObject<{
1025
+ traceId: z.ZodString;
1026
+ spanId: z.ZodString;
1027
+ parentSpanId: z.ZodOptional<z.ZodString>;
1028
+ }, "strip", z.ZodTypeAny, {
1029
+ traceId: string;
1030
+ spanId: string;
1031
+ parentSpanId?: string | undefined;
1032
+ }, {
1033
+ traceId: string;
1034
+ spanId: string;
1035
+ parentSpanId?: string | undefined;
1036
+ }>;
1037
+ correlationId: z.ZodOptional<z.ZodString>;
1038
+ executionId: z.ZodOptional<z.ZodString>;
1039
+ rootExecutionId: z.ZodOptional<z.ZodString>;
1040
+ parentExecutionId: z.ZodOptional<z.ZodString>;
1041
+ } & {
1042
+ type: z.ZodLiteral<"workflow:run:end">;
1043
+ data: z.ZodObject<{
1044
+ workflowId: z.ZodString;
1045
+ definitionVersion: z.ZodString;
1046
+ status: z.ZodEnum<["success", "error", "truncated"]>;
1047
+ output: z.ZodOptional<z.ZodAny>;
1048
+ durationMs: z.ZodNumber;
1049
+ }, "strip", z.ZodTypeAny, {
1050
+ status: "error" | "success" | "truncated";
1051
+ durationMs: number;
1052
+ workflowId: string;
1053
+ definitionVersion: string;
1054
+ output?: any;
1055
+ }, {
1056
+ status: "error" | "success" | "truncated";
1057
+ durationMs: number;
1058
+ workflowId: string;
1059
+ definitionVersion: string;
1060
+ output?: any;
1061
+ }>;
1062
+ }, "strip", z.ZodTypeAny, {
1063
+ type: "workflow:run:end";
1064
+ timestamp: string;
1065
+ trace: {
1066
+ traceId: string;
1067
+ spanId: string;
1068
+ parentSpanId?: string | undefined;
1069
+ };
1070
+ data: {
1071
+ status: "error" | "success" | "truncated";
1072
+ durationMs: number;
1073
+ workflowId: string;
1074
+ definitionVersion: string;
1075
+ output?: any;
1076
+ };
1077
+ correlationId?: string | undefined;
1078
+ executionId?: string | undefined;
1079
+ rootExecutionId?: string | undefined;
1080
+ parentExecutionId?: string | undefined;
1081
+ }, {
1082
+ type: "workflow:run:end";
1083
+ timestamp: string;
1084
+ trace: {
1085
+ traceId: string;
1086
+ spanId: string;
1087
+ parentSpanId?: string | undefined;
1088
+ };
1089
+ data: {
1090
+ status: "error" | "success" | "truncated";
1091
+ durationMs: number;
1092
+ workflowId: string;
1093
+ definitionVersion: string;
1094
+ output?: any;
1095
+ };
1096
+ correlationId?: string | undefined;
1097
+ executionId?: string | undefined;
1098
+ rootExecutionId?: string | undefined;
1099
+ parentExecutionId?: string | undefined;
1100
+ }>;
1101
+ export declare const WorkflowRunErrorSchema: z.ZodObject<{
1102
+ timestamp: z.ZodString;
1103
+ trace: z.ZodObject<{
1104
+ traceId: z.ZodString;
1105
+ spanId: z.ZodString;
1106
+ parentSpanId: z.ZodOptional<z.ZodString>;
1107
+ }, "strip", z.ZodTypeAny, {
1108
+ traceId: string;
1109
+ spanId: string;
1110
+ parentSpanId?: string | undefined;
1111
+ }, {
1112
+ traceId: string;
1113
+ spanId: string;
1114
+ parentSpanId?: string | undefined;
1115
+ }>;
1116
+ correlationId: z.ZodOptional<z.ZodString>;
1117
+ executionId: z.ZodOptional<z.ZodString>;
1118
+ rootExecutionId: z.ZodOptional<z.ZodString>;
1119
+ parentExecutionId: z.ZodOptional<z.ZodString>;
1120
+ } & {
1121
+ type: z.ZodLiteral<"workflow:run:error">;
1122
+ data: z.ZodObject<{
1123
+ workflowId: z.ZodString;
1124
+ definitionVersion: z.ZodString;
1125
+ error: z.ZodObject<{
1126
+ name: z.ZodOptional<z.ZodString>;
1127
+ message: z.ZodString;
1128
+ code: z.ZodOptional<z.ZodString>;
1129
+ stack: z.ZodOptional<z.ZodString>;
1130
+ details: z.ZodOptional<z.ZodAny>;
1131
+ }, "strip", z.ZodTypeAny, {
1132
+ message: string;
1133
+ name?: string | undefined;
1134
+ code?: string | undefined;
1135
+ stack?: string | undefined;
1136
+ details?: any;
1137
+ }, {
1138
+ message: string;
1139
+ name?: string | undefined;
1140
+ code?: string | undefined;
1141
+ stack?: string | undefined;
1142
+ details?: any;
1143
+ }>;
1144
+ durationMs: z.ZodOptional<z.ZodNumber>;
1145
+ }, "strip", z.ZodTypeAny, {
1146
+ error: {
1147
+ message: string;
1148
+ name?: string | undefined;
1149
+ code?: string | undefined;
1150
+ stack?: string | undefined;
1151
+ details?: any;
1152
+ };
1153
+ workflowId: string;
1154
+ definitionVersion: string;
1155
+ durationMs?: number | undefined;
1156
+ }, {
1157
+ error: {
1158
+ message: string;
1159
+ name?: string | undefined;
1160
+ code?: string | undefined;
1161
+ stack?: string | undefined;
1162
+ details?: any;
1163
+ };
1164
+ workflowId: string;
1165
+ definitionVersion: string;
1166
+ durationMs?: number | undefined;
1167
+ }>;
1168
+ }, "strip", z.ZodTypeAny, {
1169
+ type: "workflow:run:error";
1170
+ timestamp: string;
1171
+ trace: {
1172
+ traceId: string;
1173
+ spanId: string;
1174
+ parentSpanId?: string | undefined;
1175
+ };
1176
+ data: {
1177
+ error: {
1178
+ message: string;
1179
+ name?: string | undefined;
1180
+ code?: string | undefined;
1181
+ stack?: string | undefined;
1182
+ details?: any;
1183
+ };
1184
+ workflowId: string;
1185
+ definitionVersion: string;
1186
+ durationMs?: number | undefined;
1187
+ };
1188
+ correlationId?: string | undefined;
1189
+ executionId?: string | undefined;
1190
+ rootExecutionId?: string | undefined;
1191
+ parentExecutionId?: string | undefined;
1192
+ }, {
1193
+ type: "workflow:run:error";
1194
+ timestamp: string;
1195
+ trace: {
1196
+ traceId: string;
1197
+ spanId: string;
1198
+ parentSpanId?: string | undefined;
1199
+ };
1200
+ data: {
1201
+ error: {
1202
+ message: string;
1203
+ name?: string | undefined;
1204
+ code?: string | undefined;
1205
+ stack?: string | undefined;
1206
+ details?: any;
1207
+ };
1208
+ workflowId: string;
1209
+ definitionVersion: string;
1210
+ durationMs?: number | undefined;
1211
+ };
1212
+ correlationId?: string | undefined;
1213
+ executionId?: string | undefined;
1214
+ rootExecutionId?: string | undefined;
1215
+ parentExecutionId?: string | undefined;
1216
+ }>;
1217
+ export declare const WorkflowNodeStartSchema: z.ZodObject<{
1218
+ timestamp: z.ZodString;
1219
+ trace: z.ZodObject<{
1220
+ traceId: z.ZodString;
1221
+ spanId: z.ZodString;
1222
+ parentSpanId: z.ZodOptional<z.ZodString>;
1223
+ }, "strip", z.ZodTypeAny, {
1224
+ traceId: string;
1225
+ spanId: string;
1226
+ parentSpanId?: string | undefined;
1227
+ }, {
1228
+ traceId: string;
1229
+ spanId: string;
1230
+ parentSpanId?: string | undefined;
1231
+ }>;
1232
+ correlationId: z.ZodOptional<z.ZodString>;
1233
+ executionId: z.ZodOptional<z.ZodString>;
1234
+ rootExecutionId: z.ZodOptional<z.ZodString>;
1235
+ parentExecutionId: z.ZodOptional<z.ZodString>;
1236
+ } & {
1237
+ type: z.ZodLiteral<"workflow:node:start">;
1238
+ data: z.ZodObject<{
1239
+ workflowId: z.ZodString;
1240
+ nodeId: z.ZodString;
1241
+ nodeType: z.ZodEnum<["start", "step", "agent", "branch", "parallel", "finish"]>;
1242
+ attempt: z.ZodDefault<z.ZodNumber>;
1243
+ input: z.ZodOptional<z.ZodAny>;
1244
+ }, "strip", z.ZodTypeAny, {
1245
+ workflowId: string;
1246
+ nodeId: string;
1247
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
1248
+ attempt: number;
1249
+ input?: any;
1250
+ }, {
1251
+ workflowId: string;
1252
+ nodeId: string;
1253
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
1254
+ input?: any;
1255
+ attempt?: number | undefined;
1256
+ }>;
1257
+ }, "strip", z.ZodTypeAny, {
1258
+ type: "workflow:node:start";
1259
+ timestamp: string;
1260
+ trace: {
1261
+ traceId: string;
1262
+ spanId: string;
1263
+ parentSpanId?: string | undefined;
1264
+ };
1265
+ data: {
1266
+ workflowId: string;
1267
+ nodeId: string;
1268
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
1269
+ attempt: number;
1270
+ input?: any;
1271
+ };
1272
+ correlationId?: string | undefined;
1273
+ executionId?: string | undefined;
1274
+ rootExecutionId?: string | undefined;
1275
+ parentExecutionId?: string | undefined;
1276
+ }, {
1277
+ type: "workflow:node:start";
1278
+ timestamp: string;
1279
+ trace: {
1280
+ traceId: string;
1281
+ spanId: string;
1282
+ parentSpanId?: string | undefined;
1283
+ };
1284
+ data: {
1285
+ workflowId: string;
1286
+ nodeId: string;
1287
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
1288
+ input?: any;
1289
+ attempt?: number | undefined;
1290
+ };
1291
+ correlationId?: string | undefined;
1292
+ executionId?: string | undefined;
1293
+ rootExecutionId?: string | undefined;
1294
+ parentExecutionId?: string | undefined;
1295
+ }>;
1296
+ export declare const WorkflowNodeEndSchema: z.ZodObject<{
1297
+ timestamp: z.ZodString;
1298
+ trace: z.ZodObject<{
1299
+ traceId: z.ZodString;
1300
+ spanId: z.ZodString;
1301
+ parentSpanId: z.ZodOptional<z.ZodString>;
1302
+ }, "strip", z.ZodTypeAny, {
1303
+ traceId: string;
1304
+ spanId: string;
1305
+ parentSpanId?: string | undefined;
1306
+ }, {
1307
+ traceId: string;
1308
+ spanId: string;
1309
+ parentSpanId?: string | undefined;
1310
+ }>;
1311
+ correlationId: z.ZodOptional<z.ZodString>;
1312
+ executionId: z.ZodOptional<z.ZodString>;
1313
+ rootExecutionId: z.ZodOptional<z.ZodString>;
1314
+ parentExecutionId: z.ZodOptional<z.ZodString>;
1315
+ } & {
1316
+ type: z.ZodLiteral<"workflow:node:end">;
1317
+ data: z.ZodObject<{
1318
+ workflowId: z.ZodString;
1319
+ nodeId: z.ZodString;
1320
+ nodeType: z.ZodEnum<["start", "step", "agent", "branch", "parallel", "finish"]>;
1321
+ attempt: z.ZodDefault<z.ZodNumber>;
1322
+ status: z.ZodEnum<["success", "error"]>;
1323
+ durationMs: z.ZodNumber;
1324
+ output: z.ZodOptional<z.ZodAny>;
1325
+ error: z.ZodOptional<z.ZodObject<{
1326
+ name: z.ZodOptional<z.ZodString>;
1327
+ message: z.ZodString;
1328
+ code: z.ZodOptional<z.ZodString>;
1329
+ stack: z.ZodOptional<z.ZodString>;
1330
+ details: z.ZodOptional<z.ZodAny>;
1331
+ }, "strip", z.ZodTypeAny, {
1332
+ message: string;
1333
+ name?: string | undefined;
1334
+ code?: string | undefined;
1335
+ stack?: string | undefined;
1336
+ details?: any;
1337
+ }, {
1338
+ message: string;
1339
+ name?: string | undefined;
1340
+ code?: string | undefined;
1341
+ stack?: string | undefined;
1342
+ details?: any;
1343
+ }>>;
1344
+ }, "strip", z.ZodTypeAny, {
1345
+ status: "error" | "success";
1346
+ durationMs: number;
1347
+ workflowId: string;
1348
+ nodeId: string;
1349
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
1350
+ attempt: number;
1351
+ error?: {
1352
+ message: string;
1353
+ name?: string | undefined;
1354
+ code?: string | undefined;
1355
+ stack?: string | undefined;
1356
+ details?: any;
1357
+ } | undefined;
1358
+ output?: any;
1359
+ }, {
1360
+ status: "error" | "success";
1361
+ durationMs: number;
1362
+ workflowId: string;
1363
+ nodeId: string;
1364
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
1365
+ error?: {
1366
+ message: string;
1367
+ name?: string | undefined;
1368
+ code?: string | undefined;
1369
+ stack?: string | undefined;
1370
+ details?: any;
1371
+ } | undefined;
1372
+ output?: any;
1373
+ attempt?: number | undefined;
1374
+ }>;
1375
+ }, "strip", z.ZodTypeAny, {
1376
+ type: "workflow:node:end";
1377
+ timestamp: string;
1378
+ trace: {
1379
+ traceId: string;
1380
+ spanId: string;
1381
+ parentSpanId?: string | undefined;
1382
+ };
1383
+ data: {
1384
+ status: "error" | "success";
1385
+ durationMs: number;
1386
+ workflowId: string;
1387
+ nodeId: string;
1388
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
1389
+ attempt: number;
1390
+ error?: {
1391
+ message: string;
1392
+ name?: string | undefined;
1393
+ code?: string | undefined;
1394
+ stack?: string | undefined;
1395
+ details?: any;
1396
+ } | undefined;
1397
+ output?: any;
1398
+ };
1399
+ correlationId?: string | undefined;
1400
+ executionId?: string | undefined;
1401
+ rootExecutionId?: string | undefined;
1402
+ parentExecutionId?: string | undefined;
1403
+ }, {
1404
+ type: "workflow:node:end";
1405
+ timestamp: string;
1406
+ trace: {
1407
+ traceId: string;
1408
+ spanId: string;
1409
+ parentSpanId?: string | undefined;
1410
+ };
1411
+ data: {
1412
+ status: "error" | "success";
1413
+ durationMs: number;
1414
+ workflowId: string;
1415
+ nodeId: string;
1416
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
1417
+ error?: {
1418
+ message: string;
1419
+ name?: string | undefined;
1420
+ code?: string | undefined;
1421
+ stack?: string | undefined;
1422
+ details?: any;
1423
+ } | undefined;
1424
+ output?: any;
1425
+ attempt?: number | undefined;
1426
+ };
1427
+ correlationId?: string | undefined;
1428
+ executionId?: string | undefined;
1429
+ rootExecutionId?: string | undefined;
1430
+ parentExecutionId?: string | undefined;
1431
+ }>;
1432
+ export declare const ToolExecutionStartSchema: z.ZodObject<{
1433
+ timestamp: z.ZodString;
1434
+ trace: z.ZodObject<{
1435
+ traceId: z.ZodString;
1436
+ spanId: z.ZodString;
1437
+ parentSpanId: z.ZodOptional<z.ZodString>;
1438
+ }, "strip", z.ZodTypeAny, {
1439
+ traceId: string;
1440
+ spanId: string;
1441
+ parentSpanId?: string | undefined;
1442
+ }, {
1443
+ traceId: string;
1444
+ spanId: string;
1445
+ parentSpanId?: string | undefined;
1446
+ }>;
1447
+ correlationId: z.ZodOptional<z.ZodString>;
1448
+ executionId: z.ZodOptional<z.ZodString>;
1449
+ rootExecutionId: z.ZodOptional<z.ZodString>;
1450
+ parentExecutionId: z.ZodOptional<z.ZodString>;
1451
+ } & {
1452
+ type: z.ZodLiteral<"tool:execution:start">;
1453
+ data: z.ZodObject<{
1454
+ toolId: z.ZodString;
1455
+ toolName: z.ZodString;
1456
+ toolCallId: z.ZodOptional<z.ZodString>;
1457
+ input: z.ZodOptional<z.ZodAny>;
1458
+ }, "strip", z.ZodTypeAny, {
1459
+ toolName: string;
1460
+ toolId: string;
1461
+ input?: any;
1462
+ toolCallId?: string | undefined;
1463
+ }, {
1464
+ toolName: string;
1465
+ toolId: string;
1466
+ input?: any;
1467
+ toolCallId?: string | undefined;
1468
+ }>;
1469
+ }, "strip", z.ZodTypeAny, {
1470
+ type: "tool:execution:start";
1471
+ timestamp: string;
1472
+ trace: {
1473
+ traceId: string;
1474
+ spanId: string;
1475
+ parentSpanId?: string | undefined;
1476
+ };
1477
+ data: {
1478
+ toolName: string;
1479
+ toolId: string;
1480
+ input?: any;
1481
+ toolCallId?: string | undefined;
1482
+ };
1483
+ correlationId?: string | undefined;
1484
+ executionId?: string | undefined;
1485
+ rootExecutionId?: string | undefined;
1486
+ parentExecutionId?: string | undefined;
1487
+ }, {
1488
+ type: "tool:execution:start";
1489
+ timestamp: string;
1490
+ trace: {
1491
+ traceId: string;
1492
+ spanId: string;
1493
+ parentSpanId?: string | undefined;
1494
+ };
1495
+ data: {
1496
+ toolName: string;
1497
+ toolId: string;
1498
+ input?: any;
1499
+ toolCallId?: string | undefined;
1500
+ };
1501
+ correlationId?: string | undefined;
1502
+ executionId?: string | undefined;
1503
+ rootExecutionId?: string | undefined;
1504
+ parentExecutionId?: string | undefined;
1505
+ }>;
1506
+ export declare const ToolExecutionEndSchema: z.ZodObject<{
1507
+ timestamp: z.ZodString;
1508
+ trace: z.ZodObject<{
1509
+ traceId: z.ZodString;
1510
+ spanId: z.ZodString;
1511
+ parentSpanId: z.ZodOptional<z.ZodString>;
1512
+ }, "strip", z.ZodTypeAny, {
1513
+ traceId: string;
1514
+ spanId: string;
1515
+ parentSpanId?: string | undefined;
1516
+ }, {
1517
+ traceId: string;
1518
+ spanId: string;
1519
+ parentSpanId?: string | undefined;
1520
+ }>;
1521
+ correlationId: z.ZodOptional<z.ZodString>;
1522
+ executionId: z.ZodOptional<z.ZodString>;
1523
+ rootExecutionId: z.ZodOptional<z.ZodString>;
1524
+ parentExecutionId: z.ZodOptional<z.ZodString>;
1525
+ } & {
1526
+ type: z.ZodLiteral<"tool:execution:end">;
1527
+ data: z.ZodObject<{
1528
+ toolId: z.ZodString;
1529
+ toolName: z.ZodString;
1530
+ toolCallId: z.ZodOptional<z.ZodString>;
1531
+ status: z.ZodEnum<["success", "error"]>;
1532
+ output: z.ZodOptional<z.ZodAny>;
1533
+ durationMs: z.ZodNumber;
1534
+ }, "strip", z.ZodTypeAny, {
1535
+ status: "error" | "success";
1536
+ durationMs: number;
1537
+ toolName: string;
1538
+ toolId: string;
1539
+ output?: any;
1540
+ toolCallId?: string | undefined;
1541
+ }, {
1542
+ status: "error" | "success";
1543
+ durationMs: number;
1544
+ toolName: string;
1545
+ toolId: string;
1546
+ output?: any;
1547
+ toolCallId?: string | undefined;
1548
+ }>;
1549
+ }, "strip", z.ZodTypeAny, {
1550
+ type: "tool:execution:end";
1551
+ timestamp: string;
1552
+ trace: {
1553
+ traceId: string;
1554
+ spanId: string;
1555
+ parentSpanId?: string | undefined;
1556
+ };
1557
+ data: {
1558
+ status: "error" | "success";
1559
+ durationMs: number;
1560
+ toolName: string;
1561
+ toolId: string;
1562
+ output?: any;
1563
+ toolCallId?: string | undefined;
1564
+ };
1565
+ correlationId?: string | undefined;
1566
+ executionId?: string | undefined;
1567
+ rootExecutionId?: string | undefined;
1568
+ parentExecutionId?: string | undefined;
1569
+ }, {
1570
+ type: "tool:execution:end";
1571
+ timestamp: string;
1572
+ trace: {
1573
+ traceId: string;
1574
+ spanId: string;
1575
+ parentSpanId?: string | undefined;
1576
+ };
1577
+ data: {
1578
+ status: "error" | "success";
1579
+ durationMs: number;
1580
+ toolName: string;
1581
+ toolId: string;
1582
+ output?: any;
1583
+ toolCallId?: string | undefined;
1584
+ };
1585
+ correlationId?: string | undefined;
1586
+ executionId?: string | undefined;
1587
+ rootExecutionId?: string | undefined;
1588
+ parentExecutionId?: string | undefined;
1589
+ }>;
1590
+ export declare const ToolExecutionErrorSchema: z.ZodObject<{
1591
+ timestamp: z.ZodString;
1592
+ trace: z.ZodObject<{
1593
+ traceId: z.ZodString;
1594
+ spanId: z.ZodString;
1595
+ parentSpanId: z.ZodOptional<z.ZodString>;
1596
+ }, "strip", z.ZodTypeAny, {
1597
+ traceId: string;
1598
+ spanId: string;
1599
+ parentSpanId?: string | undefined;
1600
+ }, {
1601
+ traceId: string;
1602
+ spanId: string;
1603
+ parentSpanId?: string | undefined;
1604
+ }>;
1605
+ correlationId: z.ZodOptional<z.ZodString>;
1606
+ executionId: z.ZodOptional<z.ZodString>;
1607
+ rootExecutionId: z.ZodOptional<z.ZodString>;
1608
+ parentExecutionId: z.ZodOptional<z.ZodString>;
1609
+ } & {
1610
+ type: z.ZodLiteral<"tool:execution:error">;
1611
+ data: z.ZodObject<{
1612
+ toolId: z.ZodString;
1613
+ toolName: z.ZodString;
1614
+ toolCallId: z.ZodOptional<z.ZodString>;
1615
+ error: z.ZodObject<{
1616
+ name: z.ZodOptional<z.ZodString>;
1617
+ message: z.ZodString;
1618
+ code: z.ZodOptional<z.ZodString>;
1619
+ stack: z.ZodOptional<z.ZodString>;
1620
+ details: z.ZodOptional<z.ZodAny>;
1621
+ }, "strip", z.ZodTypeAny, {
1622
+ message: string;
1623
+ name?: string | undefined;
1624
+ code?: string | undefined;
1625
+ stack?: string | undefined;
1626
+ details?: any;
1627
+ }, {
1628
+ message: string;
1629
+ name?: string | undefined;
1630
+ code?: string | undefined;
1631
+ stack?: string | undefined;
1632
+ details?: any;
1633
+ }>;
1634
+ durationMs: z.ZodOptional<z.ZodNumber>;
1635
+ }, "strip", z.ZodTypeAny, {
1636
+ error: {
1637
+ message: string;
1638
+ name?: string | undefined;
1639
+ code?: string | undefined;
1640
+ stack?: string | undefined;
1641
+ details?: any;
1642
+ };
1643
+ toolName: string;
1644
+ toolId: string;
1645
+ durationMs?: number | undefined;
1646
+ toolCallId?: string | undefined;
1647
+ }, {
1648
+ error: {
1649
+ message: string;
1650
+ name?: string | undefined;
1651
+ code?: string | undefined;
1652
+ stack?: string | undefined;
1653
+ details?: any;
1654
+ };
1655
+ toolName: string;
1656
+ toolId: string;
1657
+ durationMs?: number | undefined;
1658
+ toolCallId?: string | undefined;
1659
+ }>;
1660
+ }, "strip", z.ZodTypeAny, {
1661
+ type: "tool:execution:error";
1662
+ timestamp: string;
1663
+ trace: {
1664
+ traceId: string;
1665
+ spanId: string;
1666
+ parentSpanId?: string | undefined;
1667
+ };
1668
+ data: {
1669
+ error: {
1670
+ message: string;
1671
+ name?: string | undefined;
1672
+ code?: string | undefined;
1673
+ stack?: string | undefined;
1674
+ details?: any;
1675
+ };
1676
+ toolName: string;
1677
+ toolId: string;
1678
+ durationMs?: number | undefined;
1679
+ toolCallId?: string | undefined;
1680
+ };
1681
+ correlationId?: string | undefined;
1682
+ executionId?: string | undefined;
1683
+ rootExecutionId?: string | undefined;
1684
+ parentExecutionId?: string | undefined;
1685
+ }, {
1686
+ type: "tool:execution:error";
1687
+ timestamp: string;
1688
+ trace: {
1689
+ traceId: string;
1690
+ spanId: string;
1691
+ parentSpanId?: string | undefined;
1692
+ };
1693
+ data: {
1694
+ error: {
1695
+ message: string;
1696
+ name?: string | undefined;
1697
+ code?: string | undefined;
1698
+ stack?: string | undefined;
1699
+ details?: any;
1700
+ };
1701
+ toolName: string;
1702
+ toolId: string;
1703
+ durationMs?: number | undefined;
1704
+ toolCallId?: string | undefined;
1705
+ };
1706
+ correlationId?: string | undefined;
1707
+ executionId?: string | undefined;
1708
+ rootExecutionId?: string | undefined;
1709
+ parentExecutionId?: string | undefined;
1710
+ }>;
1711
+ export declare const ExecutionCostIncurredSchema: z.ZodObject<{
1712
+ timestamp: z.ZodString;
1713
+ trace: z.ZodObject<{
1714
+ traceId: z.ZodString;
1715
+ spanId: z.ZodString;
1716
+ parentSpanId: z.ZodOptional<z.ZodString>;
1717
+ }, "strip", z.ZodTypeAny, {
1718
+ traceId: string;
1719
+ spanId: string;
1720
+ parentSpanId?: string | undefined;
1721
+ }, {
1722
+ traceId: string;
1723
+ spanId: string;
1724
+ parentSpanId?: string | undefined;
1725
+ }>;
1726
+ correlationId: z.ZodOptional<z.ZodString>;
1727
+ executionId: z.ZodOptional<z.ZodString>;
1728
+ rootExecutionId: z.ZodOptional<z.ZodString>;
1729
+ parentExecutionId: z.ZodOptional<z.ZodString>;
1730
+ } & {
1731
+ type: z.ZodLiteral<"execution:cost:incurred">;
1732
+ data: z.ZodObject<{
1733
+ amount: z.ZodString;
1734
+ description: z.ZodOptional<z.ZodString>;
1735
+ source: z.ZodOptional<z.ZodString>;
1736
+ idempotencyKey: z.ZodOptional<z.ZodString>;
1737
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1738
+ }, "strip", z.ZodTypeAny, {
1739
+ amount: string;
1740
+ metadata?: Record<string, any> | undefined;
1741
+ description?: string | undefined;
1742
+ source?: string | undefined;
1743
+ idempotencyKey?: string | undefined;
1744
+ }, {
1745
+ amount: string;
1746
+ metadata?: Record<string, any> | undefined;
1747
+ description?: string | undefined;
1748
+ source?: string | undefined;
1749
+ idempotencyKey?: string | undefined;
1750
+ }>;
1751
+ }, "strip", z.ZodTypeAny, {
1752
+ type: "execution:cost:incurred";
1753
+ timestamp: string;
1754
+ trace: {
1755
+ traceId: string;
1756
+ spanId: string;
1757
+ parentSpanId?: string | undefined;
1758
+ };
1759
+ data: {
1760
+ amount: string;
1761
+ metadata?: Record<string, any> | undefined;
1762
+ description?: string | undefined;
1763
+ source?: string | undefined;
1764
+ idempotencyKey?: string | undefined;
1765
+ };
1766
+ correlationId?: string | undefined;
1767
+ executionId?: string | undefined;
1768
+ rootExecutionId?: string | undefined;
1769
+ parentExecutionId?: string | undefined;
1770
+ }, {
1771
+ type: "execution:cost:incurred";
1772
+ timestamp: string;
1773
+ trace: {
1774
+ traceId: string;
1775
+ spanId: string;
1776
+ parentSpanId?: string | undefined;
1777
+ };
1778
+ data: {
1779
+ amount: string;
1780
+ metadata?: Record<string, any> | undefined;
1781
+ description?: string | undefined;
1782
+ source?: string | undefined;
1783
+ idempotencyKey?: string | undefined;
1784
+ };
1785
+ correlationId?: string | undefined;
1786
+ executionId?: string | undefined;
1787
+ rootExecutionId?: string | undefined;
1788
+ parentExecutionId?: string | undefined;
1789
+ }>;
1790
+ export declare const NebulaEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1791
+ timestamp: z.ZodString;
1792
+ trace: z.ZodObject<{
1793
+ traceId: z.ZodString;
1794
+ spanId: z.ZodString;
1795
+ parentSpanId: z.ZodOptional<z.ZodString>;
1796
+ }, "strip", z.ZodTypeAny, {
1797
+ traceId: string;
1798
+ spanId: string;
1799
+ parentSpanId?: string | undefined;
1800
+ }, {
1801
+ traceId: string;
1802
+ spanId: string;
1803
+ parentSpanId?: string | undefined;
1804
+ }>;
1805
+ correlationId: z.ZodOptional<z.ZodString>;
1806
+ executionId: z.ZodOptional<z.ZodString>;
1807
+ rootExecutionId: z.ZodOptional<z.ZodString>;
1808
+ parentExecutionId: z.ZodOptional<z.ZodString>;
1809
+ } & {
1810
+ type: z.ZodLiteral<"agent:execution:start">;
1811
+ data: z.ZodObject<{
1812
+ agentId: z.ZodString;
1813
+ agentName: z.ZodString;
1814
+ input: z.ZodOptional<z.ZodAny>;
1815
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1816
+ }, "strip", z.ZodTypeAny, {
1817
+ agentId: string;
1818
+ agentName: string;
1819
+ input?: any;
1820
+ metadata?: Record<string, any> | undefined;
1821
+ }, {
1822
+ agentId: string;
1823
+ agentName: string;
1824
+ input?: any;
1825
+ metadata?: Record<string, any> | undefined;
1826
+ }>;
1827
+ }, "strip", z.ZodTypeAny, {
1828
+ type: "agent:execution:start";
1829
+ timestamp: string;
1830
+ trace: {
1831
+ traceId: string;
1832
+ spanId: string;
1833
+ parentSpanId?: string | undefined;
1834
+ };
1835
+ data: {
1836
+ agentId: string;
1837
+ agentName: string;
1838
+ input?: any;
1839
+ metadata?: Record<string, any> | undefined;
1840
+ };
1841
+ correlationId?: string | undefined;
1842
+ executionId?: string | undefined;
1843
+ rootExecutionId?: string | undefined;
1844
+ parentExecutionId?: string | undefined;
1845
+ }, {
1846
+ type: "agent:execution:start";
1847
+ timestamp: string;
1848
+ trace: {
1849
+ traceId: string;
1850
+ spanId: string;
1851
+ parentSpanId?: string | undefined;
1852
+ };
1853
+ data: {
1854
+ agentId: string;
1855
+ agentName: string;
1856
+ input?: any;
1857
+ metadata?: Record<string, any> | undefined;
1858
+ };
1859
+ correlationId?: string | undefined;
1860
+ executionId?: string | undefined;
1861
+ rootExecutionId?: string | undefined;
1862
+ parentExecutionId?: string | undefined;
1863
+ }>, z.ZodObject<{
1864
+ timestamp: z.ZodString;
1865
+ trace: z.ZodObject<{
1866
+ traceId: z.ZodString;
1867
+ spanId: z.ZodString;
1868
+ parentSpanId: z.ZodOptional<z.ZodString>;
1869
+ }, "strip", z.ZodTypeAny, {
1870
+ traceId: string;
1871
+ spanId: string;
1872
+ parentSpanId?: string | undefined;
1873
+ }, {
1874
+ traceId: string;
1875
+ spanId: string;
1876
+ parentSpanId?: string | undefined;
1877
+ }>;
1878
+ correlationId: z.ZodOptional<z.ZodString>;
1879
+ executionId: z.ZodOptional<z.ZodString>;
1880
+ rootExecutionId: z.ZodOptional<z.ZodString>;
1881
+ parentExecutionId: z.ZodOptional<z.ZodString>;
1882
+ } & {
1883
+ type: z.ZodLiteral<"agent:execution:end">;
1884
+ data: z.ZodObject<{
1885
+ agentId: z.ZodString;
1886
+ agentName: z.ZodString;
1887
+ status: z.ZodEnum<["success", "error", "truncated"]>;
1888
+ output: z.ZodOptional<z.ZodAny>;
1889
+ durationMs: z.ZodNumber;
1890
+ usage: z.ZodOptional<z.ZodObject<{
1891
+ promptTokens: z.ZodNumber;
1892
+ completionTokens: z.ZodNumber;
1893
+ totalTokens: z.ZodNumber;
1894
+ reasoningTokens: z.ZodOptional<z.ZodNumber>;
1895
+ }, "strip", z.ZodTypeAny, {
1896
+ promptTokens: number;
1897
+ completionTokens: number;
1898
+ totalTokens: number;
1899
+ reasoningTokens?: number | undefined;
1900
+ }, {
1901
+ promptTokens: number;
1902
+ completionTokens: number;
1903
+ totalTokens: number;
1904
+ reasoningTokens?: number | undefined;
1905
+ }>>;
1906
+ }, "strip", z.ZodTypeAny, {
1907
+ status: "error" | "success" | "truncated";
1908
+ agentId: string;
1909
+ agentName: string;
1910
+ durationMs: number;
1911
+ output?: any;
1912
+ usage?: {
1913
+ promptTokens: number;
1914
+ completionTokens: number;
1915
+ totalTokens: number;
1916
+ reasoningTokens?: number | undefined;
1917
+ } | undefined;
1918
+ }, {
1919
+ status: "error" | "success" | "truncated";
1920
+ agentId: string;
1921
+ agentName: string;
1922
+ durationMs: number;
1923
+ output?: any;
1924
+ usage?: {
1925
+ promptTokens: number;
1926
+ completionTokens: number;
1927
+ totalTokens: number;
1928
+ reasoningTokens?: number | undefined;
1929
+ } | undefined;
1930
+ }>;
1931
+ }, "strip", z.ZodTypeAny, {
1932
+ type: "agent:execution:end";
1933
+ timestamp: string;
1934
+ trace: {
1935
+ traceId: string;
1936
+ spanId: string;
1937
+ parentSpanId?: string | undefined;
1938
+ };
1939
+ data: {
1940
+ status: "error" | "success" | "truncated";
1941
+ agentId: string;
1942
+ agentName: string;
1943
+ durationMs: number;
1944
+ output?: any;
1945
+ usage?: {
1946
+ promptTokens: number;
1947
+ completionTokens: number;
1948
+ totalTokens: number;
1949
+ reasoningTokens?: number | undefined;
1950
+ } | undefined;
1951
+ };
1952
+ correlationId?: string | undefined;
1953
+ executionId?: string | undefined;
1954
+ rootExecutionId?: string | undefined;
1955
+ parentExecutionId?: string | undefined;
1956
+ }, {
1957
+ type: "agent:execution:end";
1958
+ timestamp: string;
1959
+ trace: {
1960
+ traceId: string;
1961
+ spanId: string;
1962
+ parentSpanId?: string | undefined;
1963
+ };
1964
+ data: {
1965
+ status: "error" | "success" | "truncated";
1966
+ agentId: string;
1967
+ agentName: string;
1968
+ durationMs: number;
1969
+ output?: any;
1970
+ usage?: {
1971
+ promptTokens: number;
1972
+ completionTokens: number;
1973
+ totalTokens: number;
1974
+ reasoningTokens?: number | undefined;
1975
+ } | undefined;
1976
+ };
1977
+ correlationId?: string | undefined;
1978
+ executionId?: string | undefined;
1979
+ rootExecutionId?: string | undefined;
1980
+ parentExecutionId?: string | undefined;
1981
+ }>, z.ZodObject<{
1982
+ timestamp: z.ZodString;
1983
+ trace: z.ZodObject<{
1984
+ traceId: z.ZodString;
1985
+ spanId: z.ZodString;
1986
+ parentSpanId: z.ZodOptional<z.ZodString>;
1987
+ }, "strip", z.ZodTypeAny, {
1988
+ traceId: string;
1989
+ spanId: string;
1990
+ parentSpanId?: string | undefined;
1991
+ }, {
1992
+ traceId: string;
1993
+ spanId: string;
1994
+ parentSpanId?: string | undefined;
1995
+ }>;
1996
+ correlationId: z.ZodOptional<z.ZodString>;
1997
+ executionId: z.ZodOptional<z.ZodString>;
1998
+ rootExecutionId: z.ZodOptional<z.ZodString>;
1999
+ parentExecutionId: z.ZodOptional<z.ZodString>;
2000
+ } & {
2001
+ type: z.ZodLiteral<"agent:execution:error">;
2002
+ data: z.ZodObject<{
2003
+ agentId: z.ZodString;
2004
+ agentName: z.ZodString;
2005
+ error: z.ZodObject<{
2006
+ name: z.ZodOptional<z.ZodString>;
2007
+ message: z.ZodString;
2008
+ code: z.ZodOptional<z.ZodString>;
2009
+ stack: z.ZodOptional<z.ZodString>;
2010
+ details: z.ZodOptional<z.ZodAny>;
2011
+ }, "strip", z.ZodTypeAny, {
2012
+ message: string;
2013
+ name?: string | undefined;
2014
+ code?: string | undefined;
2015
+ stack?: string | undefined;
2016
+ details?: any;
2017
+ }, {
2018
+ message: string;
2019
+ name?: string | undefined;
2020
+ code?: string | undefined;
2021
+ stack?: string | undefined;
2022
+ details?: any;
2023
+ }>;
2024
+ durationMs: z.ZodOptional<z.ZodNumber>;
2025
+ }, "strip", z.ZodTypeAny, {
2026
+ error: {
2027
+ message: string;
2028
+ name?: string | undefined;
2029
+ code?: string | undefined;
2030
+ stack?: string | undefined;
2031
+ details?: any;
2032
+ };
2033
+ agentId: string;
2034
+ agentName: string;
2035
+ durationMs?: number | undefined;
2036
+ }, {
2037
+ error: {
2038
+ message: string;
2039
+ name?: string | undefined;
2040
+ code?: string | undefined;
2041
+ stack?: string | undefined;
2042
+ details?: any;
2043
+ };
2044
+ agentId: string;
2045
+ agentName: string;
2046
+ durationMs?: number | undefined;
2047
+ }>;
2048
+ }, "strip", z.ZodTypeAny, {
2049
+ type: "agent:execution:error";
2050
+ timestamp: string;
2051
+ trace: {
2052
+ traceId: string;
2053
+ spanId: string;
2054
+ parentSpanId?: string | undefined;
2055
+ };
2056
+ data: {
2057
+ error: {
2058
+ message: string;
2059
+ name?: string | undefined;
2060
+ code?: string | undefined;
2061
+ stack?: string | undefined;
2062
+ details?: any;
2063
+ };
2064
+ agentId: string;
2065
+ agentName: string;
2066
+ durationMs?: number | undefined;
2067
+ };
2068
+ correlationId?: string | undefined;
2069
+ executionId?: string | undefined;
2070
+ rootExecutionId?: string | undefined;
2071
+ parentExecutionId?: string | undefined;
2072
+ }, {
2073
+ type: "agent:execution:error";
2074
+ timestamp: string;
2075
+ trace: {
2076
+ traceId: string;
2077
+ spanId: string;
2078
+ parentSpanId?: string | undefined;
2079
+ };
2080
+ data: {
2081
+ error: {
2082
+ message: string;
2083
+ name?: string | undefined;
2084
+ code?: string | undefined;
2085
+ stack?: string | undefined;
2086
+ details?: any;
2087
+ };
2088
+ agentId: string;
2089
+ agentName: string;
2090
+ durationMs?: number | undefined;
2091
+ };
2092
+ correlationId?: string | undefined;
2093
+ executionId?: string | undefined;
2094
+ rootExecutionId?: string | undefined;
2095
+ parentExecutionId?: string | undefined;
2096
+ }>, z.ZodObject<{
2097
+ timestamp: z.ZodString;
2098
+ trace: z.ZodObject<{
2099
+ traceId: z.ZodString;
2100
+ spanId: z.ZodString;
2101
+ parentSpanId: z.ZodOptional<z.ZodString>;
2102
+ }, "strip", z.ZodTypeAny, {
2103
+ traceId: string;
2104
+ spanId: string;
2105
+ parentSpanId?: string | undefined;
2106
+ }, {
2107
+ traceId: string;
2108
+ spanId: string;
2109
+ parentSpanId?: string | undefined;
2110
+ }>;
2111
+ correlationId: z.ZodOptional<z.ZodString>;
2112
+ executionId: z.ZodOptional<z.ZodString>;
2113
+ rootExecutionId: z.ZodOptional<z.ZodString>;
2114
+ parentExecutionId: z.ZodOptional<z.ZodString>;
2115
+ } & {
2116
+ type: z.ZodLiteral<"agent:llm:call">;
2117
+ data: z.ZodObject<{
2118
+ agentId: z.ZodString;
2119
+ agentName: z.ZodString;
2120
+ step: z.ZodNumber;
2121
+ model: z.ZodObject<{
2122
+ provider: z.ZodString;
2123
+ model: z.ZodString;
2124
+ temperature: z.ZodOptional<z.ZodNumber>;
2125
+ maxTokens: z.ZodOptional<z.ZodNumber>;
2126
+ topP: z.ZodOptional<z.ZodNumber>;
2127
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
2128
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
2129
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2130
+ provider: z.ZodString;
2131
+ model: z.ZodString;
2132
+ temperature: z.ZodOptional<z.ZodNumber>;
2133
+ maxTokens: z.ZodOptional<z.ZodNumber>;
2134
+ topP: z.ZodOptional<z.ZodNumber>;
2135
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
2136
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
2137
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2138
+ provider: z.ZodString;
2139
+ model: z.ZodString;
2140
+ temperature: z.ZodOptional<z.ZodNumber>;
2141
+ maxTokens: z.ZodOptional<z.ZodNumber>;
2142
+ topP: z.ZodOptional<z.ZodNumber>;
2143
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
2144
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
2145
+ }, z.ZodTypeAny, "passthrough">>;
2146
+ messages: z.ZodArray<z.ZodAny, "many">;
2147
+ tools: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
2148
+ responseFormat: z.ZodOptional<z.ZodAny>;
2149
+ }, "strip", z.ZodTypeAny, {
2150
+ model: {
2151
+ provider: string;
2152
+ model: string;
2153
+ temperature?: number | undefined;
2154
+ maxTokens?: number | undefined;
2155
+ topP?: number | undefined;
2156
+ frequencyPenalty?: number | undefined;
2157
+ presencePenalty?: number | undefined;
2158
+ } & {
2159
+ [k: string]: unknown;
2160
+ };
2161
+ agentId: string;
2162
+ agentName: string;
2163
+ step: number;
2164
+ messages: any[];
2165
+ responseFormat?: any;
2166
+ tools?: any[] | undefined;
2167
+ }, {
2168
+ model: {
2169
+ provider: string;
2170
+ model: string;
2171
+ temperature?: number | undefined;
2172
+ maxTokens?: number | undefined;
2173
+ topP?: number | undefined;
2174
+ frequencyPenalty?: number | undefined;
2175
+ presencePenalty?: number | undefined;
2176
+ } & {
2177
+ [k: string]: unknown;
2178
+ };
2179
+ agentId: string;
2180
+ agentName: string;
2181
+ step: number;
2182
+ messages: any[];
2183
+ responseFormat?: any;
2184
+ tools?: any[] | undefined;
2185
+ }>;
2186
+ }, "strip", z.ZodTypeAny, {
2187
+ type: "agent:llm:call";
2188
+ timestamp: string;
2189
+ trace: {
2190
+ traceId: string;
2191
+ spanId: string;
2192
+ parentSpanId?: string | undefined;
2193
+ };
2194
+ data: {
2195
+ model: {
2196
+ provider: string;
2197
+ model: string;
2198
+ temperature?: number | undefined;
2199
+ maxTokens?: number | undefined;
2200
+ topP?: number | undefined;
2201
+ frequencyPenalty?: number | undefined;
2202
+ presencePenalty?: number | undefined;
2203
+ } & {
2204
+ [k: string]: unknown;
2205
+ };
2206
+ agentId: string;
2207
+ agentName: string;
2208
+ step: number;
2209
+ messages: any[];
2210
+ responseFormat?: any;
2211
+ tools?: any[] | undefined;
2212
+ };
2213
+ correlationId?: string | undefined;
2214
+ executionId?: string | undefined;
2215
+ rootExecutionId?: string | undefined;
2216
+ parentExecutionId?: string | undefined;
2217
+ }, {
2218
+ type: "agent:llm:call";
2219
+ timestamp: string;
2220
+ trace: {
2221
+ traceId: string;
2222
+ spanId: string;
2223
+ parentSpanId?: string | undefined;
2224
+ };
2225
+ data: {
2226
+ model: {
2227
+ provider: string;
2228
+ model: string;
2229
+ temperature?: number | undefined;
2230
+ maxTokens?: number | undefined;
2231
+ topP?: number | undefined;
2232
+ frequencyPenalty?: number | undefined;
2233
+ presencePenalty?: number | undefined;
2234
+ } & {
2235
+ [k: string]: unknown;
2236
+ };
2237
+ agentId: string;
2238
+ agentName: string;
2239
+ step: number;
2240
+ messages: any[];
2241
+ responseFormat?: any;
2242
+ tools?: any[] | undefined;
2243
+ };
2244
+ correlationId?: string | undefined;
2245
+ executionId?: string | undefined;
2246
+ rootExecutionId?: string | undefined;
2247
+ parentExecutionId?: string | undefined;
2248
+ }>, z.ZodObject<{
2249
+ timestamp: z.ZodString;
2250
+ trace: z.ZodObject<{
2251
+ traceId: z.ZodString;
2252
+ spanId: z.ZodString;
2253
+ parentSpanId: z.ZodOptional<z.ZodString>;
2254
+ }, "strip", z.ZodTypeAny, {
2255
+ traceId: string;
2256
+ spanId: string;
2257
+ parentSpanId?: string | undefined;
2258
+ }, {
2259
+ traceId: string;
2260
+ spanId: string;
2261
+ parentSpanId?: string | undefined;
2262
+ }>;
2263
+ correlationId: z.ZodOptional<z.ZodString>;
2264
+ executionId: z.ZodOptional<z.ZodString>;
2265
+ rootExecutionId: z.ZodOptional<z.ZodString>;
2266
+ parentExecutionId: z.ZodOptional<z.ZodString>;
2267
+ } & {
2268
+ type: z.ZodLiteral<"agent:llm:response">;
2269
+ data: z.ZodObject<{
2270
+ agentId: z.ZodString;
2271
+ agentName: z.ZodString;
2272
+ step: z.ZodNumber;
2273
+ model: z.ZodObject<{
2274
+ provider: z.ZodString;
2275
+ model: z.ZodString;
2276
+ temperature: z.ZodOptional<z.ZodNumber>;
2277
+ maxTokens: z.ZodOptional<z.ZodNumber>;
2278
+ topP: z.ZodOptional<z.ZodNumber>;
2279
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
2280
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
2281
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
2282
+ provider: z.ZodString;
2283
+ model: z.ZodString;
2284
+ temperature: z.ZodOptional<z.ZodNumber>;
2285
+ maxTokens: z.ZodOptional<z.ZodNumber>;
2286
+ topP: z.ZodOptional<z.ZodNumber>;
2287
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
2288
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
2289
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
2290
+ provider: z.ZodString;
2291
+ model: z.ZodString;
2292
+ temperature: z.ZodOptional<z.ZodNumber>;
2293
+ maxTokens: z.ZodOptional<z.ZodNumber>;
2294
+ topP: z.ZodOptional<z.ZodNumber>;
2295
+ frequencyPenalty: z.ZodOptional<z.ZodNumber>;
2296
+ presencePenalty: z.ZodOptional<z.ZodNumber>;
2297
+ }, z.ZodTypeAny, "passthrough">>;
2298
+ content: z.ZodAny;
2299
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
2300
+ finishReason: z.ZodOptional<z.ZodString>;
2301
+ usage: z.ZodOptional<z.ZodObject<{
2302
+ promptTokens: z.ZodNumber;
2303
+ completionTokens: z.ZodNumber;
2304
+ totalTokens: z.ZodNumber;
2305
+ reasoningTokens: z.ZodOptional<z.ZodNumber>;
2306
+ }, "strip", z.ZodTypeAny, {
2307
+ promptTokens: number;
2308
+ completionTokens: number;
2309
+ totalTokens: number;
2310
+ reasoningTokens?: number | undefined;
2311
+ }, {
2312
+ promptTokens: number;
2313
+ completionTokens: number;
2314
+ totalTokens: number;
2315
+ reasoningTokens?: number | undefined;
2316
+ }>>;
2317
+ durationMs: z.ZodOptional<z.ZodNumber>;
2318
+ }, "strip", z.ZodTypeAny, {
2319
+ model: {
2320
+ provider: string;
2321
+ model: string;
2322
+ temperature?: number | undefined;
2323
+ maxTokens?: number | undefined;
2324
+ topP?: number | undefined;
2325
+ frequencyPenalty?: number | undefined;
2326
+ presencePenalty?: number | undefined;
2327
+ } & {
2328
+ [k: string]: unknown;
2329
+ };
2330
+ agentId: string;
2331
+ agentName: string;
2332
+ step: number;
2333
+ finishReason?: string | undefined;
2334
+ durationMs?: number | undefined;
2335
+ usage?: {
2336
+ promptTokens: number;
2337
+ completionTokens: number;
2338
+ totalTokens: number;
2339
+ reasoningTokens?: number | undefined;
2340
+ } | undefined;
2341
+ content?: any;
2342
+ toolCalls?: any[] | undefined;
2343
+ }, {
2344
+ model: {
2345
+ provider: string;
2346
+ model: string;
2347
+ temperature?: number | undefined;
2348
+ maxTokens?: number | undefined;
2349
+ topP?: number | undefined;
2350
+ frequencyPenalty?: number | undefined;
2351
+ presencePenalty?: number | undefined;
2352
+ } & {
2353
+ [k: string]: unknown;
2354
+ };
2355
+ agentId: string;
2356
+ agentName: string;
2357
+ step: number;
2358
+ finishReason?: string | undefined;
2359
+ durationMs?: number | undefined;
2360
+ usage?: {
2361
+ promptTokens: number;
2362
+ completionTokens: number;
2363
+ totalTokens: number;
2364
+ reasoningTokens?: number | undefined;
2365
+ } | undefined;
2366
+ content?: any;
2367
+ toolCalls?: any[] | undefined;
2368
+ }>;
2369
+ }, "strip", z.ZodTypeAny, {
2370
+ type: "agent:llm:response";
2371
+ timestamp: string;
2372
+ trace: {
2373
+ traceId: string;
2374
+ spanId: string;
2375
+ parentSpanId?: string | undefined;
2376
+ };
2377
+ data: {
2378
+ model: {
2379
+ provider: string;
2380
+ model: string;
2381
+ temperature?: number | undefined;
2382
+ maxTokens?: number | undefined;
2383
+ topP?: number | undefined;
2384
+ frequencyPenalty?: number | undefined;
2385
+ presencePenalty?: number | undefined;
2386
+ } & {
2387
+ [k: string]: unknown;
2388
+ };
2389
+ agentId: string;
2390
+ agentName: string;
2391
+ step: number;
2392
+ finishReason?: string | undefined;
2393
+ durationMs?: number | undefined;
2394
+ usage?: {
2395
+ promptTokens: number;
2396
+ completionTokens: number;
2397
+ totalTokens: number;
2398
+ reasoningTokens?: number | undefined;
2399
+ } | undefined;
2400
+ content?: any;
2401
+ toolCalls?: any[] | undefined;
2402
+ };
2403
+ correlationId?: string | undefined;
2404
+ executionId?: string | undefined;
2405
+ rootExecutionId?: string | undefined;
2406
+ parentExecutionId?: string | undefined;
2407
+ }, {
2408
+ type: "agent:llm:response";
2409
+ timestamp: string;
2410
+ trace: {
2411
+ traceId: string;
2412
+ spanId: string;
2413
+ parentSpanId?: string | undefined;
2414
+ };
2415
+ data: {
2416
+ model: {
2417
+ provider: string;
2418
+ model: string;
2419
+ temperature?: number | undefined;
2420
+ maxTokens?: number | undefined;
2421
+ topP?: number | undefined;
2422
+ frequencyPenalty?: number | undefined;
2423
+ presencePenalty?: number | undefined;
2424
+ } & {
2425
+ [k: string]: unknown;
2426
+ };
2427
+ agentId: string;
2428
+ agentName: string;
2429
+ step: number;
2430
+ finishReason?: string | undefined;
2431
+ durationMs?: number | undefined;
2432
+ usage?: {
2433
+ promptTokens: number;
2434
+ completionTokens: number;
2435
+ totalTokens: number;
2436
+ reasoningTokens?: number | undefined;
2437
+ } | undefined;
2438
+ content?: any;
2439
+ toolCalls?: any[] | undefined;
2440
+ };
2441
+ correlationId?: string | undefined;
2442
+ executionId?: string | undefined;
2443
+ rootExecutionId?: string | undefined;
2444
+ parentExecutionId?: string | undefined;
2445
+ }>, z.ZodObject<{
2446
+ timestamp: z.ZodString;
2447
+ trace: z.ZodObject<{
2448
+ traceId: z.ZodString;
2449
+ spanId: z.ZodString;
2450
+ parentSpanId: z.ZodOptional<z.ZodString>;
2451
+ }, "strip", z.ZodTypeAny, {
2452
+ traceId: string;
2453
+ spanId: string;
2454
+ parentSpanId?: string | undefined;
2455
+ }, {
2456
+ traceId: string;
2457
+ spanId: string;
2458
+ parentSpanId?: string | undefined;
2459
+ }>;
2460
+ correlationId: z.ZodOptional<z.ZodString>;
2461
+ executionId: z.ZodOptional<z.ZodString>;
2462
+ rootExecutionId: z.ZodOptional<z.ZodString>;
2463
+ parentExecutionId: z.ZodOptional<z.ZodString>;
2464
+ } & {
2465
+ type: z.ZodLiteral<"agent:tool:call">;
2466
+ data: z.ZodObject<{
2467
+ agentId: z.ZodString;
2468
+ agentName: z.ZodString;
2469
+ toolName: z.ZodString;
2470
+ toolCallId: z.ZodString;
2471
+ args: z.ZodAny;
2472
+ }, "strip", z.ZodTypeAny, {
2473
+ agentId: string;
2474
+ agentName: string;
2475
+ toolName: string;
2476
+ toolCallId: string;
2477
+ args?: any;
2478
+ }, {
2479
+ agentId: string;
2480
+ agentName: string;
2481
+ toolName: string;
2482
+ toolCallId: string;
2483
+ args?: any;
2484
+ }>;
2485
+ }, "strip", z.ZodTypeAny, {
2486
+ type: "agent:tool:call";
2487
+ timestamp: string;
2488
+ trace: {
2489
+ traceId: string;
2490
+ spanId: string;
2491
+ parentSpanId?: string | undefined;
2492
+ };
2493
+ data: {
2494
+ agentId: string;
2495
+ agentName: string;
2496
+ toolName: string;
2497
+ toolCallId: string;
2498
+ args?: any;
2499
+ };
2500
+ correlationId?: string | undefined;
2501
+ executionId?: string | undefined;
2502
+ rootExecutionId?: string | undefined;
2503
+ parentExecutionId?: string | undefined;
2504
+ }, {
2505
+ type: "agent:tool:call";
2506
+ timestamp: string;
2507
+ trace: {
2508
+ traceId: string;
2509
+ spanId: string;
2510
+ parentSpanId?: string | undefined;
2511
+ };
2512
+ data: {
2513
+ agentId: string;
2514
+ agentName: string;
2515
+ toolName: string;
2516
+ toolCallId: string;
2517
+ args?: any;
2518
+ };
2519
+ correlationId?: string | undefined;
2520
+ executionId?: string | undefined;
2521
+ rootExecutionId?: string | undefined;
2522
+ parentExecutionId?: string | undefined;
2523
+ }>, z.ZodObject<{
2524
+ timestamp: z.ZodString;
2525
+ trace: z.ZodObject<{
2526
+ traceId: z.ZodString;
2527
+ spanId: z.ZodString;
2528
+ parentSpanId: z.ZodOptional<z.ZodString>;
2529
+ }, "strip", z.ZodTypeAny, {
2530
+ traceId: string;
2531
+ spanId: string;
2532
+ parentSpanId?: string | undefined;
2533
+ }, {
2534
+ traceId: string;
2535
+ spanId: string;
2536
+ parentSpanId?: string | undefined;
2537
+ }>;
2538
+ correlationId: z.ZodOptional<z.ZodString>;
2539
+ executionId: z.ZodOptional<z.ZodString>;
2540
+ rootExecutionId: z.ZodOptional<z.ZodString>;
2541
+ parentExecutionId: z.ZodOptional<z.ZodString>;
2542
+ } & {
2543
+ type: z.ZodLiteral<"agent:tool:result">;
2544
+ data: z.ZodObject<{
2545
+ agentId: z.ZodString;
2546
+ agentName: z.ZodString;
2547
+ toolName: z.ZodString;
2548
+ toolCallId: z.ZodString;
2549
+ output: z.ZodOptional<z.ZodAny>;
2550
+ error: z.ZodOptional<z.ZodString>;
2551
+ durationMs: z.ZodOptional<z.ZodNumber>;
2552
+ }, "strip", z.ZodTypeAny, {
2553
+ agentId: string;
2554
+ agentName: string;
2555
+ toolName: string;
2556
+ toolCallId: string;
2557
+ error?: string | undefined;
2558
+ output?: any;
2559
+ durationMs?: number | undefined;
2560
+ }, {
2561
+ agentId: string;
2562
+ agentName: string;
2563
+ toolName: string;
2564
+ toolCallId: string;
2565
+ error?: string | undefined;
2566
+ output?: any;
2567
+ durationMs?: number | undefined;
2568
+ }>;
2569
+ }, "strip", z.ZodTypeAny, {
2570
+ type: "agent:tool:result";
2571
+ timestamp: string;
2572
+ trace: {
2573
+ traceId: string;
2574
+ spanId: string;
2575
+ parentSpanId?: string | undefined;
2576
+ };
2577
+ data: {
2578
+ agentId: string;
2579
+ agentName: string;
2580
+ toolName: string;
2581
+ toolCallId: string;
2582
+ error?: string | undefined;
2583
+ output?: any;
2584
+ durationMs?: number | undefined;
2585
+ };
2586
+ correlationId?: string | undefined;
2587
+ executionId?: string | undefined;
2588
+ rootExecutionId?: string | undefined;
2589
+ parentExecutionId?: string | undefined;
2590
+ }, {
2591
+ type: "agent:tool:result";
2592
+ timestamp: string;
2593
+ trace: {
2594
+ traceId: string;
2595
+ spanId: string;
2596
+ parentSpanId?: string | undefined;
2597
+ };
2598
+ data: {
2599
+ agentId: string;
2600
+ agentName: string;
2601
+ toolName: string;
2602
+ toolCallId: string;
2603
+ error?: string | undefined;
2604
+ output?: any;
2605
+ durationMs?: number | undefined;
2606
+ };
2607
+ correlationId?: string | undefined;
2608
+ executionId?: string | undefined;
2609
+ rootExecutionId?: string | undefined;
2610
+ parentExecutionId?: string | undefined;
2611
+ }>, z.ZodObject<{
2612
+ timestamp: z.ZodString;
2613
+ trace: z.ZodObject<{
2614
+ traceId: z.ZodString;
2615
+ spanId: z.ZodString;
2616
+ parentSpanId: z.ZodOptional<z.ZodString>;
2617
+ }, "strip", z.ZodTypeAny, {
2618
+ traceId: string;
2619
+ spanId: string;
2620
+ parentSpanId?: string | undefined;
2621
+ }, {
2622
+ traceId: string;
2623
+ spanId: string;
2624
+ parentSpanId?: string | undefined;
2625
+ }>;
2626
+ correlationId: z.ZodOptional<z.ZodString>;
2627
+ executionId: z.ZodOptional<z.ZodString>;
2628
+ rootExecutionId: z.ZodOptional<z.ZodString>;
2629
+ parentExecutionId: z.ZodOptional<z.ZodString>;
2630
+ } & {
2631
+ type: z.ZodLiteral<"workflow:run:start">;
2632
+ data: z.ZodObject<{
2633
+ workflowId: z.ZodString;
2634
+ definitionVersion: z.ZodString;
2635
+ input: z.ZodOptional<z.ZodAny>;
2636
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2637
+ }, "strip", z.ZodTypeAny, {
2638
+ workflowId: string;
2639
+ definitionVersion: string;
2640
+ input?: any;
2641
+ metadata?: Record<string, any> | undefined;
2642
+ }, {
2643
+ workflowId: string;
2644
+ definitionVersion: string;
2645
+ input?: any;
2646
+ metadata?: Record<string, any> | undefined;
2647
+ }>;
2648
+ }, "strip", z.ZodTypeAny, {
2649
+ type: "workflow:run:start";
2650
+ timestamp: string;
2651
+ trace: {
2652
+ traceId: string;
2653
+ spanId: string;
2654
+ parentSpanId?: string | undefined;
2655
+ };
2656
+ data: {
2657
+ workflowId: string;
2658
+ definitionVersion: string;
2659
+ input?: any;
2660
+ metadata?: Record<string, any> | undefined;
2661
+ };
2662
+ correlationId?: string | undefined;
2663
+ executionId?: string | undefined;
2664
+ rootExecutionId?: string | undefined;
2665
+ parentExecutionId?: string | undefined;
2666
+ }, {
2667
+ type: "workflow:run:start";
2668
+ timestamp: string;
2669
+ trace: {
2670
+ traceId: string;
2671
+ spanId: string;
2672
+ parentSpanId?: string | undefined;
2673
+ };
2674
+ data: {
2675
+ workflowId: string;
2676
+ definitionVersion: string;
2677
+ input?: any;
2678
+ metadata?: Record<string, any> | undefined;
2679
+ };
2680
+ correlationId?: string | undefined;
2681
+ executionId?: string | undefined;
2682
+ rootExecutionId?: string | undefined;
2683
+ parentExecutionId?: string | undefined;
2684
+ }>, z.ZodObject<{
2685
+ timestamp: z.ZodString;
2686
+ trace: z.ZodObject<{
2687
+ traceId: z.ZodString;
2688
+ spanId: z.ZodString;
2689
+ parentSpanId: z.ZodOptional<z.ZodString>;
2690
+ }, "strip", z.ZodTypeAny, {
2691
+ traceId: string;
2692
+ spanId: string;
2693
+ parentSpanId?: string | undefined;
2694
+ }, {
2695
+ traceId: string;
2696
+ spanId: string;
2697
+ parentSpanId?: string | undefined;
2698
+ }>;
2699
+ correlationId: z.ZodOptional<z.ZodString>;
2700
+ executionId: z.ZodOptional<z.ZodString>;
2701
+ rootExecutionId: z.ZodOptional<z.ZodString>;
2702
+ parentExecutionId: z.ZodOptional<z.ZodString>;
2703
+ } & {
2704
+ type: z.ZodLiteral<"workflow:run:end">;
2705
+ data: z.ZodObject<{
2706
+ workflowId: z.ZodString;
2707
+ definitionVersion: z.ZodString;
2708
+ status: z.ZodEnum<["success", "error", "truncated"]>;
2709
+ output: z.ZodOptional<z.ZodAny>;
2710
+ durationMs: z.ZodNumber;
2711
+ }, "strip", z.ZodTypeAny, {
2712
+ status: "error" | "success" | "truncated";
2713
+ durationMs: number;
2714
+ workflowId: string;
2715
+ definitionVersion: string;
2716
+ output?: any;
2717
+ }, {
2718
+ status: "error" | "success" | "truncated";
2719
+ durationMs: number;
2720
+ workflowId: string;
2721
+ definitionVersion: string;
2722
+ output?: any;
2723
+ }>;
2724
+ }, "strip", z.ZodTypeAny, {
2725
+ type: "workflow:run:end";
2726
+ timestamp: string;
2727
+ trace: {
2728
+ traceId: string;
2729
+ spanId: string;
2730
+ parentSpanId?: string | undefined;
2731
+ };
2732
+ data: {
2733
+ status: "error" | "success" | "truncated";
2734
+ durationMs: number;
2735
+ workflowId: string;
2736
+ definitionVersion: string;
2737
+ output?: any;
2738
+ };
2739
+ correlationId?: string | undefined;
2740
+ executionId?: string | undefined;
2741
+ rootExecutionId?: string | undefined;
2742
+ parentExecutionId?: string | undefined;
2743
+ }, {
2744
+ type: "workflow:run:end";
2745
+ timestamp: string;
2746
+ trace: {
2747
+ traceId: string;
2748
+ spanId: string;
2749
+ parentSpanId?: string | undefined;
2750
+ };
2751
+ data: {
2752
+ status: "error" | "success" | "truncated";
2753
+ durationMs: number;
2754
+ workflowId: string;
2755
+ definitionVersion: string;
2756
+ output?: any;
2757
+ };
2758
+ correlationId?: string | undefined;
2759
+ executionId?: string | undefined;
2760
+ rootExecutionId?: string | undefined;
2761
+ parentExecutionId?: string | undefined;
2762
+ }>, z.ZodObject<{
2763
+ timestamp: z.ZodString;
2764
+ trace: z.ZodObject<{
2765
+ traceId: z.ZodString;
2766
+ spanId: z.ZodString;
2767
+ parentSpanId: z.ZodOptional<z.ZodString>;
2768
+ }, "strip", z.ZodTypeAny, {
2769
+ traceId: string;
2770
+ spanId: string;
2771
+ parentSpanId?: string | undefined;
2772
+ }, {
2773
+ traceId: string;
2774
+ spanId: string;
2775
+ parentSpanId?: string | undefined;
2776
+ }>;
2777
+ correlationId: z.ZodOptional<z.ZodString>;
2778
+ executionId: z.ZodOptional<z.ZodString>;
2779
+ rootExecutionId: z.ZodOptional<z.ZodString>;
2780
+ parentExecutionId: z.ZodOptional<z.ZodString>;
2781
+ } & {
2782
+ type: z.ZodLiteral<"workflow:run:error">;
2783
+ data: z.ZodObject<{
2784
+ workflowId: z.ZodString;
2785
+ definitionVersion: z.ZodString;
2786
+ error: z.ZodObject<{
2787
+ name: z.ZodOptional<z.ZodString>;
2788
+ message: z.ZodString;
2789
+ code: z.ZodOptional<z.ZodString>;
2790
+ stack: z.ZodOptional<z.ZodString>;
2791
+ details: z.ZodOptional<z.ZodAny>;
2792
+ }, "strip", z.ZodTypeAny, {
2793
+ message: string;
2794
+ name?: string | undefined;
2795
+ code?: string | undefined;
2796
+ stack?: string | undefined;
2797
+ details?: any;
2798
+ }, {
2799
+ message: string;
2800
+ name?: string | undefined;
2801
+ code?: string | undefined;
2802
+ stack?: string | undefined;
2803
+ details?: any;
2804
+ }>;
2805
+ durationMs: z.ZodOptional<z.ZodNumber>;
2806
+ }, "strip", z.ZodTypeAny, {
2807
+ error: {
2808
+ message: string;
2809
+ name?: string | undefined;
2810
+ code?: string | undefined;
2811
+ stack?: string | undefined;
2812
+ details?: any;
2813
+ };
2814
+ workflowId: string;
2815
+ definitionVersion: string;
2816
+ durationMs?: number | undefined;
2817
+ }, {
2818
+ error: {
2819
+ message: string;
2820
+ name?: string | undefined;
2821
+ code?: string | undefined;
2822
+ stack?: string | undefined;
2823
+ details?: any;
2824
+ };
2825
+ workflowId: string;
2826
+ definitionVersion: string;
2827
+ durationMs?: number | undefined;
2828
+ }>;
2829
+ }, "strip", z.ZodTypeAny, {
2830
+ type: "workflow:run:error";
2831
+ timestamp: string;
2832
+ trace: {
2833
+ traceId: string;
2834
+ spanId: string;
2835
+ parentSpanId?: string | undefined;
2836
+ };
2837
+ data: {
2838
+ error: {
2839
+ message: string;
2840
+ name?: string | undefined;
2841
+ code?: string | undefined;
2842
+ stack?: string | undefined;
2843
+ details?: any;
2844
+ };
2845
+ workflowId: string;
2846
+ definitionVersion: string;
2847
+ durationMs?: number | undefined;
2848
+ };
2849
+ correlationId?: string | undefined;
2850
+ executionId?: string | undefined;
2851
+ rootExecutionId?: string | undefined;
2852
+ parentExecutionId?: string | undefined;
2853
+ }, {
2854
+ type: "workflow:run:error";
2855
+ timestamp: string;
2856
+ trace: {
2857
+ traceId: string;
2858
+ spanId: string;
2859
+ parentSpanId?: string | undefined;
2860
+ };
2861
+ data: {
2862
+ error: {
2863
+ message: string;
2864
+ name?: string | undefined;
2865
+ code?: string | undefined;
2866
+ stack?: string | undefined;
2867
+ details?: any;
2868
+ };
2869
+ workflowId: string;
2870
+ definitionVersion: string;
2871
+ durationMs?: number | undefined;
2872
+ };
2873
+ correlationId?: string | undefined;
2874
+ executionId?: string | undefined;
2875
+ rootExecutionId?: string | undefined;
2876
+ parentExecutionId?: string | undefined;
2877
+ }>, z.ZodObject<{
2878
+ timestamp: z.ZodString;
2879
+ trace: z.ZodObject<{
2880
+ traceId: z.ZodString;
2881
+ spanId: z.ZodString;
2882
+ parentSpanId: z.ZodOptional<z.ZodString>;
2883
+ }, "strip", z.ZodTypeAny, {
2884
+ traceId: string;
2885
+ spanId: string;
2886
+ parentSpanId?: string | undefined;
2887
+ }, {
2888
+ traceId: string;
2889
+ spanId: string;
2890
+ parentSpanId?: string | undefined;
2891
+ }>;
2892
+ correlationId: z.ZodOptional<z.ZodString>;
2893
+ executionId: z.ZodOptional<z.ZodString>;
2894
+ rootExecutionId: z.ZodOptional<z.ZodString>;
2895
+ parentExecutionId: z.ZodOptional<z.ZodString>;
2896
+ } & {
2897
+ type: z.ZodLiteral<"workflow:node:start">;
2898
+ data: z.ZodObject<{
2899
+ workflowId: z.ZodString;
2900
+ nodeId: z.ZodString;
2901
+ nodeType: z.ZodEnum<["start", "step", "agent", "branch", "parallel", "finish"]>;
2902
+ attempt: z.ZodDefault<z.ZodNumber>;
2903
+ input: z.ZodOptional<z.ZodAny>;
2904
+ }, "strip", z.ZodTypeAny, {
2905
+ workflowId: string;
2906
+ nodeId: string;
2907
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
2908
+ attempt: number;
2909
+ input?: any;
2910
+ }, {
2911
+ workflowId: string;
2912
+ nodeId: string;
2913
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
2914
+ input?: any;
2915
+ attempt?: number | undefined;
2916
+ }>;
2917
+ }, "strip", z.ZodTypeAny, {
2918
+ type: "workflow:node:start";
2919
+ timestamp: string;
2920
+ trace: {
2921
+ traceId: string;
2922
+ spanId: string;
2923
+ parentSpanId?: string | undefined;
2924
+ };
2925
+ data: {
2926
+ workflowId: string;
2927
+ nodeId: string;
2928
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
2929
+ attempt: number;
2930
+ input?: any;
2931
+ };
2932
+ correlationId?: string | undefined;
2933
+ executionId?: string | undefined;
2934
+ rootExecutionId?: string | undefined;
2935
+ parentExecutionId?: string | undefined;
2936
+ }, {
2937
+ type: "workflow:node:start";
2938
+ timestamp: string;
2939
+ trace: {
2940
+ traceId: string;
2941
+ spanId: string;
2942
+ parentSpanId?: string | undefined;
2943
+ };
2944
+ data: {
2945
+ workflowId: string;
2946
+ nodeId: string;
2947
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
2948
+ input?: any;
2949
+ attempt?: number | undefined;
2950
+ };
2951
+ correlationId?: string | undefined;
2952
+ executionId?: string | undefined;
2953
+ rootExecutionId?: string | undefined;
2954
+ parentExecutionId?: string | undefined;
2955
+ }>, z.ZodObject<{
2956
+ timestamp: z.ZodString;
2957
+ trace: z.ZodObject<{
2958
+ traceId: z.ZodString;
2959
+ spanId: z.ZodString;
2960
+ parentSpanId: z.ZodOptional<z.ZodString>;
2961
+ }, "strip", z.ZodTypeAny, {
2962
+ traceId: string;
2963
+ spanId: string;
2964
+ parentSpanId?: string | undefined;
2965
+ }, {
2966
+ traceId: string;
2967
+ spanId: string;
2968
+ parentSpanId?: string | undefined;
2969
+ }>;
2970
+ correlationId: z.ZodOptional<z.ZodString>;
2971
+ executionId: z.ZodOptional<z.ZodString>;
2972
+ rootExecutionId: z.ZodOptional<z.ZodString>;
2973
+ parentExecutionId: z.ZodOptional<z.ZodString>;
2974
+ } & {
2975
+ type: z.ZodLiteral<"workflow:node:end">;
2976
+ data: z.ZodObject<{
2977
+ workflowId: z.ZodString;
2978
+ nodeId: z.ZodString;
2979
+ nodeType: z.ZodEnum<["start", "step", "agent", "branch", "parallel", "finish"]>;
2980
+ attempt: z.ZodDefault<z.ZodNumber>;
2981
+ status: z.ZodEnum<["success", "error"]>;
2982
+ durationMs: z.ZodNumber;
2983
+ output: z.ZodOptional<z.ZodAny>;
2984
+ error: z.ZodOptional<z.ZodObject<{
2985
+ name: z.ZodOptional<z.ZodString>;
2986
+ message: z.ZodString;
2987
+ code: z.ZodOptional<z.ZodString>;
2988
+ stack: z.ZodOptional<z.ZodString>;
2989
+ details: z.ZodOptional<z.ZodAny>;
2990
+ }, "strip", z.ZodTypeAny, {
2991
+ message: string;
2992
+ name?: string | undefined;
2993
+ code?: string | undefined;
2994
+ stack?: string | undefined;
2995
+ details?: any;
2996
+ }, {
2997
+ message: string;
2998
+ name?: string | undefined;
2999
+ code?: string | undefined;
3000
+ stack?: string | undefined;
3001
+ details?: any;
3002
+ }>>;
3003
+ }, "strip", z.ZodTypeAny, {
3004
+ status: "error" | "success";
3005
+ durationMs: number;
3006
+ workflowId: string;
3007
+ nodeId: string;
3008
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
3009
+ attempt: number;
3010
+ error?: {
3011
+ message: string;
3012
+ name?: string | undefined;
3013
+ code?: string | undefined;
3014
+ stack?: string | undefined;
3015
+ details?: any;
3016
+ } | undefined;
3017
+ output?: any;
3018
+ }, {
3019
+ status: "error" | "success";
3020
+ durationMs: number;
3021
+ workflowId: string;
3022
+ nodeId: string;
3023
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
3024
+ error?: {
3025
+ message: string;
3026
+ name?: string | undefined;
3027
+ code?: string | undefined;
3028
+ stack?: string | undefined;
3029
+ details?: any;
3030
+ } | undefined;
3031
+ output?: any;
3032
+ attempt?: number | undefined;
3033
+ }>;
3034
+ }, "strip", z.ZodTypeAny, {
3035
+ type: "workflow:node:end";
3036
+ timestamp: string;
3037
+ trace: {
3038
+ traceId: string;
3039
+ spanId: string;
3040
+ parentSpanId?: string | undefined;
3041
+ };
3042
+ data: {
3043
+ status: "error" | "success";
3044
+ durationMs: number;
3045
+ workflowId: string;
3046
+ nodeId: string;
3047
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
3048
+ attempt: number;
3049
+ error?: {
3050
+ message: string;
3051
+ name?: string | undefined;
3052
+ code?: string | undefined;
3053
+ stack?: string | undefined;
3054
+ details?: any;
3055
+ } | undefined;
3056
+ output?: any;
3057
+ };
3058
+ correlationId?: string | undefined;
3059
+ executionId?: string | undefined;
3060
+ rootExecutionId?: string | undefined;
3061
+ parentExecutionId?: string | undefined;
3062
+ }, {
3063
+ type: "workflow:node:end";
3064
+ timestamp: string;
3065
+ trace: {
3066
+ traceId: string;
3067
+ spanId: string;
3068
+ parentSpanId?: string | undefined;
3069
+ };
3070
+ data: {
3071
+ status: "error" | "success";
3072
+ durationMs: number;
3073
+ workflowId: string;
3074
+ nodeId: string;
3075
+ nodeType: "finish" | "step" | "start" | "agent" | "branch" | "parallel";
3076
+ error?: {
3077
+ message: string;
3078
+ name?: string | undefined;
3079
+ code?: string | undefined;
3080
+ stack?: string | undefined;
3081
+ details?: any;
3082
+ } | undefined;
3083
+ output?: any;
3084
+ attempt?: number | undefined;
3085
+ };
3086
+ correlationId?: string | undefined;
3087
+ executionId?: string | undefined;
3088
+ rootExecutionId?: string | undefined;
3089
+ parentExecutionId?: string | undefined;
3090
+ }>, z.ZodObject<{
3091
+ timestamp: z.ZodString;
3092
+ trace: z.ZodObject<{
3093
+ traceId: z.ZodString;
3094
+ spanId: z.ZodString;
3095
+ parentSpanId: z.ZodOptional<z.ZodString>;
3096
+ }, "strip", z.ZodTypeAny, {
3097
+ traceId: string;
3098
+ spanId: string;
3099
+ parentSpanId?: string | undefined;
3100
+ }, {
3101
+ traceId: string;
3102
+ spanId: string;
3103
+ parentSpanId?: string | undefined;
3104
+ }>;
3105
+ correlationId: z.ZodOptional<z.ZodString>;
3106
+ executionId: z.ZodOptional<z.ZodString>;
3107
+ rootExecutionId: z.ZodOptional<z.ZodString>;
3108
+ parentExecutionId: z.ZodOptional<z.ZodString>;
3109
+ } & {
3110
+ type: z.ZodLiteral<"tool:execution:start">;
3111
+ data: z.ZodObject<{
3112
+ toolId: z.ZodString;
3113
+ toolName: z.ZodString;
3114
+ toolCallId: z.ZodOptional<z.ZodString>;
3115
+ input: z.ZodOptional<z.ZodAny>;
3116
+ }, "strip", z.ZodTypeAny, {
3117
+ toolName: string;
3118
+ toolId: string;
3119
+ input?: any;
3120
+ toolCallId?: string | undefined;
3121
+ }, {
3122
+ toolName: string;
3123
+ toolId: string;
3124
+ input?: any;
3125
+ toolCallId?: string | undefined;
3126
+ }>;
3127
+ }, "strip", z.ZodTypeAny, {
3128
+ type: "tool:execution:start";
3129
+ timestamp: string;
3130
+ trace: {
3131
+ traceId: string;
3132
+ spanId: string;
3133
+ parentSpanId?: string | undefined;
3134
+ };
3135
+ data: {
3136
+ toolName: string;
3137
+ toolId: string;
3138
+ input?: any;
3139
+ toolCallId?: string | undefined;
3140
+ };
3141
+ correlationId?: string | undefined;
3142
+ executionId?: string | undefined;
3143
+ rootExecutionId?: string | undefined;
3144
+ parentExecutionId?: string | undefined;
3145
+ }, {
3146
+ type: "tool:execution:start";
3147
+ timestamp: string;
3148
+ trace: {
3149
+ traceId: string;
3150
+ spanId: string;
3151
+ parentSpanId?: string | undefined;
3152
+ };
3153
+ data: {
3154
+ toolName: string;
3155
+ toolId: string;
3156
+ input?: any;
3157
+ toolCallId?: string | undefined;
3158
+ };
3159
+ correlationId?: string | undefined;
3160
+ executionId?: string | undefined;
3161
+ rootExecutionId?: string | undefined;
3162
+ parentExecutionId?: string | undefined;
3163
+ }>, z.ZodObject<{
3164
+ timestamp: z.ZodString;
3165
+ trace: z.ZodObject<{
3166
+ traceId: z.ZodString;
3167
+ spanId: z.ZodString;
3168
+ parentSpanId: z.ZodOptional<z.ZodString>;
3169
+ }, "strip", z.ZodTypeAny, {
3170
+ traceId: string;
3171
+ spanId: string;
3172
+ parentSpanId?: string | undefined;
3173
+ }, {
3174
+ traceId: string;
3175
+ spanId: string;
3176
+ parentSpanId?: string | undefined;
3177
+ }>;
3178
+ correlationId: z.ZodOptional<z.ZodString>;
3179
+ executionId: z.ZodOptional<z.ZodString>;
3180
+ rootExecutionId: z.ZodOptional<z.ZodString>;
3181
+ parentExecutionId: z.ZodOptional<z.ZodString>;
3182
+ } & {
3183
+ type: z.ZodLiteral<"tool:execution:end">;
3184
+ data: z.ZodObject<{
3185
+ toolId: z.ZodString;
3186
+ toolName: z.ZodString;
3187
+ toolCallId: z.ZodOptional<z.ZodString>;
3188
+ status: z.ZodEnum<["success", "error"]>;
3189
+ output: z.ZodOptional<z.ZodAny>;
3190
+ durationMs: z.ZodNumber;
3191
+ }, "strip", z.ZodTypeAny, {
3192
+ status: "error" | "success";
3193
+ durationMs: number;
3194
+ toolName: string;
3195
+ toolId: string;
3196
+ output?: any;
3197
+ toolCallId?: string | undefined;
3198
+ }, {
3199
+ status: "error" | "success";
3200
+ durationMs: number;
3201
+ toolName: string;
3202
+ toolId: string;
3203
+ output?: any;
3204
+ toolCallId?: string | undefined;
3205
+ }>;
3206
+ }, "strip", z.ZodTypeAny, {
3207
+ type: "tool:execution:end";
3208
+ timestamp: string;
3209
+ trace: {
3210
+ traceId: string;
3211
+ spanId: string;
3212
+ parentSpanId?: string | undefined;
3213
+ };
3214
+ data: {
3215
+ status: "error" | "success";
3216
+ durationMs: number;
3217
+ toolName: string;
3218
+ toolId: string;
3219
+ output?: any;
3220
+ toolCallId?: string | undefined;
3221
+ };
3222
+ correlationId?: string | undefined;
3223
+ executionId?: string | undefined;
3224
+ rootExecutionId?: string | undefined;
3225
+ parentExecutionId?: string | undefined;
3226
+ }, {
3227
+ type: "tool:execution:end";
3228
+ timestamp: string;
3229
+ trace: {
3230
+ traceId: string;
3231
+ spanId: string;
3232
+ parentSpanId?: string | undefined;
3233
+ };
3234
+ data: {
3235
+ status: "error" | "success";
3236
+ durationMs: number;
3237
+ toolName: string;
3238
+ toolId: string;
3239
+ output?: any;
3240
+ toolCallId?: string | undefined;
3241
+ };
3242
+ correlationId?: string | undefined;
3243
+ executionId?: string | undefined;
3244
+ rootExecutionId?: string | undefined;
3245
+ parentExecutionId?: string | undefined;
3246
+ }>, z.ZodObject<{
3247
+ timestamp: z.ZodString;
3248
+ trace: z.ZodObject<{
3249
+ traceId: z.ZodString;
3250
+ spanId: z.ZodString;
3251
+ parentSpanId: z.ZodOptional<z.ZodString>;
3252
+ }, "strip", z.ZodTypeAny, {
3253
+ traceId: string;
3254
+ spanId: string;
3255
+ parentSpanId?: string | undefined;
3256
+ }, {
3257
+ traceId: string;
3258
+ spanId: string;
3259
+ parentSpanId?: string | undefined;
3260
+ }>;
3261
+ correlationId: z.ZodOptional<z.ZodString>;
3262
+ executionId: z.ZodOptional<z.ZodString>;
3263
+ rootExecutionId: z.ZodOptional<z.ZodString>;
3264
+ parentExecutionId: z.ZodOptional<z.ZodString>;
3265
+ } & {
3266
+ type: z.ZodLiteral<"tool:execution:error">;
3267
+ data: z.ZodObject<{
3268
+ toolId: z.ZodString;
3269
+ toolName: z.ZodString;
3270
+ toolCallId: z.ZodOptional<z.ZodString>;
3271
+ error: z.ZodObject<{
3272
+ name: z.ZodOptional<z.ZodString>;
3273
+ message: z.ZodString;
3274
+ code: z.ZodOptional<z.ZodString>;
3275
+ stack: z.ZodOptional<z.ZodString>;
3276
+ details: z.ZodOptional<z.ZodAny>;
3277
+ }, "strip", z.ZodTypeAny, {
3278
+ message: string;
3279
+ name?: string | undefined;
3280
+ code?: string | undefined;
3281
+ stack?: string | undefined;
3282
+ details?: any;
3283
+ }, {
3284
+ message: string;
3285
+ name?: string | undefined;
3286
+ code?: string | undefined;
3287
+ stack?: string | undefined;
3288
+ details?: any;
3289
+ }>;
3290
+ durationMs: z.ZodOptional<z.ZodNumber>;
3291
+ }, "strip", z.ZodTypeAny, {
3292
+ error: {
3293
+ message: string;
3294
+ name?: string | undefined;
3295
+ code?: string | undefined;
3296
+ stack?: string | undefined;
3297
+ details?: any;
3298
+ };
3299
+ toolName: string;
3300
+ toolId: string;
3301
+ durationMs?: number | undefined;
3302
+ toolCallId?: string | undefined;
3303
+ }, {
3304
+ error: {
3305
+ message: string;
3306
+ name?: string | undefined;
3307
+ code?: string | undefined;
3308
+ stack?: string | undefined;
3309
+ details?: any;
3310
+ };
3311
+ toolName: string;
3312
+ toolId: string;
3313
+ durationMs?: number | undefined;
3314
+ toolCallId?: string | undefined;
3315
+ }>;
3316
+ }, "strip", z.ZodTypeAny, {
3317
+ type: "tool:execution:error";
3318
+ timestamp: string;
3319
+ trace: {
3320
+ traceId: string;
3321
+ spanId: string;
3322
+ parentSpanId?: string | undefined;
3323
+ };
3324
+ data: {
3325
+ error: {
3326
+ message: string;
3327
+ name?: string | undefined;
3328
+ code?: string | undefined;
3329
+ stack?: string | undefined;
3330
+ details?: any;
3331
+ };
3332
+ toolName: string;
3333
+ toolId: string;
3334
+ durationMs?: number | undefined;
3335
+ toolCallId?: string | undefined;
3336
+ };
3337
+ correlationId?: string | undefined;
3338
+ executionId?: string | undefined;
3339
+ rootExecutionId?: string | undefined;
3340
+ parentExecutionId?: string | undefined;
3341
+ }, {
3342
+ type: "tool:execution:error";
3343
+ timestamp: string;
3344
+ trace: {
3345
+ traceId: string;
3346
+ spanId: string;
3347
+ parentSpanId?: string | undefined;
3348
+ };
3349
+ data: {
3350
+ error: {
3351
+ message: string;
3352
+ name?: string | undefined;
3353
+ code?: string | undefined;
3354
+ stack?: string | undefined;
3355
+ details?: any;
3356
+ };
3357
+ toolName: string;
3358
+ toolId: string;
3359
+ durationMs?: number | undefined;
3360
+ toolCallId?: string | undefined;
3361
+ };
3362
+ correlationId?: string | undefined;
3363
+ executionId?: string | undefined;
3364
+ rootExecutionId?: string | undefined;
3365
+ parentExecutionId?: string | undefined;
3366
+ }>, z.ZodObject<{
3367
+ timestamp: z.ZodString;
3368
+ trace: z.ZodObject<{
3369
+ traceId: z.ZodString;
3370
+ spanId: z.ZodString;
3371
+ parentSpanId: z.ZodOptional<z.ZodString>;
3372
+ }, "strip", z.ZodTypeAny, {
3373
+ traceId: string;
3374
+ spanId: string;
3375
+ parentSpanId?: string | undefined;
3376
+ }, {
3377
+ traceId: string;
3378
+ spanId: string;
3379
+ parentSpanId?: string | undefined;
3380
+ }>;
3381
+ correlationId: z.ZodOptional<z.ZodString>;
3382
+ executionId: z.ZodOptional<z.ZodString>;
3383
+ rootExecutionId: z.ZodOptional<z.ZodString>;
3384
+ parentExecutionId: z.ZodOptional<z.ZodString>;
3385
+ } & {
3386
+ type: z.ZodLiteral<"execution:cost:incurred">;
3387
+ data: z.ZodObject<{
3388
+ amount: z.ZodString;
3389
+ description: z.ZodOptional<z.ZodString>;
3390
+ source: z.ZodOptional<z.ZodString>;
3391
+ idempotencyKey: z.ZodOptional<z.ZodString>;
3392
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3393
+ }, "strip", z.ZodTypeAny, {
3394
+ amount: string;
3395
+ metadata?: Record<string, any> | undefined;
3396
+ description?: string | undefined;
3397
+ source?: string | undefined;
3398
+ idempotencyKey?: string | undefined;
3399
+ }, {
3400
+ amount: string;
3401
+ metadata?: Record<string, any> | undefined;
3402
+ description?: string | undefined;
3403
+ source?: string | undefined;
3404
+ idempotencyKey?: string | undefined;
3405
+ }>;
3406
+ }, "strip", z.ZodTypeAny, {
3407
+ type: "execution:cost:incurred";
3408
+ timestamp: string;
3409
+ trace: {
3410
+ traceId: string;
3411
+ spanId: string;
3412
+ parentSpanId?: string | undefined;
3413
+ };
3414
+ data: {
3415
+ amount: string;
3416
+ metadata?: Record<string, any> | undefined;
3417
+ description?: string | undefined;
3418
+ source?: string | undefined;
3419
+ idempotencyKey?: string | undefined;
3420
+ };
3421
+ correlationId?: string | undefined;
3422
+ executionId?: string | undefined;
3423
+ rootExecutionId?: string | undefined;
3424
+ parentExecutionId?: string | undefined;
3425
+ }, {
3426
+ type: "execution:cost:incurred";
3427
+ timestamp: string;
3428
+ trace: {
3429
+ traceId: string;
3430
+ spanId: string;
3431
+ parentSpanId?: string | undefined;
3432
+ };
3433
+ data: {
3434
+ amount: string;
3435
+ metadata?: Record<string, any> | undefined;
3436
+ description?: string | undefined;
3437
+ source?: string | undefined;
3438
+ idempotencyKey?: string | undefined;
3439
+ };
3440
+ correlationId?: string | undefined;
3441
+ executionId?: string | undefined;
3442
+ rootExecutionId?: string | undefined;
3443
+ parentExecutionId?: string | undefined;
3444
+ }>]>;
3445
+ export type TraceContext = z.infer<typeof TraceContextSchema>;
3446
+ export type Usage = z.infer<typeof UsageSchema>;
3447
+ export type NebulaEvent = z.infer<typeof NebulaEventSchema>;
3448
+ export type AgentExecutionStart = z.infer<typeof AgentExecutionStartSchema>;
3449
+ export type AgentExecutionEnd = z.infer<typeof AgentExecutionEndSchema>;
3450
+ export type AgentExecutionError = z.infer<typeof AgentExecutionErrorSchema>;
3451
+ export type AgentLLMCall = z.infer<typeof AgentLLMCallSchema>;
3452
+ export type AgentLLMResponse = z.infer<typeof AgentLLMResponseSchema>;
3453
+ export type AgentToolCall = z.infer<typeof AgentToolCallSchema>;
3454
+ export type AgentToolResult = z.infer<typeof AgentToolResultSchema>;
3455
+ export type WorkflowRunStart = z.infer<typeof WorkflowRunStartSchema>;
3456
+ export type WorkflowRunEnd = z.infer<typeof WorkflowRunEndSchema>;
3457
+ export type WorkflowRunError = z.infer<typeof WorkflowRunErrorSchema>;
3458
+ export type WorkflowNodeStart = z.infer<typeof WorkflowNodeStartSchema>;
3459
+ export type WorkflowNodeEnd = z.infer<typeof WorkflowNodeEndSchema>;
3460
+ export type ToolExecutionStart = z.infer<typeof ToolExecutionStartSchema>;
3461
+ export type ToolExecutionEnd = z.infer<typeof ToolExecutionEndSchema>;
3462
+ export type ToolExecutionError = z.infer<typeof ToolExecutionErrorSchema>;
3463
+ export type ExecutionCostIncurred = z.infer<typeof ExecutionCostIncurredSchema>;