@loopstack/contracts 0.14.1 → 0.16.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/.github/workflows/publish-npm.yml +83 -0
- package/dist/schemas/main.schema.d.ts +21 -16
- package/dist/schemas/tool-call.schema.d.ts +17 -1
- package/dist/schemas/tool-call.schema.js +8 -2
- package/dist/schemas/workflow-transition.schema.d.ts +64 -11
- package/dist/schemas/workflow-transition.schema.js +16 -6
- package/dist/schemas/workflow.schema.d.ts +21 -16
- package/dist/schemas/workflow.schema.js +1 -1
- package/dist/types/interfaces/document-item.interface.d.ts +1 -1
- package/dist/types/interfaces/pipeline-config.interface.d.ts +1 -1
- package/dist/types/interfaces/transition-info.interface.d.ts +1 -1
- package/dist/types/interfaces/workflow.interface.d.ts +1 -1
- package/dist/types/types/tool-call.type.d.ts +2 -2
- package/dist/types/types/workflow-transition.type.d.ts +2 -2
- package/package.json +10 -5
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
name: 'Publish to NPM Workflow'
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*.*.*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
name: 'Build & Publish to NPM'
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
timeout-minutes: 15
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write
|
|
15
|
+
id-token: write
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout Code
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
with:
|
|
20
|
+
fetch-depth: 0
|
|
21
|
+
|
|
22
|
+
- name: Check if tag is on main branch
|
|
23
|
+
run: |
|
|
24
|
+
git fetch origin main
|
|
25
|
+
if ! git branch -r --contains ${{ github.ref }} | grep -q 'origin/main'; then
|
|
26
|
+
echo "❌ Tag is not on main branch"
|
|
27
|
+
exit 1
|
|
28
|
+
fi
|
|
29
|
+
echo "✅ Tag is on main branch"
|
|
30
|
+
|
|
31
|
+
- name: Setup Node.js
|
|
32
|
+
uses: actions/setup-node@v4
|
|
33
|
+
with:
|
|
34
|
+
node-version: '20'
|
|
35
|
+
cache: 'npm'
|
|
36
|
+
registry-url: 'https://registry.npmjs.org'
|
|
37
|
+
|
|
38
|
+
- name: Extract Package Version
|
|
39
|
+
id: package
|
|
40
|
+
run: |
|
|
41
|
+
echo "name=$(node -p "require('./package.json').name")" >> $GITHUB_OUTPUT
|
|
42
|
+
echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
|
|
43
|
+
|
|
44
|
+
- name: Validate Version Matches Tag
|
|
45
|
+
run: |
|
|
46
|
+
TAG_VERSION=${GITHUB_REF#refs/tags/v}
|
|
47
|
+
PKG_VERSION=${{ steps.package.outputs.version }}
|
|
48
|
+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
|
|
49
|
+
echo "❌ Tag version ($TAG_VERSION) does not match package.json version ($PKG_VERSION)"
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
echo "✅ Versions match"
|
|
53
|
+
|
|
54
|
+
- name: Install Dependencies
|
|
55
|
+
run: npm ci
|
|
56
|
+
|
|
57
|
+
- name: Build Package
|
|
58
|
+
run: npm run build --if-present
|
|
59
|
+
|
|
60
|
+
- name: Publish to NPM
|
|
61
|
+
run: npm publish --access public
|
|
62
|
+
env:
|
|
63
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
64
|
+
|
|
65
|
+
- name: Create GitHub Release
|
|
66
|
+
uses: softprops/action-gh-release@v2
|
|
67
|
+
if: success()
|
|
68
|
+
with:
|
|
69
|
+
tag_name: ${{ github.ref_name }}
|
|
70
|
+
body: |
|
|
71
|
+
## 📦 NPM Package
|
|
72
|
+
|
|
73
|
+
**Package:** [${{ steps.package.outputs.name }}](https://www.npmjs.com/package/${{ steps.package.outputs.name }}/v/${{ steps.package.outputs.version }})
|
|
74
|
+
**Version:** ${{ steps.package.outputs.version }}
|
|
75
|
+
|
|
76
|
+
Install with:
|
|
77
|
+
```bash
|
|
78
|
+
npm install ${{ steps.package.outputs.name }}@${{ steps.package.outputs.version }}
|
|
79
|
+
```
|
|
80
|
+
draft: false
|
|
81
|
+
prerelease: false
|
|
82
|
+
env:
|
|
83
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -585,9 +585,10 @@ export declare const BlockConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodOb
|
|
|
585
585
|
type: z.ZodDefault<z.ZodLiteral<"workflow">>;
|
|
586
586
|
transitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
587
587
|
id: z.ZodString;
|
|
588
|
-
from: z.
|
|
589
|
-
to: z.
|
|
590
|
-
|
|
588
|
+
from: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
589
|
+
to: z.ZodString;
|
|
590
|
+
if: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodLiteral<"true">, z.ZodLiteral<"false">]>>;
|
|
591
|
+
trigger: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["manual", "onEntry"]>, z.ZodString]>>;
|
|
591
592
|
call: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
592
593
|
id: z.ZodOptional<z.ZodString>;
|
|
593
594
|
tool: z.ZodString;
|
|
@@ -605,11 +606,12 @@ export declare const BlockConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodOb
|
|
|
605
606
|
assign?: Record<string, string | number | boolean | Record<string, any> | null> | undefined;
|
|
606
607
|
}>, "many">>;
|
|
607
608
|
onError: z.ZodOptional<z.ZodString>;
|
|
608
|
-
}, "
|
|
609
|
+
}, "strict", z.ZodTypeAny, {
|
|
609
610
|
id: string;
|
|
610
|
-
from
|
|
611
|
-
to
|
|
612
|
-
|
|
611
|
+
from: string | string[];
|
|
612
|
+
to: string;
|
|
613
|
+
if?: string | undefined;
|
|
614
|
+
trigger?: string | undefined;
|
|
613
615
|
call?: {
|
|
614
616
|
tool: string;
|
|
615
617
|
id?: string | undefined;
|
|
@@ -619,9 +621,10 @@ export declare const BlockConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodOb
|
|
|
619
621
|
onError?: string | undefined;
|
|
620
622
|
}, {
|
|
621
623
|
id: string;
|
|
622
|
-
from
|
|
623
|
-
to
|
|
624
|
-
|
|
624
|
+
from: string | string[];
|
|
625
|
+
to: string;
|
|
626
|
+
if?: string | undefined;
|
|
627
|
+
trigger?: string | undefined;
|
|
625
628
|
call?: {
|
|
626
629
|
tool: string;
|
|
627
630
|
id?: string | undefined;
|
|
@@ -659,9 +662,10 @@ export declare const BlockConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodOb
|
|
|
659
662
|
} | undefined;
|
|
660
663
|
transitions?: {
|
|
661
664
|
id: string;
|
|
662
|
-
from
|
|
663
|
-
to
|
|
664
|
-
|
|
665
|
+
from: string | string[];
|
|
666
|
+
to: string;
|
|
667
|
+
if?: string | undefined;
|
|
668
|
+
trigger?: string | undefined;
|
|
665
669
|
call?: {
|
|
666
670
|
tool: string;
|
|
667
671
|
id?: string | undefined;
|
|
@@ -699,9 +703,10 @@ export declare const BlockConfigSchema: z.ZodDiscriminatedUnion<"type", [z.ZodOb
|
|
|
699
703
|
} | undefined;
|
|
700
704
|
transitions?: {
|
|
701
705
|
id: string;
|
|
702
|
-
from
|
|
703
|
-
to
|
|
704
|
-
|
|
706
|
+
from: string | string[];
|
|
707
|
+
to: string;
|
|
708
|
+
if?: string | undefined;
|
|
709
|
+
trigger?: string | undefined;
|
|
705
710
|
call?: {
|
|
706
711
|
tool: string;
|
|
707
712
|
id?: string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const ToolCallConfigSchema: z.ZodObject<{
|
|
3
3
|
id: z.ZodOptional<z.ZodString>;
|
|
4
4
|
tool: z.ZodString;
|
|
5
5
|
args: z.ZodOptional<z.ZodAny>;
|
|
@@ -15,3 +15,19 @@ export declare const ToolCallSchema: z.ZodObject<{
|
|
|
15
15
|
args?: any;
|
|
16
16
|
assign?: Record<string, string | number | boolean | Record<string, any> | null> | undefined;
|
|
17
17
|
}>;
|
|
18
|
+
export declare const ToolCallSchema: z.ZodObject<{
|
|
19
|
+
id: z.ZodOptional<z.ZodString>;
|
|
20
|
+
tool: z.ZodString;
|
|
21
|
+
args: z.ZodOptional<z.ZodAny>;
|
|
22
|
+
assign: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNull, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodAny>]>>>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
tool: string;
|
|
25
|
+
id?: string | undefined;
|
|
26
|
+
args?: any;
|
|
27
|
+
assign?: Record<string, string | number | boolean | Record<string, any> | null> | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
tool: string;
|
|
30
|
+
id?: string | undefined;
|
|
31
|
+
args?: any;
|
|
32
|
+
assign?: Record<string, string | number | boolean | Record<string, any> | null> | undefined;
|
|
33
|
+
}>;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ToolCallSchema = void 0;
|
|
3
|
+
exports.ToolCallSchema = exports.ToolCallConfigSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const assignment_schema_1 = require("./assignment.schema");
|
|
6
|
-
exports.
|
|
6
|
+
exports.ToolCallConfigSchema = zod_1.z.object({
|
|
7
7
|
id: zod_1.z.string().optional(),
|
|
8
8
|
tool: zod_1.z.string(),
|
|
9
9
|
args: zod_1.z.any().optional(),
|
|
10
10
|
assign: assignment_schema_1.AssignmentConfigSchema.optional(),
|
|
11
11
|
});
|
|
12
|
+
exports.ToolCallSchema = zod_1.z.object({
|
|
13
|
+
id: zod_1.z.string().optional(),
|
|
14
|
+
tool: zod_1.z.string(),
|
|
15
|
+
args: zod_1.z.any().optional(),
|
|
16
|
+
assign: assignment_schema_1.AssignmentSchema.optional(),
|
|
17
|
+
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const WorkflowTransitionConfigSchema: z.ZodObject<{
|
|
3
3
|
id: z.ZodString;
|
|
4
|
-
from: z.
|
|
5
|
-
to: z.
|
|
6
|
-
|
|
4
|
+
from: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
5
|
+
to: z.ZodString;
|
|
6
|
+
if: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodLiteral<"true">, z.ZodLiteral<"false">]>>;
|
|
7
|
+
trigger: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["manual", "onEntry"]>, z.ZodString]>>;
|
|
7
8
|
call: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
8
9
|
id: z.ZodOptional<z.ZodString>;
|
|
9
10
|
tool: z.ZodString;
|
|
@@ -21,11 +22,62 @@ export declare const WorkflowTransitionSchema: z.ZodObject<{
|
|
|
21
22
|
assign?: Record<string, string | number | boolean | Record<string, any> | null> | undefined;
|
|
22
23
|
}>, "many">>;
|
|
23
24
|
onError: z.ZodOptional<z.ZodString>;
|
|
24
|
-
}, "
|
|
25
|
+
}, "strict", z.ZodTypeAny, {
|
|
26
|
+
id: string;
|
|
27
|
+
from: string | string[];
|
|
28
|
+
to: string;
|
|
29
|
+
if?: string | undefined;
|
|
30
|
+
trigger?: string | undefined;
|
|
31
|
+
call?: {
|
|
32
|
+
tool: string;
|
|
33
|
+
id?: string | undefined;
|
|
34
|
+
args?: any;
|
|
35
|
+
assign?: Record<string, string | number | boolean | Record<string, any> | null> | undefined;
|
|
36
|
+
}[] | undefined;
|
|
37
|
+
onError?: string | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
id: string;
|
|
40
|
+
from: string | string[];
|
|
41
|
+
to: string;
|
|
42
|
+
if?: string | undefined;
|
|
43
|
+
trigger?: string | undefined;
|
|
44
|
+
call?: {
|
|
45
|
+
tool: string;
|
|
46
|
+
id?: string | undefined;
|
|
47
|
+
args?: any;
|
|
48
|
+
assign?: Record<string, string | number | boolean | Record<string, any> | null> | undefined;
|
|
49
|
+
}[] | undefined;
|
|
50
|
+
onError?: string | undefined;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const WorkflowTransitionSchema: z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
from: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
55
|
+
to: z.ZodString;
|
|
56
|
+
if: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"true">, z.ZodLiteral<"false">]>>;
|
|
57
|
+
trigger: z.ZodOptional<z.ZodEnum<["manual", "onEntry"]>>;
|
|
58
|
+
call: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
59
|
+
id: z.ZodOptional<z.ZodString>;
|
|
60
|
+
tool: z.ZodString;
|
|
61
|
+
args: z.ZodOptional<z.ZodAny>;
|
|
62
|
+
assign: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNull, z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodAny>]>>>;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
tool: string;
|
|
65
|
+
id?: string | undefined;
|
|
66
|
+
args?: any;
|
|
67
|
+
assign?: Record<string, string | number | boolean | Record<string, any> | null> | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
tool: string;
|
|
70
|
+
id?: string | undefined;
|
|
71
|
+
args?: any;
|
|
72
|
+
assign?: Record<string, string | number | boolean | Record<string, any> | null> | undefined;
|
|
73
|
+
}>, "many">>;
|
|
74
|
+
onError: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, "strict", z.ZodTypeAny, {
|
|
25
76
|
id: string;
|
|
26
|
-
from
|
|
27
|
-
to
|
|
28
|
-
|
|
77
|
+
from: string | string[];
|
|
78
|
+
to: string;
|
|
79
|
+
if?: string | undefined;
|
|
80
|
+
trigger?: "manual" | "onEntry" | undefined;
|
|
29
81
|
call?: {
|
|
30
82
|
tool: string;
|
|
31
83
|
id?: string | undefined;
|
|
@@ -35,9 +87,10 @@ export declare const WorkflowTransitionSchema: z.ZodObject<{
|
|
|
35
87
|
onError?: string | undefined;
|
|
36
88
|
}, {
|
|
37
89
|
id: string;
|
|
38
|
-
from
|
|
39
|
-
to
|
|
40
|
-
|
|
90
|
+
from: string | string[];
|
|
91
|
+
to: string;
|
|
92
|
+
if?: string | undefined;
|
|
93
|
+
trigger?: "manual" | "onEntry" | undefined;
|
|
41
94
|
call?: {
|
|
42
95
|
tool: string;
|
|
43
96
|
id?: string | undefined;
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WorkflowTransitionSchema = void 0;
|
|
3
|
+
exports.WorkflowTransitionSchema = exports.WorkflowTransitionConfigSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const tool_call_schema_1 = require("./tool-call.schema");
|
|
6
6
|
const template_expression_schema_1 = require("./template-expression.schema");
|
|
7
|
-
exports.
|
|
7
|
+
exports.WorkflowTransitionConfigSchema = zod_1.z.object({
|
|
8
8
|
id: zod_1.z.string(),
|
|
9
|
-
from: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())])
|
|
10
|
-
to: zod_1.z.
|
|
11
|
-
|
|
9
|
+
from: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]),
|
|
10
|
+
to: zod_1.z.string(),
|
|
11
|
+
if: zod_1.z.union([template_expression_schema_1.TemplateExpression, zod_1.z.string(), zod_1.z.literal('true'), zod_1.z.literal('false')]).optional(),
|
|
12
|
+
trigger: zod_1.z.union([
|
|
12
13
|
zod_1.z.enum(["manual", "onEntry"]),
|
|
13
14
|
template_expression_schema_1.TemplateExpression,
|
|
14
15
|
]).optional(),
|
|
16
|
+
call: zod_1.z.array(tool_call_schema_1.ToolCallConfigSchema).optional(),
|
|
17
|
+
onError: zod_1.z.string().optional(),
|
|
18
|
+
}).strict();
|
|
19
|
+
exports.WorkflowTransitionSchema = zod_1.z.object({
|
|
20
|
+
id: zod_1.z.string(),
|
|
21
|
+
from: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]),
|
|
22
|
+
to: zod_1.z.string(),
|
|
23
|
+
if: zod_1.z.union([zod_1.z.string(), zod_1.z.literal('true'), zod_1.z.literal('false')]).optional(),
|
|
24
|
+
trigger: zod_1.z.enum(["manual", "onEntry"]).optional(),
|
|
15
25
|
call: zod_1.z.array(tool_call_schema_1.ToolCallSchema).optional(),
|
|
16
26
|
onError: zod_1.z.string().optional(),
|
|
17
|
-
});
|
|
27
|
+
}).strict();
|
|
@@ -311,9 +311,10 @@ export declare const WorkflowSchema: z.ZodObject<{
|
|
|
311
311
|
type: z.ZodDefault<z.ZodLiteral<"workflow">>;
|
|
312
312
|
transitions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
313
313
|
id: z.ZodString;
|
|
314
|
-
from: z.
|
|
315
|
-
to: z.
|
|
316
|
-
|
|
314
|
+
from: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
315
|
+
to: z.ZodString;
|
|
316
|
+
if: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString, z.ZodLiteral<"true">, z.ZodLiteral<"false">]>>;
|
|
317
|
+
trigger: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["manual", "onEntry"]>, z.ZodString]>>;
|
|
317
318
|
call: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
318
319
|
id: z.ZodOptional<z.ZodString>;
|
|
319
320
|
tool: z.ZodString;
|
|
@@ -331,11 +332,12 @@ export declare const WorkflowSchema: z.ZodObject<{
|
|
|
331
332
|
assign?: Record<string, string | number | boolean | Record<string, any> | null> | undefined;
|
|
332
333
|
}>, "many">>;
|
|
333
334
|
onError: z.ZodOptional<z.ZodString>;
|
|
334
|
-
}, "
|
|
335
|
+
}, "strict", z.ZodTypeAny, {
|
|
335
336
|
id: string;
|
|
336
|
-
from
|
|
337
|
-
to
|
|
338
|
-
|
|
337
|
+
from: string | string[];
|
|
338
|
+
to: string;
|
|
339
|
+
if?: string | undefined;
|
|
340
|
+
trigger?: string | undefined;
|
|
339
341
|
call?: {
|
|
340
342
|
tool: string;
|
|
341
343
|
id?: string | undefined;
|
|
@@ -345,9 +347,10 @@ export declare const WorkflowSchema: z.ZodObject<{
|
|
|
345
347
|
onError?: string | undefined;
|
|
346
348
|
}, {
|
|
347
349
|
id: string;
|
|
348
|
-
from
|
|
349
|
-
to
|
|
350
|
-
|
|
350
|
+
from: string | string[];
|
|
351
|
+
to: string;
|
|
352
|
+
if?: string | undefined;
|
|
353
|
+
trigger?: string | undefined;
|
|
351
354
|
call?: {
|
|
352
355
|
tool: string;
|
|
353
356
|
id?: string | undefined;
|
|
@@ -385,9 +388,10 @@ export declare const WorkflowSchema: z.ZodObject<{
|
|
|
385
388
|
} | undefined;
|
|
386
389
|
transitions?: {
|
|
387
390
|
id: string;
|
|
388
|
-
from
|
|
389
|
-
to
|
|
390
|
-
|
|
391
|
+
from: string | string[];
|
|
392
|
+
to: string;
|
|
393
|
+
if?: string | undefined;
|
|
394
|
+
trigger?: string | undefined;
|
|
391
395
|
call?: {
|
|
392
396
|
tool: string;
|
|
393
397
|
id?: string | undefined;
|
|
@@ -425,9 +429,10 @@ export declare const WorkflowSchema: z.ZodObject<{
|
|
|
425
429
|
} | undefined;
|
|
426
430
|
transitions?: {
|
|
427
431
|
id: string;
|
|
428
|
-
from
|
|
429
|
-
to
|
|
430
|
-
|
|
432
|
+
from: string | string[];
|
|
433
|
+
to: string;
|
|
434
|
+
if?: string | undefined;
|
|
435
|
+
trigger?: string | undefined;
|
|
431
436
|
call?: {
|
|
432
437
|
tool: string;
|
|
433
438
|
id?: string | undefined;
|
|
@@ -15,5 +15,5 @@ exports.WorkflowBaseSchema = block_schema_1.BlockSchema.extend({
|
|
|
15
15
|
});
|
|
16
16
|
exports.WorkflowSchema = exports.WorkflowBaseSchema.extend({
|
|
17
17
|
type: zod_1.z.literal('workflow').default('workflow'),
|
|
18
|
-
transitions: zod_1.z.array(workflow_transition_schema_1.
|
|
18
|
+
transitions: zod_1.z.array(workflow_transition_schema_1.WorkflowTransitionConfigSchema).optional(),
|
|
19
19
|
});
|
|
@@ -5,7 +5,7 @@ import { UiFormType } from '../types/ui-form.type';
|
|
|
5
5
|
import { WorkflowTransitionType } from '../types/workflow-transition.type';
|
|
6
6
|
export interface WorkflowInterface {
|
|
7
7
|
id: string;
|
|
8
|
-
|
|
8
|
+
blockName: string;
|
|
9
9
|
title: string;
|
|
10
10
|
index: number;
|
|
11
11
|
labels: string[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export type ToolCallType = z.infer<typeof
|
|
2
|
+
import { ToolCallConfigSchema } from '../../schemas';
|
|
3
|
+
export type ToolCallType = z.infer<typeof ToolCallConfigSchema>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export type WorkflowTransitionType = z.infer<typeof
|
|
2
|
+
import { WorkflowTransitionConfigSchema } from '../../schemas';
|
|
3
|
+
export type WorkflowTransitionType = z.infer<typeof WorkflowTransitionConfigSchema>;
|
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.16.0",
|
|
6
6
|
"license": "BSL",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Jakob Klippel",
|
|
@@ -26,15 +26,20 @@
|
|
|
26
26
|
},
|
|
27
27
|
"typesVersions": {
|
|
28
28
|
"*": {
|
|
29
|
-
"types": [
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
"types": [
|
|
30
|
+
"./dist/types/index.d.ts"
|
|
31
|
+
],
|
|
32
|
+
"enums": [
|
|
33
|
+
"./dist/enums/index.d.ts"
|
|
34
|
+
],
|
|
35
|
+
"schemas": [
|
|
36
|
+
"./dist/schemas/index.d.ts"
|
|
37
|
+
]
|
|
32
38
|
}
|
|
33
39
|
},
|
|
34
40
|
"scripts": {
|
|
35
41
|
"build": "tsc -p tsconfig.json",
|
|
36
42
|
"watch": "tsc --watch",
|
|
37
|
-
"prepare": "npm run build",
|
|
38
43
|
"compile": "tsc --noEmit"
|
|
39
44
|
},
|
|
40
45
|
"peerDependencies": {
|