cerebras-cli 1.0.1 → 1.0.4

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 (314) hide show
  1. package/README.md +3 -5
  2. package/cerebras-cli-1.0.0.tgz +0 -0
  3. package/package.json +7 -88
  4. package/AGENTS.md +0 -27
  5. package/Dockerfile +0 -10
  6. package/bunfig.toml +0 -4
  7. package/parsers-config.ts +0 -239
  8. package/script/build.ts +0 -151
  9. package/script/postinstall.mjs +0 -122
  10. package/script/publish.ts +0 -256
  11. package/script/schema.ts +0 -47
  12. package/src/acp/README.md +0 -164
  13. package/src/acp/agent.ts +0 -812
  14. package/src/acp/session.ts +0 -70
  15. package/src/acp/types.ts +0 -22
  16. package/src/agent/agent.ts +0 -310
  17. package/src/agent/generate.txt +0 -75
  18. package/src/auth/index.ts +0 -70
  19. package/src/bun/index.ts +0 -152
  20. package/src/bus/global.ts +0 -10
  21. package/src/bus/index.ts +0 -142
  22. package/src/cli/bootstrap.ts +0 -17
  23. package/src/cli/cmd/acp.ts +0 -88
  24. package/src/cli/cmd/agent.ts +0 -165
  25. package/src/cli/cmd/auth.ts +0 -369
  26. package/src/cli/cmd/cmd.ts +0 -7
  27. package/src/cli/cmd/debug/config.ts +0 -15
  28. package/src/cli/cmd/debug/file.ts +0 -91
  29. package/src/cli/cmd/debug/index.ts +0 -41
  30. package/src/cli/cmd/debug/lsp.ts +0 -47
  31. package/src/cli/cmd/debug/ripgrep.ts +0 -83
  32. package/src/cli/cmd/debug/scrap.ts +0 -15
  33. package/src/cli/cmd/debug/snapshot.ts +0 -48
  34. package/src/cli/cmd/export.ts +0 -88
  35. package/src/cli/cmd/generate.ts +0 -38
  36. package/src/cli/cmd/github.ts +0 -1200
  37. package/src/cli/cmd/import.ts +0 -98
  38. package/src/cli/cmd/mcp.ts +0 -400
  39. package/src/cli/cmd/models.ts +0 -77
  40. package/src/cli/cmd/pr.ts +0 -112
  41. package/src/cli/cmd/run.ts +0 -342
  42. package/src/cli/cmd/serve.ts +0 -31
  43. package/src/cli/cmd/session.ts +0 -106
  44. package/src/cli/cmd/stats.ts +0 -298
  45. package/src/cli/cmd/tui/app.tsx +0 -732
  46. package/src/cli/cmd/tui/attach.ts +0 -25
  47. package/src/cli/cmd/tui/component/border.tsx +0 -21
  48. package/src/cli/cmd/tui/component/dialog-agent.tsx +0 -31
  49. package/src/cli/cmd/tui/component/dialog-command.tsx +0 -124
  50. package/src/cli/cmd/tui/component/dialog-feedback.tsx +0 -160
  51. package/src/cli/cmd/tui/component/dialog-mcp.tsx +0 -86
  52. package/src/cli/cmd/tui/component/dialog-model.tsx +0 -223
  53. package/src/cli/cmd/tui/component/dialog-notification.tsx +0 -78
  54. package/src/cli/cmd/tui/component/dialog-provider.tsx +0 -222
  55. package/src/cli/cmd/tui/component/dialog-session-list.tsx +0 -97
  56. package/src/cli/cmd/tui/component/dialog-session-rename.tsx +0 -31
  57. package/src/cli/cmd/tui/component/dialog-status.tsx +0 -114
  58. package/src/cli/cmd/tui/component/dialog-tag.tsx +0 -44
  59. package/src/cli/cmd/tui/component/dialog-theme-list.tsx +0 -50
  60. package/src/cli/cmd/tui/component/logo.tsx +0 -37
  61. package/src/cli/cmd/tui/component/notification-banner.tsx +0 -58
  62. package/src/cli/cmd/tui/component/prompt/autocomplete.tsx +0 -530
  63. package/src/cli/cmd/tui/component/prompt/history.tsx +0 -107
  64. package/src/cli/cmd/tui/component/prompt/index.tsx +0 -931
  65. package/src/cli/cmd/tui/context/args.tsx +0 -14
  66. package/src/cli/cmd/tui/context/directory.ts +0 -12
  67. package/src/cli/cmd/tui/context/exit.tsx +0 -23
  68. package/src/cli/cmd/tui/context/helper.tsx +0 -25
  69. package/src/cli/cmd/tui/context/keybind.tsx +0 -111
  70. package/src/cli/cmd/tui/context/kv.tsx +0 -49
  71. package/src/cli/cmd/tui/context/local.tsx +0 -339
  72. package/src/cli/cmd/tui/context/prompt.tsx +0 -18
  73. package/src/cli/cmd/tui/context/route.tsx +0 -45
  74. package/src/cli/cmd/tui/context/sdk.tsx +0 -75
  75. package/src/cli/cmd/tui/context/sync.tsx +0 -374
  76. package/src/cli/cmd/tui/context/theme/aura.json +0 -69
  77. package/src/cli/cmd/tui/context/theme/ayu.json +0 -80
  78. package/src/cli/cmd/tui/context/theme/catppuccin-macchiato.json +0 -233
  79. package/src/cli/cmd/tui/context/theme/catppuccin.json +0 -112
  80. package/src/cli/cmd/tui/context/theme/cobalt2.json +0 -228
  81. package/src/cli/cmd/tui/context/theme/dracula.json +0 -219
  82. package/src/cli/cmd/tui/context/theme/everforest.json +0 -241
  83. package/src/cli/cmd/tui/context/theme/flexoki.json +0 -237
  84. package/src/cli/cmd/tui/context/theme/github.json +0 -233
  85. package/src/cli/cmd/tui/context/theme/gruvbox.json +0 -95
  86. package/src/cli/cmd/tui/context/theme/kanagawa.json +0 -77
  87. package/src/cli/cmd/tui/context/theme/material.json +0 -235
  88. package/src/cli/cmd/tui/context/theme/matrix.json +0 -77
  89. package/src/cli/cmd/tui/context/theme/mercury.json +0 -252
  90. package/src/cli/cmd/tui/context/theme/monokai.json +0 -221
  91. package/src/cli/cmd/tui/context/theme/nightowl.json +0 -221
  92. package/src/cli/cmd/tui/context/theme/nord.json +0 -223
  93. package/src/cli/cmd/tui/context/theme/one-dark.json +0 -84
  94. package/src/cli/cmd/tui/context/theme/orng.json +0 -245
  95. package/src/cli/cmd/tui/context/theme/palenight.json +0 -222
  96. package/src/cli/cmd/tui/context/theme/rosepine.json +0 -234
  97. package/src/cli/cmd/tui/context/theme/solarized.json +0 -223
  98. package/src/cli/cmd/tui/context/theme/synthwave84.json +0 -226
  99. package/src/cli/cmd/tui/context/theme/tokyonight.json +0 -243
  100. package/src/cli/cmd/tui/context/theme/vercel.json +0 -245
  101. package/src/cli/cmd/tui/context/theme/vesper.json +0 -218
  102. package/src/cli/cmd/tui/context/theme/zenburn.json +0 -223
  103. package/src/cli/cmd/tui/context/theme.tsx +0 -1077
  104. package/src/cli/cmd/tui/event.ts +0 -39
  105. package/src/cli/cmd/tui/routes/home.tsx +0 -104
  106. package/src/cli/cmd/tui/routes/session/dialog-message.tsx +0 -93
  107. package/src/cli/cmd/tui/routes/session/dialog-timeline.tsx +0 -37
  108. package/src/cli/cmd/tui/routes/session/footer.tsx +0 -76
  109. package/src/cli/cmd/tui/routes/session/header.tsx +0 -183
  110. package/src/cli/cmd/tui/routes/session/index.tsx +0 -1703
  111. package/src/cli/cmd/tui/routes/session/sidebar.tsx +0 -586
  112. package/src/cli/cmd/tui/spawn.ts +0 -60
  113. package/src/cli/cmd/tui/thread.ts +0 -120
  114. package/src/cli/cmd/tui/ui/dialog-alert.tsx +0 -55
  115. package/src/cli/cmd/tui/ui/dialog-confirm.tsx +0 -81
  116. package/src/cli/cmd/tui/ui/dialog-help.tsx +0 -36
  117. package/src/cli/cmd/tui/ui/dialog-prompt.tsx +0 -75
  118. package/src/cli/cmd/tui/ui/dialog-select.tsx +0 -317
  119. package/src/cli/cmd/tui/ui/dialog.tsx +0 -170
  120. package/src/cli/cmd/tui/ui/spinner.ts +0 -368
  121. package/src/cli/cmd/tui/ui/toast.tsx +0 -100
  122. package/src/cli/cmd/tui/util/clipboard.ts +0 -127
  123. package/src/cli/cmd/tui/util/editor.ts +0 -32
  124. package/src/cli/cmd/tui/util/terminal.ts +0 -114
  125. package/src/cli/cmd/tui/worker.ts +0 -63
  126. package/src/cli/cmd/uninstall.ts +0 -344
  127. package/src/cli/cmd/upgrade.ts +0 -67
  128. package/src/cli/cmd/web.ts +0 -84
  129. package/src/cli/error.ts +0 -55
  130. package/src/cli/ui.ts +0 -84
  131. package/src/cli/upgrade.ts +0 -25
  132. package/src/command/index.ts +0 -79
  133. package/src/command/template/initialize.txt +0 -10
  134. package/src/command/template/review.txt +0 -73
  135. package/src/config/config.ts +0 -886
  136. package/src/config/markdown.ts +0 -41
  137. package/src/env/index.ts +0 -26
  138. package/src/file/fzf.ts +0 -124
  139. package/src/file/ignore.ts +0 -83
  140. package/src/file/index.ts +0 -326
  141. package/src/file/ripgrep.ts +0 -391
  142. package/src/file/time.ts +0 -38
  143. package/src/file/watcher.ts +0 -89
  144. package/src/flag/flag.ts +0 -28
  145. package/src/format/formatter.ts +0 -277
  146. package/src/format/index.ts +0 -137
  147. package/src/global/index.ts +0 -52
  148. package/src/id/id.ts +0 -73
  149. package/src/ide/index.ts +0 -75
  150. package/src/index.ts +0 -158
  151. package/src/installation/index.ts +0 -194
  152. package/src/lsp/client.ts +0 -215
  153. package/src/lsp/index.ts +0 -370
  154. package/src/lsp/language.ts +0 -111
  155. package/src/lsp/server.ts +0 -1327
  156. package/src/mcp/auth.ts +0 -82
  157. package/src/mcp/index.ts +0 -576
  158. package/src/mcp/oauth-callback.ts +0 -203
  159. package/src/mcp/oauth-provider.ts +0 -132
  160. package/src/notification/index.ts +0 -101
  161. package/src/patch/index.ts +0 -622
  162. package/src/permission/index.ts +0 -198
  163. package/src/plugin/index.ts +0 -95
  164. package/src/project/bootstrap.ts +0 -31
  165. package/src/project/instance.ts +0 -68
  166. package/src/project/project.ts +0 -133
  167. package/src/project/state.ts +0 -65
  168. package/src/project/vcs.ts +0 -77
  169. package/src/provider/auth.ts +0 -143
  170. package/src/provider/models-macro.ts +0 -11
  171. package/src/provider/models.ts +0 -93
  172. package/src/provider/provider.ts +0 -996
  173. package/src/provider/sdk/openai-compatible/src/README.md +0 -5
  174. package/src/provider/sdk/openai-compatible/src/index.ts +0 -2
  175. package/src/provider/sdk/openai-compatible/src/openai-compatible-provider.ts +0 -100
  176. package/src/provider/sdk/openai-compatible/src/responses/convert-to-openai-responses-input.ts +0 -303
  177. package/src/provider/sdk/openai-compatible/src/responses/map-openai-responses-finish-reason.ts +0 -27
  178. package/src/provider/sdk/openai-compatible/src/responses/openai-config.ts +0 -18
  179. package/src/provider/sdk/openai-compatible/src/responses/openai-error.ts +0 -22
  180. package/src/provider/sdk/openai-compatible/src/responses/openai-responses-api-types.ts +0 -207
  181. package/src/provider/sdk/openai-compatible/src/responses/openai-responses-language-model.ts +0 -1713
  182. package/src/provider/sdk/openai-compatible/src/responses/openai-responses-prepare-tools.ts +0 -177
  183. package/src/provider/sdk/openai-compatible/src/responses/openai-responses-settings.ts +0 -1
  184. package/src/provider/sdk/openai-compatible/src/responses/tool/code-interpreter.ts +0 -88
  185. package/src/provider/sdk/openai-compatible/src/responses/tool/file-search.ts +0 -128
  186. package/src/provider/sdk/openai-compatible/src/responses/tool/image-generation.ts +0 -115
  187. package/src/provider/sdk/openai-compatible/src/responses/tool/local-shell.ts +0 -65
  188. package/src/provider/sdk/openai-compatible/src/responses/tool/web-search-preview.ts +0 -104
  189. package/src/provider/sdk/openai-compatible/src/responses/tool/web-search.ts +0 -103
  190. package/src/provider/transform.ts +0 -406
  191. package/src/pty/index.ts +0 -226
  192. package/src/ratelimit/index.ts +0 -185
  193. package/src/server/error.ts +0 -36
  194. package/src/server/project.ts +0 -50
  195. package/src/server/server.ts +0 -2463
  196. package/src/server/tui.ts +0 -71
  197. package/src/session/compaction.ts +0 -257
  198. package/src/session/index.ts +0 -470
  199. package/src/session/message-v2.ts +0 -641
  200. package/src/session/message.ts +0 -189
  201. package/src/session/processor.ts +0 -443
  202. package/src/session/prompt/anthropic-20250930.txt +0 -166
  203. package/src/session/prompt/anthropic.txt +0 -105
  204. package/src/session/prompt/anthropic_spoof.txt +0 -1
  205. package/src/session/prompt/beast.txt +0 -147
  206. package/src/session/prompt/build-switch.txt +0 -5
  207. package/src/session/prompt/codex.txt +0 -318
  208. package/src/session/prompt/compaction.txt +0 -12
  209. package/src/session/prompt/copilot-gpt-5.txt +0 -143
  210. package/src/session/prompt/gemini.txt +0 -155
  211. package/src/session/prompt/max-steps.txt +0 -16
  212. package/src/session/prompt/plan-reminder-anthropic.txt +0 -67
  213. package/src/session/prompt/plan.txt +0 -26
  214. package/src/session/prompt/polaris.txt +0 -107
  215. package/src/session/prompt/qwen.txt +0 -109
  216. package/src/session/prompt/summarize.txt +0 -4
  217. package/src/session/prompt/title.txt +0 -36
  218. package/src/session/prompt.ts +0 -1541
  219. package/src/session/retry.ts +0 -82
  220. package/src/session/revert.ts +0 -108
  221. package/src/session/status.ts +0 -75
  222. package/src/session/summary.ts +0 -203
  223. package/src/session/system.ts +0 -148
  224. package/src/session/todo.ts +0 -36
  225. package/src/share/share-next.ts +0 -195
  226. package/src/share/share.ts +0 -87
  227. package/src/snapshot/index.ts +0 -197
  228. package/src/storage/storage.ts +0 -226
  229. package/src/telemetry/index.ts +0 -232
  230. package/src/tool/bash.ts +0 -365
  231. package/src/tool/bash.txt +0 -128
  232. package/src/tool/batch.ts +0 -173
  233. package/src/tool/batch.txt +0 -28
  234. package/src/tool/codesearch.ts +0 -138
  235. package/src/tool/codesearch.txt +0 -12
  236. package/src/tool/edit.ts +0 -674
  237. package/src/tool/edit.txt +0 -10
  238. package/src/tool/glob.ts +0 -65
  239. package/src/tool/glob.txt +0 -6
  240. package/src/tool/grep.ts +0 -120
  241. package/src/tool/grep.txt +0 -8
  242. package/src/tool/invalid.ts +0 -17
  243. package/src/tool/ls.ts +0 -110
  244. package/src/tool/ls.txt +0 -1
  245. package/src/tool/lsp-diagnostics.ts +0 -26
  246. package/src/tool/lsp-diagnostics.txt +0 -1
  247. package/src/tool/lsp-hover.ts +0 -31
  248. package/src/tool/lsp-hover.txt +0 -1
  249. package/src/tool/multiedit.ts +0 -46
  250. package/src/tool/multiedit.txt +0 -41
  251. package/src/tool/patch.ts +0 -233
  252. package/src/tool/patch.txt +0 -1
  253. package/src/tool/read.ts +0 -217
  254. package/src/tool/read.txt +0 -12
  255. package/src/tool/registry.ts +0 -148
  256. package/src/tool/task.ts +0 -135
  257. package/src/tool/task.txt +0 -60
  258. package/src/tool/todo.ts +0 -39
  259. package/src/tool/todoread.txt +0 -14
  260. package/src/tool/todowrite.txt +0 -167
  261. package/src/tool/tool.ts +0 -66
  262. package/src/tool/webfetch.ts +0 -187
  263. package/src/tool/webfetch.txt +0 -14
  264. package/src/tool/websearch.ts +0 -150
  265. package/src/tool/websearch.txt +0 -11
  266. package/src/tool/write.ts +0 -99
  267. package/src/tool/write.txt +0 -8
  268. package/src/types/shims.d.ts +0 -3
  269. package/src/util/color.ts +0 -19
  270. package/src/util/context.ts +0 -25
  271. package/src/util/defer.ts +0 -12
  272. package/src/util/eventloop.ts +0 -20
  273. package/src/util/filesystem.ts +0 -69
  274. package/src/util/fn.ts +0 -11
  275. package/src/util/iife.ts +0 -3
  276. package/src/util/keybind.ts +0 -79
  277. package/src/util/lazy.ts +0 -11
  278. package/src/util/locale.ts +0 -81
  279. package/src/util/lock.ts +0 -98
  280. package/src/util/log.ts +0 -177
  281. package/src/util/queue.ts +0 -32
  282. package/src/util/rpc.ts +0 -42
  283. package/src/util/scrap.ts +0 -10
  284. package/src/util/signal.ts +0 -12
  285. package/src/util/timeout.ts +0 -14
  286. package/src/util/token.ts +0 -7
  287. package/src/util/wildcard.ts +0 -54
  288. package/sst-env.d.ts +0 -9
  289. package/test/bun.test.ts +0 -53
  290. package/test/config/agent-color.test.ts +0 -66
  291. package/test/config/config.test.ts +0 -503
  292. package/test/config/markdown.test.ts +0 -89
  293. package/test/file/ignore.test.ts +0 -10
  294. package/test/fixture/fixture.ts +0 -28
  295. package/test/fixture/lsp/fake-lsp-server.js +0 -77
  296. package/test/ide/ide.test.ts +0 -82
  297. package/test/keybind.test.ts +0 -317
  298. package/test/lsp/client.test.ts +0 -95
  299. package/test/patch/patch.test.ts +0 -348
  300. package/test/preload.ts +0 -38
  301. package/test/project/project.test.ts +0 -42
  302. package/test/provider/provider.test.ts +0 -1809
  303. package/test/provider/transform.test.ts +0 -305
  304. package/test/session/retry.test.ts +0 -61
  305. package/test/session/session.test.ts +0 -71
  306. package/test/snapshot/snapshot.test.ts +0 -939
  307. package/test/tool/__snapshots__/tool.test.ts.snap +0 -9
  308. package/test/tool/bash.test.ts +0 -55
  309. package/test/tool/patch.test.ts +0 -259
  310. package/test/util/iife.test.ts +0 -36
  311. package/test/util/lazy.test.ts +0 -50
  312. package/test/util/timeout.test.ts +0 -21
  313. package/test/util/wildcard.test.ts +0 -55
  314. package/tsconfig.json +0 -17
