@loopstack/contracts 0.36.0 → 0.38.0
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.
- package/dist/api/api-token.schema.d.ts +24 -0
- package/dist/api/api-token.schema.d.ts.map +1 -0
- package/dist/api/api-token.schema.js +16 -0
- package/dist/api/api-token.schema.js.map +1 -0
- package/dist/api/auth.schema.d.ts +29 -0
- package/dist/api/auth.schema.d.ts.map +1 -0
- package/dist/api/auth.schema.js +24 -0
- package/dist/api/auth.schema.js.map +1 -0
- package/dist/api/common.schema.d.ts +20 -0
- package/dist/api/common.schema.d.ts.map +1 -0
- package/dist/api/common.schema.js +14 -0
- package/dist/api/common.schema.js.map +1 -0
- package/dist/api/config.schema.d.ts +187 -0
- package/dist/api/config.schema.d.ts.map +1 -0
- package/dist/api/config.schema.js +64 -0
- package/dist/api/config.schema.js.map +1 -0
- package/dist/api/dashboard.schema.d.ts +39 -0
- package/dist/api/dashboard.schema.d.ts.map +1 -0
- package/dist/api/dashboard.schema.js +11 -0
- package/dist/api/dashboard.schema.js.map +1 -0
- package/dist/api/document.schema.d.ts +51 -0
- package/dist/api/document.schema.d.ts.map +1 -0
- package/dist/api/document.schema.js +27 -0
- package/dist/api/document.schema.js.map +1 -0
- package/dist/api/file.interface.d.ts +1 -1
- package/dist/api/file.interface.d.ts.map +1 -1
- package/dist/api/index.d.ts +9 -10
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +9 -7
- package/dist/api/index.js.map +1 -1
- package/dist/api/pagination.schema.d.ts +14 -0
- package/dist/api/pagination.schema.d.ts.map +1 -0
- package/dist/api/pagination.schema.js +10 -0
- package/dist/api/pagination.schema.js.map +1 -0
- package/dist/api/workflow.schema.d.ts +159 -0
- package/dist/api/workflow.schema.d.ts.map +1 -0
- package/dist/api/workflow.schema.js +88 -0
- package/dist/api/workflow.schema.js.map +1 -0
- package/dist/api/workspace.schema.d.ts +69 -0
- package/dist/api/workspace.schema.d.ts.map +1 -0
- package/dist/api/workspace.schema.js +28 -0
- package/dist/api/workspace.schema.js.map +1 -0
- package/dist/events/client-message-base.schema.d.ts +7 -0
- package/dist/events/client-message-base.schema.d.ts.map +1 -0
- package/dist/events/client-message-base.schema.js +6 -0
- package/dist/events/client-message-base.schema.js.map +1 -0
- package/dist/events/client-message.schema.d.ts +131 -0
- package/dist/events/client-message.schema.d.ts.map +1 -0
- package/dist/events/client-message.schema.js +30 -0
- package/dist/events/client-message.schema.js.map +1 -0
- package/dist/events/index.d.ts +7 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +7 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/llm-events.schema.d.ts +221 -0
- package/dist/events/llm-events.schema.d.ts.map +1 -0
- package/dist/events/llm-events.schema.js +46 -0
- package/dist/events/llm-events.schema.js.map +1 -0
- package/dist/events/stream-events.schema.d.ts +8 -0
- package/dist/events/stream-events.schema.d.ts.map +1 -0
- package/dist/events/stream-events.schema.js +6 -0
- package/dist/events/stream-events.schema.js.map +1 -0
- package/dist/events/workflow-events.schema.d.ts +30 -0
- package/dist/events/workflow-events.schema.d.ts.map +1 -0
- package/dist/events/workflow-events.schema.js +22 -0
- package/dist/events/workflow-events.schema.js.map +1 -0
- package/dist/events/workspace-events.schema.d.ts +23 -0
- package/dist/events/workspace-events.schema.d.ts.map +1 -0
- package/dist/events/workspace-events.schema.js +15 -0
- package/dist/events/workspace-events.schema.js.map +1 -0
- package/dist/park-view/index.d.ts +3 -0
- package/dist/park-view/index.d.ts.map +1 -0
- package/dist/park-view/index.js +3 -0
- package/dist/park-view/index.js.map +1 -0
- package/dist/park-view/park-view.rules.d.ts +13 -0
- package/dist/park-view/park-view.rules.d.ts.map +1 -0
- package/dist/park-view/park-view.rules.js +158 -0
- package/dist/park-view/park-view.rules.js.map +1 -0
- package/dist/park-view/park-view.types.d.ts +55 -0
- package/dist/park-view/park-view.types.d.ts.map +1 -0
- package/dist/park-view/park-view.types.js +16 -0
- package/dist/park-view/park-view.types.js.map +1 -0
- package/dist/schemas/startup.schema.d.ts +4 -4
- package/dist/schemas/transition-payload.schema.d.ts +1 -1
- package/dist/types/interfaces/document-item.interface.d.ts +1 -18
- package/dist/types/interfaces/document-item.interface.d.ts.map +1 -1
- package/dist/types/interfaces/index.d.ts +0 -4
- package/dist/types/interfaces/index.d.ts.map +1 -1
- package/dist/types/interfaces/index.js +0 -4
- package/dist/types/interfaces/index.js.map +1 -1
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/index.js +1 -0
- package/dist/types/types/index.js.map +1 -1
- package/dist/types/types/run-trace.type.d.ts +211 -0
- package/dist/types/types/run-trace.type.d.ts.map +1 -0
- package/dist/types/types/run-trace.type.js +108 -0
- package/dist/types/types/run-trace.type.js.map +1 -0
- package/package.json +16 -3
- package/dist/api/auth.interface.d.ts +0 -9
- package/dist/api/auth.interface.d.ts.map +0 -1
- package/dist/api/auth.interface.js +0 -2
- package/dist/api/auth.interface.js.map +0 -1
- package/dist/api/common.interface.d.ts +0 -6
- package/dist/api/common.interface.d.ts.map +0 -1
- package/dist/api/common.interface.js +0 -2
- package/dist/api/common.interface.js.map +0 -1
- package/dist/api/dashboard.interface.d.ts +0 -13
- package/dist/api/dashboard.interface.d.ts.map +0 -1
- package/dist/api/dashboard.interface.js +0 -2
- package/dist/api/dashboard.interface.js.map +0 -1
- package/dist/api/document.interface.d.ts +0 -6
- package/dist/api/document.interface.d.ts.map +0 -1
- package/dist/api/document.interface.js +0 -2
- package/dist/api/document.interface.js.map +0 -1
- package/dist/api/pagination.interface.d.ts +0 -7
- package/dist/api/pagination.interface.d.ts.map +0 -1
- package/dist/api/pagination.interface.js +0 -2
- package/dist/api/pagination.interface.js.map +0 -1
- package/dist/api/workflow.interface.d.ts +0 -66
- package/dist/api/workflow.interface.d.ts.map +0 -1
- package/dist/api/workflow.interface.js +0 -2
- package/dist/api/workflow.interface.js.map +0 -1
- package/dist/api/workspace.interface.d.ts +0 -74
- package/dist/api/workspace.interface.d.ts.map +0 -1
- package/dist/api/workspace.interface.js +0 -2
- package/dist/api/workspace.interface.js.map +0 -1
- package/dist/types/interfaces/client-message.interface.d.ts +0 -11
- package/dist/types/interfaces/client-message.interface.d.ts.map +0 -1
- package/dist/types/interfaces/client-message.interface.js +0 -2
- package/dist/types/interfaces/client-message.interface.js.map +0 -1
- package/dist/types/interfaces/history-transition.interface.d.ts +0 -9
- package/dist/types/interfaces/history-transition.interface.d.ts.map +0 -1
- package/dist/types/interfaces/history-transition.interface.js +0 -2
- package/dist/types/interfaces/history-transition.interface.js.map +0 -1
- package/dist/types/interfaces/tool-config.interface.d.ts +0 -7
- package/dist/types/interfaces/tool-config.interface.d.ts.map +0 -1
- package/dist/types/interfaces/tool-config.interface.js +0 -2
- package/dist/types/interfaces/tool-config.interface.js.map +0 -1
- package/dist/types/interfaces/workflow-config.interface.d.ts +0 -10
- package/dist/types/interfaces/workflow-config.interface.d.ts.map +0 -1
- package/dist/types/interfaces/workflow-config.interface.js +0 -2
- package/dist/types/interfaces/workflow-config.interface.js.map +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface ParkViewWorkflowInput {
|
|
3
|
+
id: string;
|
|
4
|
+
workflowName: string;
|
|
5
|
+
status: string;
|
|
6
|
+
place: string | null;
|
|
7
|
+
availableTransitions: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface ParkViewDocumentInput {
|
|
10
|
+
documentName: string;
|
|
11
|
+
place: string | null;
|
|
12
|
+
content: Record<string, unknown> | null;
|
|
13
|
+
tags?: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface ParkViewWidgetConfig {
|
|
16
|
+
widget: string;
|
|
17
|
+
options?: Record<string, unknown>;
|
|
18
|
+
enabledWhen?: string[];
|
|
19
|
+
showWhen?: string[];
|
|
20
|
+
schema?: Record<string, unknown>;
|
|
21
|
+
enableAtPlaces?: string[];
|
|
22
|
+
hideAtPlaces?: string[];
|
|
23
|
+
internal?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export type ParkWidgetState = 'active' | 'disabled' | 'hidden';
|
|
26
|
+
export interface PromptCandidate {
|
|
27
|
+
kind: 'document' | 'workflow' | 'bare';
|
|
28
|
+
workflow: ParkViewWorkflowInput;
|
|
29
|
+
document?: ParkViewDocumentInput;
|
|
30
|
+
widget?: ParkViewWidgetConfig;
|
|
31
|
+
state: ParkWidgetState;
|
|
32
|
+
submitTransition?: string;
|
|
33
|
+
submitDeclared?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface PickResult {
|
|
36
|
+
prompt?: PromptCandidate;
|
|
37
|
+
blocked?: PromptCandidate;
|
|
38
|
+
fallback?: PromptCandidate;
|
|
39
|
+
}
|
|
40
|
+
export declare const ParkViewSchema: z.ZodObject<{
|
|
41
|
+
workflowId: z.ZodString;
|
|
42
|
+
workflowName: z.ZodString;
|
|
43
|
+
place: z.ZodNullable<z.ZodString>;
|
|
44
|
+
status: z.ZodString;
|
|
45
|
+
widget: z.ZodOptional<z.ZodString>;
|
|
46
|
+
documentName: z.ZodOptional<z.ZodString>;
|
|
47
|
+
content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
48
|
+
schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
49
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
50
|
+
transitions: z.ZodArray<z.ZodString>;
|
|
51
|
+
defaultTransition: z.ZodOptional<z.ZodString>;
|
|
52
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export type ParkView = z.infer<typeof ParkViewSchema>;
|
|
55
|
+
//# sourceMappingURL=park-view.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"park-view.types.d.ts","sourceRoot":"","sources":["../../src/park-view/park-view.types.ts"],"names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AC,EAAE,OAAO,CAAC;CAC1B;AASD,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AASD,eAAO,MAAM,cAAc;;;;;;;;;;;;;iBAqBzB,CAAC;AAGH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const ParkViewSchema = z.object({
|
|
3
|
+
workflowId: z.string(),
|
|
4
|
+
workflowName: z.string(),
|
|
5
|
+
place: z.string().nullable(),
|
|
6
|
+
status: z.string(),
|
|
7
|
+
widget: z.string().optional(),
|
|
8
|
+
documentName: z.string().optional(),
|
|
9
|
+
content: z.record(z.string(), z.unknown()).optional(),
|
|
10
|
+
schema: z.record(z.string(), z.unknown()).optional(),
|
|
11
|
+
options: z.record(z.string(), z.unknown()).optional(),
|
|
12
|
+
transitions: z.array(z.string()),
|
|
13
|
+
defaultTransition: z.string().optional(),
|
|
14
|
+
actions: z.array(z.string()).optional(),
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=park-view.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"park-view.types.js","sourceRoot":"","sources":["../../src/park-view/park-view.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoGxB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAErC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAElB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAEnC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IAErD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IAEpD,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IAErD,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAEhC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAExC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC"}
|
|
@@ -37,8 +37,8 @@ export declare const RunPayloadSchema: z.ZodObject<{
|
|
|
37
37
|
payload: z.ZodOptional<z.ZodUnknown>;
|
|
38
38
|
meta: z.ZodOptional<z.ZodUnknown>;
|
|
39
39
|
status: z.ZodOptional<z.ZodEnum<{
|
|
40
|
-
completed: "completed";
|
|
41
40
|
failed: "failed";
|
|
41
|
+
completed: "completed";
|
|
42
42
|
canceled: "canceled";
|
|
43
43
|
}>>;
|
|
44
44
|
errorMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -74,8 +74,8 @@ export declare const RunWorkflowTaskSchema: z.ZodObject<{
|
|
|
74
74
|
payload: z.ZodOptional<z.ZodUnknown>;
|
|
75
75
|
meta: z.ZodOptional<z.ZodUnknown>;
|
|
76
76
|
status: z.ZodOptional<z.ZodEnum<{
|
|
77
|
-
completed: "completed";
|
|
78
77
|
failed: "failed";
|
|
78
|
+
completed: "completed";
|
|
79
79
|
canceled: "canceled";
|
|
80
80
|
}>>;
|
|
81
81
|
errorMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -111,8 +111,8 @@ export declare const StartupTaskSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
111
111
|
payload: z.ZodOptional<z.ZodUnknown>;
|
|
112
112
|
meta: z.ZodOptional<z.ZodUnknown>;
|
|
113
113
|
status: z.ZodOptional<z.ZodEnum<{
|
|
114
|
-
completed: "completed";
|
|
115
114
|
failed: "failed";
|
|
115
|
+
completed: "completed";
|
|
116
116
|
canceled: "canceled";
|
|
117
117
|
}>>;
|
|
118
118
|
errorMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -151,8 +151,8 @@ export declare const ScheduledTaskSchema: z.ZodObject<{
|
|
|
151
151
|
payload: z.ZodOptional<z.ZodUnknown>;
|
|
152
152
|
meta: z.ZodOptional<z.ZodUnknown>;
|
|
153
153
|
status: z.ZodOptional<z.ZodEnum<{
|
|
154
|
-
completed: "completed";
|
|
155
154
|
failed: "failed";
|
|
155
|
+
completed: "completed";
|
|
156
156
|
canceled: "canceled";
|
|
157
157
|
}>>;
|
|
158
158
|
errorMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -5,8 +5,8 @@ export declare const TransitionPayloadSchema: z.ZodObject<{
|
|
|
5
5
|
payload: z.ZodOptional<z.ZodUnknown>;
|
|
6
6
|
meta: z.ZodOptional<z.ZodUnknown>;
|
|
7
7
|
status: z.ZodOptional<z.ZodEnum<{
|
|
8
|
-
completed: "completed";
|
|
9
8
|
failed: "failed";
|
|
9
|
+
completed: "completed";
|
|
10
10
|
canceled: "canceled";
|
|
11
11
|
}>>;
|
|
12
12
|
errorMessage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export interface DocumentItemInterface {
|
|
3
|
-
id: string;
|
|
4
|
-
documentName: string;
|
|
5
|
-
content: any;
|
|
6
|
-
validationError: any;
|
|
7
|
-
meta: DynamicDocumentMeta | null;
|
|
8
|
-
isInvalidated: boolean;
|
|
9
|
-
index: number;
|
|
10
|
-
transition: string | null;
|
|
11
|
-
place: string | null;
|
|
12
|
-
labels: string[];
|
|
13
|
-
tags: string[];
|
|
14
|
-
createdAt: Date;
|
|
15
|
-
updatedAt: Date;
|
|
16
|
-
workspaceId: string;
|
|
17
|
-
workflowId: string;
|
|
18
|
-
}
|
|
1
|
+
export type { DocumentItemInterface } from '../../api/document.schema.js';
|
|
19
2
|
//# sourceMappingURL=document-item.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-item.interface.d.ts","sourceRoot":"","sources":["../../../src/types/interfaces/document-item.interface.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"document-item.interface.d.ts","sourceRoot":"","sources":["../../../src/types/interfaces/document-item.interface.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
export * from './history-transition.interface.js';
|
|
2
1
|
export * from './transition-info.interface.js';
|
|
3
2
|
export * from './transition-payload.interface.js';
|
|
4
3
|
export * from './transition-metadata.interface.js';
|
|
5
4
|
export * from './document-item.interface.js';
|
|
6
5
|
export * from './workflow.interface.js';
|
|
7
|
-
export * from './client-message.interface.js';
|
|
8
|
-
export * from './workflow-config.interface.js';
|
|
9
|
-
export * from './tool-config.interface.js';
|
|
10
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
export * from './history-transition.interface.js';
|
|
2
1
|
export * from './transition-info.interface.js';
|
|
3
2
|
export * from './transition-payload.interface.js';
|
|
4
3
|
export * from './transition-metadata.interface.js';
|
|
5
4
|
export * from './document-item.interface.js';
|
|
6
5
|
export * from './workflow.interface.js';
|
|
7
|
-
export * from './client-message.interface.js';
|
|
8
|
-
export * from './workflow-config.interface.js';
|
|
9
|
-
export * from './tool-config.interface.js';
|
|
10
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC"}
|
|
@@ -12,5 +12,6 @@ export * from './workflow.type.js';
|
|
|
12
12
|
export * from './workflow-transition.type.js';
|
|
13
13
|
export * from './json-schema-config.type.js';
|
|
14
14
|
export * from './main.type.js';
|
|
15
|
+
export * from './run-trace.type.js';
|
|
15
16
|
export * from './workflow-state.type.js';
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC"}
|
|
@@ -12,5 +12,6 @@ export * from './workflow.type.js';
|
|
|
12
12
|
export * from './workflow-transition.type.js';
|
|
13
13
|
export * from './json-schema-config.type.js';
|
|
14
14
|
export * from './main.type.js';
|
|
15
|
+
export * from './run-trace.type.js';
|
|
15
16
|
export * from './workflow-state.type.js';
|
|
16
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const StateDiffSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3
|
+
before: z.ZodOptional<z.ZodUnknown>;
|
|
4
|
+
after: z.ZodOptional<z.ZodUnknown>;
|
|
5
|
+
}, z.core.$strip>>;
|
|
6
|
+
export type StateDiff = z.infer<typeof StateDiffSchema>;
|
|
7
|
+
export declare const TransitionStartedEventSchema: z.ZodObject<{
|
|
8
|
+
type: z.ZodLiteral<"transition.started">;
|
|
9
|
+
transitionId: z.ZodString;
|
|
10
|
+
from: z.ZodNullable<z.ZodString>;
|
|
11
|
+
to: z.ZodString;
|
|
12
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
13
|
+
seq: z.ZodNumber;
|
|
14
|
+
ts: z.ZodNumber;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export declare const TransitionCompletedEventSchema: z.ZodObject<{
|
|
17
|
+
type: z.ZodLiteral<"transition.completed">;
|
|
18
|
+
transitionId: z.ZodString;
|
|
19
|
+
durationMs: z.ZodNumber;
|
|
20
|
+
stateDiff: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
21
|
+
before: z.ZodOptional<z.ZodUnknown>;
|
|
22
|
+
after: z.ZodOptional<z.ZodUnknown>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
resultDirty: z.ZodBoolean;
|
|
25
|
+
seq: z.ZodNumber;
|
|
26
|
+
ts: z.ZodNumber;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
export declare const TransitionFailedEventSchema: z.ZodObject<{
|
|
29
|
+
type: z.ZodLiteral<"transition.failed">;
|
|
30
|
+
transitionId: z.ZodString;
|
|
31
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
error: z.ZodString;
|
|
33
|
+
retryCount: z.ZodNumber;
|
|
34
|
+
willRetry: z.ZodBoolean;
|
|
35
|
+
seq: z.ZodNumber;
|
|
36
|
+
ts: z.ZodNumber;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export declare const ToolCalledEventSchema: z.ZodObject<{
|
|
39
|
+
type: z.ZodLiteral<"tool.called">;
|
|
40
|
+
transitionId: z.ZodOptional<z.ZodString>;
|
|
41
|
+
toolName: z.ZodString;
|
|
42
|
+
toolSeq: z.ZodNumber;
|
|
43
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
44
|
+
config: z.ZodOptional<z.ZodUnknown>;
|
|
45
|
+
seq: z.ZodNumber;
|
|
46
|
+
ts: z.ZodNumber;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export declare const ToolCompletedEventSchema: z.ZodObject<{
|
|
49
|
+
type: z.ZodLiteral<"tool.completed">;
|
|
50
|
+
transitionId: z.ZodOptional<z.ZodString>;
|
|
51
|
+
toolName: z.ZodString;
|
|
52
|
+
toolSeq: z.ZodNumber;
|
|
53
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
54
|
+
config: z.ZodOptional<z.ZodUnknown>;
|
|
55
|
+
envelope: z.ZodUnknown;
|
|
56
|
+
durationMs: z.ZodNumber;
|
|
57
|
+
seq: z.ZodNumber;
|
|
58
|
+
ts: z.ZodNumber;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
export declare const ToolFailedEventSchema: z.ZodObject<{
|
|
61
|
+
type: z.ZodLiteral<"tool.failed">;
|
|
62
|
+
transitionId: z.ZodOptional<z.ZodString>;
|
|
63
|
+
toolName: z.ZodString;
|
|
64
|
+
toolSeq: z.ZodNumber;
|
|
65
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
66
|
+
config: z.ZodOptional<z.ZodUnknown>;
|
|
67
|
+
error: z.ZodString;
|
|
68
|
+
durationMs: z.ZodNumber;
|
|
69
|
+
seq: z.ZodNumber;
|
|
70
|
+
ts: z.ZodNumber;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
export declare const DocumentEmittedEventSchema: z.ZodObject<{
|
|
73
|
+
type: z.ZodLiteral<"document.emitted">;
|
|
74
|
+
transitionId: z.ZodOptional<z.ZodString>;
|
|
75
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
76
|
+
key: z.ZodOptional<z.ZodString>;
|
|
77
|
+
documentName: z.ZodString;
|
|
78
|
+
invalidatedKey: z.ZodOptional<z.ZodString>;
|
|
79
|
+
seq: z.ZodNumber;
|
|
80
|
+
ts: z.ZodNumber;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
export declare const ChildQueuedEventSchema: z.ZodObject<{
|
|
83
|
+
type: z.ZodLiteral<"child.queued">;
|
|
84
|
+
transitionId: z.ZodOptional<z.ZodString>;
|
|
85
|
+
childWorkflowId: z.ZodString;
|
|
86
|
+
workflowName: z.ZodString;
|
|
87
|
+
show: z.ZodOptional<z.ZodString>;
|
|
88
|
+
seq: z.ZodNumber;
|
|
89
|
+
ts: z.ZodNumber;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
export declare const ChildSettledEventSchema: z.ZodObject<{
|
|
92
|
+
type: z.ZodLiteral<"child.settled">;
|
|
93
|
+
childWorkflowId: z.ZodString;
|
|
94
|
+
status: z.ZodString;
|
|
95
|
+
seq: z.ZodNumber;
|
|
96
|
+
ts: z.ZodNumber;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
export declare const RunSettledEventSchema: z.ZodObject<{
|
|
99
|
+
type: z.ZodLiteral<"run.settled">;
|
|
100
|
+
status: z.ZodString;
|
|
101
|
+
place: z.ZodString;
|
|
102
|
+
availableTransitions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
103
|
+
seq: z.ZodNumber;
|
|
104
|
+
ts: z.ZodNumber;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
export declare const RunTraceEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
107
|
+
type: z.ZodLiteral<"transition.started">;
|
|
108
|
+
transitionId: z.ZodString;
|
|
109
|
+
from: z.ZodNullable<z.ZodString>;
|
|
110
|
+
to: z.ZodString;
|
|
111
|
+
payload: z.ZodOptional<z.ZodUnknown>;
|
|
112
|
+
seq: z.ZodNumber;
|
|
113
|
+
ts: z.ZodNumber;
|
|
114
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
115
|
+
type: z.ZodLiteral<"transition.completed">;
|
|
116
|
+
transitionId: z.ZodString;
|
|
117
|
+
durationMs: z.ZodNumber;
|
|
118
|
+
stateDiff: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
119
|
+
before: z.ZodOptional<z.ZodUnknown>;
|
|
120
|
+
after: z.ZodOptional<z.ZodUnknown>;
|
|
121
|
+
}, z.core.$strip>>;
|
|
122
|
+
resultDirty: z.ZodBoolean;
|
|
123
|
+
seq: z.ZodNumber;
|
|
124
|
+
ts: z.ZodNumber;
|
|
125
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
126
|
+
type: z.ZodLiteral<"transition.failed">;
|
|
127
|
+
transitionId: z.ZodString;
|
|
128
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
error: z.ZodString;
|
|
130
|
+
retryCount: z.ZodNumber;
|
|
131
|
+
willRetry: z.ZodBoolean;
|
|
132
|
+
seq: z.ZodNumber;
|
|
133
|
+
ts: z.ZodNumber;
|
|
134
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
135
|
+
type: z.ZodLiteral<"tool.called">;
|
|
136
|
+
transitionId: z.ZodOptional<z.ZodString>;
|
|
137
|
+
toolName: z.ZodString;
|
|
138
|
+
toolSeq: z.ZodNumber;
|
|
139
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
140
|
+
config: z.ZodOptional<z.ZodUnknown>;
|
|
141
|
+
seq: z.ZodNumber;
|
|
142
|
+
ts: z.ZodNumber;
|
|
143
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
144
|
+
type: z.ZodLiteral<"tool.completed">;
|
|
145
|
+
transitionId: z.ZodOptional<z.ZodString>;
|
|
146
|
+
toolName: z.ZodString;
|
|
147
|
+
toolSeq: z.ZodNumber;
|
|
148
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
149
|
+
config: z.ZodOptional<z.ZodUnknown>;
|
|
150
|
+
envelope: z.ZodUnknown;
|
|
151
|
+
durationMs: z.ZodNumber;
|
|
152
|
+
seq: z.ZodNumber;
|
|
153
|
+
ts: z.ZodNumber;
|
|
154
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
155
|
+
type: z.ZodLiteral<"tool.failed">;
|
|
156
|
+
transitionId: z.ZodOptional<z.ZodString>;
|
|
157
|
+
toolName: z.ZodString;
|
|
158
|
+
toolSeq: z.ZodNumber;
|
|
159
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
160
|
+
config: z.ZodOptional<z.ZodUnknown>;
|
|
161
|
+
error: z.ZodString;
|
|
162
|
+
durationMs: z.ZodNumber;
|
|
163
|
+
seq: z.ZodNumber;
|
|
164
|
+
ts: z.ZodNumber;
|
|
165
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
166
|
+
type: z.ZodLiteral<"document.emitted">;
|
|
167
|
+
transitionId: z.ZodOptional<z.ZodString>;
|
|
168
|
+
documentId: z.ZodOptional<z.ZodString>;
|
|
169
|
+
key: z.ZodOptional<z.ZodString>;
|
|
170
|
+
documentName: z.ZodString;
|
|
171
|
+
invalidatedKey: z.ZodOptional<z.ZodString>;
|
|
172
|
+
seq: z.ZodNumber;
|
|
173
|
+
ts: z.ZodNumber;
|
|
174
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
175
|
+
type: z.ZodLiteral<"child.queued">;
|
|
176
|
+
transitionId: z.ZodOptional<z.ZodString>;
|
|
177
|
+
childWorkflowId: z.ZodString;
|
|
178
|
+
workflowName: z.ZodString;
|
|
179
|
+
show: z.ZodOptional<z.ZodString>;
|
|
180
|
+
seq: z.ZodNumber;
|
|
181
|
+
ts: z.ZodNumber;
|
|
182
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
183
|
+
type: z.ZodLiteral<"child.settled">;
|
|
184
|
+
childWorkflowId: z.ZodString;
|
|
185
|
+
status: z.ZodString;
|
|
186
|
+
seq: z.ZodNumber;
|
|
187
|
+
ts: z.ZodNumber;
|
|
188
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
189
|
+
type: z.ZodLiteral<"run.settled">;
|
|
190
|
+
status: z.ZodString;
|
|
191
|
+
place: z.ZodString;
|
|
192
|
+
availableTransitions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
193
|
+
seq: z.ZodNumber;
|
|
194
|
+
ts: z.ZodNumber;
|
|
195
|
+
}, z.core.$strip>], "type">;
|
|
196
|
+
export type RunTraceEvent = z.infer<typeof RunTraceEventSchema>;
|
|
197
|
+
export type TransitionStartedEvent = z.infer<typeof TransitionStartedEventSchema>;
|
|
198
|
+
export type TransitionCompletedEvent = z.infer<typeof TransitionCompletedEventSchema>;
|
|
199
|
+
export type TransitionFailedEvent = z.infer<typeof TransitionFailedEventSchema>;
|
|
200
|
+
export type ToolCalledEvent = z.infer<typeof ToolCalledEventSchema>;
|
|
201
|
+
export type ToolCompletedEvent = z.infer<typeof ToolCompletedEventSchema>;
|
|
202
|
+
export type ToolFailedEvent = z.infer<typeof ToolFailedEventSchema>;
|
|
203
|
+
export type DocumentEmittedEvent = z.infer<typeof DocumentEmittedEventSchema>;
|
|
204
|
+
export type ChildQueuedEvent = z.infer<typeof ChildQueuedEventSchema>;
|
|
205
|
+
export type ChildSettledEvent = z.infer<typeof ChildSettledEventSchema>;
|
|
206
|
+
export type RunSettledEvent = z.infer<typeof RunSettledEventSchema>;
|
|
207
|
+
type DistributiveOmit<T, K extends keyof never> = T extends unknown ? Omit<T, K> : never;
|
|
208
|
+
export type RunTraceEventInput = DistributiveOmit<RunTraceEvent, 'seq' | 'ts'>;
|
|
209
|
+
export declare function executedTransitions(trace: RunTraceEvent[]): Array<TransitionCompletedEvent | TransitionFailedEvent>;
|
|
210
|
+
export {};
|
|
211
|
+
//# sourceMappingURL=run-trace.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-trace.type.d.ts","sourceRoot":"","sources":["../../../src/types/types/run-trace.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,eAAe;;;kBAG3B,CAAC;AACF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,4BAA4B;;;;;;;;iBAQvC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;iBASzC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BAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,KAAK,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,KAAK,IAAI,CAAC,SAAS,OAAO,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC;AAGzF,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,aAAa,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC;AAS/E,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC,wBAAwB,GAAG,qBAAqB,CAAC,CAKnH"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const RunTraceEventBase = {
|
|
3
|
+
seq: z.number().int(),
|
|
4
|
+
ts: z.number(),
|
|
5
|
+
};
|
|
6
|
+
export const StateDiffSchema = z.record(z.string(), z.object({ before: z.unknown().optional(), after: z.unknown().optional() }));
|
|
7
|
+
export const TransitionStartedEventSchema = z.object({
|
|
8
|
+
...RunTraceEventBase,
|
|
9
|
+
type: z.literal('transition.started'),
|
|
10
|
+
transitionId: z.string(),
|
|
11
|
+
from: z.string().nullable(),
|
|
12
|
+
to: z.string(),
|
|
13
|
+
payload: z.unknown().optional(),
|
|
14
|
+
});
|
|
15
|
+
export const TransitionCompletedEventSchema = z.object({
|
|
16
|
+
...RunTraceEventBase,
|
|
17
|
+
type: z.literal('transition.completed'),
|
|
18
|
+
transitionId: z.string(),
|
|
19
|
+
durationMs: z.number(),
|
|
20
|
+
stateDiff: StateDiffSchema,
|
|
21
|
+
resultDirty: z.boolean(),
|
|
22
|
+
});
|
|
23
|
+
export const TransitionFailedEventSchema = z.object({
|
|
24
|
+
...RunTraceEventBase,
|
|
25
|
+
type: z.literal('transition.failed'),
|
|
26
|
+
transitionId: z.string(),
|
|
27
|
+
durationMs: z.number().optional(),
|
|
28
|
+
error: z.string(),
|
|
29
|
+
retryCount: z.number(),
|
|
30
|
+
willRetry: z.boolean(),
|
|
31
|
+
});
|
|
32
|
+
export const ToolCalledEventSchema = z.object({
|
|
33
|
+
...RunTraceEventBase,
|
|
34
|
+
type: z.literal('tool.called'),
|
|
35
|
+
transitionId: z.string().optional(),
|
|
36
|
+
toolName: z.string(),
|
|
37
|
+
toolSeq: z.number(),
|
|
38
|
+
args: z.unknown().optional(),
|
|
39
|
+
config: z.unknown().optional(),
|
|
40
|
+
});
|
|
41
|
+
export const ToolCompletedEventSchema = z.object({
|
|
42
|
+
...RunTraceEventBase,
|
|
43
|
+
type: z.literal('tool.completed'),
|
|
44
|
+
transitionId: z.string().optional(),
|
|
45
|
+
toolName: z.string(),
|
|
46
|
+
toolSeq: z.number(),
|
|
47
|
+
args: z.unknown().optional(),
|
|
48
|
+
config: z.unknown().optional(),
|
|
49
|
+
envelope: z.unknown(),
|
|
50
|
+
durationMs: z.number(),
|
|
51
|
+
});
|
|
52
|
+
export const ToolFailedEventSchema = z.object({
|
|
53
|
+
...RunTraceEventBase,
|
|
54
|
+
type: z.literal('tool.failed'),
|
|
55
|
+
transitionId: z.string().optional(),
|
|
56
|
+
toolName: z.string(),
|
|
57
|
+
toolSeq: z.number(),
|
|
58
|
+
args: z.unknown().optional(),
|
|
59
|
+
config: z.unknown().optional(),
|
|
60
|
+
error: z.string(),
|
|
61
|
+
durationMs: z.number(),
|
|
62
|
+
});
|
|
63
|
+
export const DocumentEmittedEventSchema = z.object({
|
|
64
|
+
...RunTraceEventBase,
|
|
65
|
+
type: z.literal('document.emitted'),
|
|
66
|
+
transitionId: z.string().optional(),
|
|
67
|
+
documentId: z.string().optional(),
|
|
68
|
+
key: z.string().optional(),
|
|
69
|
+
documentName: z.string(),
|
|
70
|
+
invalidatedKey: z.string().optional(),
|
|
71
|
+
});
|
|
72
|
+
export const ChildQueuedEventSchema = z.object({
|
|
73
|
+
...RunTraceEventBase,
|
|
74
|
+
type: z.literal('child.queued'),
|
|
75
|
+
transitionId: z.string().optional(),
|
|
76
|
+
childWorkflowId: z.string(),
|
|
77
|
+
workflowName: z.string(),
|
|
78
|
+
show: z.string().optional(),
|
|
79
|
+
});
|
|
80
|
+
export const ChildSettledEventSchema = z.object({
|
|
81
|
+
...RunTraceEventBase,
|
|
82
|
+
type: z.literal('child.settled'),
|
|
83
|
+
childWorkflowId: z.string(),
|
|
84
|
+
status: z.string(),
|
|
85
|
+
});
|
|
86
|
+
export const RunSettledEventSchema = z.object({
|
|
87
|
+
...RunTraceEventBase,
|
|
88
|
+
type: z.literal('run.settled'),
|
|
89
|
+
status: z.string(),
|
|
90
|
+
place: z.string(),
|
|
91
|
+
availableTransitions: z.array(z.string()).optional(),
|
|
92
|
+
});
|
|
93
|
+
export const RunTraceEventSchema = z.discriminatedUnion('type', [
|
|
94
|
+
TransitionStartedEventSchema,
|
|
95
|
+
TransitionCompletedEventSchema,
|
|
96
|
+
TransitionFailedEventSchema,
|
|
97
|
+
ToolCalledEventSchema,
|
|
98
|
+
ToolCompletedEventSchema,
|
|
99
|
+
ToolFailedEventSchema,
|
|
100
|
+
DocumentEmittedEventSchema,
|
|
101
|
+
ChildQueuedEventSchema,
|
|
102
|
+
ChildSettledEventSchema,
|
|
103
|
+
RunSettledEventSchema,
|
|
104
|
+
]);
|
|
105
|
+
export function executedTransitions(trace) {
|
|
106
|
+
return trace.filter((e) => e.type === 'transition.completed' || e.type === 'transition.failed');
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=run-trace.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-trace.type.js","sourceRoot":"","sources":["../../../src/types/types/run-trace.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,E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AE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,GAAG,iBAAiB;IACpB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;IAChC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,GAAG,iBAAiB;IACpB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC9B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IAEjB,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACrD,CAAC,CAAC;AAOH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC9D,4BAA4B;IAC5B,8BAA8B;IAC9B,2BAA2B;IAC3B,qBAAqB;IACrB,wBAAwB;IACxB,qBAAqB;IACrB,0BAA0B;IAC1B,sBAAsB;IACtB,uBAAuB;IACvB,qBAAqB;CACtB,CAAC,CAAC;AAgCH,MAAM,UAAU,mBAAmB,CAAC,KAAsB;IACxD,OAAO,KAAK,CAAC,MAAM,CACjB,CAAC,CAAC,EAAyD,EAAE,CAC3D,CAAC,CAAC,IAAI,KAAK,sBAAsB,IAAI,CAAC,CAAC,IAAI,KAAK,mBAAmB,CACtE,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@loopstack/contracts",
|
|
3
3
|
"displayName": "Loopstack Contracts",
|
|
4
4
|
"description": "A collection of types and schemas shared between projects",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.38.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Jakob Klippel",
|
|
@@ -27,17 +27,27 @@
|
|
|
27
27
|
"./api": {
|
|
28
28
|
"types": "./dist/api/index.d.ts",
|
|
29
29
|
"default": "./dist/api/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./events": {
|
|
32
|
+
"types": "./dist/events/index.d.ts",
|
|
33
|
+
"default": "./dist/events/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./park-view": {
|
|
36
|
+
"types": "./dist/park-view/index.d.ts",
|
|
37
|
+
"default": "./dist/park-view/index.js"
|
|
30
38
|
}
|
|
31
39
|
},
|
|
32
40
|
"scripts": {
|
|
33
|
-
"build": "tsc",
|
|
41
|
+
"build": "tsc -p tsconfig.build.json",
|
|
34
42
|
"compile": "tsc --noEmit",
|
|
35
43
|
"format": "prettier --write .",
|
|
36
44
|
"lint": "eslint .",
|
|
37
|
-
"
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"watch": "tsc -p tsconfig.build.json --watch"
|
|
38
47
|
},
|
|
39
48
|
"dependencies": {},
|
|
40
49
|
"devDependencies": {
|
|
50
|
+
"vitest": "^4.1.6",
|
|
41
51
|
"zod": "^4.3.6"
|
|
42
52
|
},
|
|
43
53
|
"peerDependencies": {
|
|
@@ -59,6 +69,9 @@
|
|
|
59
69
|
],
|
|
60
70
|
"api": [
|
|
61
71
|
"./dist/api/index.d.ts"
|
|
72
|
+
],
|
|
73
|
+
"events": [
|
|
74
|
+
"./dist/events/index.d.ts"
|
|
62
75
|
]
|
|
63
76
|
}
|
|
64
77
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.interface.d.ts","sourceRoot":"","sources":["../../src/api/auth.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.interface.js","sourceRoot":"","sources":["../../src/api/auth.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.interface.d.ts","sourceRoot":"","sources":["../../src/api/common.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;CAClB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.interface.js","sourceRoot":"","sources":["../../src/api/common.interface.ts"],"names":[],"mappings":""}
|