Skip to content

Commit e0468f5

Browse files
committed
fix: address CodeRabbit review comments on agent template
- Fix .ts → .tsx file extension in README LLM example section - Capitalize 'Markdown' in ctx.reply API table - Add 'text' language specifier to project structure code fence - Indent code block under ordered list item 1 for markdown parsers - Add blank line before return in layout.tsx and page.tsx templates - Consolidate duplicate zod dependency blocks into single condition Made-with: Cursor
1 parent 1ba8e28 commit e0468f5

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

packages/novu/src/commands/init/templates/app-agent/ts/README-template.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ A conversational AI agent powered by [Novu](https://novu.co) and [Next.js](https
66

77
1. Start the development server:
88

9-
```bash
10-
npm run dev
11-
```
9+
```bash
10+
npm run dev
11+
```
1212

1313
2. Connect a chat platform in the [Novu Dashboard](https://dashboard.novu.co).
1414

@@ -18,7 +18,7 @@ Your agent is served at `/api/novu` and handles incoming messages via the Novu B
1818

1919
## Project Structure
2020

21-
```
21+
```text
2222
app/
2323
api/novu/route.ts → Bridge endpoint serving your agent
2424
novu/agents/
@@ -38,14 +38,14 @@ Your agent handler receives a context object with:
3838
| `ctx.history` | Recent conversation history |
3939
| `ctx.subscriber` | Resolved subscriber info |
4040
| `ctx.platform` | Source platform (slack, teams, whatsapp) |
41-
| `ctx.reply(content)` | Send a reply (text, markdown, or Card) |
41+
| `ctx.reply(content)` | Send a reply (text, Markdown, or Card) |
4242
| `ctx.metadata.set(k, v)` | Set conversation metadata |
4343
| `ctx.resolve(summary?)` | Mark conversation as resolved |
4444
| `ctx.trigger(workflowId)` | Trigger a Novu workflow |
4545

4646
## Wiring Up Your LLM
4747

48-
Replace the demo handler in `app/novu/agents/support-agent.ts` with your LLM call:
48+
Replace the demo handler in `app/novu/agents/support-agent.tsx` with your LLM call:
4949

5050
```typescript
5151
onMessage: async (ctx) => {

packages/novu/src/commands/init/templates/app-agent/ts/app/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default function RootLayout({
1111
}: Readonly<{
1212
children: React.ReactNode;
1313
}>) {
14+
1415
return (
1516
<html lang="en">
1617
<body>{children}</body>

packages/novu/src/commands/init/templates/app-agent/ts/app/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import styles from './page.module.css';
22

33
export default function Home() {
4+
45
return (
56
<main className={styles.main}>
67
<div className={styles.container}>

packages/novu/src/commands/init/templates/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,9 @@ export const installTemplate = async ({
224224
'@react-email/components': '0.0.18',
225225
'@react-email/tailwind': '0.0.18',
226226
};
227-
228-
packageJson.dependencies = {
229-
...packageJson.dependencies,
230-
zod: '^3.23.8',
231-
'zod-to-json-schema': '^3.23.1',
232-
};
233227
}
234228

235-
if (isAgentTemplate) {
229+
if (template === TemplateTypeEnum.APP_REACT_EMAIL || isAgentTemplate) {
236230
packageJson.dependencies = {
237231
...packageJson.dependencies,
238232
zod: '^3.23.8',

0 commit comments

Comments
 (0)