Skip to content

Commit 549e0f1

Browse files
authored
Merge pull request #6167 from elizaOS/pr1/rls-infrastructure
feat: Entity RLS Infrastructure + API Clarity + Performance
2 parents f602337 + 9f5bb51 commit 549e0f1

File tree

168 files changed

+6118
-2157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+6118
-2157
lines changed

.github/workflows/client-cypress-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ jobs:
112112
- name: Run E2E tests with server
113113
working-directory: packages/client
114114
run: |
115-
chmod +x scripts/test-e2e-with-server.sh
116-
./scripts/test-e2e-with-server.sh
115+
chmod +x scripts/test-e2e-server.sh
116+
./scripts/test-e2e-server.sh
117117
env:
118118
SERVER_PORT: 3000
119119
CLIENT_PORT: 5173

bun.lock

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,17 +418,21 @@
418418
"@types/express": "^5.0.2",
419419
"@types/helmet": "^4.0.0",
420420
"@types/multer": "^2.0.0",
421+
"bcrypt": "^6.0.0",
421422
"dotenv": "^17.2.3",
422423
"express": "^5.1.0",
423424
"express-rate-limit": "^8.1.0",
424425
"helmet": "^8.1.0",
426+
"jose": "^6.1.2",
425427
"multer": "^2.0.1",
426428
"path-to-regexp": "^8.2.0",
427429
"socket.io": "^4.8.1",
428430
},
429431
"devDependencies": {
430432
"@elizaos/client": "workspace:*",
433+
"@types/bcrypt": "^6.0.0",
431434
"@types/node": "^24.0.1",
435+
"bun-fetch-mock": "^1.0.0",
432436
"prettier": "3.6.2",
433437
"tsx": "4.20.6",
434438
"typescript": "^5.5.4",
@@ -1385,6 +1389,8 @@
13851389

13861390
"@types/babel__traverse": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.28.2" } }, "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q=="],
13871391

1392+
"@types/bcrypt": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-/oJGukuH3D2+D+3H4JWLaAsJ/ji86dhRidzZ/Od7H/i8g+aCmvkeCc6Ni/f9uxGLSQVCRZkX2/lqEFG2BvWtlQ=="],
1393+
13881394
"@types/body-parser": ["@types/[email protected]", "", { "dependencies": { "@types/connect": "*", "@types/node": "*" } }, "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g=="],
13891395

13901396
"@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.3.2" } }, "sha512-t15P7k5UIgHKkxwnMNkJbWlh/617rkDGEdSsDbu+qNHTaz9SKf7aC8fiIlUdD5RPpH6GEkP0cK7WlvmrEBRtWg=="],
@@ -1787,6 +1793,8 @@
17871793

17881794
"bats-support": ["[email protected]", "", { "peerDependencies": { "bats": "0.4 || ^1" } }, "sha512-z+2WzXbI4OZgLnynydqH8GpI3+DcOtepO66PlK47SfEzTkiuV9hxn9eIQX+uLVFbt2Oqoc7Ky3TJ/N83lqD+cg=="],
17891795

1796+
"bcrypt": ["[email protected]", "", { "dependencies": { "node-addon-api": "^8.3.0", "node-gyp-build": "^4.8.4" } }, "sha512-cU8v/EGSrnH+HnxV2z0J7/blxH8gq7Xh2JFT6Aroax7UohdmiJJlxApMxtKfuI7z68NvvVcmR78k2LbT6efhRg=="],
1797+
17901798
"bcrypt-pbkdf": ["[email protected]", "", { "dependencies": { "tweetnacl": "^0.14.3" } }, "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w=="],
17911799

17921800
"before-after-hook": ["[email protected]", "", {}, "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ=="],
@@ -1845,6 +1853,8 @@
18451853

