@aj-archipelago/cortex 1.4.2 → 1.4.4

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 (91) hide show
  1. package/README.md +1 -0
  2. package/config.js +1 -1
  3. package/helper-apps/cortex-autogen2/.dockerignore +1 -0
  4. package/helper-apps/cortex-autogen2/Dockerfile +6 -10
  5. package/helper-apps/cortex-autogen2/Dockerfile.worker +2 -0
  6. package/helper-apps/cortex-autogen2/agents.py +203 -2
  7. package/helper-apps/cortex-autogen2/main.py +1 -1
  8. package/helper-apps/cortex-autogen2/pyproject.toml +12 -0
  9. package/helper-apps/cortex-autogen2/requirements.txt +14 -0
  10. package/helper-apps/cortex-autogen2/services/redis_publisher.py +1 -1
  11. package/helper-apps/cortex-autogen2/services/run_analyzer.py +1 -1
  12. package/helper-apps/cortex-autogen2/task_processor.py +431 -229
  13. package/helper-apps/cortex-autogen2/test_entity_fetcher.py +305 -0
  14. package/helper-apps/cortex-autogen2/tests/README.md +240 -0
  15. package/helper-apps/cortex-autogen2/tests/TEST_REPORT.md +342 -0
  16. package/helper-apps/cortex-autogen2/tests/__init__.py +8 -0
  17. package/helper-apps/cortex-autogen2/tests/analysis/__init__.py +1 -0
  18. package/helper-apps/cortex-autogen2/tests/analysis/improvement_suggester.py +224 -0
  19. package/helper-apps/cortex-autogen2/tests/analysis/trend_analyzer.py +211 -0
  20. package/helper-apps/cortex-autogen2/tests/cli/__init__.py +1 -0
  21. package/helper-apps/cortex-autogen2/tests/cli/run_tests.py +296 -0
  22. package/helper-apps/cortex-autogen2/tests/collectors/__init__.py +1 -0
  23. package/helper-apps/cortex-autogen2/tests/collectors/log_collector.py +252 -0
  24. package/helper-apps/cortex-autogen2/tests/collectors/progress_collector.py +182 -0
  25. package/helper-apps/cortex-autogen2/tests/conftest.py +15 -0
  26. package/helper-apps/cortex-autogen2/tests/database/__init__.py +1 -0
  27. package/helper-apps/cortex-autogen2/tests/database/repository.py +501 -0
  28. package/helper-apps/cortex-autogen2/tests/database/schema.sql +108 -0
  29. package/helper-apps/cortex-autogen2/tests/evaluators/__init__.py +1 -0
  30. package/helper-apps/cortex-autogen2/tests/evaluators/llm_scorer.py +294 -0
  31. package/helper-apps/cortex-autogen2/tests/evaluators/prompts.py +250 -0
  32. package/helper-apps/cortex-autogen2/tests/evaluators/wordcloud_validator.py +168 -0
  33. package/helper-apps/cortex-autogen2/tests/metrics/__init__.py +1 -0
  34. package/helper-apps/cortex-autogen2/tests/metrics/collector.py +155 -0
  35. package/helper-apps/cortex-autogen2/tests/orchestrator.py +576 -0
  36. package/helper-apps/cortex-autogen2/tests/test_cases.yaml +279 -0
  37. package/helper-apps/cortex-autogen2/tests/test_data.db +0 -0
  38. package/helper-apps/cortex-autogen2/tests/utils/__init__.py +3 -0
  39. package/helper-apps/cortex-autogen2/tests/utils/connectivity.py +112 -0
  40. package/helper-apps/cortex-autogen2/tools/azure_blob_tools.py +74 -24
  41. package/helper-apps/cortex-autogen2/tools/entity_api_registry.json +38 -0
  42. package/helper-apps/cortex-autogen2/tools/file_tools.py +1 -1
  43. package/helper-apps/cortex-autogen2/tools/search_tools.py +436 -238
  44. package/helper-apps/cortex-file-handler/package-lock.json +2 -2
  45. package/helper-apps/cortex-file-handler/package.json +1 -1
  46. package/helper-apps/cortex-file-handler/scripts/setup-test-containers.js +4 -5
  47. package/helper-apps/cortex-file-handler/src/blobHandler.js +36 -144
  48. package/helper-apps/cortex-file-handler/src/services/FileConversionService.js +5 -3
  49. package/helper-apps/cortex-file-handler/src/services/storage/AzureStorageProvider.js +34 -1
  50. package/helper-apps/cortex-file-handler/src/services/storage/GCSStorageProvider.js +22 -0
  51. package/helper-apps/cortex-file-handler/src/services/storage/LocalStorageProvider.js +28 -1
  52. package/helper-apps/cortex-file-handler/src/services/storage/StorageFactory.js +29 -4
  53. package/helper-apps/cortex-file-handler/src/services/storage/StorageProvider.js +11 -0
  54. package/helper-apps/cortex-file-handler/src/services/storage/StorageService.js +1 -1
  55. package/helper-apps/cortex-file-handler/tests/blobHandler.test.js +3 -2
  56. package/helper-apps/cortex-file-handler/tests/checkHashShortLived.test.js +8 -1
  57. package/helper-apps/cortex-file-handler/tests/containerConversionFlow.test.js +5 -2
  58. package/helper-apps/cortex-file-handler/tests/containerNameParsing.test.js +14 -7
  59. package/helper-apps/cortex-file-handler/tests/containerParameterFlow.test.js +5 -2
  60. package/helper-apps/cortex-file-handler/tests/storage/StorageFactory.test.js +31 -19
  61. package/lib/entityConstants.js +3 -0
  62. package/package.json +2 -2
  63. package/pathways/system/entity/sys_entity_agent.js +2 -1
  64. package/pathways/system/entity/tools/sys_tool_codingagent.js +2 -2
  65. package/pathways/system/workspaces/workspace_applet_edit.js +551 -29
  66. package/server/modelExecutor.js +4 -0
  67. package/server/plugins/claude4VertexPlugin.js +540 -0
  68. package/server/plugins/openAiWhisperPlugin.js +43 -2
  69. package/tests/integration/rest/vendors/claude_streaming.test.js +121 -0
  70. package/tests/unit/plugins/claude4VertexPlugin.test.js +462 -0
  71. package/tests/unit/plugins/claude4VertexToolConversion.test.js +413 -0
  72. package/helper-apps/cortex-autogen/.funcignore +0 -8
  73. package/helper-apps/cortex-autogen/Dockerfile +0 -10
  74. package/helper-apps/cortex-autogen/OAI_CONFIG_LIST +0 -6
  75. package/helper-apps/cortex-autogen/agents.py +0 -493
  76. package/helper-apps/cortex-autogen/agents_extra.py +0 -14
  77. package/helper-apps/cortex-autogen/config.py +0 -18
  78. package/helper-apps/cortex-autogen/data_operations.py +0 -29
  79. package/helper-apps/cortex-autogen/function_app.py +0 -44
  80. package/helper-apps/cortex-autogen/host.json +0 -15
  81. package/helper-apps/cortex-autogen/main.py +0 -38
  82. package/helper-apps/cortex-autogen/prompts.py +0 -196
  83. package/helper-apps/cortex-autogen/prompts_extra.py +0 -5
  84. package/helper-apps/cortex-autogen/requirements.txt +0 -9
  85. package/helper-apps/cortex-autogen/search.py +0 -85
  86. package/helper-apps/cortex-autogen/test.sh +0 -40
  87. package/helper-apps/cortex-autogen/tools/sasfileuploader.py +0 -66
  88. package/helper-apps/cortex-autogen/utils.py +0 -88
  89. package/helper-apps/cortex-autogen2/DigiCertGlobalRootCA.crt.pem +0 -22
  90. package/helper-apps/cortex-autogen2/poetry.lock +0 -3652
  91. package/testrun.log +0 -35371
