create-tsrouter-app 0.9.5 → 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.
- package/dist/create-app.js +1 -1
- package/dist/package-manager.js +1 -1
- package/package.json +1 -1
- package/src/create-app.ts +1 -1
- package/src/package-manager.ts +1 -1
- package/templates/react/example/tanchat/assets/src/utils/demo.ai.ts +8 -2
- package/templates/react/example/tanchat/assets/src/utils/demo.tools.ts +18 -14
- package/templates/react/example/tanchat/package.json +3 -2
package/dist/create-app.js
CHANGED
|
@@ -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/dist/package-manager.js
CHANGED
|
@@ -21,7 +21,7 @@ export function packageManagerExecute(environment, packagerManager, pkg, args, c
|
|
|
21
21
|
case 'pnpm':
|
|
22
22
|
return environment.execute('pnpx', [pkg, ...args], cwd);
|
|
23
23
|
case 'bun':
|
|
24
|
-
return environment.execute('bunx', [pkg, ...args], cwd);
|
|
24
|
+
return environment.execute('bunx', ['--bun', pkg, ...args], cwd);
|
|
25
25
|
case 'deno':
|
|
26
26
|
return environment.execute('deno', ['run', `npm:${pkg}`, ...args], cwd);
|
|
27
27
|
default:
|
package/package.json
CHANGED
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
|
}
|
package/src/package-manager.ts
CHANGED
|
@@ -37,7 +37,7 @@ export function packageManagerExecute(
|
|
|
37
37
|
case 'pnpm':
|
|
38
38
|
return environment.execute('pnpx', [pkg, ...args], cwd)
|
|
39
39
|
case 'bun':
|
|
40
|
-
return environment.execute('bunx', [pkg, ...args], cwd)
|
|
40
|
+
return environment.execute('bunx', ['--bun', pkg, ...args], cwd)
|
|
41
41
|
case 'deno':
|
|
42
42
|
return environment.execute('deno', ['run', `npm:${pkg}`, ...args], cwd)
|
|
43
43
|
default:
|
|
@@ -10,9 +10,15 @@ export interface Message {
|
|
|
10
10
|
content: string
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const SYSTEM_PROMPT = `You are
|
|
13
|
+
const SYSTEM_PROMPT = `You are a helpful assistant for a store that sells guitars.
|
|
14
14
|
|
|
15
|
-
|
|
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
|
|
6
|
-
// const
|
|
6
|
+
// Example of using an SSE MCP server
|
|
7
|
+
// const mcpClient = await experimental_createMCPClient({
|
|
7
8
|
// transport: {
|
|
8
|
-
// type:
|
|
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
|
-
//
|
|
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
|
-
//
|
|
18
|
-
//
|
|
19
|
-
// })
|
|
22
|
+
// }),
|
|
23
|
+
// });
|
|
20
24
|
|
|
21
|
-
const
|
|
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
|
-
|
|
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.
|
|
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
|
}
|