18461854
"bun": ["[email protected]", "", { "optionalDependencies": { "@oven/bun-darwin-aarch64": "1.3.2", "@oven/bun-darwin-x64": "1.3.2", "@oven/bun-darwin-x64-baseline": "1.3.2", "@oven/bun-linux-aarch64": "1.3.2", "@oven/bun-linux-aarch64-musl": "1.3.2", "@oven/bun-linux-x64": "1.3.2", "@oven/bun-linux-x64-baseline": "1.3.2", "@oven/bun-linux-x64-musl": "1.3.2", "@oven/bun-linux-x64-musl-baseline": "1.3.2", "@oven/bun-windows-x64": "1.3.2", "@oven/bun-windows-x64-baseline": "1.3.2" }, "os": [ "linux", "win32", "darwin", ], "cpu": [ "x64", "arm64", ], "bin": { "bun": "bin/bun.exe", "bunx": "bin/bunx.exe" } }, "sha512-x75mPJiEfhO1j4Tfc65+PtW6ZyrAB6yTZInydnjDZXF9u9PRAnr6OK3v0Q9dpDl0dxRHkXlYvJ8tteJxc8t4Sw=="],
18471855

1856+
"bun-fetch-mock": ["[email protected]", "", {}, "sha512-5YVYK7R7NhJ//iNQBasnuG19cZLb4qDCp/gTQqdBnC6RINr2bwOmtBN3hrg5/qY3gp97bH2jjqjqjNRwVIN50Q=="],
1857+
18481858
"bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-i/Gln4tbzKNuxP70OWhJRZz1MRfvqExowP7U6JKoI8cntFrtxg7RJK3jvz7wQW54UuvNC8tbKHHri5fy74FVqg=="],
18491859

18501860
"bundle-require": ["[email protected]", "", { "dependencies": { "load-tsconfig": "^0.2.3" }, "peerDependencies": { "esbuild": ">=0.18" } }, "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA=="],
@@ -2779,6 +2789,8 @@
27792789

27802790
"joi": ["[email protected]", "", { "dependencies": { "@hapi/address": "^5.1.1", "@hapi/formula": "^3.0.2", "@hapi/hoek": "^11.0.7", "@hapi/pinpoint": "^2.0.1", "@hapi/tlds": "^1.1.1", "@hapi/topo": "^6.0.2", "@standard-schema/spec": "^1.0.0" } }, "sha512-RuCOQMIt78LWnktPoeBL0GErkNaJPTBGcYuyaBvUOQSpcpcLfWrHPPihYdOGbV5pam9VTWbeoF7TsGiHugcjGA=="],
27812791

2792+
"jose": ["[email protected]", "", {}, "sha512-MpcPtHLE5EmztuFIqB0vzHAWJPpmN1E6L4oo+kze56LIs3MyXIj9ZHMDxqOvkP38gBR7K1v3jqd4WU2+nrfONQ=="],
2793+
27822794
"joycon": ["[email protected]", "", {}, "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw=="],
27832795

27842796
"js-tiktoken": ["[email protected]", "", { "dependencies": { "base64-js": "^1.5.1" } }, "sha512-biOj/6M5qdgx5TKjDnFT1ymSpM5tbd3ylwDtrQvFQSu0Z7bBYko2dF+W/aUkXUPuk6IVpRxk/3Q2sHOzGlS36g=="],
@@ -3161,6 +3173,8 @@
31613173

31623174
"nipplejs": ["[email protected]", "", {}, "sha512-XGxFY8C2DOtobf1fK+MXINTzkkXJLjZDDpfQhOUZf4TSytbc9s4bmA0lB9eKKM8iDivdr9NQkO7DpIQfsST+9g=="],
31633175

3176+
"node-addon-api": ["[email protected]", "", {}, "sha512-/bRZty2mXUIFY/xU5HLvveNHlswNJej+RnxBjOMkidWfwZzgTbPG1E3K5TOxRLOR+5hX7bSofy8yf1hZevMS8A=="],
3177+
31643178
"node-domexception": ["[email protected]", "", {}, "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="],
31653179

