@hybrd/xmtp 1.3.2 → 1.4.0
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 +41 -7
- package/dist/index.cjs +415 -3085
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -828
- package/dist/index.d.ts +12 -828
- package/dist/index.js +416 -3056
- package/dist/index.js.map +1 -1
- package/package.json +18 -5
- package/src/client.ts +23 -135
- package/src/index.ts +28 -81
- package/src/index.ts.old +145 -0
- package/src/lib/jwt.ts +45 -13
- package/src/lib/{message-listener.test.ts → message-listener.test.ts.old} +1 -1
- package/src/lib/subjects.ts +6 -5
- package/src/plugin.filters.test.ts +158 -0
- package/src/plugin.ts +456 -23
- package/src/resolver/address-resolver.ts +217 -211
- package/src/resolver/basename-resolver.ts +6 -5
- package/src/resolver/ens-resolver.ts +15 -14
- package/src/resolver/resolver.ts +3 -2
- package/src/resolver/xmtp-resolver.ts +10 -9
- package/src/{service-client.ts → service-client.ts.old} +26 -3
- package/src/types.ts +9 -157
- package/src/types.ts.old +157 -0
- package/.cache/tsbuildinfo.json +0 -1
- package/.turbo/turbo-build.log +0 -45
- package/.turbo/turbo-lint$colon$fix.log +0 -6
- package/.turbo/turbo-typecheck.log +0 -5
- package/biome.jsonc +0 -4
- package/scripts/generate-keys.ts +0 -25
- package/scripts/refresh-identity.ts +0 -119
- package/scripts/register-wallet.ts +0 -95
- package/scripts/revoke-all-installations.ts +0 -91
- package/scripts/revoke-installations.ts +0 -94
- package/src/endpoints.ts +0 -306
- package/tsconfig.json +0 -9
- package/tsup.config.ts +0 -14
- /package/src/lib/{message-listener.ts → message-listener.ts.old} +0 -0
package/README.md
CHANGED
|
@@ -2,6 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|
This package provides an enhanced XMTP client with robust connection management, retry logic, and health monitoring capabilities.
|
|
4
4
|
|
|
5
|
+
## Links
|
|
6
|
+
|
|
7
|
+
- Main repo: [github.com/ian/hybrid](https://github.com/ian/hybrid)
|
|
8
|
+
- Website & docs: [hybrid.dev](https://hybrid.dev)
|
|
9
|
+
|
|
10
|
+
### XMTP Plugin Filters
|
|
11
|
+
|
|
12
|
+
You can scope which messages are processed by providing XMTP Agent SDK filters to the plugin. These are the same built-in filters and combinators documented in the Agent SDK.
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { XMTPPlugin } from "@hybrd/xmtp"
|
|
16
|
+
import { filter } from "hybrid"
|
|
17
|
+
|
|
18
|
+
// As a standalone plugin instance
|
|
19
|
+
const xmtp = XMTPPlugin({
|
|
20
|
+
filters: [
|
|
21
|
+
filter.isText,
|
|
22
|
+
filter.not(filter.fromSelf),
|
|
23
|
+
filter.startsWith("@agent")
|
|
24
|
+
]
|
|
25
|
+
})
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
When using the Hybrid server `listen()` helper, pass `filters` directly (the helper wires them into `XMTPPlugin` under the hood):
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
await agent.listen({
|
|
32
|
+
port: process.env.PORT || "8454",
|
|
33
|
+
filters: [filter.isText, filter.startsWith("@agent")]
|
|
34
|
+
})
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
See the Agent SDK documentation for all available filters and the `withFilter` helper: https://github.com/xmtp/xmtp-js/tree/main/sdks/agent-sdk#3-builtin-filters
|
|
38
|
+
|
|
5
39
|
## 🆙 Upgraded Features
|
|
6
40
|
|
|
7
41
|
- **XMTP Node SDK**: Upgraded to `^3.1.0` (latest version)
|
|
@@ -152,13 +186,13 @@ Your **QStash-based webhook system** already provides superior reliability compa
|
|
|
152
186
|
|
|
153
187
|
### Environment Variables
|
|
154
188
|
|
|
155
|
-
| Variable
|
|
156
|
-
|
|
|
157
|
-
| `XMTP_STORAGE_PATH`
|
|
158
|
-
| `XMTP_WALLET_KEY`
|
|
159
|
-
| `
|
|
160
|
-
| `XMTP_ENV`
|
|
161
|
-
| `PROJECT_ROOT`
|
|
189
|
+
| Variable | Description | Default |
|
|
190
|
+
| ------------------------ | ---------------------------------------- | --------------------------------------- |
|
|
191
|
+
| `XMTP_STORAGE_PATH` | Custom path for XMTP database storage | `.data/xmtp` (relative to project root) |
|
|
192
|
+
| `XMTP_WALLET_KEY` | Private key for XMTP wallet | Required |
|
|
193
|
+
| `XMTP_DB_ENCRYPTION_KEY` | Encryption key for database | Required for persistent mode |
|
|
194
|
+
| `XMTP_ENV` | XMTP environment (`dev` or `production`) | `dev` |
|
|
195
|
+
| `PROJECT_ROOT` | Override project root path | Auto-detected |
|
|
162
196
|
|
|
163
197
|
### Connection Configuration
|
|
164
198
|
|