sillyspec 3.7.10 → 3.7.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.
@@ -1,100 +1,202 @@
1
1
  import chokidar from 'chokidar'
2
- import { join } from 'path'
2
+ import { join, basename, dirname, sep } from 'path'
3
3
  import { homedir } from 'os'
4
- import { existsSync } from 'fs'
4
+ import { existsSync, readdirSync, realpathSync } from 'fs'
5
5
  import { parseProjectState } from './parser.js'
6
6
 
7
7
  let watcher = null
8
8
  let updateCallback = null
9
9
  let projectStates = new Map()
10
+ export const customScanPaths = new Set()
11
+
12
+ // Directories to exclude (system junk, cache, etc.)
13
+ const excludeDirs = new Set([
14
+ '.Trash', '.cache', '.npm', '.local', '.vscode', 'Library',
15
+ '.git', 'node_modules', '.Trash-*', '.DS_Store', '.config',
16
+ '.cocoapods', '.gem', '.rvm', '.nvm', '.asdf', '.brew',
17
+ 'AppData', 'Application Data', '.cargo', '.rustup',
18
+ '.nuget', '.android', '.gradle', '.m2', '.vscode-server'
19
+ ])
10
20
 
11
21
  /**
12
- * Start watching all .sillyspec directories
13
- * @param {function} callback - Callback function when projects are updated
14
- * @returns {object} The watcher instance
22
+ * Check if directory should be excluded from scanning
23
+ * @param {string} name - Directory name
24
+ * @returns {boolean}
15
25
  */
