@dyyz1993/create-agent 2.1.0 → 2.1.2

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 (349) hide show
  1. package/package.json +5 -4
  2. package/src/__tests__/cli.test.ts +2 -0
  3. package/src/__tests__/copy.test.ts +110 -122
  4. package/src/__tests__/create-args.test.ts +113 -0
  5. package/src/__tests__/templates.test.ts +29 -3
  6. package/src/__tests__/update.test.ts +129 -0
  7. package/src/cli.ts +30 -32
  8. package/src/commands/create.ts +83 -24
  9. package/src/commands/update.ts +174 -0
  10. package/src/commands/workspace.ts +26 -6
  11. package/src/lib/copy.ts +233 -93
  12. package/src/lib/templates.ts +12 -0
  13. package/templates/agent/.husky/commit-msg +4 -0
  14. package/templates/agent/.husky/pre-commit +11 -0
  15. package/templates/agent/.husky/pre-push +6 -0
  16. package/templates/agent/.prettierignore +6 -0
  17. package/templates/agent/.prettierrc +9 -0
  18. package/templates/agent/CHANGELOG.md +15 -0
  19. package/templates/agent/commitlint.config.js +8 -0
  20. package/templates/agent/package.json +19 -4
  21. package/templates/agent/src/gateway/__tests__/ws-handler-token.test.ts +53 -39
  22. package/templates/agent/src/mainview/App.tsx +14 -12
  23. package/templates/agent/src/mainview/__tests__/hooks/use-rpc-init.test.ts +194 -190
  24. package/templates/agent/src/mainview/components/bash/BashPanel.tsx +210 -189
  25. package/templates/agent/src/mainview/components/chat/ChatPanel.tsx +45 -20
  26. package/templates/agent/src/mainview/components/common/ThemeToggle.tsx +41 -21
  27. package/templates/agent/src/mainview/components/debug/DebugPanel.tsx +181 -114
  28. package/templates/agent/src/mainview/components/debug/__tests__/DebugPanel.test.tsx +80 -80
  29. package/templates/agent/src/mainview/components/diff/__tests__/DiffViewerPanel.test.tsx +61 -58
  30. package/templates/agent/src/mainview/components/feed/FeedPanel.tsx +43 -41
  31. package/templates/agent/src/mainview/components/file-preview/FilePreviewOverlay.tsx +69 -50
  32. package/templates/agent/src/mainview/components/file-preview/VirtualizedCodeView.tsx +31 -18
  33. package/templates/agent/src/mainview/components/git/GitPanel.tsx +731 -490
  34. package/templates/agent/src/mainview/components/git/__tests__/GitPanel.test.tsx +157 -139
  35. package/templates/agent/src/mainview/components/layout/AppLayout.tsx +210 -161
  36. package/templates/agent/src/mainview/components/layout/__tests__/AppLayout.test.tsx +130 -122
  37. package/templates/agent/src/mainview/components/rules/RulesPanel.tsx +119 -109
  38. package/templates/agent/src/mainview/components/search/SearchPanel.tsx +123 -117
  39. package/templates/agent/src/mainview/components/search/__tests__/SearchPanel.test.tsx +64 -44
  40. package/templates/agent/src/mainview/components/sidebar/__tests__/PinButton.test.tsx +38 -38
  41. package/templates/agent/src/mainview/components/todo/TodoPanel.tsx +40 -38
  42. package/templates/agent/src/mainview/components/todo/__tests__/TodoPanel.test.tsx +72 -72
  43. package/templates/agent/src/mainview/lib/i18n/locales/en.json +175 -155
  44. package/templates/agent/src/mainview/lib/i18n/locales/zh.json +173 -155
  45. package/templates/agent/src/mainview/stores/use-app-store.ts +96 -86
  46. package/templates/agent/src/mainview/stores/use-explorer-store.ts +292 -275
  47. package/templates/agent/src/mainview/types/index.ts +23 -22
  48. package/templates/agent/src/mainview/utils/file-icon.tsx +17 -21
  49. package/templates/agent/src/shared/handlers/chat.ts +53 -53
  50. package/templates/agent/src/shared/handlers/debug.ts +13 -3
  51. package/templates/browser-agent/.env.example +19 -0
  52. package/templates/browser-agent/.husky/commit-msg +4 -0
  53. package/templates/browser-agent/.husky/pre-commit +11 -0
  54. package/templates/browser-agent/.husky/pre-push +6 -0
  55. package/templates/browser-agent/.prettierignore +6 -0
  56. package/templates/browser-agent/.prettierrc +9 -0
  57. package/templates/browser-agent/AGENTS.md +396 -0
  58. package/templates/browser-agent/CHANGELOG.md +15 -0
  59. package/templates/browser-agent/LICENSE +21 -0
  60. package/templates/browser-agent/README.md +103 -0
  61. package/templates/browser-agent/commitlint.config.js +8 -0
  62. package/templates/browser-agent/electrobun.config.ts +27 -0
  63. package/templates/browser-agent/electron/main.js +46 -0
  64. package/templates/browser-agent/electron/preload.js +5 -0
  65. package/templates/browser-agent/electron-builder.json +40 -0
  66. package/templates/browser-agent/eslint.config.mjs +79 -0
  67. package/templates/browser-agent/llms.txt +24 -0
  68. package/templates/browser-agent/package.json +140 -0
  69. package/templates/browser-agent/postcss.config.js +6 -0
  70. package/templates/browser-agent/scripts/dev.ts +138 -0
  71. package/templates/browser-agent/src/__tests__/hybrid-mode.test.ts +126 -0
  72. package/templates/browser-agent/src/__tests__/server-config-security.test.ts +55 -0
  73. package/templates/browser-agent/src/__tests__/server-config.test.ts +59 -0
  74. package/templates/browser-agent/src/bun/index.ts +130 -0
  75. package/templates/browser-agent/src/bun/three.d.ts +1 -0
  76. package/templates/browser-agent/src/gateway/http-routes.ts +1 -0
  77. package/templates/browser-agent/src/gateway/ipc-transport.ts +68 -0
  78. package/templates/browser-agent/src/gateway/sse-transport.ts +221 -0
  79. package/templates/browser-agent/src/mainview/App.tsx +45 -0
  80. package/templates/browser-agent/src/mainview/__tests__/hooks/use-rpc-init.test.ts +202 -0
  81. package/templates/browser-agent/src/mainview/__tests__/hooks/use-sidebar-resize.test.ts +127 -0
  82. package/templates/browser-agent/src/mainview/__tests__/i18n/i18n.test.ts +49 -0
  83. package/templates/browser-agent/src/mainview/__tests__/setup.ts +40 -0
  84. package/templates/browser-agent/src/mainview/__tests__/stores/use-chat-store.test.ts +73 -0
  85. package/templates/browser-agent/src/mainview/__tests__/stores/use-sidebar-store.test.ts +61 -0
  86. package/templates/browser-agent/src/mainview/__tests__/theme-variables.test.ts +36 -0
  87. package/templates/browser-agent/src/mainview/components/assets/AssetsPanel.tsx +139 -0
  88. package/templates/browser-agent/src/mainview/components/chat/ChatPanel.tsx +219 -0
  89. package/templates/browser-agent/src/mainview/components/chat/CommandBar.tsx +184 -0
  90. package/templates/browser-agent/src/mainview/components/chat/MessageBubble.tsx +249 -0
  91. package/templates/browser-agent/src/mainview/components/chat/ToolPicker.tsx +115 -0
  92. package/templates/browser-agent/src/mainview/components/common/ErrorBoundary.tsx +1 -0
  93. package/templates/browser-agent/src/mainview/components/common/LanguageSwitcher.tsx +15 -0
  94. package/templates/browser-agent/src/mainview/components/common/ThemeToggle.tsx +45 -0
  95. package/templates/browser-agent/src/mainview/components/common/__tests__/ErrorBoundary.test.tsx +74 -0
  96. package/templates/browser-agent/src/mainview/components/common/__tests__/LanguageSwitcher.test.tsx +44 -0
  97. package/templates/browser-agent/src/mainview/components/common/__tests__/ThemeToggle.test.tsx +41 -0
  98. package/templates/browser-agent/src/mainview/components/dev/NetworkPanel.tsx +155 -0
  99. package/templates/browser-agent/src/mainview/components/layout/AppLayout.tsx +311 -0
  100. package/templates/browser-agent/src/mainview/components/onboarding/SetupWizard.tsx +310 -0
  101. package/templates/browser-agent/src/mainview/components/process/ProcessPanel.tsx +329 -0
  102. package/templates/browser-agent/src/mainview/components/sidebar/SessionSidebar.tsx +122 -0
  103. package/templates/browser-agent/src/mainview/components/sidebar/SkillSidebar.tsx +115 -0
  104. package/templates/browser-agent/src/mainview/components/topbar/TopBar.tsx +350 -0
  105. package/templates/browser-agent/src/mainview/global.d.ts +13 -0
  106. package/templates/browser-agent/src/mainview/hooks/__tests__/use-breakpoint.test.ts +151 -0
  107. package/templates/browser-agent/src/mainview/hooks/use-agent-chat.ts +157 -0
  108. package/templates/browser-agent/src/mainview/hooks/use-breakpoint.ts +68 -0
  109. package/templates/browser-agent/src/mainview/hooks/use-rpc-init.ts +71 -0
  110. package/templates/browser-agent/src/mainview/hooks/use-sidebar-resize.ts +40 -0
  111. package/templates/browser-agent/src/mainview/index.css +71 -0
  112. package/templates/browser-agent/src/mainview/index.html +12 -0
  113. package/templates/browser-agent/src/mainview/lib/api-client.ts +397 -0
  114. package/templates/browser-agent/src/mainview/lib/i18n/index.ts +30 -0
  115. package/templates/browser-agent/src/mainview/lib/i18n/locales/en.json +130 -0
  116. package/templates/browser-agent/src/mainview/lib/i18n/locales/zh.json +128 -0
  117. package/templates/browser-agent/src/mainview/lib/network-bus.ts +92 -0
  118. package/templates/browser-agent/src/mainview/lib/rpc-cache.ts +94 -0
  119. package/templates/browser-agent/src/mainview/main.tsx +18 -0
  120. package/templates/browser-agent/src/mainview/stores/__tests__/use-connection-store.test.ts +26 -0
  121. package/templates/browser-agent/src/mainview/stores/__tests__/use-locale-store.test.ts +32 -0
  122. package/templates/browser-agent/src/mainview/stores/__tests__/use-log-store.test.ts +28 -0
  123. package/templates/browser-agent/src/mainview/stores/__tests__/use-theme-store.test.ts +59 -0
  124. package/templates/browser-agent/src/mainview/stores/message-batcher.ts +25 -0
  125. package/templates/browser-agent/src/mainview/stores/use-asset-store.ts +65 -0
  126. package/templates/browser-agent/src/mainview/stores/use-chat-store.ts +200 -0
  127. package/templates/browser-agent/src/mainview/stores/use-connection-store.ts +173 -0
  128. package/templates/browser-agent/src/mainview/stores/use-locale-store.ts +27 -0
  129. package/templates/browser-agent/src/mainview/stores/use-log-store.ts +16 -0
  130. package/templates/browser-agent/src/mainview/stores/use-network-panel-store.ts +18 -0
  131. package/templates/browser-agent/src/mainview/stores/use-record-store.ts +147 -0
  132. package/templates/browser-agent/src/mainview/stores/use-session-store.ts +151 -0
  133. package/templates/browser-agent/src/mainview/stores/use-sidebar-store.ts +161 -0
  134. package/templates/browser-agent/src/mainview/stores/use-theme-store.ts +46 -0
  135. package/templates/browser-agent/src/mainview/stores/use-view-store.ts +20 -0
  136. package/templates/browser-agent/src/mainview/types/index.ts +6 -0
  137. package/templates/browser-agent/src/server-config.ts +45 -0
  138. package/templates/browser-agent/src/server.ts +78 -0
  139. package/templates/browser-agent/src/shared/handlers/__tests__/chat-concurrency.test.ts +127 -0
  140. package/templates/browser-agent/src/shared/handlers/__tests__/chat-handler.test.ts +77 -0
  141. package/templates/browser-agent/src/shared/handlers/__tests__/file-handler.test.ts +100 -0
  142. package/templates/browser-agent/src/shared/handlers/__tests__/system-handler.test.ts +55 -0
  143. package/templates/browser-agent/src/shared/handlers/__tests__/timer-handler.test.ts +77 -0
  144. package/templates/browser-agent/src/shared/handlers/browser.ts +596 -0
  145. package/templates/browser-agent/src/shared/handlers/chat.ts +213 -0
  146. package/templates/browser-agent/src/shared/handlers/file.ts +99 -0
  147. package/templates/browser-agent/src/shared/handlers/index.ts +7 -0
  148. package/templates/browser-agent/src/shared/handlers/session.ts +167 -0
  149. package/templates/browser-agent/src/shared/handlers/system.ts +27 -0
  150. package/templates/browser-agent/src/shared/handlers/timer.ts +34 -0
  151. package/templates/browser-agent/src/shared/http-routes.ts +437 -0
  152. package/templates/browser-agent/src/shared/lib/__tests__/logger.test.ts +92 -0
  153. package/templates/browser-agent/src/shared/lib/__tests__/path-security.test.ts +77 -0
  154. package/templates/browser-agent/src/shared/lib/__tests__/web-server.test.ts +203 -0
  155. package/templates/browser-agent/src/shared/lib/agent.ts +384 -0
  156. package/templates/browser-agent/src/shared/lib/cdp.ts +448 -0
  157. package/templates/browser-agent/src/shared/lib/generate.ts +111 -0
  158. package/templates/browser-agent/src/shared/lib/logger.ts +152 -0
  159. package/templates/browser-agent/src/shared/lib/mock-stream.ts +147 -0
  160. package/templates/browser-agent/src/shared/lib/path-security.ts +38 -0
  161. package/templates/browser-agent/src/shared/lib/port-registry.ts +103 -0
  162. package/templates/browser-agent/src/shared/lib/web-server.ts +127 -0
  163. package/templates/browser-agent/src/shared/lib/xhs-extract.ts +71 -0
  164. package/templates/browser-agent/src/shared/modules/browser.ts +86 -0
  165. package/templates/browser-agent/src/shared/modules/chat.ts +20 -0
  166. package/templates/browser-agent/src/shared/modules/file.ts +40 -0
  167. package/templates/browser-agent/src/shared/modules/session.ts +55 -0
  168. package/templates/browser-agent/src/shared/modules/system.ts +8 -0
  169. package/templates/browser-agent/src/shared/modules/timer.ts +11 -0
  170. package/templates/browser-agent/src/shared/register-all-handlers.ts +36 -0
  171. package/templates/browser-agent/src/shared/rpc-schema.ts +34 -0
  172. package/templates/browser-agent/tailwind.config.js +15 -0
  173. package/templates/browser-agent/tsconfig.ipc.json +14 -0
  174. package/templates/browser-agent/tsconfig.json +36 -0
  175. package/templates/browser-agent/vite.config.ts +3 -0
  176. package/templates/browser-agent/vitest.config.ts +3 -0
  177. package/templates/chat/.husky/commit-msg +4 -0
  178. package/templates/chat/.husky/pre-commit +11 -0
  179. package/templates/chat/.husky/pre-push +6 -0
  180. package/templates/chat/CHANGELOG.md +15 -0
  181. package/templates/chat/commitlint.config.js +8 -0
  182. package/templates/chat/package.json +19 -4
  183. package/templates/chat/src/mainview/__tests__/hooks/use-input-history.test.ts +125 -0
  184. package/templates/chat/src/mainview/__tests__/setup.ts +32 -29
  185. package/templates/chat/src/mainview/components/chat/ChatPanel.tsx +80 -55
  186. package/templates/chat/src/mainview/components/common/ThemeToggle.tsx +40 -20
  187. package/templates/chat/src/mainview/lib/i18n/locales/en.json +175 -155
  188. package/templates/chat/src/mainview/lib/i18n/locales/zh.json +173 -155
  189. package/templates/chat/src/shared/handlers/chat.ts +17 -19
  190. package/templates/chat/src/shared/handlers/debug.ts +12 -2
  191. package/templates/cowork/.env.example +8 -0
  192. package/templates/cowork/.prettierignore +6 -0
  193. package/templates/cowork/.prettierrc +9 -0
  194. package/templates/cowork/AGENTS.md +236 -0
  195. package/templates/cowork/CHANGELOG.md +15 -0
  196. package/templates/cowork/LICENSE +21 -0
  197. package/templates/cowork/README.md +103 -0
  198. package/templates/cowork/commitlint.config.js +8 -0
  199. package/templates/cowork/docs/CODE-VIEW-PLAN.md +637 -0
  200. package/templates/cowork/docs/CODE-VIEW-V2.md +196 -0
  201. package/templates/cowork/docs/CODE-VIEW-V4.md +150 -0
  202. package/templates/cowork/electrobun.config.ts +27 -0
  203. package/templates/cowork/eslint.config.mjs +79 -0
  204. package/templates/cowork/llms.txt +24 -0
  205. package/templates/cowork/package.json +87 -0
  206. package/templates/cowork/postcss.config.js +6 -0
  207. package/templates/cowork/scripts/dev.ts +138 -0
  208. package/templates/cowork/src/__tests__/hybrid-mode.test.ts +126 -0
  209. package/templates/cowork/src/__tests__/server-config-security.test.ts +55 -0
  210. package/templates/cowork/src/__tests__/server-config.test.ts +59 -0
  211. package/templates/cowork/src/bun/index.ts +130 -0
  212. package/templates/cowork/src/bun/three.d.ts +1 -0
  213. package/templates/cowork/src/gateway/http-routes.ts +1 -0
  214. package/templates/cowork/src/gateway/ipc-transport.ts +68 -0
  215. package/templates/cowork/src/gateway/sse-transport.ts +231 -0
  216. package/templates/cowork/src/mainview/App.tsx +45 -0
  217. package/templates/cowork/src/mainview/__tests__/hooks/use-rpc-init.test.ts +202 -0
  218. package/templates/cowork/src/mainview/__tests__/hooks/use-sidebar-resize.test.ts +127 -0
  219. package/templates/cowork/src/mainview/__tests__/i18n/i18n.test.ts +49 -0
  220. package/templates/cowork/src/mainview/__tests__/setup.ts +40 -0
  221. package/templates/cowork/src/mainview/__tests__/stores/use-chat-store.test.ts +73 -0
  222. package/templates/cowork/src/mainview/__tests__/stores/use-sidebar-store.test.ts +61 -0
  223. package/templates/cowork/src/mainview/__tests__/theme-variables.test.ts +36 -0
  224. package/templates/cowork/src/mainview/components/chat/TaskChat.tsx +311 -0
  225. package/templates/cowork/src/mainview/components/chat/__tests__/localhost-links.test.ts +76 -0
  226. package/templates/cowork/src/mainview/components/common/ErrorBoundary.tsx +1 -0
  227. package/templates/cowork/src/mainview/components/common/LanguageSwitcher.tsx +15 -0
  228. package/templates/cowork/src/mainview/components/common/ThemeToggle.tsx +45 -0
  229. package/templates/cowork/src/mainview/components/common/__tests__/ErrorBoundary.test.tsx +74 -0
  230. package/templates/cowork/src/mainview/components/common/__tests__/LanguageSwitcher.test.tsx +44 -0
  231. package/templates/cowork/src/mainview/components/common/__tests__/ThemeToggle.test.tsx +41 -0
  232. package/templates/cowork/src/mainview/components/dev/NetworkPanel.tsx +155 -0
  233. package/templates/cowork/src/mainview/components/layout/AppLayout.tsx +216 -0
  234. package/templates/cowork/src/mainview/components/right/ArtifactsPanel.tsx +54 -0
  235. package/templates/cowork/src/mainview/components/right/ContextPanel.tsx +133 -0
  236. package/templates/cowork/src/mainview/components/right/ElementPicker.tsx +206 -0
  237. package/templates/cowork/src/mainview/components/right/PreviewBlock.tsx +155 -0
  238. package/templates/cowork/src/mainview/components/right/ProgressPanel.tsx +85 -0
  239. package/templates/cowork/src/mainview/components/sidebar/TaskSidebar.tsx +211 -0
  240. package/templates/cowork/src/mainview/components/topbar/TopBar.tsx +86 -0
  241. package/templates/cowork/src/mainview/global.d.ts +13 -0
  242. package/templates/cowork/src/mainview/hooks/__tests__/use-breakpoint.test.ts +123 -0
  243. package/templates/cowork/src/mainview/hooks/use-breakpoint.ts +53 -0
  244. package/templates/cowork/src/mainview/hooks/use-rpc-init.ts +26 -0
  245. package/templates/cowork/src/mainview/hooks/use-sidebar-resize.ts +40 -0
  246. package/templates/cowork/src/mainview/index.css +89 -0
  247. package/templates/cowork/src/mainview/index.html +12 -0
  248. package/templates/cowork/src/mainview/lib/api-client.ts +404 -0
  249. package/templates/cowork/src/mainview/lib/i18n/index.ts +30 -0
  250. package/templates/cowork/src/mainview/lib/i18n/locales/en.json +130 -0
  251. package/templates/cowork/src/mainview/lib/i18n/locales/zh.json +128 -0
  252. package/templates/cowork/src/mainview/lib/network-bus.ts +92 -0
  253. package/templates/cowork/src/mainview/lib/rpc-cache.ts +94 -0
  254. package/templates/cowork/src/mainview/main.tsx +18 -0
  255. package/templates/cowork/src/mainview/stores/__tests__/use-connection-store.test.ts +26 -0
  256. package/templates/cowork/src/mainview/stores/__tests__/use-locale-store.test.ts +32 -0
  257. package/templates/cowork/src/mainview/stores/__tests__/use-log-store.test.ts +28 -0
  258. package/templates/cowork/src/mainview/stores/__tests__/use-preview-store.test.ts +193 -0
  259. package/templates/cowork/src/mainview/stores/__tests__/use-sidebar-store.test.ts +81 -0
  260. package/templates/cowork/src/mainview/stores/__tests__/use-theme-store.test.ts +59 -0
  261. package/templates/cowork/src/mainview/stores/message-batcher.ts +25 -0
  262. package/templates/cowork/src/mainview/stores/use-chat-store.ts +198 -0
  263. package/templates/cowork/src/mainview/stores/use-connection-store.ts +168 -0
  264. package/templates/cowork/src/mainview/stores/use-context-store.ts +68 -0
  265. package/templates/cowork/src/mainview/stores/use-locale-store.ts +27 -0
  266. package/templates/cowork/src/mainview/stores/use-log-store.ts +16 -0
  267. package/templates/cowork/src/mainview/stores/use-network-panel-store.ts +18 -0
  268. package/templates/cowork/src/mainview/stores/use-output-store.ts +47 -0
  269. package/templates/cowork/src/mainview/stores/use-preview-store.ts +97 -0
  270. package/templates/cowork/src/mainview/stores/use-sidebar-store.ts +272 -0
  271. package/templates/cowork/src/mainview/stores/use-task-store.ts +86 -0
  272. package/templates/cowork/src/mainview/stores/use-theme-store.ts +46 -0
  273. package/templates/cowork/src/mainview/stores/use-view-store.ts +29 -0
  274. package/templates/cowork/src/mainview/types/index.ts +6 -0
  275. package/templates/cowork/src/server-config.ts +44 -0
  276. package/templates/cowork/src/server.ts +78 -0
  277. package/templates/cowork/src/shared/handlers/__tests__/chat-concurrency.test.ts +127 -0
  278. package/templates/cowork/src/shared/handlers/__tests__/chat-handler.test.ts +77 -0
  279. package/templates/cowork/src/shared/handlers/__tests__/file-handler.test.ts +100 -0
  280. package/templates/cowork/src/shared/handlers/__tests__/preview-handler.test.ts +172 -0
  281. package/templates/cowork/src/shared/handlers/__tests__/system-handler.test.ts +55 -0
  282. package/templates/cowork/src/shared/handlers/__tests__/timer-handler.test.ts +77 -0
  283. package/templates/cowork/src/shared/handlers/chat.ts +213 -0
  284. package/templates/cowork/src/shared/handlers/context.ts +72 -0
  285. package/templates/cowork/src/shared/handlers/file.ts +99 -0
  286. package/templates/cowork/src/shared/handlers/index.ts +9 -0
  287. package/templates/cowork/src/shared/handlers/output.ts +59 -0
  288. package/templates/cowork/src/shared/handlers/preview.ts +81 -0
  289. package/templates/cowork/src/shared/handlers/system.ts +27 -0
  290. package/templates/cowork/src/shared/handlers/task.ts +101 -0
  291. package/templates/cowork/src/shared/handlers/timer.ts +34 -0
  292. package/templates/cowork/src/shared/http-routes.ts +444 -0
  293. package/templates/cowork/src/shared/lib/__tests__/logger.test.ts +92 -0
  294. package/templates/cowork/src/shared/lib/__tests__/path-security.test.ts +77 -0
  295. package/templates/cowork/src/shared/lib/__tests__/web-server.test.ts +203 -0
  296. package/templates/cowork/src/shared/lib/logger.ts +152 -0
  297. package/templates/cowork/src/shared/lib/path-security.ts +38 -0
  298. package/templates/cowork/src/shared/lib/port-registry.ts +103 -0
  299. package/templates/cowork/src/shared/lib/web-server.ts +127 -0
  300. package/templates/cowork/src/shared/modules/chat.ts +20 -0
  301. package/templates/cowork/src/shared/modules/context.ts +32 -0
  302. package/templates/cowork/src/shared/modules/file.ts +40 -0
  303. package/templates/cowork/src/shared/modules/output.ts +20 -0
  304. package/templates/cowork/src/shared/modules/preview.ts +44 -0
  305. package/templates/cowork/src/shared/modules/system.ts +8 -0
  306. package/templates/cowork/src/shared/modules/task.ts +31 -0
  307. package/templates/cowork/src/shared/modules/timer.ts +11 -0
  308. package/templates/cowork/src/shared/register-all-handlers.ts +36 -0
  309. package/templates/cowork/src/shared/rpc-schema.ts +38 -0
  310. package/templates/cowork/tailwind.config.js +15 -0
  311. package/templates/cowork/test-upload.txt +0 -0
  312. package/templates/cowork/tsconfig.ipc.json +14 -0
  313. package/templates/cowork/tsconfig.json +36 -0
  314. package/templates/cowork/vite.config.ts +3 -0
  315. package/templates/cowork/vitest.config.ts +3 -0
  316. package/templates/general/.husky/commit-msg +4 -0
  317. package/templates/general/.husky/pre-commit +11 -0
  318. package/templates/general/.husky/pre-push +6 -0
  319. package/templates/general/CHANGELOG.md +15 -0
  320. package/templates/general/commitlint.config.js +8 -0
  321. package/templates/general/package.json +19 -4
  322. package/templates/general/src/mainview/__tests__/hooks/use-input-history.test.ts +125 -0
  323. package/templates/general/src/mainview/__tests__/setup.ts +32 -29
  324. package/templates/general/src/mainview/components/chat/ChatPanel.tsx +80 -55
  325. package/templates/general/src/mainview/components/common/ThemeToggle.tsx +40 -20
  326. package/templates/general/src/mainview/components/debug/DebugPanel.tsx +170 -156
  327. package/templates/general/src/mainview/components/debug/__tests__/DebugPanel.test.tsx +169 -0
  328. package/templates/general/src/mainview/components/explorer/ConfirmDialog.tsx +42 -42
  329. package/templates/general/src/mainview/components/explorer/ContextMenu.tsx +72 -67
  330. package/templates/general/src/mainview/components/feed/FeedPanel.tsx +7 -5
  331. package/templates/general/src/mainview/components/file-preview/FilePreviewOverlay.tsx +64 -45
  332. package/templates/general/src/mainview/components/file-preview/VirtualizedCodeView.tsx +24 -7
  333. package/templates/general/src/mainview/components/git/GitPanel.tsx +700 -473
  334. package/templates/general/src/mainview/components/layout/AppLayout.tsx +123 -114
  335. package/templates/general/src/mainview/components/search/SearchPanel.tsx +15 -19
  336. package/templates/general/src/mainview/lib/i18n/locales/en.json +175 -155
  337. package/templates/general/src/mainview/lib/i18n/locales/zh.json +173 -155
  338. package/templates/general/src/mainview/stores/__tests__/use-explorer-store.test.ts +259 -0
  339. package/templates/general/src/mainview/stores/__tests__/use-feed-store.test.ts +160 -0
  340. package/templates/general/src/mainview/stores/__tests__/use-git-store.test.ts +313 -0
  341. package/templates/general/src/mainview/stores/__tests__/use-notification-store.test.ts +115 -0
  342. package/templates/general/src/mainview/stores/__tests__/use-sidebar-store.test.ts +120 -0
  343. package/templates/general/src/mainview/stores/use-explorer-store.ts +277 -260
  344. package/templates/general/src/mainview/types/index.ts +21 -20
  345. package/templates/general/src/shared/handlers/chat.ts +1 -1
  346. package/templates/general/src/shared/handlers/debug.ts +12 -2
  347. package/templates/shared/components/ErrorBoundary.tsx +0 -1
  348. package/templates/shared/vite-base.config.ts +8 -7
  349. /package/templates/{shared → browser-agent}/test-upload.txt +0 -0
