@loopstack/contracts 0.28.0 → 0.29.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.
@@ -6,6 +6,7 @@ export * from './tool-config.type.js';
6
6
  export * from './transition-payload.type.js';
7
7
  export * from './ui-form.type.js';
8
8
  export * from './ui-element.type.js';
9
+ export * from './ui-message.type.js';
9
10
  export * from './ui-properties.type.js';
10
11
  export * from './workflow.type.js';
11
12
  export * from './workflow-transition.type.js';
@@ -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,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,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,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC"}
@@ -22,6 +22,7 @@ __exportStar(require("./tool-config.type.js"), exports);
22
22
  __exportStar(require("./transition-payload.type.js"), exports);
23
23
  __exportStar(require("./ui-form.type.js"), exports);
24
24
  __exportStar(require("./ui-element.type.js"), exports);
25
+ __exportStar(require("./ui-message.type.js"), exports);
25
26
  __exportStar(require("./ui-properties.type.js"), exports);
26
27
  __exportStar(require("./workflow.type.js"), exports);
27
28
  __exportStar(require("./workflow-transition.type.js"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,qDAAmC;AACnC,oDAAkC;AAClC,sDAAoC;AACpC,wDAAsC;AACtC,+DAA6C;AAC7C,oDAAkC;AAClC,uDAAqC;AACrC,0DAAwC;AACxC,qDAAmC;AACnC,gEAA8C;AAC9C,sDAAoC;AACpC,+DAA6C;AAC7C,iDAA+B;AAC/B,2DAAyC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,qDAAmC;AACnC,oDAAkC;AAClC,sDAAoC;AACpC,wDAAsC;AACtC,+DAA6C;AAC7C,oDAAkC;AAClC,uDAAqC;AACrC,uDAAqC;AACrC,0DAAwC;AACxC,qDAAmC;AACnC,gEAA8C;AAC9C,sDAAoC;AACpC,+DAA6C;AAC7C,iDAA+B;AAC/B,2DAAyC"}
@@ -0,0 +1,99 @@
1
+ import { z } from 'zod';
2
+ export declare const UITextBlockSchema: z.ZodObject<{
3
+ type: z.ZodLiteral<"text">;
4
+ text: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export type UITextBlock = z.infer<typeof UITextBlockSchema>;
7
+ export declare const UIThinkingBlockSchema: z.ZodObject<{
8
+ type: z.ZodLiteral<"thinking">;
9
+ text: z.ZodString;
10
+ }, z.core.$strip>;
11
+ export type UIThinkingBlock = z.infer<typeof UIThinkingBlockSchema>;
12
+ export declare const UIToolCallBlockSchema: z.ZodObject<{
13
+ type: z.ZodLiteral<"tool_call">;
14
+ id: z.ZodString;
15
+ name: z.ZodString;
16
+ args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
17
+ }, z.core.$strip>;
18
+ export type UIToolCallBlock = z.infer<typeof UIToolCallBlockSchema>;
19
+ export declare const UIServerToolUseBlockSchema: z.ZodObject<{
20
+ type: z.ZodLiteral<"server_tool_use">;
21
+ id: z.ZodString;
22
+ name: z.ZodString;
23
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
24
+ }, z.core.$strip>;
25
+ export type UIServerToolUseBlock = z.infer<typeof UIServerToolUseBlockSchema>;
26
+ export declare const UIServerToolResultBlockSchema: z.ZodObject<{
27
+ type: z.ZodLiteral<"server_tool_result">;
28
+ toolUseId: z.ZodString;
29
+ content: z.ZodUnknown;
30
+ }, z.core.$strip>;
31
+ export type UIServerToolResultBlock = z.infer<typeof UIServerToolResultBlockSchema>;
32
+ export declare const UIToolResultBlockSchema: z.ZodObject<{
33
+ type: z.ZodLiteral<"tool_result">;
34
+ toolCallId: z.ZodString;
35
+ content: z.ZodString;
36
+ isError: z.ZodBoolean;
37
+ }, z.core.$strip>;
38
+ export type UIToolResultBlock = z.infer<typeof UIToolResultBlockSchema>;
39
+ export declare const UIContentBlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
40
+ type: z.ZodLiteral<"text">;
41
+ text: z.ZodString;
42
+ }, z.core.$strip>, z.ZodObject<{
43
+ type: z.ZodLiteral<"thinking">;
44
+ text: z.ZodString;
45
+ }, z.core.$strip>, z.ZodObject<{
46
+ type: z.ZodLiteral<"tool_call">;
47
+ id: z.ZodString;
48
+ name: z.ZodString;
49
+ args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
50
+ }, z.core.$strip>, z.ZodObject<{
51
+ type: z.ZodLiteral<"server_tool_use">;
52
+ id: z.ZodString;
53
+ name: z.ZodString;
54
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ type: z.ZodLiteral<"server_tool_result">;
57
+ toolUseId: z.ZodString;
58
+ content: z.ZodUnknown;
59
+ }, z.core.$strip>, z.ZodObject<{
60
+ type: z.ZodLiteral<"tool_result">;
61
+ toolCallId: z.ZodString;
62
+ content: z.ZodString;
63
+ isError: z.ZodBoolean;
64
+ }, z.core.$strip>], "type">;
65
+ export type UIContentBlock = z.infer<typeof UIContentBlockSchema>;
66
+ export declare const UIMessageSchema: z.ZodObject<{
67
+ role: z.ZodEnum<{
68
+ user: "user";
69
+ assistant: "assistant";
70
+ }>;
71
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
72
+ type: z.ZodLiteral<"text">;
73
+ text: z.ZodString;
74
+ }, z.core.$strip>, z.ZodObject<{
75
+ type: z.ZodLiteral<"thinking">;
76
+ text: z.ZodString;
77
+ }, z.core.$strip>, z.ZodObject<{
78
+ type: z.ZodLiteral<"tool_call">;
79
+ id: z.ZodString;
80
+ name: z.ZodString;
81
+ args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
82
+ }, z.core.$strip>, z.ZodObject<{
83
+ type: z.ZodLiteral<"server_tool_use">;
84
+ id: z.ZodString;
85
+ name: z.ZodString;
86
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
87
+ }, z.core.$strip>, z.ZodObject<{
88
+ type: z.ZodLiteral<"server_tool_result">;
89
+ toolUseId: z.ZodString;
90
+ content: z.ZodUnknown;
91
+ }, z.core.$strip>, z.ZodObject<{
92
+ type: z.ZodLiteral<"tool_result">;
93
+ toolCallId: z.ZodString;
94
+ content: z.ZodString;
95
+ isError: z.ZodBoolean;
96
+ }, z.core.$strip>], "type">>]>;
97
+ }, z.core.$strip>;
98
+ export type UIMessage = z.infer<typeof UIMessageSchema>;
99
+ //# sourceMappingURL=ui-message.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-message.type.d.ts","sourceRoot":"","sources":["../../../src/types/types/ui-message.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,iBAAiB;;;iBAA0D,CAAC;AACzF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,qBAAqB;;;iBAA8D,CAAC;AACjG,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,qBAAqB;;;;;iBAKhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,0BAA0B;;;;;iBAKrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,6BAA6B;;;;iBAIxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,uBAAuB;;;;;iBAKlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAMxE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;2BAO/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAMlE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UIMessageSchema = exports.UIContentBlockSchema = exports.UIToolResultBlockSchema = exports.UIServerToolResultBlockSchema = exports.UIServerToolUseBlockSchema = exports.UIToolCallBlockSchema = exports.UIThinkingBlockSchema = exports.UITextBlockSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.UITextBlockSchema = zod_1.z.object({ type: zod_1.z.literal('text'), text: zod_1.z.string() });
6
+ exports.UIThinkingBlockSchema = zod_1.z.object({ type: zod_1.z.literal('thinking'), text: zod_1.z.string() });
7
+ exports.UIToolCallBlockSchema = zod_1.z.object({
8
+ type: zod_1.z.literal('tool_call'),
9
+ id: zod_1.z.string(),
10
+ name: zod_1.z.string(),
11
+ args: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
12
+ });
13
+ exports.UIServerToolUseBlockSchema = zod_1.z.object({
14
+ type: zod_1.z.literal('server_tool_use'),
15
+ id: zod_1.z.string(),
16
+ name: zod_1.z.string(),
17
+ input: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
18
+ });
19
+ exports.UIServerToolResultBlockSchema = zod_1.z.object({
20
+ type: zod_1.z.literal('server_tool_result'),
21
+ toolUseId: zod_1.z.string(),
22
+ content: zod_1.z.unknown(),
23
+ });
24
+ exports.UIToolResultBlockSchema = zod_1.z.object({
25
+ type: zod_1.z.literal('tool_result'),
26
+ toolCallId: zod_1.z.string(),
27
+ content: zod_1.z.string(),
28
+ isError: zod_1.z.boolean(),
29
+ });
30
+ exports.UIContentBlockSchema = zod_1.z.discriminatedUnion('type', [
31
+ exports.UITextBlockSchema,
32
+ exports.UIThinkingBlockSchema,
33
+ exports.UIToolCallBlockSchema,
34
+ exports.UIServerToolUseBlockSchema,
35
+ exports.UIServerToolResultBlockSchema,
36
+ exports.UIToolResultBlockSchema,
37
+ ]);
38
+ exports.UIMessageSchema = zod_1.z.object({
39
+ role: zod_1.z.enum(['user', 'assistant']),
40
+ content: zod_1.z.union([zod_1.z.string(), zod_1.z.array(exports.UIContentBlockSchema)]),
41
+ });
42
+ //# sourceMappingURL=ui-message.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-message.type.js","sourceRoot":"","sources":["../../../src/types/types/ui-message.type.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAMX,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAG5E,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAGpF,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IAC5B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC;CACxC,CAAC,CAAC;AAGU,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC;IAClC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC;CACzC,CAAC,CAAC;AAGU,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IACrC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE;CACrB,CAAC,CAAC;AAGU,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC9B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;IACtB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE;CACrB,CAAC,CAAC;AAOU,QAAA,oBAAoB,GAAG,OAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC/D,yBAAiB;IACjB,6BAAqB;IACrB,6BAAqB;IACrB,kCAA0B;IAC1B,qCAA6B;IAC7B,+BAAuB;CACxB,CAAC,CAAC;AAOU,QAAA,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACnC,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,KAAK,CAAC,4BAAoB,CAAC,CAAC,CAAC;CAC9D,CAAC,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.28.0",
5
+ "version": "0.29.0",
6
6
  "license": "MIT",
7
7
  "author": {
8
8
  "name": "Jakob Klippel",