@typia/interface 12.0.0-dev.20260225

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.
Files changed (311) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +23 -0
  3. package/lib/http/IHttpConnection.d.ts +163 -0
  4. package/lib/http/IHttpConnection.js +4 -0
  5. package/lib/http/IHttpConnection.js.map +1 -0
  6. package/lib/http/IHttpLlmApplication.d.ts +73 -0
  7. package/lib/http/IHttpLlmApplication.js +3 -0
  8. package/lib/http/IHttpLlmApplication.js.map +1 -0
  9. package/lib/http/IHttpLlmController.d.ts +86 -0
  10. package/lib/http/IHttpLlmController.js +3 -0
  11. package/lib/http/IHttpLlmController.js.map +1 -0
  12. package/lib/http/IHttpLlmFunction.d.ts +79 -0
  13. package/lib/http/IHttpLlmFunction.js +3 -0
  14. package/lib/http/IHttpLlmFunction.js.map +1 -0
  15. package/lib/http/IHttpMigrateApplication.d.ts +42 -0
  16. package/lib/http/IHttpMigrateApplication.js +3 -0
  17. package/lib/http/IHttpMigrateApplication.js.map +1 -0
  18. package/lib/http/IHttpMigrateRoute.d.ts +121 -0
  19. package/lib/http/IHttpMigrateRoute.js +3 -0
  20. package/lib/http/IHttpMigrateRoute.js.map +1 -0
  21. package/lib/http/IHttpResponse.d.ts +40 -0
  22. package/lib/http/IHttpResponse.js +3 -0
  23. package/lib/http/IHttpResponse.js.map +1 -0
  24. package/lib/http/index.d.ts +7 -0
  25. package/lib/http/index.js +24 -0
  26. package/lib/http/index.js.map +1 -0
  27. package/lib/index.d.ts +8 -0
  28. package/lib/index.js +48 -0
  29. package/lib/index.js.map +1 -0
  30. package/lib/metadata/IJsDocTagInfo.d.ts +23 -0
  31. package/lib/metadata/IJsDocTagInfo.js +3 -0
  32. package/lib/metadata/IJsDocTagInfo.js.map +1 -0
  33. package/lib/metadata/IMetadataComponents.d.ts +20 -0
  34. package/lib/metadata/IMetadataComponents.js +3 -0
  35. package/lib/metadata/IMetadataComponents.js.map +1 -0
  36. package/lib/metadata/IMetadataSchema.d.ts +219 -0
  37. package/lib/metadata/IMetadataSchema.js +3 -0
  38. package/lib/metadata/IMetadataSchema.js.map +1 -0
  39. package/lib/metadata/IMetadataSchemaCollection.d.ts +18 -0
  40. package/lib/metadata/IMetadataSchemaCollection.js +3 -0
  41. package/lib/metadata/IMetadataSchemaCollection.js.map +1 -0
  42. package/lib/metadata/IMetadataSchemaUnit.d.ts +18 -0
  43. package/lib/metadata/IMetadataSchemaUnit.js +3 -0
  44. package/lib/metadata/IMetadataSchemaUnit.js.map +1 -0
  45. package/lib/metadata/IMetadataTypeTag.d.ts +28 -0
  46. package/lib/metadata/IMetadataTypeTag.js +3 -0
  47. package/lib/metadata/IMetadataTypeTag.js.map +1 -0
  48. package/lib/metadata/index.d.ts +6 -0
  49. package/lib/metadata/index.js +23 -0
  50. package/lib/metadata/index.js.map +1 -0
  51. package/lib/openapi/OpenApi.d.ts +454 -0
  52. package/lib/openapi/OpenApi.js +3 -0
  53. package/lib/openapi/OpenApi.js.map +1 -0
  54. package/lib/openapi/OpenApiV3.d.ts +420 -0
  55. package/lib/openapi/OpenApiV3.js +3 -0
  56. package/lib/openapi/OpenApiV3.js.map +1 -0
  57. package/lib/openapi/OpenApiV3_1.d.ts +463 -0
  58. package/lib/openapi/OpenApiV3_1.js +3 -0
  59. package/lib/openapi/OpenApiV3_1.js.map +1 -0
  60. package/lib/openapi/SwaggerV2.d.ts +343 -0
  61. package/lib/openapi/SwaggerV2.js +3 -0
  62. package/lib/openapi/SwaggerV2.js.map +1 -0
  63. package/lib/openapi/index.d.ts +4 -0
  64. package/lib/openapi/index.js +21 -0
  65. package/lib/openapi/index.js.map +1 -0
  66. package/lib/protobuf/ProtobufWire.d.ts +46 -0
  67. package/lib/protobuf/ProtobufWire.js +3 -0
  68. package/lib/protobuf/ProtobufWire.js.map +1 -0
  69. package/lib/protobuf/index.d.ts +1 -0
  70. package/lib/protobuf/index.js +18 -0
  71. package/lib/protobuf/index.js.map +1 -0
  72. package/lib/schema/IJsonSchemaApplication.d.ts +232 -0
  73. package/lib/schema/IJsonSchemaApplication.js +3 -0
  74. package/lib/schema/IJsonSchemaApplication.js.map +1 -0
  75. package/lib/schema/IJsonSchemaAttribute.d.ts +152 -0
  76. package/lib/schema/IJsonSchemaAttribute.js +3 -0
  77. package/lib/schema/IJsonSchemaAttribute.js.map +1 -0
  78. package/lib/schema/IJsonSchemaCollection.d.ts +109 -0
  79. package/lib/schema/IJsonSchemaCollection.js +3 -0
  80. package/lib/schema/IJsonSchemaCollection.js.map +1 -0
  81. package/lib/schema/IJsonSchemaTransformError.d.ts +81 -0
  82. package/lib/schema/IJsonSchemaTransformError.js +3 -0
  83. package/lib/schema/IJsonSchemaTransformError.js.map +1 -0
  84. package/lib/schema/IJsonSchemaUnit.d.ts +106 -0
  85. package/lib/schema/IJsonSchemaUnit.js +3 -0
  86. package/lib/schema/IJsonSchemaUnit.js.map +1 -0
  87. package/lib/schema/ILlmApplication.d.ts +95 -0
  88. package/lib/schema/ILlmApplication.js +3 -0
  89. package/lib/schema/ILlmApplication.js.map +1 -0
  90. package/lib/schema/ILlmController.d.ts +53 -0
  91. package/lib/schema/ILlmController.js +3 -0
  92. package/lib/schema/ILlmController.js.map +1 -0
  93. package/lib/schema/ILlmFunction.d.ts +134 -0
  94. package/lib/schema/ILlmFunction.js +3 -0
  95. package/lib/schema/ILlmFunction.js.map +1 -0
  96. package/lib/schema/ILlmSchema.d.ts +412 -0
  97. package/lib/schema/ILlmSchema.js +3 -0
  98. package/lib/schema/ILlmSchema.js.map +1 -0
  99. package/lib/schema/IResult.d.ts +81 -0
  100. package/lib/schema/IResult.js +3 -0
  101. package/lib/schema/IResult.js.map +1 -0
  102. package/lib/schema/IValidation.d.ts +123 -0
  103. package/lib/schema/IValidation.js +3 -0
  104. package/lib/schema/IValidation.js.map +1 -0
  105. package/lib/schema/index.d.ts +11 -0
  106. package/lib/schema/index.js +28 -0
  107. package/lib/schema/index.js.map +1 -0
  108. package/lib/tags/Constant.d.ts +44 -0
  109. package/lib/tags/Constant.js +3 -0
  110. package/lib/tags/Constant.js.map +1 -0
  111. package/lib/tags/ContentMediaType.d.ts +39 -0
  112. package/lib/tags/ContentMediaType.js +3 -0
  113. package/lib/tags/ContentMediaType.js.map +1 -0
  114. package/lib/tags/Default.d.ts +42 -0
  115. package/lib/tags/Default.js +3 -0
  116. package/lib/tags/Default.js.map +1 -0
  117. package/lib/tags/Example.d.ts +38 -0
  118. package/lib/tags/Example.js +3 -0
  119. package/lib/tags/Example.js.map +1 -0
  120. package/lib/tags/Examples.d.ts +44 -0
  121. package/lib/tags/Examples.js +3 -0
  122. package/lib/tags/Examples.js.map +1 -0
  123. package/lib/tags/ExclusiveMaximum.d.ts +39 -0
  124. package/lib/tags/ExclusiveMaximum.js +3 -0
  125. package/lib/tags/ExclusiveMaximum.js.map +1 -0
  126. package/lib/tags/ExclusiveMinimum.d.ts +39 -0
  127. package/lib/tags/ExclusiveMinimum.js +3 -0
  128. package/lib/tags/ExclusiveMinimum.js.map +1 -0
  129. package/lib/tags/Format.d.ts +43 -0
  130. package/lib/tags/Format.js +3 -0
  131. package/lib/tags/Format.js.map +1 -0
  132. package/lib/tags/JsonSchemaPlugin.d.ts +44 -0
  133. package/lib/tags/JsonSchemaPlugin.js +3 -0
  134. package/lib/tags/JsonSchemaPlugin.js.map +1 -0
  135. package/lib/tags/MaxItems.d.ts +38 -0
  136. package/lib/tags/MaxItems.js +3 -0
  137. package/lib/tags/MaxItems.js.map +1 -0
  138. package/lib/tags/MaxLength.d.ts +36 -0
  139. package/lib/tags/MaxLength.js +3 -0
  140. package/lib/tags/MaxLength.js.map +1 -0
  141. package/lib/tags/Maximum.d.ts +41 -0
  142. package/lib/tags/Maximum.js +3 -0
  143. package/lib/tags/Maximum.js.map +1 -0
  144. package/lib/tags/MinItems.d.ts +38 -0
  145. package/lib/tags/MinItems.js +3 -0
  146. package/lib/tags/MinItems.js.map +1 -0
  147. package/lib/tags/MinLength.d.ts +36 -0
  148. package/lib/tags/MinLength.js +3 -0
  149. package/lib/tags/MinLength.js.map +1 -0
  150. package/lib/tags/Minimum.d.ts +41 -0
  151. package/lib/tags/Minimum.js +3 -0
  152. package/lib/tags/Minimum.js.map +1 -0
  153. package/lib/tags/MultipleOf.d.ts +49 -0
  154. package/lib/tags/MultipleOf.js +3 -0
  155. package/lib/tags/MultipleOf.js.map +1 -0
  156. package/lib/tags/Pattern.d.ts +51 -0
  157. package/lib/tags/Pattern.js +3 -0
  158. package/lib/tags/Pattern.js.map +1 -0
  159. package/lib/tags/Sequence.d.ts +42 -0
  160. package/lib/tags/Sequence.js +3 -0
  161. package/lib/tags/Sequence.js.map +1 -0
  162. package/lib/tags/TagBase.d.ts +109 -0
  163. package/lib/tags/TagBase.js +3 -0
  164. package/lib/tags/TagBase.js.map +1 -0
  165. package/lib/tags/Type.d.ts +53 -0
  166. package/lib/tags/Type.js +3 -0
  167. package/lib/tags/Type.js.map +1 -0
  168. package/lib/tags/UniqueItems.d.ts +41 -0
  169. package/lib/tags/UniqueItems.js +3 -0
  170. package/lib/tags/UniqueItems.js.map +1 -0
  171. package/lib/tags/index.d.ts +21 -0
  172. package/lib/tags/index.js +38 -0
  173. package/lib/tags/index.js.map +1 -0
  174. package/lib/typings/AssertionGuard.d.ts +12 -0
  175. package/lib/typings/AssertionGuard.js +3 -0
  176. package/lib/typings/AssertionGuard.js.map +1 -0
  177. package/lib/typings/Atomic.d.ts +19 -0
  178. package/lib/typings/Atomic.js +3 -0
  179. package/lib/typings/Atomic.js.map +1 -0
  180. package/lib/typings/CamelCase.d.ts +26 -0
  181. package/lib/typings/CamelCase.js +3 -0
  182. package/lib/typings/CamelCase.js.map +1 -0
  183. package/lib/typings/ClassProperties.d.ts +14 -0
  184. package/lib/typings/ClassProperties.js +3 -0
  185. package/lib/typings/ClassProperties.js.map +1 -0
  186. package/lib/typings/OmitNever.d.ts +11 -0
  187. package/lib/typings/OmitNever.js +3 -0
  188. package/lib/typings/OmitNever.js.map +1 -0
  189. package/lib/typings/PascalCase.d.ts +25 -0
  190. package/lib/typings/PascalCase.js +3 -0
  191. package/lib/typings/PascalCase.js.map +1 -0
  192. package/lib/typings/Primitive.d.ts +29 -0
  193. package/lib/typings/Primitive.js +3 -0
  194. package/lib/typings/Primitive.js.map +1 -0
  195. package/lib/typings/ProtobufAtomic.d.ts +15 -0
  196. package/lib/typings/ProtobufAtomic.js +3 -0
  197. package/lib/typings/ProtobufAtomic.js.map +1 -0
  198. package/lib/typings/Resolved.d.ts +23 -0
  199. package/lib/typings/Resolved.js +3 -0
  200. package/lib/typings/Resolved.js.map +1 -0
  201. package/lib/typings/SnakeCase.d.ts +31 -0
  202. package/lib/typings/SnakeCase.js +3 -0
  203. package/lib/typings/SnakeCase.js.map +1 -0
  204. package/lib/typings/SpecialFields.d.ts +13 -0
  205. package/lib/typings/SpecialFields.js +3 -0
  206. package/lib/typings/SpecialFields.js.map +1 -0
  207. package/lib/typings/ValidationPipe.d.ts +18 -0
  208. package/lib/typings/ValidationPipe.js +3 -0
  209. package/lib/typings/ValidationPipe.js.map +1 -0
  210. package/lib/typings/index.d.ts +12 -0
  211. package/lib/typings/index.js +29 -0
  212. package/lib/typings/index.js.map +1 -0
  213. package/lib/typings/internal/Equal.d.ts +11 -0
  214. package/lib/typings/internal/Equal.js +3 -0
  215. package/lib/typings/internal/Equal.js.map +1 -0
  216. package/lib/typings/internal/IsTuple.d.ts +13 -0
  217. package/lib/typings/internal/IsTuple.js +3 -0
  218. package/lib/typings/internal/IsTuple.js.map +1 -0
  219. package/lib/typings/internal/NativeClass.d.ts +9 -0
  220. package/lib/typings/internal/NativeClass.js +3 -0
  221. package/lib/typings/internal/NativeClass.js.map +1 -0
  222. package/lib/typings/internal/ValueOf.d.ts +15 -0
  223. package/lib/typings/internal/ValueOf.js +3 -0
  224. package/lib/typings/internal/ValueOf.js.map +1 -0
  225. package/lib/utils/IRandomGenerator.d.ts +68 -0
  226. package/lib/utils/IRandomGenerator.js +3 -0
  227. package/lib/utils/IRandomGenerator.js.map +1 -0
  228. package/lib/utils/IReadableURLSearchParams.d.ts +22 -0
  229. package/lib/utils/IReadableURLSearchParams.js +3 -0
  230. package/lib/utils/IReadableURLSearchParams.js.map +1 -0
  231. package/lib/utils/index.d.ts +2 -0
  232. package/lib/utils/index.js +19 -0
  233. package/lib/utils/index.js.map +1 -0
  234. package/package.json +79 -0
  235. package/src/http/IHttpConnection.ts +200 -0
  236. package/src/http/IHttpLlmApplication.ts +83 -0
  237. package/src/http/IHttpLlmController.ts +96 -0
  238. package/src/http/IHttpLlmFunction.ts +93 -0
  239. package/src/http/IHttpMigrateApplication.ts +48 -0
  240. package/src/http/IHttpMigrateRoute.ts +165 -0
  241. package/src/http/IHttpResponse.ts +42 -0
  242. package/src/http/index.ts +7 -0
  243. package/src/index.ts +9 -0
  244. package/src/metadata/IJsDocTagInfo.ts +25 -0
  245. package/src/metadata/IMetadataComponents.ts +24 -0
  246. package/src/metadata/IMetadataSchema.ts +293 -0
  247. package/src/metadata/IMetadataSchemaCollection.ts +20 -0
  248. package/src/metadata/IMetadataSchemaUnit.ts +20 -0
  249. package/src/metadata/IMetadataTypeTag.ts +39 -0
  250. package/src/metadata/index.ts +6 -0
  251. package/src/openapi/OpenApi.ts +643 -0
  252. package/src/openapi/OpenApiV3.ts +655 -0
  253. package/src/openapi/OpenApiV3_1.ts +735 -0
  254. package/src/openapi/SwaggerV2.ts +559 -0
  255. package/src/openapi/index.ts +4 -0
  256. package/src/protobuf/ProtobufWire.ts +51 -0
  257. package/src/protobuf/index.ts +1 -0
  258. package/src/schema/IJsonSchemaApplication.ts +274 -0
  259. package/src/schema/IJsonSchemaAttribute.ts +158 -0
  260. package/src/schema/IJsonSchemaCollection.ts +123 -0
  261. package/src/schema/IJsonSchemaTransformError.ts +86 -0
  262. package/src/schema/IJsonSchemaUnit.ts +120 -0
  263. package/src/schema/ILlmApplication.ts +103 -0
  264. package/src/schema/ILlmController.ts +57 -0
  265. package/src/schema/ILlmFunction.ts +144 -0
  266. package/src/schema/ILlmSchema.ts +484 -0
  267. package/src/schema/IResult.ts +84 -0
  268. package/src/schema/IValidation.ts +134 -0
  269. package/src/schema/index.ts +13 -0
  270. package/src/tags/Constant.ts +49 -0
  271. package/src/tags/ContentMediaType.ts +40 -0
  272. package/src/tags/Default.ts +50 -0
  273. package/src/tags/Example.ts +48 -0
  274. package/src/tags/Examples.ts +50 -0
  275. package/src/tags/ExclusiveMaximum.ts +46 -0
  276. package/src/tags/ExclusiveMinimum.ts +46 -0
  277. package/src/tags/Format.ts +76 -0
  278. package/src/tags/JsonSchemaPlugin.ts +45 -0
  279. package/src/tags/MaxItems.ts +39 -0
  280. package/src/tags/MaxLength.ts +37 -0
  281. package/src/tags/Maximum.ts +44 -0
  282. package/src/tags/MinItems.ts +39 -0
  283. package/src/tags/MinLength.ts +37 -0
  284. package/src/tags/Minimum.ts +44 -0
  285. package/src/tags/MultipleOf.ts +54 -0
  286. package/src/tags/Pattern.ts +59 -0
  287. package/src/tags/Sequence.ts +43 -0
  288. package/src/tags/TagBase.ts +131 -0
  289. package/src/tags/Type.ts +70 -0
  290. package/src/tags/UniqueItems.ts +44 -0
  291. package/src/tags/index.ts +21 -0
  292. package/src/typings/AssertionGuard.ts +12 -0
  293. package/src/typings/Atomic.ts +21 -0
  294. package/src/typings/CamelCase.ts +75 -0
  295. package/src/typings/ClassProperties.ts +15 -0
  296. package/src/typings/OmitNever.ts +12 -0
  297. package/src/typings/PascalCase.ts +71 -0
  298. package/src/typings/Primitive.ts +71 -0
  299. package/src/typings/ProtobufAtomic.ts +30 -0
  300. package/src/typings/Resolved.ts +58 -0
  301. package/src/typings/SnakeCase.ts +126 -0
  302. package/src/typings/SpecialFields.ts +13 -0
  303. package/src/typings/ValidationPipe.ts +20 -0
  304. package/src/typings/index.ts +13 -0
  305. package/src/typings/internal/Equal.ts +14 -0
  306. package/src/typings/internal/IsTuple.ts +17 -0
  307. package/src/typings/internal/NativeClass.ts +31 -0
  308. package/src/typings/internal/ValueOf.ts +29 -0
  309. package/src/utils/IRandomGenerator.ts +105 -0
  310. package/src/utils/IReadableURLSearchParams.ts +25 -0
  311. package/src/utils/index.ts +2 -0