@@ -1,24 +1,24 @@
1
- import { useEffect } from "react";
2
- import { useTranslation } from "react-i18next";
3
- import { Rss, Send } from "lucide-react";
4
- import { apiClient } from "../../lib/api-client";
5
- import { useLogStore } from "../../stores/use-log-store";
6
- import { useConnectionStore } from "../../stores/use-connection-store";
7
- import { useFeedStore, useEventStreamStore, type SubEventType } from "../../stores/use-feed-store";
8
- import type { FeedCategory } from "@shared/modules/feed";
1
+ import { useEffect } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { Rss, Send } from 'lucide-react';
4
+ import { apiClient } from '../../lib/api-client';
5
+ import { useLogStore } from '../../stores/use-log-store';
6
+ import { useConnectionStore } from '../../stores/use-connection-store';
7
+ import { useFeedStore, useEventStreamStore, type SubEventType } from '../../stores/use-feed-store';
8
+ import type { FeedCategory } from '@shared/modules/feed';
9
9
 
10
- const CATEGORIES: FeedCategory[] = ["tech", "news", "general"];
11
- const EVENT_TYPES: SubEventType[] = ["feed.update", "chat.message", "timer.tick"];
10
+ const CATEGORIES: FeedCategory[] = ['tech', 'news', 'general'];
11
+ const EVENT_TYPES: SubEventType[] = ['feed.update', 'chat.message', 'timer.tick'];
12
12
  const FILTER_PRESETS: Record<SubEventType, string[]> = {
13
- "feed.update": ["", '{"category":"tech"}', '{"category":"news"}', '{"author":"alice"}'],
14
- "chat.message": ["", '{"role":"user"}', '{"role":"assistant"}'],
15
- "timer.tick": ["", '{"channel":"default"}'],
13
+ 'feed.update': ['', '{"category":"tech"}', '{"category":"news"}', '{"author":"alice"}'],
14
+ 'chat.message': ['', '{"role":"user"}', '{"role":"assistant"}'],
15
+ 'timer.tick': ['', '{"channel":"default"}'],
16
16
  };
