@elizaos/plugin-matrix-typescript 2.0.0-alpha.1
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/__tests__/integration.test.ts +30 -0
- package/build.ts +16 -0
- package/dist/index.js +1045 -0
- package/package.json +31 -0
- package/src/actions/joinRoom.ts +147 -0
- package/src/actions/listRooms.ts +95 -0
- package/src/actions/sendMessage.ts +175 -0
- package/src/actions/sendReaction.ts +162 -0
- package/src/index.ts +105 -0
- package/src/providers/roomState.ts +95 -0
- package/src/providers/userContext.ts +79 -0
- package/src/service.ts +483 -0
- package/src/types.ts +334 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import matrixPlugin, {
|
|
3
|
+
MatrixService,
|
|
4
|
+
joinRoom,
|
|
5
|
+
listRooms,
|
|
6
|
+
roomStateProvider,
|
|
7
|
+
sendMessage,
|
|
8
|
+
sendReaction,
|
|
9
|
+
userContextProvider,
|
|
10
|
+
} from "../src/index.ts";
|
|
11
|
+
|
|
12
|
+
describe("Matrix plugin exports", () => {
|
|
13
|
+
test("exports plugin metadata", () => {
|
|
14
|
+
expect(matrixPlugin.name).toBe("matrix");
|
|
15
|
+
expect(matrixPlugin.description).toContain("Matrix");
|
|
16
|
+
expect(Array.isArray(matrixPlugin.actions)).toBe(true);
|
|
17
|
+
expect(Array.isArray(matrixPlugin.providers)).toBe(true);
|
|
18
|
+
expect(Array.isArray(matrixPlugin.services)).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test("exports actions, providers, and service", () => {
|
|
22
|
+
expect(sendMessage).toBeDefined();
|
|
23
|
+
expect(sendReaction).toBeDefined();
|
|
24
|
+
expect(listRooms).toBeDefined();
|
|
25
|
+
expect(joinRoom).toBeDefined();
|
|
26
|
+
expect(roomStateProvider).toBeDefined();
|
|
27
|
+
expect(userContextProvider).toBeDefined();
|
|
28
|
+
expect(MatrixService).toBeDefined();
|
|
29
|
+
});
|
|
30
|
+
});
|
package/build.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { build } from "bun";
|
|
2
|
+
|
|
3
|
+
await build({
|
|
4
|
+
entrypoints: ["./src/index.ts"],
|
|
5
|
+
outdir: "./dist",
|
|
6
|
+
target: "node",
|
|
7
|
+
format: "esm",
|
|
8
|
+
sourcemap: "external",
|
|
9
|
+
external: ["@elizaos/core", "matrix-js-sdk"],
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
// Also emit declarations with tsc
|
|
13
|
+
import { spawnSync } from "node:child_process";
|
|
14
|
+
spawnSync("bunx", ["tsc", "--emitDeclarationOnly"], { stdio: "inherit" });
|
|
15
|
+
|
|
16
|
+
console.log("Build complete");
|