@@ -71,11 +71,14 @@ test.after.always(async (t) => {
71
71
 
72
72
  // Test container parameter validation
73
73
  test("should validate container names correctly", (t) => {
74
+ // Get current container names
75
+ const currentContainers = AZURE_STORAGE_CONTAINER_NAMES;
76
+
74
77
  // Test with valid container names from configuration
75
- AZURE_STORAGE_CONTAINER_NAMES.forEach(containerName => {
78
+ currentContainers.forEach(containerName => {
76
79
  t.true(isValidContainerName(containerName), `${containerName} should be valid`);
77
80
  });
78
-
81
+
79
82
  // Test with invalid container names
80
83
  const invalidNames = ["invalid-container", "", null, undefined, "nonexistent"];
81
84
  invalidNames.forEach(name => {
@@ -123,19 +123,27 @@ test("should get azure provider with specific container name", async (t) => {
123
123
  return;
124
124
  }
125
125
 
126
- const factory = new StorageFactory();
127
-
128
- // Mock the blobHandler constants for this test
129
- const mockConstants = {
130
- AZURE_STORAGE_CONTAINER_NAMES: ["container1", "container2", "container3"],
131
- DEFAULT_AZURE_STORAGE_CONTAINER_NAME: "container1",
132
- isValidContainerName: (name) => ["container1", "container2", "container3"].includes(name)
133
- };
126
+ // Save original env value
127
+ const originalEnv = process.env.AZURE_STORAGE_CONTAINER_NAME;
134
128
 
135
- // Test with valid container name
136
- const provider = await factory.getAzureProvider("container2");
137
- t.truthy(provider);
138
- t.is(provider.containerName, "container2");
129
+ try {
130
+ // Set test container names in environment
131
+ process.env.AZURE_STORAGE_CONTAINER_NAME = "container1,container2,container3";
132
+
133
+ const factory = new StorageFactory();
134
+
135
+ // Test with valid container name
136
+ const provider = await factory.getAzureProvider("container2");
137
+ t.truthy(provider);
138
+ t.is(provider.containerName, "container2");
139
+ } finally {
140
+ // Restore original env
141
+ if (originalEnv) {
142
+ process.env.AZURE_STORAGE_CONTAINER_NAME = originalEnv;
143
+ } else {
144
+ delete process.env.AZURE_STORAGE_CONTAINER_NAME;
145
+ }
146
+ }
139
147
  });
140
148
 
141
149
  test("should throw error for invalid container name", async (t) => {
@@ -159,21 +167,25 @@ test("should cache providers by container name", async (t) => {
159
167
  return;
160
168
  }
161
169
 
162
- const factory = new StorageFactory();
163
-
164
- // Mock valid container names for testing
170
+ // Save original env value
165
171
  const originalEnv = process.env.AZURE_STORAGE_CONTAINER_NAME;
166
- process.env.AZURE_STORAGE_CONTAINER_NAME = "test1,test2,test3";
167
172
 
168
173
  try {
169
- const provider1 = await factory.getAzureProvider("test1");
170
- const provider2 = await factory.getAzureProvider("test1");
171
- const provider3 = await factory.getAzureProvider("test2");
174
+ // Set test container names in environment
175
+ process.env.AZURE_STORAGE_CONTAINER_NAME = "container1,container2,container3";
176
+
177
+ const factory = new StorageFactory();
178
+
179
+ const provider1 = await factory.getAzureProvider("container1");
180
+ const provider2 = await factory.getAzureProvider("container1");
181
+ const provider3 = await factory.getAzureProvider("container2");
172
182
 
173
183
  // Same container should return same instance
174
184
  t.is(provider1, provider2);
175
185
  // Different container should return different instance
176
186
  t.not(provider1, provider3);
187
+ t.is(provider1.containerName, "container1");
188
+ t.is(provider3.containerName, "container2");
177
189
  } finally {
178
190
  // Restore original env
179
191
  if (originalEnv) {
@@ -26,6 +26,7 @@ Your responses should be in {{language}} unless the user has expressed another p
26
26
  - You have an extensive toolkit. Each time you call tool(s) you will get the result(s), evaluate, decide what's next, and chain as many steps as needed.
27
27
  - Your tools work most efficiently when called in parallel so if you know you will need multiple tool calls and you know what the parameters are, call them in parallel.
28
28
  - Always honor user requests to use specific tools.
29
+ - For data processing requests (e.g. tell me how many articles were published in the last 30 days), or deep file analysis (chart the trends in this spreadsheet, etc.), you should call your code execution tool to perform the task - especially if the task requires a lot of data, deep analysis, complex filtering, or precision calculations. For simpler things (e.g. make me a chart of the population of the world in the last 100 years) you might find it faster to search for the data and then just call your charting tool to generate the chart.
29
30
  - You must always search if you are being asked questions about current events, news, fact-checking, or information requiring citation.
30
31
  - Do not make up information - if information cannot be confirmed with rigorous logic or reliable sources, do not include it in your response.
31
32
  - Start searches broad and consult multiple sources, running all searches in parallel to save time.
@@ -123,6 +124,8 @@ Privacy is critical. If asked to forget or delete something, always comply affir
123
124
 
124
125
  AI_STYLE_OPENAI: "oai-gpt5-chat",
125
126
  AI_STYLE_OPENAI_RESEARCH: "oai-gpt5",
127
+ AI_STYLE_OPENAI_LEGACY: "oai-gpt41",
128
+ AI_STYLE_OPENAI_LEGACY_RESEARCH: "oai-o3",
126
129
  AI_STYLE_ANTHROPIC: "claude-4-sonnet-vertex",
127
130
  AI_STYLE_ANTHROPIC_RESEARCH: "claude-41-opus-vertex",
128
131
  AI_STYLE_XAI: "xai-grok-4-fast-reasoning",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aj-archipelago/cortex",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "description": "Cortex is a GraphQL API for AI. It provides a simple, extensible interface for using AI services from OpenAI, Azure and others.",
5
5
  "private": false,
6
6
  "repository": {
@@ -33,7 +33,7 @@
33
33
  "type": "module",
34
34
  "homepage": "https://github.com/aj-archipelago/cortex#readme",
35
35
  "dependencies": {
36
- "@aj-archipelago/merval": "^1.0.2",
36
+ "@aj-archipelago/merval": "^1.0.3",
37
37
  "@aj-archipelago/subvibe": "^1.0.12",
38
38
  "@apollo/server": "^4.7.3",
39
39
  "@apollo/server-plugin-response-cache": "^4.1.2",
@@ -333,12 +333,13 @@ export default {
333
333
  ];
334
334
 
335
335
  // set the style model if applicable
336
- const { aiStyle, AI_STYLE_ANTHROPIC, AI_STYLE_OPENAI, AI_STYLE_ANTHROPIC_RESEARCH, AI_STYLE_OPENAI_RESEARCH, AI_STYLE_XAI, AI_STYLE_XAI_RESEARCH, AI_STYLE_GOOGLE, AI_STYLE_GOOGLE_RESEARCH } = args;
336
+ const { aiStyle, AI_STYLE_ANTHROPIC, AI_STYLE_OPENAI, AI_STYLE_ANTHROPIC_RESEARCH, AI_STYLE_OPENAI_RESEARCH, AI_STYLE_OPENAI_LEGACY, AI_STYLE_OPENAI_LEGACY_RESEARCH, AI_STYLE_XAI, AI_STYLE_XAI_RESEARCH, AI_STYLE_GOOGLE, AI_STYLE_GOOGLE_RESEARCH } = args;
337
337
 
338
338
  // Create a mapping of AI styles to their corresponding models
339
339
  const styleModelMap = {
340
340
  "Anthropic": { normal: AI_STYLE_ANTHROPIC, research: AI_STYLE_ANTHROPIC_RESEARCH },
341
341
  "OpenAI": { normal: AI_STYLE_OPENAI, research: AI_STYLE_OPENAI_RESEARCH },
342
+ "OpenAI_Legacy": { normal: AI_STYLE_OPENAI_LEGACY, research: AI_STYLE_OPENAI_LEGACY_RESEARCH },
342
343
  "XAI": { normal: AI_STYLE_XAI, research: AI_STYLE_XAI_RESEARCH },
343
344
  "Google": { normal: AI_STYLE_GOOGLE, research: AI_STYLE_GOOGLE_RESEARCH }
344
345
  };
@@ -48,7 +48,7 @@ export default {
48
48
  icon: "🤖",
49
49
  function: {
50
50
  name: "CodeExecution",
51
- description: "This tool allows you to engage an agent to write and execute code to perform a task on your behalf. Use when explicitly asked to run or execute code, or when a coding agent is needed to perform specific tasks - examples include data analysis, file manipulation, or other tasks that require code execution. With this tool you can also access internal databases and query them directly. This will start a background task and return - you will not receive the response immediately.",
51
+ description: "This tool allows you to asynchronously engage an agent to write and execute code to perform a task on your behalf. Use when explicitly asked to run or execute code, or when a coding agent is needed to perform specific tasks - examples include data analysis, file manipulation, or other tasks that require code execution. With this tool you can read and write files and also access internal databases and query them directly. This will start a background task and return - you will not receive the response immediately.",
52
52
  parameters: {
53
53
  type: "object",
54
54
  properties: {
@@ -66,7 +66,7 @@ export default {
66
66
  },
67
67
  codingTaskKeywords: {
68
68
  type: "string",
69
- description: "Keywords for Azure Cognitive Search to help the coding agent find relevant code snippets"
69
+ description: "Keywords for the coding agent's internal Azure Cognitive Search index to help the coding agent find relevant code snippets"
70
70
  }
71
71
  },
72
72
  required: ["codingTask", "userMessage", "codingTaskKeywords"]