@agentica/core 0.24.0 → 0.26.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 (189) hide show
  1. package/README.md +56 -17
  2. package/lib/Agentica.d.ts +2 -2
  3. package/lib/Agentica.js +4 -4
  4. package/lib/Agentica.js.map +1 -1
  5. package/lib/MicroAgentica.d.ts +2 -2
  6. package/lib/MicroAgentica.js +4 -4
  7. package/lib/MicroAgentica.js.map +1 -1
  8. package/lib/context/AgenticaContext.d.ts +2 -2
  9. package/lib/context/MicroAgenticaContext.d.ts +2 -2
  10. package/lib/context/index.d.ts +5 -0
  11. package/lib/{structures/mcp → context}/index.js +5 -1
  12. package/lib/context/index.js.map +1 -0
  13. package/lib/context/internal/AgenticaOperationComposer.spec.js +13 -5
  14. package/lib/context/internal/AgenticaOperationComposer.spec.js.map +1 -1
  15. package/lib/events/AgenticaAssistantMessageEvent.d.ts +9 -0
  16. package/lib/events/AgenticaAssistantMessageEvent.js +3 -0
  17. package/lib/events/AgenticaAssistantMessageEvent.js.map +1 -0
  18. package/lib/events/AgenticaEvent.d.ts +9 -9
  19. package/lib/events/AgenticaEvent.type.d.ts +1 -0
  20. package/lib/events/AgenticaEvent.type.js +8 -0
  21. package/lib/events/AgenticaEvent.type.js.map +1 -0
  22. package/lib/events/AgenticaUserMessageEvent.d.ts +9 -0
  23. package/lib/events/{AgenticaUserInputEvent.js → AgenticaUserMessageEvent.js} +1 -1
  24. package/lib/events/AgenticaUserMessageEvent.js.map +1 -0
  25. package/lib/events/MicroAgenticaEvent.d.ts +6 -6
  26. package/lib/events/index.d.ts +14 -0
  27. package/lib/events/index.js +31 -0
  28. package/lib/events/index.js.map +1 -0
  29. package/lib/factory/events.d.ts +8 -8
  30. package/lib/factory/events.js +23 -38
  31. package/lib/factory/events.js.map +1 -1
  32. package/lib/factory/histories.d.ts +1 -36
  33. package/lib/factory/histories.js +103 -22
  34. package/lib/factory/histories.js.map +1 -1
  35. package/lib/functional/assertHttpController.js +6 -6
  36. package/lib/functional/assertHttpLlmApplication.js +6 -6
  37. package/lib/functional/assertMcpController.d.ts +1 -2
  38. package/lib/functional/assertMcpController.js +6 -6
  39. package/lib/functional/assertMcpController.js.map +1 -1
  40. package/lib/functional/index.d.ts +6 -0
  41. package/lib/functional/index.js +23 -0
  42. package/lib/functional/index.js.map +1 -0
  43. package/lib/functional/validateHttpController.js +5 -5
  44. package/lib/functional/validateHttpLlmApplication.js +5 -5
  45. package/lib/functional/validateMcpController.d.ts +1 -2
  46. package/lib/functional/validateMcpController.js +11 -11
  47. package/lib/functional/validateMcpController.js.map +1 -1
  48. package/lib/histories/AgenticaAssistantMessageHistory.d.ts +5 -0
  49. package/lib/histories/AgenticaAssistantMessageHistory.js +3 -0
  50. package/lib/histories/AgenticaAssistantMessageHistory.js.map +1 -0
  51. package/lib/histories/AgenticaHistory.d.ts +9 -7
  52. package/lib/histories/{AgenticaTextHistory.d.ts → AgenticaSystemMessageHistory.d.ts} +1 -2
  53. package/lib/histories/{AgenticaUserInputHistory.js → AgenticaSystemMessageHistory.js} +1 -1
  54. package/lib/histories/AgenticaSystemMessageHistory.js.map +1 -0
  55. package/lib/histories/AgenticaUserMessageHistory.d.ts +6 -0
  56. package/lib/{events/AgenticaTextEvent.js → histories/AgenticaUserMessageHistory.js} +1 -1
  57. package/lib/histories/AgenticaUserMessageHistory.js.map +1 -0
  58. package/lib/histories/MicroAgenticaHistory.d.ts +5 -4
  59. package/lib/histories/contents/AgenticaUserMessageAudioContent.d.ts +19 -0
  60. package/lib/histories/contents/AgenticaUserMessageAudioContent.js +3 -0
  61. package/lib/histories/contents/AgenticaUserMessageAudioContent.js.map +1 -0
  62. package/lib/histories/contents/AgenticaUserMessageContent.d.ts +14 -0
  63. package/lib/histories/{AgenticaTextHistory.js → contents/AgenticaUserMessageContent.js} +1 -1
  64. package/lib/histories/contents/AgenticaUserMessageContent.js.map +1 -0
  65. package/lib/histories/contents/AgenticaUserMessageContentBase.d.ts +6 -0
  66. package/lib/histories/contents/AgenticaUserMessageContentBase.js +3 -0
  67. package/lib/histories/contents/AgenticaUserMessageContentBase.js.map +1 -0
  68. package/lib/histories/contents/AgenticaUserMessageFileContent.d.ts +26 -0
  69. package/lib/histories/contents/AgenticaUserMessageFileContent.js +3 -0
  70. package/lib/histories/contents/AgenticaUserMessageFileContent.js.map +1 -0
  71. package/lib/histories/contents/AgenticaUserMessageImageContent.d.ts +20 -0
  72. package/lib/histories/contents/AgenticaUserMessageImageContent.js +3 -0
  73. package/lib/histories/contents/AgenticaUserMessageImageContent.js.map +1 -0
  74. package/lib/histories/contents/AgenticaUserMessageTextContent.d.ts +14 -0
  75. package/lib/histories/contents/AgenticaUserMessageTextContent.js +3 -0
  76. package/lib/histories/contents/AgenticaUserMessageTextContent.js.map +1 -0
  77. package/lib/histories/contents/index.d.ts +5 -0
  78. package/lib/histories/contents/index.js +22 -0
  79. package/lib/histories/contents/index.js.map +1 -0
  80. package/lib/histories/index.d.ts +10 -0
  81. package/lib/histories/index.js +27 -0
  82. package/lib/histories/index.js.map +1 -0
  83. package/lib/index.d.ts +6 -45
  84. package/lib/index.js +6 -46
  85. package/lib/index.js.map +1 -1
  86. package/lib/index.mjs +182 -131
  87. package/lib/index.mjs.map +1 -1
  88. package/lib/json/IAgenticaEventJson.d.ts +44 -19
  89. package/lib/json/IAgenticaEventJson.type.d.ts +1 -0
  90. package/lib/json/IAgenticaEventJson.type.js +8 -0
  91. package/lib/json/IAgenticaEventJson.type.js.map +1 -0
  92. package/lib/json/IAgenticaHistoryJson.d.ts +34 -19
  93. package/lib/json/IAgenticaHistoryJson.type.d.ts +1 -0
  94. package/lib/json/IAgenticaHistoryJson.type.js +8 -0
  95. package/lib/json/IAgenticaHistoryJson.type.js.map +1 -0
  96. package/lib/json/IMicroAgenticaEventJson.d.ts +1 -1
  97. package/lib/json/IMicroAgenticaHistoryJson.d.ts +1 -1
  98. package/lib/json/index.d.ts +7 -0
  99. package/lib/json/index.js +24 -0
  100. package/lib/json/index.js.map +1 -0
  101. package/lib/orchestrate/call.js +4 -4
  102. package/lib/orchestrate/call.js.map +1 -1
  103. package/lib/orchestrate/cancel.js +1 -1
  104. package/lib/orchestrate/cancel.js.map +1 -1
  105. package/lib/orchestrate/initialize.js +4 -4
  106. package/lib/orchestrate/initialize.js.map +1 -1
  107. package/lib/orchestrate/select.js +3 -3
  108. package/lib/orchestrate/select.js.map +1 -1
  109. package/lib/structures/IAgenticaController.d.ts +1 -2
  110. package/lib/structures/index.d.ts +10 -0
  111. package/lib/structures/index.js +27 -0
  112. package/lib/structures/index.js.map +1 -0
  113. package/lib/transformers/transformHistory.d.ts +1 -0
  114. package/lib/transformers/{AgenticaHistoryTransformer.js → transformHistory.js} +33 -23
  115. package/lib/transformers/transformHistory.js.map +1 -0
  116. package/lib/utils/ChatGptCompletionMessageUtil.js +2 -2
  117. package/lib/utils/types.d.ts +33 -0
  118. package/lib/utils/types.js +29 -0
  119. package/lib/utils/types.js.map +1 -0
  120. package/package.json +7 -7
  121. package/src/Agentica.ts +10 -9
  122. package/src/MicroAgentica.ts +12 -9
  123. package/src/context/AgenticaContext.ts +2 -2
  124. package/src/context/MicroAgenticaContext.ts +2 -2
  125. package/src/context/index.ts +5 -0
  126. package/src/context/internal/AgenticaOperationComposer.spec.ts +15 -5
  127. package/src/events/AgenticaAssistantMessageEvent.ts +12 -0
  128. package/src/events/AgenticaEvent.ts +15 -15
  129. package/src/events/AgenticaEvent.type.ts +19 -0
  130. package/src/events/AgenticaUserMessageEvent.ts +12 -0
  131. package/src/events/MicroAgenticaEvent.ts +9 -9
  132. package/src/events/index.ts +14 -0
  133. package/src/factory/events.ts +29 -34
  134. package/src/factory/histories.ts +120 -29
  135. package/src/functional/assertMcpController.ts +4 -2
  136. package/src/functional/index.ts +7 -0
  137. package/src/functional/validateMcpController.ts +4 -2
  138. package/src/histories/AgenticaAssistantMessageHistory.ts +10 -0
  139. package/src/histories/AgenticaHistory.ts +11 -8
  140. package/src/histories/{AgenticaTextHistory.ts → AgenticaSystemMessageHistory.ts} +4 -2
  141. package/src/histories/AgenticaUserMessageHistory.ts +11 -0
  142. package/src/histories/MicroAgenticaHistory.ts +6 -5
  143. package/src/histories/contents/AgenticaUserMessageAudioContent.ts +21 -0
  144. package/src/histories/contents/AgenticaUserMessageContent.ts +19 -0
  145. package/src/histories/contents/AgenticaUserMessageContentBase.ts +6 -0
  146. package/src/histories/contents/AgenticaUserMessageFileContent.ts +27 -0
  147. package/src/histories/contents/AgenticaUserMessageImageContent.ts +23 -0
  148. package/src/histories/contents/AgenticaUserMessageTextContent.ts +15 -0
  149. package/src/histories/contents/index.ts +5 -0
  150. package/src/histories/index.ts +10 -0
  151. package/src/index.ts +6 -54
  152. package/src/json/IAgenticaEventJson.ts +53 -21
  153. package/src/json/IAgenticaEventJson.type.ts +19 -0
  154. package/src/json/IAgenticaHistoryJson.ts +41 -23
  155. package/src/json/IAgenticaHistoryJson.type.ts +19 -0
  156. package/src/json/IMicroAgenticaEventJson.ts +2 -1
  157. package/src/json/IMicroAgenticaHistoryJson.ts +2 -1
  158. package/src/json/index.ts +7 -0
  159. package/src/orchestrate/call.ts +8 -8
  160. package/src/orchestrate/cancel.ts +2 -2
  161. package/src/orchestrate/initialize.ts +5 -5
  162. package/src/orchestrate/select.ts +5 -5
  163. package/src/structures/IAgenticaController.ts +4 -2
  164. package/src/structures/index.ts +10 -0
  165. package/src/transformers/{AgenticaHistoryTransformer.ts → transformHistory.ts} +43 -26
  166. package/src/utils/types.ts +50 -0
  167. package/lib/events/AgenticaTextEvent.d.ts +0 -10
  168. package/lib/events/AgenticaTextEvent.js.map +0 -1
  169. package/lib/events/AgenticaUserInputEvent.d.ts +0 -10
  170. package/lib/events/AgenticaUserInputEvent.js.map +0 -1
  171. package/lib/histories/AgenticaTextHistory.js.map +0 -1
  172. package/lib/histories/AgenticaUserInputHistory.d.ts +0 -86
  173. package/lib/histories/AgenticaUserInputHistory.js.map +0 -1
  174. package/lib/structures/mcp/IMcpLlmTransportProps.d.ts +0 -11
  175. package/lib/structures/mcp/IMcpLlmTransportProps.js +0 -3
  176. package/lib/structures/mcp/IMcpLlmTransportProps.js.map +0 -1
  177. package/lib/structures/mcp/index.d.ts +0 -1
  178. package/lib/structures/mcp/index.js.map +0 -1
  179. package/lib/transformers/AgenticaEventTransformer.d.ts +0 -63
  180. package/lib/transformers/AgenticaEventTransformer.js +0 -155
  181. package/lib/transformers/AgenticaEventTransformer.js.map +0 -1
  182. package/lib/transformers/AgenticaHistoryTransformer.d.ts +0 -41
  183. package/lib/transformers/AgenticaHistoryTransformer.js.map +0 -1
  184. package/src/events/AgenticaTextEvent.ts +0 -12
  185. package/src/events/AgenticaUserInputEvent.ts +0 -12
  186. package/src/histories/AgenticaUserInputHistory.ts +0 -94
  187. package/src/structures/mcp/IMcpLlmTransportProps.ts +0 -13
  188. package/src/structures/mcp/index.ts +0 -1
  189. package/src/transformers/AgenticaEventTransformer.ts +0 -196