@@ -1,1077 +0,0 @@
1
- import { SyntaxStyle, RGBA, type TerminalColors } from "@opentui/core"
2
- import path from "path"
3
- import { createEffect, createMemo, onMount } from "solid-js"
4
- import { useSync } from "@tui/context/sync"
5
- import { createSimpleContext } from "./helper"
6
- import aura from "./theme/aura.json" with { type: "json" }
7
- import ayu from "./theme/ayu.json" with { type: "json" }
8
- import catppuccin from "./theme/catppuccin.json" with { type: "json" }
9
- import catppuccinMacchiato from "./theme/catppuccin-macchiato.json" with { type: "json" }
10
- import cobalt2 from "./theme/cobalt2.json" with { type: "json" }
11
- import dracula from "./theme/dracula.json" with { type: "json" }
12
- import everforest from "./theme/everforest.json" with { type: "json" }
13
- import flexoki from "./theme/flexoki.json" with { type: "json" }
14
- import github from "./theme/github.json" with { type: "json" }
15
- import gruvbox from "./theme/gruvbox.json" with { type: "json" }
16
- import kanagawa from "./theme/kanagawa.json" with { type: "json" }
17
- import material from "./theme/material.json" with { type: "json" }
18
- import matrix from "./theme/matrix.json" with { type: "json" }
19
- import mercury from "./theme/mercury.json" with { type: "json" }
20
- import monokai from "./theme/monokai.json" with { type: "json" }
21
- import nightowl from "./theme/nightowl.json" with { type: "json" }
22
- import nord from "./theme/nord.json" with { type: "json" }
23
- import onedark from "./theme/one-dark.json" with { type: "json" }
24
- import opencode from "./theme/opencode.json" with { type: "json" }
25
- import orng from "./theme/orng.json" with { type: "json" }
26
- import palenight from "./theme/palenight.json" with { type: "json" }
27
- import rosepine from "./theme/rosepine.json" with { type: "json" }
28
- import solarized from "./theme/solarized.json" with { type: "json" }
29
- import synthwave84 from "./theme/synthwave84.json" with { type: "json" }
30
- import tokyonight from "./theme/tokyonight.json" with { type: "json" }
31
- import vercel from "./theme/vercel.json" with { type: "json" }
32
- import vesper from "./theme/vesper.json" with { type: "json" }
33
- import zenburn from "./theme/zenburn.json" with { type: "json" }
34
- import { useKV } from "./kv"
35
- import { useRenderer } from "@opentui/solid"
36
- import { createStore, produce } from "solid-js/store"
37
- import { Global } from "@/global"
38
- import { Filesystem } from "@/util/filesystem"
39
-
40
- type ThemeColors = {
41
- primary: RGBA
42
- secondary: RGBA
43
- accent: RGBA
44
- error: RGBA
45
- warning: RGBA
46
- success: RGBA
47
- info: RGBA
48
- text: RGBA
49
- textMuted: RGBA
50
- selectedListItemText: RGBA
51
- background: RGBA
52
- backgroundPanel: RGBA
53
- backgroundElement: RGBA
54
- backgroundMenu: RGBA
55
- border: RGBA
56
- borderActive: RGBA
57
- borderSubtle: RGBA
58
- diffAdded: RGBA
59
- diffRemoved: RGBA
60
- diffContext: RGBA
61
- diffHunkHeader: RGBA
62
- diffHighlightAdded: RGBA
63
- diffHighlightRemoved: RGBA
64
- diffAddedBg: RGBA
65
- diffRemovedBg: RGBA
66
- diffContextBg: RGBA
67
- diffLineNumber: RGBA
68
- diffAddedLineNumberBg: RGBA
69
- diffRemovedLineNumberBg: RGBA
70
- markdownText: RGBA
71
- markdownHeading: RGBA
72
- markdownLink: RGBA
73
- markdownLinkText: RGBA
74
- markdownCode: RGBA
75
- markdownBlockQuote: RGBA
76
- markdownEmph: RGBA
77
- markdownStrong: RGBA
78
- markdownHorizontalRule: RGBA
79
- markdownListItem: RGBA
80
- markdownListEnumeration: RGBA
81
- markdownImage: RGBA
82
- markdownImageText: RGBA
83
- markdownCodeBlock: RGBA
84
- syntaxComment: RGBA
85
- syntaxKeyword: RGBA
86
- syntaxFunction: RGBA
87
- syntaxVariable: RGBA
88
- syntaxString: RGBA
89
- syntaxNumber: RGBA
90
- syntaxType: RGBA
91
- syntaxOperator: RGBA
92
- syntaxPunctuation: RGBA
93
- }
94
-
95
- type Theme = ThemeColors & {
96
- _hasSelectedListItemText: boolean
97
- thinkingOpacity: number
98
- }
99
-
100
- export function selectedForeground(theme: Theme): RGBA {
101
- // If theme explicitly defines selectedListItemText, use it
102
- if (theme._hasSelectedListItemText) {
103
- return theme.selectedListItemText
104
- }
105
-
106
- // For transparent backgrounds, calculate contrast based on primary color
107
- if (theme.background.a === 0) {
108
- const { r, g, b } = theme.primary
109
- const luminance = 0.299 * r + 0.587 * g + 0.114 * b
110
- return luminance > 0.5 ? RGBA.fromInts(0, 0, 0) : RGBA.fromInts(255, 255, 255)
111
- }
112
-
113
- // Fall back to background color
114
- return theme.background
115
- }
116
-
117
- type HexColor = `#${string}`
118
- type RefName = string
119
- type Variant = {
120
- dark: HexColor | RefName
121
- light: HexColor | RefName
122
- }
123
- type ColorValue = HexColor | RefName | Variant | RGBA
124
- type ThemeJson = {
125
- $schema?: string
126
- defs?: Record<string, HexColor | RefName>
127
- theme: Omit<Record<keyof ThemeColors, ColorValue>, "selectedListItemText" | "backgroundMenu"> & {
128
- selectedListItemText?: ColorValue
129
- backgroundMenu?: ColorValue
130
- thinkingOpacity?: number
131
- }
132
- }
133
-
134
- export const DEFAULT_THEMES: Record<string, ThemeJson> = {
135
- aura,
136
- ayu,
137
- catppuccin,
138
- ["catppuccin-macchiato"]: catppuccinMacchiato,
139
- cobalt2,
140
- dracula,
141
- everforest,
142
- flexoki,
143
- github,
144
- gruvbox,
145
- kanagawa,
146
- material,
147
- matrix,
148
- mercury,
149
- monokai,
150
- nightowl,
151
- nord,
152
- ["one-dark"]: onedark,
153
- opencode,
154
- orng,
155
- palenight,
156
- rosepine,
157
- solarized,
158
- synthwave84,
159
- tokyonight,
160
- vesper,
161
- vercel,
162
- zenburn,
163
- }
164
-
165
- function resolveTheme(theme: ThemeJson, mode: "dark" | "light") {
166
- const defs = theme.defs ?? {}
167
- function resolveColor(c: ColorValue): RGBA {
168
- if (c instanceof RGBA) return c
169
- if (typeof c === "string") {
170
- if (c === "transparent" || c === "none") return RGBA.fromInts(0, 0, 0, 0)
171
-
172
- if (c.startsWith("#")) return RGBA.fromHex(c)
173
-
174
- if (defs[c] != null) {
175
- return resolveColor(defs[c])
176
- } else if (theme.theme[c as keyof ThemeColors] !== undefined) {
177
- return resolveColor(theme.theme[c as keyof ThemeColors]!)
178
- } else {
179
- throw new Error(`Color reference "${c}" not found in defs or theme`)
180
- }
181
- }
182
- if (typeof c === "number") {
183
- return ansiToRgba(c)
184
- }
185
- return resolveColor(c[mode])
186
- }
187
-
188
- const resolved = Object.fromEntries(
189
- Object.entries(theme.theme)
190
- .filter(([key]) => key !== "selectedListItemText" && key !== "backgroundMenu" && key !== "thinkingOpacity")
191
- .map(([key, value]) => {
192
- return [key, resolveColor(value as ColorValue)]
193
- }),
194
- ) as Partial<ThemeColors>
195
-
196
- // Handle selectedListItemText separately since it's optional
197
- const hasSelectedListItemText = theme.theme.selectedListItemText !== undefined
198
- if (hasSelectedListItemText) {
199
- resolved.selectedListItemText = resolveColor(theme.theme.selectedListItemText!)
200
- } else {
201
- // Backward compatibility: if selectedListItemText is not defined, use background color
202
- // This preserves the current behavior for all existing themes
203
- resolved.selectedListItemText = resolved.background
204
- }
205
-
206
- // Handle backgroundMenu - optional with fallback to backgroundElement
207
- if (theme.theme.backgroundMenu !== undefined) {
208
- resolved.backgroundMenu = resolveColor(theme.theme.backgroundMenu)
209
- } else {
210
- resolved.backgroundMenu = resolved.backgroundElement
211
- }
212
-
213
- // Handle thinkingOpacity - optional with default of 0.6
214
- const thinkingOpacity = theme.theme.thinkingOpacity ?? 0.6
215
-
216
- return {
217
- ...resolved,
218
- _hasSelectedListItemText: hasSelectedListItemText,
219
- thinkingOpacity,
220
- } as Theme
221
- }
222
-
223
- function ansiToRgba(code: number): RGBA {
224
- // Standard ANSI colors (0-15)
225
- if (code < 16) {
226
- const ansiColors = [
227
- "#000000", // Black
228
- "#800000", // Red
229
- "#008000", // Green
230
- "#808000", // Yellow
231
- "#000080", // Blue
232
- "#800080", // Magenta
233
- "#008080", // Cyan
234
- "#c0c0c0", // White
235
- "#808080", // Bright Black
236
- "#ff0000", // Bright Red
237
- "#00ff00", // Bright Green
238
- "#ffff00", // Bright Yellow
239
- "#0000ff", // Bright Blue
240
- "#ff00ff", // Bright Magenta
241
- "#00ffff", // Bright Cyan
242
- "#ffffff", // Bright White
243
- ]
244
- return RGBA.fromHex(ansiColors[code] ?? "#000000")
245
- }
246
-
247
- // 6x6x6 Color Cube (16-231)
248
- if (code < 232) {
249
- const index = code - 16
250
- const b = index % 6
251
- const g = Math.floor(index / 6) % 6
252
- const r = Math.floor(index / 36)
253
-
254
- const val = (x: number) => (x === 0 ? 0 : x * 40 + 55)
255
- return RGBA.fromInts(val(r), val(g), val(b))
256
- }
257
-
258
- // Grayscale Ramp (232-255)
259
- if (code < 256) {
260
- const gray = (code - 232) * 10 + 8
261
- return RGBA.fromInts(gray, gray, gray)
262
- }
263
-
264
- // Fallback for invalid codes
265
- return RGBA.fromInts(0, 0, 0)
266
- }
267
-
268
- export const { use: useTheme, provider: ThemeProvider } = createSimpleContext({
269
- name: "Theme",
270
- init: (props: { mode: "dark" | "light" }) => {
271
- const sync = useSync()
272
- const kv = useKV()
273
- const [store, setStore] = createStore({
274
- themes: DEFAULT_THEMES,
275
- mode: kv.get("theme_mode", props.mode),
276
- active: (sync.data.config.theme ?? kv.get("theme", "opencode")) as string,
277
- ready: false,
278
- })
279
-
280
- createEffect(async () => {
281
- const custom = await getCustomThemes()
282
- setStore(
283
- produce((draft) => {
284
- Object.assign(draft.themes, custom)
285
- draft.ready = true
286
- }),
287
- )
288
- })
289
-
290
- const renderer = useRenderer()
291
- renderer
292
- .getPalette({
293
- size: 16,
294
- })
295
- .then((colors) => {
296
- if (!colors.palette[0]) return
297
- setStore("themes", "system", generateSystem(colors, store.mode))
298
- })
299
-
300
- const values = createMemo(() => {
301
- return resolveTheme(store.themes[store.active] ?? store.themes.opencode, store.mode)
302
- })
303
-
304
- const syntax = createMemo(() => generateSyntax(values()))
305
- const subtleSyntax = createMemo(() => generateSubtleSyntax(values()))
306
-
307
- return {
308
- theme: new Proxy(values(), {
309
- get(_target, prop) {
310
- // @ts-expect-error
311
- return values()[prop]
312
- },
313
- }),
314
- get selected() {
315
- return store.active
316
- },
317
- all() {
318
- return store.themes
319
- },
320
- syntax,
321
- subtleSyntax,
322
- mode() {
323
- return store.mode
324
- },
325
- setMode(mode: "dark" | "light") {
326
- setStore("mode", mode)
327
- kv.set("theme_mode", mode)
328
- },
329
- set(theme: string) {
330
- setStore("active", theme)
331
- kv.set("theme", theme)
332
- },
333
- get ready() {
334
- return store.ready
335
- },
336
- }
337
- },
338
- })
339
-
340
- const CUSTOM_THEME_GLOB = new Bun.Glob("themes/*.json")
341
- async function getCustomThemes() {
342
- const directories = [
343
- Global.Path.config,
344
- ...(await Array.fromAsync(
345
- Filesystem.up({
346
- targets: [".opencode"],
347
- start: process.cwd(),
348
- }),
349
- )),
350
- ]
351
-
352
- const result: Record<string, ThemeJson> = {}
353
- for (const dir of directories) {
354
- for await (const item of CUSTOM_THEME_GLOB.scan({
355
- absolute: true,
356
- followSymlinks: true,
357
- dot: true,
358
- cwd: dir,
359
- })) {
360
- const name = path.basename(item, ".json")
361
- result[name] = await Bun.file(item).json()
362
- }
363
- }
364
- return result
365
- }
366
-
367
- function generateSystem(colors: TerminalColors, mode: "dark" | "light"): ThemeJson {
368
- const bg = RGBA.fromHex(colors.defaultBackground ?? colors.palette[0]!)
369
- const fg = RGBA.fromHex(colors.defaultForeground ?? colors.palette[7]!)
370
- const palette = colors.palette.filter((x) => x !== null).map((x) => RGBA.fromHex(x))
371
- const isDark = mode == "dark"
372
-
373
- // Generate gray scale based on terminal background
374
- const grays = generateGrayScale(bg, isDark)
375
- const textMuted = generateMutedTextColor(bg, isDark)
376
-
377
- // ANSI color references
378
- const ansiColors = {
379
- black: palette[0],
380
- red: palette[1],
381
- green: palette[2],
382
- yellow: palette[3],
383
- blue: palette[4],
384
- magenta: palette[5],
385
- cyan: palette[6],
386
- white: palette[7],
387
- }
388
-
389
- return {
390
- theme: {
391
- // Primary colors using ANSI
392
- primary: ansiColors.cyan,
393
- secondary: ansiColors.magenta,
394
- accent: ansiColors.cyan,
395
-
396
- // Status colors using ANSI
397
- error: ansiColors.red,
398
- warning: ansiColors.yellow,
399
- success: ansiColors.green,
400
- info: ansiColors.cyan,
401
-
402
- // Text colors
403
- text: fg,
404
- textMuted,
405
- selectedListItemText: bg,
406
-
407
- // Background colors
408
- background: bg,
409
- backgroundPanel: grays[2],
410
- backgroundElement: grays[3],
411
- backgroundMenu: grays[3],
412
-
413
- // Border colors
414
- borderSubtle: grays[6],
415
- border: grays[7],
416
- borderActive: grays[8],
417
-
418
- // Diff colors
419
- diffAdded: ansiColors.green,
420
- diffRemoved: ansiColors.red,
421
- diffContext: grays[7],
422
- diffHunkHeader: grays[7],
423
- diffHighlightAdded: ansiColors.green,
424
- diffHighlightRemoved: ansiColors.red,
425
- diffAddedBg: grays[2],
426
- diffRemovedBg: grays[2],
427
- diffContextBg: grays[1],
428
- diffLineNumber: grays[6],
429
- diffAddedLineNumberBg: grays[3],
430
- diffRemovedLineNumberBg: grays[3],
431
-
432
- // Markdown colors
433
- markdownText: fg,
434
- markdownHeading: fg,
435
- markdownLink: ansiColors.blue,
436
- markdownLinkText: ansiColors.cyan,
437
- markdownCode: ansiColors.green,
438
- markdownBlockQuote: ansiColors.yellow,
439
- markdownEmph: ansiColors.yellow,
440
- markdownStrong: fg,
441
- markdownHorizontalRule: grays[7],
442
- markdownListItem: ansiColors.blue,
443
- markdownListEnumeration: ansiColors.cyan,
444
- markdownImage: ansiColors.blue,
445
- markdownImageText: ansiColors.cyan,
446
- markdownCodeBlock: fg,
447
-
448
- // Syntax colors
449
- syntaxComment: textMuted,
450
- syntaxKeyword: ansiColors.magenta,
451
- syntaxFunction: ansiColors.blue,
452
- syntaxVariable: fg,
453
- syntaxString: ansiColors.green,
454
- syntaxNumber: ansiColors.yellow,
455
- syntaxType: ansiColors.cyan,
456
- syntaxOperator: ansiColors.cyan,
457
- syntaxPunctuation: fg,
458
- },
459
- }
460
- }
461
-
462
- function generateGrayScale(bg: RGBA, isDark: boolean): Record<number, RGBA> {
463
- const grays: Record<number, RGBA> = {}
464
-
465
- // RGBA stores floats in range 0-1, convert to 0-255
466
- const bgR = bg.r * 255
467
- const bgG = bg.g * 255
468
- const bgB = bg.b * 255
469
-
470
- const luminance = 0.299 * bgR + 0.587 * bgG + 0.114 * bgB
471
-
472
- for (let i = 1; i <= 12; i++) {
473
- const factor = i / 12.0
474
-
475
- let grayValue: number
476
- let newR: number
477
- let newG: number
478
- let newB: number
479
-
480
- if (isDark) {
481
- if (luminance < 10) {
482
- grayValue = Math.floor(factor * 0.4 * 255)
483
- newR = grayValue
484
- newG = grayValue
485
- newB = grayValue
486
- } else {
487
- const newLum = luminance + (255 - luminance) * factor * 0.4
488
-
489
- const ratio = newLum / luminance
490
- newR = Math.min(bgR * ratio, 255)
491
- newG = Math.min(bgG * ratio, 255)
492
- newB = Math.min(bgB * ratio, 255)
493
- }
494
- } else {
495
- if (luminance > 245) {
496
- grayValue = Math.floor(255 - factor * 0.4 * 255)
497
- newR = grayValue
498
- newG = grayValue
499
- newB = grayValue
500
- } else {
501
- const newLum = luminance * (1 - factor * 0.4)
502
-
503
- const ratio = newLum / luminance
504
- newR = Math.max(bgR * ratio, 0)
505
- newG = Math.max(bgG * ratio, 0)
506
- newB = Math.max(bgB * ratio, 0)
507
- }
508
- }
509
-
510
- grays[i] = RGBA.fromInts(Math.floor(newR), Math.floor(newG), Math.floor(newB))
511
- }
512
-
513
- return grays
514
- }
515
-
516
- function generateMutedTextColor(bg: RGBA, isDark: boolean): RGBA {
517
- // RGBA stores floats in range 0-1, convert to 0-255
518
- const bgR = bg.r * 255
519
- const bgG = bg.g * 255
520
- const bgB = bg.b * 255
521
-
522
- const bgLum = 0.299 * bgR + 0.587 * bgG + 0.114 * bgB
523
-
524
- let grayValue: number
525
-
526
- if (isDark) {
527
- if (bgLum < 10) {
528
- // Very dark/black background
529
- grayValue = 180 // #b4b4b4
530
- } else {
531
- // Scale up for lighter dark backgrounds
532
- grayValue = Math.min(Math.floor(160 + bgLum * 0.3), 200)
533
- }
534
- } else {
535
- if (bgLum > 245) {
536
- // Very light/white background
537
- grayValue = 75 // #4b4b4b
538
- } else {
539
- // Scale down for darker light backgrounds
540
- grayValue = Math.max(Math.floor(100 - (255 - bgLum) * 0.2), 60)
541
- }
542
- }
543
-
544
- return RGBA.fromInts(grayValue, grayValue, grayValue)
545
- }
546
-
547
- function generateSyntax(theme: Theme) {
548
- return SyntaxStyle.fromTheme(getSyntaxRules(theme))
549
- }
550
-
551
- function generateSubtleSyntax(theme: Theme) {
552
- const rules = getSyntaxRules(theme)
553
- return SyntaxStyle.fromTheme(
554
- rules.map((rule) => {
555
- if (rule.style.foreground) {
556
- const fg = rule.style.foreground
557
- return {
558
- ...rule,
559
- style: {
560
- ...rule.style,
561
- foreground: RGBA.fromInts(
562
- Math.round(fg.r * 255),
563
- Math.round(fg.g * 255),
564
- Math.round(fg.b * 255),
565
- Math.round(theme.thinkingOpacity * 255),
566
- ),
567
- },
568
- }
569
- }
570
- return rule
571
- }),
572
- )
573
- }
574
-
575
- function getSyntaxRules(theme: Theme) {
576
- return [
577
- {
578
- scope: ["default"],
579
- style: {
580
- foreground: theme.text,
581
- },
582
- },
583
- {
584
- scope: ["prompt"],
585
- style: {
586
- foreground: theme.accent,
587
- },
588
- },
589
- {
590
- scope: ["extmark.file"],
591
- style: {
592
- foreground: theme.warning,
593
- bold: true,
594
- },
595
- },
596
- {
597
- scope: ["extmark.agent"],
598
- style: {
599
- foreground: theme.secondary,
600
- bold: true,
601
- },
602
- },
603
- {
604
- scope: ["extmark.paste"],
605
- style: {
606
- foreground: theme.background,
607
- background: theme.warning,
608
- bold: true,
609
- },
610
- },
611
- {
612
- scope: ["comment"],
613
- style: {
614
- foreground: theme.syntaxComment,
615
- italic: true,
616
- },
617
- },
618
- {
619
- scope: ["comment.documentation"],
620
- style: {
621
- foreground: theme.syntaxComment,
622
- italic: true,
623
- },
624
- },
625
- {
626
- scope: ["string", "symbol"],
627
- style: {
628
- foreground: theme.syntaxString,
629
- },
630
- },
631
- {
632
- scope: ["number", "boolean"],
633
- style: {
634
- foreground: theme.syntaxNumber,
635
- },
636
- },
637
- {
638
- scope: ["character.special"],
639
- style: {
640
- foreground: theme.syntaxString,
641
- },
642
- },
643
- {
644
- scope: ["keyword.return", "keyword.conditional", "keyword.repeat", "keyword.coroutine"],
645
- style: {
646
- foreground: theme.syntaxKeyword,
647
- italic: true,
648
- },
649
- },
650
- {
651
- scope: ["keyword.type"],
652
- style: {
653
- foreground: theme.syntaxType,
654
- bold: true,
655
- italic: true,
656
- },
657
- },
658
- {
659
- scope: ["keyword.function", "function.method"],
660
- style: {
661
- foreground: theme.syntaxFunction,
662
- },
663
- },
664
- {
665
- scope: ["keyword"],
666
- style: {
667
- foreground: theme.syntaxKeyword,
668
- italic: true,
669
- },
670
- },
671
- {
672
- scope: ["keyword.import"],
673
- style: {
674
- foreground: theme.syntaxKeyword,
675
- },
676
- },
677
- {
678
- scope: ["operator", "keyword.operator", "punctuation.delimiter"],
679
- style: {
680
- foreground: theme.syntaxOperator,
681
- },
682
- },
683
- {
684
- scope: ["keyword.conditional.ternary"],
685
- style: {
686
- foreground: theme.syntaxOperator,
687
- },
688
- },
689
- {
690
- scope: ["variable", "variable.parameter", "function.method.call", "function.call"],
691
- style: {
692
- foreground: theme.syntaxVariable,
693
- },
694
- },
695
- {
696
- scope: ["variable.member", "function", "constructor"],
697
- style: {
698
- foreground: theme.syntaxFunction,
699
- },
700
- },
701
- {
702
- scope: ["type", "module"],
703
- style: {
704
- foreground: theme.syntaxType,
705
- },
706
- },
707
- {
708
- scope: ["constant"],
709
- style: {
710
- foreground: theme.syntaxNumber,
711
- },
712
- },
713
- {
714
- scope: ["property"],
715
- style: {
716
- foreground: theme.syntaxVariable,
717
- },
718
- },
719
- {
720
- scope: ["class"],
721
- style: {
722
- foreground: theme.syntaxType,
723
- },
724
- },
725
- {
726
- scope: ["parameter"],
727
- style: {
728
- foreground: theme.syntaxVariable,
729
- },
730
- },
731
- {
732
- scope: ["punctuation", "punctuation.bracket"],
733
- style: {
734
- foreground: theme.syntaxPunctuation,
735
- },
736
- },
737
- {
738
- scope: ["variable.builtin", "type.builtin", "function.builtin", "module.builtin", "constant.builtin"],
739
- style: {
740
- foreground: theme.error,
741
- },
742
- },
743
- {
744
- scope: ["variable.super"],
745
- style: {
746
- foreground: theme.error,
747
- },
748
- },
749
- {
750
- scope: ["string.escape", "string.regexp"],
751
- style: {
752
- foreground: theme.syntaxKeyword,
753
- },
754
- },
755
- {
756
- scope: ["keyword.directive"],
757
- style: {
758
- foreground: theme.syntaxKeyword,
759
- italic: true,
760
- },
761
- },
762
- {
763
- scope: ["punctuation.special"],
764
- style: {
765
- foreground: theme.syntaxOperator,
766
- },
767
- },
768
- {
769
- scope: ["keyword.modifier"],
770
- style: {
771
- foreground: theme.syntaxKeyword,
772
- italic: true,
773
- },
774
- },
775
- {
776
- scope: ["keyword.exception"],
777
- style: {
778
- foreground: theme.syntaxKeyword,
779
- italic: true,
780
- },
781
- },
782
- // Markdown specific styles
783
- {
784
- scope: ["markup.heading"],
785
- style: {
786
- foreground: theme.markdownHeading,
787
- bold: true,
788
- },
789
- },
790
- {
791
- scope: ["markup.heading.1"],
792
- style: {
793
- foreground: theme.markdownHeading,
794
- bold: true,
795
- },
796
- },
797
- {
798
- scope: ["markup.heading.2"],
799
- style: {
800
- foreground: theme.markdownHeading,
801
- bold: true,
802
- },
803
- },
804
- {
805
- scope: ["markup.heading.3"],
806
- style: {
807
- foreground: theme.markdownHeading,
808
- bold: true,
809
- },
810
- },
811
- {
812
- scope: ["markup.heading.4"],
813
- style: {
814
- foreground: theme.markdownHeading,
815
- bold: true,
816
- },
817
- },
818
- {
819
- scope: ["markup.heading.5"],
820
- style: {
821
- foreground: theme.markdownHeading,
822
- bold: true,
823
- },
824
- },
825
- {
826
- scope: ["markup.heading.6"],
827
- style: {
828
- foreground: theme.markdownHeading,
829
- bold: true,
830
- },
831
- },
832
- {
833
- scope: ["markup.bold", "markup.strong"],
834
- style: {
835
- foreground: theme.markdownStrong,
836
- bold: true,
837
- },
838
- },
839
- {
840
- scope: ["markup.italic"],
841
- style: {
842
- foreground: theme.markdownEmph,
843
- italic: true,
844
- },
845
- },
846
- {
847
- scope: ["markup.list"],
848
- style: {
849
- foreground: theme.markdownListItem,
850
- },
851
- },
852
- {
853
- scope: ["markup.quote"],
854
- style: {
855
- foreground: theme.markdownBlockQuote,
856
- italic: true,
857
- },
858
- },
859
- {
860
- scope: ["markup.raw", "markup.raw.block"],
861
- style: {
862
- foreground: theme.markdownCode,
863
- },
864
- },
865
- {
866
- scope: ["markup.raw.inline"],
867
- style: {
868
- foreground: theme.markdownCode,
869
- background: theme.background,
870
- },
871
- },
872
- {
873
- scope: ["markup.link"],
874
- style: {
875
- foreground: theme.markdownLink,
876
- underline: true,
877
- },
878
- },
879
- {
880
- scope: ["markup.link.label"],
881
- style: {
882
- foreground: theme.markdownLinkText,
883
- underline: true,
884
- },
885
- },
886
- {
887
- scope: ["markup.link.url"],
888
- style: {
889
- foreground: theme.markdownLink,
890
- underline: true,
891
- },
892
- },
893
- {
894
- scope: ["label"],
895
- style: {
896
- foreground: theme.markdownLinkText,
897
- },
898
- },
899
- {
900
- scope: ["spell", "nospell"],
901
- style: {
902
- foreground: theme.text,
903
- },
904
- },
905
- {
906
- scope: ["conceal"],
907
- style: {
908
- foreground: theme.textMuted,
909
- },
910
- },
911
- // Additional common highlight groups
912
- {
913
- scope: ["string.special", "string.special.url"],
914
- style: {
915
- foreground: theme.markdownLink,
916
- underline: true,
917
- },
918
- },
919
- {
920
- scope: ["character"],
921
- style: {
922
- foreground: theme.syntaxString,
923
- },
924
- },
925
- {
926
- scope: ["float"],
927
- style: {
928
- foreground: theme.syntaxNumber,
929
- },
930
- },
931
- {
932
- scope: ["comment.error"],
933
- style: {
934
- foreground: theme.error,
935
- italic: true,
936
- bold: true,
937
- },
938
- },
939
- {
940
- scope: ["comment.warning"],
941
- style: {
942
- foreground: theme.warning,
943
- italic: true,
944
- bold: true,
945
- },
946
- },
947
- {
948
- scope: ["comment.todo", "comment.note"],
949
- style: {
950
- foreground: theme.info,
951
- italic: true,
952
- bold: true,
953
- },
954
- },
955
- {
956
- scope: ["namespace"],
957
- style: {
958
- foreground: theme.syntaxType,
959
- },
960
- },
961
- {
962
- scope: ["field"],
963
- style: {
964
- foreground: theme.syntaxVariable,
965
- },
966
- },
967
- {
968
- scope: ["type.definition"],
969
- style: {
970
- foreground: theme.syntaxType,
971
- bold: true,
972
- },
973
- },
974
- {
975
- scope: ["keyword.export"],
976
- style: {
977
- foreground: theme.syntaxKeyword,
978
- },
979
- },
980
- {
981
- scope: ["attribute", "annotation"],
982
- style: {
983
- foreground: theme.warning,
984
- },
985
- },
986
- {
987
- scope: ["tag"],
988
- style: {
989
- foreground: theme.error,
990
- },
991
- },
992
- {
993
- scope: ["tag.attribute"],
994
- style: {
995
- foreground: theme.syntaxKeyword,
996
- },
997
- },
998
- {
999
- scope: ["tag.delimiter"],
1000
- style: {
1001
- foreground: theme.syntaxOperator,
1002
- },
1003
- },
1004
- {
1005
- scope: ["markup.strikethrough"],
1006
- style: {
1007
- foreground: theme.textMuted,
1008
- },
1009
- },
1010
- {
1011
- scope: ["markup.underline"],
1012
- style: {
1013
- foreground: theme.text,
1014
- underline: true,
1015
- },
1016
- },
1017
- {
1018
- scope: ["markup.list.checked"],
1019
- style: {
1020
- foreground: theme.success,
1021
- },
1022
- },
1023
- {
1024
- scope: ["markup.list.unchecked"],
1025
- style: {
1026
- foreground: theme.textMuted,
1027
- },
1028
- },
1029
- {
1030
- scope: ["diff.plus"],
1031
- style: {
1032
- foreground: theme.diffAdded,
1033
- background: theme.diffAddedBg,
1034
- },
1035
- },
1036
- {
1037
- scope: ["diff.minus"],
1038
- style: {
1039
- foreground: theme.diffRemoved,
1040
- background: theme.diffRemovedBg,
1041
- },
1042
- },
1043
- {
1044
- scope: ["diff.delta"],
1045
- style: {
1046
- foreground: theme.diffContext,
1047
- background: theme.diffContextBg,
1048
- },
1049
- },
1050
- {
1051
- scope: ["error"],
1052
- style: {
1053
- foreground: theme.error,
1054
- bold: true,
1055
- },
1056
- },
1057
- {
1058
- scope: ["warning"],
1059
- style: {
1060
- foreground: theme.warning,
1061
- bold: true,
1062
- },
1063
- },
1064
- {
1065
- scope: ["info"],
1066
- style: {
1067
- foreground: theme.info,
1068
- },
1069
- },
1070
- {
1071
- scope: ["debug"],
1072
- style: {
1073
- foreground: theme.textMuted,
1074
- },
1075
- },
1076
- ]
1077
- }