create-tsrouter-app 0.9.6 → 0.9.7

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.
@@ -446,6 +446,6 @@ Use the following commands to start your app:
446
446
  % cd ${options.projectName}
447
447
  % ${startCommand}
448
448
 
449
- Please read README.md for more information on testing, styling, adding routes, react-query, etc.${errorStatement}`);
449
+ Please read the README.md for more information on testing, styling, adding routes, react-query, etc.${errorStatement}`);
450
450
  }
451
451
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-tsrouter-app",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
4
4
  "description": "Tanstack Application Builder",
5
5
  "bin": "./dist/index.js",
6
6
  "type": "module",
package/src/create-app.ts CHANGED
@@ -725,6 +725,6 @@ Use the following commands to start your app:
725
725
  % cd ${options.projectName}
726
726
  % ${startCommand}
727
727
 
728
- Please read README.md for more information on testing, styling, adding routes, react-query, etc.${errorStatement}`)
728
+ Please read the README.md for more information on testing, styling, adding routes, react-query, etc.${errorStatement}`)
729
729
  }
730
730
  }
@@ -10,9 +10,15 @@ export interface Message {
10
10
  content: string
11
11
  }
12
12
 
13
- const SYSTEM_PROMPT = `You are TanStack Chat, an AI assistant using Markdown for clear and structured responses.`
13
+ const SYSTEM_PROMPT = `You are a helpful assistant for a store that sells guitars.
14
14
 
15
- export const genAIResponse = createServerFn({ method: 'GET', response: 'raw' })
15
+ You can use the following tools to help the user:
16
+
17
+ - getGuitars: Get all guitars from the database
18
+ - recommendGuitar: Recommend a guitar to the user
19
+ `
20
+
21
+ export const genAIResponse = createServerFn({ method: 'POST', response: 'raw' })
16
22
  .validator(
17
23
  (d: {
18
24
  messages: Array<Message>
@@ -1,24 +1,28 @@
1
1
  import { experimental_createMCPClient, tool } from 'ai'
2
+ //import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
2
3
  import { z } from 'zod'
3
4
  import guitars from '../data/example-guitars'
4
5
 
5
- // Example of using an MCP server to get tools
6
- // const mcpCient = await experimental_createMCPClient({
6
+ // Example of using an SSE MCP server
7
+ // const mcpClient = await experimental_createMCPClient({
7
8
  // transport: {
8
- // type: 'stdio',
9
+ // type: "sse",
10
+ // url: "http://localhost:8081/sse",
11
+ // },
12
+ // name: "Demo Service",
13
+ // });
14
+
15
+ // Example of using an STDIO MCP server
16
+ // const mcpClient = await experimental_createMCPClient({
17
+ // transport: new StdioClientTransport({
18
+ // command: "node",
9
19
  // args: [
10
- // '--directory',
11
- // '~/mcp/servers/src/sqlite',
12
- // 'run',
13
- // 'mcp-server-sqlite',
14
- // '--db-path',
15
- // '~/sqlite-example/orders.db',
20
+ // "stdio-server.js",
16
21
  // ],
17
- // command: 'uv',
18
- // },
19
- // })
22
+ // }),
23
+ // });
20
24
 
21
- const getProducts = tool({
25
+ const getGuitars = tool({
22
26
  description: 'Get all products from the database',
23
27
  parameters: z.object({}),
24
28
  execute: async () => {
@@ -37,7 +41,7 @@ export default async function getTools() {
37
41
  // const mcpTools = await mcpCient.tools()
38
42
  return {
39
43
  // ...mcpTools,
40
- getProducts,
44
+ getGuitars,
41
45
  recommendGuitar,
42
46
  }
43
47
  }
@@ -2,13 +2,14 @@
2
2
  "dependencies": {
3
3
  "@ai-sdk/anthropic": "^1.1.17",
4
4
  "@ai-sdk/react": "^1.1.23",
5
- "ai": "^4.1.61",
5
+ "ai": "^4.1.65",
6
6
  "highlight.js": "^11.11.1",
7
7
  "react-markdown": "^9.0.1",
8
8
  "rehype-highlight": "^7.0.0",
9
9
  "rehype-raw": "^7.0.0",
10
10
  "rehype-sanitize": "^6.0.0",
11
11
  "remark-gfm": "^4.0.1",
12
- "lucide-react": "^0.475.0"
12
+ "lucide-react": "^0.475.0",
13
+ "zod": "^3.24.2"
13
14
  }
14
15
  }