towns-agent 3.4.0 → 4.0.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "towns-agent",
3
3
  "description": "CLI for creating and managing Towns Protocol bot projects",
4
- "version": "3.4.0",
4
+ "version": "4.0.0",
5
5
  "author": "Towns Protocol",
6
6
  "scripts": {
7
7
  "build": "tsup",
@@ -29,13 +29,13 @@
29
29
  "zod": "^4.3.6"
30
30
  },
31
31
  "devDependencies": {
32
- "@towns-labs/contracts": "^3.4.0",
33
- "@towns-labs/encryption": "^3.4.0",
34
- "@towns-labs/proto": "^3.4.0",
35
- "@towns-labs/relayer-client": "^3.4.0",
36
- "@towns-labs/sdk": "^3.4.0",
37
- "@towns-labs/sdk-crypto": "^3.4.0",
38
- "@towns-labs/utils": "^3.4.0",
32
+ "@towns-labs/contracts": "^4.0.0",
33
+ "@towns-labs/encryption": "^4.0.0",
34
+ "@towns-labs/proto": "^4.0.0",
35
+ "@towns-labs/relayer-client": "^4.0.0",
36
+ "@towns-labs/sdk": "^4.0.0",
37
+ "@towns-labs/sdk-crypto": "^4.0.0",
38
+ "@towns-labs/utils": "^4.0.0",
39
39
  "@types/cross-spawn": "^6.0.6",
40
40
  "@types/minimist": "^1.2.5",
41
41
  "@types/node": "^20.14.8",
@@ -102,14 +102,14 @@ bot.onMessage(async (handler, event) => {
102
102
  **Setup:**
103
103
  ```typescript
104
104
  // 1. src/commands.ts
105
- import type { AgentCommand } from '@towns-labs/agent'
105
+ import type { AgentCommand } from '@towns-labs/app-framework'
106
106
 
107
107
  export const commands = [
108
108
  { name: "help", description: "Show help" }
109
109
  ] as const satisfies AgentCommand[]
110
110
 
111
111
  // 2. Initialize
112
- const bot = await makeTownsAgent(privateData, { commands })
112
+ const bot = await makeTownsApp(privateData, { commands })
113
113
 
114
114
  // 3. Register
115
115
  bot.onSlashCommand("help", async (handler, event) => {
@@ -1,6 +1,6 @@
1
1
  # Towns Agent
2
2
 
3
- A [Towns Protocol](https://towns.com) agent built with [`@towns-labs/agent`](https://www.npmjs.com/package/@towns-labs/agent).
3
+ A [Towns Protocol](https://towns.com) agent built with [`@towns-labs/app-framework`](https://www.npmjs.com/package/@towns-labs/app-framework).
4
4
 
5
5
  ## Getting Started
6
6
 
@@ -70,7 +70,7 @@ src/
70
70
  ```
71
71
 
72
72
  - **`commands.ts`** — Define slash commands that appear in autocomplete.
73
- - **`index.ts`** — Initialize the agent with `makeTownsAgent` and register event handlers (`onMessage`, `onSlashCommand`, etc.).
73
+ - **`index.ts`** — Initialize the agent with `makeTownsApp` and register event handlers (`onMessage`, `onSlashCommand`, etc.).
74
74
 
75
75
  ## Scripts
76
76
 
@@ -92,4 +92,4 @@ bunx towns-agent update
92
92
  ## Resources
93
93
 
94
94
  - [AGENTS.md](./AGENTS.md) — API reference for event handlers, payloads, and handler methods
95
- - [@towns-labs/agent on npm](https://www.npmjs.com/package/@towns-labs/agent)
95
+ - [@towns-labs/app-framework on npm](https://www.npmjs.com/package/@towns-labs/app-framework)
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@connectrpc/connect-node": "^2.1.0",
18
- "@towns-labs/agent": "workspace:^",
18
+ "@towns-labs/app-framework": "workspace:^",
19
19
  "@towns-labs/proto": "workspace:^",
20
20
  "dotenv": "^16.4.5",
21
21
  "hono": "^4.11.7",
@@ -1,4 +1,4 @@
1
- import type { AgentCommand } from "@towns-labs/agent"
1
+ import type { AgentCommand } from "@towns-labs/app-framework"
2
2
 
3
3
  // Those commands will be registered to the bot as soon as the bot is initialized
4
4
  // and will be available in the slash command autocomplete.
@@ -1,8 +1,8 @@
1
1
  import "dotenv/config"
2
- import { makeTownsAgent } from "@towns-labs/agent"
2
+ import { makeTownsApp } from "@towns-labs/app-framework"
3
3
  import commands from "./commands"
4
4
 
5
- const bot = await makeTownsAgent(
5
+ const bot = await makeTownsApp(
6
6
  process.env.APP_PRIVATE_DATA!,
7
7
  { jwtSecret: process.env.JWT_SECRET, commands },
8
8
  )