@vinkius-core/mcp-fusion 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +391 -0
  3. package/dist/src/AbstractBase.d.ts +24 -0
  4. package/dist/src/AbstractBase.d.ts.map +1 -0
  5. package/dist/src/AbstractBase.js +63 -0
  6. package/dist/src/AbstractBase.js.map +1 -0
  7. package/dist/src/AbstractLeaf.d.ts +12 -0
  8. package/dist/src/AbstractLeaf.d.ts.map +1 -0
  9. package/dist/src/AbstractLeaf.js +32 -0
  10. package/dist/src/AbstractLeaf.js.map +1 -0
  11. package/dist/src/Annotations.d.ts +15 -0
  12. package/dist/src/Annotations.d.ts.map +1 -0
  13. package/dist/src/Annotations.js +29 -0
  14. package/dist/src/Annotations.js.map +1 -0
  15. package/dist/src/Group.d.ts +32 -0
  16. package/dist/src/Group.d.ts.map +1 -0
  17. package/dist/src/Group.js +131 -0
  18. package/dist/src/Group.js.map +1 -0
  19. package/dist/src/Icon.d.ts +19 -0
  20. package/dist/src/Icon.d.ts.map +1 -0
  21. package/dist/src/Icon.js +33 -0
  22. package/dist/src/Icon.js.map +1 -0
  23. package/dist/src/Prompt.d.ts +11 -0
  24. package/dist/src/Prompt.d.ts.map +1 -0
  25. package/dist/src/Prompt.js +28 -0
  26. package/dist/src/Prompt.js.map +1 -0
  27. package/dist/src/PromptArgument.d.ts +10 -0
  28. package/dist/src/PromptArgument.d.ts.map +1 -0
  29. package/dist/src/PromptArgument.js +20 -0
  30. package/dist/src/PromptArgument.js.map +1 -0
  31. package/dist/src/Resource.d.ts +19 -0
  32. package/dist/src/Resource.d.ts.map +1 -0
  33. package/dist/src/Resource.js +34 -0
  34. package/dist/src/Resource.js.map +1 -0
  35. package/dist/src/Role.d.ts +5 -0
  36. package/dist/src/Role.d.ts.map +1 -0
  37. package/dist/src/Role.js +6 -0
  38. package/dist/src/Role.js.map +1 -0
  39. package/dist/src/Tool.d.ts +16 -0
  40. package/dist/src/Tool.d.ts.map +1 -0
  41. package/dist/src/Tool.js +28 -0
  42. package/dist/src/Tool.js.map +1 -0
  43. package/dist/src/ToolAnnotations.d.ts +23 -0
  44. package/dist/src/ToolAnnotations.d.ts.map +1 -0
  45. package/dist/src/ToolAnnotations.js +44 -0
  46. package/dist/src/ToolAnnotations.js.map +1 -0
  47. package/dist/src/converters/GroupConverter.d.ts +14 -0
  48. package/dist/src/converters/GroupConverter.d.ts.map +1 -0
  49. package/dist/src/converters/GroupConverter.js +13 -0
  50. package/dist/src/converters/GroupConverter.js.map +1 -0
  51. package/dist/src/converters/PromptConverter.d.ts +14 -0
  52. package/dist/src/converters/PromptConverter.d.ts.map +1 -0
  53. package/dist/src/converters/PromptConverter.js +13 -0
  54. package/dist/src/converters/PromptConverter.js.map +1 -0
  55. package/dist/src/converters/ResourceConverter.d.ts +14 -0
  56. package/dist/src/converters/ResourceConverter.d.ts.map +1 -0
  57. package/dist/src/converters/ResourceConverter.js +13 -0
  58. package/dist/src/converters/ResourceConverter.js.map +1 -0
  59. package/dist/src/converters/ToolAnnotationsConverter.d.ts +16 -0
  60. package/dist/src/converters/ToolAnnotationsConverter.d.ts.map +1 -0
  61. package/dist/src/converters/ToolAnnotationsConverter.js +23 -0
  62. package/dist/src/converters/ToolAnnotationsConverter.js.map +1 -0
  63. package/dist/src/converters/ToolConverter.d.ts +14 -0
  64. package/dist/src/converters/ToolConverter.d.ts.map +1 -0
  65. package/dist/src/converters/ToolConverter.js +13 -0
  66. package/dist/src/converters/ToolConverter.js.map +1 -0
  67. package/dist/src/converters/index.d.ts +6 -0
  68. package/dist/src/converters/index.d.ts.map +1 -0
  69. package/dist/src/converters/index.js +6 -0
  70. package/dist/src/converters/index.js.map +1 -0
  71. package/dist/src/framework/GroupedToolBuilder.d.ts +137 -0
  72. package/dist/src/framework/GroupedToolBuilder.d.ts.map +1 -0
  73. package/dist/src/framework/GroupedToolBuilder.js +289 -0
  74. package/dist/src/framework/GroupedToolBuilder.js.map +1 -0
  75. package/dist/src/framework/ResponseHelper.d.ts +43 -0
  76. package/dist/src/framework/ResponseHelper.d.ts.map +1 -0
  77. package/dist/src/framework/ResponseHelper.js +49 -0
  78. package/dist/src/framework/ResponseHelper.js.map +1 -0
  79. package/dist/src/framework/ToolBuilder.d.ts +46 -0
  80. package/dist/src/framework/ToolBuilder.d.ts.map +1 -0
  81. package/dist/src/framework/ToolBuilder.js +2 -0
  82. package/dist/src/framework/ToolBuilder.js.map +1 -0
  83. package/dist/src/framework/ToolRegistry.d.ts +85 -0
  84. package/dist/src/framework/ToolRegistry.d.ts.map +1 -0
  85. package/dist/src/framework/ToolRegistry.js +153 -0
  86. package/dist/src/framework/ToolRegistry.js.map +1 -0
  87. package/dist/src/framework/index.d.ts +9 -0
  88. package/dist/src/framework/index.d.ts.map +1 -0
  89. package/dist/src/framework/index.js +8 -0
  90. package/dist/src/framework/index.js.map +1 -0
  91. package/dist/src/framework/strategies/AnnotationAggregator.d.ts +11 -0
  92. package/dist/src/framework/strategies/AnnotationAggregator.d.ts.map +1 -0
  93. package/dist/src/framework/strategies/AnnotationAggregator.js +25 -0
  94. package/dist/src/framework/strategies/AnnotationAggregator.js.map +1 -0
  95. package/dist/src/framework/strategies/DescriptionGenerator.d.ts +12 -0
  96. package/dist/src/framework/strategies/DescriptionGenerator.d.ts.map +1 -0
  97. package/dist/src/framework/strategies/DescriptionGenerator.js +70 -0
  98. package/dist/src/framework/strategies/DescriptionGenerator.js.map +1 -0
  99. package/dist/src/framework/strategies/MiddlewareCompiler.d.ts +13 -0
  100. package/dist/src/framework/strategies/MiddlewareCompiler.d.ts.map +1 -0
  101. package/dist/src/framework/strategies/MiddlewareCompiler.js +24 -0
  102. package/dist/src/framework/strategies/MiddlewareCompiler.js.map +1 -0
  103. package/dist/src/framework/strategies/SchemaGenerator.d.ts +15 -0
  104. package/dist/src/framework/strategies/SchemaGenerator.d.ts.map +1 -0
  105. package/dist/src/framework/strategies/SchemaGenerator.js +97 -0
  106. package/dist/src/framework/strategies/SchemaGenerator.js.map +1 -0
  107. package/dist/src/framework/strategies/SchemaUtils.d.ts +7 -0
  108. package/dist/src/framework/strategies/SchemaUtils.d.ts.map +1 -0
  109. package/dist/src/framework/strategies/SchemaUtils.js +17 -0
  110. package/dist/src/framework/strategies/SchemaUtils.js.map +1 -0
  111. package/dist/src/framework/strategies/ToonDescriptionGenerator.d.ts +3 -0
  112. package/dist/src/framework/strategies/ToonDescriptionGenerator.d.ts.map +1 -0
  113. package/dist/src/framework/strategies/ToonDescriptionGenerator.js +53 -0
  114. package/dist/src/framework/strategies/ToonDescriptionGenerator.js.map +1 -0
  115. package/dist/src/framework/strategies/Types.d.ts +34 -0
  116. package/dist/src/framework/strategies/Types.d.ts.map +1 -0
  117. package/dist/src/framework/strategies/Types.js +2 -0
  118. package/dist/src/framework/strategies/Types.js.map +1 -0
  119. package/dist/src/framework/strategies/index.d.ts +12 -0
  120. package/dist/src/framework/strategies/index.d.ts.map +1 -0
  121. package/dist/src/framework/strategies/index.js +11 -0
  122. package/dist/src/framework/strategies/index.js.map +1 -0
  123. package/dist/src/index.d.ts +15 -0
  124. package/dist/src/index.d.ts.map +1 -0
  125. package/dist/src/index.js +15 -0
  126. package/dist/src/index.js.map +1 -0
  127. package/dist/tests/AbstractBase.test.d.ts +2 -0
  128. package/dist/tests/AbstractBase.test.d.ts.map +1 -0
  129. package/dist/tests/AbstractBase.test.js +130 -0
  130. package/dist/tests/AbstractBase.test.js.map +1 -0
  131. package/dist/tests/AbstractLeaf.test.d.ts +2 -0
  132. package/dist/tests/AbstractLeaf.test.d.ts.map +1 -0
  133. package/dist/tests/AbstractLeaf.test.js +65 -0
  134. package/dist/tests/AbstractLeaf.test.js.map +1 -0
  135. package/dist/tests/Annotations.test.d.ts +2 -0
  136. package/dist/tests/Annotations.test.d.ts.map +1 -0
  137. package/dist/tests/Annotations.test.js +34 -0
  138. package/dist/tests/Annotations.test.js.map +1 -0
  139. package/dist/tests/BarrelExport.test.d.ts +2 -0
  140. package/dist/tests/BarrelExport.test.d.ts.map +1 -0
  141. package/dist/tests/BarrelExport.test.js +42 -0
  142. package/dist/tests/BarrelExport.test.js.map +1 -0
  143. package/dist/tests/Converters.test.d.ts +2 -0
  144. package/dist/tests/Converters.test.d.ts.map +1 -0
  145. package/dist/tests/Converters.test.js +193 -0
  146. package/dist/tests/Converters.test.js.map +1 -0
  147. package/dist/tests/Group.test.d.ts +2 -0
  148. package/dist/tests/Group.test.d.ts.map +1 -0
  149. package/dist/tests/Group.test.js +257 -0
  150. package/dist/tests/Group.test.js.map +1 -0
  151. package/dist/tests/Icon.test.d.ts +2 -0
  152. package/dist/tests/Icon.test.d.ts.map +1 -0
  153. package/dist/tests/Icon.test.js +44 -0
  154. package/dist/tests/Icon.test.js.map +1 -0
  155. package/dist/tests/Prompt.test.d.ts +2 -0
  156. package/dist/tests/Prompt.test.d.ts.map +1 -0
  157. package/dist/tests/Prompt.test.js +63 -0
  158. package/dist/tests/Prompt.test.js.map +1 -0
  159. package/dist/tests/PromptArgument.test.d.ts +2 -0
  160. package/dist/tests/PromptArgument.test.d.ts.map +1 -0
  161. package/dist/tests/PromptArgument.test.js +37 -0
  162. package/dist/tests/PromptArgument.test.js.map +1 -0
  163. package/dist/tests/Resource.test.d.ts +2 -0
  164. package/dist/tests/Resource.test.d.ts.map +1 -0
  165. package/dist/tests/Resource.test.js +61 -0
  166. package/dist/tests/Resource.test.js.map +1 -0
  167. package/dist/tests/Role.test.d.ts +2 -0
  168. package/dist/tests/Role.test.d.ts.map +1 -0
  169. package/dist/tests/Role.test.js +17 -0
  170. package/dist/tests/Role.test.js.map +1 -0
  171. package/dist/tests/Tool.test.d.ts +2 -0
  172. package/dist/tests/Tool.test.d.ts.map +1 -0
  173. package/dist/tests/Tool.test.js +62 -0
  174. package/dist/tests/Tool.test.js.map +1 -0
  175. package/dist/tests/ToolAnnotations.test.d.ts +2 -0
  176. package/dist/tests/ToolAnnotations.test.d.ts.map +1 -0
  177. package/dist/tests/ToolAnnotations.test.js +55 -0
  178. package/dist/tests/ToolAnnotations.test.js.map +1 -0
  179. package/dist/tests/framework/AdversarialQA.test.d.ts +2 -0
  180. package/dist/tests/framework/AdversarialQA.test.d.ts.map +1 -0
  181. package/dist/tests/framework/AdversarialQA.test.js +906 -0
  182. package/dist/tests/framework/AdversarialQA.test.js.map +1 -0
  183. package/dist/tests/framework/GroupedToolBuilder.test.d.ts +2 -0
  184. package/dist/tests/framework/GroupedToolBuilder.test.d.ts.map +1 -0
  185. package/dist/tests/framework/GroupedToolBuilder.test.js +712 -0
  186. package/dist/tests/framework/GroupedToolBuilder.test.js.map +1 -0
  187. package/dist/tests/framework/LargeScaleScenarios.test.d.ts +2 -0
  188. package/dist/tests/framework/LargeScaleScenarios.test.d.ts.map +1 -0
  189. package/dist/tests/framework/LargeScaleScenarios.test.js +1043 -0
  190. package/dist/tests/framework/LargeScaleScenarios.test.js.map +1 -0
  191. package/dist/tests/framework/McpServerAdapter.test.d.ts +2 -0
  192. package/dist/tests/framework/McpServerAdapter.test.d.ts.map +1 -0
  193. package/dist/tests/framework/McpServerAdapter.test.js +380 -0
  194. package/dist/tests/framework/McpServerAdapter.test.js.map +1 -0
  195. package/dist/tests/framework/ResponseHelper.test.d.ts +2 -0
  196. package/dist/tests/framework/ResponseHelper.test.d.ts.map +1 -0
  197. package/dist/tests/framework/ResponseHelper.test.js +202 -0
  198. package/dist/tests/framework/ResponseHelper.test.js.map +1 -0
  199. package/dist/tests/framework/SecurityDeep.test.d.ts +2 -0
  200. package/dist/tests/framework/SecurityDeep.test.d.ts.map +1 -0
  201. package/dist/tests/framework/SecurityDeep.test.js +825 -0
  202. package/dist/tests/framework/SecurityDeep.test.js.map +1 -0
  203. package/dist/tests/framework/ToolRegistry.test.d.ts +2 -0
  204. package/dist/tests/framework/ToolRegistry.test.d.ts.map +1 -0
  205. package/dist/tests/framework/ToolRegistry.test.js +152 -0
  206. package/dist/tests/framework/ToolRegistry.test.js.map +1 -0
  207. package/dist/tests/framework/ToonDescription.test.d.ts +2 -0
  208. package/dist/tests/framework/ToonDescription.test.d.ts.map +1 -0
  209. package/dist/tests/framework/ToonDescription.test.js +287 -0
  210. package/dist/tests/framework/ToonDescription.test.js.map +1 -0
  211. package/package.json +64 -0
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Shared internal types for strategy modules.
3
+ *
4
+ * Extracted from GroupedToolBuilder so that strategy functions
5
+ * can operate on action data without depending on the builder class.
6
+ */
7
+ import type { ZodObject, ZodRawShape } from 'zod';
8
+ import type { ToolResponse } from '../ResponseHelper.js';
9
+ /** Internal representation of a registered action */
10
+ export interface InternalAction<TContext> {
11
+ /** Full key: "name" (flat) or "group.name" (grouped) */
12
+ key: string;
13
+ /** Group name (undefined for flat actions) */
14
+ groupName?: string;
15
+ /** Group description */
16
+ groupDescription?: string;
17
+ /** Action name within the group */
18
+ actionName: string;
19
+ /** Description */
20
+ description?: string;
21
+ /** Zod schema */
22
+ schema?: ZodObject<ZodRawShape>;
23
+ /** Annotations */
24
+ destructive?: boolean;
25
+ idempotent?: boolean;
26
+ readOnly?: boolean;
27
+ /** Per-action/group middleware (applied after global middleware) */
28
+ middlewares?: MiddlewareFn<TContext>[];
29
+ /** Handler */
30
+ handler: (ctx: TContext, args: Record<string, unknown>) => Promise<ToolResponse>;
31
+ }
32
+ /** Middleware function signature (Express/Koa pattern) */
33
+ export type MiddlewareFn<TContext> = (ctx: TContext, args: Record<string, unknown>, next: () => Promise<ToolResponse>) => Promise<ToolResponse>;
34
+ //# sourceMappingURL=Types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../../src/framework/strategies/Types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,qDAAqD;AACrD,MAAM,WAAW,cAAc,CAAC,QAAQ;IACpC,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAC;IACZ,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mCAAmC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,MAAM,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAChC,kBAAkB;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oEAAoE;IACpE,WAAW,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;IACvC,cAAc;IACd,OAAO,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;CACpF;AAED,0DAA0D;AAC1D,MAAM,MAAM,YAAY,CAAC,QAAQ,IAAI,CACjC,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,IAAI,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,KAChC,OAAO,CAAC,YAAY,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Types.js","sourceRoot":"","sources":["../../../../src/framework/strategies/Types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Strategy modules — Pure-function strategies extracted from GroupedToolBuilder.
3
+ * Each module handles a single responsibility.
4
+ */
5
+ export { generateDescription } from './DescriptionGenerator.js';
6
+ export { generateToonDescription } from './ToonDescriptionGenerator.js';
7
+ export { generateInputSchema } from './SchemaGenerator.js';
8
+ export { aggregateAnnotations } from './AnnotationAggregator.js';
9
+ export { compileMiddlewareChains, type CompiledChain } from './MiddlewareCompiler.js';
10
+ export { getActionRequiredFields } from './SchemaUtils.js';
11
+ export type { InternalAction, MiddlewareFn } from './Types.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/framework/strategies/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Strategy modules — Pure-function strategies extracted from GroupedToolBuilder.
3
+ * Each module handles a single responsibility.
4
+ */
5
+ export { generateDescription } from './DescriptionGenerator.js';
6
+ export { generateToonDescription } from './ToonDescriptionGenerator.js';
7
+ export { generateInputSchema } from './SchemaGenerator.js';
8
+ export { aggregateAnnotations } from './AnnotationAggregator.js';
9
+ export { compileMiddlewareChains } from './MiddlewareCompiler.js';
10
+ export { getActionRequiredFields } from './SchemaUtils.js';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/framework/strategies/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAsB,MAAM,yBAAyB,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,15 @@
1
+ export { Role } from './Role.js';
2
+ export { Icon } from './Icon.js';
3
+ export { AbstractBase } from './AbstractBase.js';
4
+ export { Group } from './Group.js';
5
+ export { AbstractLeaf } from './AbstractLeaf.js';
6
+ export { Annotations } from './Annotations.js';
7
+ export { ToolAnnotations } from './ToolAnnotations.js';
8
+ export { Tool } from './Tool.js';
9
+ export { PromptArgument } from './PromptArgument.js';
10
+ export { Prompt } from './Prompt.js';
11
+ export { Resource } from './Resource.js';
12
+ export { type GroupConverter, AbstractGroupConverter, type ToolConverter, AbstractToolConverter, type PromptConverter, AbstractPromptConverter, type ResourceConverter, AbstractResourceConverter, type ToolAnnotationsConverter, AbstractToolAnnotationsConverter } from './converters/index.js';
13
+ export { success, error, required, toonSuccess, GroupedToolBuilder, ActionGroupBuilder, ToolRegistry, generateToonDescription, } from './framework/index.js';
14
+ export type { ToolResponse, ActionConfig, MiddlewareFn, GroupConfigurator, ToolFilter, ToolBuilder, AttachOptions, DetachFn, } from './framework/index.js';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACH,KAAK,cAAc,EAAE,sBAAsB,EAC3C,KAAK,aAAa,EAAE,qBAAqB,EACzC,KAAK,eAAe,EAAE,uBAAuB,EAC7C,KAAK,iBAAiB,EAAE,yBAAyB,EACjD,KAAK,wBAAwB,EAAE,gCAAgC,EAClE,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EACrC,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EACZ,uBAAuB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACR,YAAY,EACZ,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAC7C,UAAU,EACV,WAAW,EAAE,aAAa,EAAE,QAAQ,GACvC,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,15 @@
1
+ export { Role } from './Role.js';
2
+ export { Icon } from './Icon.js';
3
+ export { AbstractBase } from './AbstractBase.js';
4
+ export { Group } from './Group.js';
5
+ export { AbstractLeaf } from './AbstractLeaf.js';
6
+ export { Annotations } from './Annotations.js';
7
+ export { ToolAnnotations } from './ToolAnnotations.js';
8
+ export { Tool } from './Tool.js';
9
+ export { PromptArgument } from './PromptArgument.js';
10
+ export { Prompt } from './Prompt.js';
11
+ export { Resource } from './Resource.js';
12
+ export { AbstractGroupConverter, AbstractToolConverter, AbstractPromptConverter, AbstractResourceConverter, AbstractToolAnnotationsConverter } from './converters/index.js';
13
+ // Framework
14
+ export { success, error, required, toonSuccess, GroupedToolBuilder, ActionGroupBuilder, ToolRegistry, generateToonDescription, } from './framework/index.js';
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACkB,sBAAsB,EACvB,qBAAqB,EACnB,uBAAuB,EACrB,yBAAyB,EAClB,gCAAgC,EAClE,MAAM,uBAAuB,CAAC;AAE/B,YAAY;AACZ,OAAO,EACH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EACrC,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EACZ,uBAAuB,GAC1B,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AbstractBase.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractBase.test.d.ts","sourceRoot":"","sources":["../../tests/AbstractBase.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,130 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { AbstractBase } from '../src/AbstractBase.js';
3
+ import { Icon } from '../src/Icon.js';
4
+ // Concrete subclass for testing abstract class
5
+ class ConcreteBase extends AbstractBase {
6
+ constructor(name, nameSeparator) {
7
+ super(name, nameSeparator);
8
+ }
9
+ getFullyQualifiedName() {
10
+ return this.name;
11
+ }
12
+ }
13
+ describe('AbstractBase', () => {
14
+ describe('constructor', () => {
15
+ it('should create with name', () => {
16
+ const base = new ConcreteBase('test');
17
+ expect(base.getName()).toBe('test');
18
+ });
19
+ it('should use default separator', () => {
20
+ expect(AbstractBase.DEFAULT_SEPARATOR).toBe('.');
21
+ });
22
+ it('should throw error when name is null', () => {
23
+ expect(() => new ConcreteBase(null)).toThrow('name must not be null');
24
+ });
25
+ it('should throw error when name is undefined', () => {
26
+ expect(() => new ConcreteBase(undefined)).toThrow('name must not be null');
27
+ });
28
+ });
29
+ describe('title', () => {
30
+ it('should be undefined by default', () => {
31
+ const base = new ConcreteBase('test');
32
+ expect(base.getTitle()).toBeUndefined();
33
+ });
34
+ it('should set and get title', () => {
35
+ const base = new ConcreteBase('test');
36
+ base.setTitle('Test Title');
37
+ expect(base.getTitle()).toBe('Test Title');
38
+ });
39
+ });
40
+ describe('description', () => {
41
+ it('should be undefined by default', () => {
42
+ const base = new ConcreteBase('test');
43
+ expect(base.getDescription()).toBeUndefined();
44
+ });
45
+ it('should set and get description', () => {
46
+ const base = new ConcreteBase('test');
47
+ base.setDescription('A description');
48
+ expect(base.getDescription()).toBe('A description');
49
+ });
50
+ });
51
+ describe('icons', () => {
52
+ it('should be undefined by default', () => {
53
+ const base = new ConcreteBase('test');
54
+ expect(base.getIcons()).toBeUndefined();
55
+ });
56
+ it('should set and get icons', () => {
57
+ const base = new ConcreteBase('test');
58
+ const icon = new Icon();
59
+ icon.setSrc('icon.png');
60
+ base.setIcons([icon]);
61
+ expect(base.getIcons()).toHaveLength(1);
62
+ expect(base.getIcons()[0].getSrc()).toBe('icon.png');
63
+ });
64
+ });
65
+ describe('meta', () => {
66
+ it('should be undefined by default', () => {
67
+ const base = new ConcreteBase('test');
68
+ expect(base.getMeta()).toBeUndefined();
69
+ });
70
+ it('should set and get meta', () => {
71
+ const base = new ConcreteBase('test');
72
+ const meta = new Map();
73
+ meta.set('key', 'value');
74
+ base.setMeta(meta);
75
+ expect(base.getMeta().get('key')).toBe('value');
76
+ });
77
+ });
78
+ describe('hashCode', () => {
79
+ it('should return consistent hash for same name', () => {
80
+ const base1 = new ConcreteBase('test');
81
+ const base2 = new ConcreteBase('test');
82
+ expect(base1.hashCode()).toBe(base2.hashCode());
83
+ });
84
+ it('should return different hash for different names', () => {
85
+ const base1 = new ConcreteBase('test1');
86
+ const base2 = new ConcreteBase('test2');
87
+ expect(base1.hashCode()).not.toBe(base2.hashCode());
88
+ });
89
+ it('should return 0 for empty name', () => {
90
+ const base = new ConcreteBase('');
91
+ expect(base.hashCode()).toBe(0);
92
+ });
93
+ });
94
+ describe('equals', () => {
95
+ it('should be equal to itself', () => {
96
+ const base = new ConcreteBase('test');
97
+ expect(base.equals(base)).toBe(true);
98
+ });
99
+ it('should be equal to another instance with same name', () => {
100
+ const base1 = new ConcreteBase('test');
101
+ const base2 = new ConcreteBase('test');
102
+ expect(base1.equals(base2)).toBe(true);
103
+ });
104
+ it('should not be equal to instance with different name', () => {
105
+ const base1 = new ConcreteBase('test1');
106
+ const base2 = new ConcreteBase('test2');
107
+ expect(base1.equals(base2)).toBe(false);
108
+ });
109
+ it('should not be equal to null', () => {
110
+ const base = new ConcreteBase('test');
111
+ expect(base.equals(null)).toBe(false);
112
+ });
113
+ it('should not be equal to undefined', () => {
114
+ const base = new ConcreteBase('test');
115
+ expect(base.equals(undefined)).toBe(false);
116
+ });
117
+ it('should not be equal to a different subclass with same name', () => {
118
+ // Scenario: two different MCP primitives share the same name "deploy"
119
+ // but they are distinct types (e.g., a group vs a leaf) — must not equal
120
+ class AnotherBase extends AbstractBase {
121
+ constructor(name) { super(name); }
122
+ getFullyQualifiedName() { return this.name; }
123
+ }
124
+ const original = new ConcreteBase('deploy');
125
+ const different = new AnotherBase('deploy');
126
+ expect(original.equals(different)).toBe(false);
127
+ });
128
+ });
129
+ });
130
+ //# sourceMappingURL=AbstractBase.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractBase.test.js","sourceRoot":"","sources":["../../tests/AbstractBase.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,+CAA+C;AAC/C,MAAM,YAAa,SAAQ,YAAY;IACnC,YAAmB,IAAY,EAAE,aAAsB;QACnD,KAAK,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAC/B,CAAC;IAEM,qBAAqB;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;CACJ;AAED,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC1B,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;QACzB,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;YAC/B,MAAM,IAAI,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;YACpC,MAAM,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;YAC5C,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,YAAY,CAAC,IAAW,CAAC,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAA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,EAAE,GAAG,EAAE;YAClE,sEAAsE;YACtE,yEAAyE;YACzE,MAAM,WAAY,SAAQ,YAAY;gBAClC,YAAY,IAAY,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAC1C,qBAAqB,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;aACxD;YACD,MAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC;YAC5C,MAAM,SAAS,GAAG,IAAI,WAAW,CAAC,QAAQ,CAAC,CAAC;YAC5C,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AbstractLeaf.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractLeaf.test.d.ts","sourceRoot":"","sources":["../../tests/AbstractLeaf.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,65 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { Tool } from '../src/Tool.js';
3
+ import { Group } from '../src/Group.js';
4
+ describe('AbstractLeaf (via Tool)', () => {
5
+ it('should start with no parent groups', () => {
6
+ const tool = new Tool('test');
7
+ expect(tool.getParentGroups()).toHaveLength(0);
8
+ });
9
+ it('should add parent group', () => {
10
+ const tool = new Tool('test');
11
+ const group = new Group('parent');
12
+ expect(tool.addParentGroup(group)).toBe(true);
13
+ expect(tool.getParentGroups()).toHaveLength(1);
14
+ });
15
+ it('should not add duplicate parent group', () => {
16
+ const tool = new Tool('test');
17
+ const group = new Group('parent');
18
+ tool.addParentGroup(group);
19
+ expect(tool.addParentGroup(group)).toBe(false);
20
+ expect(tool.getParentGroups()).toHaveLength(1);
21
+ });
22
+ it('should throw when adding null parent group', () => {
23
+ const tool = new Tool('test');
24
+ expect(() => tool.addParentGroup(null)).toThrow('parentGroup must not be null');
25
+ });
26
+ it('should remove parent group', () => {
27
+ const tool = new Tool('test');
28
+ const group = new Group('parent');
29
+ tool.addParentGroup(group);
30
+ expect(tool.removeParentGroup(group)).toBe(true);
31
+ expect(tool.getParentGroups()).toHaveLength(0);
32
+ });
33
+ it('should return false when removing non-existing parent group', () => {
34
+ const tool = new Tool('test');
35
+ const group = new Group('parent');
36
+ expect(tool.removeParentGroup(group)).toBe(false);
37
+ });
38
+ it('should get parent group roots', () => {
39
+ const root = new Group('root');
40
+ const child = new Group('child');
41
+ root.addChildGroup(child);
42
+ const tool = new Tool('test');
43
+ tool.addParentGroup(child);
44
+ const roots = tool.getParentGroupRoots();
45
+ expect(roots).toHaveLength(1);
46
+ expect(roots[0].getName()).toBe('root');
47
+ });
48
+ it('should get root when parent is already root', () => {
49
+ const root = new Group('root');
50
+ const tool = new Tool('test');
51
+ tool.addParentGroup(root);
52
+ const roots = tool.getParentGroupRoots();
53
+ expect(roots).toHaveLength(1);
54
+ expect(roots[0].getName()).toBe('root');
55
+ });
56
+ it('should handle multiple parent groups', () => {
57
+ const tool = new Tool('shared_tool');
58
+ const group1 = new Group('group1');
59
+ const group2 = new Group('group2');
60
+ tool.addParentGroup(group1);
61
+ tool.addParentGroup(group2);
62
+ expect(tool.getParentGroups()).toHaveLength(2);
63
+ });
64
+ });
65
+ //# sourceMappingURL=AbstractLeaf.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractLeaf.test.js","sourceRoot":"","sources":["../../tests/AbstractLeaf.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACrC,EAAE,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O,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACnD,MAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;QAC/B,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAE1B,MAAM,KAAK,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACzC,MAAM,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC9B,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC5C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC;QACrC,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC5B,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC5B,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Annotations.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Annotations.test.d.ts","sourceRoot":"","sources":["../../tests/Annotations.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,34 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { Annotations } from '../src/Annotations.js';
3
+ import { Role } from '../src/Role.js';
4
+ describe('Annotations', () => {
5
+ it('should construct with all parameters', () => {
6
+ const annotations = new Annotations([Role.USER], 1, '2025-01-01T00:00:00Z');
7
+ expect(annotations.getAudience()).toEqual([Role.USER]);
8
+ expect(annotations.getPriority()).toBe(1);
9
+ expect(annotations.getLastModified()).toBe('2025-01-01T00:00:00Z');
10
+ });
11
+ it('should set and get audience', () => {
12
+ const annotations = new Annotations([], 0, '');
13
+ annotations.setAudience([Role.USER, Role.ASSISTANT]);
14
+ expect(annotations.getAudience()).toEqual([Role.USER, Role.ASSISTANT]);
15
+ });
16
+ it('should set and get priority', () => {
17
+ const annotations = new Annotations([], 0, '');
18
+ annotations.setPriority(5);
19
+ expect(annotations.getPriority()).toBe(5);
20
+ });
21
+ it('should set and get lastModified', () => {
22
+ const annotations = new Annotations([], 0, '');
23
+ annotations.setLastModified('2025-06-15T12:00:00Z');
24
+ expect(annotations.getLastModified()).toBe('2025-06-15T12:00:00Z');
25
+ });
26
+ it('should produce correct toString', () => {
27
+ const annotations = new Annotations([Role.USER], 3, '2025-01-01');
28
+ const str = annotations.toString();
29
+ expect(str).toContain('Annotations');
30
+ expect(str).toContain('priority=3');
31
+ expect(str).toContain('lastModified=2025-01-01');
32
+ });
33
+ });
34
+ //# sourceMappingURL=Annotations.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Annotations.test.js","sourceRoot":"","sources":["../../tests/Annotations.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC5C,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,CA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AAM,CAAC,WAAW,CAAC,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACvC,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;QAClE,MAAM,GAAG,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;QACnC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QACrC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACpC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BarrelExport.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BarrelExport.test.d.ts","sourceRoot":"","sources":["../../tests/BarrelExport.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,42 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ // ============================================================================
3
+ // Barrel Export Verification
4
+ // Ensures all public API exports are accessible from the package entry point
5
+ // ============================================================================
6
+ describe('Barrel Export (src/index.ts)', () => {
7
+ it('should export all domain model classes', async () => {
8
+ const mod = await import('../src/index.js');
9
+ // Domain model
10
+ expect(mod.Role).toBeDefined();
11
+ expect(mod.Icon).toBeDefined();
12
+ expect(mod.AbstractBase).toBeDefined();
13
+ expect(mod.Group).toBeDefined();
14
+ expect(mod.AbstractLeaf).toBeDefined();
15
+ expect(mod.Annotations).toBeDefined();
16
+ expect(mod.ToolAnnotations).toBeDefined();
17
+ expect(mod.Tool).toBeDefined();
18
+ expect(mod.PromptArgument).toBeDefined();
19
+ expect(mod.Prompt).toBeDefined();
20
+ expect(mod.Resource).toBeDefined();
21
+ });
22
+ it('should export all converter abstract classes', async () => {
23
+ const mod = await import('../src/index.js');
24
+ expect(mod.AbstractGroupConverter).toBeDefined();
25
+ expect(mod.AbstractToolConverter).toBeDefined();
26
+ expect(mod.AbstractPromptConverter).toBeDefined();
27
+ expect(mod.AbstractResourceConverter).toBeDefined();
28
+ expect(mod.AbstractToolAnnotationsConverter).toBeDefined();
29
+ });
30
+ it('should export all framework components', async () => {
31
+ const mod = await import('../src/index.js');
32
+ // Framework helpers
33
+ expect(mod.success).toBeTypeOf('function');
34
+ expect(mod.error).toBeTypeOf('function');
35
+ expect(mod.required).toBeTypeOf('function');
36
+ // Framework builders
37
+ expect(mod.GroupedToolBuilder).toBeDefined();
38
+ expect(mod.ActionGroupBuilder).toBeDefined();
39
+ expect(mod.ToolRegistry).toBeDefined();
40
+ });
41
+ });
42
+ //# sourceMappingURL=BarrelExport.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BarrelExport.test.js","sourceRoot":"","sources":["../../tests/BarrelExport.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,+EAA+E;AAC/E,6BAA6B;AAC7B,6EAA6E;AAC7E,+EAA+E;AAE/E,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC1C,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;QACpD,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAE5C,eAAe;QACf,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;QAC/B,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;QAC/B,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC;QACvC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,W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AK,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACzC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAE5C,qBAAqB;QACrB,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,WAAW,EAAE,CAAC;QAC7C,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,WAAW,EAAE,CAAC;QAC7C,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC;IAC3C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Converters.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Converters.test.d.ts","sourceRoot":"","sources":["../../tests/Converters.test.ts"],"names":[],"mappings":""}