@lssm/module.ai-chat 1.42.10 → 1.43.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.
- package/dist/libs/schema/dist/GraphQLSchemaType.js +1 -0
- package/dist/libs/schema/dist/JsonSchemaType.js +1 -0
- package/dist/libs/schema/dist/ScalarTypeEnum.js +38 -38
- package/dist/libs/schema/dist/ScalarTypeEnum.js.map +1 -1
- package/dist/libs/schema/dist/SchemaModel.js +3 -3
- package/dist/libs/schema/dist/SchemaModel.js.map +1 -1
- package/dist/libs/schema/dist/ZodSchemaType.js +1 -0
- package/dist/libs/schema/dist/index.js +3 -0
- package/dist/presentation/components/ChatInput.d.ts +2 -2
- package/dist/presentation/components/ChatMessage.d.ts +2 -2
- package/dist/presentation/components/CodePreview.d.ts +2 -2
- package/dist/presentation/components/ContextIndicator.d.ts +2 -2
- package/dist/presentation/components/ModelPicker.d.ts +2 -2
- package/package.json +12 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "zod";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FieldType } from "./FieldType.js";
|
|
2
|
-
import * as z from "zod";
|
|
2
|
+
import * as z$1 from "zod";
|
|
3
3
|
import { Kind } from "graphql";
|
|
4
4
|
|
|
5
5
|
//#region ../../libs/schema/dist/ScalarTypeEnum.js
|
|
@@ -19,8 +19,8 @@ const ScalarTypeEnum = {
|
|
|
19
19
|
String_unsecure: () => new FieldType({
|
|
20
20
|
name: "String_unsecure",
|
|
21
21
|
description: "Unvalidated string scalar",
|
|
22
|
-
zod: z.string(),
|
|
23
|
-
parseValue: (v) => z.string().parse(v),
|
|
22
|
+
zod: z$1.string(),
|
|
23
|
+
parseValue: (v) => z$1.string().parse(v),
|
|
24
24
|
serialize: (v) => String(v),
|
|
25
25
|
parseLiteral: (ast) => {
|
|
26
26
|
if (ast.kind !== Kind.STRING) throw new TypeError("Invalid literal");
|
|
@@ -31,10 +31,10 @@ const ScalarTypeEnum = {
|
|
|
31
31
|
Int_unsecure: () => new FieldType({
|
|
32
32
|
name: "Int_unsecure",
|
|
33
33
|
description: "Unvalidated integer scalar",
|
|
34
|
-
zod: z.number().int(),
|
|
34
|
+
zod: z$1.number().int(),
|
|
35
35
|
parseValue: (v) => {
|
|
36
36
|
const num = typeof v === "number" ? v : Number(v);
|
|
37
|
-
return z.number().int().parse(num);
|
|
37
|
+
return z$1.number().int().parse(num);
|
|
38
38
|
},
|
|
39
39
|
serialize: (v) => Math.trunc(typeof v === "number" ? v : Number(v)),
|
|
40
40
|
parseLiteral: (ast) => {
|
|
@@ -46,10 +46,10 @@ const ScalarTypeEnum = {
|
|
|
46
46
|
Float_unsecure: () => new FieldType({
|
|
47
47
|
name: "Float_unsecure",
|
|
48
48
|
description: "Unvalidated float scalar",
|
|
49
|
-
zod: z.number(),
|
|
49
|
+
zod: z$1.number(),
|
|
50
50
|
parseValue: (v) => {
|
|
51
51
|
const num = typeof v === "number" ? v : Number(v);
|
|
52
|
-
return z.number().parse(num);
|
|
52
|
+
return z$1.number().parse(num);
|
|
53
53
|
},
|
|
54
54
|
serialize: (v) => Number(v),
|
|
55
55
|
parseLiteral: (ast) => {
|
|
@@ -61,8 +61,8 @@ const ScalarTypeEnum = {
|
|
|
61
61
|
Boolean: () => new FieldType({
|
|
62
62
|
name: "Boolean",
|
|
63
63
|
description: "Unvalidated boolean scalar",
|
|
64
|
-
zod: z.boolean(),
|
|
65
|
-
parseValue: (v) => z.coerce.boolean().parse(v),
|
|
64
|
+
zod: z$1.boolean(),
|
|
65
|
+
parseValue: (v) => z$1.coerce.boolean().parse(v),
|
|
66
66
|
serialize: (v) => Boolean(v),
|
|
67
67
|
parseLiteral: (ast) => {
|
|
68
68
|
if (ast.kind !== Kind.BOOLEAN) throw new TypeError("Invalid literal");
|
|
@@ -73,8 +73,8 @@ const ScalarTypeEnum = {
|
|
|
73
73
|
ID: () => new FieldType({
|
|
74
74
|
name: "ID",
|
|
75
75
|
description: "Unvalidated id scalar",
|
|
76
|
-
zod: z.string(),
|
|
77
|
-
parseValue: (v) => z.string().parse(v),
|
|
76
|
+
zod: z$1.string(),
|
|
77
|
+
parseValue: (v) => z$1.string().parse(v),
|
|
78
78
|
serialize: (v) => String(v),
|
|
79
79
|
parseLiteral: (ast) => {
|
|
80
80
|
if (ast.kind !== Kind.STRING) throw new TypeError("Invalid literal");
|
|
@@ -84,21 +84,21 @@ const ScalarTypeEnum = {
|
|
|
84
84
|
}),
|
|
85
85
|
JSON: () => new FieldType({
|
|
86
86
|
name: "JSON",
|
|
87
|
-
zod: z.any(),
|
|
87
|
+
zod: z$1.any(),
|
|
88
88
|
parseValue: (v) => v,
|
|
89
89
|
serialize: (v) => v,
|
|
90
90
|
jsonSchema: {}
|
|
91
91
|
}),
|
|
92
92
|
JSONObject: () => new FieldType({
|
|
93
93
|
name: "JSONObject",
|
|
94
|
-
zod: z.record(z.string(), z.any()),
|
|
95
|
-
parseValue: (v) => z.record(z.string(), z.any()).parse(v),
|
|
94
|
+
zod: z$1.record(z$1.string(), z$1.any()),
|
|
95
|
+
parseValue: (v) => z$1.record(z$1.string(), z$1.any()).parse(v),
|
|
96
96
|
serialize: (v) => v ?? {},
|
|
97
97
|
jsonSchema: { type: "object" }
|
|
98
98
|
}),
|
|
99
99
|
Date: () => new FieldType({
|
|
100
100
|
name: "Date",
|
|
101
|
-
zod: z.date(),
|
|
101
|
+
zod: z$1.date(),
|
|
102
102
|
parseValue: (v) => v instanceof Date ? v : new Date(String(v)),
|
|
103
103
|
serialize: (v) => v instanceof Date ? v.toISOString().split("T")[0] : String(v),
|
|
104
104
|
jsonSchema: {
|
|
@@ -108,7 +108,7 @@ const ScalarTypeEnum = {
|
|
|
108
108
|
}),
|
|
109
109
|
DateTime: () => new FieldType({
|
|
110
110
|
name: "DateTime",
|
|
111
|
-
zod: z.date(),
|
|
111
|
+
zod: z$1.date(),
|
|
112
112
|
parseValue: (v) => v instanceof Date ? v : new Date(String(v)),
|
|
113
113
|
serialize: (v) => {
|
|
114
114
|
return v instanceof Date ? v.toISOString() : String(v);
|
|
@@ -120,8 +120,8 @@ const ScalarTypeEnum = {
|
|
|
120
120
|
}),
|
|
121
121
|
Time: () => new FieldType({
|
|
122
122
|
name: "Time",
|
|
123
|
-
zod: z.string().regex(/^\d{2}:\d{2}(:\d{2})?$/),
|
|
124
|
-
parseValue: (v) => z.string().regex(/^\d{2}:\d{2}(:\d{2})?$/).parse(v),
|
|
123
|
+
zod: z$1.string().regex(/^\d{2}:\d{2}(:\d{2})?$/),
|
|
124
|
+
parseValue: (v) => z$1.string().regex(/^\d{2}:\d{2}(:\d{2})?$/).parse(v),
|
|
125
125
|
serialize: (v) => String(v),
|
|
126
126
|
jsonSchema: {
|
|
127
127
|
type: "string",
|
|
@@ -130,8 +130,8 @@ const ScalarTypeEnum = {
|
|
|
130
130
|
}),
|
|
131
131
|
EmailAddress: () => new FieldType({
|
|
132
132
|
name: "EmailAddress",
|
|
133
|
-
zod: z.string().email(),
|
|
134
|
-
parseValue: (v) => z.string().email().parse(v),
|
|
133
|
+
zod: z$1.string().email(),
|
|
134
|
+
parseValue: (v) => z$1.string().email().parse(v),
|
|
135
135
|
serialize: (v) => String(v),
|
|
136
136
|
jsonSchema: {
|
|
137
137
|
type: "string",
|
|
@@ -140,8 +140,8 @@ const ScalarTypeEnum = {
|
|
|
140
140
|
}),
|
|
141
141
|
URL: () => new FieldType({
|
|
142
142
|
name: "URL",
|
|
143
|
-
zod: z.string().url(),
|
|
144
|
-
parseValue: (v) => z.string().url().parse(v),
|
|
143
|
+
zod: z$1.string().url(),
|
|
144
|
+
parseValue: (v) => z$1.string().url().parse(v),
|
|
145
145
|
serialize: (v) => String(v),
|
|
146
146
|
jsonSchema: {
|
|
147
147
|
type: "string",
|
|
@@ -150,8 +150,8 @@ const ScalarTypeEnum = {
|
|
|
150
150
|
}),
|
|
151
151
|
PhoneNumber: () => new FieldType({
|
|
152
152
|
name: "PhoneNumber",
|
|
153
|
-
zod: z.string().regex(phoneRegex),
|
|
154
|
-
parseValue: (v) => z.string().regex(phoneRegex).parse(v),
|
|
153
|
+
zod: z$1.string().regex(phoneRegex),
|
|
154
|
+
parseValue: (v) => z$1.string().regex(phoneRegex).parse(v),
|
|
155
155
|
serialize: (v) => String(v),
|
|
156
156
|
jsonSchema: {
|
|
157
157
|
type: "string",
|
|
@@ -160,8 +160,8 @@ const ScalarTypeEnum = {
|
|
|
160
160
|
}),
|
|
161
161
|
NonEmptyString: () => new FieldType({
|
|
162
162
|
name: "NonEmptyString",
|
|
163
|
-
zod: z.string().min(1),
|
|
164
|
-
parseValue: (v) => z.string().min(1).parse(v),
|
|
163
|
+
zod: z$1.string().min(1),
|
|
164
|
+
parseValue: (v) => z$1.string().min(1).parse(v),
|
|
165
165
|
serialize: (v) => String(v),
|
|
166
166
|
jsonSchema: {
|
|
167
167
|
type: "string",
|
|
@@ -170,8 +170,8 @@ const ScalarTypeEnum = {
|
|
|
170
170
|
}),
|
|
171
171
|
Locale: () => new FieldType({
|
|
172
172
|
name: "Locale",
|
|
173
|
-
zod: z.string().regex(localeRegex),
|
|
174
|
-
parseValue: (v) => z.string().regex(localeRegex).parse(v),
|
|
173
|
+
zod: z$1.string().regex(localeRegex),
|
|
174
|
+
parseValue: (v) => z$1.string().regex(localeRegex).parse(v),
|
|
175
175
|
serialize: (v) => String(v),
|
|
176
176
|
jsonSchema: {
|
|
177
177
|
type: "string",
|
|
@@ -180,8 +180,8 @@ const ScalarTypeEnum = {
|
|
|
180
180
|
}),
|
|
181
181
|
TimeZone: () => new FieldType({
|
|
182
182
|
name: "TimeZone",
|
|
183
|
-
zod: z.string().regex(timezoneRegex),
|
|
184
|
-
parseValue: (v) => z.string().regex(timezoneRegex).parse(v),
|
|
183
|
+
zod: z$1.string().regex(timezoneRegex),
|
|
184
|
+
parseValue: (v) => z$1.string().regex(timezoneRegex).parse(v),
|
|
185
185
|
serialize: (v) => String(v),
|
|
186
186
|
jsonSchema: {
|
|
187
187
|
type: "string",
|
|
@@ -190,8 +190,8 @@ const ScalarTypeEnum = {
|
|
|
190
190
|
}),
|
|
191
191
|
Latitude: () => new FieldType({
|
|
192
192
|
name: "Latitude",
|
|
193
|
-
zod: z.number().min(latMin).max(latMax),
|
|
194
|
-
parseValue: (v) => z.coerce.number().min(latMin).max(latMax).parse(v),
|
|
193
|
+
zod: z$1.number().min(latMin).max(latMax),
|
|
194
|
+
parseValue: (v) => z$1.coerce.number().min(latMin).max(latMax).parse(v),
|
|
195
195
|
serialize: (v) => Number(v),
|
|
196
196
|
jsonSchema: {
|
|
197
197
|
type: "number",
|
|
@@ -201,8 +201,8 @@ const ScalarTypeEnum = {
|
|
|
201
201
|
}),
|
|
202
202
|
Longitude: () => new FieldType({
|
|
203
203
|
name: "Longitude",
|
|
204
|
-
zod: z.number().min(lonMin).max(lonMax),
|
|
205
|
-
parseValue: (v) => z.coerce.number().min(lonMin).max(lonMax).parse(v),
|
|
204
|
+
zod: z$1.number().min(lonMin).max(lonMax),
|
|
205
|
+
parseValue: (v) => z$1.coerce.number().min(lonMin).max(lonMax).parse(v),
|
|
206
206
|
serialize: (v) => Number(v),
|
|
207
207
|
jsonSchema: {
|
|
208
208
|
type: "number",
|
|
@@ -212,8 +212,8 @@ const ScalarTypeEnum = {
|
|
|
212
212
|
}),
|
|
213
213
|
Currency: () => new FieldType({
|
|
214
214
|
name: "Currency",
|
|
215
|
-
zod: z.string().regex(currencyRegex),
|
|
216
|
-
parseValue: (v) => z.string().regex(currencyRegex).parse(v),
|
|
215
|
+
zod: z$1.string().regex(currencyRegex),
|
|
216
|
+
parseValue: (v) => z$1.string().regex(currencyRegex).parse(v),
|
|
217
217
|
serialize: (v) => String(v),
|
|
218
218
|
jsonSchema: {
|
|
219
219
|
type: "string",
|
|
@@ -222,8 +222,8 @@ const ScalarTypeEnum = {
|
|
|
222
222
|
}),
|
|
223
223
|
CountryCode: () => new FieldType({
|
|
224
224
|
name: "CountryCode",
|
|
225
|
-
zod: z.string().regex(countryRegex),
|
|
226
|
-
parseValue: (v) => z.string().regex(countryRegex).parse(v),
|
|
225
|
+
zod: z$1.string().regex(countryRegex),
|
|
226
|
+
parseValue: (v) => z$1.string().regex(countryRegex).parse(v),
|
|
227
227
|
serialize: (v) => String(v),
|
|
228
228
|
jsonSchema: {
|
|
229
229
|
type: "string",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarTypeEnum.js","names":[],"sources":["../../../../../../libs/schema/dist/ScalarTypeEnum.js"],"sourcesContent":["import { FieldType } from \"./FieldType.js\";\nimport * as z from \"zod\";\nimport { Kind } from \"graphql\";\n\n//#region src/ScalarTypeEnum.ts\nconst localeRegex = /^[A-Za-z]{2}(?:-[A-Za-z0-9]{2,8})*$/;\nconst timezoneRegex = /^(?:UTC|[A-Za-z_]+\\/[A-Za-z_]+)$/;\nconst phoneRegex = /^[+]?\\d[\\d\\s().-]{3,}$/;\nconst currencyRegex = /^[A-Z]{3}$/;\nconst countryRegex = /^[A-Z]{2}$/;\nconst latMin = -90;\nconst latMax = 90;\nconst lonMin = -180;\nconst lonMax = 180;\n/**\n* Factory functions for common scalar FieldTypes with zod/GraphQL/JSON Schema.\n*/\nconst ScalarTypeEnum = {\n\tString_unsecure: () => new FieldType({\n\t\tname: \"String_unsecure\",\n\t\tdescription: \"Unvalidated string scalar\",\n\t\tzod: z.string(),\n\t\tparseValue: (v) => z.string().parse(v),\n\t\tserialize: (v) => String(v),\n\t\tparseLiteral: (ast) => {\n\t\t\tif (ast.kind !== Kind.STRING) throw new TypeError(\"Invalid literal\");\n\t\t\treturn ast.value;\n\t\t},\n\t\tjsonSchema: { type: \"string\" }\n\t}),\n\tInt_unsecure: () => new FieldType({\n\t\tname: \"Int_unsecure\",\n\t\tdescription: \"Unvalidated integer scalar\",\n\t\tzod: z.number().int(),\n\t\tparseValue: (v) => {\n\t\t\tconst num = typeof v === \"number\" ? v : Number(v);\n\t\t\treturn z.number().int().parse(num);\n\t\t},\n\t\tserialize: (v) => Math.trunc(typeof v === \"number\" ? v : Number(v)),\n\t\tparseLiteral: (ast) => {\n\t\t\tif (ast.kind !== Kind.INT) throw new TypeError(\"Invalid literal\");\n\t\t\treturn Number(ast.value);\n\t\t},\n\t\tjsonSchema: { type: \"integer\" }\n\t}),\n\tFloat_unsecure: () => new FieldType({\n\t\tname: \"Float_unsecure\",\n\t\tdescription: \"Unvalidated float scalar\",\n\t\tzod: z.number(),\n\t\tparseValue: (v) => {\n\t\t\tconst num = typeof v === \"number\" ? v : Number(v);\n\t\t\treturn z.number().parse(num);\n\t\t},\n\t\tserialize: (v) => Number(v),\n\t\tparseLiteral: (ast) => {\n\t\t\tif (ast.kind !== Kind.FLOAT && ast.kind !== Kind.INT) throw new TypeError(\"Invalid literal\");\n\t\t\treturn Number(ast.value);\n\t\t},\n\t\tjsonSchema: { type: \"number\" }\n\t}),\n\tBoolean: () => new FieldType({\n\t\tname: \"Boolean\",\n\t\tdescription: \"Unvalidated boolean scalar\",\n\t\tzod: z.boolean(),\n\t\tparseValue: (v) => z.coerce.boolean().parse(v),\n\t\tserialize: (v) => Boolean(v),\n\t\tparseLiteral: (ast) => {\n\t\t\tif (ast.kind !== Kind.BOOLEAN) throw new TypeError(\"Invalid literal\");\n\t\t\treturn ast.value;\n\t\t},\n\t\tjsonSchema: { type: \"boolean\" }\n\t}),\n\tID: () => new FieldType({\n\t\tname: \"ID\",\n\t\tdescription: \"Unvalidated id scalar\",\n\t\tzod: z.string(),\n\t\tparseValue: (v) => z.string().parse(v),\n\t\tserialize: (v) => String(v),\n\t\tparseLiteral: (ast) => {\n\t\t\tif (ast.kind !== Kind.STRING) throw new TypeError(\"Invalid literal\");\n\t\t\treturn ast.value;\n\t\t},\n\t\tjsonSchema: { type: \"string\" }\n\t}),\n\tJSON: () => new FieldType({\n\t\tname: \"JSON\",\n\t\tzod: z.any(),\n\t\tparseValue: (v) => v,\n\t\tserialize: (v) => v,\n\t\tjsonSchema: {}\n\t}),\n\tJSONObject: () => new FieldType({\n\t\tname: \"JSONObject\",\n\t\tzod: z.record(z.string(), z.any()),\n\t\tparseValue: (v) => z.record(z.string(), z.any()).parse(v),\n\t\tserialize: (v) => v ?? {},\n\t\tjsonSchema: { type: \"object\" }\n\t}),\n\tDate: () => new FieldType({\n\t\tname: \"Date\",\n\t\tzod: z.date(),\n\t\tparseValue: (v) => v instanceof Date ? v : new Date(String(v)),\n\t\tserialize: (v) => v instanceof Date ? v.toISOString().split(\"T\")[0] : String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tformat: \"date\"\n\t\t}\n\t}),\n\tDateTime: () => new FieldType({\n\t\tname: \"DateTime\",\n\t\tzod: z.date(),\n\t\tparseValue: (v) => v instanceof Date ? v : new Date(String(v)),\n\t\tserialize: (v) => {\n\t\t\treturn v instanceof Date ? v.toISOString() : String(v);\n\t\t},\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tformat: \"date-time\"\n\t\t}\n\t}),\n\tTime: () => new FieldType({\n\t\tname: \"Time\",\n\t\tzod: z.string().regex(/^\\d{2}:\\d{2}(:\\d{2})?$/),\n\t\tparseValue: (v) => z.string().regex(/^\\d{2}:\\d{2}(:\\d{2})?$/).parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tpattern: \"^\\\\d{2}:\\\\d{2}(:\\\\d{2})?$\"\n\t\t}\n\t}),\n\tEmailAddress: () => new FieldType({\n\t\tname: \"EmailAddress\",\n\t\tzod: z.string().email(),\n\t\tparseValue: (v) => z.string().email().parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tformat: \"email\"\n\t\t}\n\t}),\n\tURL: () => new FieldType({\n\t\tname: \"URL\",\n\t\tzod: z.string().url(),\n\t\tparseValue: (v) => z.string().url().parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tformat: \"uri\"\n\t\t}\n\t}),\n\tPhoneNumber: () => new FieldType({\n\t\tname: \"PhoneNumber\",\n\t\tzod: z.string().regex(phoneRegex),\n\t\tparseValue: (v) => z.string().regex(phoneRegex).parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tpattern: phoneRegex.source\n\t\t}\n\t}),\n\tNonEmptyString: () => new FieldType({\n\t\tname: \"NonEmptyString\",\n\t\tzod: z.string().min(1),\n\t\tparseValue: (v) => z.string().min(1).parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tminLength: 1\n\t\t}\n\t}),\n\tLocale: () => new FieldType({\n\t\tname: \"Locale\",\n\t\tzod: z.string().regex(localeRegex),\n\t\tparseValue: (v) => z.string().regex(localeRegex).parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tpattern: localeRegex.source\n\t\t}\n\t}),\n\tTimeZone: () => new FieldType({\n\t\tname: \"TimeZone\",\n\t\tzod: z.string().regex(timezoneRegex),\n\t\tparseValue: (v) => z.string().regex(timezoneRegex).parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tpattern: timezoneRegex.source\n\t\t}\n\t}),\n\tLatitude: () => new FieldType({\n\t\tname: \"Latitude\",\n\t\tzod: z.number().min(latMin).max(latMax),\n\t\tparseValue: (v) => z.coerce.number().min(latMin).max(latMax).parse(v),\n\t\tserialize: (v) => Number(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"number\",\n\t\t\tminimum: latMin,\n\t\t\tmaximum: latMax\n\t\t}\n\t}),\n\tLongitude: () => new FieldType({\n\t\tname: \"Longitude\",\n\t\tzod: z.number().min(lonMin).max(lonMax),\n\t\tparseValue: (v) => z.coerce.number().min(lonMin).max(lonMax).parse(v),\n\t\tserialize: (v) => Number(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"number\",\n\t\t\tminimum: lonMin,\n\t\t\tmaximum: lonMax\n\t\t}\n\t}),\n\tCurrency: () => new FieldType({\n\t\tname: \"Currency\",\n\t\tzod: z.string().regex(currencyRegex),\n\t\tparseValue: (v) => z.string().regex(currencyRegex).parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tpattern: currencyRegex.source\n\t\t}\n\t}),\n\tCountryCode: () => new FieldType({\n\t\tname: \"CountryCode\",\n\t\tzod: z.string().regex(countryRegex),\n\t\tparseValue: (v) => z.string().regex(countryRegex).parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tpattern: countryRegex.source\n\t\t}\n\t})\n};\n\n//#endregion\nexport { ScalarTypeEnum };\n//# sourceMappingURL=ScalarTypeEnum.js.map"],"mappings":";;;;;AAKA,MAAM,cAAc;AACpB,MAAM,gBAAgB;AACtB,MAAM,aAAa;AACnB,MAAM,gBAAgB;AACtB,MAAM,eAAe;AACrB,MAAM,SAAS;AACf,MAAM,SAAS;AACf,MAAM,SAAS;AACf,MAAM,SAAS;;;;AAIf,MAAM,iBAAiB;CACtB,uBAAuB,IAAI,UAAU;EACpC,MAAM;EACN,aAAa;EACb,KAAK,EAAE,QAAQ;EACf,aAAa,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE;EACtC,YAAY,MAAM,OAAO,EAAE;EAC3B,eAAe,QAAQ;AACtB,OAAI,IAAI,SAAS,KAAK,OAAQ,OAAM,IAAI,UAAU,kBAAkB;AACpE,UAAO,IAAI;;EAEZ,YAAY,EAAE,MAAM,UAAU;EAC9B,CAAC;CACF,oBAAoB,IAAI,UAAU;EACjC,MAAM;EACN,aAAa;EACb,KAAK,EAAE,QAAQ,CAAC,KAAK;EACrB,aAAa,MAAM;GAClB,MAAM,MAAM,OAAO,MAAM,WAAW,IAAI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Content":["import { FieldType } from \"./FieldType.js\";\nimport * as z$1 from \"zod\";\nimport { Kind } from \"graphql\";\n\n//#region src/ScalarTypeEnum.ts\nconst localeRegex = /^[A-Za-z]{2}(?:-[A-Za-z0-9]{2,8})*$/;\nconst timezoneRegex = /^(?:UTC|[A-Za-z_]+\\/[A-Za-z_]+)$/;\nconst phoneRegex = /^[+]?\\d[\\d\\s().-]{3,}$/;\nconst currencyRegex = /^[A-Z]{3}$/;\nconst countryRegex = /^[A-Z]{2}$/;\nconst latMin = -90;\nconst latMax = 90;\nconst lonMin = -180;\nconst lonMax = 180;\n/**\n* Factory functions for common scalar FieldTypes with zod/GraphQL/JSON Schema.\n*/\nconst ScalarTypeEnum = {\n\tString_unsecure: () => new FieldType({\n\t\tname: \"String_unsecure\",\n\t\tdescription: \"Unvalidated string scalar\",\n\t\tzod: z$1.string(),\n\t\tparseValue: (v) => z$1.string().parse(v),\n\t\tserialize: (v) => String(v),\n\t\tparseLiteral: (ast) => {\n\t\t\tif (ast.kind !== Kind.STRING) throw new TypeError(\"Invalid literal\");\n\t\t\treturn ast.value;\n\t\t},\n\t\tjsonSchema: { type: \"string\" }\n\t}),\n\tInt_unsecure: () => new FieldType({\n\t\tname: \"Int_unsecure\",\n\t\tdescription: \"Unvalidated integer scalar\",\n\t\tzod: z$1.number().int(),\n\t\tparseValue: (v) => {\n\t\t\tconst num = typeof v === \"number\" ? v : Number(v);\n\t\t\treturn z$1.number().int().parse(num);\n\t\t},\n\t\tserialize: (v) => Math.trunc(typeof v === \"number\" ? v : Number(v)),\n\t\tparseLiteral: (ast) => {\n\t\t\tif (ast.kind !== Kind.INT) throw new TypeError(\"Invalid literal\");\n\t\t\treturn Number(ast.value);\n\t\t},\n\t\tjsonSchema: { type: \"integer\" }\n\t}),\n\tFloat_unsecure: () => new FieldType({\n\t\tname: \"Float_unsecure\",\n\t\tdescription: \"Unvalidated float scalar\",\n\t\tzod: z$1.number(),\n\t\tparseValue: (v) => {\n\t\t\tconst num = typeof v === \"number\" ? v : Number(v);\n\t\t\treturn z$1.number().parse(num);\n\t\t},\n\t\tserialize: (v) => Number(v),\n\t\tparseLiteral: (ast) => {\n\t\t\tif (ast.kind !== Kind.FLOAT && ast.kind !== Kind.INT) throw new TypeError(\"Invalid literal\");\n\t\t\treturn Number(ast.value);\n\t\t},\n\t\tjsonSchema: { type: \"number\" }\n\t}),\n\tBoolean: () => new FieldType({\n\t\tname: \"Boolean\",\n\t\tdescription: \"Unvalidated boolean scalar\",\n\t\tzod: z$1.boolean(),\n\t\tparseValue: (v) => z$1.coerce.boolean().parse(v),\n\t\tserialize: (v) => Boolean(v),\n\t\tparseLiteral: (ast) => {\n\t\t\tif (ast.kind !== Kind.BOOLEAN) throw new TypeError(\"Invalid literal\");\n\t\t\treturn ast.value;\n\t\t},\n\t\tjsonSchema: { type: \"boolean\" }\n\t}),\n\tID: () => new FieldType({\n\t\tname: \"ID\",\n\t\tdescription: \"Unvalidated id scalar\",\n\t\tzod: z$1.string(),\n\t\tparseValue: (v) => z$1.string().parse(v),\n\t\tserialize: (v) => String(v),\n\t\tparseLiteral: (ast) => {\n\t\t\tif (ast.kind !== Kind.STRING) throw new TypeError(\"Invalid literal\");\n\t\t\treturn ast.value;\n\t\t},\n\t\tjsonSchema: { type: \"string\" }\n\t}),\n\tJSON: () => new FieldType({\n\t\tname: \"JSON\",\n\t\tzod: z$1.any(),\n\t\tparseValue: (v) => v,\n\t\tserialize: (v) => v,\n\t\tjsonSchema: {}\n\t}),\n\tJSONObject: () => new FieldType({\n\t\tname: \"JSONObject\",\n\t\tzod: z$1.record(z$1.string(), z$1.any()),\n\t\tparseValue: (v) => z$1.record(z$1.string(), z$1.any()).parse(v),\n\t\tserialize: (v) => v ?? {},\n\t\tjsonSchema: { type: \"object\" }\n\t}),\n\tDate: () => new FieldType({\n\t\tname: \"Date\",\n\t\tzod: z$1.date(),\n\t\tparseValue: (v) => v instanceof Date ? v : new Date(String(v)),\n\t\tserialize: (v) => v instanceof Date ? v.toISOString().split(\"T\")[0] : String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tformat: \"date\"\n\t\t}\n\t}),\n\tDateTime: () => new FieldType({\n\t\tname: \"DateTime\",\n\t\tzod: z$1.date(),\n\t\tparseValue: (v) => v instanceof Date ? v : new Date(String(v)),\n\t\tserialize: (v) => {\n\t\t\treturn v instanceof Date ? v.toISOString() : String(v);\n\t\t},\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tformat: \"date-time\"\n\t\t}\n\t}),\n\tTime: () => new FieldType({\n\t\tname: \"Time\",\n\t\tzod: z$1.string().regex(/^\\d{2}:\\d{2}(:\\d{2})?$/),\n\t\tparseValue: (v) => z$1.string().regex(/^\\d{2}:\\d{2}(:\\d{2})?$/).parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tpattern: \"^\\\\d{2}:\\\\d{2}(:\\\\d{2})?$\"\n\t\t}\n\t}),\n\tEmailAddress: () => new FieldType({\n\t\tname: \"EmailAddress\",\n\t\tzod: z$1.string().email(),\n\t\tparseValue: (v) => z$1.string().email().parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tformat: \"email\"\n\t\t}\n\t}),\n\tURL: () => new FieldType({\n\t\tname: \"URL\",\n\t\tzod: z$1.string().url(),\n\t\tparseValue: (v) => z$1.string().url().parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tformat: \"uri\"\n\t\t}\n\t}),\n\tPhoneNumber: () => new FieldType({\n\t\tname: \"PhoneNumber\",\n\t\tzod: z$1.string().regex(phoneRegex),\n\t\tparseValue: (v) => z$1.string().regex(phoneRegex).parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tpattern: phoneRegex.source\n\t\t}\n\t}),\n\tNonEmptyString: () => new FieldType({\n\t\tname: \"NonEmptyString\",\n\t\tzod: z$1.string().min(1),\n\t\tparseValue: (v) => z$1.string().min(1).parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tminLength: 1\n\t\t}\n\t}),\n\tLocale: () => new FieldType({\n\t\tname: \"Locale\",\n\t\tzod: z$1.string().regex(localeRegex),\n\t\tparseValue: (v) => z$1.string().regex(localeRegex).parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tpattern: localeRegex.source\n\t\t}\n\t}),\n\tTimeZone: () => new FieldType({\n\t\tname: \"TimeZone\",\n\t\tzod: z$1.string().regex(timezoneRegex),\n\t\tparseValue: (v) => z$1.string().regex(timezoneRegex).parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tpattern: timezoneRegex.source\n\t\t}\n\t}),\n\tLatitude: () => new FieldType({\n\t\tname: \"Latitude\",\n\t\tzod: z$1.number().min(latMin).max(latMax),\n\t\tparseValue: (v) => z$1.coerce.number().min(latMin).max(latMax).parse(v),\n\t\tserialize: (v) => Number(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"number\",\n\t\t\tminimum: latMin,\n\t\t\tmaximum: latMax\n\t\t}\n\t}),\n\tLongitude: () => new FieldType({\n\t\tname: \"Longitude\",\n\t\tzod: z$1.number().min(lonMin).max(lonMax),\n\t\tparseValue: (v) => z$1.coerce.number().min(lonMin).max(lonMax).parse(v),\n\t\tserialize: (v) => Number(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"number\",\n\t\t\tminimum: lonMin,\n\t\t\tmaximum: lonMax\n\t\t}\n\t}),\n\tCurrency: () => new FieldType({\n\t\tname: \"Currency\",\n\t\tzod: z$1.string().regex(currencyRegex),\n\t\tparseValue: (v) => z$1.string().regex(currencyRegex).parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tpattern: currencyRegex.source\n\t\t}\n\t}),\n\tCountryCode: () => new FieldType({\n\t\tname: \"CountryCode\",\n\t\tzod: z$1.string().regex(countryRegex),\n\t\tparseValue: (v) => z$1.string().regex(countryRegex).parse(v),\n\t\tserialize: (v) => String(v),\n\t\tjsonSchema: {\n\t\t\ttype: \"string\",\n\t\t\tpattern: countryRegex.source\n\t\t}\n\t})\n};\n\n//#endregion\nexport { ScalarTypeEnum };\n//# sourceMappingURL=ScalarTypeEnum.js.map"],"mappings":";;;;;AAKA,MAAM,cAAc;AACpB,MAAM,gBAAgB;AACtB,MAAM,aAAa;AACnB,MAAM,gBAAgB;AACtB,MAAM,eAAe;AACrB,MAAM,SAAS;AACf,MAAM,SAAS;AACf,MAAM,SAAS;AACf,MAAM,SAAS;;;;AAIf,MAAM,iBAAiB;CACtB,uBAAuB,IAAI,UAAU;EACpC,MAAM;EACN,aAAa;EACb,KAAK,IAAI,QAAQ;EACjB,aAAa,MAAM,IAAI,QAAQ,CAAC,MAAM,EAAE;EACxC,YAAY,MAAM,OAAO,EAAE;EAC3B,eAAe,QAAQ;AACtB,OAAI,IAAI,SAAS,KAAK,OAAQ,OAAM,IAAI,UAAU,kBAAkB;AACpE,UAAO,IAAI;;EAEZ,YAAY,EAAE,MAAM,UAAU;EAC9B,CAAC;CACF,oBAAoB,IAAI,UAAU;EACjC,MAAM;EACN,aAAa;EACb,KAAK,IAAI,QAAQ,CAAC,KAAK;EACvB,aAAa,MAAM;GAClB,MAAM,MAAM,OAAO,MAAM,WAAW,IAAI,OAAO,EAAE;AACjD,UAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,IAAI;;EAErC,YAAY,MAAM,KAAK,MAAM,OAAO,MAAM,WAAW,IAAI,OAAO,EAAE,CAAC;EACnE,eAAe,QAAQ;AACtB,OAAI,IAAI,SAAS,KAAK,IAAK,OAAM,IAAI,UAAU,kBAAkB;AACjE,UAAO,OAAO,IAAI,MAAM;;E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,IAAI,OAAO,CAAC,MAAM,EAAE;EACvE,YAAY,MAAM,OAAO,EAAE;EAC3B,YAAY;GACX,MAAM;GACN,SAAS;GACT,SAAS;GACT;EACD,CAAC;CACF,iBAAiB,IAAI,UAAU;EAC9B,MAAM;EACN,KAAK,IAAI,QAAQ,CAAC,IAAI,OAAO,CAAC,IAAI,OAAO;EACzC,aAAa,MAAM,IAAI,OAAO,QAAQ,CAAC,IAAI,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE;EACvE,YAAY,MAAM,OAAO,EAAE;EAC3B,YAAY;GACX,MAAM;GACN,SAAS;GACT,SAAS;GACT;EACD,CAAC;CACF,gBAAgB,IAAI,UAAU;EAC7B,MAAM;EACN,KAAK,IAAI,QAAQ,CAAC,MAAM,cAAc;EACtC,aAAa,MAAM,IAAI,QAAQ,CAAC,MAAM,cAAc,CAAC,MAAM,EAAE;EAC7D,YAAY,MAAM,OAAO,EAAE;EAC3B,YAAY;GACX,MAAM;GACN,SAAS,cAAc;GACvB;EACD,CAAC;CACF,mBAAmB,IAAI,UAAU;EAChC,MAAM;EACN,KAAK,IAAI,QAAQ,CAAC,MAAM,aAAa;EACrC,aAAa,MAAM,IAAI,QAAQ,CAAC,MAAM,aAAa,CAAC,MAAM,EAAE;EAC5D,YAAY,MAAM,OAAO,EAAE;EAC3B,YAAY;GACX,MAAM;GACN,SAAS,aAAa;GACtB;EACD,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./EnumType.js";
|
|
2
2
|
import "./FieldType.js";
|
|
3
|
-
import * as z from "zod";
|
|
3
|
+
import * as z$1 from "zod";
|
|
4
4
|
|
|
5
5
|
//#region ../../libs/schema/dist/SchemaModel.js
|
|
6
6
|
/**
|
|
@@ -18,11 +18,11 @@ var SchemaModel = class {
|
|
|
18
18
|
getZod() {
|
|
19
19
|
const shape = Object.entries(this.config.fields).reduce((acc, [key, def]) => {
|
|
20
20
|
const base = def.type.getZod();
|
|
21
|
-
const withArray = def.isArray ? z.array(base) : base;
|
|
21
|
+
const withArray = def.isArray ? z$1.array(base) : base;
|
|
22
22
|
acc[key] = def.isOptional ? withArray.optional() : withArray;
|
|
23
23
|
return acc;
|
|
24
24
|
}, {});
|
|
25
|
-
return z.object(shape);
|
|
25
|
+
return z$1.object(shape);
|
|
26
26
|
}
|
|
27
27
|
/** Input object name for GraphQL builder adapters. */
|
|
28
28
|
getPothosInput() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaModel.js","names":[],"sources":["../../../../../../libs/schema/dist/SchemaModel.js"],"sourcesContent":["import \"./EnumType.js\";\nimport \"./FieldType.js\";\nimport * as z from \"zod\";\n\n//#region src/SchemaModel.ts\n/**\n* Named object model built from FieldType/EnumType/SchemaModel fields.\n* Provides zod and GraphQL input helpers, and supports arrays/optional fields.\n*/\nvar SchemaModel = class {\n\tconstructor(config) {\n\t\tthis.config = config;\n\t}\n\t/**\n\t* Build a typed ZodObject from the model fields, preserving each field's\n\t* Zod schema and optionality at the type level when possible.\n\t*/\n\tgetZod() {\n\t\tconst shape = Object.entries(this.config.fields).reduce((acc, [key, def]) => {\n\t\t\tconst base = def.type.getZod();\n\t\t\tconst withArray = def.isArray ? z.array(base) : base;\n\t\t\tacc[key] = def.isOptional ? withArray.optional() : withArray;\n\t\t\treturn acc;\n\t\t}, {});\n\t\treturn z.object(shape);\n\t}\n\t/** Input object name for GraphQL builder adapters. */\n\tgetPothosInput() {\n\t\treturn this.config.name;\n\t}\n};\n/**\n* Helper to define a SchemaModel with type inference.\n* Equivalent to `new SchemaModel(config)` but with better ergonomics.\n*/\nconst defineSchemaModel = (config) => new SchemaModel(config);\n\n//#endregion\nexport { SchemaModel, defineSchemaModel };\n//# sourceMappingURL=SchemaModel.js.map"],"mappings":";;;;;;;;;AASA,IAAI,cAAc,MAAM;CACvB,YAAY,QAAQ;AACnB,OAAK,SAAS;;;;;;CAMf,SAAS;EACR,MAAM,QAAQ,OAAO,QAAQ,KAAK,OAAO,OAAO,CAAC,QAAQ,KAAK,CAAC,KAAK,SAAS;GAC5E,MAAM,OAAO,IAAI,KAAK,QAAQ;GAC9B,MAAM,YAAY,IAAI,UAAU,
|
|
1
|
+
{"version":3,"file":"SchemaModel.js","names":[],"sources":["../../../../../../libs/schema/dist/SchemaModel.js"],"sourcesContent":["import \"./EnumType.js\";\nimport \"./FieldType.js\";\nimport * as z$1 from \"zod\";\n\n//#region src/SchemaModel.ts\n/**\n* Named object model built from FieldType/EnumType/SchemaModel fields.\n* Provides zod and GraphQL input helpers, and supports arrays/optional fields.\n*/\nvar SchemaModel = class {\n\tconstructor(config) {\n\t\tthis.config = config;\n\t}\n\t/**\n\t* Build a typed ZodObject from the model fields, preserving each field's\n\t* Zod schema and optionality at the type level when possible.\n\t*/\n\tgetZod() {\n\t\tconst shape = Object.entries(this.config.fields).reduce((acc, [key, def]) => {\n\t\t\tconst base = def.type.getZod();\n\t\t\tconst withArray = def.isArray ? z$1.array(base) : base;\n\t\t\tacc[key] = def.isOptional ? withArray.optional() : withArray;\n\t\t\treturn acc;\n\t\t}, {});\n\t\treturn z$1.object(shape);\n\t}\n\t/** Input object name for GraphQL builder adapters. */\n\tgetPothosInput() {\n\t\treturn this.config.name;\n\t}\n};\n/**\n* Type guard to check if a value is a SchemaModel (not just any SchemaType).\n* Use this when you need to access SchemaModel-specific properties like `config`.\n*\n* @param model - The model to check\n* @returns True if the model is a SchemaModel instance\n*\n* @example\n* ```typescript\n* if (isSchemaModel(model)) {\n* // TypeScript knows model.config is available\n* console.log(model.config.name);\n* }\n* ```\n*/\nfunction isSchemaModel(model) {\n\treturn model !== null && model !== void 0 && \"config\" in model && typeof model.config === \"object\" && \"name\" in model.config;\n}\n/**\n* Helper to define a SchemaModel with type inference.\n* Equivalent to `new SchemaModel(config)` but with better ergonomics.\n*/\nconst defineSchemaModel = (config) => new SchemaModel(config);\n\n//#endregion\nexport { SchemaModel, defineSchemaModel, isSchemaModel };\n//# sourceMappingURL=SchemaModel.js.map"],"mappings":";;;;;;;;;AASA,IAAI,cAAc,MAAM;CACvB,YAAY,QAAQ;AACnB,OAAK,SAAS;;;;;;CAMf,SAAS;EACR,MAAM,QAAQ,OAAO,QAAQ,KAAK,OAAO,OAAO,CAAC,QAAQ,KAAK,CAAC,KAAK,SAAS;GAC5E,MAAM,OAAO,IAAI,KAAK,QAAQ;GAC9B,MAAM,YAAY,IAAI,UAAU,IAAI,MAAM,KAAK,GAAG;AAClD,OAAI,OAAO,IAAI,aAAa,UAAU,UAAU,GAAG;AACnD,UAAO;KACL,EAAE,CAAC;AACN,SAAO,IAAI,OAAO,MAAM;;;CAGzB,iBAAiB;AAChB,SAAO,KAAK,OAAO;;;;;;;AAyBrB,MAAM,qBAAqB,WAAW,IAAI,YAAY,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "zod";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import "./EnumType.js";
|
|
2
2
|
import { FieldType } from "./FieldType.js";
|
|
3
|
+
import "./GraphQLSchemaType.js";
|
|
4
|
+
import "./JsonSchemaType.js";
|
|
3
5
|
import { ScalarTypeEnum } from "./ScalarTypeEnum.js";
|
|
4
6
|
import { SchemaModel, defineSchemaModel } from "./SchemaModel.js";
|
|
7
|
+
import "./ZodSchemaType.js";
|
|
5
8
|
import "./entity/defineEntity.js";
|
|
6
9
|
import "./entity/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatAttachment } from "../../core/message-types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/presentation/components/ChatInput.d.ts
|
|
5
5
|
interface ChatInputProps {
|
|
@@ -29,7 +29,7 @@ declare function ChatInput({
|
|
|
29
29
|
className,
|
|
30
30
|
showAttachments,
|
|
31
31
|
maxAttachments
|
|
32
|
-
}: ChatInputProps):
|
|
32
|
+
}: ChatInputProps): react_jsx_runtime2.JSX.Element;
|
|
33
33
|
//#endregion
|
|
34
34
|
export { ChatInput };
|
|
35
35
|
//# sourceMappingURL=ChatInput.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatMessage as ChatMessage$1 } from "../../core/message-types.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/presentation/components/ChatMessage.d.ts
|
|
5
5
|
interface ChatMessageProps {
|
|
@@ -18,7 +18,7 @@ declare function ChatMessage({
|
|
|
18
18
|
className,
|
|
19
19
|
showCopy,
|
|
20
20
|
showAvatar
|
|
21
|
-
}: ChatMessageProps):
|
|
21
|
+
}: ChatMessageProps): react_jsx_runtime1.JSX.Element;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { ChatMessage };
|
|
24
24
|
//# sourceMappingURL=ChatMessage.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/presentation/components/CodePreview.d.ts
|
|
4
4
|
interface CodePreviewProps {
|
|
@@ -34,7 +34,7 @@ declare function CodePreview({
|
|
|
34
34
|
onExecute,
|
|
35
35
|
showDownload,
|
|
36
36
|
maxHeight
|
|
37
|
-
}: CodePreviewProps):
|
|
37
|
+
}: CodePreviewProps): react_jsx_runtime0.JSX.Element;
|
|
38
38
|
//#endregion
|
|
39
39
|
export { CodePreview };
|
|
40
40
|
//# sourceMappingURL=CodePreview.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WorkspaceSummary } from "../../context/workspace-context.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/presentation/components/ContextIndicator.d.ts
|
|
5
5
|
interface ContextIndicatorProps {
|
|
@@ -20,7 +20,7 @@ declare function ContextIndicator({
|
|
|
20
20
|
active,
|
|
21
21
|
className,
|
|
22
22
|
showDetails
|
|
23
|
-
}: ContextIndicatorProps):
|
|
23
|
+
}: ContextIndicatorProps): react_jsx_runtime4.JSX.Element;
|
|
24
24
|
//#endregion
|
|
25
25
|
export { ContextIndicator };
|
|
26
26
|
//# sourceMappingURL=ContextIndicator.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
2
2
|
import { ProviderMode, ProviderName } from "@lssm/lib.ai-providers";
|
|
3
3
|
|
|
4
4
|
//#region src/presentation/components/ModelPicker.d.ts
|
|
@@ -33,7 +33,7 @@ declare function ModelPicker({
|
|
|
33
33
|
availableProviders,
|
|
34
34
|
className,
|
|
35
35
|
compact
|
|
36
|
-
}: ModelPickerProps):
|
|
36
|
+
}: ModelPickerProps): react_jsx_runtime3.JSX.Element;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { ModelPicker };
|
|
39
39
|
//# sourceMappingURL=ModelPicker.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/module.ai-chat",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.43.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"test": "bun test"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@lssm/lib.ai-agent": "1.
|
|
27
|
-
"@lssm/lib.ai-providers": "1.
|
|
28
|
-
"@lssm/lib.contracts": "1.
|
|
29
|
-
"@lssm/lib.metering": "1.
|
|
30
|
-
"@lssm/lib.cost-tracking": "1.
|
|
31
|
-
"@lssm/lib.design-system": "1.
|
|
32
|
-
"@lssm/lib.ui-kit-web": "1.
|
|
26
|
+
"@lssm/lib.ai-agent": "1.43.2",
|
|
27
|
+
"@lssm/lib.ai-providers": "1.43.1",
|
|
28
|
+
"@lssm/lib.contracts": "1.43.2",
|
|
29
|
+
"@lssm/lib.metering": "1.43.2",
|
|
30
|
+
"@lssm/lib.cost-tracking": "1.43.1",
|
|
31
|
+
"@lssm/lib.design-system": "1.43.2",
|
|
32
|
+
"@lssm/lib.ui-kit-web": "1.43.1",
|
|
33
33
|
"@ai-sdk/react": "3.0.3",
|
|
34
34
|
"ai": "6.0.3",
|
|
35
35
|
"lucide-react": "^0.535.0",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"zod": "^4.1.13"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@lssm/tool.tsdown": "1.
|
|
41
|
-
"@lssm/tool.typescript": "1.
|
|
40
|
+
"@lssm/tool.tsdown": "1.43.1",
|
|
41
|
+
"@lssm/tool.typescript": "1.43.1",
|
|
42
42
|
"@types/react": "^19.0.14",
|
|
43
43
|
"tsdown": "^0.18.3",
|
|
44
44
|
"typescript": "^5.9.3"
|
|
@@ -75,5 +75,6 @@
|
|
|
75
75
|
"type": "git",
|
|
76
76
|
"url": "https://github.com/lssm-tech/contractspec.git",
|
|
77
77
|
"directory": "packages/modules/ai-chat"
|
|
78
|
-
}
|
|
78
|
+
},
|
|
79
|
+
"homepage": "https://contractspec.io"
|
|
79
80
|
}
|