@framers/agentos-ext-channel-matrix 0.1.4 → 0.1.5

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/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # Matrix channel
2
+
3
+ This pack gives an agent inbound and outbound Matrix text messaging through `@vector-im/matrix-bot-sdk`.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @framers/agentos-ext-channel-matrix
9
+ ```
10
+
11
+ Peer dependency: `@framers/agentos` `>=0.10.40`.
12
+
13
+ ## Usage
14
+
15
+ ```ts
16
+ import { AgentOS } from '@framers/agentos';
17
+
18
+ const agentos = await AgentOS.create({
19
+ extensionManifest: {
20
+ packs: [
21
+ {
22
+ package: '@framers/agentos-ext-channel-matrix',
23
+ options: {
24
+ homeserverUrl: process.env.MATRIX_HOMESERVER_URL,
25
+ accessToken: process.env.MATRIX_ACCESS_TOKEN,
26
+ },
27
+ },
28
+ ],
29
+ },
30
+ });
31
+ ```
32
+
33
+ ## Configuration
34
+
35
+ | Option | Secret id | Environment variable | Required | Default |
36
+ | --- | --- | --- | --- | --- |
37
+ | `homeserverUrl` | `matrix.homeserverUrl` | `MATRIX_HOMESERVER_URL` | Yes | None |
38
+ | `accessToken` | `matrix.accessToken` | `MATRIX_ACCESS_TOKEN` | Yes | None |
39
+ | `detectDirectRooms` | | | No | `true` |
40
+ | `priority` | | | No | `50` |
41
+ | `secrets` | | | No | None |
42
+ | Context `logger` | | | No | `console` for service logging |
43
+
44
+ Credentials resolve from options, then option `secrets`, then environment variables.
45
+
46
+ ## Tools
47
+
48
+ | Tool | What it does |
49
+ | --- | --- |
50
+ | `matrixChannelSendMessage` | Sends a text message through the Matrix channel. |
51
+
52
+ ### `matrixChannelSendMessage`
53
+
54
+ | Parameter | Type | Required | Description |
55
+ | --- | --- | --- | --- |
56
+ | `conversationId` | string | Yes | Target Matrix room ID (e.g., `!room:server`) |
57
+ | `text` | string | Yes | Message text |
58
+
59
+ ## Channel adapter
60
+
61
+ The adapter registers platform `matrix`. Activation starts a `MatrixClient` with the homeserver URL, access token and `MemoryStorageProvider`, and configures `AutojoinRoomsMixin`. Received room messages with a body and type `m.text`, `m.notice` or no message type become message events. Messages from the client's own user id are ignored once that id is known.
62
+
63
+ Direct-room detection uses SDK DM hints, joined-member counts and `m.room.member` state flags. Disabling `detectDirectRooms` classifies inbound conversations as groups. Outbound text blocks are sent as `m.text` messages to the room id. Typing indicators call the SDK's `setTyping` method; errors are ignored.
64
+
65
+ ## Notes
66
+
67
+ Sending writes messages to Matrix rooms. Activation starts sync and enables automatic room joining through the SDK mixin. It also sets the SDK's global `LogService` level to `LogLevel.ERROR`. Sync storage and the direct-room caches are held in memory. DM hints and member counts use `30000` ms cache intervals. Typing requests use a `10000` ms timeout.
68
+
69
+ Missing homeserver URL or access token causes a factory error. Sending requires an initialized client, a nonempty room id and nonempty text. Startup failures are recorded in connection status and rethrown. Shutdown stops the client and clears caches and handlers. Outbound replies and rich formatting are not added by the send implementation.
70
+
71
+ Node.js requirement: `>=22`.
72
+
73
+ ## License
74
+
75
+ Apache-2.0
package/manifest.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
3
3
  "id": "com.framers.channels.matrix",
4
4
  "name": "Matrix Channel Extension",
5
- "version": "0.1.4",
5
+ "version": "0.1.5",
6
6
  "description": "Matrix/Element via matrix-bot-sdk — decentralized, federated messaging.",
7
7
  "categories": ["channel", "communication"],
8
8
  "platforms": ["matrix"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@framers/agentos-ext-channel-matrix",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Matrix/Element messaging channel adapter for AgentOS (matrix-bot-sdk)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "@types/node": "^20.0.0",
31
31
  "typescript": "^5.0.0",
32
32
  "vitest": "^3.2.7",
33
- "@framers/agentos": "^0.13.40"
33
+ "@framers/agentos": "^0.13.47"
34
34
  },
35
35
  "engines": {
36
36
  "node": ">=22"