@templmf/temp-solf-lmf 0.0.55 → 0.0.56

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 (87) hide show
  1. package/package.json +1 -1
  2. package//345/242/236/351/207/217/351/234/200/346/261/202prompt +72 -0
  3. package/guanwang/README.md +0 -95
  4. package/guanwang/docs/changelog.md +0 -145
  5. package/guanwang/docs/doc-maintenance.md +0 -229
  6. package/guanwang/docs/product.md +0 -181
  7. package/guanwang/docs/test-cases.md +0 -395
  8. package/guanwang/docs/usage.md +0 -291
  9. package/guanwang/env.example +0 -27
  10. package/guanwang/index.html +0 -13
  11. package/guanwang/package-lock.json +0 -3825
  12. package/guanwang/package.json +0 -32
  13. package/guanwang/public/favicon.svg +0 -4
  14. package/guanwang/public/react-runtime/babel.min.js +0 -4
  15. package/guanwang/public/react-runtime/react-dom.min.js +0 -267
  16. package/guanwang/public/react-runtime/react.min.js +0 -31
  17. package/guanwang/public/vue-repl-assets/compiler-sfc.esm-browser.js +0 -50795
  18. package/guanwang/public/vue-repl-assets/runtime-dom.esm-browser.js +0 -12758
  19. package/guanwang/public/vue-repl-assets/server-renderer.esm-browser.js +0 -8600
  20. package/guanwang/public/vue-repl-assets/vue.esm-browser.js +0 -18672
  21. package/guanwang/src/App.vue +0 -61
  22. package/guanwang/src/chat-sdk/core/components/ChatBox.vue +0 -305
  23. package/guanwang/src/chat-sdk/core/components/ChatSidebar.vue +0 -84
  24. package/guanwang/src/chat-sdk/core/components/InputBar.vue +0 -354
  25. package/guanwang/src/chat-sdk/core/components/MessageBubble.vue +0 -703
  26. package/guanwang/src/chat-sdk/core/useTheme.js +0 -31
  27. package/guanwang/src/chat-sdk/features/artifact/ArtifactCard.vue +0 -172
  28. package/guanwang/src/chat-sdk/features/artifact/ArtifactPanel.vue +0 -963
  29. package/guanwang/src/chat-sdk/features/artifact/index.js +0 -13
  30. package/guanwang/src/chat-sdk/features/artifact/useArtifactStore.js +0 -275
  31. package/guanwang/src/chat-sdk/features/codepreview/CodePreview.vue +0 -523
  32. package/guanwang/src/chat-sdk/features/codepreview/index.js +0 -7
  33. package/guanwang/src/chat-sdk/features/markdown/index.js +0 -13
  34. package/guanwang/src/chat-sdk/features/markdown/useMarkdown.js +0 -724
  35. package/guanwang/src/chat-sdk/features/mermaid/MermaidZoom.vue +0 -254
  36. package/guanwang/src/chat-sdk/features/upload/FileAttachment.vue +0 -142
  37. package/guanwang/src/chat-sdk/features/upload/index.js +0 -17
  38. package/guanwang/src/chat-sdk/features/upload/useFileHandler.js +0 -336
  39. package/guanwang/src/chat-sdk/headless/api/adapters/openai.js +0 -76
  40. package/guanwang/src/chat-sdk/headless/api/chatApi.js +0 -126
  41. package/guanwang/src/chat-sdk/headless/buildSystemPrompt.js +0 -351
  42. package/guanwang/src/chat-sdk/headless/index.js +0 -15
  43. package/guanwang/src/chat-sdk/headless/useChat.js +0 -77
  44. package/guanwang/src/chat-sdk/headless/useChatDB.js +0 -147
  45. package/guanwang/src/chat-sdk/headless/useChatStore.js +0 -529
  46. package/guanwang/src/chat-sdk/index.js +0 -79
  47. package/guanwang/src/chat-sdk/modes/architect.js +0 -27
  48. package/guanwang/src/chat-sdk/modes/ask.js +0 -26
  49. package/guanwang/src/chat-sdk/modes/code.js +0 -25
  50. package/guanwang/src/chat-sdk/modes/index.js +0 -36
  51. package/guanwang/src/chat-sdk/modes/requirements.js +0 -175
  52. package/guanwang/src/chat-sdk/settings/SettingsPanel.vue +0 -170
  53. package/guanwang/src/chat-sdk/settings/index.js +0 -9
  54. package/guanwang/src/chat-sdk/settings/useSettings.js +0 -122
  55. package/guanwang/src/chat-sdk/tools/defaults.js +0 -89
  56. package/guanwang/src/chat-sdk/tools/index.js +0 -16
  57. package/guanwang/src/chat-sdk/tools/parser.js +0 -116
  58. package/guanwang/src/components/CustomCursor.vue +0 -69
  59. package/guanwang/src/components/Footer.vue +0 -24
  60. package/guanwang/src/components/LoginModal.vue +0 -109
  61. package/guanwang/src/components/Navbar.vue +0 -193
  62. package/guanwang/src/components/ThemeToggle.vue +0 -25
  63. package/guanwang/src/composables/useArtifactStore.js +0 -253
  64. package/guanwang/src/composables/useAuth.js +0 -88
  65. package/guanwang/src/composables/useChatDB.js +0 -147
  66. package/guanwang/src/composables/useCountUp.js +0 -24
  67. package/guanwang/src/composables/useFileHandler.js +0 -345
  68. package/guanwang/src/composables/useTheme.js +0 -31
  69. package/guanwang/src/config/api.js +0 -71
  70. package/guanwang/src/main.js +0 -23
  71. package/guanwang/src/router/index.js +0 -23
  72. package/guanwang/src/services/authApi.js +0 -27
  73. package/guanwang/src/services/chatApi.js +0 -66
  74. package/guanwang/src/styles/global.css +0 -478
  75. package/guanwang/src/tracker/analyze.js +0 -73
  76. package/guanwang/src/tracker/config.js +0 -82
  77. package/guanwang/src/tracker/index.js +0 -18
  78. package/guanwang/src/tracker/service.js +0 -102
  79. package/guanwang/src/tracker/useChatTracker.js +0 -179
  80. package/guanwang/src/tracker/useTracker.js +0 -45
  81. package/guanwang/src/views/ChatView.vue +0 -65
  82. package/guanwang/src/views/HomeView.vue +0 -156
  83. package/guanwang/src/views/MarketView.vue +0 -143
  84. package/guanwang/src/views/PracticesView.vue +0 -190
  85. package/guanwang/src/views/SkillsView.vue +0 -129
  86. package/guanwang/temp +0 -19
  87. package/guanwang/vite.config.js +0 -6
