@opentiny/tiny-robot-cli 0.4.2 → 0.5.2-alpha.11
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/README.md +10 -0
- package/bin/commands/add.js +106 -33
- package/bin/utils.js +4 -0
- package/package.json +9 -2
- package/templates/basic/package.json +3 -3
- package/templates/basic/src/models.ts +5 -5
- package/templates/chat/.env.example +4 -0
- package/templates/chat/README.md +36 -0
- package/templates/chat/index.html +12 -0
- package/templates/chat/package.json +28 -0
- package/templates/chat/src/TinyRobotChat.vue +88 -27
- package/templates/chat/src/components/ComposerTools.vue +99 -0
- package/templates/chat/src/components/WindowHeader.vue +192 -0
- package/templates/chat/src/composables/useWindow.ts +83 -0
- package/templates/chat/src/config/chat-runtime.ts +57 -0
- package/templates/chat/src/config/chat-ui.ts +289 -0
- package/templates/chat/src/index.css +116 -0
- package/templates/chat/src/main.ts +7 -0
- package/templates/chat/tsconfig.app.json +13 -0
- package/templates/chat/tsconfig.json +7 -0
- package/templates/chat/tsconfig.node.json +19 -0
- package/templates/chat/vite.config.ts +16 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
font-family:
|
|
3
|
+
Inter,
|
|
4
|
+
-apple-system,
|
|
5
|
+
BlinkMacSystemFont,
|
|
6
|
+
'Segoe UI',
|
|
7
|
+
sans-serif;
|
|
8
|
+
color: #1f2329;
|
|
9
|
+
}
|
|
10
|
+
* {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
}
|
|
13
|
+
html,
|
|
14
|
+
body,
|
|
15
|
+
#app {
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
min-height: 0;
|
|
19
|
+
margin: 0;
|
|
20
|
+
}
|
|
21
|
+
body {
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
}
|
|
24
|
+
.chat-add-app {
|
|
25
|
+
position: relative;
|
|
26
|
+
container-type: inline-size;
|
|
27
|
+
display: flex;
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 100%;
|
|
30
|
+
min-width: 0;
|
|
31
|
+
min-height: 0;
|
|
32
|
+
}
|
|
33
|
+
.chat-add-launcher {
|
|
34
|
+
position: fixed;
|
|
35
|
+
right: 24px;
|
|
36
|
+
bottom: 24px;
|
|
37
|
+
z-index: var(--tr-z-index-popover, 1000);
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
width: 56px;
|
|
42
|
+
height: 56px;
|
|
43
|
+
padding: 0;
|
|
44
|
+
border: 0;
|
|
45
|
+
border-radius: 50%;
|
|
46
|
+
background: var(--tr-color-primary);
|
|
47
|
+
color: #fff;
|
|
48
|
+
box-shadow: 0 8px 24px rgb(0 0 0 / 20%);
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
.chat-add-launcher:hover {
|
|
52
|
+
background: var(--tr-color-primary-hover);
|
|
53
|
+
}
|
|
54
|
+
.chat-add-launcher:focus-visible {
|
|
55
|
+
outline: 2px solid var(--tr-color-primary);
|
|
56
|
+
outline-offset: 3px;
|
|
57
|
+
}
|
|
58
|
+
.chat-add-window {
|
|
59
|
+
container-type: inline-size;
|
|
60
|
+
--tr-layout-bg-default: #f5f5f7;
|
|
61
|
+
--tr-chat-ui-header-bg: #f5f5f7;
|
|
62
|
+
--tr-chat-ui-main-bg: #f5f5f7;
|
|
63
|
+
--tr-chat-ui-footer-bg: #f5f5f7;
|
|
64
|
+
--tr-suggestion-popover-width: min(440px, calc(100cqw - 16px));
|
|
65
|
+
width: 100%;
|
|
66
|
+
min-width: 0;
|
|
67
|
+
min-height: 0;
|
|
68
|
+
}
|
|
69
|
+
.chat-add-window .tr-welcome {
|
|
70
|
+
box-sizing: border-box;
|
|
71
|
+
width: 100%;
|
|
72
|
+
padding: 24px 24px 0;
|
|
73
|
+
}
|
|
74
|
+
.chat-add-window .tr-welcome__title-wrapper {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
}
|
|
79
|
+
.chat-add-window .tr-prompts {
|
|
80
|
+
--tr-prompts-gap: 16px;
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
width: 100%;
|
|
83
|
+
padding: 16px 24px;
|
|
84
|
+
}
|
|
85
|
+
.chat-add-window .prompt-item {
|
|
86
|
+
flex: 0 0 calc((100% - 16px) / 2);
|
|
87
|
+
box-sizing: border-box;
|
|
88
|
+
min-width: 0;
|
|
89
|
+
}
|
|
90
|
+
.chat-add-window--floating {
|
|
91
|
+
border-radius: var(--tr-layout-floating-radius);
|
|
92
|
+
box-shadow: var(--tr-layout-floating-shadow);
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
}
|
|
95
|
+
.chat-add-window--fullscreen {
|
|
96
|
+
border-radius: 0;
|
|
97
|
+
box-shadow: none;
|
|
98
|
+
}
|
|
99
|
+
@container (max-width: 519px) {
|
|
100
|
+
.chat-add-launcher {
|
|
101
|
+
right: 16px;
|
|
102
|
+
bottom: 16px;
|
|
103
|
+
}
|
|
104
|
+
.chat-add-window .prompt-item {
|
|
105
|
+
flex-basis: 100%;
|
|
106
|
+
}
|
|
107
|
+
.chat-add-window .tr-welcome {
|
|
108
|
+
padding-inline: 12px;
|
|
109
|
+
}
|
|
110
|
+
.chat-add-window .tr-prompts {
|
|
111
|
+
padding-inline: 12px;
|
|
112
|
+
}
|
|
113
|
+
.chat-add-window .tr-bubble__avatar {
|
|
114
|
+
display: none;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
5
|
+
"types": ["vite/client"],
|
|
6
|
+
"allowArbitraryExtensions": true,
|
|
7
|
+
"noUnusedLocals": true,
|
|
8
|
+
"noUnusedParameters": true,
|
|
9
|
+
"erasableSyntaxOnly": true,
|
|
10
|
+
"noFallthroughCasesInSwitch": true
|
|
11
|
+
},
|
|
12
|
+
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "es2023",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"types": ["node"],
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"module": "nodenext",
|
|
9
|
+
"allowImportingTsExtensions": true,
|
|
10
|
+
"verbatimModuleSyntax": true,
|
|
11
|
+
"moduleDetection": "force",
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"noUnusedLocals": true,
|
|
14
|
+
"noUnusedParameters": true,
|
|
15
|
+
"erasableSyntaxOnly": true,
|
|
16
|
+
"noFallthroughCasesInSwitch": true
|
|
17
|
+
},
|
|
18
|
+
"include": ["vite.config.ts"]
|
|
19
|
+
}
|
|
@@ -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
|
+
})
|