@props-labs/mesh-os 0.1.12 → 0.1.14
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/core/client.js +7 -2
- package/package.json +1 -1
package/dist/core/client.js
CHANGED
@@ -743,6 +743,12 @@ class MeshOS {
|
|
743
743
|
*/
|
744
744
|
async getMemories(options) {
|
745
745
|
const { where, orderBy, limit, offset, distinctOn } = options;
|
746
|
+
// Convert orderBy to Hasura format
|
747
|
+
const hasuraOrderBy = orderBy?.map(({ column, order }) => {
|
748
|
+
// Convert camelCase to snake_case for column names
|
749
|
+
const snakeCaseColumn = column.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`);
|
750
|
+
return { [snakeCaseColumn]: order };
|
751
|
+
});
|
746
752
|
// Build the GraphQL query dynamically
|
747
753
|
const query = `
|
748
754
|
query GetMemories(
|
@@ -763,7 +769,6 @@ class MeshOS {
|
|
763
769
|
agent_id
|
764
770
|
content
|
765
771
|
metadata
|
766
|
-
embedding
|
767
772
|
created_at
|
768
773
|
updated_at
|
769
774
|
expires_at
|
@@ -772,7 +777,7 @@ class MeshOS {
|
|
772
777
|
`;
|
773
778
|
const result = await this.executeQuery(query, {
|
774
779
|
where,
|
775
|
-
orderBy,
|
780
|
+
orderBy: hasuraOrderBy,
|
776
781
|
limit,
|
777
782
|
offset,
|
778
783
|
...(distinctOn ? { distinctOn } : {})
|