@xmtp/agent-sdk 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 XMTP (xmtp.org)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # XMTP Agent SDK for Node
2
+
3
+ This package provides the XMTP Agent SDK for Node.
4
+
5
+ To keep up with the latest SDK developments, see the [Issues tab](https://github.com/xmtp/xmtp-js/issues) in this repo.
6
+
7
+ > [!CAUTION]
8
+ > This SDK is in beta status and ready for you to build with in production. Software in this status may change based on feedback.
9
+
10
+ ## Features
11
+
12
+ ### Event-driven architecture
13
+
14
+ Subscribe to specific events and receive only the ones that matter to you using Node's `EventEmitter`:
15
+
16
+ ```ts
17
+ agent.on("message", async (ctx) => {
18
+ await ctx.conversation.send("Hello!");
19
+ });
20
+ ```
21
+
22
+ ### Middleware support
23
+
24
+ Build flexible middleware pipelines by composing the tools you need (Custom Filters, Telemetry, Analytics, …):
25
+
26
+ ```ts
27
+ const router = new CommandRouter();
28
+
29
+ router.command("/start", async (ctx) => {
30
+ await ctx.conversation.send("👋 Welcome to your XMTP agent!");
31
+ });
32
+
33
+ const agent = new Agent({ client });
34
+ agent.use(router.middleware());
35
+ ```
36
+
37
+ ### Built-in Filters
38
+
39
+ Skip repetitive condition checks with ready-to-use message filters, easily chained through a fluent API:
40
+
41
+ ```ts
42
+ agent.on(
43
+ "message",
44
+ withFilter(filter.and(filter.notFromSelf, filter.textOnly), async (ctx) => {
45
+ await ctx.conversation.send("Hey!");
46
+ }),
47
+ );
48
+ ```
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./core";
2
+ export * from "./utils";
3
+ //# sourceMappingURL=index.js.map
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "author": "XMTP Labs <eng@xmtp.com>",
3
+ "bugs": {
4
+ "url": "https://github.com/xmtp/xmtp-js/issues"
5
+ },
6
+ "dependencies": {
7
+ "@xmtp/content-type-reply": "^2.0.2",
8
+ "@xmtp/node-sdk": "^4.0.3",
9
+ "viem": "^2.31.7"
10
+ },
11
+ "description": "XMTP Agent SDK for interacting with XMTP networks",
12
+ "devDependencies": {
13
+ "@types/node": "^22.16.3",
14
+ "@vitest/coverage-v8": "^3.2.4",
15
+ "tsx": "^4.20.3",
16
+ "typescript": "^5.8.3",
17
+ "vite": "^7.0.4",
18
+ "vite-tsconfig-paths": "^5.1.4",
19
+ "vitest": "^3.2.4"
20
+ },
21
+ "engines": {
22
+ "node": ">=20"
23
+ },
24
+ "files": [
25
+ "dist/src",
26
+ "!dist/**/*.test.*"
27
+ ],
28
+ "homepage": "https://github.com/xmtp/xmtp-js",
29
+ "keywords": [
30
+ "agents",
31
+ "javascript",
32
+ "js",
33
+ "messaging",
34
+ "node",
35
+ "nodejs",
36
+ "typescript",
37
+ "web3",
38
+ "xmtp"
39
+ ],
40
+ "license": "MIT",
41
+ "main": "dist/index.js",
42
+ "name": "@xmtp/agent-sdk",
43
+ "packageManager": "yarn@4.5.0",
44
+ "publishConfig": {
45
+ "access": "public",
46
+ "provenance": true,
47
+ "registry": "https://registry.npmjs.org/"
48
+ },
49
+ "repository": {
50
+ "directory": "sdks/agent-sdk",
51
+ "type": "git",
52
+ "url": "git+https://git@github.com/xmtp/xmtp-js.git"
53
+ },
54
+ "scripts": {
55
+ "build": "yarn clean:dist && tsc -p tsconfig.build.json",
56
+ "clean": "rm -rf .turbo && rm -rf node_modules && yarn clean:dist",
57
+ "clean:dist": "rm -rf dist",
58
+ "dev": "tsx --watch src/main.ts",
59
+ "start": "tsx src/demo.ts",
60
+ "test": "vitest --typecheck",
61
+ "test:cov": "vitest run --coverage",
62
+ "typecheck": "tsc --noEmit"
63
+ },
64
+ "type": "module",
65
+ "version": "0.0.1"
66
+ }