@smythos/sre 1.5.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 (188) hide show
  1. package/README.md +135 -0
  2. package/dist/index.js +7 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/types/Components/APICall/APICall.class.d.ts +34 -0
  5. package/dist/types/Components/APICall/AccessTokenManager.d.ts +17 -0
  6. package/dist/types/Components/APICall/ArrayBufferResponse.helper.d.ts +3 -0
  7. package/dist/types/Components/APICall/OAuth.helper.d.ts +10 -0
  8. package/dist/types/Components/APICall/mimeTypeCategories.d.ts +6 -0
  9. package/dist/types/Components/APICall/parseData.d.ts +5 -0
  10. package/dist/types/Components/APICall/parseHeaders.d.ts +3 -0
  11. package/dist/types/Components/APICall/parseProxy.d.ts +4 -0
  12. package/dist/types/Components/APICall/parseUrl.d.ts +7 -0
  13. package/dist/types/Components/APIEndpoint.class.d.ts +16 -0
  14. package/dist/types/Components/APIOutput.class.d.ts +15 -0
  15. package/dist/types/Components/AgentPlugin.class.d.ts +16 -0
  16. package/dist/types/Components/Async.class.d.ts +17 -0
  17. package/dist/types/Components/Await.class.d.ts +22 -0
  18. package/dist/types/Components/Classifier.class.d.ts +33 -0
  19. package/dist/types/Components/Component.class.d.ts +35 -0
  20. package/dist/types/Components/ComponentHost.class.d.ts +12 -0
  21. package/dist/types/Components/DataSourceCleaner.class.d.ts +19 -0
  22. package/dist/types/Components/DataSourceIndexer.class.d.ts +25 -0
  23. package/dist/types/Components/DataSourceLookup.class.d.ts +17 -0
  24. package/dist/types/Components/FEncDec.class.d.ts +17 -0
  25. package/dist/types/Components/FHash.class.d.ts +17 -0
  26. package/dist/types/Components/FSign.class.d.ts +18 -0
  27. package/dist/types/Components/FSleep.class.d.ts +19 -0
  28. package/dist/types/Components/FTimestamp.class.d.ts +19 -0
  29. package/dist/types/Components/FileStore.class.d.ts +11 -0
  30. package/dist/types/Components/ForEach.class.d.ts +16 -0
  31. package/dist/types/Components/GPTPlugin.class.d.ts +17 -0
  32. package/dist/types/Components/GenAILLM.class.d.ts +130 -0
  33. package/dist/types/Components/HuggingFace.class.d.ts +17 -0
  34. package/dist/types/Components/Image/imageSettings.config.d.ts +21 -0
  35. package/dist/types/Components/ImageGenerator.class.d.ts +17 -0
  36. package/dist/types/Components/JSONFilter.class.d.ts +13 -0
  37. package/dist/types/Components/LLMAssistant.class.d.ts +19 -0
  38. package/dist/types/Components/LogicAND.class.d.ts +7 -0
  39. package/dist/types/Components/LogicAtLeast.class.d.ts +9 -0
  40. package/dist/types/Components/LogicAtMost.class.d.ts +9 -0
  41. package/dist/types/Components/LogicOR.class.d.ts +7 -0
  42. package/dist/types/Components/LogicXOR.class.d.ts +7 -0
  43. package/dist/types/Components/MCPClient.class.d.ts +17 -0
  44. package/dist/types/Components/PromptGenerator.class.d.ts +19 -0
  45. package/dist/types/Components/ScrapflyWebScrape.class.d.ts +30 -0
  46. package/dist/types/Components/TavilyWebSearch.class.d.ts +31 -0
  47. package/dist/types/Components/index.d.ts +74 -0
  48. package/dist/types/Core/AgentProcess.helper.d.ts +36 -0
  49. package/dist/types/Core/Connector.class.d.ts +34 -0
  50. package/dist/types/Core/ConnectorsService.d.ts +64 -0
  51. package/dist/types/Core/DummyConnector.d.ts +4 -0
  52. package/dist/types/Core/HookService.d.ts +27 -0
  53. package/dist/types/Core/SmythRuntime.class.d.ts +28 -0
  54. package/dist/types/Core/SystemEvents.d.ts +12 -0
  55. package/dist/types/Core/boot.d.ts +1 -0
  56. package/dist/types/config.d.ts +11 -0
  57. package/dist/types/constants.d.ts +79 -0
  58. package/dist/types/helpers/BinaryInput.helper.d.ts +33 -0
  59. package/dist/types/helpers/Conversation.helper.d.ts +85 -0
  60. package/dist/types/helpers/JsonContent.helper.d.ts +16 -0
  61. package/dist/types/helpers/LocalCache.helper.d.ts +14 -0
  62. package/dist/types/helpers/Log.helper.d.ts +22 -0
  63. package/dist/types/helpers/OpenApiParser.helper.d.ts +10 -0
  64. package/dist/types/helpers/S3Cache.helper.d.ts +9 -0
  65. package/dist/types/helpers/SmythURI.helper.d.ts +3 -0
  66. package/dist/types/helpers/TemplateString.helper.d.ts +71 -0
  67. package/dist/types/helpers/TypeChecker.helper.d.ts +10 -0
  68. package/dist/types/index.d.ts +173 -0
  69. package/dist/types/subsystems/AgentManager/Agent.class.d.ts +78 -0
  70. package/dist/types/subsystems/AgentManager/Agent.helper.d.ts +1 -0
  71. package/dist/types/subsystems/AgentManager/AgentData.service/AgentDataConnector.d.ts +33 -0
  72. package/dist/types/subsystems/AgentManager/AgentData.service/connectors/CLIAgentDataConnector.class.d.ts +20 -0
  73. package/dist/types/subsystems/AgentManager/AgentData.service/connectors/LocalAgentDataConnector.class.d.ts +48 -0
  74. package/dist/types/subsystems/AgentManager/AgentData.service/connectors/NullAgentData.class.d.ts +19 -0
  75. package/dist/types/subsystems/AgentManager/AgentData.service/index.d.ts +4 -0
  76. package/dist/types/subsystems/AgentManager/AgentLogger.class.d.ts +11 -0
  77. package/dist/types/subsystems/AgentManager/AgentRequest.class.d.ts +15 -0
  78. package/dist/types/subsystems/AgentManager/AgentRuntime.class.d.ts +91 -0
  79. package/dist/types/subsystems/AgentManager/AgentSSE.class.d.ts +40 -0
  80. package/dist/types/subsystems/AgentManager/AgentSettings.class.d.ts +12 -0
  81. package/dist/types/subsystems/AgentManager/Component.service/ComponentConnector.d.ts +17 -0
  82. package/dist/types/subsystems/AgentManager/Component.service/connectors/LocalComponentConnector.class.d.ts +14 -0
  83. package/dist/types/subsystems/AgentManager/Component.service/index.d.ts +4 -0
  84. package/dist/types/subsystems/AgentManager/EmbodimentSettings.class.d.ts +8 -0
  85. package/dist/types/subsystems/AgentManager/ForkedAgent.class.d.ts +15 -0
  86. package/dist/types/subsystems/AgentManager/OSResourceMonitor.d.ts +2 -0
  87. package/dist/types/subsystems/ComputeManager/Code.service/CodeConnector.d.ts +58 -0
  88. package/dist/types/subsystems/ComputeManager/Code.service/connectors/AWSLambdaCode.class.d.ts +15 -0
  89. package/dist/types/subsystems/ComputeManager/Code.service/index.d.ts +4 -0
  90. package/dist/types/subsystems/IO/CLI.service/CLIConnector.d.ts +21 -0
  91. package/dist/types/subsystems/IO/CLI.service/index.d.ts +4 -0
  92. package/dist/types/subsystems/IO/Log.service/LogConnector.d.ts +17 -0
  93. package/dist/types/subsystems/IO/Log.service/connectors/ConsoleLog.class.d.ts +12 -0
  94. package/dist/types/subsystems/IO/Log.service/index.d.ts +4 -0
  95. package/dist/types/subsystems/IO/NKV.service/NKVConnector.d.ts +33 -0
  96. package/dist/types/subsystems/IO/NKV.service/connectors/NKVRAM.class.d.ts +43 -0
  97. package/dist/types/subsystems/IO/NKV.service/connectors/NKVRedis.class.d.ts +27 -0
  98. package/dist/types/subsystems/IO/NKV.service/index.d.ts +4 -0
  99. package/dist/types/subsystems/IO/Router.service/RouterConnector.d.ts +11 -0
  100. package/dist/types/subsystems/IO/Router.service/connectors/ExpressRouter.class.d.ts +21 -0
  101. package/dist/types/subsystems/IO/Router.service/connectors/NullRouter.class.d.ts +12 -0
  102. package/dist/types/subsystems/IO/Router.service/index.d.ts +4 -0
  103. package/dist/types/subsystems/IO/Storage.service/SmythFS.class.d.ts +49 -0
  104. package/dist/types/subsystems/IO/Storage.service/StorageConnector.d.ts +30 -0
  105. package/dist/types/subsystems/IO/Storage.service/connectors/LocalStorage.class.d.ts +58 -0
  106. package/dist/types/subsystems/IO/Storage.service/connectors/S3Storage.class.d.ts +53 -0
  107. package/dist/types/subsystems/IO/Storage.service/index.d.ts +4 -0
  108. package/dist/types/subsystems/IO/VectorDB.service/VectorDBConnector.d.ts +41 -0
  109. package/dist/types/subsystems/IO/VectorDB.service/connectors/MilvusVectorDB.class.d.ts +49 -0
  110. package/dist/types/subsystems/IO/VectorDB.service/connectors/PineconeVectorDB.class.d.ts +50 -0
  111. package/dist/types/subsystems/IO/VectorDB.service/connectors/RAMVecrtorDB.class.d.ts +52 -0
  112. package/dist/types/subsystems/IO/VectorDB.service/embed/BaseEmbedding.d.ts +53 -0
  113. package/dist/types/subsystems/IO/VectorDB.service/embed/OpenAIEmbedding.d.ts +16 -0
  114. package/dist/types/subsystems/IO/VectorDB.service/embed/index.d.ts +16 -0
  115. package/dist/types/subsystems/IO/VectorDB.service/index.d.ts +4 -0
  116. package/dist/types/subsystems/LLMManager/LLM.helper.d.ts +125 -0
  117. package/dist/types/subsystems/LLMManager/LLM.inference.d.ts +36 -0
  118. package/dist/types/subsystems/LLMManager/LLM.service/LLMConnector.d.ts +62 -0
  119. package/dist/types/subsystems/LLMManager/LLM.service/LLMCredentials.helper.d.ts +3 -0
  120. package/dist/types/subsystems/LLMManager/LLM.service/connectors/Anthropic.class.d.ts +68 -0
  121. package/dist/types/subsystems/LLMManager/LLM.service/connectors/Bedrock.class.d.ts +46 -0
  122. package/dist/types/subsystems/LLMManager/LLM.service/connectors/Echo.class.d.ts +18 -0
  123. package/dist/types/subsystems/LLMManager/LLM.service/connectors/GoogleAI.class.d.ts +57 -0
  124. package/dist/types/subsystems/LLMManager/LLM.service/connectors/Groq.class.d.ts +55 -0
  125. package/dist/types/subsystems/LLMManager/LLM.service/connectors/OpenAI.class.d.ts +92 -0
  126. package/dist/types/subsystems/LLMManager/LLM.service/connectors/Perplexity.class.d.ts +86 -0
  127. package/dist/types/subsystems/LLMManager/LLM.service/connectors/VertexAI.class.d.ts +38 -0
  128. package/dist/types/subsystems/LLMManager/LLM.service/index.d.ts +5 -0
  129. package/dist/types/subsystems/LLMManager/ModelsProvider.service/ModelsProviderConnector.d.ts +36 -0
  130. package/dist/types/subsystems/LLMManager/ModelsProvider.service/connectors/SmythModelsProvider.class.d.ts +39 -0
  131. package/dist/types/subsystems/LLMManager/ModelsProvider.service/index.d.ts +4 -0
  132. package/dist/types/subsystems/LLMManager/custom-models.d.ts +785 -0
  133. package/dist/types/subsystems/LLMManager/models.d.ts +2629 -0
  134. package/dist/types/subsystems/LLMManager/paramMappings.d.ts +69 -0
  135. package/dist/types/subsystems/MemoryManager/Cache.service/CacheConnector.d.ts +41 -0
  136. package/dist/types/subsystems/MemoryManager/Cache.service/connectors/LocalStorageCache.class.d.ts +33 -0
  137. package/dist/types/subsystems/MemoryManager/Cache.service/connectors/RAMCache.class.d.ts +31 -0
  138. package/dist/types/subsystems/MemoryManager/Cache.service/connectors/RedisCache.class.d.ts +33 -0
  139. package/dist/types/subsystems/MemoryManager/Cache.service/connectors/S3Cache.class.d.ts +38 -0
  140. package/dist/types/subsystems/MemoryManager/Cache.service/index.d.ts +4 -0
  141. package/dist/types/subsystems/MemoryManager/LLMCache.d.ts +27 -0
  142. package/dist/types/subsystems/MemoryManager/LLMContext.d.ts +25 -0
  143. package/dist/types/subsystems/MemoryManager/RuntimeContext.d.ts +50 -0
  144. package/dist/types/subsystems/Security/AccessControl/ACL.class.d.ts +29 -0
  145. package/dist/types/subsystems/Security/AccessControl/AccessCandidate.class.d.ts +21 -0
  146. package/dist/types/subsystems/Security/AccessControl/AccessRequest.class.d.ts +13 -0
  147. package/dist/types/subsystems/Security/Account.service/AccountConnector.d.ts +27 -0
  148. package/dist/types/subsystems/Security/Account.service/connectors/AWSAccount.class.d.ts +19 -0
  149. package/dist/types/subsystems/Security/Account.service/connectors/DummyAccount.class.d.ts +19 -0
  150. package/dist/types/subsystems/Security/Account.service/connectors/JSONFileAccount.class.d.ts +25 -0
  151. package/dist/types/subsystems/Security/Account.service/index.d.ts +4 -0
  152. package/dist/types/subsystems/Security/Credentials.helper.d.ts +16 -0
  153. package/dist/types/subsystems/Security/ManagedVault.service/ManagedVaultConnector.d.ts +23 -0
  154. package/dist/types/subsystems/Security/ManagedVault.service/connectors/NullManagedVault.class.d.ts +14 -0
  155. package/dist/types/subsystems/Security/ManagedVault.service/connectors/SecretManagerManagedVault.d.ts +22 -0
  156. package/dist/types/subsystems/Security/ManagedVault.service/index.d.ts +4 -0
  157. package/dist/types/subsystems/Security/SecureConnector.class.d.ts +13 -0
  158. package/dist/types/subsystems/Security/Vault.service/Vault.helper.d.ts +5 -0
  159. package/dist/types/subsystems/Security/Vault.service/VaultConnector.d.ts +17 -0
  160. package/dist/types/subsystems/Security/Vault.service/connectors/HashicorpVault.class.d.ts +13 -0
  161. package/dist/types/subsystems/Security/Vault.service/connectors/JSONFileVault.class.d.ts +23 -0
  162. package/dist/types/subsystems/Security/Vault.service/connectors/NullVault.class.d.ts +16 -0
  163. package/dist/types/subsystems/Security/Vault.service/connectors/SecretsManager.class.d.ts +20 -0
  164. package/dist/types/subsystems/Security/Vault.service/index.d.ts +4 -0
  165. package/dist/types/types/ACL.types.d.ts +83 -0
  166. package/dist/types/types/AWS.types.d.ts +7 -0
  167. package/dist/types/types/Agent.types.d.ts +52 -0
  168. package/dist/types/types/AgentLogger.types.d.ts +16 -0
  169. package/dist/types/types/Cache.types.d.ts +1 -0
  170. package/dist/types/types/Common.types.d.ts +3 -0
  171. package/dist/types/types/LLM.types.d.ts +365 -0
  172. package/dist/types/types/Redis.types.d.ts +6 -0
  173. package/dist/types/types/SRE.types.d.ts +60 -0
  174. package/dist/types/types/Security.types.d.ts +16 -0
  175. package/dist/types/types/Storage.types.d.ts +3 -0
  176. package/dist/types/types/VectorDB.types.d.ts +66 -0
  177. package/dist/types/utils/base64.utils.d.ts +86 -0
  178. package/dist/types/utils/cli.utils.d.ts +20 -0
  179. package/dist/types/utils/data.utils.d.ts +17 -0
  180. package/dist/types/utils/date-time.utils.d.ts +3 -0
  181. package/dist/types/utils/general.utils.d.ts +75 -0
  182. package/dist/types/utils/index.d.ts +9 -0
  183. package/dist/types/utils/numbers.utils.d.ts +2 -0
  184. package/dist/types/utils/oauth.utils.d.ts +7 -0
  185. package/dist/types/utils/string.utils.d.ts +28 -0
  186. package/dist/types/utils/url.utils.d.ts +1 -0
  187. package/dist/types/utils/validation.utils.d.ts +25 -0
  188. package/package.json +117 -0
