@loop-engine/core 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,386 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const LoopIdSchema: z.ZodBranded<z.ZodString, "LoopId">;
4
+ type LoopId = z.infer<typeof LoopIdSchema>;
5
+ declare const AggregateIdSchema: z.ZodBranded<z.ZodString, "AggregateId">;
6
+ type AggregateId = z.infer<typeof AggregateIdSchema>;
7
+ declare const ActorIdSchema: z.ZodBranded<z.ZodString, "ActorId">;
8
+ type ActorId = z.infer<typeof ActorIdSchema>;
9
+ declare const SignalIdSchema: z.ZodBranded<z.ZodString, "SignalId">;
10
+ type SignalId = z.infer<typeof SignalIdSchema>;
11
+ declare const GuardIdSchema: z.ZodBranded<z.ZodString, "GuardId">;
12
+ type GuardId = z.infer<typeof GuardIdSchema>;
13
+ declare const StateIdSchema: z.ZodBranded<z.ZodString, "StateId">;
14
+ type StateId = z.infer<typeof StateIdSchema>;
15
+ declare const TransitionIdSchema: z.ZodBranded<z.ZodString, "TransitionId">;
16
+ type TransitionId = z.infer<typeof TransitionIdSchema>;
17
+ declare const LoopStatusSchema: z.ZodEnum<["pending", "active", "completed", "failed", "cancelled", "suspended"]>;
18
+ type LoopStatus = z.infer<typeof LoopStatusSchema>;
19
+ declare const ActorTypeSchema: z.ZodEnum<["human", "automation", "ai-agent"]>;
20
+ type ActorType = z.infer<typeof ActorTypeSchema>;
21
+ declare const ActorRefSchema: z.ZodObject<{
22
+ id: z.ZodBranded<z.ZodString, "ActorId">;
23
+ type: z.ZodEnum<["human", "automation", "ai-agent"]>;
24
+ displayName: z.ZodOptional<z.ZodString>;
25
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ type: "human" | "automation" | "ai-agent";
28
+ id: string & z.BRAND<"ActorId">;
29
+ displayName?: string | undefined;
30
+ metadata?: Record<string, unknown> | undefined;
31
+ }, {
32
+ type: "human" | "automation" | "ai-agent";
33
+ id: string;
34
+ displayName?: string | undefined;
35
+ metadata?: Record<string, unknown> | undefined;
36
+ }>;
37
+ type ActorRef = z.infer<typeof ActorRefSchema>;
38
+ declare const GuardSeveritySchema: z.ZodEnum<["hard", "soft"]>;
39
+ type GuardSeverity = z.infer<typeof GuardSeveritySchema>;
40
+ declare const GuardSpecSchema: z.ZodObject<{
41
+ guardId: z.ZodBranded<z.ZodString, "GuardId">;
42
+ description: z.ZodString;
43
+ severity: z.ZodEnum<["hard", "soft"]>;
44
+ evaluatedBy: z.ZodEnum<["runtime", "module", "external"]>;
45
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ guardId: string & z.BRAND<"GuardId">;
48
+ description: string;
49
+ severity: "hard" | "soft";
50
+ evaluatedBy: "runtime" | "module" | "external";
51
+ parameters?: Record<string, unknown> | undefined;
52
+ }, {
53
+ guardId: string;
54
+ description: string;
55
+ severity: "hard" | "soft";
56
+ evaluatedBy: "runtime" | "module" | "external";
57
+ parameters?: Record<string, unknown> | undefined;
58
+ }>;
59
+ type GuardSpec = z.infer<typeof GuardSpecSchema>;
60
+ declare const TransitionSpecSchema: z.ZodObject<{
61
+ transitionId: z.ZodBranded<z.ZodString, "TransitionId">;
62
+ from: z.ZodBranded<z.ZodString, "StateId">;
63
+ to: z.ZodBranded<z.ZodString, "StateId">;
64
+ signal: z.ZodBranded<z.ZodString, "SignalId">;
65
+ allowedActors: z.ZodArray<z.ZodEnum<["human", "automation", "ai-agent"]>, "many">;
66
+ guards: z.ZodOptional<z.ZodArray<z.ZodObject<{
67
+ guardId: z.ZodBranded<z.ZodString, "GuardId">;
68
+ description: z.ZodString;
69
+ severity: z.ZodEnum<["hard", "soft"]>;
70
+ evaluatedBy: z.ZodEnum<["runtime", "module", "external"]>;
71
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
72
+ }, "strip", z.ZodTypeAny, {
73
+ guardId: string & z.BRAND<"GuardId">;
74
+ description: string;
75
+ severity: "hard" | "soft";
76
+ evaluatedBy: "runtime" | "module" | "external";
77
+ parameters?: Record<string, unknown> | undefined;
78
+ }, {
79
+ guardId: string;
80
+ description: string;
81
+ severity: "hard" | "soft";
82
+ evaluatedBy: "runtime" | "module" | "external";
83
+ parameters?: Record<string, unknown> | undefined;
84
+ }>, "many">>;
85
+ description: z.ZodOptional<z.ZodString>;
86
+ }, "strip", z.ZodTypeAny, {
87
+ transitionId: string & z.BRAND<"TransitionId">;
88
+ from: string & z.BRAND<"StateId">;
89
+ to: string & z.BRAND<"StateId">;
90
+ signal: string & z.BRAND<"SignalId">;
91
+ allowedActors: ("human" | "automation" | "ai-agent")[];
92
+ description?: string | undefined;
93
+ guards?: {
94
+ guardId: string & z.BRAND<"GuardId">;
95
+ description: string;
96
+ severity: "hard" | "soft";
97
+ evaluatedBy: "runtime" | "module" | "external";
98
+ parameters?: Record<string, unknown> | undefined;
99
+ }[] | undefined;
100
+ }, {
101
+ transitionId: string;
102
+ from: string;
103
+ to: string;
104
+ signal: string;
105
+ allowedActors: ("human" | "automation" | "ai-agent")[];
106
+ description?: string | undefined;
107
+ guards?: {
108
+ guardId: string;
109
+ description: string;
110
+ severity: "hard" | "soft";
111
+ evaluatedBy: "runtime" | "module" | "external";
112
+ parameters?: Record<string, unknown> | undefined;
113
+ }[] | undefined;
114
+ }>;
115
+ type TransitionSpec = z.infer<typeof TransitionSpecSchema>;
116
+ declare const StateSpecSchema: z.ZodObject<{
117
+ stateId: z.ZodBranded<z.ZodString, "StateId">;
118
+ label: z.ZodString;
119
+ terminal: z.ZodOptional<z.ZodBoolean>;
120
+ description: z.ZodOptional<z.ZodString>;
121
+ }, "strip", z.ZodTypeAny, {
122
+ stateId: string & z.BRAND<"StateId">;
123
+ label: string;
124
+ description?: string | undefined;
125
+ terminal?: boolean | undefined;
126
+ }, {
127
+ stateId: string;
128
+ label: string;
129
+ description?: string | undefined;
130
+ terminal?: boolean | undefined;
131
+ }>;
132
+ type StateSpec = z.infer<typeof StateSpecSchema>;
133
+ declare const BusinessMetricSchema: z.ZodObject<{
134
+ id: z.ZodString;
135
+ label: z.ZodString;
136
+ unit: z.ZodString;
137
+ improvableByAI: z.ZodOptional<z.ZodBoolean>;
138
+ }, "strip", z.ZodTypeAny, {
139
+ id: string;
140
+ label: string;
141
+ unit: string;
142
+ improvableByAI?: boolean | undefined;
143
+ }, {
144
+ id: string;
145
+ label: string;
146
+ unit: string;
147
+ improvableByAI?: boolean | undefined;
148
+ }>;
149
+ type BusinessMetric = z.infer<typeof BusinessMetricSchema>;
150
+ declare const OutcomeSpecSchema: z.ZodObject<{
151
+ description: z.ZodString;
152
+ valueUnit: z.ZodString;
153
+ businessMetrics: z.ZodArray<z.ZodObject<{
154
+ id: z.ZodString;
155
+ label: z.ZodString;
156
+ unit: z.ZodString;
157
+ improvableByAI: z.ZodOptional<z.ZodBoolean>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ id: string;
160
+ label: string;
161
+ unit: string;
162
+ improvableByAI?: boolean | undefined;
163
+ }, {
164
+ id: string;
165
+ label: string;
166
+ unit: string;
167
+ improvableByAI?: boolean | undefined;
168
+ }>, "many">;
169
+ }, "strip", z.ZodTypeAny, {
170
+ description: string;
171
+ valueUnit: string;
172
+ businessMetrics: {
173
+ id: string;
174
+ label: string;
175
+ unit: string;
176
+ improvableByAI?: boolean | undefined;
177
+ }[];
178
+ }, {
179
+ description: string;
180
+ valueUnit: string;
181
+ businessMetrics: {
182
+ id: string;
183
+ label: string;
184
+ unit: string;
185
+ improvableByAI?: boolean | undefined;
186
+ }[];
187
+ }>;
188
+ type OutcomeSpec = z.infer<typeof OutcomeSpecSchema>;
189
+ declare const LoopDefinitionSchema: z.ZodObject<{
190
+ loopId: z.ZodBranded<z.ZodString, "LoopId">;
191
+ version: z.ZodString;
192
+ name: z.ZodString;
193
+ description: z.ZodString;
194
+ states: z.ZodArray<z.ZodObject<{
195
+ stateId: z.ZodBranded<z.ZodString, "StateId">;
196
+ label: z.ZodString;
197
+ terminal: z.ZodOptional<z.ZodBoolean>;
198
+ description: z.ZodOptional<z.ZodString>;
199
+ }, "strip", z.ZodTypeAny, {
200
+ stateId: string & z.BRAND<"StateId">;
201
+ label: string;
202
+ description?: string | undefined;
203
+ terminal?: boolean | undefined;
204
+ }, {
205
+ stateId: string;
206
+ label: string;
207
+ description?: string | undefined;
208
+ terminal?: boolean | undefined;
209
+ }>, "many">;
210
+ initialState: z.ZodBranded<z.ZodString, "StateId">;
211
+ transitions: z.ZodArray<z.ZodObject<{
212
+ transitionId: z.ZodBranded<z.ZodString, "TransitionId">;
213
+ from: z.ZodBranded<z.ZodString, "StateId">;
214
+ to: z.ZodBranded<z.ZodString, "StateId">;
215
+ signal: z.ZodBranded<z.ZodString, "SignalId">;
216
+ allowedActors: z.ZodArray<z.ZodEnum<["human", "automation", "ai-agent"]>, "many">;
217
+ guards: z.ZodOptional<z.ZodArray<z.ZodObject<{
218
+ guardId: z.ZodBranded<z.ZodString, "GuardId">;
219
+ description: z.ZodString;
220
+ severity: z.ZodEnum<["hard", "soft"]>;
221
+ evaluatedBy: z.ZodEnum<["runtime", "module", "external"]>;
222
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
223
+ }, "strip", z.ZodTypeAny, {
224
+ guardId: string & z.BRAND<"GuardId">;
225
+ description: string;
226
+ severity: "hard" | "soft";
227
+ evaluatedBy: "runtime" | "module" | "external";
228
+ parameters?: Record<string, unknown> | undefined;
229
+ }, {
230
+ guardId: string;
231
+ description: string;
232
+ severity: "hard" | "soft";
233
+ evaluatedBy: "runtime" | "module" | "external";
234
+ parameters?: Record<string, unknown> | undefined;
235
+ }>, "many">>;
236
+ description: z.ZodOptional<z.ZodString>;
237
+ }, "strip", z.ZodTypeAny, {
238
+ transitionId: string & z.BRAND<"TransitionId">;
239
+ from: string & z.BRAND<"StateId">;
240
+ to: string & z.BRAND<"StateId">;
241
+ signal: string & z.BRAND<"SignalId">;
242
+ allowedActors: ("human" | "automation" | "ai-agent")[];
243
+ description?: string | undefined;
244
+ guards?: {
245
+ guardId: string & z.BRAND<"GuardId">;
246
+ description: string;
247
+ severity: "hard" | "soft";
248
+ evaluatedBy: "runtime" | "module" | "external";
249
+ parameters?: Record<string, unknown> | undefined;
250
+ }[] | undefined;
251
+ }, {
252
+ transitionId: string;
253
+ from: string;
254
+ to: string;
255
+ signal: string;
256
+ allowedActors: ("human" | "automation" | "ai-agent")[];
257
+ description?: string | undefined;
258
+ guards?: {
259
+ guardId: string;
260
+ description: string;
261
+ severity: "hard" | "soft";
262
+ evaluatedBy: "runtime" | "module" | "external";
263
+ parameters?: Record<string, unknown> | undefined;
264
+ }[] | undefined;
265
+ }>, "many">;
266
+ outcome: z.ZodOptional<z.ZodObject<{
267
+ description: z.ZodString;
268
+ valueUnit: z.ZodString;
269
+ businessMetrics: z.ZodArray<z.ZodObject<{
270
+ id: z.ZodString;
271
+ label: z.ZodString;
272
+ unit: z.ZodString;
273
+ improvableByAI: z.ZodOptional<z.ZodBoolean>;
274
+ }, "strip", z.ZodTypeAny, {
275
+ id: string;
276
+ label: string;
277
+ unit: string;
278
+ improvableByAI?: boolean | undefined;
279
+ }, {
280
+ id: string;
281
+ label: string;
282
+ unit: string;
283
+ improvableByAI?: boolean | undefined;
284
+ }>, "many">;
285
+ }, "strip", z.ZodTypeAny, {
286
+ description: string;
287
+ valueUnit: string;
288
+ businessMetrics: {
289
+ id: string;
290
+ label: string;
291
+ unit: string;
292
+ improvableByAI?: boolean | undefined;
293
+ }[];
294
+ }, {
295
+ description: string;
296
+ valueUnit: string;
297
+ businessMetrics: {
298
+ id: string;
299
+ label: string;
300
+ unit: string;
301
+ improvableByAI?: boolean | undefined;
302
+ }[];
303
+ }>>;
304
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
305
+ }, "strip", z.ZodTypeAny, {
306
+ description: string;
307
+ loopId: string & z.BRAND<"LoopId">;
308
+ version: string;
309
+ name: string;
310
+ states: {
311
+ stateId: string & z.BRAND<"StateId">;
312
+ label: string;
313
+ description?: string | undefined;
314
+ terminal?: boolean | undefined;
315
+ }[];
316
+ initialState: string & z.BRAND<"StateId">;
317
+ transitions: {
318
+ transitionId: string & z.BRAND<"TransitionId">;
319
+ from: string & z.BRAND<"StateId">;
320
+ to: string & z.BRAND<"StateId">;
321
+ signal: string & z.BRAND<"SignalId">;
322
+ allowedActors: ("human" | "automation" | "ai-agent")[];
323
+ description?: string | undefined;
324
+ guards?: {
325
+ guardId: string & z.BRAND<"GuardId">;
326
+ description: string;
327
+ severity: "hard" | "soft";
328
+ evaluatedBy: "runtime" | "module" | "external";
329
+ parameters?: Record<string, unknown> | undefined;
330
+ }[] | undefined;
331
+ }[];
332
+ outcome?: {
333
+ description: string;
334
+ valueUnit: string;
335
+ businessMetrics: {
336
+ id: string;
337
+ label: string;
338
+ unit: string;
339
+ improvableByAI?: boolean | undefined;
340
+ }[];
341
+ } | undefined;
342
+ tags?: string[] | undefined;
343
+ }, {
344
+ description: string;
345
+ loopId: string;
346
+ version: string;
347
+ name: string;
348
+ states: {
349
+ stateId: string;
350
+ label: string;
351
+ description?: string | undefined;
352
+ terminal?: boolean | undefined;
353
+ }[];
354
+ initialState: string;
355
+ transitions: {
356
+ transitionId: string;
357
+ from: string;
358
+ to: string;
359
+ signal: string;
360
+ allowedActors: ("human" | "automation" | "ai-agent")[];
361
+ description?: string | undefined;
362
+ guards?: {
363
+ guardId: string;
364
+ description: string;
365
+ severity: "hard" | "soft";
366
+ evaluatedBy: "runtime" | "module" | "external";
367
+ parameters?: Record<string, unknown> | undefined;
368
+ }[] | undefined;
369
+ }[];
370
+ outcome?: {
371
+ description: string;
372
+ valueUnit: string;
373
+ businessMetrics: {
374
+ id: string;
375
+ label: string;
376
+ unit: string;
377
+ improvableByAI?: boolean | undefined;
378
+ }[];
379
+ } | undefined;
380
+ tags?: string[] | undefined;
381
+ }>;
382
+ type LoopDefinition = z.infer<typeof LoopDefinitionSchema>;
383
+
384
+ declare const LOOP_ENGINE_CORE_VERSION = "0.1.0";
385
+
386
+ export { type ActorId, ActorIdSchema, type ActorRef, ActorRefSchema, type ActorType, ActorTypeSchema, type AggregateId, AggregateIdSchema, type BusinessMetric, BusinessMetricSchema, type GuardId, GuardIdSchema, type GuardSeverity, GuardSeveritySchema, type GuardSpec, GuardSpecSchema, LOOP_ENGINE_CORE_VERSION, type LoopDefinition, LoopDefinitionSchema, type LoopId, LoopIdSchema, type LoopStatus, LoopStatusSchema, type OutcomeSpec, OutcomeSpecSchema, type SignalId, SignalIdSchema, type StateId, StateIdSchema, type StateSpec, StateSpecSchema, type TransitionId, TransitionIdSchema, type TransitionSpec, TransitionSpecSchema };