17
17
 
18
18
  const CATEGORY_COLORS: Record<FeedCategory, string> = {
19
- tech: "bg-blue-600/30 text-blue-300",
20
- news: "bg-amber-600/30 text-amber-300",
21
- general: "bg-green-600/30 text-green-300",
19
+ tech: 'bg-blue-600/30 text-blue-300',
20
+ news: 'bg-amber-600/30 text-amber-300',
21
+ general: 'bg-[var(--color-text-success)]/30 text-[var(--color-text-success)]',
22
22
  };
23
23
 
24
24
  export function FeedPanel() {
@@ -53,13 +53,13 @@ export function FeedPanel() {
53
53
 
54
54
  const setup = async () => {
55
55
  subId = await apiClient.subscribe(
56
- "feed.update",
56
+ 'feed.update',
57
57
  (payload) => {
58
58
  addPost(payload as (typeof posts)[number]);
59
59
  },
60
- {}
60
+ {},
61
61
  );
62
- addLog("Subscribed to feed.update (no filter)");
62
+ addLog('Subscribed to feed.update (no filter)');
63
63
 
64
64
  await loadPosts();
65
65
  };
@@ -75,7 +75,7 @@ export function FeedPanel() {
75
75
  <div className="px-4 py-2 bg-[var(--color-bg-secondary)] border-b border-[var(--color-border-primary)] flex items-center justify-between flex-shrink-0">
76
76
  <h2 className="text-sm font-semibold flex items-center gap-1.5">
77
77
  <Rss className="w-4 h-4 text-[var(--color-text-accent)]" />
78
- {t("feed.title")}
78
+ {t('feed.title')}
79
79
  {posts.length > 0 && (
80
80
  <span className="ml-1 px-2 py-0.5 bg-[var(--color-accent)]/30 text-[var(--color-text-accent)] rounded text-[10px]">
81
81
  {posts.length}
@@ -87,17 +87,18 @@ export function FeedPanel() {
87
87
  <div className="flex-1 overflow-y-auto p-4 space-y-4">
88
88
  <div className="bg-[var(--color-bg-secondary)] rounded-lg p-3 space-y-2">
89
89
  <div className="text-xs font-semibold text-[var(--color-text-tertiary)] uppercase tracking-wider">
90
- {t("feed.newPost")}
90
+ {t('feed.newPost')}
91
91
  </div>
92
92
  <div className="flex gap-2">
93
93
  <input
94
94
  type="text"
95
95
  value={author}
96
96
  onChange={(e) => setAuthor(e.target.value)}
97
- placeholder={t("feed.authorPlaceholder")}
97
+ placeholder={t('feed.authorPlaceholder')}
98
98
  className="w-24 px-2 py-1.5 text-xs bg-[var(--color-bg-tertiary)] rounded text-[var(--color-text-primary)] border border-[var(--color-border-secondary)] focus:border-[var(--color-accent)] focus:outline-none"
99
99
  />
100
100
  <select
101
+ aria-label={t('feed.newPost')}
101
102
  value={category}
102
103
  onChange={(e) => setCategory(e.target.value as FeedCategory)}
103
104
  className="px-2 py-1.5 text-xs bg-[var(--color-bg-tertiary)] rounded text-[var(--color-text-primary)] border border-[var(--color-border-secondary)]"
@@ -114,8 +115,8 @@ export function FeedPanel() {
114
115
  type="text"
115
116
  value={content}
116
117
  onChange={(e) => setContent(e.target.value)}
117
- onKeyDown={(e) => e.key === "Enter" && !e.shiftKey && createPost()}
118
- placeholder={t("feed.postPlaceholder")}
118
+ onKeyDown={(e) => e.key === 'Enter' && !e.shiftKey && createPost()}
119
+ placeholder={t('feed.postPlaceholder')}
119
120
  className="flex-1 px-3 py-1.5 text-xs bg-[var(--color-bg-tertiary)] rounded text-[var(--color-text-primary)] border border-[var(--color-border-secondary)] focus:border-[var(--color-accent)] focus:outline-none"
120
121
  />
121
122
  <button
@@ -124,21 +125,22 @@ export function FeedPanel() {
124
125
  className="px-3 py-1.5 text-xs bg-[var(--color-accent)] hover:bg-[var(--color-accent-hover)] disabled:opacity-50 rounded transition-colors flex items-center gap-1"
125
126
  >
126
127
  <Send className="w-3 h-3" />
127
- {t("feed.post")}
128
+ {t('feed.post')}
128
129
  </button>
129
130
  </div>
130
131
  </div>
131
132
 
132
133
  <div className="bg-[var(--color-bg-secondary)] rounded-lg p-3 space-y-2">
133
134
  <div className="text-xs font-semibold text-[var(--color-text-tertiary)] uppercase tracking-wider">
134
- {t("feed.subscribeWithFilter")}
135
+ {t('feed.subscribeWithFilter')}
135
136
  </div>
136
137
  <div className="flex gap-2 items-center">
137
138
  <select
139
+ aria-label={t('feed.eventStream')}
138
140
  value={activeEventType}
139
141
  onChange={(e) => {
140
142
  setActiveEventType(e.target.value as SubEventType);
141
- setActiveFilter("");
143
+ setActiveFilter('');
142
144
  }}
143
145
  className="px-2 py-1.5 text-xs bg-[var(--color-bg-tertiary)] rounded text-[var(--color-text-primary)] border border-[var(--color-border-secondary)]"
144
146
  >
@@ -152,22 +154,22 @@ export function FeedPanel() {
152
154
  type="text"
153
155
  value={activeFilter}
154
156
  onChange={(e) => setActiveFilter(e.target.value)}
155
- placeholder={t("feed.filterPlaceholder")}
157
+ placeholder={t('feed.filterPlaceholder')}
156
158
  className="flex-1 px-2 py-1.5 text-xs bg-[var(--color-bg-tertiary)] rounded text-[var(--color-text-primary)] border border-[var(--color-border-secondary)] focus:border-[var(--color-accent)] focus:outline-none font-mono"
157
159
  />
158
160
  {!subscribed ? (
159
161
  <button
160
162
  onClick={handleSubscribe}
161
- className="px-3 py-1.5 text-xs bg-green-600 hover:bg-green-700 rounded transition-colors whitespace-nowrap"
163
+ className="px-3 py-1.5 text-xs bg-[var(--color-text-success)] hover:opacity-80 rounded transition-colors whitespace-nowrap"
162
164
  >
163
- {t("feed.subscribe")}
165
+ {t('feed.subscribe')}
164
166
  </button>
165
167
  ) : (
166
168
  <button
167
169
  onClick={handleUnsubscribe}
168
- className="px-3 py-1.5 text-xs bg-red-600 hover:bg-red-700 rounded transition-colors whitespace-nowrap"
170
+ className="px-3 py-1.5 text-xs bg-[var(--color-text-error)] hover:opacity-80 rounded transition-colors whitespace-nowrap"
169
171
  >
170
- {t("feed.unsubscribe")}
172
+ {t('feed.unsubscribe')}
171
173
  </button>
172
174
  )}
173
175
  </div>
@@ -178,11 +180,11 @@ export function FeedPanel() {
178
180
  onClick={() => setActiveFilter(preset)}
179
181
  className={`px-2 py-0.5 text-[10px] rounded border transition-colors ${
180
182
  activeFilter === preset
181
- ? "border-[var(--color-accent)] bg-[var(--color-accent)]/30 text-[var(--color-text-accent)]"
182
- : "border-[var(--color-border-secondary)] text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)]"
183
+ ? 'border-[var(--color-accent)] bg-[var(--color-accent)]/30 text-[var(--color-text-accent)]'
184
+ : 'border-[var(--color-border-secondary)] text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)]'
183
185
  }`}
184
186
  >
185
- {preset || t("feed.noFilter")}
187
+ {preset || t('feed.noFilter')}
186
188
  </button>
187
189
  ))}
188
190
  </div>
@@ -192,11 +194,11 @@ export function FeedPanel() {
192
194
  <div className="bg-[var(--color-bg-secondary)] rounded-lg p-3 space-y-2">
193
195
  <div className="flex items-center justify-between">
194
196
  <div className="text-xs font-semibold text-[var(--color-text-tertiary)] uppercase tracking-wider">
195
- {t("feed.eventStream")}
197
+ {t('feed.eventStream')}
196
198
  </div>
197
199
  {subscribed && (
198
- <span className="px-1.5 py-0.5 bg-green-600/30 text-green-400 rounded text-[10px] animate-pulse">
199
- {t("feed.live")}
200
+ <span className="px-1.5 py-0.5 bg-[var(--color-text-success)]/30 text-[var(--color-text-success)] rounded text-[10px] animate-pulse">
201
+ {t('feed.live')}
200
202
  </span>
201
203
  )}
202
204
  </div>
@@ -211,13 +213,13 @@ export function FeedPanel() {
211
213
  <span className="text-[10px]">
212
214
  {Object.keys(entry.filter).length > 0
213
215
  ? `filter: ${JSON.stringify(entry.filter)}`
214
- : t("feed.noFilter")}
216
+ : t('feed.noFilter')}
215
217
  </span>
216
218
  <span className="text-[10px] ml-auto">
217
219
  {new Date(entry.timestamp).toLocaleTimeString()}
218
220
  </span>
219
221
  </div>
220
- <pre className="text-cyan-300 mt-0.5 whitespace-pre-wrap break-all">
222
+ <pre className="text-[var(--color-text-info)] mt-0.5 whitespace-pre-wrap break-all">
221
223
  {JSON.stringify(entry.payload, null, 0)}
222
224
  </pre>
223
225
  </div>
@@ -228,7 +230,7 @@ export function FeedPanel() {
228
230
 
229
231
  {posts.length === 0 ? (
230
232
  <div className="flex items-center justify-center py-8 text-[var(--color-text-placeholder)] text-xs">
231
- {t("feed.noPostsYet")}
233
+ {t('feed.noPostsYet')}
232
234
  </div>
233
235
  ) : (
234
236
  <div className="space-y-2">
@@ -1,56 +1,75 @@
1
- import { FileText, X } from "lucide-react";
2
- import type { FilePreview } from "../../types";
3
- import { formatSize } from "../../utils/file-utils";
4
- import { VirtualizedCodeView } from "./VirtualizedCodeView";
1
+ import { FileText, X } from 'lucide-react';
2
+ import type { FilePreview } from '../../types';
3
+ import { formatSize } from '../../utils/file-utils';
4
+ import { VirtualizedCodeView } from './VirtualizedCodeView';
5
5
 
6
6
  interface FilePreviewOverlayProps {
7
- preview: FilePreview;
8
- loading: boolean;
9
- onClose: () => void;
7
+ preview: FilePreview;
8
+ loading: boolean;
9
+ onClose: () => void;
10
+ scrollToLine?: number;
11
+ onScrolledToLine?: () => void;
10
12
  }
11
13
 
12
- export function FilePreviewOverlay({ preview, loading, onClose }: FilePreviewOverlayProps) {
13
- return (
14
- <div className="absolute inset-0 z-10 bg-[var(--color-bg-primary)]/95 flex flex-col overflow-hidden">
15
- {/* File header with close button */}
16
- <div className="flex items-center justify-between px-4 py-2 bg-[var(--color-bg-secondary)] border-b border-[var(--color-border-primary)] flex-shrink-0">
17
- <div className="flex items-center gap-2">
18
- <FileText className="w-4 h-4 text-[var(--color-text-tertiary)]" />
19
- <span className="text-sm font-medium text-[var(--color-text-secondary)]">{preview.name}</span>
20
- {preview.size > 0 && (
21
- <span className="text-xs text-[var(--color-text-placeholder)]">{formatSize(preview.size)}</span>
22
- )}
23
- {preview.totalLines != null && (
24
- <span className="text-xs text-[var(--color-text-placeholder)]">{preview.totalLines} lines</span>
25
- )}
26
- </div>
27
- <button
28
- onClick={onClose}
29
- className="text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] p-1 rounded hover:bg-[var(--color-bg-hover)] transition-colors"
30
- >
31
- <X className="w-4 h-4" />
32
- </button>
33
- </div>
14
+ export function FilePreviewOverlay({
15
+ preview,
16
+ loading,
17
+ onClose,
18
+ scrollToLine,
19
+ onScrolledToLine,
20
+ }: FilePreviewOverlayProps) {
21
+ return (
22
+ <div className="absolute inset-0 z-10 bg-[var(--color-bg-primary)]/95 flex flex-col overflow-hidden">
23
+ {/* File header with close button */}
24
+ <div className="flex items-center justify-between px-4 py-2 bg-[var(--color-bg-secondary)] border-b border-[var(--color-border-primary)] flex-shrink-0">
25
+ <div className="flex items-center gap-2">
26
+ <FileText className="w-4 h-4 text-[var(--color-text-tertiary)]" />
27
+ <span className="text-sm font-medium text-[var(--color-text-secondary)]">
28
+ {preview.name}
29
+ </span>
30
+ {preview.size > 0 && (
31
+ <span className="text-xs text-[var(--color-text-placeholder)]">
32
+ {formatSize(preview.size)}
33
+ </span>
34
+ )}
35
+ {preview.totalLines != null && (
36
+ <span className="text-xs text-[var(--color-text-placeholder)]">
37
+ {preview.totalLines} lines
38
+ </span>
39
+ )}
40
+ </div>
41
+ <button
42
+ onClick={onClose}
43
+ className="text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] p-1 rounded hover:bg-[var(--color-bg-hover)] transition-colors"
44
+ >
45
+ <X className="w-4 h-4" />
46
+ </button>
47
+ </div>
34
48
 
35
- {/* File content — flex-col so VirtualizedCodeView's flex-1 works */}
36
- <div className="flex-1 min-h-0 flex flex-col">
37
- {loading ? (
38
- <div className="flex items-center justify-center h-full text-[var(--color-text-tertiary)] text-sm">
39
- <div className="w-5 h-5 border-2 border-[var(--color-text-accent)] border-t-transparent rounded-full animate-spin mr-2" />
40
- Loading...
41
- </div>
42
- ) : preview.isImage && preview.imageUrl ? (
43
- <div className="flex items-center justify-center h-full p-4 bg-[#1a1a2e]">
44
- <img
45
- src={preview.imageUrl}
46
- alt={preview.name}
47
- className="max-w-full max-h-full object-contain rounded"
48
- />
49
- </div>
50
- ) : preview.content ? (
51
- <VirtualizedCodeView code={preview.content} filename={preview.name} />
52
- ) : null}
53
- </div>
54
- </div>
55
- );
49
+ {/* File content — flex-col so VirtualizedCodeView's flex-1 works */}
50
+ <div className="flex-1 min-h-0 flex flex-col">
51
+ {loading ? (
52
+ <div className="flex items-center justify-center h-full text-[var(--color-text-tertiary)] text-sm">
53
+ <div className="w-5 h-5 border-2 border-[var(--color-text-accent)] border-t-transparent rounded-full animate-spin mr-2" />
54
+ Loading...
55
+ </div>
56
+ ) : preview.isImage && preview.imageUrl ? (
57
+ <div className="flex items-center justify-center h-full p-4 bg-[#1a1a2e]">
58
+ <img
59
+ src={preview.imageUrl}
60
+ alt={preview.name}
61
+ className="max-w-full max-h-full object-contain rounded"
62
+ />
63
+ </div>
64
+ ) : preview.content ? (
65
+ <VirtualizedCodeView
66
+ code={preview.content}
67
+ filename={preview.name}
68
+ scrollToLine={scrollToLine}
69
+ onScrolledToLine={onScrolledToLine}
70
+ />
71
+ ) : null}
72
+ </div>
73
+ </div>
74
+ );
56
75
  }
@@ -1,22 +1,28 @@
1
- import { useRef, useMemo } from "react";
2
- import { useVirtualizer } from "@tanstack/react-virtual";
3
- import { Highlight, themes } from "prism-react-renderer";
4
- import { getLanguage } from "../../utils/file-utils";
1
+ import { useRef, useMemo, useEffect } from 'react';
2
+ import { useVirtualizer } from '@tanstack/react-virtual';
3
+ import { Highlight, themes } from 'prism-react-renderer';
4
+ import { getLanguage } from '../../utils/file-utils';
5
5
 
6
6
  interface VirtualizedCodeViewProps {
7
7
  code: string;
8
8
  filename: string;
9
+ scrollToLine?: number;
10
+ onScrolledToLine?: () => void;
9
11
  }
10
12
 
11
13
  /** Lines longer than this skip syntax highlighting (plain text instead) */
12
14
  const LONG_LINE_THRESHOLD = 5000;
13
15
 
14
- export function VirtualizedCodeView({ code, filename }: VirtualizedCodeViewProps) {
16
+ export function VirtualizedCodeView({
17
+ code,
18
+ filename,
19
+ scrollToLine,
20
+ onScrolledToLine,
21
+ }: VirtualizedCodeViewProps) {
15
22
  const parentRef = useRef<HTMLDivElement>(null);
16
23
  const language = getLanguage(filename);
17
- const lines = useMemo(() => code.split("\n"), [code]);
24
+ const lines = useMemo(() => code.split('\n'), [code]);
18
25
 
19
- // Detect minified files: avg line length > 500 chars
20
26
  const avgLineLength = code.length / Math.max(lines.length, 1);
21
27
  const usePlainText = !language || avgLineLength > 500;
22
28
 
@@ -27,31 +33,38 @@ export function VirtualizedCodeView({ code, filename }: VirtualizedCodeViewProps
27
33
  overscan: 20,
28
34
  });
29
35
 
36
+ useEffect(() => {
37
+ if (scrollToLine != null && scrollToLine > 0 && scrollToLine <= lines.length) {
38
+ virtualizer.scrollToIndex(scrollToLine - 1, { align: 'center' });
39
+ onScrolledToLine?.();
40
+ }
41
+ }, [scrollToLine, lines.length, virtualizer, onScrolledToLine]);
42
+
30
43
  // --- Plain text path: no Prism tokenization ---
31
44
  if (usePlainText) {
32
45
  return (
33
46
  <div
34
47
  ref={parentRef}
35
48
  className="flex-1 min-h-0 overflow-auto"
36
- style={{ background: "#011627" }}
49
+ style={{ background: '#011627' }}
37
50
  >
38
51
  <div
39
- style={{ height: `${virtualizer.getTotalSize()}px`, width: "100%", position: "relative" }}
52
+ style={{ height: `${virtualizer.getTotalSize()}px`, width: '100%', position: 'relative' }}
40
53
  >
41
54
  {virtualizer.getVirtualItems().map((vr) => (
42
55
  <div
43
56
  key={vr.key}
44
57
  style={{
45
- position: "absolute",
58
+ position: 'absolute',
46
59
  top: 0,
47
60
  left: 0,
48
- width: "100%",
61
+ width: '100%',
49
62
  height: `${vr.size}px`,
50
63
  transform: `translateY(${vr.start}px)`,
51
64
  }}
52
65
  className="flex text-xs leading-5 font-mono"
53
66
  >
54
- <span className="inline-block w-10 text-right pr-4 text-gray-600 select-none shrink-0">
67
+ <span className="inline-block w-10 text-right pr-4 text-[var(--color-text-tertiary)] select-none shrink-0">
55
68
  {vr.index + 1}
56
69
  </span>
57
70
  <span className="flex-1 text-[var(--color-text-secondary)] whitespace-pre">
@@ -71,13 +84,13 @@ export function VirtualizedCodeView({ code, filename }: VirtualizedCodeViewProps
71
84
  <div
72
85
  ref={parentRef}
73
86
  className="flex-1 min-h-0 overflow-auto"
74
- style={{ background: "#011627" }}
87
+ style={{ background: '#011627' }}
75
88
  >
76
89
  <div
77
90
  style={{
78
91
  height: `${virtualizer.getTotalSize()}px`,
79
- width: "100%",
80
- position: "relative",
92
+ width: '100%',
93
+ position: 'relative',
81
94
  }}
82
95
  >
83
96
  {virtualizer.getVirtualItems().map((vr) => {
@@ -89,16 +102,16 @@ export function VirtualizedCodeView({ code, filename }: VirtualizedCodeViewProps
89
102
  <div
90
103
  key={vr.key}
91
104
  style={{
92
- position: "absolute",
105
+ position: 'absolute',
93
106
  top: 0,
94
107
  left: 0,
95
- width: "100%",
108
+ width: '100%',
96
109
  height: `${vr.size}px`,
97
110
  transform: `translateY(${vr.start}px)`,
98
111
  }}
99
112
  className="flex text-xs leading-5 font-mono"
100
113
  >
101
- <span className="inline-block w-10 text-right pr-4 text-gray-600 select-none shrink-0">
114
+ <span className="inline-block w-10 text-right pr-4 text-[var(--color-text-tertiary)] select-none shrink-0">
102
115
  {vr.index + 1}
103
116
  </span>
104
117
  {isLongLine ? (