@@ -0,0 +1,106 @@
1
+ import { OpenApi } from "../openapi/OpenApi";
2
+ import { OpenApiV3 } from "../openapi/OpenApiV3";
3
+ /**
4
+ * Single JSON schema unit for one TypeScript type.
5
+ *
6
+ * `IJsonSchemaUnit` represents a complete JSON schema for a single TypeScript
7
+ * type, including the main schema definition and any referenced component
8
+ * schemas. Generated by `typia.json.schema<T>()` at compile time.
9
+ *
10
+ * The result contains:
11
+ *
12
+ * - {@link IV3_0.schema | schema}: The main JSON schema for the type
13
+ * - {@link IV3_0.components | components}: Shared schemas referenced via `$ref`
14
+ * - {@link IV3_0.__type | __type}: Phantom property for TypeScript type inference
15
+ *
16
+ * Use this for single-type schema generation. For multiple types, see
17
+ * {@link IJsonSchemaCollection}. For function schemas, see
18
+ * {@link IJsonSchemaApplication}.
19
+ *
20
+ * @author Jeongho Nam - https://github.com/samchon
21
+ * @template Version OpenAPI version ("3.0" or "3.1")
22
+ * @template Type Original TypeScript type
23
+ */
24
+ export type IJsonSchemaUnit<Version extends "3.0" | "3.1" = "3.1", Type = unknown> = Version extends "3.0" ? IJsonSchemaUnit.IV3_0<Type> : IJsonSchemaUnit.IV3_1<Type>;
25
+ export declare namespace IJsonSchemaUnit {
26
+ /**
27
+ * JSON Schema unit for OpenAPI v3.0 specification.
28
+ *
29
+ * Uses OpenAPI v3.0 compatible JSON Schema format. In v3.0, nullable types
30
+ * are expressed with `nullable: true` rather than v3.1's `type: ["string",
31
+ * "null"]`.
32
+ *
33
+ * @template Type Original TypeScript type for phantom type preservation
34
+ */
35
+ interface IV3_0<Type> {
36
+ /**
37
+ * OpenAPI specification version.
38
+ *
39
+ * Always `"3.0"` for this variant. Use this discriminator to determine
40
+ * which schema format is in use.
41
+ */
42
+ version: "3.0";
43
+ /**
44
+ * The main JSON schema definition for the type.
45
+ *
46
+ * Contains the complete schema for the target TypeScript type. May include
47
+ * `$ref` references to schemas in {@link components}.
48
+ */
49
+ schema: OpenApiV3.IJsonSchema;
50
+ /**
51
+ * Reusable schema definitions for `$ref` references.
52
+ *
53
+ * Contains named schemas that can be referenced throughout the main schema.
54
+ * Essential for recursive types and reducing duplication.
55
+ */
56
+ components: OpenApiV3.IComponents;
57
+ /**
58
+ * Phantom property for TypeScript generic type preservation.
59
+ *
60
+ * This property exists only in the type system to preserve the `Type`
61
+ * generic parameter. It is always `undefined` at runtime and should not be
62
+ * accessed or used in application code.
63
+ */
64
+ __type?: Type | undefined;
65
+ }
66
+ /**
67
+ * JSON Schema unit for OpenAPI v3.1 specification.
68
+ *
69
+ * Uses OpenAPI v3.1 compatible JSON Schema format. v3.1 aligns more closely
70
+ * with JSON Schema draft 2020-12, supporting features like `type` arrays for
71
+ * nullable types and `const` values.
72
+ *
73
+ * @template Type Original TypeScript type for phantom type preservation
74
+ */
75
+ interface IV3_1<Type> {
76
+ /**
77
+ * OpenAPI specification version.
78
+ *
79
+ * Always `"3.1"` for this variant. Use this discriminator to determine
80
+ * which schema format is in use.
81
+ */
82
+ version: "3.1";
83
+ /**
84
+ * The main JSON schema definition for the type.
85
+ *
86
+ * Contains the complete schema for the target TypeScript type. May include
87
+ * `$ref` references to schemas in {@link components}.
88
+ */
89
+ schema: OpenApi.IJsonSchema;
90
+ /**
91
+ * Reusable schema definitions for `$ref` references.
92
+ *
93
+ * Contains named schemas that can be referenced throughout the main schema.
94
+ * Essential for recursive types and reducing duplication.
95
+ */
96
+ components: OpenApi.IComponents;
97
+ /**
98
+ * Phantom property for TypeScript generic type preservation.
99
+ *
100
+ * This property exists only in the type system to preserve the `Type`
101
+ * generic parameter. It is always `undefined` at runtime and should not be
102
+ * accessed or used in application code.
103
+ */
104
+ __type?: Type | undefined;
105
+ }
106
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IJsonSchemaUnit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IJsonSchemaUnit.js","sourceRoot":"","sources":["../../src/schema/IJsonSchemaUnit.ts"],"names":[],"mappings":""}
@@ -0,0 +1,95 @@
1
+ import { ILlmFunction } from "./ILlmFunction";
2
+ import { ILlmSchema } from "./ILlmSchema";
3
+ import { IValidation } from "./IValidation";
4
+ /**
5
+ * LLM function calling application.
6
+ *
7
+ * `ILlmApplication` is a collection of {@link ILlmFunction} schemas generated
8
+ * from a TypeScript class or interface by `typia.llm.application<App>()`. Each
9
+ * public method becomes an {@link ILlmFunction} that LLM agents can invoke.
10
+ *
11
+ * Configure behavior via {@link ILlmApplication.IConfig}:
12
+ *
13
+ * - {@link ILlmApplication.IConfig.separate}: Split parameters into LLM-fillable
14
+ * vs human-required (e.g., file uploads, passwords)
15
+ * - {@link ILlmApplication.IConfig.validate}: Custom validation per method
16
+ * - {@link ILlmSchema.IConfig.strict}: OpenAI structured output mode
17
+ * - {@link ILlmSchema.IConfig.reference}: Control `$ref` inlining behavior
18
+ *
19
+ * @author Jeongho Nam - https://github.com/samchon
20
+ * @template Class Source class/interface type
21
+ */
22
+ export interface ILlmApplication<Class extends object = any> {
23
+ /**
24
+ * Array of callable function schemas.
25
+ *
26
+ * Each function represents a method from the source class that the LLM can
27
+ * invoke. Functions include parameter schemas, descriptions, and validation
28
+ * logic for type-safe function calling.
29
+ */
30
+ functions: ILlmFunction[];
31
+ /**
32
+ * Configuration used to generate this application.
33
+ *
34
+ * Contains the settings that were applied during schema generation, including
35
+ * reference handling, strict mode, and parameter separation.
36
+ */
37
+ config: ILlmApplication.IConfig<Class>;
38
+ /**
39
+ * Phantom property for TypeScript generic type preservation.
40
+ *
41
+ * This property exists only in the type system to preserve the `Class`
42
+ * generic parameter at compile time. It is always `undefined` at runtime and
43
+ * should not be accessed or used in application code.
44
+ *
45
+ * This pattern enables type inference to recover the original class type from
46
+ * an `ILlmApplication` instance, useful for type-safe function routing.
47
+ */
48
+ __class?: Class | undefined;
49
+ }
50
+ export declare namespace ILlmApplication {
51
+ /**
52
+ * Configuration for LLM application generation.
53
+ *
54
+ * Extends {@link ILlmSchema.IConfig} with application-specific options for
55
+ * parameter separation and custom validation. These settings control how the
56
+ * application schema is generated from the source class.
57
+ */
58
+ interface IConfig<Class extends object = any> extends ILlmSchema.IConfig {
59
+ /**
60
+ * Function to separate LLM-fillable from human-required parameters.
61
+ *
62
+ * When provided, this function is called for each parameter schema to
63
+ * determine if it should be filled by the LLM (`false`) or require human
64
+ * input (`true`). Use this for sensitive data like passwords, file uploads,
65
+ * or data the LLM cannot generate.
66
+ *
67
+ * @default null (no separation)
68
+ * @param schema - The parameter schema to evaluate
69
+ * @returns `true` if human input required, `false` if LLM can fill
70
+ */
71
+ separate: null | ((schema: ILlmSchema) => boolean);
72
+ /**
73
+ * Custom validation functions per method name.
74
+ *
75
+ * Allows overriding the default type-based validation with custom business
76
+ * logic. Useful for complex validation rules that cannot be expressed in
77
+ * JSON Schema.
78
+ *
79
+ * @default null (use default type validation)
80
+ */
81
+ validate: null | Partial<ILlmApplication.IValidationHook<Class>>;
82
+ }
83
+ /**
84
+ * Type-safe mapping of method names to custom validators.
85
+ *
86
+ * Maps each method name to a validation function that receives the raw input
87
+ * and returns a validation result. The type inference ensures validators
88
+ * match the expected argument types.
89
+ *
90
+ * @template Class - The source class type for type inference
91
+ */
92
+ type IValidationHook<Class extends object> = {
93
+ [K in keyof Class]?: Class[K] extends (args: infer Argument) => unknown ? (input: unknown) => IValidation<Argument> : never;
94
+ };
95
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ILlmApplication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ILlmApplication.js","sourceRoot":"","sources":["../../src/schema/ILlmApplication.ts"],"names":[],"mappings":""}
@@ -0,0 +1,53 @@
1
+ import { ILlmApplication } from "./ILlmApplication";
2
+ /**
3
+ * Controller of TypeScript class-based LLM function calling.
4
+ *
5
+ * `ILlmController` is a controller for registering TypeScript class methods as
6
+ * LLM function calling tools. It contains {@link ILlmApplication} with
7
+ * {@link ILlmFunction function calling schemas}, {@link name identifier}, and
8
+ * {@link execute class instance} for method execution.
9
+ *
10
+ * You can create this controller with `typia.llm.controller<Class>()` function,
11
+ * and register it to MCP server with {@link registerMcpControllers}:
12
+ *
13
+ * ```typescript
14
+ * import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
15
+ * import typia from "typia";
16
+ * import { registerMcpControllers } from "@typia/mcp";
17
+ *
18
+ * class Calculator {
19
+ * add(input: { a: number; b: number }): number {
20
+ * return input.a + input.b;
21
+ * }
22
+ * subtract(input: { a: number; b: number }): number {
23
+ * return input.a - input.b;
24
+ * }
25
+ * }
26
+ *
27
+ * const server = new McpServer({ name: "my-server", version: "1.0.0" });
28
+ * registerMcpControllers({
29
+ * server,
30
+ * controllers: [
31
+ * typia.llm.controller<Calculator>(
32
+ * "calculator",
33
+ * new Calculator(),
34
+ * ),
35
+ * ],
36
+ * });
37
+ * ```
38
+ *
39
+ * For OpenAPI/HTTP-based controller, use {@link IHttpLlmController} instead.
40
+ *
41
+ * @author Jeongho Nam - https://github.com/samchon
42
+ * @template Class Class type of the function executor
43
+ */
44
+ export interface ILlmController<Class extends object = any> {
45
+ /** Protocol discriminator. */
46
+ protocol: "class";
47
+ /** Identifier name of the controller. */
48
+ name: string;
49
+ /** Application schema of function calling. */
50
+ application: ILlmApplication<Class>;
51
+ /** Target class instance for function execution. */
52
+ execute: Class;
53
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ILlmController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ILlmController.js","sourceRoot":"","sources":["../../src/schema/ILlmController.ts"],"names":[],"mappings":""}
@@ -0,0 +1,134 @@
1
+ import { ILlmSchema } from "./ILlmSchema";
2
+ import { IValidation } from "./IValidation";
3
+ /**
4
+ * LLM function calling metadata.
5
+ *
6
+ * `ILlmFunction` describes a single callable function for LLM agents. Generated
7
+ * as part of {@link ILlmApplication} by `typia.llm.application<App>()`.
8
+ *
9
+ * Contains the function {@link name} (max 64 chars for OpenAI),
10
+ * {@link parameters} schema for input types, optional {@link output} schema for
11
+ * return type, and {@link description} for LLM to understand the function's
12
+ * purpose.
13
+ *
14
+ * The built-in {@link validate} function checks LLM-generated arguments against
15
+ * the schema, enabling auto-correction when the LLM makes type errors (e.g.,
16
+ * returning `"123"` instead of `123`).
17
+ *
18
+ * Use {@link separated} when some parameters require human input (files,
19
+ * passwords) via {@link ILlmApplication.IConfig.separate}.
20
+ *
21
+ * @author Jeongho Nam - https://github.com/samchon
22
+ */
23
+ export interface ILlmFunction {
24
+ /**
25
+ * Function name for LLM invocation.
26
+ *
27
+ * The identifier used by the LLM to call this function. Must be unique within
28
+ * the application. OpenAI limits function names to 64 characters.
29
+ *
30
+ * @maxLength 64
31
+ */
32
+ name: string;
33
+ /**
34
+ * Schema for function parameters.
35
+ *
36
+ * Defines the expected argument types as a JSON Schema object. Contains
37
+ * `$defs` for shared type definitions and `properties` for each named
38
+ * parameter.
39
+ */
40
+ parameters: ILlmSchema.IParameters;
41
+ /**
42
+ * Parameters split between LLM and human input.
43
+ *
44
+ * Present when {@link ILlmApplication.IConfig.separate} is configured. Allows
45
+ * separating parameters that the LLM can fill from those requiring human
46
+ * input (e.g., file uploads, passwords).
47
+ */
48
+ separated?: ILlmFunction.ISeparated;
49
+ /**
50
+ * Schema for the return type.
51
+ *
52
+ * Defines the expected output type as a JSON Schema. `undefined` when the
53
+ * function returns `void` or has no meaningful return value.
54
+ */
55
+ output?: ILlmSchema | undefined;
56
+ /**
57
+ * Human-readable function description.
58
+ *
59
+ * Explains what the function does, when to use it, and any important
60
+ * considerations. This description is crucial for LLMs to understand when to
61
+ * invoke this function. Extracted from JSDoc comments.
62
+ */
63
+ description?: string | undefined;
64
+ /**
65
+ * Whether this function is deprecated.
66
+ *
67
+ * When `true`, indicates the function should no longer be used. LLMs may
68
+ * still invoke deprecated functions but should prefer non-deprecated
69
+ * alternatives when available.
70
+ */
71
+ deprecated?: boolean | undefined;
72
+ /**
73
+ * Category tags for function organization.
74
+ *
75
+ * Extracted from `@tag` JSDoc annotations. Useful for grouping related
76
+ * functions and filtering the function list.
77
+ */
78
+ tags?: string[] | undefined;
79
+ /**
80
+ * Validates LLM-generated arguments against the schema.
81
+ *
82
+ * LLMs frequently make type errors such as returning strings instead of
83
+ * numbers or missing required properties. Use this validator to check
84
+ * arguments before execution.
85
+ *
86
+ * When validation fails, use `stringifyValidationFailure()` from
87
+ * `@typia/utils` to format the error for LLM feedback. The formatted output
88
+ * shows the invalid JSON with inline error comments, helping the LLM
89
+ * understand and correct its mistakes in the next turn.
90
+ *
91
+ * @param args The arguments generated by the LLM
92
+ * @returns Validation result with success status and any errors
93
+ * @see stringifyValidationFailure Format errors for LLM auto-correction
94
+ */
95
+ validate: (args: unknown) => IValidation<unknown>;
96
+ }
97
+ export declare namespace ILlmFunction {
98
+ /**
99
+ * Separated parameter schemas for hybrid LLM/human input.
100
+ *
101
+ * When a function has parameters that cannot or should not be filled by the
102
+ * LLM (e.g., file uploads, passwords, sensitive data), the parameters are
103
+ * split into two schemas.
104
+ */
105
+ interface ISeparated {
106
+ /**
107
+ * Parameters the LLM should fill.
108
+ *
109
+ * Contains only the parameters that are safe and appropriate for the LLM to
110
+ * generate values for.
111
+ */
112
+ llm: ILlmSchema.IParameters;
113
+ /**
114
+ * Parameters requiring human input.
115
+ *
116
+ * Contains parameters that must be provided by the user directly, such as
117
+ * file uploads, passwords, or other sensitive data. `null` when all
118
+ * parameters can be filled by the LLM.
119
+ */
120
+ human: ILlmSchema.IParameters | null;
121
+ /**
122
+ * Validates the LLM portion of separated parameters.
123
+ *
124
+ * Validates only the LLM-fillable portion, allowing human parameters to be
125
+ * validated separately with appropriate handling.
126
+ *
127
+ * When validation fails, use `stringifyValidationFailure()` from
128
+ * `@typia/utils` to format the error for LLM feedback.
129
+ *
130
+ * @see stringifyValidationFailure Format errors for LLM auto-correction
131
+ */
132
+ validate?: ((args: unknown) => IValidation<unknown>) | undefined;
133
+ }
134
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ILlmFunction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ILlmFunction.js","sourceRoot":"","sources":["../../src/schema/ILlmFunction.ts"],"names":[],"mappings":""}