@loopstack/contracts 0.16.0 → 0.16.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.
@@ -53,7 +53,7 @@ jobs:
53
53
 
54
54
  - name: Install Dependencies
55
55
  run: npm ci
56
-
56
+
57
57
  - name: Build Package
58
58
  run: npm run build --if-present
59
59
 
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env sh
2
+
3
+ npx lint-staged
@@ -0,0 +1,15 @@
1
+ # Build output
2
+ dist
3
+
4
+ # Dependencies
5
+ node_modules
6
+
7
+ # Lock files
8
+ pnpm-lock.yaml
9
+
10
+ # Minified files
11
+ *.min.js
12
+ *.min.css
13
+
14
+ # Auto-generated
15
+ src/components/ui
@@ -2,17 +2,15 @@ export declare enum RegistryEntryStatus {
2
2
  DRAFT = "draft",
3
3
  PENDING = "pending",
4
4
  ACTIVE = "active",
5
- INACTIVE = "inactive"
5
+ INACTIVE = "inactive",
6
+ PREVIEW = "preview"
6
7
  }
7
8
  export declare enum RegistryEntryCategory {
8
- FULL_AUTOMATIONS = "full-automations",
9
9
  TOOLS = "tools",
10
- WORKFLOWS = "workflows",
11
- DEMOS_AND_TESTS = "demos-and-tests",
12
- EXPERIMENTAL = "experimental",
13
- STARTER_TEMPLATES = "starter-templates",
14
- INTEGRATIONS = "integrations",
15
- AGENTS = "agents"
10
+ EXAMPLES = "examples",
11
+ BUNDLES = "bundles",
12
+ MODULES = "modules",
13
+ INTEGRATIONS = "integrations"
16
14
  }
17
15
  export type RegistryCategory = `${RegistryEntryCategory}`;
18
16
  export declare const REGISTRY_CATEGORIES: RegistryCategory[];
@@ -7,25 +7,20 @@ var RegistryEntryStatus;
7
7
  RegistryEntryStatus["PENDING"] = "pending";
8
8
  RegistryEntryStatus["ACTIVE"] = "active";
9
9
  RegistryEntryStatus["INACTIVE"] = "inactive";
10
+ RegistryEntryStatus["PREVIEW"] = "preview";
10
11
  })(RegistryEntryStatus || (exports.RegistryEntryStatus = RegistryEntryStatus = {}));
11
12
  var RegistryEntryCategory;
12
13
  (function (RegistryEntryCategory) {
13
- RegistryEntryCategory["FULL_AUTOMATIONS"] = "full-automations";
14
14
  RegistryEntryCategory["TOOLS"] = "tools";
15
- RegistryEntryCategory["WORKFLOWS"] = "workflows";
16
- RegistryEntryCategory["DEMOS_AND_TESTS"] = "demos-and-tests";
17
- RegistryEntryCategory["EXPERIMENTAL"] = "experimental";
18
- RegistryEntryCategory["STARTER_TEMPLATES"] = "starter-templates";
15
+ RegistryEntryCategory["EXAMPLES"] = "examples";
16
+ RegistryEntryCategory["BUNDLES"] = "bundles";
17
+ RegistryEntryCategory["MODULES"] = "modules";
19
18
  RegistryEntryCategory["INTEGRATIONS"] = "integrations";
20
- RegistryEntryCategory["AGENTS"] = "agents";
21
19
  })(RegistryEntryCategory || (exports.RegistryEntryCategory = RegistryEntryCategory = {}));
22
20
  exports.REGISTRY_CATEGORIES = [
23
- RegistryEntryCategory.FULL_AUTOMATIONS,
24
21
  RegistryEntryCategory.TOOLS,
25
- RegistryEntryCategory.WORKFLOWS,
26
- RegistryEntryCategory.DEMOS_AND_TESTS,
27
- RegistryEntryCategory.EXPERIMENTAL,
28
- RegistryEntryCategory.STARTER_TEMPLATES,
22
+ RegistryEntryCategory.EXAMPLES,
23
+ RegistryEntryCategory.BUNDLES,
24
+ RegistryEntryCategory.MODULES,
29
25
  RegistryEntryCategory.INTEGRATIONS,
30
- RegistryEntryCategory.AGENTS,
31
26
  ];