@@ -0,0 +1,50 @@
1
+ /**
2
+ * from ts-toolbelt repository
3
+ * https://github.com/millsp/ts-toolbelt/blob/master/sources/Test.ts
4
+ */
5
+
6
+ type Equals<A1, A2> = (<A>() => A extends A2 ? 1 : 0) extends <
7
+ A,
8
+ >() => A extends A1 ? 1 : 0
9
+ ? 1
10
+ : 0;
11
+
12
+ type Boolean = 0 | 1;
13
+ /**
14
+ * Test should pass
15
+ */
16
+ export type Pass = 1;
17
+
18
+ /**
19
+ * Test should fail
20
+ */
21
+ export type Fail = 0;
22
+
23
+ /**
24
+ * Check or test the validity of a type
25
+ * @param debug to debug with parameter hints (`ctrl+p`, `ctrl+shift+space`)
26
+ * @example
27
+ * ```ts
28
+ * // see in `tst` folder
29
+ * ```
30
+ */
31
+ export function check<Type, Expect, Outcome extends Boolean>(
32
+ debug?: Type,
33
+ ): Equals<Equals<Type, Expect>, Outcome> {
34
+ if (debug !== undefined) {
35
+ // eslint-disable-next-line no-console
36
+ console.log(debug);
37
+ }
38
+
39
+ return 1 as Equals<Equals<Type, Expect>, Outcome>;
40
+ }
41
+
42
+ /**
43
+ * Validates a batch of [[check]]
44
+ * @param _checks a batch of [[check]]
45
+ * @example
46
+ * ```ts
47
+ * // see in `tst` folder
48
+ * ```
49
+ */
50
+ export function checks(_checks: 1[]): void { }
@@ -1,10 +0,0 @@
1
- import type { AgenticaTextHistory } from "../histories/AgenticaTextHistory";
2
- import type { IAgenticaEventJson } from "../json/IAgenticaEventJson";
3
- import type { AgenticaEventBase } from "./AgenticaEventBase";
4
- export interface AgenticaTextEvent extends AgenticaEventBase<"text"> {
5
- role: "assistant";
6
- stream: AsyncGenerator<string, undefined, undefined>;
7
- join: () => Promise<string>;
8
- toJSON: () => IAgenticaEventJson.IText;
9
- toHistory: () => AgenticaTextHistory;
10
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgenticaTextEvent.js","sourceRoot":"","sources":["../../src/events/AgenticaTextEvent.ts"],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
1
- import type { AgenticaUserInputHistory } from "../histories/AgenticaUserInputHistory";
2
- import type { IAgenticaEventJson } from "../json/IAgenticaEventJson";
3
- import type { AgenticaEventBase } from "./AgenticaEventBase";
4
- export interface AgenticaUserInputEvent extends AgenticaEventBase<"user_input"> {
5
- role: "user";
6
- contents: Array<AgenticaUserInputHistory.Contents>;
7
- join: () => Promise<Array<AgenticaUserInputHistory.Contents>>;
8
- toJSON: () => IAgenticaEventJson.IUserInput;
9
- toHistory: () => AgenticaUserInputHistory;
10
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgenticaUserInputEvent.js","sourceRoot":"","sources":["../../src/events/AgenticaUserInputEvent.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgenticaTextHistory.js","sourceRoot":"","sources":["../../src/histories/AgenticaTextHistory.ts"],"names":[],"mappings":""}
@@ -1,86 +0,0 @@
1
- import type typia from "typia";
2
- import type { IAgenticaHistoryJson } from "../json/IAgenticaHistoryJson";
3
- import type { AgenticaHistoryBase } from "./AgenticaHistoryBase";
4
- export interface AgenticaUserInputHistory extends AgenticaHistoryBase<"user_input", IAgenticaHistoryJson.IUserInput> {
5
- role: "user";
6
- contents: Array<AgenticaUserInputHistory.Contents>;
7
- }
8
- export declare namespace AgenticaUserInputHistory {
9
- type Contents = Contents.File | Contents.Image | Contents.InputAudio | Contents.Text;
10
- namespace Contents {
11
- interface ContentsBase<Type extends string> {
12
- /**
13
- * The type of the content part.
14
- */
15
- type: Type;
16
- }
17
- /**
18
- * Learn about
19
- * [text inputs](https://platform.openai.com/docs/guides/text-generation).
20
- */
21
- export interface Text extends ContentsBase<"text"> {
22
- /**
23
- * The text content.
24
- */
25
- text: string;
26
- }
27
- /**
28
- * Learn about [image inputs](https://platform.openai.com/docs/guides/vision).
29
- */
30
- export interface Image extends ContentsBase<"image_url"> {
31
- image_url: {
32
- /**
33
- * Either a URL of the image or the base64 encoded image data.
34
- */
35
- url: string & typia.tags.Format<"url">;
36
- /**
37
- * Specifies the detail level of the image. Learn more in the
38
- * [Vision guide](https://platform.openai.com/docs/guides/vision#low-or-high-fidelity-image-understanding).
39
- */
40
- detail?: "auto" | "high" | "low";
41
- };
42
- }
43
- /**
44
- * Learn about [audio inputs](https://platform.openai.com/docs/guides/audio).
45
- *
46
- * Note: we not recommend it because audio input data only support base64 so it's too big data.
47
- */
48
- export interface InputAudio extends ContentsBase<"input_audio"> {
49
- input_audio: {
50
- /**
51
- * Base64 encoded audio data.
52
- */
53
- data: string;
54
- /**
55
- * The format of the encoded audio data. Currently supports "wav" and "mp3".
56
- */
57
- format: "wav" | "mp3";
58
- };
59
- }
60
- /**
61
- * Learn about [file inputs](https://platform.openai.com/docs/guides/text) for text
62
- * generation.
63
- *
64
- * Note: we recommend use `file_id` instead of `file_data` because it's too big data.
65
- */
66
- export interface File extends ContentsBase<"file"> {
67
- file: {
68
- /**
69
- * The ID of an uploaded file to use as input.
70
- */
71
- file_id: string;
72
- } | {
73
- /**
74
- * The base64 encoded file data, used when passing the file to the model as a
75
- * string.
76
- */
77
- file_data: string;
78
- /**
79
- * The name of the file, used when passing the file to the model as a string.
80
- */
81
- filename: string;
82
- };
83
- }
84
- export {};
85
- }
86
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgenticaUserInputHistory.js","sourceRoot":"","sources":["../../src/histories/AgenticaUserInputHistory.ts"],"names":[],"mappings":""}
@@ -1,11 +0,0 @@
1
- import type { SSEClientTransportOptions } from "@modelcontextprotocol/sdk/client/sse.d.ts";
2
- import type { StdioServerParameters } from "@modelcontextprotocol/sdk/client/stdio.d.ts";
3
- export type IMcpLlmTransportProps = IMcpLlmTransportPropsHttp | IMcpLlmTransportPropsStdio;
4
- export interface IMcpLlmTransportPropsHttp extends IMcpLlmTransportPropsBase<"sse">, SSEClientTransportOptions {
5
- url: URL;
6
- }
7
- export interface IMcpLlmTransportPropsStdio extends IMcpLlmTransportPropsBase<"stdio">, StdioServerParameters {
8
- }
9
- export interface IMcpLlmTransportPropsBase<T extends string> {
10
- type: T;
11
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IMcpLlmTransportProps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IMcpLlmTransportProps.js","sourceRoot":"","sources":["../../../src/structures/mcp/IMcpLlmTransportProps.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- export * from "./IMcpLlmTransportProps";
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/structures/mcp/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
@@ -1,63 +0,0 @@
1
- import type { ILlmSchema } from "@samchon/openapi";
2
- import type { AgenticaOperation } from "../context/AgenticaOperation";
3
- import type { AgenticaCallEvent } from "../events/AgenticaCallEvent";
4
- import type { AgenticaCancelEvent } from "../events/AgenticaCancelEvent";
5
- import type { AgenticaDescribeEvent } from "../events/AgenticaDescribeEvent";
6
- import type { AgenticaEvent } from "../events/AgenticaEvent";
7
- import type { AgenticaExecuteEvent } from "../events/AgenticaExecuteEvent";
8
- import type { AgenticaInitializeEvent } from "../events/AgenticaInitializeEvent";
9
- import type { AgenticaRequestEvent } from "../events/AgenticaRequestEvent";
10
- import type { AgenticaSelectEvent } from "../events/AgenticaSelectEvent";
11
- import type { AgenticaTextEvent } from "../events/AgenticaTextEvent";
12
- import type { IAgenticaEventJson } from "../json/IAgenticaEventJson";
13
- declare function findOperation<Model extends ILlmSchema.Model>(props: {
14
- operations: Map<string, Map<string, AgenticaOperation<Model>>>;
15
- input: {
16
- controller: string;
17
- function: string;
18
- };
19
- }): AgenticaOperation<Model>;
20
- declare function transform<Model extends ILlmSchema.Model>(props: {
21
- operations: Map<string, Map<string, AgenticaOperation<Model>>>;
22
- event: IAgenticaEventJson;
23
- }): AgenticaEvent<Model>;
24
- declare function transformCall<Model extends ILlmSchema.Model>(props: {
25
- operations: Map<string, Map<string, AgenticaOperation<Model>>>;
26
- event: IAgenticaEventJson.ICall;
27
- }): AgenticaCallEvent<Model>;
28
- export declare function transformCancel<Model extends ILlmSchema.Model>(props: {
29
- operations: Map<string, Map<string, AgenticaOperation<Model>>>;
30
- event: IAgenticaEventJson.ICancel;
31
- }): AgenticaCancelEvent<Model>;
32
- declare function transformDescribe<Model extends ILlmSchema.Model>(props: {
33
- operations: Map<string, Map<string, AgenticaOperation<Model>>>;
34
- event: IAgenticaEventJson.IDescribe;
35
- }): AgenticaDescribeEvent<Model>;
36
- declare function transformExecute<Model extends ILlmSchema.Model>(props: {
37
- operations: Map<string, Map<string, AgenticaOperation<Model>>>;
38
- event: IAgenticaEventJson.IExecute;
39
- }): AgenticaExecuteEvent<Model>;
40
- declare function transformInitialize(): AgenticaInitializeEvent;
41
- declare function transformRequest(props: {
42
- event: IAgenticaEventJson.IRequest;
43
- }): AgenticaRequestEvent;
44
- declare function transformSelect<Model extends ILlmSchema.Model>(props: {
45
- operations: Map<string, Map<string, AgenticaOperation<Model>>>;
46
- event: IAgenticaEventJson.ISelect;
47
- }): AgenticaSelectEvent<Model>;
48
- declare function transformText(props: {
49
- event: IAgenticaEventJson.IText;
50
- }): AgenticaTextEvent;
51
- export declare const AgenticaEventTransformer: {
52
- transform: typeof transform;
53
- transformCall: typeof transformCall;
54
- transformCancel: typeof transformCancel;
55
- transformDescribe: typeof transformDescribe;
56
- transformExecute: typeof transformExecute;
57
- transformInitialize: typeof transformInitialize;
58
- transformRequest: typeof transformRequest;
59
- transformSelect: typeof transformSelect;
60
- transformText: typeof transformText;
61
- findOperation: typeof findOperation;
62
- };
63
- export {};
@@ -1,155 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AgenticaEventTransformer = void 0;
13
- exports.transformCancel = transformCancel;
14
- const events_1 = require("../factory/events");
15
- const operations_1 = require("../factory/operations");
16
- const StreamUtil_1 = require("../utils/StreamUtil");
17
- function findOperation(props) {
18
- var _a;
19
- const found = (_a = props.operations
20
- .get(props.input.controller)) === null || _a === void 0 ? void 0 : _a.get(props.input.function);
21
- if (found === undefined) {
22
- throw new Error(`No operation found: (controller: ${props.input.controller}, function: ${props.input.function})`);
23
- }
24
- return found;
25
- }
26
- function transform(props) {
27
- if (props.event.type === "call") {
28
- return transformCall({
29
- operations: props.operations,
30
- event: props.event,
31
- });
32
- }
33
- else if (props.event.type === "cancel") {
34
- return transformCancel({
35
- operations: props.operations,
36
- event: props.event,
37
- });
38
- }
39
- else if (props.event.type === "describe") {
40
- return transformDescribe({
41
- operations: props.operations,
42
- event: props.event,
43
- });
44
- }
45
- else if (props.event.type === "execute") {
46
- return transformExecute({
47
- operations: props.operations,
48
- event: props.event,
49
- });
50
- }
51
- else if (props.event.type === "initialize") {
52
- return transformInitialize();
53
- }
54
- else if (props.event.type === "request") {
55
- return transformRequest({
56
- event: props.event,
57
- });
58
- }
59
- else if (props.event.type === "select") {
60
- return transformSelect({
61
- operations: props.operations,
62
- event: props.event,
63
- });
64
- }
65
- else if (props.event.type === "text") {
66
- return transformText({
67
- event: props.event,
68
- });
69
- }
70
- else {
71
- throw new Error("Unknown event type");
72
- }
73
- }
74
- function transformCall(props) {
75
- return (0, events_1.createCallEvent)({
76
- id: props.event.id,
77
- operation: findOperation({
78
- operations: props.operations,
79
- input: props.event.operation,
80
- }),
81
- arguments: props.event.arguments,
82
- });
83
- }
84
- function transformCancel(props) {
85
- return (0, events_1.createCancelEvent)({
86
- selection: (0, operations_1.createOperationSelection)({
87
- operation: findOperation({
88
- operations: props.operations,
89
- input: props.event.selection.operation,
90
- }),
91
- reason: props.event.selection.reason,
92
- }),
93
- });
94
- }
95
- function transformDescribe(props) {
96
- return (0, events_1.createDescribeEvent)({
97
- executes: props.event.executes.map(next => transformExecute({
98
- operations: props.operations,
99
- event: next,
100
- })),
101
- stream: (0, StreamUtil_1.toAsyncGenerator)(props.event.text),
102
- done: () => true,
103
- get: () => props.event.text,
104
- join: () => __awaiter(this, void 0, void 0, function* () { return props.event.text; }),
105
- });
106
- }
107
- function transformExecute(props) {
108
- return (0, events_1.createExecuteEvent)({
109
- id: props.event.id,
110
- operation: findOperation({
111
- operations: props.operations,
112
- input: props.event.operation,
113
- }),
114
- arguments: props.event.arguments,
115
- value: props.event.value,
116
- });
117
- }
118
- function transformInitialize() {
119
- return (0, events_1.createInitializeEvent)();
120
- }
121
- function transformRequest(props) {
122
- return (0, events_1.createRequestEvent)(props.event);
123
- }
124
- function transformSelect(props) {
125
- return (0, events_1.createSelectEvent)({
126
- selection: (0, operations_1.createOperationSelection)({
127
- operation: findOperation({
128
- operations: props.operations,
129
- input: props.event.selection.operation,
130
- }),
131
- reason: props.event.selection.reason,
132
- }),
133
- });
134
- }
135
- function transformText(props) {
136
- return (0, events_1.createTextEvent)({
137
- stream: (0, StreamUtil_1.toAsyncGenerator)(props.event.text),
138
- done: () => true,
139
- get: () => props.event.text,
140
- join: () => __awaiter(this, void 0, void 0, function* () { return props.event.text; }),
141
- });
142
- }
143
- exports.AgenticaEventTransformer = {
144
- transform,
145
- transformCall,
146
- transformCancel,
147
- transformDescribe,
148
- transformExecute,
149
- transformInitialize,
150
- transformRequest,
151
- transformSelect,
152
- transformText,
153
- findOperation,
154
- };
155
- //# sourceMappingURL=AgenticaEventTransformer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgenticaEventTransformer.js","sourceRoot":"","sources":["../../src/transformers/AgenticaEventTransformer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoGA,0CAaC;AAnGD,8CAA+L;AAC/L,sDAAiE;AACjE,oDAAuD;AAEvD,SAAS,aAAa,CAAiC,KAMtD;;IACC,MAAM,KAAK,GAAyC,MAAA,KAAK,CAAC,UAAU;SACjE,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,0CAC1B,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,oCAAoC,KAAK,CAAC,KAAK,CAAC,UAAU,eAAe,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,CACjG,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,SAAS,CAAiC,KAGlD;IACC,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAChC,OAAO,aAAa,C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CAAC,KAAK,CAAC,IAAI;QAC3B,IAAI,EAAE,GAAS,EAAE,gDAAC,OAAA,KAAK,CAAC,KAAK,CAAC,IAAI,CAAA,GAAA;KACnC,CAAC,CAAC;AACL,CAAC;AAEY,QAAA,wBAAwB,GAAG;IACtC,SAAS;IACT,aAAa;IACb,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,mBAAmB;IACnB,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,aAAa;CACd,CAAC"}
@@ -1,41 +0,0 @@
1
- import type { ILlmSchema } from "@samchon/openapi";
2
- import type { AgenticaOperation } from "../context/AgenticaOperation";
3
- import type { AgenticaCancelHistory } from "../histories/AgenticaCancelHistory";
4
- import type { AgenticaDescribeHistory } from "../histories/AgenticaDescribeHistory";
5
- import type { AgenticaExecuteHistory } from "../histories/AgenticaExecuteHistory";
6
- import type { AgenticaHistory } from "../histories/AgenticaHistory";
7
- import type { AgenticaSelectHistory } from "../histories/AgenticaSelectHistory";
8
- import type { AgenticaTextHistory } from "../histories/AgenticaTextHistory";
9
- import type { IAgenticaHistoryJson } from "../json/IAgenticaHistoryJson";
10
- declare function transform<Model extends ILlmSchema.Model>(props: {
11
- operations: Map<string, Map<string, AgenticaOperation<Model>>>;
12
- history: IAgenticaHistoryJson;
13
- }): AgenticaHistory<Model>;
14
- declare function transformText(props: {
15
- history: IAgenticaHistoryJson.IText;
16
- }): AgenticaTextHistory;
17
- declare function transformSelect<Model extends ILlmSchema.Model>(props: {
18
- operations: Map<string, Map<string, AgenticaOperation<Model>>>;
19
- history: IAgenticaHistoryJson.ISelect;
20
- }): AgenticaSelectHistory<Model>;
21
- declare function transformCancel<Model extends ILlmSchema.Model>(props: {
22
- operations: Map<string, Map<string, AgenticaOperation<Model>>>;
23
- history: IAgenticaHistoryJson.ICancel;
24
- }): AgenticaCancelHistory<Model>;
25
- declare function transformExecute<Model extends ILlmSchema.Model>(props: {
26
- operations: Map<string, Map<string, AgenticaOperation<Model>>>;
27
- history: IAgenticaHistoryJson.IExecute;
28
- }): AgenticaExecuteHistory<Model>;
29
- declare function transformDescribe<Model extends ILlmSchema.Model>(props: {
30
- operations: Map<string, Map<string, AgenticaOperation<Model>>>;
31
- history: IAgenticaHistoryJson.IDescribe;
32
- }): AgenticaDescribeHistory<Model>;
33
- export declare const AgenticaHistoryTransformer: {
34
- transform: typeof transform;
35
- transformText: typeof transformText;
36
- transformSelect: typeof transformSelect;
37
- transformCancel: typeof transformCancel;
38
- transformExecute: typeof transformExecute;
39
- transformDescribe: typeof transformDescribe;
40
- };
41
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgenticaHistoryTransformer.js","sourceRoot":"","sources":["../../src/transformers/AgenticaHistoryTransformer.ts"],"names":[],"mappings":";;;AAWA,oDAAgJ;AAChJ,sDAAiE;AAEjE,SAAS,SAAS,CAAiC,KAGlD;IACC,OAAO;IACP,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAClC,OAAO,aAAa,CAAC;YACnB,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CAAC;IACL,CAAC;IACD,kBAAkB;SACb,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACzC,OAAO,eAAe,CAAC;YACrB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CAAC;IACL,CAAC;SACI,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACzC,OAAO,eAAe,CAAC;YACrB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CAAC;IACL,CAAC;IACD,UAAU;SACL,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,gBAAgB,CAAC;YACtB,UAAU,EAAE,KAAK,CAAC,UAA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gB;IAChB,iBAAiB;CAClB,CAAC"}
@@ -1,12 +0,0 @@
1
- import type { AgenticaTextHistory } from "../histories/AgenticaTextHistory";
2
- import type { IAgenticaEventJson } from "../json/IAgenticaEventJson";
3
-
4
- import type { AgenticaEventBase } from "./AgenticaEventBase";
5
-
6
- export interface AgenticaTextEvent extends AgenticaEventBase<"text"> {
7
- role: "assistant";
8
- stream: AsyncGenerator<string, undefined, undefined>;
9
- join: () => Promise<string>;
10
- toJSON: () => IAgenticaEventJson.IText;
11
- toHistory: () => AgenticaTextHistory;
12
- }
@@ -1,12 +0,0 @@
1
- import type { AgenticaUserInputHistory } from "../histories/AgenticaUserInputHistory";
2
- import type { IAgenticaEventJson } from "../json/IAgenticaEventJson";
3
-
4
- import type { AgenticaEventBase } from "./AgenticaEventBase";
5
-
6
- export interface AgenticaUserInputEvent extends AgenticaEventBase<"user_input"> {
7
- role: "user";
8
- contents: Array<AgenticaUserInputHistory.Contents>;
9
- join: () => Promise<Array<AgenticaUserInputHistory.Contents>>;
10
- toJSON: () => IAgenticaEventJson.IUserInput;
11
- toHistory: () => AgenticaUserInputHistory;
12
- }
@@ -1,94 +0,0 @@
1
- import type typia from "typia";
2
-
3
- import type { IAgenticaHistoryJson } from "../json/IAgenticaHistoryJson";
4
-
5
- import type { AgenticaHistoryBase } from "./AgenticaHistoryBase";
6
-
7
- export interface AgenticaUserInputHistory extends AgenticaHistoryBase<"user_input", IAgenticaHistoryJson.IUserInput> {
8
- role: "user";
9
- contents: Array<AgenticaUserInputHistory.Contents>;
10
- }
11
-
12
- export namespace AgenticaUserInputHistory {
13
- export type Contents = Contents.File | Contents.Image | Contents.InputAudio | Contents.Text;
14
- export namespace Contents {
15
- interface ContentsBase<Type extends string> {
16
- /**
17
- * The type of the content part.
18
- */
19
- type: Type;
20
- }
21
- /**
22
- * Learn about
23
- * [text inputs](https://platform.openai.com/docs/guides/text-generation).
24
- */
25
- export interface Text extends ContentsBase<"text"> {
26
- /**
27
- * The text content.
28
- */
29
- text: string;
30
- }
31
-
32
- /**
33
- * Learn about [image inputs](https://platform.openai.com/docs/guides/vision).
34
- */
35
- export interface Image extends ContentsBase<"image_url"> {
36
- image_url: {
37
- /**
38
- * Either a URL of the image or the base64 encoded image data.
39
- */
40
- url: string & typia.tags.Format<"url">;
41
- /**
42
- * Specifies the detail level of the image. Learn more in the
43
- * [Vision guide](https://platform.openai.com/docs/guides/vision#low-or-high-fidelity-image-understanding).
44
- */
45
- detail?: "auto" | "high" | "low";
46
- };
47
- }
48
-
49
- /**
50
- * Learn about [audio inputs](https://platform.openai.com/docs/guides/audio).
51
- *
52
- * Note: we not recommend it because audio input data only support base64 so it's too big data.
53
- */
54
- export interface InputAudio extends ContentsBase<"input_audio"> {
55
- input_audio: {
56
- /**
57
- * Base64 encoded audio data.
58
- */
59
- data: string;
60
-
61
- /**
62
- * The format of the encoded audio data. Currently supports "wav" and "mp3".
63
- */
64
- format: "wav" | "mp3";
65
- };
66
- }
67
-
68
- /**
69
- * Learn about [file inputs](https://platform.openai.com/docs/guides/text) for text
70
- * generation.
71
- *
72
- * Note: we recommend use `file_id` instead of `file_data` because it's too big data.
73
- */
74
- export interface File extends ContentsBase<"file"> {
75
- file: {
76
- /**
77
- * The ID of an uploaded file to use as input.
78
- */
79
- file_id: string;
80
- } | {
81
- /**
82
- * The base64 encoded file data, used when passing the file to the model as a
83
- * string.
84
- */
85
- file_data: string;
86
-
87
- /**
88
- * The name of the file, used when passing the file to the model as a string.
89
- */
90
- filename: string;
91
- };
92
- }
93
- }
94
- }
@@ -1,13 +0,0 @@
1
- import type { SSEClientTransportOptions } from "@modelcontextprotocol/sdk/client/sse.d.ts";
2
- import type { StdioServerParameters } from "@modelcontextprotocol/sdk/client/stdio.d.ts";
3
-
4
- export type IMcpLlmTransportProps = IMcpLlmTransportPropsHttp | IMcpLlmTransportPropsStdio;
5
-
6
- export interface IMcpLlmTransportPropsHttp extends IMcpLlmTransportPropsBase<"sse">, SSEClientTransportOptions {
7
- url: URL;
8
- }
9
- export interface IMcpLlmTransportPropsStdio extends IMcpLlmTransportPropsBase<"stdio">, StdioServerParameters {}
10
-
11
- export interface IMcpLlmTransportPropsBase<T extends string> {
12
- type: T;
13
- }
@@ -1 +0,0 @@
1
- export * from "./IMcpLlmTransportProps";