31663180
"node-fetch": ["[email protected]", "", { "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", "formdata-polyfill": "^4.0.10" } }, "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA=="],
@@ -4711,7 +4725,7 @@
47114725

47124726
"npm-run-path/path-key": ["[email protected]", "", {}, "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ=="],
47134727

4714-
"nx/chalk": ["[email protected].2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
4728+
"nx/chalk": ["[email protected].0", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A=="],
47154729

47164730
"nx/cli-cursor": ["[email protected]", "", { "dependencies": { "restore-cursor": "^3.1.0" } }, "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw=="],
47174731

@@ -4859,6 +4873,8 @@
48594873

48604874
"tsup/source-map": ["[email protected]", "", { "dependencies": { "whatwg-url": "^7.0.0" } }, "sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA=="],
48614875

4876+
"tsup/tinyglobby": ["[email protected]", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="],
4877+
48624878
"tuf-js/make-fetch-happen": ["[email protected]", "", { "dependencies": { "@npmcli/agent": "^3.0.0", "cacache": "^19.0.1", "http-cache-semantics": "^4.1.1", "minipass": "^7.0.2", "minipass-fetch": "^4.0.0", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "negotiator": "^1.0.0", "proc-log": "^5.0.0", "promise-retry": "^2.0.1", "ssri": "^12.0.0" } }, "sha512-QMjGbFTP0blj97EeidG5hk/QhKQ3T4ICckQGLgz38QF7Vgbk6e6FTARN8KhKxyBbWn8R0HU+bnw8aSoFPD4qtQ=="],
48634879

48644880
"type-is/mime-types": ["[email protected]", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="],
@@ -5431,6 +5447,8 @@
54315447

54325448
"normalize-package-data/hosted-git-info/lru-cache/yallist": ["[email protected]", "", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="],
54335449

5450+
"nx/ora/log-symbols/chalk": ["[email protected]", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
5451+
54345452
"nx/ora/log-symbols/is-unicode-supported": ["[email protected]", "", {}, "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw=="],
54355453

54365454
"nx/ora/strip-ansi/ansi-regex": ["[email protected]", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
@@ -5479,6 +5497,10 @@
54795497

54805498
"meow/read-pkg-up/read-pkg/normalize-package-data/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver" } }, "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g=="],
54815499

5500+
"nx/ora/log-symbols/chalk/ansi-styles": ["[email protected]", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],
5501+
5502+
"nx/ora/log-symbols/chalk/supports-color": ["[email protected]", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="],
5503+
54825504
"pacote/sigstore/@sigstore/tuf/tuf-js/@tufjs/models": ["@tufjs/[email protected]", "", { "dependencies": { "@tufjs/canonical-json": "2.0.0", "minimatch": "^9.0.5" } }, "sha512-h5x5ga/hh82COe+GoD4+gKUeV4T3iaYOxqLt41GRKApinPI7DMidhCmNVTjKfhCWFJIGXaFJee07XczdT4jdZQ=="],
54835505

54845506
"pkg-dir/find-up/locate-path/p-locate/p-limit": ["[email protected]", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="],

examples/standalone-cli-chat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class AgentInitializer {
192192
name: 'User',
193193
source: CONSTANTS.CHAT_IDENTIFIERS.SOURCE,
194194
channelId: CONSTANTS.CHAT_IDENTIFIERS.CHANNEL,
195-
serverId: CONSTANTS.CHAT_IDENTIFIERS.SERVER,
195+
messageServerId: CONSTANTS.CHAT_IDENTIFIERS.SERVER,
196196
type: ChannelType.DM,
197197
});
198198

examples/standalone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ async function main(): Promise<void> {
123123
name: 'LocalUser',
124124
source: 'cli',
125125
channelId: 'standalone-channel',
126-
serverId: 'standalone-server',
126+
messageServerId: stringToUuid('standalone-server'),
127127
type: ChannelType.DM,
128128
});
129129

packages/api-client/src/__tests__/services/media.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe('MediaService', () => {
104104

105105
expect((mediaService as any).request).toHaveBeenCalledWith(
106106
'POST',
107-
`/api/messaging/central-channels/${TEST_CHANNEL_ID}/upload-media`,
107+
`/api/messaging/channels/${TEST_CHANNEL_ID}/upload-media`,
108108
expect.objectContaining({
109109
body: expect.any(FormData),
110110
})

packages/api-client/src/__tests__/services/memory.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { UUID } from '@elizaos/core';
77
const TEST_AGENT_ID = '550e8400-e29b-41d4-a716-446655440001' as UUID;
88
const TEST_ROOM_ID = '550e8400-e29b-41d4-a716-446655440002' as UUID;
99
const TEST_MEMORY_ID = '550e8400-e29b-41d4-a716-446655440003' as UUID;
10-
const TEST_SERVER_ID = '550e8400-e29b-41d4-a716-446655440004' as UUID;
10+
const TEST_MESSAGE_SERVER_ID = '550e8400-e29b-41d4-a716-446655440004' as UUID;
1111

1212
describe('MemoryService', () => {
1313
let memoryService: MemoryService;
@@ -261,16 +261,16 @@ describe('MemoryService', () => {
261261
});
262262

263263
describe('createWorldFromServer', () => {
264-
const worldParams = { serverId: TEST_SERVER_ID, name: 'New World', description: 'A new world' };
264+
const worldParams = { messageServerId: TEST_MESSAGE_SERVER_ID, name: 'New World', description: 'A new world' };
265265

266266
it('should create world from server successfully', async () => {
267267
const mockResponse = { worldId: 'world-new' as UUID };
268268
(memoryService as any).post.mockResolvedValue(mockResponse);
269269

270-
const result = await memoryService.createWorldFromServer(TEST_SERVER_ID, worldParams);
270+
const result = await memoryService.createWorldFromMessageServer(TEST_MESSAGE_SERVER_ID, worldParams);
271271

272272
expect((memoryService as any).post).toHaveBeenCalledWith(
273-
`/api/memory/groups/${TEST_SERVER_ID}`,
273+
`/api/memory/groups/${TEST_MESSAGE_SERVER_ID}`,
274274
worldParams
275275
);
276276
expect(result).toEqual(mockResponse);
@@ -282,10 +282,10 @@ describe('MemoryService', () => {
282282
const mockResponse = { success: true };
283283
(memoryService as any).delete.mockResolvedValue(mockResponse);
284284

285-
const result = await memoryService.deleteWorld(TEST_SERVER_ID);
285+
const result = await memoryService.deleteWorld(TEST_MESSAGE_SERVER_ID);
286286

287287
expect((memoryService as any).delete).toHaveBeenCalledWith(
288-
`/api/memory/groups/${TEST_SERVER_ID}`
288+
`/api/memory/groups/${TEST_MESSAGE_SERVER_ID}`
289289
);
290290
expect(result).toEqual(mockResponse);
291291
});
@@ -296,10 +296,10 @@ describe('MemoryService', () => {
296296
const mockResponse = { deleted: 15 };
297297
(memoryService as any).delete.mockResolvedValue(mockResponse);
298298

299-
const result = await memoryService.clearWorldMemories(TEST_SERVER_ID);
299+
const result = await memoryService.clearWorldMemories(TEST_MESSAGE_SERVER_ID);
300300

301301
expect((memoryService as any).delete).toHaveBeenCalledWith(
302-
`/api/memory/groups/${TEST_SERVER_ID}/memories`
302+
`/api/memory/groups/${TEST_MESSAGE_SERVER_ID}/memories`
303303
);
304304
expect(result).toEqual(mockResponse);
305305
});

0 commit comments

Comments
 (0)