@opentiny/tiny-robot-cli 0.4.2-alpha.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.
Files changed (36) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +21 -0
  3. package/bin/cli.js +187 -0
  4. package/package.json +37 -0
  5. package/templates/basic/.env.example +2 -0
  6. package/templates/basic/README.md +45 -0
  7. package/templates/basic/index.html +13 -0
  8. package/templates/basic/package.json +29 -0
  9. package/templates/basic/public/favicon.ico +0 -0
  10. package/templates/basic/public/modelcontextprotocol.png +0 -0
  11. package/templates/basic/src/App.vue +130 -0
  12. package/templates/basic/src/components/ChatList.vue +82 -0
  13. package/templates/basic/src/components/ChatSender.vue +125 -0
  14. package/templates/basic/src/components/ConversationHistory.vue +136 -0
  15. package/templates/basic/src/components/HistoryDrawerButton.vue +43 -0
  16. package/templates/basic/src/components/McpServerPickerButton.vue +278 -0
  17. package/templates/basic/src/components/ThemeToggleButton.vue +44 -0
  18. package/templates/basic/src/components/icons/IconDeepThink.vue +29 -0
  19. package/templates/basic/src/components/icons/IconModelAliyunBailian.vue +51 -0
  20. package/templates/basic/src/components/icons/IconModelDeepseek.vue +29 -0
  21. package/templates/basic/src/components/icons/IconMoon.vue +29 -0
  22. package/templates/basic/src/components/icons/IconPlugin.vue +29 -0
  23. package/templates/basic/src/components/icons/IconSun.vue +35 -0
  24. package/templates/basic/src/components/icons/IconWebSearch.vue +36 -0
  25. package/templates/basic/src/components/icons/index.ts +7 -0
  26. package/templates/basic/src/composables/useChat.ts +129 -0
  27. package/templates/basic/src/composables/useMcp.ts +170 -0
  28. package/templates/basic/src/composables/useModel.ts +82 -0
  29. package/templates/basic/src/main.ts +7 -0
  30. package/templates/basic/src/mcpServers.ts +40 -0
  31. package/templates/basic/src/models.ts +81 -0
  32. package/templates/basic/src/style.css +21 -0
  33. package/templates/basic/tsconfig.app.json +16 -0
  34. package/templates/basic/tsconfig.json +7 -0
  35. package/templates/basic/tsconfig.node.json +26 -0
  36. package/templates/basic/vite.config.ts +16 -0
@@ -0,0 +1,81 @@
1
+ import { type Component } from 'vue'
2
+ import { IconModelAliyunBailian, IconModelDeepseek } from './components/icons'
3
+
4
+ export interface ModelCapabilities {
5
+ thinking?: Record<string, unknown> | false
6
+ search?: Record<string, unknown> | false
7
+ }
8
+
9
+ export interface ModelConfigItem {
10
+ name: string
11
+ model: string
12
+ capabilities?: ModelCapabilities
13
+ }
14
+
15
+ export interface ProviderModelConfig {
16
+ apiUrl: string
17
+ icon: Component
18
+ apiKey?: string
19
+ models: ModelConfigItem[]
20
+ }
21
+
22
+ export const ModelConfigs: Record<string, ProviderModelConfig> = {
23
+ aliyun: {
24
+ apiUrl: 'https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions',
25
+ icon: IconModelAliyunBailian,
26
+ apiKey: import.meta.env.VITE_ALIYUN_DASHSCOPE_KEY,
27
+ models: [
28
+ {
29
+ name: 'Qwen Flash',
30
+ model: 'qwen-flash',
31
+ capabilities: {
32
+ thinking: {
33
+ enable_thinking: true,
34
+ },
35
+ search: {
36
+ enable_search: true,
37
+ },
38
+ },
39
+ },
40
+ {
41
+ name: 'Qwen Plus',
42
+ model: 'qwen-plus',
43
+ capabilities: {
44
+ thinking: {
45
+ enable_thinking: true,
46
+ },
47
+ search: {
48
+ enable_search: true,
49
+ },
50
+ },
51
+ },
52
+ {
53
+ name: 'Qwen Max',
54
+ model: 'qwen-max',
55
+ capabilities: {
56
+ thinking: {
57
+ enable_thinking: true,
58
+ },
59
+ search: {
60
+ enable_search: true,
61
+ },
62
+ },
63
+ },
64
+ ],
65
+ },
66
+ deepseek: {
67
+ apiUrl: 'https://api.deepseek.com/v1',
68
+ icon: IconModelDeepseek,
69
+ apiKey: import.meta.env.VITE_DEEPSEEK_API_KEY,
70
+ models: [
71
+ {
72
+ name: 'DeepSeek Chat',
73
+ model: 'deepseek-chat',
74
+ },
75
+ {
76
+ name: 'DeepSeek Reasoner',
77
+ model: 'deepseek-reasoner',
78
+ },
79
+ ],
80
+ },
81
+ }
@@ -0,0 +1,21 @@
1
+ :root {
2
+ font-family:
3
+ Inter,
4
+ -apple-system,
5
+ BlinkMacSystemFont,
6
+ 'Segoe UI',
7
+ sans-serif;
8
+ color: var(--tr-text-primary);
9
+ }
10
+
11
+ * {
12
+ box-sizing: border-box;
13
+ }
14
+
15
+ body {
16
+ margin: 0;
17
+ }
18
+
19
+ #app {
20
+ height: 100vh;
21
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "extends": "@vue/tsconfig/tsconfig.dom.json",
3
+ "compilerOptions": {
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
+ "types": ["vite/client"],
6
+
7
+ /* Linting */
8
+ "strict": true,
9
+ "noUnusedLocals": true,
10
+ "noUnusedParameters": true,
11
+ "erasableSyntaxOnly": true,
12
+ "noFallthroughCasesInSwitch": true,
13
+ "noUncheckedSideEffectImports": true
14
+ },
15
+ "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
16
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.app.json" },
5
+ { "path": "./tsconfig.node.json" }
6
+ ]
7
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "ES2023",
5
+ "lib": ["ES2023"],
6
+ "module": "ESNext",
7
+ "types": ["node"],
8
+ "skipLibCheck": true,
9
+
10
+ /* Bundler mode */
11
+ "moduleResolution": "bundler",
12
+ "allowImportingTsExtensions": true,
13
+ "verbatimModuleSyntax": true,
14
+ "moduleDetection": "force",
15
+ "noEmit": true,
16
+
17
+ /* Linting */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "erasableSyntaxOnly": true,
22
+ "noFallthroughCasesInSwitch": true,
23
+ "noUncheckedSideEffectImports": true
24
+ },
25
+ "include": ["vite.config.ts"]
26
+ }
@@ -0,0 +1,16 @@
1
+ import { defineConfig } from 'vite'
2
+ import vue from '@vitejs/plugin-vue'
3
+
4
+ // https://vite.dev/config/
5
+ export default defineConfig({
6
+ plugins: [vue()],
7
+ server: {
8
+ proxy: {
9
+ '/modelcontextprotocol-mcp': {
10
+ target: 'https://modelcontextprotocol.io/mcp',
11
+ changeOrigin: true,
12
+ rewrite: (path) => path.replace(/^\/modelcontextprotocol-mcp/, ''),
13
+ },
14
+ },
15
+ },
16
+ })