@smythos/sre 1.5.4 → 1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +122 -22317
- package/dist/index.js.map +1 -1
- package/dist/types/helpers/Sysconfig.helper.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/subsystems/IO/Log.service/connectors/ConsoleLog.class.d.ts +1 -1
- package/dist/types/subsystems/IO/NKV.service/NKVConnector.d.ts +2 -0
- package/dist/types/subsystems/IO/NKV.service/connectors/NKVLocalStorage.class.d.ts +34 -0
- package/dist/types/subsystems/IO/Storage.service/connectors/LocalStorage.class.d.ts +1 -0
- package/package.json +1 -1
- package/src/Components/DataSourceLookup.class.ts +1 -1
- package/src/Core/SmythRuntime.class.ts +3 -66
- package/src/helpers/Sysconfig.helper.ts +67 -0
- package/src/index.ts +2 -0
- package/src/index.ts.bak +178 -176
- package/src/subsystems/AgentManager/AgentLogger.class.ts +1 -1
- package/src/subsystems/IO/Log.service/connectors/ConsoleLog.class.ts +1 -1
- package/src/subsystems/IO/NKV.service/NKVConnector.ts +2 -0
- package/src/subsystems/IO/NKV.service/connectors/NKVLocalStorage.class.ts +211 -0
- package/src/subsystems/IO/NKV.service/connectors/NKVRAM.class.ts +1 -1
- package/src/subsystems/IO/NKV.service/index.ts +2 -0
- package/src/subsystems/IO/Storage.service/connectors/LocalStorage.class.ts +21 -1
- package/src/subsystems/Security/Vault.service/connectors/JSONFileVault.class.ts +11 -11
package/src/index.ts.bak
CHANGED
|
@@ -1,179 +1,181 @@
|
|
|
1
|
-
//!!! This is a generated file, do not edit it directly !!!//
|
|
2
|
-
|
|
3
|
-
export { version } from '../package.json';
|
|
4
|
-
|
|
1
|
+
//!!! This is a generated file, do not edit it directly !!!//
|
|
5
2
|
|
|
3
|
+
export { version } from '../package.json';
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './Components/
|
|
13
|
-
export * from './Components/
|
|
14
|
-
export * from './Components/
|
|
15
|
-
export * from './Components/
|
|
16
|
-
export * from './Components/
|
|
17
|
-
export * from './Components/
|
|
18
|
-
export * from './Components/
|
|
19
|
-
export * from './Components/
|
|
20
|
-
export * from './Components/
|
|
21
|
-
export * from './Components/
|
|
22
|
-
export * from './Components/
|
|
23
|
-
export * from './Components/
|
|
24
|
-
export * from './Components/
|
|
25
|
-
export * from './Components/
|
|
26
|
-
export * from './Components/
|
|
27
|
-
export * from './Components/
|
|
28
|
-
export * from './Components/
|
|
29
|
-
export * from './Components/
|
|
30
|
-
export * from './Components/
|
|
31
|
-
export * from './Components/
|
|
32
|
-
export * from './Components/
|
|
33
|
-
export * from './Components/
|
|
34
|
-
export * from './Components/
|
|
35
|
-
export * from './Components/
|
|
36
|
-
export * from './Components/
|
|
37
|
-
export * from './Components/
|
|
38
|
-
export * from './Components/
|
|
39
|
-
export * from './Components/
|
|
40
|
-
export * from './Components/
|
|
41
|
-
export * from './Components/
|
|
42
|
-
export * from './Components/
|
|
43
|
-
export * from './Components/
|
|
44
|
-
export * from './
|
|
45
|
-
export * from './
|
|
46
|
-
export * from './Core/
|
|
47
|
-
export * from './Core/
|
|
48
|
-
export * from './Core/
|
|
49
|
-
export * from './Core/
|
|
50
|
-
export * from './Core/
|
|
51
|
-
export * from './Core/
|
|
52
|
-
export * from './
|
|
53
|
-
export * from './
|
|
54
|
-
export * from './helpers/
|
|
55
|
-
export * from './helpers/
|
|
56
|
-
export * from './helpers/
|
|
57
|
-
export * from './helpers/
|
|
58
|
-
export * from './helpers/
|
|
59
|
-
export * from './helpers/
|
|
60
|
-
export * from './helpers/
|
|
61
|
-
export * from './helpers/
|
|
62
|
-
export * from './
|
|
63
|
-
export * from './
|
|
64
|
-
export * from './
|
|
65
|
-
export * from './types/
|
|
66
|
-
export * from './types/
|
|
67
|
-
export * from './types/
|
|
68
|
-
export * from './types/
|
|
69
|
-
export * from './types/
|
|
70
|
-
export * from './types/
|
|
71
|
-
export * from './types/
|
|
72
|
-
export * from './types/
|
|
73
|
-
export * from './types/
|
|
74
|
-
export * from './
|
|
75
|
-
export * from './
|
|
76
|
-
export * from './
|
|
77
|
-
export * from './Components/APICall/
|
|
78
|
-
export * from './Components/APICall/
|
|
79
|
-
export * from './Components/APICall/
|
|
80
|
-
export * from './Components/APICall/
|
|
81
|
-
export * from './Components/APICall/
|
|
82
|
-
export * from './Components/APICall/
|
|
83
|
-
export * from './Components/
|
|
84
|
-
export * from './
|
|
85
|
-
export * from './
|
|
86
|
-
export * from './
|
|
87
|
-
export * from './subsystems/AgentManager/
|
|
88
|
-
export * from './subsystems/AgentManager/
|
|
89
|
-
export * from './subsystems/AgentManager/
|
|
90
|
-
export * from './subsystems/AgentManager/
|
|
91
|
-
export * from './subsystems/AgentManager/
|
|
92
|
-
export * from './subsystems/AgentManager/
|
|
93
|
-
export * from './subsystems/AgentManager/
|
|
94
|
-
export * from './subsystems/
|
|
95
|
-
export * from './subsystems/
|
|
96
|
-
export * from './subsystems/
|
|
97
|
-
export * from './subsystems/LLMManager/models';
|
|
98
|
-
export * from './subsystems/LLMManager/
|
|
99
|
-
export * from './subsystems/
|
|
100
|
-
export * from './subsystems/
|
|
101
|
-
export * from './subsystems/
|
|
102
|
-
export * from './subsystems/
|
|
103
|
-
export * from './subsystems/
|
|
104
|
-
export * from './subsystems/
|
|
105
|
-
export * from './subsystems/
|
|
106
|
-
export * from './subsystems/
|
|
107
|
-
export * from './subsystems/AgentManager/
|
|
108
|
-
export * from './subsystems/
|
|
109
|
-
export * from './subsystems/
|
|
110
|
-
export * from './subsystems/
|
|
111
|
-
export * from './subsystems/
|
|
112
|
-
export * from './subsystems/
|
|
113
|
-
export * from './subsystems/IO/
|
|
114
|
-
export * from './subsystems/IO/
|
|
115
|
-
export * from './subsystems/IO/
|
|
116
|
-
export * from './subsystems/IO/
|
|
117
|
-
export * from './subsystems/IO/
|
|
118
|
-
export * from './subsystems/IO/
|
|
119
|
-
export * from './subsystems/IO/
|
|
120
|
-
export * from './subsystems/IO/
|
|
121
|
-
export * from './subsystems/IO/
|
|
122
|
-
export * from './subsystems/IO/
|
|
123
|
-
export * from './subsystems/
|
|
124
|
-
export * from './subsystems/
|
|
125
|
-
export * from './subsystems/
|
|
126
|
-
export * from './subsystems/LLMManager/
|
|
127
|
-
export * from './subsystems/LLMManager/
|
|
128
|
-
export * from './subsystems/
|
|
129
|
-
export * from './subsystems/
|
|
130
|
-
export * from './subsystems/
|
|
131
|
-
export * from './subsystems/
|
|
132
|
-
export * from './subsystems/
|
|
133
|
-
export * from './subsystems/Security/
|
|
134
|
-
export * from './subsystems/Security/
|
|
135
|
-
export * from './subsystems/Security/
|
|
136
|
-
export * from './subsystems/Security/
|
|
137
|
-
export * from './subsystems/Security/
|
|
138
|
-
export * from './subsystems/Security/
|
|
139
|
-
export * from './subsystems/Security/
|
|
140
|
-
export * from './subsystems/
|
|
141
|
-
export * from './subsystems/
|
|
142
|
-
export * from './subsystems/
|
|
143
|
-
export * from './subsystems/AgentManager/
|
|
144
|
-
export * from './subsystems/
|
|
145
|
-
export * from './subsystems/
|
|
146
|
-
export * from './subsystems/
|
|
147
|
-
export * from './subsystems/
|
|
148
|
-
export * from './subsystems/IO/
|
|
149
|
-
export * from './subsystems/IO/
|
|
150
|
-
export * from './subsystems/IO/
|
|
151
|
-
export * from './subsystems/IO/
|
|
152
|
-
export * from './subsystems/IO/
|
|
153
|
-
export * from './subsystems/IO/
|
|
154
|
-
export * from './subsystems/IO/
|
|
155
|
-
export * from './subsystems/IO/
|
|
156
|
-
export * from './subsystems/IO/VectorDB.service/
|
|
157
|
-
export * from './subsystems/IO/VectorDB.service/
|
|
158
|
-
export * from './subsystems/
|
|
159
|
-
export * from './subsystems/
|
|
160
|
-
export * from './subsystems/
|
|
161
|
-
export * from './subsystems/
|
|
162
|
-
export * from './subsystems/LLMManager/LLM.service/connectors/
|
|
163
|
-
export * from './subsystems/LLMManager/LLM.service/connectors/
|
|
164
|
-
export * from './subsystems/LLMManager/LLM.service/connectors/
|
|
165
|
-
export * from './subsystems/LLMManager/LLM.service/connectors/
|
|
166
|
-
export * from './subsystems/LLMManager/
|
|
167
|
-
export * from './subsystems/
|
|
168
|
-
export * from './subsystems/
|
|
169
|
-
export * from './subsystems/
|
|
170
|
-
export * from './subsystems/
|
|
171
|
-
export * from './subsystems/
|
|
172
|
-
export * from './subsystems/
|
|
173
|
-
export * from './subsystems/
|
|
174
|
-
export * from './subsystems/
|
|
175
|
-
export * from './subsystems/Security/
|
|
176
|
-
export * from './subsystems/Security/
|
|
177
|
-
export * from './subsystems/Security/
|
|
178
|
-
export * from './subsystems/Security/
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export * from './config';
|
|
9
|
+
export * from './constants';
|
|
10
|
+
export * from './Components/AgentPlugin.class';
|
|
11
|
+
export * from './Components/APIEndpoint.class';
|
|
12
|
+
export * from './Components/APIOutput.class';
|
|
13
|
+
export * from './Components/Async.class';
|
|
14
|
+
export * from './Components/Await.class';
|
|
15
|
+
export * from './Components/Classifier.class';
|
|
16
|
+
export * from './Components/Component.class';
|
|
17
|
+
export * from './Components/ComponentHost.class';
|
|
18
|
+
export * from './Components/DataSourceCleaner.class';
|
|
19
|
+
export * from './Components/DataSourceIndexer.class';
|
|
20
|
+
export * from './Components/DataSourceLookup.class';
|
|
21
|
+
export * from './Components/FEncDec.class';
|
|
22
|
+
export * from './Components/FHash.class';
|
|
23
|
+
export * from './Components/FileStore.class';
|
|
24
|
+
export * from './Components/ForEach.class';
|
|
25
|
+
export * from './Components/FSign.class';
|
|
26
|
+
export * from './Components/FSleep.class';
|
|
27
|
+
export * from './Components/FTimestamp.class';
|
|
28
|
+
export * from './Components/GenAILLM.class';
|
|
29
|
+
export * from './Components/GPTPlugin.class';
|
|
30
|
+
export * from './Components/HuggingFace.class';
|
|
31
|
+
export * from './Components/ImageGenerator.class';
|
|
32
|
+
export * from './Components/index';
|
|
33
|
+
export * from './Components/JSONFilter.class';
|
|
34
|
+
export * from './Components/LLMAssistant.class';
|
|
35
|
+
export * from './Components/LogicAND.class';
|
|
36
|
+
export * from './Components/LogicAtLeast.class';
|
|
37
|
+
export * from './Components/LogicAtMost.class';
|
|
38
|
+
export * from './Components/LogicOR.class';
|
|
39
|
+
export * from './Components/LogicXOR.class';
|
|
40
|
+
export * from './Components/MCPClient.class';
|
|
41
|
+
export * from './Components/PromptGenerator.class';
|
|
42
|
+
export * from './Components/ScrapflyWebScrape.class';
|
|
43
|
+
export * from './Components/TavilyWebSearch.class';
|
|
44
|
+
export * from './Core/AgentProcess.helper';
|
|
45
|
+
export * from './Core/boot';
|
|
46
|
+
export * from './Core/Connector.class';
|
|
47
|
+
export * from './Core/ConnectorsService';
|
|
48
|
+
export * from './Core/DummyConnector';
|
|
49
|
+
export * from './Core/HookService';
|
|
50
|
+
export * from './Core/SmythRuntime.class';
|
|
51
|
+
export * from './Core/SystemEvents';
|
|
52
|
+
export * from './helpers/BinaryInput.helper';
|
|
53
|
+
export * from './helpers/Conversation.helper';
|
|
54
|
+
export * from './helpers/JsonContent.helper';
|
|
55
|
+
export * from './helpers/LocalCache.helper';
|
|
56
|
+
export * from './helpers/Log.helper';
|
|
57
|
+
export * from './helpers/OpenApiParser.helper';
|
|
58
|
+
export * from './helpers/S3Cache.helper';
|
|
59
|
+
export * from './helpers/SmythURI.helper';
|
|
60
|
+
export * from './helpers/Sysconfig.helper';
|
|
61
|
+
export * from './helpers/TemplateString.helper';
|
|
62
|
+
export * from './helpers/TypeChecker.helper';
|
|
63
|
+
export * from './types/ACL.types';
|
|
64
|
+
export * from './types/Agent.types';
|
|
65
|
+
export * from './types/AgentLogger.types';
|
|
66
|
+
export * from './types/AWS.types';
|
|
67
|
+
export * from './types/Cache.types';
|
|
68
|
+
export * from './types/Common.types';
|
|
69
|
+
export * from './types/LLM.types';
|
|
70
|
+
export * from './types/Redis.types';
|
|
71
|
+
export * from './types/Security.types';
|
|
72
|
+
export * from './types/SRE.types';
|
|
73
|
+
export * from './types/Storage.types';
|
|
74
|
+
export * from './types/VectorDB.types';
|
|
75
|
+
export * from './Components/APICall/AccessTokenManager';
|
|
76
|
+
export * from './Components/APICall/APICall.class';
|
|
77
|
+
export * from './Components/APICall/ArrayBufferResponse.helper';
|
|
78
|
+
export * from './Components/APICall/mimeTypeCategories';
|
|
79
|
+
export * from './Components/APICall/OAuth.helper';
|
|
80
|
+
export * from './Components/APICall/parseData';
|
|
81
|
+
export * from './Components/APICall/parseHeaders';
|
|
82
|
+
export * from './Components/APICall/parseProxy';
|
|
83
|
+
export * from './Components/APICall/parseUrl';
|
|
84
|
+
export * from './Components/Image/imageSettings.config';
|
|
85
|
+
export * from './subsystems/AgentManager/Agent.class';
|
|
86
|
+
export * from './subsystems/AgentManager/Agent.helper';
|
|
87
|
+
export * from './subsystems/AgentManager/AgentLogger.class';
|
|
88
|
+
export * from './subsystems/AgentManager/AgentRequest.class';
|
|
89
|
+
export * from './subsystems/AgentManager/AgentRuntime.class';
|
|
90
|
+
export * from './subsystems/AgentManager/AgentSettings.class';
|
|
91
|
+
export * from './subsystems/AgentManager/AgentSSE.class';
|
|
92
|
+
export * from './subsystems/AgentManager/EmbodimentSettings.class';
|
|
93
|
+
export * from './subsystems/AgentManager/ForkedAgent.class';
|
|
94
|
+
export * from './subsystems/AgentManager/OSResourceMonitor';
|
|
95
|
+
export * from './subsystems/LLMManager/custom-models';
|
|
96
|
+
export * from './subsystems/LLMManager/LLM.helper';
|
|
97
|
+
export * from './subsystems/LLMManager/LLM.inference';
|
|
98
|
+
export * from './subsystems/LLMManager/models';
|
|
99
|
+
export * from './subsystems/LLMManager/paramMappings';
|
|
100
|
+
export * from './subsystems/MemoryManager/LLMCache';
|
|
101
|
+
export * from './subsystems/MemoryManager/LLMContext';
|
|
102
|
+
export * from './subsystems/MemoryManager/RuntimeContext';
|
|
103
|
+
export * from './subsystems/Security/Credentials.helper';
|
|
104
|
+
export * from './subsystems/Security/SecureConnector.class';
|
|
105
|
+
export * from './subsystems/AgentManager/AgentData.service/AgentDataConnector';
|
|
106
|
+
export * from './subsystems/AgentManager/AgentData.service/index';
|
|
107
|
+
export * from './subsystems/AgentManager/Component.service/ComponentConnector';
|
|
108
|
+
export * from './subsystems/AgentManager/Component.service/index';
|
|
109
|
+
export * from './subsystems/ComputeManager/Code.service/CodeConnector';
|
|
110
|
+
export * from './subsystems/ComputeManager/Code.service/index';
|
|
111
|
+
export * from './subsystems/IO/CLI.service/CLIConnector';
|
|
112
|
+
export * from './subsystems/IO/CLI.service/index';
|
|
113
|
+
export * from './subsystems/IO/Log.service/index';
|
|
114
|
+
export * from './subsystems/IO/Log.service/LogConnector';
|
|
115
|
+
export * from './subsystems/IO/NKV.service/index';
|
|
116
|
+
export * from './subsystems/IO/NKV.service/NKVConnector';
|
|
117
|
+
export * from './subsystems/IO/Router.service/index';
|
|
118
|
+
export * from './subsystems/IO/Router.service/RouterConnector';
|
|
119
|
+
export * from './subsystems/IO/Storage.service/index';
|
|
120
|
+
export * from './subsystems/IO/Storage.service/SmythFS.class';
|
|
121
|
+
export * from './subsystems/IO/Storage.service/StorageConnector';
|
|
122
|
+
export * from './subsystems/IO/VectorDB.service/index';
|
|
123
|
+
export * from './subsystems/IO/VectorDB.service/VectorDBConnector';
|
|
124
|
+
export * from './subsystems/LLMManager/LLM.service/index';
|
|
125
|
+
export * from './subsystems/LLMManager/LLM.service/LLMConnector';
|
|
126
|
+
export * from './subsystems/LLMManager/LLM.service/LLMCredentials.helper';
|
|
127
|
+
export * from './subsystems/LLMManager/ModelsProvider.service/index';
|
|
128
|
+
export * from './subsystems/LLMManager/ModelsProvider.service/ModelsProviderConnector';
|
|
129
|
+
export * from './subsystems/MemoryManager/Cache.service/CacheConnector';
|
|
130
|
+
export * from './subsystems/MemoryManager/Cache.service/index';
|
|
131
|
+
export * from './subsystems/Security/AccessControl/AccessCandidate.class';
|
|
132
|
+
export * from './subsystems/Security/AccessControl/AccessRequest.class';
|
|
133
|
+
export * from './subsystems/Security/AccessControl/ACL.class';
|
|
134
|
+
export * from './subsystems/Security/Account.service/AccountConnector';
|
|
135
|
+
export * from './subsystems/Security/Account.service/index';
|
|
136
|
+
export * from './subsystems/Security/ManagedVault.service/index';
|
|
137
|
+
export * from './subsystems/Security/ManagedVault.service/ManagedVaultConnector';
|
|
138
|
+
export * from './subsystems/Security/Vault.service/index';
|
|
139
|
+
export * from './subsystems/Security/Vault.service/Vault.helper';
|
|
140
|
+
export * from './subsystems/Security/Vault.service/VaultConnector';
|
|
141
|
+
export * from './subsystems/AgentManager/AgentData.service/connectors/CLIAgentDataConnector.class';
|
|
142
|
+
export * from './subsystems/AgentManager/AgentData.service/connectors/LocalAgentDataConnector.class';
|
|
143
|
+
export * from './subsystems/AgentManager/AgentData.service/connectors/NullAgentData.class';
|
|
144
|
+
export * from './subsystems/AgentManager/Component.service/connectors/LocalComponentConnector.class';
|
|
145
|
+
export * from './subsystems/ComputeManager/Code.service/connectors/AWSLambdaCode.class';
|
|
146
|
+
export * from './subsystems/IO/Log.service/connectors/ConsoleLog.class';
|
|
147
|
+
export * from './subsystems/IO/NKV.service/connectors/NKVLocalStorage.class';
|
|
148
|
+
export * from './subsystems/IO/NKV.service/connectors/NKVRAM.class';
|
|
149
|
+
export * from './subsystems/IO/NKV.service/connectors/NKVRedis.class';
|
|
150
|
+
export * from './subsystems/IO/Router.service/connectors/ExpressRouter.class';
|
|
151
|
+
export * from './subsystems/IO/Router.service/connectors/NullRouter.class';
|
|
152
|
+
export * from './subsystems/IO/Storage.service/connectors/LocalStorage.class';
|
|
153
|
+
export * from './subsystems/IO/Storage.service/connectors/S3Storage.class';
|
|
154
|
+
export * from './subsystems/IO/VectorDB.service/connectors/MilvusVectorDB.class';
|
|
155
|
+
export * from './subsystems/IO/VectorDB.service/connectors/PineconeVectorDB.class';
|
|
156
|
+
export * from './subsystems/IO/VectorDB.service/connectors/RAMVecrtorDB.class';
|
|
157
|
+
export * from './subsystems/IO/VectorDB.service/embed/BaseEmbedding';
|
|
158
|
+
export * from './subsystems/IO/VectorDB.service/embed/index';
|
|
159
|
+
export * from './subsystems/IO/VectorDB.service/embed/OpenAIEmbedding';
|
|
160
|
+
export * from './subsystems/LLMManager/LLM.service/connectors/Anthropic.class';
|
|
161
|
+
export * from './subsystems/LLMManager/LLM.service/connectors/Bedrock.class';
|
|
162
|
+
export * from './subsystems/LLMManager/LLM.service/connectors/Echo.class';
|
|
163
|
+
export * from './subsystems/LLMManager/LLM.service/connectors/GoogleAI.class';
|
|
164
|
+
export * from './subsystems/LLMManager/LLM.service/connectors/Groq.class';
|
|
165
|
+
export * from './subsystems/LLMManager/LLM.service/connectors/OpenAI.class';
|
|
166
|
+
export * from './subsystems/LLMManager/LLM.service/connectors/Perplexity.class';
|
|
167
|
+
export * from './subsystems/LLMManager/LLM.service/connectors/VertexAI.class';
|
|
168
|
+
export * from './subsystems/LLMManager/ModelsProvider.service/connectors/SmythModelsProvider.class';
|
|
169
|
+
export * from './subsystems/MemoryManager/Cache.service/connectors/LocalStorageCache.class';
|
|
170
|
+
export * from './subsystems/MemoryManager/Cache.service/connectors/RAMCache.class';
|
|
171
|
+
export * from './subsystems/MemoryManager/Cache.service/connectors/RedisCache.class';
|
|
172
|
+
export * from './subsystems/MemoryManager/Cache.service/connectors/S3Cache.class';
|
|
173
|
+
export * from './subsystems/Security/Account.service/connectors/AWSAccount.class';
|
|
174
|
+
export * from './subsystems/Security/Account.service/connectors/DummyAccount.class';
|
|
175
|
+
export * from './subsystems/Security/Account.service/connectors/JSONFileAccount.class';
|
|
176
|
+
export * from './subsystems/Security/ManagedVault.service/connectors/NullManagedVault.class';
|
|
177
|
+
export * from './subsystems/Security/ManagedVault.service/connectors/SecretManagerManagedVault';
|
|
178
|
+
export * from './subsystems/Security/Vault.service/connectors/HashicorpVault.class';
|
|
179
|
+
export * from './subsystems/Security/Vault.service/connectors/JSONFileVault.class';
|
|
180
|
+
export * from './subsystems/Security/Vault.service/connectors/NullVault.class';
|
|
179
181
|
export * from './subsystems/Security/Vault.service/connectors/SecretsManager.class';
|
|
@@ -137,7 +137,7 @@ class LogTransaction {
|
|
|
137
137
|
|
|
138
138
|
private async storeLogData(filePath: string, content: any) {
|
|
139
139
|
const logConnector = ConnectorService.getLogConnector();
|
|
140
|
-
if (!logConnector.valid) return;
|
|
140
|
+
if (!logConnector.valid || logConnector.name == 'ConsoleLog') return;
|
|
141
141
|
|
|
142
142
|
if (!filePath) return;
|
|
143
143
|
try {
|
|
@@ -8,6 +8,7 @@ import { AgentCallLog } from '@sre/types/AgentLogger.types';
|
|
|
8
8
|
const console = Logger('SmythLog');
|
|
9
9
|
|
|
10
10
|
export class ConsoleLog extends LogConnector {
|
|
11
|
+
public name: string = 'ConsoleLog';
|
|
11
12
|
public id: string;
|
|
12
13
|
public getResourceACL(resourceId: string, candidate: IAccessCandidate): Promise<ACL> {
|
|
13
14
|
return Promise.resolve(new ACL());
|
|
@@ -24,5 +25,4 @@ export class ConsoleLog extends LogConnector {
|
|
|
24
25
|
|
|
25
26
|
return Promise.resolve();
|
|
26
27
|
}
|
|
27
|
-
public name: string;
|
|
28
28
|
}
|
|
@@ -16,6 +16,8 @@ export interface INKVRequest {
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* NKV = Namespace-Key-Value Connector
|
|
19
|
+
* The NKV Connectors are used to store and retrieve data in a namespace-key-value format.
|
|
20
|
+
* It is generally used by internal connectors to index data : for example, some vectorDB providers may use it to keep track of inserted vectors.
|
|
19
21
|
*/
|
|
20
22
|
export abstract class NKVConnector extends SecureConnector {
|
|
21
23
|
public requester(candidate: AccessCandidate): INKVRequest {
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { AccessRequest } from '@sre/Security/AccessControl/AccessRequest.class';
|
|
2
|
+
import { NKVConnector } from '../NKVConnector';
|
|
3
|
+
import { ACLAccessDeniedError, IAccessCandidate, TAccessResult } from '@sre/types/ACL.types';
|
|
4
|
+
import { ACL } from '@sre/Security/AccessControl/ACL.class';
|
|
5
|
+
import { CacheConnector } from '@sre/MemoryManager/Cache.service/CacheConnector';
|
|
6
|
+
import { ConnectorService } from '@sre/Core/ConnectorsService';
|
|
7
|
+
import { StorageData } from '@sre/types/Storage.types';
|
|
8
|
+
import { AccountConnector } from '@sre/Security/Account.service/AccountConnector';
|
|
9
|
+
import Joi from 'joi';
|
|
10
|
+
import fs from 'fs';
|
|
11
|
+
import path from 'path';
|
|
12
|
+
import { findSmythPath } from '../../../../';
|
|
13
|
+
import { Logger } from '@sre/helpers/Log.helper';
|
|
14
|
+
|
|
15
|
+
const console = Logger('NKVLocalStorage');
|
|
16
|
+
|
|
17
|
+
export type NKVLocalStorageConfig = {
|
|
18
|
+
folder?: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export class NKVLocalStorage extends NKVConnector {
|
|
22
|
+
public name = 'NKVLocalStorage';
|
|
23
|
+
private folder: string;
|
|
24
|
+
private accountConnector: AccountConnector;
|
|
25
|
+
private cacheConnector: CacheConnector;
|
|
26
|
+
private isInitialized = false;
|
|
27
|
+
|
|
28
|
+
constructor(protected _settings?: NKVLocalStorageConfig) {
|
|
29
|
+
super(_settings);
|
|
30
|
+
this.accountConnector = ConnectorService.getAccountConnector();
|
|
31
|
+
this.cacheConnector = ConnectorService.getCacheConnector('RAM');
|
|
32
|
+
this.folder = this.findStorageFolder(_settings?.folder);
|
|
33
|
+
this.initialize();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private findStorageFolder(folder?: string): string {
|
|
37
|
+
let _storageFolder = folder;
|
|
38
|
+
|
|
39
|
+
if (_storageFolder && fs.existsSync(_storageFolder)) {
|
|
40
|
+
return _storageFolder;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
_storageFolder = findSmythPath('nkv');
|
|
44
|
+
|
|
45
|
+
if (fs.existsSync(_storageFolder)) {
|
|
46
|
+
console.warn('Using alternative storage folder found in : ', _storageFolder);
|
|
47
|
+
return _storageFolder;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
console.warn('!!! All attempts to find an existing storage folder failed !!!');
|
|
51
|
+
console.warn('!!! I will use this folder: ', _storageFolder);
|
|
52
|
+
return _storageFolder;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
private initialize() {
|
|
56
|
+
if (!this.isInitialized) {
|
|
57
|
+
if (!fs.existsSync(this.folder)) {
|
|
58
|
+
fs.mkdirSync(this.folder, { recursive: true });
|
|
59
|
+
}
|
|
60
|
+
this.isInitialized = true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private getStoragePath(teamId: string, namespace: string, key?: string): string {
|
|
65
|
+
const parts = [`team_${teamId}`, namespace];
|
|
66
|
+
if (key) {
|
|
67
|
+
parts.push(key);
|
|
68
|
+
}
|
|
69
|
+
return path.join(this.folder, ...parts);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public key(...parts: string[]) {
|
|
73
|
+
return parts.join(':');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@NKVLocalStorage.Validate
|
|
77
|
+
@NKVLocalStorage.NamespaceAccessControl
|
|
78
|
+
protected async get(acRequest: AccessRequest, namespace: string, key: string): Promise<StorageData> {
|
|
79
|
+
const teamId = await this.accountConnector.getCandidateTeam(acRequest.candidate);
|
|
80
|
+
const filePath = this.getStoragePath(teamId, namespace, key);
|
|
81
|
+
if (!fs.existsSync(filePath)) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
const data = fs.readFileSync(filePath, 'utf-8');
|
|
86
|
+
return JSON.parse(data);
|
|
87
|
+
} catch (error) {
|
|
88
|
+
console.error(`Error reading from NKVLocalStorage: ${error.message}`);
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@NKVLocalStorage.Validate
|
|
94
|
+
@NKVLocalStorage.NamespaceAccessControl
|
|
95
|
+
protected async set(acRequest: AccessRequest, namespace: string, key: string, value: any): Promise<void> {
|
|
96
|
+
const teamId = await this.accountConnector.getCandidateTeam(acRequest.candidate);
|
|
97
|
+
const filePath = this.getStoragePath(teamId, namespace, key);
|
|
98
|
+
const dirPath = path.dirname(filePath);
|
|
99
|
+
|
|
100
|
+
if (!fs.existsSync(dirPath)) {
|
|
101
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
fs.writeFileSync(filePath, JSON.stringify(value));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@NKVLocalStorage.Validate
|
|
108
|
+
@NKVLocalStorage.NamespaceAccessControl
|
|
109
|
+
protected async delete(acRequest: AccessRequest, namespace: string, key: string): Promise<void> {
|
|
110
|
+
const teamId = await this.accountConnector.getCandidateTeam(acRequest.candidate);
|
|
111
|
+
const filePath = this.getStoragePath(teamId, namespace, key);
|
|
112
|
+
if (fs.existsSync(filePath)) {
|
|
113
|
+
fs.unlinkSync(filePath);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@NKVLocalStorage.Validate
|
|
118
|
+
@NKVLocalStorage.NamespaceAccessControl
|
|
119
|
+
protected async exists(acRequest: AccessRequest, namespace: string, key: string): Promise<boolean> {
|
|
120
|
+
const teamId = await this.accountConnector.getCandidateTeam(acRequest.candidate);
|
|
121
|
+
const filePath = this.getStoragePath(teamId, namespace, key);
|
|
122
|
+
return fs.existsSync(filePath);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@NKVLocalStorage.NamespaceAccessControl
|
|
126
|
+
public async list(acRequest: AccessRequest, namespace: string): Promise<{ key: string; data: StorageData }[]> {
|
|
127
|
+
const teamId = await this.accountConnector.getCandidateTeam(acRequest.candidate);
|
|
128
|
+
const namespacePath = this.getStoragePath(teamId, namespace);
|
|
129
|
+
const results: { key: string; data: StorageData }[] = [];
|
|
130
|
+
|
|
131
|
+
if (!fs.existsSync(namespacePath)) {
|
|
132
|
+
return results;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const files = fs.readdirSync(namespacePath);
|
|
136
|
+
for (const file of files) {
|
|
137
|
+
const filePath = path.join(namespacePath, file);
|
|
138
|
+
const stat = fs.statSync(filePath);
|
|
139
|
+
if (stat.isFile()) {
|
|
140
|
+
const data = fs.readFileSync(filePath, 'utf-8');
|
|
141
|
+
results.push({
|
|
142
|
+
key: file,
|
|
143
|
+
data: JSON.parse(data) as StorageData,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return results;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@NKVLocalStorage.NamespaceAccessControl
|
|
151
|
+
public async deleteAll(acRequest: AccessRequest, namespace: string): Promise<void> {
|
|
152
|
+
const teamId = await this.accountConnector.getCandidateTeam(acRequest.candidate);
|
|
153
|
+
const namespacePath = this.getStoragePath(teamId, namespace);
|
|
154
|
+
if (fs.existsSync(namespacePath)) {
|
|
155
|
+
fs.rmSync(namespacePath, { recursive: true, force: true });
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
public async getResourceACL(resourceId: string, candidate: IAccessCandidate): Promise<ACL> {
|
|
160
|
+
return this.cacheConnector.getResourceACL(resourceId, candidate);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
public clearAll(): void {
|
|
164
|
+
if (fs.existsSync(this.folder)) {
|
|
165
|
+
fs.rmSync(this.folder, { recursive: true, force: true });
|
|
166
|
+
this.initialize();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
static NamespaceAccessControl(target: any, propertyKey: string, descriptor: PropertyDescriptor) {
|
|
171
|
+
const originalMethod = descriptor.value;
|
|
172
|
+
|
|
173
|
+
descriptor.value = async function (...args: any[]) {
|
|
174
|
+
let [acRequest, namespace, key] = args;
|
|
175
|
+
const isNamespaceSearch = key === undefined;
|
|
176
|
+
|
|
177
|
+
const teamId = await this.accountConnector.getCandidateTeam(acRequest.candidate);
|
|
178
|
+
const resourceId = isNamespaceSearch ? namespace : `${namespace}:${key}`;
|
|
179
|
+
const finalKey = this.key(`team_${teamId}`, resourceId);
|
|
180
|
+
const accessTicket = await this.getAccessTicket(finalKey, acRequest);
|
|
181
|
+
|
|
182
|
+
if (accessTicket.access !== TAccessResult.Granted) throw new ACLAccessDeniedError('Access Denied');
|
|
183
|
+
|
|
184
|
+
return originalMethod.apply(this, args);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
return descriptor;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
static Validate(target: any, propertyKey: string, descriptor: PropertyDescriptor) {
|
|
191
|
+
const originalMethod = descriptor.value;
|
|
192
|
+
|
|
193
|
+
descriptor.value = async function (...args: any[]) {
|
|
194
|
+
let [acRequest, namespace, key] = args;
|
|
195
|
+
|
|
196
|
+
const schemaValidator = Joi.object().keys({
|
|
197
|
+
namespace: Joi.string().min(1).required(),
|
|
198
|
+
key: Joi.string().min(1).required(),
|
|
199
|
+
});
|
|
200
|
+
const validationResult = schemaValidator.validate({ namespace, key });
|
|
201
|
+
|
|
202
|
+
if (validationResult.error) {
|
|
203
|
+
throw new Error(`Validation Error: ${validationResult.error.message}`);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return originalMethod.apply(this, args);
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
return descriptor;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
@@ -11,7 +11,7 @@ import { AccountConnector } from '@sre/Security/Account.service/AccountConnector
|
|
|
11
11
|
import Joi from 'joi';
|
|
12
12
|
|
|
13
13
|
export class NKVRAM extends NKVConnector {
|
|
14
|
-
public name = '
|
|
14
|
+
public name = 'NKVRAM';
|
|
15
15
|
private storage: Map<string, any> = new Map();
|
|
16
16
|
private namespaces: Set<string> = new Set();
|
|
17
17
|
private accountConnector: AccountConnector;
|