@@ -2,54 +2,40 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DocumentMessageSchema = exports.DocumentMessageContentSchema = exports.DocumentSchema = exports.DocumentConfigSchema = exports.MimeTypeSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const template_expression_schema_1 = require("./template-expression.schema");
6
5
  const block_schema_1 = require("./block.schema");
6
+ const template_expression_schema_1 = require("./template-expression.schema");
7
7
  const ui_form_schema_1 = require("./ui-form.schema");
8
8
  exports.MimeTypeSchema = zod_1.z.enum([
9
- "text/plain",
10
- "text/html",
11
- "text/css",
12
- "text/xml",
13
- "text/markdown",
14
- "application/javascript",
15
- "application/typescript",
16
- "application/json",
17
- "application/xml",
18
- "application/yaml",
9
+ 'text/plain',
10
+ 'text/html',
11
+ 'text/css',
12
+ 'text/xml',
13
+ 'text/markdown',
14
+ 'application/javascript',
15
+ 'application/typescript',
16
+ 'application/json',
17
+ 'application/xml',
18
+ 'application/yaml',
19
19
  ]);
20
20
  exports.DocumentConfigSchema = block_schema_1.BlockSchema.extend({
21
21
  type: zod_1.z.literal('document').default('document').optional(),
22
22
  description: zod_1.z.string().optional(),
23
23
  content: zod_1.z.any().optional(),
24
24
  ui: ui_form_schema_1.UiFormSchema.optional(),
25
- tags: zod_1.z.union([
26
- template_expression_schema_1.TemplateExpression,
27
- zod_1.z.array(zod_1.z.string()),
28
- ]).optional(),
29
- meta: zod_1.z.object({
30
- hidden: zod_1.z.union([
31
- zod_1.z.boolean(),
32
- template_expression_schema_1.TemplateExpression,
33
- ]).optional(),
34
- mimeType: zod_1.z.union([
35
- exports.MimeTypeSchema,
36
- template_expression_schema_1.TemplateExpression,
37
- ]).optional(),
38
- invalidate: zod_1.z.union([
39
- zod_1.z.boolean(),
40
- template_expression_schema_1.TemplateExpression,
41
- ]).optional(),
42
- level: zod_1.z.union([
43
- template_expression_schema_1.TemplateExpression,
44
- zod_1.z.literal('debug'),
45
- zod_1.z.literal('info'),
46
- zod_1.z.literal('warning'),
47
- zod_1.z.literal('error'),
48
- ]).optional(),
25
+ tags: zod_1.z.union([template_expression_schema_1.TemplateExpression, zod_1.z.array(zod_1.z.string())]).optional(),
26
+ meta: zod_1.z
27
+ .object({
28
+ hidden: zod_1.z.union([zod_1.z.boolean(), template_expression_schema_1.TemplateExpression]).optional(),
29
+ mimeType: zod_1.z.union([exports.MimeTypeSchema, template_expression_schema_1.TemplateExpression]).optional(),
30
+ invalidate: zod_1.z.union([zod_1.z.boolean(), template_expression_schema_1.TemplateExpression]).optional(),
31
+ level: zod_1.z
32
+ .union([template_expression_schema_1.TemplateExpression, zod_1.z.literal('debug'), zod_1.z.literal('info'), zod_1.z.literal('warning'), zod_1.z.literal('error')])
33
+ .optional(),
49
34
  enableAtPlaces: zod_1.z.array(zod_1.z.string()).optional(),
50
35
  hideAtPlaces: zod_1.z.array(zod_1.z.string()).optional(),
51
36
  data: zod_1.z.any().optional(),
52
- }).optional(),
37
+ })
38
+ .optional(),
53
39
  });
