@aj-archipelago/cortex 1.4.30 → 1.4.32
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/lib/fileUtils.js +194 -187
- package/lib/pathwayManager.js +7 -0
- package/lib/pathwayTools.js +71 -0
- package/package.json +1 -1
- package/pathways/system/entity/files/sys_read_file_collection.js +3 -3
- package/pathways/system/entity/sys_entity_agent.js +41 -3
- package/pathways/system/entity/tools/sys_tool_analyzefile.js +48 -19
- package/pathways/system/entity/tools/sys_tool_editfile.js +4 -4
- package/pathways/system/entity/tools/sys_tool_file_collection.js +24 -17
- package/pathways/system/entity/tools/sys_tool_view_image.js +3 -3
- package/server/clientToolCallbacks.js +241 -0
- package/server/executeWorkspace.js +7 -0
- package/server/graphql.js +3 -1
- package/server/plugins/gemini15VisionPlugin.js +16 -3
- package/server/resolver.js +37 -2
- package/tests/integration/clientToolCallbacks.test.js +161 -0
- package/tests/integration/features/tools/fileCollection.test.js +696 -63
- package/tests/integration/features/tools/writefile.test.js +4 -4
- package/tests/integration/graphql/async/stream/file_operations_agent.test.js +839 -0
- package/tests/unit/core/fileCollection.test.js +1 -1
- package/tests/unit/plugins/multimodal_conversion.test.js +16 -6
|
@@ -485,7 +485,7 @@ test('addFileToCollection should preserve original displayFilename for converted
|
|
|
485
485
|
|
|
486
486
|
// Verify it was saved correctly
|
|
487
487
|
const { loadFileCollection } = await import('../../../lib/fileUtils.js');
|
|
488
|
-
const collection = await loadFileCollection(contextId,
|
|
488
|
+
const collection = await loadFileCollection(contextId, { useCache: false });
|
|
489
489
|
t.is(collection.length, 1);
|
|
490
490
|
t.is(collection[0].displayFilename, 'original-document.docx');
|
|
491
491
|
t.is(collection[0].mimeType, 'text/markdown');
|
|
@@ -432,9 +432,9 @@ test('Gemini 1.5 image URL type handling', t => {
|
|
|
432
432
|
{ type: 'image_url', image_url: { url: 'gs://my-bucket/image1.jpg' } },
|
|
433
433
|
// Base64 URL - should be converted to inlineData
|
|
434
434
|
{ type: 'image_url', image_url: { url: 'data:image/jpeg;base64,/9j/4AAQSkZJRg...' } },
|
|
435
|
-
// Regular HTTP URL - should be
|
|
435
|
+
// Regular HTTP URL - should be converted to fileData (Gemini supports HTTP URLs directly)
|
|
436
436
|
{ type: 'image_url', image_url: { url: 'https://example.com/image.jpg' } },
|
|
437
|
-
// Azure blob URL - should be
|
|
437
|
+
// Azure blob URL - should be converted to fileData (Gemini supports HTTP URLs directly)
|
|
438
438
|
{ type: 'image_url', image_url: { url: 'https://myaccount.blob.core.windows.net/container/image.jpg' } }
|
|
439
439
|
]}
|
|
440
440
|
];
|
|
@@ -442,20 +442,30 @@ test('Gemini 1.5 image URL type handling', t => {
|
|
|
442
442
|
const { modifiedMessages } = gemini15.convertMessagesToGemini(messages);
|
|
443
443
|
|
|
444
444
|
t.is(modifiedMessages.length, 1);
|
|
445
|
-
t.is(modifiedMessages[0].parts.length,
|
|
446
|
-
|
|
445
|
+
t.is(modifiedMessages[0].parts.length, 5); // text + gcs + base64 + http + azure (all urls kept)
|
|
446
|
+
|
|
447
447
|
// Check text part
|
|
448
448
|
t.is(modifiedMessages[0].parts[0].text, 'Process these images:');
|
|
449
|
-
|
|
449
|
+
|
|
450
450
|
// Check GCS URL handling
|
|
451
451
|
t.true('fileData' in modifiedMessages[0].parts[1]);
|
|
452
452
|
t.is(modifiedMessages[0].parts[1].fileData.fileUri, 'gs://my-bucket/image1.jpg');
|
|
453
453
|
t.is(modifiedMessages[0].parts[1].fileData.mimeType, 'image/jpeg');
|
|
454
|
-
|
|
454
|
+
|
|
455
455
|
// Check base64 URL handling
|
|
456
456
|
t.true('inlineData' in modifiedMessages[0].parts[2]);
|
|
457
457
|
t.is(modifiedMessages[0].parts[2].inlineData.mimeType, 'image/jpeg');
|
|
458
458
|
t.is(modifiedMessages[0].parts[2].inlineData.data, '/9j/4AAQSkZJRg...');
|
|
459
|
+
|
|
460
|
+
// Check HTTP URL handling
|
|
461
|
+
t.true('fileData' in modifiedMessages[0].parts[3]);
|
|
462
|
+
t.is(modifiedMessages[0].parts[3].fileData.fileUri, 'https://example.com/image.jpg');
|
|
463
|
+
t.is(modifiedMessages[0].parts[3].fileData.mimeType, 'image/jpeg');
|
|
464
|
+
|
|
465
|
+
// Check Azure blob URL handling
|
|
466
|
+
t.true('fileData' in modifiedMessages[0].parts[4]);
|
|
467
|
+
t.is(modifiedMessages[0].parts[4].fileData.fileUri, 'https://myaccount.blob.core.windows.net/container/image.jpg');
|
|
468
|
+
t.is(modifiedMessages[0].parts[4].fileData.mimeType, 'image/jpeg');
|
|
459
469
|
});
|
|
460
470
|
|
|
461
471
|
// Test edge cases for image URLs in Gemini 1.5
|