@@ -1,354 +0,0 @@
1
- <template>
2
- <div
3
- class="input-wrap"
4
- :class="{ 'is-dragging': isDragging }"
5
- @dragover.prevent="isDragging = true"
6
- @dragleave.prevent="isDragging = false"
7
- @drop.prevent="onDrop"
8
- >
9
- <!-- 附件预览条 -->
10
- <FileAttachment
11
- :attachments="attachments"
12
- @remove="removeAttachment"
13
- />
14
-
15
- <!-- 拖拽提示遮罩 -->
16
- <div v-if="isDragging" class="drop-overlay">
17
- <Paperclip :size="28" />
18
- <span>松开以添加附件</span>
19
- </div>
20
-
21
- <!-- 输入行 -->
22
- <div class="input-row">
23
- <!-- 上传按钮 -->
24
- <el-tooltip content="添加附件(图片/PDF/代码/文档)" placement="top">
25
- <el-button
26
- text
27
- circle
28
- :disabled="isLoading"
29
- class="upload-btn"
30
- :class="{ 'has-files': attachments.length > 0 }"
31
- @click="triggerFileInput"
32
- >
33
- <Paperclip :size="18" />
34
- </el-button>
35
- </el-tooltip>
36
-
37
- <!-- 隐藏的 file input -->
38
- <input
39
- ref="fileInputRef"
40
- type="file"
41
- multiple
42
- :accept="ACCEPT_TYPES"
43
- style="display:none"
44
- @change="onFileChange"
45
- />
46
-
47
- <!-- 文字输入框 -->
48
- <el-input
49
- ref="inputRef"
50
- v-model="input"
51
- type="textarea"
52
- :autosize="{ minRows: 1, maxRows: 4 }"
53
- :placeholder="currentPlaceholder"
54
- resize="none"
55
- style="flex: 1;"
56
- @keydown="onKey"
57
- @paste="onPaste"
58
- />
59
-
60
- <!-- 发送按钮 -->
61
- <el-button
62
- type="primary"
63
- :disabled="!canSend"
64
- :loading="isLoading"
65
- class="send-btn"
66
- @click="send"
67
- >
68
- <Send v-if="!isLoading" :size="18" />
69
- </el-button>
70
- </div>
71
-
72
- <!-- 处理中提示 -->
73
- <div v-if="processingFile" class="processing-bar">
74
- <span class="processing-dot" />
75
- 正在处理附件:{{ processingFile }}...
76
- </div>
77
-
78
- <!-- 模型选择工具栏 -->
79
- <!-- v-if="showModelSelector" -->
80
- <div class="model-bar">
81
- <span class="model-bar__label">模型</span>
82
- <el-select
83
- v-model="localSelectedId"
84
- size="small"
85
- class="model-select"
86
- @change="id => emit('select-model', id)"
87
- >
88
- <el-option
89
- v-for="m in availableModels"
90
- :key="m.id"
91
- :label="m.name"
92
- :value="m.id"
93
- />
94
- </el-select>
95
- </div>
96
- </div>
97
- </template>
98
-
99
- <script setup>
100
- import { ref, computed, onMounted } from 'vue'
101
- import { Send, Paperclip } from 'lucide-vue-next'
102
- import { ElMessage } from 'element-plus'
103
- import FileAttachment from '../../features/upload/FileAttachment.vue'
104
- import { processFile, buildMessageContent, ACCEPT_TYPES, FILE_TYPE_HINT } from '../../features/upload/useFileHandler.js'
105
-
106
- const props = defineProps({
107
- isLoading: { type: Boolean, default: false },
108
- placeholder: { type: String, default: '描述您的需求...' },
109
- autoFocus: { type: Boolean, default: false },
110
- // 模型相关(由 ChatBox 从 chatStore 传入)
111
- availableModels: { type: Array, default: () => [] },
112
- selectedModelId: { type: String, default: '' },
113
- showModelSelector: { type: Boolean, default: false },
114
- })
115
-
116
- const emit = defineEmits(['send', 'select-model'])
117
-
118
- const input = ref('')
119
- const inputRef = ref(null)
120
- const fileInputRef = ref(null)
121
- const attachments = ref([])
122
- const isDragging = ref(false)
123
- const processingFile = ref('')
124
-
125
- // 本地临时选中(用户在当次会话里临时切换,和 store 双向同步)
126
- // selectedModelId 未传时自动取第一个可用模型,避免选择框空白
127
- const localSelectedId = ref(props.selectedModelId || props.availableModels[0]?.id || '')
128
-
129
- const canSend = computed(() =>
130
- !props.isLoading && (input.value.trim().length > 0 || attachments.value.length > 0)
131
- )
132
-
133
- const currentPlaceholder = computed(() =>
134
- attachments.value.length > 0 ? '描述一下你想对这些文件做什么...' : props.placeholder
135
- )
136
-
137
- onMounted(() => {
138
- if (props.autoFocus) setTimeout(() => inputRef.value?.focus(), 100)
139
- })
140
-
141
- // ── 发送 ──────────────────────────────────────────────────────────
142
- function send() {
143
- if (!canSend.value) return
144
- const text = input.value.trim()
145
- const content = buildMessageContent(text, attachments.value)
146
-
147
- emit('send', {
148
- content,
149
- displayText: text,
150
- // 只有和 store 里的 selectedModelId 不同时才传 override
151
- modelOverride: localSelectedId.value !== props.selectedModelId
152
- ? localSelectedId.value
153
- : undefined,
154
- attachments: attachments.value.map(a => ({
155
- id: a.id,
156
- fileName: a.fileName,
157
- type: a.type,
158
- preview: a.preview,
159
- ext: a.ext,
160
- })),
161
- })
162
-
163
- input.value = ''
164
- attachments.value = []
165
- }
166
-
167
- function onKey(e) {
168
- if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); send() }
169
- }
170
-
171
- // ── 文件处理 ──────────────────────────────────────────────────────
172
- function triggerFileInput() { fileInputRef.value?.click() }
173
-
174
- async function onFileChange(e) {
175
- const files = Array.from(e.target.files || [])
176
- e.target.value = '' // 清空 input 以便同文件可重复选
177
- await addFiles(files)
178
- }
179
-
180
- async function onDrop(e) {
181
- isDragging.value = false
182
- const files = Array.from(e.dataTransfer.files || [])
183
- await addFiles(files)
184
- }
185
-
186
- // 粘贴图片(截图直接粘贴)
187
- async function onPaste(e) {
188
- const items = Array.from(e.clipboardData?.items || [])
189
- // 修复:部分浏览器粘贴截图时 item.type 为空字符串,改为只要 kind==='file' 就尝试处理
190
- const fileItems = items.filter(i => i.kind === 'file')
191
- if (fileItems.length === 0) return
192
- const files = fileItems.map(i => i.getAsFile()).filter(Boolean)
193
- if (files.length === 0) return
194
- e.preventDefault()
195
- await addFiles(files)
196
- }
197
-
198
- async function addFiles(files) {
199
- const MAX_ATTACHMENTS = 5
200
- const remaining = MAX_ATTACHMENTS - attachments.value.length
201
- if (remaining <= 0) {
202
- ElMessage.warning(`最多同时上传 ${MAX_ATTACHMENTS} 个文件`)
203
- return
204
- }
205
-
206
- for (const file of files.slice(0, remaining)) {
207
- processingFile.value = file.name
208
- try {
209
- const att = await processFile(file)
210
- attachments.value.push(att)
211
- } catch (err) {
212
- ElMessage.error(`${file.name}:${err.message}`)
213
- }
214
- }
215
- processingFile.value = ''
216
- }
217
-
218
- function removeAttachment(id) {
219
- attachments.value = attachments.value.filter(a => a.id !== id)
220
- }
221
- </script>
222
-
223
- <style scoped>
224
- .input-wrap {
225
- position: relative;
226
- border-radius: 14px;
227
- border: 1px solid var(--border-default);
228
- background: var(--bg-secondary);
229
- transition: border-color 0.2s, box-shadow 0.2s;
230
- overflow: hidden;
231
- }
232
- .input-wrap:focus-within {
233
- border-color: rgba(26,111,196,0.6);
234
- box-shadow: 0 0 0 3px rgba(26,111,196,0.08);
235
- }
236
- .input-wrap.is-dragging {
237
- border-color: var(--brand-500);
238
- box-shadow: 0 0 0 3px rgba(26,111,196,0.15);
239
- }
240
-
241
- /* 拖拽遮罩 */
242
- .drop-overlay {
243
- position: absolute; inset: 0; z-index: 10;
244
- background: rgba(26,111,196,0.1);
245
- display: flex; flex-direction: column;
246
- align-items: center; justify-content: center;
247
- gap: 8px; color: var(--brand-400);
248
- font-size: 14px; font-family: Inter, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
249
- pointer-events: none;
250
- }
251
-
252
- /* 输入行 */
253
- .input-row {
254
- display: flex;
255
- align-items: flex-end;
256
- gap: 6px;
257
- padding: 8px 8px 8px 6px;
258
- }
259
-
260
- .upload-btn {
261
- color: var(--text-muted) !important;
262
- transition: color 0.15s !important;
263
- flex-shrink: 0;
264
- margin-bottom: 2px;
265
- }
266
- .upload-btn:hover { color: var(--brand-400) !important; }
267
- .upload-btn.has-files { color: var(--brand-500) !important; }
268
-
269
- .send-btn {
270
- flex-shrink: 0;
271
- width: 44px !important;
272
- height: 44px !important;
273
- border-radius: 10px !important;
274
- padding: 0 !important;
275
- margin-bottom: 2px;
276
- }
277
-
278
- /* 去掉输入框自带边框(改由 .input-wrap 统一管理) */
279
- :deep(.el-textarea__inner) {
280
- border: none !important;
281
- box-shadow: none !important;
282
- background: transparent !important;
283
- border-radius: 0 !important;
284
- padding: 10px 6px !important;
285
- font-size: 14px !important;
286
- min-height: 44px !important;
287
- line-height: 1.5 !important;
288
- font-family: Inter, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif !important;
289
- resize: none !important;
290
- }
291
- :deep(.el-textarea__inner:focus) {
292
- box-shadow: none !important;
293
- }
294
-
295
- /* 处理中提示 */
296
- .processing-bar {
297
- display: flex;
298
- align-items: center;
299
- gap: 7px;
300
- padding: 6px 14px 8px;
301
- font-size: 12px;
302
- font-family: Inter, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
303
- color: var(--text-muted);
304
- border-top: 1px solid var(--border-subtle);
305
- }
306
- .processing-dot {
307
- width: 6px; height: 6px; border-radius: 50%;
308
- background: var(--brand-400);
309
- animation: pulseSlow 1s ease infinite;
310
- }
311
-
312
- /* ── 模型选择栏 ── */
313
- .model-bar {
314
- display: flex;
315
- align-items: center;
316
- gap: 8px;
317
- padding: 5px 12px 7px;
318
- border-top: 1px solid var(--border-subtle);
319
- }
320
- .model-bar__label {
321
- font-size: 11px;
322
- color: var(--text-muted);
323
- flex-shrink: 0;
324
- }
325
- .model-select {
326
- width: 200px;
327
- }
328
- :deep(.model-select .el-input__wrapper) {
329
- background: transparent !important;
330
- box-shadow: none !important;
331
- border: 1px solid var(--border-default) !important;
332
- border-radius: 6px !important;
333
- padding: 0 8px !important;
334
- height: 26px !important;
335
- font-size: 11px !important;
336
- font-family: 'Cascadia Code', 'Consolas', monospace !important;
337
- transition: border-color 0.15s !important;
338
- }
339
- :deep(.model-select .el-input__wrapper:hover),
340
- :deep(.model-select .el-input__wrapper.is-focus) {
341
- border-color: var(--brand-500) !important;
342
- }
343
- :deep(.model-select .el-input__inner) {
344
- font-size: 11px !important;
345
- font-family: 'Cascadia Code', 'Consolas', monospace !important;
346
- color: var(--text-secondary) !important;
347
- height: 24px !important;
348
- line-height: 24px !important;
349
- }
350
- :deep(.model-select .el-select__caret) {
351
- color: var(--text-muted) !important;
352
- font-size: 11px !important;
353
- }
354
- </style>