@@ -0,0 +1,17 @@
1
+ import { ACL } from '@sre/Security/AccessControl/ACL.class';
2
+ import { AccessCandidate } from '@sre/Security/AccessControl/AccessCandidate.class';
3
+ import { AccessRequest } from '@sre/Security/AccessControl/AccessRequest.class';
4
+ import { SecureConnector } from '@sre/Security/SecureConnector.class';
5
+ import { IAccessCandidate } from '@sre/types/ACL.types';
6
+ export interface IVaultRequest {
7
+ get(keyId: string): Promise<string>;
8
+ exists(keyId: string): Promise<boolean>;
9
+ listKeys(): Promise<string[]>;
10
+ }
11
+ export declare abstract class VaultConnector extends SecureConnector {
12
+ requester(candidate: AccessCandidate): IVaultRequest;
13
+ abstract getResourceACL(resourceId: string, candidate: IAccessCandidate): Promise<ACL>;
14
+ protected abstract get(acRequest: AccessRequest, keyId: string): Promise<string>;
15
+ protected abstract exists(acRequest: AccessRequest, keyId: string): Promise<boolean>;
16
+ protected abstract listKeys(acRequest: AccessRequest): Promise<string[]>;
17
+ }
@@ -0,0 +1,13 @@
1
+ import { AccessRequest } from '@sre/Security/AccessControl/AccessRequest.class';
2
+ import { ACL } from '@sre/Security/AccessControl/ACL.class';
3
+ import { IAccessCandidate } from '@sre/types/ACL.types';
4
+ import { VaultConnector } from '../VaultConnector';
5
+ export declare class HashicorpVault extends VaultConnector {
6
+ protected _settings: any;
7
+ name: string;
8
+ constructor(_settings: any);
9
+ protected get(acRequest: AccessRequest, keyId: string): Promise<any>;
10
+ protected exists(acRequest: AccessRequest, keyId: string): Promise<boolean>;
11
+ protected listKeys(acRequest: AccessRequest): Promise<any[]>;
12
+ getResourceACL(resourceId: string, candidate: IAccessCandidate): Promise<ACL>;
13
+ }
@@ -0,0 +1,23 @@
1
+ import { AccessRequest } from '@sre/Security/AccessControl/AccessRequest.class';
2
+ import { ACL } from '@sre/Security/AccessControl/ACL.class';
3
+ import { IAccessCandidate } from '@sre/types/ACL.types';
4
+ import { VaultConnector } from '../VaultConnector';
5
+ export type JSONFileVaultConfig = {
6
+ file?: string;
7
+ fileKey?: string;
8
+ shared?: boolean;
9
+ };
10
+ export declare class JSONFileVault extends VaultConnector {
11
+ protected _settings: JSONFileVaultConfig;
12
+ name: string;
13
+ private vaultData;
14
+ private index;
15
+ private sharedVault;
16
+ constructor(_settings: JSONFileVaultConfig);
17
+ private findVaultFile;
18
+ private getMasterKeyInteractive;
19
+ protected get(acRequest: AccessRequest, keyId: string): Promise<any>;
20
+ protected exists(acRequest: AccessRequest, keyId: string): Promise<boolean>;
21
+ protected listKeys(acRequest: AccessRequest): Promise<string[]>;
22
+ getResourceACL(resourceId: string, candidate: IAccessCandidate): Promise<ACL>;
23
+ }
@@ -0,0 +1,16 @@
1
+ import { AccessRequest } from '@sre/Security/AccessControl/AccessRequest.class';
2
+ import { ACL } from '@sre/Security/AccessControl/ACL.class';
3
+ import { IAccessCandidate } from '@sre/types/ACL.types';
4
+ import { VaultConnector } from '../VaultConnector';
5
+ export declare class NullVault extends VaultConnector {
6
+ protected _settings: any;
7
+ name: string;
8
+ private vaultData;
9
+ private index;
10
+ private sharedVault;
11
+ constructor(_settings: any);
12
+ protected get(acRequest: AccessRequest, keyId: string): Promise<string>;
13
+ protected exists(acRequest: AccessRequest, keyId: string): Promise<boolean>;
14
+ protected listKeys(acRequest: AccessRequest): Promise<any[]>;
15
+ getResourceACL(resourceId: string, candidate: IAccessCandidate): Promise<ACL>;
16
+ }
@@ -0,0 +1,20 @@
1
+ import { AccessRequest } from '@sre/Security/AccessControl/AccessRequest.class';
2
+ import { ACL } from '@sre/Security/AccessControl/ACL.class';
3
+ import { IAccessCandidate } from '@sre/types/ACL.types';
4
+ import { VaultConnector } from '../VaultConnector';
5
+ export type SecretsManagerConfig = {
6
+ region: string;
7
+ awsAccessKeyId?: string;
8
+ awsSecretAccessKey?: string;
9
+ };
10
+ export declare class SecretsManager extends VaultConnector {
11
+ protected _settings: SecretsManagerConfig;
12
+ name: string;
13
+ private secretsManager;
14
+ constructor(_settings: SecretsManagerConfig);
15
+ protected get(acRequest: AccessRequest, secretName: string): Promise<any>;
16
+ protected exists(acRequest: AccessRequest, keyId: string): Promise<boolean>;
17
+ protected listKeys(acRequest: AccessRequest): Promise<any[]>;
18
+ getResourceACL(resourceId: string, candidate: IAccessCandidate): Promise<ACL>;
19
+ private getSecretByName;
20
+ }
@@ -0,0 +1,4 @@
1
+ import { ConnectorServiceProvider } from '@sre/Core/ConnectorsService';
2
+ export declare class VaultService extends ConnectorServiceProvider {
3
+ register(): void;
4
+ }
@@ -0,0 +1,83 @@
1
+ export declare const DEFAULT_TEAM_ID = "default";
2
+ export declare enum TAccessLevel {
3
+ None = "none",
4
+ Owner = "owner",
5
+ Read = "read",
6
+ Write = "write"
7
+ }
8
+ export declare enum TAccessRole {
9
+ Agent = "agent",
10
+ User = "user",
11
+ Team = "team",
12
+ Public = "public"
13
+ }
14
+ export declare const RoleMap: {
15
+ user: string;
16
+ agent: string;
17
+ team: string;
18
+ public: string;
19
+ };
20
+ export declare const LevelMap: {
21
+ none: string;
22
+ owner: string;
23
+ read: string;
24
+ write: string;
25
+ };
26
+ export declare const ReverseRoleMap: {
27
+ [k: string]: string;
28
+ };
29
+ export declare const ReverseLevelMap: {
30
+ [k: string]: string;
31
+ };
32
+ /**
33
+ * an ACLEntry is a list of access levels for a given owner.
34
+ * an owner can be an agent, a user, a team or the public.
35
+ */
36
+ export type TACLEntry = {
37
+ [hashedOwnerKey: string]: TAccessLevel[] | undefined;
38
+ };
39
+ /**
40
+ * The Access Control List (ACL) is a list of access rights for a given resource.
41
+ * Each entry in this ACL represents a role
42
+ * Role entries define a list of owners of the resource and the access levels they have.
43
+ * e.g.
44
+ * The following ACL defines that agentA and teamA has read and write access, while agentB and teamC has read access.
45
+ * {
46
+ * agent: {
47
+ * 'agentA': ['read', 'write'],
48
+ * 'agentB': ['read'],
49
+ * },
50
+ * team: {
51
+ * 'teamA': ['read', 'write'],
52
+ * 'teamC': ['read'],
53
+ * }
54
+ * }
55
+ */
56
+ export interface IACL {
57
+ hashAlgorithm?: string | undefined;
58
+ entries?: {
59
+ [key in TAccessRole]?: TACLEntry | undefined;
60
+ };
61
+ migrated?: boolean | undefined;
62
+ }
63
+ export interface IAccessCandidate {
64
+ role: TAccessRole;
65
+ id: string;
66
+ }
67
+ export interface IAccessRequest {
68
+ id: string;
69
+ resourceId: string;
70
+ candidate: IAccessCandidate;
71
+ level: TAccessLevel | TAccessLevel[];
72
+ }
73
+ export declare enum TAccessResult {
74
+ Granted = "granted",
75
+ Denied = "denied"
76
+ }
77
+ export type TAccessTicket = {
78
+ request: IAccessRequest;
79
+ access: TAccessResult;
80
+ };
81
+ export declare class ACLAccessDeniedError extends Error {
82
+ constructor(message?: string);
83
+ }
@@ -0,0 +1,7 @@
1
+ export type AWSCredentials = {
2
+ accessKeyId: string;
3
+ secretAccessKey: string;
4
+ };
5
+ export type AWSRegionConfig = {
6
+ region: string;
7
+ };
@@ -0,0 +1,52 @@
1
+ import { AgentRequest } from '@sre/AgentManager/AgentRequest.class';
2
+ import { AgentRuntime } from '@sre/AgentManager/AgentRuntime.class';
3
+ import { AgentSSE } from '@sre/AgentManager/AgentSSE.class';
4
+ import { IModelsProviderRequest } from '@sre/LLMManager/ModelsProvider.service/ModelsProviderConnector';
5
+ export type TAgentProcessParams = {
6
+ method: string;
7
+ path: string;
8
+ body?: Record<string, any>;
9
+ query?: Record<string, any>;
10
+ headers?: Record<string, string>;
11
+ params?: any;
12
+ };
13
+ export interface IAgent {
14
+ id: any;
15
+ jobID: any;
16
+ async: boolean;
17
+ agentSettings: any;
18
+ name: any;
19
+ data: any;
20
+ teamId: any;
21
+ components: any;
22
+ connections: any;
23
+ endpoints: any;
24
+ sessionId: any;
25
+ sessionTag: any;
26
+ callerSessionId: any;
27
+ apiBasePath: any;
28
+ agentRuntime: AgentRuntime | any;
29
+ usingTestDomain: any;
30
+ domain: any;
31
+ debugSessionEnabled: any;
32
+ circularLimit: any;
33
+ version: any;
34
+ agentVariables: any;
35
+ kill: any;
36
+ sse: AgentSSE;
37
+ modelsProvider: IModelsProviderRequest;
38
+ agentRequest: AgentRequest | any;
39
+ callback: (data: any) => void;
40
+ setRequest: (agentRequest: AgentRequest | any) => void;
41
+ setCallback: (callback: (data: any) => void) => void;
42
+ isKilled: () => boolean;
43
+ process: (endpointPath: string, input: any) => Promise<any>;
44
+ postProcess: (result: any) => Promise<any>;
45
+ addSSE: (sseSource: Response | AgentSSE, monitorId?: string) => void;
46
+ getConnectionSource: (connection: any) => any;
47
+ getConnectionTarget: (connection: any) => any;
48
+ findReadablePredecessors: (componentId: string) => any[];
49
+ callComponent: (sourceId: string, componentId: string, input?: any) => Promise<any>;
50
+ JSONExpression: (obj: any, propertyString: string) => any;
51
+ callNextComponents: (componentId: string, output: any) => Promise<any>;
52
+ }
@@ -0,0 +1,16 @@
1
+ export type AgentCallLog = {
2
+ sourceId?: any;
3
+ componentId?: any;
4
+ domain?: any;
5
+ input?: any;
6
+ output?: any;
7
+ inputTimestamp?: any;
8
+ outputTimestamp?: any;
9
+ result?: any;
10
+ error?: any;
11
+ sessionID?: any;
12
+ tags?: string;
13
+ step?: number;
14
+ workflowID?: string;
15
+ processID?: string;
16
+ };
@@ -0,0 +1 @@
1
+ export type CacheMetadata = Record<string, any> | undefined;
@@ -0,0 +1,3 @@
1
+ export type KeyValueObject = {
2
+ [key: string]: any;
3
+ };
@@ -0,0 +1,365 @@
1
+ import OpenAI from 'openai';
2
+ import Anthropic from '@anthropic-ai/sdk';
3
+ import { FunctionCallingMode, ModelParams, GenerateContentRequest } from '@google/generative-ai';
4
+ import { BinaryInput } from '@sre/helpers/BinaryInput.helper';
5
+ import { type models } from '@sre/LLMManager/models';
6
+ import { AccessRequest } from '@sre/Security/AccessControl/AccessRequest.class';
7
+ import { ConverseCommandInput } from '@aws-sdk/client-bedrock-runtime';
8
+ export type LLMProvider = Extract<(typeof models)[keyof typeof models], {
9
+ llm: string;
10
+ }>['llm'] | 'VertexAI' | 'Bedrock';
11
+ export type LLMModel = keyof typeof models;
12
+ export type LLMModelInfo = (typeof models)[LLMModel];
13
+ export interface VertexAICredentials {
14
+ type: 'service_account';
15
+ project_id: string;
16
+ private_key_id: string;
17
+ private_key: string;
18
+ client_email: string;
19
+ client_id: string;
20
+ auth_uri: string;
21
+ token_uri: string;
22
+ auth_provider_x509_cert_url: string;
23
+ client_x509_cert_url: string;
24
+ universe_domain?: string;
25
+ }
26
+ export interface BasicCredentials {
27
+ apiKey: string;
28
+ isUserKey: boolean;
29
+ }
30
+ export interface BedrockCredentials {
31
+ accessKeyId: string;
32
+ secretAccessKey: string;
33
+ sessionToken?: string;
34
+ }
35
+ export type ILLMConnectorCredentials = BasicCredentials | BedrockCredentials | VertexAICredentials;
36
+ export type TOpenAIResponseToolChoice = OpenAI.Responses.ToolChoiceOptions | OpenAI.Responses.ToolChoiceTypes | OpenAI.Responses.ToolChoiceFunction;
37
+ export type TLLMToolChoice = OpenAI.ChatCompletionToolChoiceOption;
38
+ export type TLLMParams = {
39
+ model: TLLMModel | string;
40
+ modelEntryName?: string;
41
+ credentials?: ILLMConnectorCredentials;
42
+ prompt?: string;
43
+ messages?: any[];
44
+ temperature?: number;
45
+ maxTokens?: number;
46
+ stopSequences?: string[];
47
+ topP?: number;
48
+ topK?: number;
49
+ frequencyPenalty?: number;
50
+ presencePenalty?: number;
51
+ responseFormat?: any;
52
+ modelInfo?: TCustomLLMModel;
53
+ files?: BinaryInput[];
54
+ toolsConfig?: {
55
+ tools?: OpenAI.ChatCompletionTool[] | OpenAI.Responses.Tool[] | OpenAI.Responses.WebSearchTool[];
56
+ tool_choice?: TLLMToolChoice;
57
+ };
58
+ baseURL?: string;
59
+ size?: OpenAI.Images.ImageGenerateParams['size'] | OpenAI.Images.ImageEditParams['size'];
60
+ quality?: 'standard' | 'hd';
61
+ n?: number;
62
+ style?: 'vivid' | 'natural';
63
+ cache?: boolean;
64
+ agentId?: string;
65
+ teamId?: string;
66
+ thinking?: {
67
+ type: 'enabled' | 'disabled';
68
+ budget_tokens: number;
69
+ };
70
+ maxThinkingTokens?: number;
71
+ useWebSearch?: boolean;
72
+ webSearchContextSize?: 'high' | 'medium' | 'low';
73
+ webSearchCity?: string;
74
+ webSearchCountry?: string;
75
+ webSearchRegion?: string;
76
+ webSearchTimezone?: string;
77
+ useReasoning?: boolean;
78
+ isUserKey?: boolean;
79
+ capabilities?: {
80
+ search?: boolean;
81
+ reasoning?: boolean;
82
+ imageGeneration?: boolean;
83
+ imageEditing?: boolean;
84
+ };
85
+ max_output_tokens?: number;
86
+ abortSignal?: AbortSignal;
87
+ };
88
+ export type TLLMParamsV2 = {
89
+ model: string;
90
+ modelEntryName: string;
91
+ messages: any[];
92
+ toolsConfig?: {
93
+ tools?: OpenAI.Responses.Tool[];
94
+ tool_choice?: OpenAI.Responses.ToolChoiceOptions | OpenAI.Responses.ToolChoiceTypes | OpenAI.Responses.ToolChoiceFunction;
95
+ };
96
+ baseURL?: string;
97
+ stream?: boolean;
98
+ responseFormat?: any;
99
+ credentials?: {
100
+ apiKey?: string;
101
+ isUserKey?: boolean;
102
+ };
103
+ max_output_tokens?: number;
104
+ temperature?: number;
105
+ top_p?: number;
106
+ top_k?: number;
107
+ frequency_penalty?: number;
108
+ presence_penalty?: number;
109
+ teamId?: string;
110
+ files?: BinaryInput[];
111
+ useWebSearch?: boolean;
112
+ webSearchContextSize?: 'high' | 'medium' | 'low';
113
+ webSearchCity?: string;
114
+ webSearchCountry?: string;
115
+ webSearchRegion?: string;
116
+ webSearchTimezone?: string;
117
+ };
118
+ export type TLLMConnectorParams = Omit<TLLMParams, 'model'> & {
119
+ model: string | TLLMModel | TCustomLLMModel;
120
+ };
121
+ export type TLLMModelEntry = {
122
+ llm: string;
123
+ tokens?: number;
124
+ completionTokens?: number;
125
+ enabled?: boolean;
126
+ components?: string[];
127
+ alias?: string;
128
+ tags?: string[];
129
+ keyOptions?: {
130
+ tokens: number;
131
+ completionTokens: number;
132
+ };
133
+ };
134
+ export declare enum TLLMCredentials {
135
+ Vault = "vault",
136
+ Internal = "internal",
137
+ BedrockVault = "bedrock_vault",
138
+ VertexAIVault = "vertexai_vault",
139
+ None = "none"
140
+ }
141
+ export type TLLMModel = {
142
+ llm?: string;
143
+ isCustomLLM?: boolean;
144
+ modelId?: string;
145
+ tokens?: number;
146
+ completionTokens?: number;
147
+ components?: string[];
148
+ tags?: string[];
149
+ label?: string;
150
+ provider?: LLMProvider;
151
+ features?: string[];
152
+ enabled?: boolean;
153
+ alias?: string;
154
+ baseURL?: string;
155
+ keyOptions?: {
156
+ tokens: number;
157
+ completionTokens: number;
158
+ };
159
+ credentials?: TLLMCredentials;
160
+ params?: TLLMParams;
161
+ };
162
+ export declare const BuiltinLLMProviders: {
163
+ readonly Echo: "Echo";
164
+ readonly OpenAI: "OpenAI";
165
+ readonly DeepSeek: "DeepSeek";
166
+ readonly GoogleAI: "GoogleAI";
167
+ readonly Anthropic: "Anthropic";
168
+ readonly Groq: "Groq";
169
+ readonly TogetherAI: "TogetherAI";
170
+ readonly Bedrock: "Bedrock";
171
+ readonly VertexAI: "VertexAI";
172
+ readonly xAI: "xAI";
173
+ readonly Perplexity: "Perplexity";
174
+ };
175
+ export type TBuiltinLLMProvider = (typeof BuiltinLLMProviders)[keyof typeof BuiltinLLMProviders];
176
+ export interface ILLMProviders {
177
+ }
178
+ export type TLLMProvider = TBuiltinLLMProvider | keyof ILLMProviders;
179
+ export declare const TLLMProvider: {
180
+ readonly Echo: "Echo";
181
+ readonly OpenAI: "OpenAI";
182
+ readonly DeepSeek: "DeepSeek";
183
+ readonly GoogleAI: "GoogleAI";
184
+ readonly Anthropic: "Anthropic";
185
+ readonly Groq: "Groq";
186
+ readonly TogetherAI: "TogetherAI";
187
+ readonly Bedrock: "Bedrock";
188
+ readonly VertexAI: "VertexAI";
189
+ readonly xAI: "xAI";
190
+ readonly Perplexity: "Perplexity";
191
+ };
192
+ export type TBedrockSettings = {
193
+ keyIDName: string;
194
+ secretKeyName: string;
195
+ sessionKeyName: string;
196
+ };
197
+ export type TVertexAISettings = {
198
+ projectId: string;
199
+ credentialsName: string;
200
+ jsonCredentialsName: string;
201
+ };
202
+ export type TCustomLLMModel = TLLMModel & {
203
+ name: string;
204
+ settings: {
205
+ foundationModel: string;
206
+ customModel: string;
207
+ region: string;
208
+ } & (TBedrockSettings | TVertexAISettings);
209
+ };
210
+ export type ToolData = {
211
+ index: number;
212
+ id: string;
213
+ type: string;
214
+ name: string;
215
+ arguments: string | Record<string, any>;
216
+ role: 'user' | 'tool' | 'assistant';
217
+ result?: string;
218
+ function?: any;
219
+ error?: string;
220
+ };
221
+ export interface AnthropicToolDefinition {
222
+ name: string;
223
+ description: string;
224
+ input_schema: {
225
+ type: 'object';
226
+ properties: Record<string, unknown>;
227
+ required: string[];
228
+ };
229
+ }
230
+ export type ToolDefinition = OpenAI.ChatCompletionTool | AnthropicToolDefinition;
231
+ export type ToolChoice = OpenAI.ChatCompletionToolChoiceOption | FunctionCallingMode;
232
+ export interface ToolsConfig {
233
+ tools?: ToolDefinition[];
234
+ tool_choice?: ToolChoice;
235
+ }
236
+ export declare enum TLLMMessageRole {
237
+ User = "user",
238
+ Assistant = "assistant",
239
+ System = "system",
240
+ Model = "model",
241
+ Tool = "tool",
242
+ Function = "function"
243
+ }
244
+ export type TLLMMessageBlock = {
245
+ role: TLLMMessageRole;
246
+ content?: string | {
247
+ text: string;
248
+ }[] | Array<Anthropic.TextBlockParam | Anthropic.ImageBlockParam | Anthropic.ToolUseBlockParam | Anthropic.ToolResultBlockParam>;
249
+ parts?: {
250
+ text?: string;
251
+ functionCall?: {
252
+ name: string;
253
+ args: string;
254
+ };
255
+ functionResponse?: {
256
+ name: string;
257
+ response: {
258
+ name: string;
259
+ content: string;
260
+ };
261
+ };
262
+ }[];
263
+ tool_calls?: ToolData[];
264
+ };
265
+ export type TLLMToolResultMessageBlock = TLLMMessageBlock & {
266
+ tool_call_id?: string;
267
+ name?: string;
268
+ };
269
+ export type GenerateImageConfig = {
270
+ size?: '256x256' | '512x512' | '1024x1024' | '1792x1024' | '1024x1792';
271
+ quality?: 'standard' | 'hd';
272
+ model: string;
273
+ style?: 'vivid' | 'natural';
274
+ n?: number;
275
+ response_format?: 'url' | 'b64_json';
276
+ prompt?: string;
277
+ };
278
+ export type TLLMInputMessage = {
279
+ role: string;
280
+ content?: string | {
281
+ text: string;
282
+ }[];
283
+ parts?: {
284
+ text: string;
285
+ }[];
286
+ };
287
+ export interface ILLMContextStore {
288
+ save(messages: any[]): Promise<void>;
289
+ load(count?: number): Promise<any[]>;
290
+ getMessage(message_id: string): Promise<any[]>;
291
+ }
292
+ export declare enum APIKeySource {
293
+ Smyth = "smyth-managed",
294
+ User = "user-managed",
295
+ Custom = "custom"
296
+ }
297
+ export interface SmythLLMUsage {
298
+ sourceId: string;
299
+ input_tokens: number;
300
+ input_tokens_cache_write: number;
301
+ input_tokens_cache_read: number;
302
+ output_tokens: number;
303
+ keySource?: APIKeySource;
304
+ agentId: string;
305
+ teamId: string;
306
+ tier?: string;
307
+ }
308
+ export interface SmythTaskUsage {
309
+ sourceId: string;
310
+ number: number;
311
+ agentId: string;
312
+ teamId: string;
313
+ }
314
+ export type TLLMModelsList = {
315
+ [key: string]: TLLMModel | TCustomLLMModel;
316
+ };
317
+ export declare enum TLLMEvent {
318
+ /** Generated response chunks */
319
+ Content = "content",
320
+ /** Thinking blocks/chunks */
321
+ Thinking = "thinking",
322
+ /** End of the response */
323
+ End = "end",
324
+ /** Error */
325
+ Error = "error",
326
+ /** Tool information : emitted by the LLM determines the next tool call */
327
+ ToolInfo = "toolInfo",
328
+ /** Tool call : emitted before the tool call */
329
+ ToolCall = "toolCall",
330
+ /** Tool result : emitted after the tool call */
331
+ ToolResult = "toolResult",
332
+ /** Tokens usage information */
333
+ Usage = "usage",
334
+ /** Interrupted : emitted when the response is interrupted before completion */
335
+ Interrupted = "interrupted"
336
+ }
337
+ export interface ILLMRequestContext {
338
+ modelEntryName: string;
339
+ agentId: string;
340
+ teamId: string;
341
+ isUserKey: boolean;
342
+ hasFiles?: boolean;
343
+ modelInfo: TCustomLLMModel | TLLMModel;
344
+ credentials: ILLMConnectorCredentials;
345
+ }
346
+ export interface ILLMRequestFuncParams<TBody = any> {
347
+ acRequest: AccessRequest;
348
+ body: TBody;
349
+ context: ILLMRequestContext;
350
+ }
351
+ export type TLLMChatResponse = {
352
+ content: string;
353
+ finishReason: string;
354
+ thinkingContent?: string;
355
+ usage?: any;
356
+ useTool?: boolean;
357
+ toolsData?: ToolData[];
358
+ message?: OpenAI.ChatCompletionMessageParam | Anthropic.MessageParam;
359
+ };
360
+ export type TOpenAIRequestBody = OpenAI.ChatCompletionCreateParamsNonStreaming | OpenAI.ChatCompletionCreateParamsStreaming | OpenAI.ChatCompletionCreateParams | OpenAI.Responses.ResponseCreateParams | OpenAI.Responses.ResponseCreateParamsNonStreaming | OpenAI.Responses.ResponseCreateParamsStreaming | OpenAI.Images.ImageGenerateParams | OpenAI.Images.ImageEditParams;
361
+ export type TAnthropicRequestBody = Anthropic.MessageCreateParamsNonStreaming;
362
+ export type TGoogleAIRequestBody = ModelParams & {
363
+ messages: string | TLLMMessageBlock[] | GenerateContentRequest;
364
+ };
365
+ export type TLLMRequestBody = TOpenAIRequestBody | TAnthropicRequestBody | TGoogleAIRequestBody | ConverseCommandInput;
@@ -0,0 +1,6 @@
1
+ export type RedisConfig = {
2
+ name: string;
3
+ password: string;
4
+ hosts: string | string[] | any[];
5
+ prefix?: string;
6
+ };