54
40
  exports.DocumentSchema = zod_1.z.object({
55
41
  type: zod_1.z.literal('document').default('document').optional(),
@@ -57,32 +43,31 @@ exports.DocumentSchema = zod_1.z.object({
57
43
  content: zod_1.z.any().optional(),
58
44
  ui: ui_form_schema_1.UiFormSchema.optional(),
59
45
  tags: zod_1.z.array(zod_1.z.string()).optional(),
60
- meta: zod_1.z.object({
46
+ meta: zod_1.z
47
+ .object({
61
48
  hidden: zod_1.z.boolean().optional(),
62
49
  mimeType: exports.MimeTypeSchema.optional(),
63
50
  invalidate: zod_1.z.boolean().optional(),
64
- level: zod_1.z.union([
65
- zod_1.z.literal('debug'),
66
- zod_1.z.literal('info'),
67
- zod_1.z.literal('warning'),
68
- zod_1.z.literal('error'),
69
- ]).optional(),
51
+ level: zod_1.z.union([zod_1.z.literal('debug'), zod_1.z.literal('info'), zod_1.z.literal('warning'), zod_1.z.literal('error')]).optional(),
70
52
  enableAtPlaces: zod_1.z.array(zod_1.z.string()).optional(),
71
53
  hideAtPlaces: zod_1.z.array(zod_1.z.string()).optional(),
72
54
  data: zod_1.z.any().optional(),
73
- }).optional(),
55
+ })
56
+ .optional(),
74
57
  });
75
58
  exports.DocumentMessageContentSchema = zod_1.z.object({
76
- role: zod_1.z.enum(["user", "assistant", "system"]),
59
+ role: zod_1.z.enum(['user', 'assistant', 'system']),
77
60
  content: zod_1.z.string().optional(),
78
- tool_calls: zod_1.z.array(zod_1.z.object({
61
+ tool_calls: zod_1.z
62
+ .array(zod_1.z.object({
79
63
  id: zod_1.z.string(),
80
64
  type: zod_1.z.string(),
81
65
  function: zod_1.z.object({
82
66
  name: zod_1.z.string(),
83
67
  arguments: zod_1.z.string().optional(),
84
- })
85
- })).optional(),
68
+ }),
69
+ }))
70
+ .optional(),
86
71
  animation: zod_1.z.string().optional(),
87
72
  icon: zod_1.z.string().optional(),
88
73
  });
