@hybrd/xmtp 1.3.1 → 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.
Files changed (38) hide show
  1. package/README.md +41 -7
  2. package/dist/index.cjs +415 -3085
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +12 -828
  5. package/dist/index.d.ts +12 -828
  6. package/dist/index.js +416 -3056
  7. package/dist/index.js.map +1 -1
  8. package/package.json +18 -5
  9. package/src/client.ts +23 -135
  10. package/src/index.ts +28 -81
  11. package/src/index.ts.old +145 -0
  12. package/src/lib/jwt.ts +55 -23
  13. package/src/lib/{message-listener.test.ts → message-listener.test.ts.old} +1 -1
  14. package/src/lib/subjects.ts +6 -5
  15. package/src/plugin.filters.test.ts +158 -0
  16. package/src/plugin.ts +456 -23
  17. package/src/resolver/address-resolver.ts +217 -211
  18. package/src/resolver/basename-resolver.ts +6 -5
  19. package/src/resolver/ens-resolver.ts +15 -14
  20. package/src/resolver/resolver.ts +3 -2
  21. package/src/resolver/xmtp-resolver.ts +10 -9
  22. package/src/{service-client.ts → service-client.ts.old} +26 -3
  23. package/src/types.ts +9 -157
  24. package/src/types.ts.old +157 -0
  25. package/.cache/tsbuildinfo.json +0 -1
  26. package/.turbo/turbo-build.log +0 -45
  27. package/.turbo/turbo-lint$colon$fix.log +0 -6
  28. package/.turbo/turbo-typecheck.log +0 -5
  29. package/biome.jsonc +0 -4
  30. package/scripts/generate-keys.ts +0 -25
  31. package/scripts/refresh-identity.ts +0 -119
  32. package/scripts/register-wallet.ts +0 -95
  33. package/scripts/revoke-all-installations.ts +0 -91
  34. package/scripts/revoke-installations.ts +0 -94
  35. package/src/endpoints.ts +0 -306
  36. package/tsconfig.json +0 -9
  37. package/tsup.config.ts +0 -14
  38. /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 | Description | Default |
156
- | --------------------- | ---------------------------------------- | --------------------------------------- |
157
- | `XMTP_STORAGE_PATH` | Custom path for XMTP database storage | `.data/xmtp` (relative to project root) |
158
- | `XMTP_WALLET_KEY` | Private key for XMTP wallet | Required |
159
- | `XMTP_ENCRYPTION_KEY` | Encryption key for database | Required for persistent mode |
160
- | `XMTP_ENV` | XMTP environment (`dev` or `production`) | `dev` |
161
- | `PROJECT_ROOT` | Override project root path | Auto-detected |
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