16
- export function startWatcher(callback) {
17
- if (watcher) {
18
- stopWatcher()
26
+ function shouldExclude(name, cwd) {
27
+ if (excludeDirs.has(name)) return true
28
+ // Check wildcard patterns (like .Trash-*)
29
+ for (const pattern of excludeDirs) {
30
+ if (pattern.includes('*')) {
31
+ const regex = new RegExp('^' + pattern.replace(/\*/g, '.*') + '$')
32
+ if (regex.test(name)) return true
33
+ }
19
34
  }
35
+ // Exclude hidden directories unless it's the cwd basename
36
+ const cwdName = cwd.split(sep).pop() || cwd.split('/').pop() || ''
37
+ if (name.startsWith('.') && name !== cwdName) {
38
+ return true
39
+ }
40
+ return false
41
+ }
20
42
 
21
- updateCallback = callback
22
-
23
- // Discover all .sillyspec directories
43
+ /**
44
+ * Build list of directories to scan
45
+ * @returns {string[]}
46
+ */
47
+ function buildScanDirs() {
24
48
  const home = homedir()
25
49
  const cwd = process.cwd()
26
50
 
27
- // Directories to exclude (system junk, cache, etc.)
28
- const excludeDirs = new Set([
29
- '.Trash', '.cache', '.npm', '.local', '.vscode', 'Library',
30
- '.git', 'node_modules', '.Trash-*', '.DS_Store', '.config',
31
- '.cocoapods', '.gem', '.rvm', '.nvm', '.asdf', '.brew'
32
- ])
33
-
34
- // Helper to check if directory should be excluded
35
- const shouldExclude = (name) => {
36
- // Check exact matches
37
- if (excludeDirs.has(name)) return true
38
- // Check wildcard patterns (like .Trash-*)
39
- for (const pattern of excludeDirs) {
40
- if (pattern.includes('*')) {
41
- const regex = new RegExp('^' + pattern.replace(/\*/g, '.*') + '$')
42
- if (regex.test(name)) return true
43
- }
44
- }
45
- // Exclude hidden directories (starting with .) unless it's the cwd basename
46
- if (name.startsWith('.') && name !== cwd.split('/').pop()) {
47
- return true
48
- }
49
- return false
50
- }
51
+ const scanDirs = new Set()
52
+
53
+ // Always scan cwd and its parent
54
+ scanDirs.add(cwd)
55
+ scanDirs.add(dirname(cwd))
51
56
 
52
- // Build scan directories: cwd + home subdirs + common project locations
53
- const scanDirs = [cwd, home]
54
- const extraDirs = ['Desktop', 'Documents', 'Projects', 'Work', 'Repos', 'Code', 'src', 'dev']
57
+ // Scan parent of parent (2 levels up from cwd) to discover sibling projects
58
+ const parentParent = dirname(dirname(cwd))
59
+ scanDirs.add(parentParent)
60
+
61
+ // Home directory
62
+ scanDirs.add(home)
63
+
64
+ // Common project directories - check both English and Chinese names
65
+ const extraDirs = [
66
+ 'Desktop', '桌面',
67
+ 'Documents', '文档',
68
+ 'Downloads', '下载',
69
+ 'Projects', '项目',
70
+ 'Work', '工作',
71
+ 'Repos', 'Code', 'src', 'dev',
72
+ 'workspace', '工作区'
73
+ ]
55
74
 
56
75
  for (const extra of extraDirs) {
57
76
  const extraPath = join(home, extra)
58
77
  if (existsSync(extraPath)) {
59
- scanDirs.push(extraPath)
78
+ scanDirs.add(extraPath)
79
+ }
80
+ }
81
+
82
+ // Add custom scan paths
83
+ for (const customPath of customScanPaths) {
84
+ if (existsSync(customPath)) {
85
+ scanDirs.add(customPath)
60
86
  }
61
87
  }
62
88
 
63
- const watchPaths = []
89
+ return Array.from(scanDirs)
90
+ }
91
+
92
+ /**
93
+ * Recursively scan a directory for .sillyspec projects
94
+ * @param {string} baseDir - Directory to scan
95
+ * @param {Set} seen - Already seen paths
96
+ * @param {number} maxDepth - Maximum recursion depth
97
+ * @param {number} currentDepth - Current depth
98
+ * @returns {Array} Found projects
99
+ */
100
+ function scanDirectory(baseDir, seen, maxDepth = 2, currentDepth = 0) {
101
+ const cwd = process.cwd()
64
102
  const projects = []
65
- const seen = new Set() // Dedupe by path
66
103
 
67
- for (const baseDir of scanDirs) {
68
- try {
69
- const { readdirSync } = require('fs')
70
- const entries = readdirSync(baseDir, { withFileTypes: true })
104
+ try {
105
+ const entries = readdirSync(baseDir, { withFileTypes: true })
71
106
 
72
- for (const entry of entries) {
73
- if (!entry.isDirectory()) continue
74
- if (shouldExclude(entry.name)) continue
107
+ for (const entry of entries) {
108
+ if (!entry.isDirectory()) continue
109
+ if (shouldExclude(entry.name, cwd)) continue
75
110
 
76
- const dirPath = join(baseDir, entry.name)
111
+ const dirPath = join(baseDir, entry.name)
77
112
 
78
- // Skip if we've already seen this path
79
- if (seen.has(dirPath)) continue
80
- seen.add(dirPath)
113
+ let realPath
114
+ try { realPath = realpathSync(dirPath) } catch { realPath = dirPath }
115
+ const normalizedPath = realPath.toLowerCase()
116
+ if (seen.has(normalizedPath)) continue
117
+ seen.add(normalizedPath)
81
118
 
82
- const sillyspecPath = join(dirPath, '.sillyspec')
119
+ // Check if this dir has .sillyspec
120
+ const sillyspecPath = join(dirPath, '.sillyspec')
121
+ if (existsSync(sillyspecPath)) {
122
+ projects.push({
123
+ name: entry.name,
124
+ path: dirPath
125
+ })
126
+ }
83
127
 
84
- if (existsSync(sillyspecPath)) {
85
- watchPaths.push(sillyspecPath)
86
- projects.push({
87
- name: entry.name,
88
- path: dirPath
89
- })
90
- }
128
+ // Recurse into subdirectories if not at max depth
129
+ if (currentDepth < maxDepth) {
130
+ projects.push(...scanDirectory(dirPath, seen, maxDepth, currentDepth + 1))
91
131
  }
92
- } catch (err) {
93
- // Skip directories we can't read
94
- continue
132
+ }
133
+ } catch (err) {
134
+ // Skip directories we can't read
135
+ }
136
+
137
+ return projects
138
+ }
139
+
140
+ /**
141
+ * Scan cwd itself (it might be a project root)
142
+ * @param {Set} seen - Already seen paths
143
+ * @returns {Array} Found projects
144
+ */
145
+ function scanSelf(seen) {
146
+ const cwd = process.cwd()
147
+ const projects = []
148
+
149
+ if (!seen.has(cwd)) {
150
+ seen.add(cwd)
151
+ const sillyspecPath = join(cwd, '.sillyspec')
152
+ if (existsSync(sillyspecPath)) {
153
+ projects.push({
154
+ name: basename(cwd),
155
+ path: cwd
156
+ })
95
157
  }
96
158
  }
97
159
 
160
+ return projects
161
+ }
162
+
163
+ /**
164
+ * Discover all .sillyspec projects
165
+ * @returns {{ projects: Array, watchPaths: string[] }}
166
+ */
167
+ function discoverAll() {
168
+ const scanDirs = buildScanDirs()
169
+ const seen = new Set()
170
+ const allProjects = []
171
+
172
+ // Check cwd itself first
173
+ allProjects.push(...scanSelf(seen))
174
+
175
+ // Scan each base directory
176
+ for (const baseDir of scanDirs) {
177
+ allProjects.push(...scanDirectory(baseDir, seen, 2, 0))
178
+ }
179
+
180
+ // Build watch paths
181
+ const watchPaths = allProjects.map(p => join(p.path, '.sillyspec'))
182
+
183
+ return { projects: allProjects, watchPaths }
184
+ }
185
+
186
+ /**
187
+ * Start watching all .sillyspec directories
188
+ * @param {function} callback - Callback function when projects are updated
189
+ * @returns {object} The watcher instance
190
+ */
191
+ export function startWatcher(callback) {
192
+ if (watcher) {
193
+ stopWatcher()
194
+ }
195
+
196
+ updateCallback = callback
197
+
198
+ const { projects, watchPaths } = discoverAll()
199
+
98
200
  // Parse initial states
99
201
  for (const project of projects) {
100
202
  const state = parseProjectState(project.path)
@@ -144,18 +246,18 @@ export function startWatcher(callback) {
144
246
  * @param {string} filePath - Path to the changed file
145
247
  */
146
248
  async function handleFileChange(filePath) {
147
- // Find which project this file belongs to
249
+ // Normalize path for comparison
250
+ const normalizedPath = filePath.replace(/\\/g, '/')
251
+
148
252
  const projectName = Array.from(projectStates.values()).find(p =>
149
- filePath.startsWith(p.path)
253
+ normalizedPath.startsWith(p.path.replace(/\\/g, '/'))
150
254
  )?.name
151
255
 
152
256
  if (!projectName) {
153
- // Re-scan for new projects
154
257
  await rescanProjects()
155
258
  return
156
259
  }
157
260
 
158
- // Re-parse the project state
159
261
  const project = projectStates.get(projectName)
160
262
  if (project) {
161
263
  const newState = parseProjectState(project.path)
@@ -164,7 +266,6 @@ async function handleFileChange(filePath) {
164
266
  }
165
267
  }
166
268
 
167
- // Emit updated state
168
269
  if (updateCallback) {
169
270
  updateCallback(Array.from(projectStates.values()))
170
271
  }
@@ -174,77 +275,49 @@ async function handleFileChange(filePath) {
174
275
  * Re-scan for projects (e.g., new .sillyspec directories)
175
276
  */
176
277
  async function rescanProjects() {
177
- const home = homedir()
178
- const cwd = process.cwd()
278
+ const { projects } = discoverAll()
179
279
 
180
- // Directories to exclude (system junk, cache, etc.)
181
- const excludeDirs = new Set([
182
- '.Trash', '.cache', '.npm', '.local', '.vscode', 'Library',
183
- '.git', 'node_modules', '.Trash-*', '.DS_Store', '.config',
184
- '.cocoapods', '.gem', '.rvm', '.nvm', '.asdf', '.brew'
185
- ])
186
-
187
- const shouldExclude = (name) => {
188
- if (excludeDirs.has(name)) return true
189
- for (const pattern of excludeDirs) {
190
- if (pattern.includes('*')) {
191
- const regex = new RegExp('^' + pattern.replace(/\*/g, '.*') + '$')
192
- if (regex.test(name)) return true
280
+ for (const project of projects) {
281
+ if (!projectStates.has(project.name)) {
282
+ const state = parseProjectState(project.path)
283
+ if (state) {
284
+ projectStates.set(project.name, {
285
+ name: project.name,
286
+ path: project.path,
287
+ state
288
+ })
193
289
  }
194
290
  }
195
- if (name.startsWith('.') && name !== cwd.split('/').pop()) {
196
- return true
197
- }
198
- return false
199
291
  }
200
292
 
201
- // Build scan directories
202
- const scanDirs = [cwd, home]
203
- const extraDirs = ['Desktop', 'Documents', 'Projects', 'Work', 'Repos', 'Code', 'src', 'dev']
204
-
205
- for (const extra of extraDirs) {
206
- const extraPath = join(home, extra)
207
- if (existsSync(extraPath)) {
208
- scanDirs.push(extraPath)
209
- }
293
+ if (updateCallback) {
294
+ updateCallback(Array.from(projectStates.values()))
210
295
  }
296
+ }
211
297
 
212
- const seen = new Set()
298
+ /**
299
+ * Add a custom scan path and rescan
300
+ * @param {string} path - Path to add
301
+ */
302
+ export function addCustomScanPath(path) {
303
+ customScanPaths.add(path)
304
+ rescanProjects()
305
+ }
213
306
 
214
- for (const baseDir of scanDirs) {
215
- try {
216
- const { readdirSync } = require('fs')
217
- const entries = readdirSync(baseDir, { withFileTypes: true })
218
-
219
- for (const entry of entries) {
220
- if (!entry.isDirectory()) continue
221
- if (shouldExclude(entry.name)) continue
222
-
223
- const dirPath = join(baseDir, entry.name)
224
- if (seen.has(dirPath)) continue
225
- seen.add(dirPath)
226
-
227
- const sillyspecPath = join(dirPath, '.sillyspec')
228
-
229
- if (existsSync(sillyspecPath) && !projectStates.has(entry.name)) {
230
- const state = parseProjectState(dirPath)
231
- if (state) {
232
- projectStates.set(entry.name, {
233
- name: entry.name,
234
- path: dirPath,
235
- state
236
- })
237
- }
238
- }
239
- }
240
- } catch (err) {
241
- continue
242
- }
243
- }
307
+ /**
308
+ * Remove a custom scan path
309
+ * @param {string} path - Path to remove
310
+ */
311
+ export function removeCustomScanPath(path) {
312
+ customScanPaths.delete(path)
313
+ }
244
314
 
245
- if (updateCallback) {
246
- updateCallback(Array.from(projectStates.values()))
247
- }
315
+ /**
316
+ * Get list of custom scan paths
317
+ * @returns {string[]}
318
+ */
319
+ export function getCustomScanPaths() {
320
+ return Array.from(customScanPaths)
248
321
  }
249
322
 
250
323
  /**
@@ -274,4 +347,3 @@ export function getProjectStates() {
274
347
  export function getProjectState(projectName) {
275
348
  return projectStates.get(projectName) || null
276
349
  }
277
-
@@ -1,17 +1,20 @@
1
1
  <template>
2
- <div class="h-screen w-screen flex flex-col overflow-hidden font-[DM_Sans,sans-serif] relative" style="background-color: #0A0A0B;">
2
+ <div class="h-screen w-screen flex flex-col overflow-hidden font-[DM_Sans,sans-serif] relative" style="background-color: #151820;">
3
3
  <!-- Ambient background -->
4
4
  <div class="absolute inset-0 pointer-events-none" style="background: radial-gradient(ellipse 60% 40% at 10% 20%, rgba(251,191,36,0.04) 0%, transparent 70%), radial-gradient(ellipse 50% 50% at 90% 80%, rgba(251,191,36,0.02) 0%, transparent 70%);" />
5
5
 
6
6
  <!-- Main Content -->
7
7
  <div class="flex-1 flex overflow-hidden relative z-10">
8
8
  <!-- Left: Project List -->
9
- <aside class="w-[240px] flex-shrink-0 relative" style="background: #111113; border-right: 1px solid #1F1F22;">
9
+ <aside class="w-[240px] flex-shrink-0 relative" style="background: #1A1E28; border-right: 1px solid #2A3040;">
10
10
  <ProjectList
11
11
  :projects="dashboard.state.projects"
12
12
  :active-project="dashboard.state.activeProject"
13
13
  :is-loading="dashboard.state.isLoading"
14
+ :scan-paths="scanPaths"
14
15
  @select="handleSelectProject"
16
+ @scan:add-path="handleAddScanPath"
17
+ @scan:remove-path="handleRemoveScanPath"
15
18
  />
16
19
  </aside>
17
20
 
@@ -30,7 +33,7 @@
30
33
  'flex-shrink-0 transition-all duration-300 relative overflow-hidden',
31
34
  dashboard.state.isPanelOpen ? 'w-[340px]' : 'w-0'
32
35
  ]"
33
- style="background: #111113; border-left: 1px solid #1F1F22;"
36
+ style="background: #1A1E28; border-left: 1px solid #2A3040;"
34
37
  >
35
38
  <DetailPanel
36
39
  :is-open="dashboard.state.isPanelOpen"
@@ -81,6 +84,7 @@ const ws = useWebSocket()
81
84
  const dashboard = useDashboard()
82
85
  const isCommandPaletteOpen = ref(false)
83
86
  const executionResult = ref(null)
87
+ const scanPaths = ref([])
84
88
 
85
89
  // Keyboard shortcuts
86
90
  useDashboardKeyboard({
@@ -123,6 +127,7 @@ onMounted(() => {
123
127
  executionResult.value = { exitCode: -1, signal: 'SIGTERM' }
124
128
  }
125
129
  })
130
+ ws.on('scan:paths', (paths) => { scanPaths.value = paths })
126
131
  })
127
132
 
128
133
  function handleSelectProject(project) { dashboard.selectProject(project) }
@@ -139,6 +144,12 @@ function handleKill() {
139
144
  if (!projectName) return
140
145
  ws.send({ type: 'cli:kill', data: { projectName } })
141
146
  }
147
+ function handleAddScanPath(path) {
148
+ ws.send({ type: 'scan:add-path', data: { path } })
149
+ }
150
+ function handleRemoveScanPath(path) {
151
+ ws.send({ type: 'scan:remove-path', data: { path } })
152
+ }
142
153
  </script>
143
154
 
144
155
  <style>
@@ -11,7 +11,7 @@
11
11
  <StageBadge v-if="project.state?.currentStage" :status="getProjectStatus()" :label="stageLabel()" />
12
12
  </div>
13
13
  <div v-else class="text-[10px] font-[JetBrains_Mono,monospace]" style="color: #3A3A3D;">
14
- no project
14
+ 未选择项目
15
15
  </div>
16
16
  </div>
17
17
 
@@ -19,11 +19,11 @@
19
19
  <div class="flex items-center gap-2">
20
20
  <div v-if="isExecuting" class="flex items-center gap-2">
21
21
  <div class="w-1 h-1 rounded-full animate-pulse-dot" style="background: #FBBF24;" />
22
- <span class="text-[10px] font-[JetBrains_Mono,monospace]" style="color: #FBBF24;">running</span>
22
+ <span class="text-[10px] font-[JetBrains_Mono,monospace]" style="color: #FBBF24;">执行中...</span>
23
23
  </div>
24
24
  <div v-else-if="executionResult" class="flex items-center gap-1.5">
25
25
  <span class="text-[10px] font-[JetBrains_Mono,monospace]" :style="{ color: executionResult.exitCode === 0 ? '#34D399' : '#EF4444' }">
26
- {{ executionResult.exitCode === 0 ? '● done' : `● exit ${executionResult.exitCode}` }}
26
+ {{ executionResult.exitCode === 0 ? '● 完成' : `● 失败 (${executionResult.exitCode})` }}
27
27
  </span>
28
28
  </div>
29
29
  </div>
@@ -36,7 +36,7 @@
36
36
  style="color: #525252;"
37
37
  @mouseenter="$event.target.style.color='#FBBF24';$event.target.style.background='rgba(251,191,36,0.06)'"
38
38
  @mouseleave="$event.target.style.color='#525252';$event.target.style.background='transparent'"
39
- title="Toggle detail panel"
39
+ title="切换详情面板"
40
40
  >
41
41
  <svg :class="['w-3.5 h-3.5 transition-transform duration-200', { 'rotate-180': !isPanelOpen }]" fill="none" stroke="currentColor" viewBox="0 0 24 24">
42
42
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
@@ -49,7 +49,7 @@
49
49
  class="px-2.5 py-1 rounded-sm text-[10px] font-[JetBrains_Mono,monospace] transition-colors duration-100"
50
50
  style="background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); color: #EF4444;"
51
51
  >
52
- kill
52
+ 停止
53
53
  </button>
54
54
 
55
55
  <button
@@ -58,7 +58,7 @@
58
58
  style="color: #525252;"
59
59
  @mouseenter="$event.target.style.color='#FBBF24';$event.target.style.background='rgba(251,191,36,0.06)'"
60
60
  @mouseleave="$event.target.style.color='#525252';$event.target.style.background='transparent'"
61
- title="Command palette (⌘K)"
61
+ title="命令面板 (⌘K)"
62
62
  >
63
63
  <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
64
64
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
@@ -17,7 +17,7 @@
17
17
  ref="searchInput"
18
18
  v-model="searchQuery"
19
19
  type="text"
20
- placeholder="Search projects or stages..."
20
+ placeholder="搜索项目或命令..."
21
21
  class="flex-1 bg-transparent border-none outline-none text-[12px] font-[JetBrains_Mono,monospace]"
22
22
  style="color: #E4E4E7;"
23
23
  @keydown="handleKeydown"
@@ -29,7 +29,7 @@
29
29
  <!-- Results -->
30
30
  <div class="max-h-72 overflow-y-auto">
31
31
  <div v-if="filteredItems.length === 0" class="py-10 text-center">
32
- <p class="text-[11px] font-[JetBrains_Mono,monospace]" style="color: #3A3A3D;">No results</p>
32
+ <p class="text-[11px] font-[JetBrains_Mono,monospace]" style="color: #3A3A3D;">无结果</p>
33
33
  </div>
34
34
  <div v-else class="py-0.5">
35
35
  <div
@@ -54,9 +54,9 @@
54
54
 
55
55
  <!-- Footer -->
56
56
  <div class="px-4 py-2 flex items-center gap-4 text-[9px] font-mono-log" style="border-top: 1px solid #1F1F22; color: #3A3A3D;">
57
- <span><kbd class="px-1 rounded-sm" style="background: #0A0A0B; border: 1px solid #1F1F22;">↑↓</kbd> nav</span>
58
- <span><kbd class="px-1 rounded-sm" style="background: #0A0A0B; border: 1px solid #1F1F22;">↵</kbd> open</span>
59
- <span><kbd class="px-1 rounded-sm" style="background: #0A0A0B; border: 1px solid #1F1F22;">esc</kbd> close</span>
57
+ <span><kbd class="px-1 rounded-sm" style="background: #0A0A0B; border: 1px solid #1F1F22;">↑↓</kbd> 导航</span>
58
+ <span><kbd class="px-1 rounded-sm" style="background: #0A0A0B; border: 1px solid #1F1F22;">↵</kbd> 打开</span>
59
+ <span><kbd class="px-1 rounded-sm" style="background: #0A0A0B; border: 1px solid #1F1F22;">esc</kbd> 关闭</span>
60
60
  </div>
61
61
  </div>
62
62
  </div>
@@ -5,7 +5,7 @@
5
5
  >
6
6
  <!-- Header -->
7
7
  <div class="px-4 py-3 flex items-center justify-between flex-shrink-0" style="border-bottom: 1px solid #1F1F22;">
8
- <h2 class="text-[11px] font-semibold uppercase tracking-[0.2em] font-[JetBrains_Mono,monospace]" style="color: #525252;">Detail</h2>
8
+ <h2 class="text-[11px] font-semibold uppercase tracking-[0.2em] font-[JetBrains_Mono,monospace]" style="color: #525252;">详情</h2>
9
9
  <button
10
10
  @click="$emit('close')"
11
11
  class="p-1 rounded-sm transition-colors duration-100 hover:bg-white/5"
@@ -27,7 +27,7 @@
27
27
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
28
28
  </svg>
29
29
  </div>
30
- <p class="text-[11px] font-[JetBrains_Mono,monospace]" style="color: #3A3A3D;">Select a step</p>
30
+ <p class="text-[11px] font-[JetBrains_Mono,monospace]" style="color: #3A3A3D;">选择一个步骤</p>
31
31
  </div>
32
32
  </div>
33
33
 
@@ -45,25 +45,25 @@
45
45
 
46
46
  <!-- Description -->
47
47
  <div v-if="activeStep.description || activeStep.summary" class="px-4 py-3" style="border-bottom: 1px solid #1F1F22;">
48
- <h4 class="text-[9px] font-semibold uppercase tracking-[0.2em] mb-1.5 font-[JetBrains_Mono,monospace]" style="color: #525252;">Description</h4>
48
+ <h4 class="text-[9px] font-semibold uppercase tracking-[0.2em] mb-1.5 font-[JetBrains_Mono,monospace]" style="color: #525252;">描述</h4>
49
49
  <p class="text-[11px] leading-relaxed" style="color: #8B8B8E;">{{ activeStep.description || activeStep.summary }}</p>
50
50
  </div>
51
51
 
52
52
  <!-- Conclusion -->
53
53
  <div v-if="activeStep.conclusion" class="px-4 py-3" style="border-bottom: 1px solid #1F1F22;">
54
- <h4 class="text-[9px] font-semibold uppercase tracking-[0.2em] mb-1.5 font-[JetBrains_Mono,monospace]" style="color: #525252;">Conclusion</h4>
54
+ <h4 class="text-[9px] font-semibold uppercase tracking-[0.2em] mb-1.5 font-[JetBrains_Mono,monospace]" style="color: #525252;">结论</h4>
55
55
  <p class="text-[11px] leading-relaxed" style="color: #E4E4E7;">{{ activeStep.conclusion }}</p>
56
56
  </div>
57
57
 
58
58
  <!-- Decision -->
59
59
  <div v-if="activeStep.decision" class="px-4 py-3" style="border-bottom: 1px solid #1F1F22;">
60
- <h4 class="text-[9px] font-semibold uppercase tracking-[0.2em] mb-1.5 font-[JetBrains_Mono,monospace]" style="color: #525252;">Decision</h4>
60
+ <h4 class="text-[9px] font-semibold uppercase tracking-[0.2em] mb-1.5 font-[JetBrains_Mono,monospace]" style="color: #525252;">决策</h4>
61
61
  <p class="text-[11px] leading-relaxed" style="color: #E4E4E7;">{{ activeStep.decision }}</p>
62
62
  </div>
63
63
 
64
64
  <!-- User Query -->
65
65
  <div v-if="activeStep.userQuery" class="px-4 py-3" style="border-bottom: 1px solid #1F1F22;">
66
- <h4 class="text-[9px] font-semibold uppercase tracking-[0.2em] mb-1.5 font-[JetBrains_Mono,monospace]" style="color: #525252;">User Query</h4>
66
+ <h4 class="text-[9px] font-semibold uppercase tracking-[0.2em] mb-1.5 font-[JetBrains_Mono,monospace]" style="color: #525252;">用户提问</h4>
67
67
  <div class="px-3 py-2 rounded-md" style="background: #0E0E10; border: 1px solid #1F1F22;">
68
68
  <p class="text-[11px] italic" style="color: #8B8B8E;">"{{ activeStep.userQuery }}"</p>
69
69
  </div>
@@ -71,16 +71,16 @@
71
71
 
72
72
  <!-- Metadata -->
73
73
  <div v-if="activeStep.duration || activeStep.timestamp" class="px-4 py-3" style="border-bottom: 1px solid #1F1F22;">
74
- <h4 class="text-[9px] font-semibold uppercase tracking-[0.2em] mb-1.5 font-[JetBrains_Mono,monospace]" style="color: #525252;">Meta</h4>
74
+ <h4 class="text-[9px] font-semibold uppercase tracking-[0.2em] mb-1.5 font-[JetBrains_Mono,monospace]" style="color: #525252;">元信息</h4>
75
75
  <div class="space-y-1 text-[11px]" style="color: #525252;">
76
- <div v-if="activeStep.duration"><span style="color: #8B8B8E;">Time:</span> {{ activeStep.duration }}</div>
77
- <div v-if="activeStep.timestamp"><span style="color: #8B8B8E;">At:</span> {{ formatTimestamp(activeStep.timestamp) }}</div>
76
+ <div v-if="activeStep.duration"><span style="color: #8B8B8E;">耗时:</span> {{ activeStep.duration }}</div>
77
+ <div v-if="activeStep.timestamp"><span style="color: #8B8B8E;">时间:</span> {{ formatTimestamp(activeStep.timestamp) }}</div>
78
78
  </div>
79
79
  </div>
80
80
 
81
81
  <!-- Output -->
82
82
  <div v-if="activeStep.output || activeStep.files" class="px-4 py-3" style="border-bottom: 1px solid #1F1F22;">
83
- <h4 class="text-[9px] font-semibold uppercase tracking-[0.2em] mb-1.5 font-[JetBrains_Mono,monospace]" style="color: #525252;">Output</h4>
83
+ <h4 class="text-[9px] font-semibold uppercase tracking-[0.2em] mb-1.5 font-[JetBrains_Mono,monospace]" style="color: #525252;">输出</h4>
84
84
  <div v-if="activeStep.output" class="px-3 py-2 rounded-md max-h-40 overflow-y-auto" style="background: #0E0E10; border: 1px solid #1F1F22;">
85
85
  <pre class="text-[10px] whitespace-pre-wrap font-mono-log" style="color: #8B8B8E;">{{ activeStep.output }}</pre>
86
86
  </div>
@@ -5,7 +5,7 @@
5
5
  <input
6
6
  v-model="searchQuery"
7
7
  type="text"
8
- placeholder="filter logs..."
8
+ placeholder="过滤日志..."
9
9
  class="flex-1 px-2 py-1 rounded-sm text-[10px] font-mono-log outline-none transition-colors duration-100"
10
10
  style="background: #141416; border: 1px solid #1F1F22; color: #8B8B8E;"
11
11
  />
@@ -14,7 +14,7 @@
14
14
  class="px-2 py-1 text-[10px] rounded-sm transition-colors duration-100"
15
15
  style="color: #525252; border: 1px solid #1F1F22;"
16
16
  >
17
- clear
17
+ 清空
18
18
  </button>
19
19
  <button
20
20
  @click="toggleAutoScroll"
@@ -25,14 +25,14 @@
25
25
  border: autoScroll ? '1px solid rgba(251,191,36,0.2)' : '1px solid #1F1F22'
26
26
  }"
27
27
  >
28
- {{ autoScroll ? 'auto' : 'pause' }}
28
+ {{ autoScroll ? '自动' : '暂停' }}
29
29
  </button>
30
30
  </div>
31
31
 
32
32
  <!-- Log output -->
33
33
  <div ref="logContainer" class="flex-1 overflow-y-auto px-2 py-1.5 font-mono-log text-[10px]" style="background: #0A0A0B;" @scroll="handleScroll">
34
34
  <div v-if="filteredLogs.length === 0" class="flex items-center justify-center h-full">
35
- <span class="font-mono-log" style="color: #2A2A2D;">{{ logs.length === 0 ? 'no logs' : 'no match' }}</span>
35
+ <span class="font-mono-log" style="color: #2A2A2D;">{{ logs.length === 0 ? '暂无日志' : '无匹配' }}</span>
36
36
  </div>
37
37
  <div v-else class="space-y-px">
38
38
  <div v-for="log in filteredLogs" :key="log.id" class="px-1.5 py-px rounded-sm" :style="{ background: logBg(log.type) }">
@@ -45,7 +45,7 @@
45
45
  <!-- Footer -->
46
46
  <div class="px-3 py-1 flex items-center justify-between text-[9px] font-mono-log" style="border-top: 1px solid #1F1F22; background: #0E0E10; color: #3A3A3D;">
47
47
  <span>{{ filteredLogs.length }}/{{ logs.length }}</span>
48
- <span v-if="!autoScroll" style="color: #FB923C;">paused</span>
48
+ <span v-if="!autoScroll" style="color: #FB923C;">已暂停</span>
49
49
  </div>
50
50
  </div>
51
51
  </template>