@aj-archipelago/cortex 1.4.1 → 1.4.3
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/README.md +1 -0
- package/config.js +1 -1
- package/helper-apps/cortex-autogen2/.dockerignore +1 -0
- package/helper-apps/cortex-autogen2/Dockerfile +6 -10
- package/helper-apps/cortex-autogen2/Dockerfile.worker +2 -0
- package/helper-apps/cortex-autogen2/agents.py +203 -2
- package/helper-apps/cortex-autogen2/main.py +1 -1
- package/helper-apps/cortex-autogen2/pyproject.toml +12 -0
- package/helper-apps/cortex-autogen2/requirements.txt +14 -0
- package/helper-apps/cortex-autogen2/services/redis_publisher.py +1 -1
- package/helper-apps/cortex-autogen2/services/run_analyzer.py +1 -1
- package/helper-apps/cortex-autogen2/task_processor.py +431 -229
- package/helper-apps/cortex-autogen2/test_entity_fetcher.py +305 -0
- package/helper-apps/cortex-autogen2/tests/README.md +240 -0
- package/helper-apps/cortex-autogen2/tests/TEST_REPORT.md +342 -0
- package/helper-apps/cortex-autogen2/tests/__init__.py +8 -0
- package/helper-apps/cortex-autogen2/tests/analysis/__init__.py +1 -0
- package/helper-apps/cortex-autogen2/tests/analysis/improvement_suggester.py +224 -0
- package/helper-apps/cortex-autogen2/tests/analysis/trend_analyzer.py +211 -0
- package/helper-apps/cortex-autogen2/tests/cli/__init__.py +1 -0
- package/helper-apps/cortex-autogen2/tests/cli/run_tests.py +296 -0
- package/helper-apps/cortex-autogen2/tests/collectors/__init__.py +1 -0
- package/helper-apps/cortex-autogen2/tests/collectors/log_collector.py +252 -0
- package/helper-apps/cortex-autogen2/tests/collectors/progress_collector.py +182 -0
- package/helper-apps/cortex-autogen2/tests/conftest.py +15 -0
- package/helper-apps/cortex-autogen2/tests/database/__init__.py +1 -0
- package/helper-apps/cortex-autogen2/tests/database/repository.py +501 -0
- package/helper-apps/cortex-autogen2/tests/database/schema.sql +108 -0
- package/helper-apps/cortex-autogen2/tests/evaluators/__init__.py +1 -0
- package/helper-apps/cortex-autogen2/tests/evaluators/llm_scorer.py +294 -0
- package/helper-apps/cortex-autogen2/tests/evaluators/prompts.py +250 -0
- package/helper-apps/cortex-autogen2/tests/evaluators/wordcloud_validator.py +168 -0
- package/helper-apps/cortex-autogen2/tests/metrics/__init__.py +1 -0
- package/helper-apps/cortex-autogen2/tests/metrics/collector.py +155 -0
- package/helper-apps/cortex-autogen2/tests/orchestrator.py +576 -0
- package/helper-apps/cortex-autogen2/tests/test_cases.yaml +279 -0
- package/helper-apps/cortex-autogen2/tests/test_data.db +0 -0
- package/helper-apps/cortex-autogen2/tests/utils/__init__.py +3 -0
- package/helper-apps/cortex-autogen2/tests/utils/connectivity.py +112 -0
- package/helper-apps/cortex-autogen2/tools/azure_blob_tools.py +74 -24
- package/helper-apps/cortex-autogen2/tools/entity_api_registry.json +38 -0
- package/helper-apps/cortex-autogen2/tools/file_tools.py +1 -1
- package/helper-apps/cortex-autogen2/tools/search_tools.py +436 -238
- package/helper-apps/cortex-file-handler/package-lock.json +2 -2
- package/helper-apps/cortex-file-handler/package.json +1 -1
- package/helper-apps/cortex-file-handler/scripts/setup-test-containers.js +4 -5
- package/helper-apps/cortex-file-handler/src/blobHandler.js +36 -144
- package/helper-apps/cortex-file-handler/src/services/FileConversionService.js +5 -3
- package/helper-apps/cortex-file-handler/src/services/storage/AzureStorageProvider.js +34 -1
- package/helper-apps/cortex-file-handler/src/services/storage/GCSStorageProvider.js +22 -0
- package/helper-apps/cortex-file-handler/src/services/storage/LocalStorageProvider.js +28 -1
- package/helper-apps/cortex-file-handler/src/services/storage/StorageFactory.js +29 -4
- package/helper-apps/cortex-file-handler/src/services/storage/StorageProvider.js +11 -0
- package/helper-apps/cortex-file-handler/src/services/storage/StorageService.js +1 -1
- package/helper-apps/cortex-file-handler/tests/blobHandler.test.js +3 -2
- package/helper-apps/cortex-file-handler/tests/checkHashShortLived.test.js +8 -1
- package/helper-apps/cortex-file-handler/tests/containerConversionFlow.test.js +5 -2
- package/helper-apps/cortex-file-handler/tests/containerNameParsing.test.js +14 -7
- package/helper-apps/cortex-file-handler/tests/containerParameterFlow.test.js +5 -2
- package/helper-apps/cortex-file-handler/tests/storage/StorageFactory.test.js +31 -19
- package/lib/crypto.js +1 -65
- package/lib/keyValueStorageClient.js +53 -1
- package/package.json +1 -1
- package/pathways/system/entity/memory/sys_read_memory.js +1 -1
- package/pathways/system/entity/memory/sys_save_memory.js +1 -1
- package/pathways/system/entity/memory/sys_search_memory.js +1 -1
- package/server/modelExecutor.js +4 -0
- package/server/pathwayResolver.js +1 -1
- package/server/plugins/claude4VertexPlugin.js +540 -0
- package/server/plugins/openAiWhisperPlugin.js +43 -2
- package/testrun.log +35371 -0
- package/tests/integration/graphql/async/stream/vendors/openai_streaming.test.js +1 -3
- package/tests/integration/rest/vendors/claude_streaming.test.js +121 -0
- package/tests/unit/core/crypto.test.js +4 -102
- package/tests/unit/core/doubleEncryptionStorageClient.test.js +262 -0
- package/tests/unit/plugins/claude4VertexPlugin.test.js +462 -0
- package/tests/unit/plugins/claude4VertexToolConversion.test.js +413 -0
- package/helper-apps/cortex-autogen/.funcignore +0 -8
- package/helper-apps/cortex-autogen/Dockerfile +0 -10
- package/helper-apps/cortex-autogen/OAI_CONFIG_LIST +0 -6
- package/helper-apps/cortex-autogen/agents.py +0 -493
- package/helper-apps/cortex-autogen/agents_extra.py +0 -14
- package/helper-apps/cortex-autogen/config.py +0 -18
- package/helper-apps/cortex-autogen/data_operations.py +0 -29
- package/helper-apps/cortex-autogen/function_app.py +0 -44
- package/helper-apps/cortex-autogen/host.json +0 -15
- package/helper-apps/cortex-autogen/main.py +0 -38
- package/helper-apps/cortex-autogen/prompts.py +0 -196
- package/helper-apps/cortex-autogen/prompts_extra.py +0 -5
- package/helper-apps/cortex-autogen/requirements.txt +0 -9
- package/helper-apps/cortex-autogen/search.py +0 -85
- package/helper-apps/cortex-autogen/test.sh +0 -40
- package/helper-apps/cortex-autogen/tools/sasfileuploader.py +0 -66
- package/helper-apps/cortex-autogen/utils.py +0 -88
- package/helper-apps/cortex-autogen2/DigiCertGlobalRootCA.crt.pem +0 -22
- package/helper-apps/cortex-autogen2/poetry.lock +0 -3652
- package/lib/doubleEncryptionStorageClient.js +0 -97
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import Keyv from 'keyv';
|
|
2
|
-
import { config } from '../config.js';
|
|
3
|
-
import { encrypt, decrypt, doubleEncrypt, doubleDecrypt } from './crypto.js';
|
|
4
|
-
import logger from './logger.js';
|
|
5
|
-
|
|
6
|
-
const storageConnectionString = config.get('storageConnectionString');
|
|
7
|
-
const cortexId = config.get('cortexId');
|
|
8
|
-
const redisEncryptionKey = config.get('redisEncryptionKey');
|
|
9
|
-
|
|
10
|
-
// Create a keyv client to store data with double encryption support
|
|
11
|
-
const doubleEncryptionStorageClient = new Keyv(storageConnectionString, {
|
|
12
|
-
ssl: true,
|
|
13
|
-
abortConnect: false,
|
|
14
|
-
serialize: (data) => JSON.stringify(data),
|
|
15
|
-
deserialize: (data) => {
|
|
16
|
-
try {
|
|
17
|
-
return JSON.parse(data);
|
|
18
|
-
} catch (error) {
|
|
19
|
-
logger.error(`Failed to parse stored data: ${error}`);
|
|
20
|
-
return {};
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
namespace: `${cortexId}-cortex-context`
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// Handle Redis connection errors to prevent crashes
|
|
27
|
-
doubleEncryptionStorageClient.on('error', (error) => {
|
|
28
|
-
logger.error(`Keyv Redis connection error: ${error}`);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// Set values with double encryption support
|
|
32
|
-
async function setvWithDoubleEncryption(key, value, userContextKey) {
|
|
33
|
-
if (!doubleEncryptionStorageClient) return false;
|
|
34
|
-
|
|
35
|
-
// Validate that system key is present
|
|
36
|
-
if (!redisEncryptionKey) {
|
|
37
|
-
logger.error('System encryption key is required but not configured');
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
try {
|
|
42
|
-
// Always use doubleEncrypt which handles both scenarios:
|
|
43
|
-
// 1. systemKey only (when userContextKey is null/undefined)
|
|
44
|
-
// 2. userContextKey + systemKey (when userContextKey is provided)
|
|
45
|
-
const encryptedValue = doubleEncrypt(JSON.stringify(value), userContextKey, redisEncryptionKey);
|
|
46
|
-
|
|
47
|
-
if (!encryptedValue) {
|
|
48
|
-
logger.error('Encryption failed, cannot store data');
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return await doubleEncryptionStorageClient.set(key, encryptedValue);
|
|
53
|
-
} catch (error) {
|
|
54
|
-
logger.error(`Failed to store data with double encryption: ${error}`);
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Get values with double decryption support
|
|
60
|
-
async function getvWithDoubleDecryption(key, userContextKey) {
|
|
61
|
-
if (!doubleEncryptionStorageClient) return null;
|
|
62
|
-
|
|
63
|
-
// Validate that system key is present
|
|
64
|
-
if (!redisEncryptionKey) {
|
|
65
|
-
logger.error('System encryption key is required but not configured');
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
const encryptedData = await doubleEncryptionStorageClient.get(key);
|
|
71
|
-
if (!encryptedData) return null;
|
|
72
|
-
|
|
73
|
-
// Always use doubleDecrypt which handles both scenarios:
|
|
74
|
-
// 1. systemKey only (when userContextKey is null/undefined)
|
|
75
|
-
// 2. userContextKey + systemKey (when userContextKey is provided)
|
|
76
|
-
const decryptedData = doubleDecrypt(encryptedData, userContextKey, redisEncryptionKey);
|
|
77
|
-
if (decryptedData) {
|
|
78
|
-
return JSON.parse(decryptedData);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// If decryption fails, try to parse as plain JSON (for backward compatibility with unencrypted data)
|
|
82
|
-
try {
|
|
83
|
-
return JSON.parse(encryptedData);
|
|
84
|
-
} catch {
|
|
85
|
-
return encryptedData;
|
|
86
|
-
}
|
|
87
|
-
} catch (error) {
|
|
88
|
-
logger.error(`Failed to retrieve and decrypt data: ${error}`);
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export {
|
|
94
|
-
doubleEncryptionStorageClient,
|
|
95
|
-
setvWithDoubleEncryption,
|
|
96
|
-
getvWithDoubleDecryption
|
|
97
|
-
};
|