@@ -4,10 +4,12 @@ exports.JSONSchemaType = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.JSONSchemaType = zod_1.z.lazy(() => zod_1.z.object({
6
6
  // Type validators
7
- type: zod_1.z.union([
8
- zod_1.z.enum(["string", "number", "integer", "boolean", "array", "object", "null", "any"]),
9
- zod_1.z.array(zod_1.z.enum(["string", "number", "integer", "boolean", "array", "object", "null"]))
10
- ]).optional(),
7
+ type: zod_1.z
8
+ .union([
9
+ zod_1.z.enum(['string', 'number', 'integer', 'boolean', 'array', 'object', 'null', 'any']),
10
+ zod_1.z.array(zod_1.z.enum(['string', 'number', 'integer', 'boolean', 'array', 'object', 'null'])),
11
+ ])
12
+ .optional(),
11
13
  // Core schema metadata
12
14
  $id: zod_1.z.string().optional(),
13
15
  $schema: zod_1.z.string().optional(),
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BlockConfigSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const workspace_schema_1 = require("./workspace.schema");
5
+ const document_schema_1 = require("./document.schema");
6
6
  const pipeline_schema_1 = require("./pipeline.schema");
7
- const workflow_schema_1 = require("./workflow.schema");
8
7
  const tool_config_schema_1 = require("./tool-config.schema");
9
- const document_schema_1 = require("./document.schema");
8
+ const workflow_schema_1 = require("./workflow.schema");
9
+ const workspace_schema_1 = require("./workspace.schema");
10
10
  exports.BlockConfigSchema = zod_1.z.discriminatedUnion('type', [
11
11
  pipeline_schema_1.PipelineFactoryConfigSchema,
12
12
  pipeline_schema_1.PipelineSequenceSchema,
@@ -2,15 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PipelineSequenceSchema = exports.PipelineFactorySchema = exports.PipelineFactoryIteratorSchema = exports.PipelineFactoryConfigSchema = exports.PipelineFactoryIteratorConfigSchema = exports.PipelineItemSchema = exports.PipelineItemConfigSchema = exports.PipelineBaseSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const workflow_schema_1 = require("./workflow.schema");
6
- const template_expression_schema_1 = require("./template-expression.schema");
7
5
  const block_schema_1 = require("./block.schema");
6
+ const template_expression_schema_1 = require("./template-expression.schema");
8
7
  const ui_form_schema_1 = require("./ui-form.schema");
8
+ const workflow_schema_1 = require("./workflow.schema");
9
9
  exports.PipelineBaseSchema = block_schema_1.BlockSchema.extend({
10
10
  title: zod_1.z.string().optional(),
11
11
  description: zod_1.z.string().optional(),
12
12
  namespace: workflow_schema_1.NamespacePropsSchema.optional(),
13
- ui: ui_form_schema_1.UiFormSchema.optional()
13
+ ui: ui_form_schema_1.UiFormSchema.optional(),
14
14
  });
15
15
  exports.PipelineItemConfigSchema = zod_1.z.object({
16
16
  id: zod_1.z.string().optional(),
@@ -24,16 +24,11 @@ exports.PipelineItemConfigSchema = zod_1.z.object({
24
24
  exports.PipelineItemSchema = zod_1.z.object({
25
25
  id: zod_1.z.string().optional(),
26
26
  block: zod_1.z.string(),
27
- condition: zod_1.z
28
- .union([zod_1.z.boolean(), zod_1.z.string()])
29
- .optional(),
27
+ condition: zod_1.z.union([zod_1.z.boolean(), zod_1.z.string()]).optional(),
30
28
  args: zod_1.z.any().optional(),
31
29
  });
32
30
  exports.PipelineFactoryIteratorConfigSchema = zod_1.z.object({
33
- source: zod_1.z.union([
34
- template_expression_schema_1.TemplateExpression,
35
- zod_1.z.array(zod_1.z.string()),
36
- ]),
31
+ source: zod_1.z.union([template_expression_schema_1.TemplateExpression, zod_1.z.array(zod_1.z.string())]),
37
32
  });
38
33
  exports.PipelineFactoryConfigSchema = exports.PipelineBaseSchema.extend({
39
34
  type: zod_1.z.literal('factory').default('factory'),
@@ -4,25 +4,32 @@ exports.ScheduledTaskSchema = exports.StartupTaskSchema = exports.RunPipelineTas
4
4
  const zod_1 = require("zod");
5
5
  const transition_payload_schema_1 = require("./transition-payload.schema");
6
6
  const RepeatOptionsSchema = zod_1.z.object({
7
- every: zod_1.z.number().nonnegative().optional()
8
- .describe('Repeat every X milliseconds. Example: 60000 for every minute'),
9
- startDate: zod_1.z.string().optional()
7
+ every: zod_1.z.number().nonnegative().optional().describe('Repeat every X milliseconds. Example: 60000 for every minute'),
8
+ startDate: zod_1.z
9
+ .string()
10
+ .optional()
10
11
  .describe('ISO string or timestamp when to start repeating. Example: "2025-01-01T00:00:00.000Z" or Date.now()'),
11
- endDate: zod_1.z.string().optional()
12
+ endDate: zod_1.z
13
+ .string()
14
+ .optional()
12
15
  .describe('ISO string or timestamp when to stop repeating. Example: "2025-12-31T23:59:59.999Z"'),
13
- limit: zod_1.z.number().nonnegative().optional()
14
- .describe('Maximum number of times to repeat. Example: 100'),
15
- immediately: zod_1.z.boolean().optional()
16
- .describe('Whether to run the job immediately when created. Default: false'),
17
- pattern: zod_1.z.string().optional()
16
+ limit: zod_1.z.number().nonnegative().optional().describe('Maximum number of times to repeat. Example: 100'),
17
+ immediately: zod_1.z.boolean().optional().describe('Whether to run the job immediately when created. Default: false'),
18
+ pattern: zod_1.z
19
+ .string()
20
+ .optional()
18
21
  .describe('Cron pattern for scheduling. Examples: "0 2 * * *" (daily at 2am), "*/15 * * * *" (every 15 min), "0 9 * * MON-FRI" (weekdays at 9am)'),
19
- tz: zod_1.z.string().optional()
22
+ tz: zod_1.z
23
+ .string()
24
+ .optional()
20
25
  .describe('IANA timezone for cron pattern. Examples: "UTC", "America/New_York", "Europe/London", "Asia/Tokyo", "Australia/Sydney"'),
21
26
  });
22
- exports.JobsScheduleSchema = zod_1.z.object({
27
+ exports.JobsScheduleSchema = zod_1.z
28
+ .object({
23
29
  delay: zod_1.z.number().nonnegative().optional(),
24
30
  repeat: RepeatOptionsSchema.optional(),
25
- }).partial();
31
+ })
32
+ .partial();
26
33
  exports.BaseStartupTaskSchema = zod_1.z.object({
27
34
  name: zod_1.z.string(),
28
35
  title: zod_1.z.string().optional(),
@@ -2,4 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TemplateExpression = void 0;
4
4
  const zod_1 = require("zod");
5
- exports.TemplateExpression = zod_1.z.string().regex(/^(?:\||>)?(?:[-+])?\s*\$\{([\s\S]*?)\}\s*$/, "Must be an expression in format '${ expression }'");
5
+ exports.TemplateExpression = zod_1.z
6
+ .string()
7
+ .regex(/^(?:\||>)?(?:[-+])?\s*\$\{([\s\S]*?)\}\s*$/, "Must be an expression in format '${ expression }'");
@@ -7,5 +7,5 @@ const ui_form_schema_1 = require("./ui-form.schema");
7
7
  exports.ToolConfigSchema = block_schema_1.BlockSchema.extend({
8
8
  type: zod_1.z.literal('tool').default('tool'),
9
9
  description: zod_1.z.string().optional(),
10
- ui: ui_form_schema_1.UiFormSchema.optional()
10
+ ui: ui_form_schema_1.UiFormSchema.optional(),
11
11
  });
@@ -14,16 +14,18 @@ exports.UiElementSchema = zod_1.z.object({
14
14
  emptyValue: zod_1.z.any().optional(),
15
15
  help: zod_1.z.string().optional(),
16
16
  title: zod_1.z.string().optional(),
17
- enumOptions: zod_1.z.union([
17
+ enumOptions: zod_1.z
18
+ .union([
18
19
  zod_1.z.array(zod_1.z.union([
19
20
  zod_1.z.object({
20
21
  label: zod_1.z.string(),
21
- value: zod_1.z.any()
22
+ value: zod_1.z.any(),
22
23
  }),
23
24
  zod_1.z.string(),
24
25
  ])),
25
- zod_1.z.string()
26
- ]).optional(),
26
+ zod_1.z.string(),
27
+ ])
28
+ .optional(),
27
29
  titleFormat: zod_1.z.string().optional(),
28
30
  addable: zod_1.z.boolean().optional(),
29
31
  removable: zod_1.z.boolean().optional(),
@@ -16,23 +16,24 @@ exports.UiFormButtonOptionsSchema = zod_1.z.object({
16
16
  });
17
17
  exports.UiFormButtonSchema = exports.UiFormBaseSchema.extend({
18
18
  type: zod_1.z.literal('button'),
19
- options: zod_1.z.object({
19
+ options: zod_1.z
20
+ .object({
20
21
  position: zod_1.z.number().optional(),
21
22
  label: zod_1.z.string().optional(),
22
23
  props: zod_1.z.record(zod_1.z.any()).optional(),
23
- }).optional(),
24
+ })
25
+ .optional(),
24
26
  });
25
27
  exports.UiFormCustomSchema = exports.UiFormBaseSchema.extend({
26
28
  type: zod_1.z.literal('custom'),
27
- options: zod_1.z.object({
29
+ options: zod_1.z
30
+ .object({
28
31
  label: zod_1.z.string().optional(),
29
32
  props: zod_1.z.record(zod_1.z.any()).optional(),
30
- }).optional(),
33
+ })
34
+ .optional(),
31
35
  });
32
- exports.UiWidgetSchema = (0, zod_1.discriminatedUnion)('type', [
33
- exports.UiFormButtonSchema,
34
- exports.UiFormCustomSchema,
35
- ]);
36
+ exports.UiWidgetSchema = (0, zod_1.discriminatedUnion)('type', [exports.UiFormButtonSchema, exports.UiFormCustomSchema]);
36
37
  exports.UiFormSchema = zod_1.z.object({
37
38
  actions: zod_1.z.array(exports.UiWidgetSchema).optional(),
38
39
  form: ui_properties_schema_1.UiPropertiesSchema.optional(),
@@ -2,26 +2,27 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WorkflowTransitionSchema = exports.WorkflowTransitionConfigSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const tool_call_schema_1 = require("./tool-call.schema");
6
5
  const template_expression_schema_1 = require("./template-expression.schema");
7
- exports.WorkflowTransitionConfigSchema = zod_1.z.object({
6
+ const tool_call_schema_1 = require("./tool-call.schema");
7
+ exports.WorkflowTransitionConfigSchema = zod_1.z
8
+ .object({
8
9
  id: zod_1.z.string(),
9
10
  from: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]),
10
11
  to: zod_1.z.string(),
11
12
  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([
13
- zod_1.z.enum(["manual", "onEntry"]),
14
- template_expression_schema_1.TemplateExpression,
15
- ]).optional(),
13
+ trigger: zod_1.z.union([zod_1.z.enum(['manual', 'onEntry']), template_expression_schema_1.TemplateExpression]).optional(),
16
14
  call: zod_1.z.array(tool_call_schema_1.ToolCallConfigSchema).optional(),
17
15
  onError: zod_1.z.string().optional(),
18
- }).strict();
19
- exports.WorkflowTransitionSchema = zod_1.z.object({
16
+ })
17
+ .strict();
18
+ exports.WorkflowTransitionSchema = zod_1.z
19
+ .object({
20
20
  id: zod_1.z.string(),
21
21
  from: zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]),
22
22
  to: zod_1.z.string(),
23
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(),
24
+ trigger: zod_1.z.enum(['manual', 'onEntry']).optional(),
25
25
  call: zod_1.z.array(tool_call_schema_1.ToolCallSchema).optional(),
26
26
  onError: zod_1.z.string().optional(),
27
- }).strict();
27
+ })
28
+ .strict();
@@ -2,16 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WorkflowSchema = exports.WorkflowBaseSchema = exports.NamespacePropsSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const workflow_transition_schema_1 = require("./workflow-transition.schema");
6
5
  const block_schema_1 = require("./block.schema");
7
6
  const ui_form_schema_1 = require("./ui-form.schema");
7
+ const workflow_transition_schema_1 = require("./workflow-transition.schema");
8
8
  exports.NamespacePropsSchema = zod_1.z.object({
9
9
  label: zod_1.z.string(),
10
10
  });
11
11
  exports.WorkflowBaseSchema = block_schema_1.BlockSchema.extend({
12
12
  title: zod_1.z.string().optional(),
13
13
  description: zod_1.z.string().optional(),
14
- ui: ui_form_schema_1.UiFormSchema.optional()
14
+ ui: ui_form_schema_1.UiFormSchema.optional(),
15
15
  });
16
16
  exports.WorkflowSchema = exports.WorkflowBaseSchema.extend({
17
17
  type: zod_1.z.literal('workflow').default('workflow'),
@@ -1,8 +1,8 @@
1
1
  import { WorkflowState } from '../../enums';
2
- import { HistoryTransition } from './history-transition.interface';
3
2
  import { JSONSchemaConfigType } from '../types/json-schema-config.type';
4
3
  import { UiFormType } from '../types/ui-form.type';
5
4
  import { WorkflowTransitionType } from '../types/workflow-transition.type';
5
+ import { HistoryTransition } from './history-transition.interface';
6
6
  export interface WorkflowInterface {
7
7
  id: string;
8
8
  blockName: string;
@@ -1,4 +1,3 @@
1
1
  import { z } from 'zod';
2
2
  import { JSONSchemaType } from '../../schemas';
3
- export interface JSONSchemaConfigType extends z.infer<typeof JSONSchemaType> {
4
- }
3
+ export type JSONSchemaConfigType = z.infer<typeof JSONSchemaType>;
@@ -1,4 +1,3 @@
1
1
  import { z } from 'zod';
2
2
  import { UiPropertiesSchema } from '../../schemas';
3
- export interface UiPropertiesType extends z.infer<typeof UiPropertiesSchema> {
4
- }
3
+ export type UiPropertiesType = z.infer<typeof UiPropertiesSchema>;
@@ -0,0 +1,21 @@
1
+ import js from '@eslint/js';
2
+ import prettier from 'eslint-plugin-prettier/recommended';
3
+ import { defineConfig, globalIgnores } from 'eslint/config';
4
+ import globals from 'globals';
5
+ import tseslint from 'typescript-eslint';
6
+
7
+ export default defineConfig([
8
+ globalIgnores(['dist', 'src/components/ai-elements']),
9
+ {
10
+ files: ['**/*.{ts,tsx}'],
11
+ extends: [js.configs.recommended, tseslint.configs.recommended, prettier],
12
+ languageOptions: {
13
+ ecmaVersion: 2020,
14
+ globals: globals.browser,
15
+ },
16
+ rules: {
17
+ //for now we ignore this, fix later
18
+ '@typescript-eslint/no-explicit-any': 'off',
19
+ },
20
+ },
21
+ ]);
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.16.0",
5
+ "version": "0.16.2",
6
6
  "license": "BSL",
7
7
  "author": {
8
8
  "name": "Jakob Klippel",
@@ -40,14 +40,35 @@
40
40
  "scripts": {
41
41
  "build": "tsc -p tsconfig.json",
42
42
  "watch": "tsc --watch",
43
- "compile": "tsc --noEmit"
43
+ "compile": "tsc --noEmit",
44
+ "lint": "eslint .",
45
+ "format": "prettier --write .",
46
+ "prepare": "husky"
44
47
  },
45
48
  "peerDependencies": {
46
49
  "zod": "^3.25.76"
47
50
  },
48
51
  "devDependencies": {
52
+ "@eslint/js": "^9.39.1",
53
+ "@trivago/prettier-plugin-sort-imports": "^6.0.1",
49
54
  "@types/node": "^22.13.4",
55
+ "eslint": "^9.39.1",
56
+ "eslint-config-prettier": "^10.1.5",
57
+ "eslint-plugin-prettier": "^5.4.1",
58
+ "globals": "^16.5.0",
59
+ "husky": "^9.1.7",
60
+ "lint-staged": "^16.2.7",
61
+ "prettier": "^3.7.4",
50
62
  "typescript": "^5.7.3",
63
+ "typescript-eslint": "^8.46.3",
51
64
  "zod": "^3.25.76"
65
+ },
66
+ "lint-staged": {
67
+ "*.{ts,tsx}": [
68
+ "eslint"
69
+ ],
70
+ "*.{json,md,css,yaml,yml}": [
71
+ "prettier --check"
72
+ ]
52
73
  }
53
74
  }
@@ -0,0 +1,19 @@
1
+ export default {
2
+ plugins: ['@trivago/prettier-plugin-sort-imports'],
3
+ importOrder: [
4
+ '<THIRD_PARTY_MODULES>', // Imports not matched by other special phrases
5
+ '^@loopstack/(.*)$', // Internal packages
6
+ '^@/(.*)$', // Path aliases
7
+ '^[./]', // Relative imports
8
+ ],
9
+ importOrderSortSpecifiers: true,
10
+ importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'],
11
+ printWidth: 120,
12
+ singleQuote: true,
13
+ trailingComma: 'all',
14
+ semi: true,
15
+ tabWidth: 2,
16
+ bracketSpacing: true,
17
+ arrowParens: 'always',
18
+ endOfLine: 'lf',
19
+ };