@waq666/pneuma 0.7.1 → 0.8.1

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 (416) hide show
  1. package/README.md +242 -206
  2. package/bin/dsc.js +9 -3
  3. package/bin/headless.cjs +1 -1
  4. package/lib/adapter/transcript.d.ts +19 -2
  5. package/lib/adapter/transcript.js +71 -14
  6. package/lib/app/AgentsOverlay.js +7 -6
  7. package/lib/app/App.js +1 -1
  8. package/lib/app/ApprovalCard.js +15 -9
  9. package/lib/app/ChatView.d.ts +3 -1
  10. package/lib/app/ChatView.js +21 -17
  11. package/lib/app/Composer.js +22 -4
  12. package/lib/app/MarkdownView.js +2 -1
  13. package/lib/app/ModelPicker.js +7 -6
  14. package/lib/app/PickerFrame.d.ts +4 -0
  15. package/lib/app/PickerFrame.js +18 -0
  16. package/lib/app/PlanReviewCard.js +2 -1
  17. package/lib/app/PresetPicker.js +8 -7
  18. package/lib/app/SessionPicker.js +21 -20
  19. package/lib/app/SettingsOverlay.js +1 -1
  20. package/lib/app/SkillsPicker.js +7 -6
  21. package/lib/app/StatusBar.js +3 -15
  22. package/lib/app/TaskStrips.js +1 -4
  23. package/lib/app/TimelineRail.js +2 -1
  24. package/lib/app/ToolCard.js +2 -6
  25. package/lib/app/Welcome.d.ts +1 -0
  26. package/lib/app/Welcome.js +1 -4
  27. package/lib/app/click.d.ts +0 -2
  28. package/lib/app/click.js +2 -21
  29. package/lib/app/display-width.d.ts +16 -0
  30. package/lib/app/display-width.js +33 -0
  31. package/lib/app/markdown.d.ts +1 -3
  32. package/lib/app/markdown.js +2 -19
  33. package/lib/app/scroll-model.js +1 -1
  34. package/lib/contract/approval.d.ts +91 -0
  35. package/lib/contract/approval.js +1 -0
  36. package/lib/contract/mode.d.ts +69 -0
  37. package/lib/contract/mode.js +1 -0
  38. package/lib/contract/plugin.d.ts +240 -0
  39. package/lib/contract/plugin.js +1 -0
  40. package/lib/contract/runtime.d.ts +282 -0
  41. package/lib/contract/runtime.js +1 -0
  42. package/lib/contract/session.d.ts +208 -0
  43. package/lib/contract/session.js +36 -0
  44. package/lib/contract/settings.d.ts +242 -0
  45. package/lib/contract/settings.js +1 -0
  46. package/lib/contract/snapshot.d.ts +453 -0
  47. package/lib/contract/snapshot.js +1 -0
  48. package/lib/contract/task.d.ts +189 -0
  49. package/lib/contract/task.js +10 -0
  50. package/lib/contract/transcript.d.ts +358 -0
  51. package/lib/contract/transcript.js +1 -0
  52. package/lib/contract/usage.d.ts +132 -0
  53. package/lib/contract/usage.js +10 -0
  54. package/lib/contract.d.ts +20 -1968
  55. package/lib/contract.js +19 -30
  56. package/lib/core/agent-roles.d.ts +1 -1
  57. package/lib/core/agent-roles.js +6 -5
  58. package/lib/core/approval-floor.d.ts +9 -0
  59. package/lib/core/approval-floor.js +152 -25
  60. package/lib/core/attachments.d.ts +185 -0
  61. package/lib/core/attachments.js +425 -0
  62. package/lib/core/bytes.d.ts +14 -0
  63. package/lib/core/bytes.js +28 -0
  64. package/lib/core/call-meaning.d.ts +20 -0
  65. package/lib/core/call-meaning.js +347 -0
  66. package/lib/core/cdp/actions.js +6 -0
  67. package/lib/core/cdp/launch.js +2 -2
  68. package/lib/core/cdp/report.d.ts +27 -0
  69. package/lib/core/cdp/report.js +50 -0
  70. package/lib/core/cdp/ring-buffer.d.ts +25 -0
  71. package/lib/core/cdp/ring-buffer.js +44 -0
  72. package/lib/core/cdp/snapshot.js +5 -9
  73. package/lib/core/cdp/transport.js +1 -1
  74. package/lib/core/clamp.d.ts +20 -0
  75. package/lib/core/clamp.js +24 -0
  76. package/lib/core/clock.d.ts +16 -0
  77. package/lib/core/clock.js +20 -0
  78. package/lib/core/command-policy.js +33 -1
  79. package/lib/core/commands-completion.d.ts +28 -0
  80. package/lib/core/commands-completion.js +108 -30
  81. package/lib/core/compact.d.ts +36 -6
  82. package/lib/core/compact.js +89 -17
  83. package/lib/core/desktop-control.js +1 -3
  84. package/lib/core/dsh-compat/llm-usage-event.d.ts +78 -0
  85. package/lib/core/dsh-compat/llm-usage-event.js +91 -0
  86. package/lib/core/dsh-compat/presentation.d.ts +84 -0
  87. package/lib/core/dsh-compat/presentation.js +105 -0
  88. package/lib/core/dsh-compat/resolve-hook.d.ts +3 -3
  89. package/lib/core/dsh-compat/resolve-hook.js +41 -13
  90. package/lib/core/dsh-compat/service-map.d.ts +52 -0
  91. package/lib/core/dsh-compat/service-map.js +87 -0
  92. package/lib/core/dsh-compat/session-bridge.d.ts +107 -0
  93. package/lib/core/dsh-compat/session-bridge.js +376 -0
  94. package/lib/core/dsh-compat/session-events.d.ts +54 -0
  95. package/lib/core/dsh-compat/session-events.js +297 -0
  96. package/lib/core/dsh-compat/shims/credentials.d.ts +62 -0
  97. package/lib/core/dsh-compat/shims/credentials.js +86 -0
  98. package/lib/core/dsh-compat/shims/home-paths.d.ts +77 -0
  99. package/lib/core/dsh-compat/shims/home-paths.js +143 -0
  100. package/lib/core/dsh-compat/tools-facade.d.ts +31 -1
  101. package/lib/core/dsh-compat/tools-facade.js +207 -3
  102. package/lib/core/err-text.d.ts +5 -0
  103. package/lib/core/err-text.js +5 -0
  104. package/lib/core/events.d.ts +31 -2
  105. package/lib/core/git-info.d.ts +127 -15
  106. package/lib/core/git-info.js +315 -34
  107. package/lib/core/git-surface.d.ts +17 -0
  108. package/lib/core/git-surface.js +7 -0
  109. package/lib/core/hooks.d.ts +19 -2
  110. package/lib/core/hooks.js +57 -13
  111. package/lib/core/host-methods.d.ts +1 -1
  112. package/lib/core/host-methods.js +4 -0
  113. package/lib/core/image-diet.js +1 -4
  114. package/lib/core/json-text.d.ts +11 -0
  115. package/lib/core/json-text.js +18 -0
  116. package/lib/core/learnings/skill-write.d.ts +1 -7
  117. package/lib/core/learnings/skill-write.js +3 -37
  118. package/lib/core/lifecycle-hooks.d.ts +11 -3
  119. package/lib/core/lifecycle-hooks.js +33 -42
  120. package/lib/core/llm.d.ts +42 -0
  121. package/lib/core/llm.js +40 -25
  122. package/lib/core/loop.d.ts +11 -1
  123. package/lib/core/loop.js +95 -28
  124. package/lib/core/lsp/client.js +30 -17
  125. package/lib/core/lsp/normalize.d.ts +0 -2
  126. package/lib/core/lsp/normalize.js +1 -6
  127. package/lib/core/lsp/servers.js +1 -4
  128. package/lib/core/mcp.d.ts +18 -0
  129. package/lib/core/mcp.js +60 -16
  130. package/lib/core/microcompact.d.ts +45 -0
  131. package/lib/core/microcompact.js +128 -0
  132. package/lib/core/native-bridge.js +2 -10
  133. package/lib/core/path-policy.d.ts +13 -1
  134. package/lib/core/path-policy.js +87 -18
  135. package/lib/core/permission-presets.d.ts +9 -5
  136. package/lib/core/permission-presets.js +14 -7
  137. package/lib/core/permission-scope.d.ts +65 -0
  138. package/lib/core/permission-scope.js +109 -0
  139. package/lib/core/plugin-bundle.d.ts +95 -0
  140. package/lib/core/plugin-bundle.js +137 -0
  141. package/lib/core/plugin-loader.d.ts +36 -1
  142. package/lib/core/plugin-loader.js +336 -12
  143. package/lib/core/plugin-patch.d.ts +64 -0
  144. package/lib/core/plugin-patch.js +146 -0
  145. package/lib/core/plugin-registry.d.ts +14 -0
  146. package/lib/core/plugin-registry.js +2 -0
  147. package/lib/core/prefs.js +40 -2
  148. package/lib/core/presets.d.ts +11 -0
  149. package/lib/core/presets.js +61 -22
  150. package/lib/core/profile-dir.d.ts +5 -0
  151. package/lib/core/profile-dir.js +40 -0
  152. package/lib/core/prompt.js +55 -19
  153. package/lib/core/ptc.d.ts +8 -2
  154. package/lib/core/ptc.js +18 -4
  155. package/lib/core/records.d.ts +16 -0
  156. package/lib/core/records.js +22 -0
  157. package/lib/core/remote/notify.js +1 -3
  158. package/lib/core/remote/push.js +2 -6
  159. package/lib/core/sandbox/execpolicy.js +27 -3
  160. package/lib/core/sandbox/net-proxy.js +2 -2
  161. package/lib/core/sandbox/policy.d.ts +1 -1
  162. package/lib/core/sandbox/policy.js +21 -15
  163. package/lib/core/sandbox/win/account.js +1 -4
  164. package/lib/core/sandbox/win/acl.js +1 -6
  165. package/lib/core/sandbox/win/backend.d.ts +24 -3
  166. package/lib/core/sandbox/win/backend.js +73 -23
  167. package/lib/core/sandbox/win/doctor.js +1 -4
  168. package/lib/core/sandbox/win/runner-entry.js +1 -6
  169. package/lib/core/sandbox/win/setup.js +1 -4
  170. package/lib/core/sandbox/win/utf16.d.ts +11 -0
  171. package/lib/core/sandbox/win/utf16.js +15 -0
  172. package/lib/core/sandbox/win/wfp.js +1 -4
  173. package/lib/core/schedule/rule.d.ts +0 -17
  174. package/lib/core/schedule/rule.js +1 -3
  175. package/lib/core/schedule/runner.d.ts +5 -2
  176. package/lib/core/schedule/runner.js +32 -9
  177. package/lib/core/schedule/store.d.ts +0 -2
  178. package/lib/core/schedule/store.js +2 -9
  179. package/lib/core/session-index.d.ts +50 -0
  180. package/lib/core/session-index.js +169 -3
  181. package/lib/core/session.d.ts +89 -13
  182. package/lib/core/session.js +385 -32
  183. package/lib/core/shell-quote.d.ts +21 -0
  184. package/lib/core/shell-quote.js +24 -0
  185. package/lib/core/side-ask.d.ts +52 -0
  186. package/lib/core/side-ask.js +89 -0
  187. package/lib/core/skills.d.ts +16 -0
  188. package/lib/core/skills.js +45 -8
  189. package/lib/core/snapshot-throttle.d.ts +8 -0
  190. package/lib/core/snapshot-throttle.js +24 -0
  191. package/lib/core/spill.d.ts +11 -5
  192. package/lib/core/spill.js +35 -36
  193. package/lib/core/strings.d.ts +21 -0
  194. package/lib/core/strings.js +33 -0
  195. package/lib/core/terminal-env.d.ts +61 -0
  196. package/lib/core/terminal-env.js +327 -0
  197. package/lib/core/text-format.d.ts +17 -0
  198. package/lib/core/text-format.js +26 -0
  199. package/lib/core/todo-reminder.d.ts +19 -14
  200. package/lib/core/todo-reminder.js +14 -23
  201. package/lib/core/token-estimate.d.ts +18 -2
  202. package/lib/core/token-estimate.js +10 -2
  203. package/lib/core/tool-result-prune.d.ts +42 -0
  204. package/lib/core/tool-result-prune.js +47 -0
  205. package/lib/core/tool-search.d.ts +3 -2
  206. package/lib/core/tool-search.js +3 -2
  207. package/lib/core/tools/bash.d.ts +35 -3
  208. package/lib/core/tools/bash.js +168 -41
  209. package/lib/core/tools/fs-tools.js +18 -17
  210. package/lib/core/tools/image-tool.d.ts +2 -0
  211. package/lib/core/tools/image-tool.js +59 -0
  212. package/lib/core/tools/path-args.d.ts +4 -0
  213. package/lib/core/tools/path-args.js +22 -0
  214. package/lib/core/tools/search-tools.d.ts +30 -0
  215. package/lib/core/tools/search-tools.js +321 -34
  216. package/lib/core/tools.d.ts +82 -0
  217. package/lib/core/tools.js +21 -0
  218. package/lib/core/transcript-text.d.ts +19 -0
  219. package/lib/core/transcript-text.js +44 -0
  220. package/lib/core/ui-boot-source.d.ts +5 -0
  221. package/lib/core/ui-boot-source.js +10 -3
  222. package/lib/core/ui-bundles.d.ts +80 -6
  223. package/lib/core/ui-bundles.js +700 -76
  224. package/lib/core/ui-events.d.ts +10 -0
  225. package/lib/core/ui-events.js +25 -0
  226. package/lib/core/ui-methods.d.ts +1 -1
  227. package/lib/core/ui-methods.js +42 -13
  228. package/lib/core/ui-route.js +11 -7
  229. package/lib/core/ui-server.d.ts +6 -0
  230. package/lib/core/ui-server.js +106 -1
  231. package/lib/core/unified-diff.d.ts +35 -0
  232. package/lib/core/unified-diff.js +86 -0
  233. package/lib/core/usage-log.js +39 -0
  234. package/lib/core/web-http.d.ts +1 -1
  235. package/lib/core/web-http.js +1 -3
  236. package/lib/host/kernel.js +57 -41
  237. package/lib/plugins/agent.js +101 -20
  238. package/lib/plugins/approval-floor.js +12 -8
  239. package/lib/plugins/approval.js +252 -80
  240. package/lib/plugins/ask.js +60 -8
  241. package/lib/plugins/browser.js +32 -84
  242. package/lib/plugins/commands.js +167 -57
  243. package/lib/plugins/compact.d.ts +2 -2
  244. package/lib/plugins/compact.js +200 -30
  245. package/lib/plugins/computer-use.js +34 -18
  246. package/lib/plugins/dock-browser.js +24 -65
  247. package/lib/plugins/dsh-compat.js +7 -0
  248. package/lib/plugins/file-review.js +59 -15
  249. package/lib/plugins/git.js +16 -8
  250. package/lib/plugins/goal.js +9 -8
  251. package/lib/plugins/hooks.js +4 -2
  252. package/lib/plugins/host-stdio.js +14 -16
  253. package/lib/plugins/lifecycle-hooks.d.ts +5 -4
  254. package/lib/plugins/lifecycle-hooks.js +12 -10
  255. package/lib/plugins/llm.js +74 -33
  256. package/lib/plugins/lsp.js +22 -27
  257. package/lib/plugins/mcp.js +16 -17
  258. package/lib/plugins/memory.js +3 -24
  259. package/lib/plugins/microcompact.d.ts +4 -1
  260. package/lib/plugins/microcompact.js +117 -19
  261. package/lib/plugins/mode.js +30 -11
  262. package/lib/plugins/permission-presets.d.ts +2 -1
  263. package/lib/plugins/permission-presets.js +55 -35
  264. package/lib/plugins/plugin-manager.js +4 -6
  265. package/lib/plugins/presets.js +56 -27
  266. package/lib/plugins/prompt.js +54 -11
  267. package/lib/plugins/ptc.d.ts +13 -0
  268. package/lib/plugins/ptc.js +121 -24
  269. package/lib/plugins/remote/types.d.ts +1 -1
  270. package/lib/plugins/remote/types.js +11 -0
  271. package/lib/plugins/remote.js +14 -15
  272. package/lib/plugins/runtime.js +91 -14
  273. package/lib/plugins/sandbox.js +181 -60
  274. package/lib/plugins/schedule.js +12 -11
  275. package/lib/plugins/self-improve.js +28 -18
  276. package/lib/plugins/session-search.js +18 -13
  277. package/lib/plugins/session-title.js +1 -1
  278. package/lib/plugins/session.js +103 -25
  279. package/lib/plugins/settings.js +16 -40
  280. package/lib/plugins/skills.js +18 -1
  281. package/lib/plugins/spill.js +18 -11
  282. package/lib/plugins/subagent.js +208 -42
  283. package/lib/plugins/team.js +11 -5
  284. package/lib/plugins/todo.d.ts +1 -1
  285. package/lib/plugins/todo.js +25 -19
  286. package/lib/plugins/tool-search.js +47 -28
  287. package/lib/plugins/tools-default.js +89 -5
  288. package/lib/plugins/tools.js +3 -3
  289. package/lib/plugins/transcript.js +116 -9
  290. package/lib/plugins/web-search.d.ts +1 -1
  291. package/lib/plugins/web-search.js +25 -16
  292. package/lib/plugins/webserver.js +40 -7
  293. package/lib/remote/assets/app-B3Id1EBq.js +14 -0
  294. package/lib/remote/assets/index.html +2 -2
  295. package/lib/remote/assets/{style-DIB6729x.css → style-NtlpbKOI.css} +1 -1
  296. package/lib/services/types.d.ts +247 -29
  297. package/lib/tools/plugin-cli.d.ts +1 -0
  298. package/lib/tools/plugin-cli.js +209 -0
  299. package/lib/ui/assets/app-B-Jx5dnh.js +90 -0
  300. package/lib/ui/assets/{chunk-BajyYBss.js → chunk-Bfdlo8Me.js} +1 -1
  301. package/lib/ui/assets/chunk-DGX-i4eb.js +12 -0
  302. package/lib/ui/assets/index.html +62 -14
  303. package/lib/ui/assets/style-WzxwEPaE.css +1 -0
  304. package/lib/ui/frames.js +1 -3
  305. package/lib/ui/index.d.ts +30 -1
  306. package/lib/ui/index.js +29 -0
  307. package/lib/ui/manifest.d.ts +24 -6
  308. package/lib/ui/manifest.js +3 -2
  309. package/lib/ui/plugins/actions/bundle.json +8 -0
  310. package/lib/ui/plugins/actions/client.js +43 -0
  311. package/lib/ui/plugins/ask/bundle.json +8 -0
  312. package/lib/ui/plugins/ask/client.js +415 -0
  313. package/lib/ui/plugins/browser/bundle.json +8 -0
  314. package/lib/ui/plugins/composer/bundle.json +9 -0
  315. package/lib/ui/plugins/composer/client.js +1806 -1087
  316. package/lib/ui/plugins/files/bundle.json +8 -0
  317. package/lib/ui/plugins/files/client.js +13 -98
  318. package/lib/ui/plugins/manifest.json +1 -104
  319. package/lib/ui/plugins/palette/bundle.json +8 -0
  320. package/lib/ui/plugins/palette/client.js +360 -0
  321. package/lib/ui/plugins/plugins/bundle.json +8 -0
  322. package/lib/ui/plugins/plugins/client.js +116 -38
  323. package/lib/ui/plugins/preview/bundle.json +8 -0
  324. package/lib/ui/plugins/preview/client.js +6 -16
  325. package/lib/ui/plugins/prompt/bundle.json +8 -0
  326. package/lib/ui/plugins/prompt/client.js +81 -47
  327. package/lib/ui/plugins/sessions/bundle.json +8 -0
  328. package/lib/ui/plugins/sessions/client.js +157 -111
  329. package/lib/ui/plugins/settings/bundle.json +8 -0
  330. package/lib/ui/plugins/settings/client.js +184 -170
  331. package/lib/ui/plugins/skills/bundle.json +8 -0
  332. package/lib/ui/plugins/skills/client.js +161 -79
  333. package/lib/ui/plugins/status/bundle.json +8 -0
  334. package/lib/ui/plugins/status/client.js +165 -26
  335. package/lib/ui/plugins/statusbar/bundle.json +9 -0
  336. package/lib/ui/plugins/statusbar/client.js +100 -144
  337. package/lib/ui/plugins/tasks/bundle.json +8 -0
  338. package/lib/ui/plugins/team/bundle.json +8 -0
  339. package/lib/ui/plugins/team/client.js +60 -58
  340. package/lib/ui/plugins/terminal/bundle.json +8 -0
  341. package/lib/ui/plugins/terminal/client.js +1 -7
  342. package/lib/ui/plugins/trace/bundle.json +11 -0
  343. package/lib/ui/plugins/trace/client.js +86 -179
  344. package/lib/ui/plugins/transcript/bundle.json +8 -0
  345. package/lib/ui/plugins/transcript/client.js +1608 -1243
  346. package/lib/ui/sdk/@dsc/ui/index.d.ts +54 -16
  347. package/lib/ui/sdk/@dsc/ui/package.json +1 -1
  348. package/lib/ui/sdk/@dsc/ui-core/contract.d.ts +20 -1968
  349. package/lib/ui/sdk/@dsc/ui-core/core/attachments.d.ts +185 -0
  350. package/lib/ui/sdk/@dsc/ui-core/core/bytes.d.ts +14 -0
  351. package/lib/ui/sdk/@dsc/ui-core/core/err-text.d.ts +18 -0
  352. package/lib/ui/sdk/@dsc/ui-core/core/git-surface.d.ts +17 -0
  353. package/lib/ui/sdk/@dsc/ui-core/core/json-text.d.ts +11 -0
  354. package/lib/ui/sdk/@dsc/ui-core/core/path-policy.d.ts +44 -0
  355. package/lib/ui/sdk/@dsc/ui-core/core/records.d.ts +16 -0
  356. package/lib/ui/sdk/@dsc/ui-core/core/throughput.d.ts +46 -0
  357. package/lib/ui/sdk/@dsc/ui-core/core/token-estimate.d.ts +18 -2
  358. package/lib/ui/sdk/@dsc/ui-core/core/unified-diff.d.ts +35 -0
  359. package/lib/ui/sdk/@dsc/ui-core/package.json +1 -1
  360. package/lib/ui/sdk/@dsc/ui-core/ui/index.d.ts +30 -1
  361. package/lib/ui/sdk/@dsc/ui-core/ui/manifest.d.ts +24 -6
  362. package/lib/ui/sdk/@dsc/ui-core/ui/services.d.ts +19 -8
  363. package/lib/ui/sdk/@dsc/ui-core/ui/signal.d.ts +49 -0
  364. package/lib/ui/sdk/@dsc/ui-dockkit/dock-model.d.ts +17 -3
  365. package/lib/ui/sdk/@dsc/ui-dockkit/dock-state.d.ts +1 -1
  366. package/lib/ui/sdk/@dsc/ui-dockkit/package.json +1 -1
  367. package/lib/ui/sdk/@dsc/ui-layout/app.d.ts +4 -0
  368. package/lib/ui/sdk/@dsc/ui-layout/appearance.d.ts +6 -1
  369. package/lib/ui/sdk/@dsc/ui-layout/host-channel.d.ts +21 -0
  370. package/lib/ui/sdk/@dsc/ui-layout/index.d.ts +1 -0
  371. package/lib/ui/sdk/@dsc/ui-layout/package.json +1 -1
  372. package/lib/ui/sdk/@dsc/ui-layout/page-state.d.ts +1 -1
  373. package/lib/ui/sdk/@dsc/ui-layout/runtime-context.d.ts +10 -1
  374. package/lib/ui/sdk/@dsc/ui-layout/thread-view.d.ts +1 -1
  375. package/lib/ui/sdk/@dsc/ui-layout/usage-today.d.ts +11 -0
  376. package/lib/ui/sdk/@dsc/ui-primitives/dialog-focus.d.ts +30 -0
  377. package/lib/ui/sdk/@dsc/ui-primitives/error-text.d.ts +12 -0
  378. package/lib/ui/sdk/@dsc/ui-primitives/git-surface.d.ts +9 -0
  379. package/lib/ui/sdk/@dsc/ui-primitives/highlight.d.ts +23 -0
  380. package/lib/ui/sdk/@dsc/ui-primitives/humanize-error.d.ts +35 -0
  381. package/lib/ui/sdk/@dsc/ui-primitives/icons-workspace.d.ts +33 -0
  382. package/lib/ui/sdk/@dsc/ui-primitives/icons.d.ts +21 -3
  383. package/lib/ui/sdk/@dsc/ui-primitives/image-lightbox.d.ts +21 -0
  384. package/lib/ui/sdk/@dsc/ui-primitives/index.d.ts +16 -0
  385. package/lib/ui/sdk/@dsc/ui-primitives/markdown.d.ts +10 -14
  386. package/lib/ui/sdk/@dsc/ui-primitives/package.json +1 -1
  387. package/lib/ui/sdk/@dsc/ui-primitives/panels.d.ts +31 -8
  388. package/lib/ui/sdk/@dsc/ui-primitives/paths.d.ts +2 -0
  389. package/lib/ui/sdk/@dsc/ui-primitives/review-findings-card.d.ts +25 -0
  390. package/lib/ui/sdk/@dsc/ui-primitives/review-findings.d.ts +64 -0
  391. package/lib/ui/sdk/@dsc/ui-primitives/review-notice-card.d.ts +27 -0
  392. package/lib/ui/sdk/@dsc/ui-primitives/review-notice.d.ts +80 -0
  393. package/lib/ui/sdk/@dsc/ui-primitives/signal.d.ts +9 -0
  394. package/lib/ui/sdk/@dsc/ui-primitives/sizes.d.ts +15 -0
  395. package/lib/ui/sdk/@dsc/ui-primitives/skeleton.d.ts +39 -0
  396. package/lib/ui/sdk/@dsc/ui-primitives/snapshot.d.ts +46 -0
  397. package/lib/ui/sdk/@dsc/ui-primitives/thread-resizer.d.ts +3 -3
  398. package/lib/ui/sdk/@dsc/ui-primitives/throughput.d.ts +13 -0
  399. package/lib/ui/sdk/@dsc/ui-primitives/tokens.d.ts +9 -0
  400. package/lib/ui/sdk/@dsc/ui-primitives/tool-args.d.ts +1 -1
  401. package/lib/ui/sdk/@dsc/ui-primitives/tool-summary.d.ts +30 -6
  402. package/lib/ui/sdk/@dsc/ui-primitives/unified-diff.d.ts +10 -0
  403. package/lib/ui/sdk/@dsc/ui-renderer/boot.d.ts +10 -1
  404. package/lib/ui/sdk/@dsc/ui-renderer/cordis-host.d.ts +113 -0
  405. package/lib/ui/sdk/@dsc/ui-renderer/package.json +1 -1
  406. package/lib/ui/sdk/@dsc/ui-slots/package.json +1 -1
  407. package/lib/ui/services.d.ts +19 -8
  408. package/lib/ui/services.js +20 -12
  409. package/lib/ui/signal.d.ts +49 -0
  410. package/lib/ui/signal.js +57 -0
  411. package/lib/ui/tui-plugins.js +36 -16
  412. package/package.json +71 -58
  413. package/lib/remote/assets/app-DAcUCOEn.js +0 -14
  414. package/lib/ui/assets/app-B70nVIKd.js +0 -69
  415. package/lib/ui/assets/chunk-BGcgwlCI.js +0 -12
  416. package/lib/ui/assets/style-Bq01xH_b.css +0 -1
@@ -12,9 +12,6 @@ const RISK_LABELS = {
12
12
  write: "写入",
13
13
  exec: "执行"
14
14
  };
15
- function text$4(error) {
16
- return error instanceof Error ? error.message : String(error);
17
- }
18
15
  function PresetsGroup() {
19
16
  const channel = ui$1.useHostChannel();
20
17
  const [surface, setSurface] = react.useState(null);
@@ -25,11 +22,11 @@ function PresetsGroup() {
25
22
  const [note, setNote] = react.useState(null);
26
23
  const reload = () => {
27
24
  void channel.invoke("listPresets").then(setSurface).catch((error) => {
28
- setNote({ tone: "error", text: `读取模式清单失败:${text$4(error)}` });
25
+ setNote({ tone: "error", text: `读取模式清单失败:${uiPrimitives.errText(error)}` });
29
26
  });
30
27
  void channel.invoke("listTools").then(setTools).catch((error) => {
31
28
  setTools([]);
32
- setNote({ tone: "error", text: `读取工具目录失败,工具多选这一块是空的:${text$4(error)}` });
29
+ setNote({ tone: "error", text: `读取工具目录失败,工具多选这一块是空的:${uiPrimitives.errText(error)}` });
33
30
  });
34
31
  };
35
32
  react.useEffect(reload, [channel]);
@@ -43,7 +40,7 @@ function PresetsGroup() {
43
40
  setNote({ tone: "ok", text: result.notice ?? okText ?? "已保存" });
44
41
  reload();
45
42
  }).catch((error) => {
46
- setNote({ tone: "error", text: `操作失败:${text$4(error)}` });
43
+ setNote({ tone: "error", text: `操作失败:${uiPrimitives.errText(error)}` });
47
44
  });
48
45
  };
49
46
  const finishDraft = (result) => {
@@ -59,12 +56,12 @@ function PresetsGroup() {
59
56
  setNote(null);
60
57
  void channel.invoke("readPreset", [name]).then((result) => {
61
58
  if (!result.ok) {
62
- setNote({ tone: "error", text: `读取失败:${result.error}` });
59
+ setNote({ tone: "error", text: `读取失败:${uiPrimitives.humanErrorText(result.error).text}` });
63
60
  return;
64
61
  }
65
62
  setPeek({ name, text: result.text });
66
63
  }).catch((error) => {
67
- setNote({ tone: "error", text: `读取失败:${text$4(error)}` });
64
+ setNote({ tone: "error", text: `读取失败:${uiPrimitives.humanErrorText(error).text}` });
68
65
  });
69
66
  };
70
67
  if (surface === null) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "settings-empty", children: "正在读取模式…" });
@@ -479,9 +476,9 @@ function readSizeMarker(id) {
479
476
  return Math.round(value * scale);
480
477
  }
481
478
  function readModalityMarkers(id) {
482
- const text2 = id.toLowerCase();
483
- const image = /(^|[^a-z0-9])(vl|vlm|vision|multimodal|omni|image)([^a-z0-9]|$)/.test(text2);
484
- const video = /(^|[^a-z0-9])(video|omni)([^a-z0-9]|$)/.test(text2);
479
+ const text = id.toLowerCase();
480
+ const image = /(^|[^a-z0-9])(vl|vlm|vision|multimodal|omni|image)([^a-z0-9]|$)/.test(text);
481
+ const video = /(^|[^a-z0-9])(video|omni)([^a-z0-9]|$)/.test(text);
485
482
  return { image, video };
486
483
  }
487
484
  function familyRule(id) {
@@ -574,9 +571,6 @@ function inferModelCaps(id, known) {
574
571
  };
575
572
  }
576
573
  const NEW_PROVIDER_KEY = "__new__";
577
- function text$3(error) {
578
- return error instanceof Error ? error.message : String(error);
579
- }
580
574
  function probeKeyOf(provider, model) {
581
575
  return `${provider}/${model}`;
582
576
  }
@@ -760,7 +754,7 @@ function ModelsGroup() {
760
754
  void channel.invoke("getModelConfig").then((value) => {
761
755
  setConfig(value);
762
756
  }).catch((error) => {
763
- ui$1.toastErr(`读取模型配置失败:${text$3(error)}`);
757
+ ui$1.toastErr(`读取模型配置失败:${uiPrimitives.errText(error)}`);
764
758
  });
765
759
  };
766
760
  react.useEffect(reload, [channel]);
@@ -774,7 +768,7 @@ function ModelsGroup() {
774
768
  ui$1.toastOk(result.notice ?? "默认模型已更新");
775
769
  reload();
776
770
  }).catch((error) => {
777
- ui$1.toastErr(`操作失败:${text$3(error)}`);
771
+ ui$1.toastErr(`操作失败:${uiPrimitives.errText(error)}`);
778
772
  reload();
779
773
  });
780
774
  };
@@ -789,7 +783,7 @@ function ModelsGroup() {
789
783
  reload();
790
784
  return true;
791
785
  }).catch((error) => {
792
- ui$1.toastErr(`操作失败:${text$3(error)}`);
786
+ ui$1.toastErr(`操作失败:${uiPrimitives.errText(error)}`);
793
787
  reload();
794
788
  return false;
795
789
  });
@@ -799,7 +793,7 @@ function ModelsGroup() {
799
793
  void channel.invoke("discoverModels", [provider]).then((models) => {
800
794
  setDiscovered({ provider, models });
801
795
  }).catch((error) => {
802
- ui$1.toastErr(`拉取失败:${text$3(error)}`);
796
+ ui$1.toastErr(`拉取失败:${uiPrimitives.errText(error)}`);
803
797
  }).finally(() => {
804
798
  setDiscovering((current2) => {
805
799
  const next = new Set(current2);
@@ -820,8 +814,8 @@ function ModelsGroup() {
820
814
  ui$1.toastErr(`${provider}/${model} 没通:${result.error ?? "未知原因"}`);
821
815
  }
822
816
  }).catch((error) => {
823
- setProbed((current2) => new Map(current2).set(key, { ok: false, model, ms: 0, reply: "", error: text$3(error) }));
824
- ui$1.toastErr(`测试失败:${text$3(error)}`);
817
+ setProbed((current2) => new Map(current2).set(key, { ok: false, model, ms: 0, reply: "", error: uiPrimitives.errText(error) }));
818
+ ui$1.toastErr(`测试失败:${uiPrimitives.errText(error)}`);
825
819
  }).finally(() => {
826
820
  setTesting((current2) => {
827
821
  const next = new Set(current2);
@@ -892,7 +886,7 @@ function ModelsGroup() {
892
886
  }
893
887
  reload();
894
888
  } catch (error) {
895
- ui$1.toastErr(`保存失败:${text$3(error)}`);
889
+ ui$1.toastErr(`保存失败:${uiPrimitives.errText(error)}`);
896
890
  }
897
891
  })();
898
892
  };
@@ -1887,16 +1881,7 @@ function DiscoverDialog(props) {
1887
1881
  );
1888
1882
  const selectable = filtered.filter((id) => !existing.has(id));
1889
1883
  const chosenVisible = selectable.filter((id) => chosen.has(id)).length;
1890
- const onClose = props.onClose;
1891
- react.useEffect(() => {
1892
- const onKey = (event) => {
1893
- if (event.key === "Escape") onClose();
1894
- };
1895
- window.addEventListener("keydown", onKey);
1896
- return () => {
1897
- window.removeEventListener("keydown", onKey);
1898
- };
1899
- }, [onClose]);
1884
+ const dialog = uiPrimitives.useDialogFocus(provider !== null, props.onClose);
1900
1885
  if (provider === null) return null;
1901
1886
  const toggle = (id) => {
1902
1887
  setChosen((current) => {
@@ -1928,7 +1913,7 @@ function DiscoverDialog(props) {
1928
1913
  onClick: (event) => {
1929
1914
  if (event.target === event.currentTarget) props.onClose();
1930
1915
  },
1931
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "dsc-overlay__card models-discover-card", children: [
1916
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "dsc-overlay__card models-discover-card", ref: dialog.ref, children: [
1932
1917
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "models-discover-head", children: [
1933
1918
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "models-discover-title", children: [
1934
1919
  "线上模型清单 · ",
@@ -2022,27 +2007,9 @@ function DiscoverDialog(props) {
2022
2007
  }
2023
2008
  );
2024
2009
  }
2025
- function text$2(error) {
2026
- return error instanceof Error ? error.message : String(error);
2027
- }
2028
- const SERIES_COLORS = [
2029
- "var(--dsc-accent)",
2030
- "var(--dsc-green)",
2031
- "var(--dsc-orange)",
2032
- "var(--dsc-purple)"
2033
- ];
2034
- function fmtTokens(value) {
2035
- if (value >= 1e8) return `${(value / 1e8).toFixed(value >= 1e9 ? 1 : 2)} 亿`;
2036
- if (value >= 1e4) return `${(value / 1e4).toFixed(1)} 万`;
2037
- return String(value);
2038
- }
2039
- function fmtDate(dateKey) {
2040
- const [, month, day] = dateKey.split("-");
2041
- return `${String(Number(month))} 月 ${String(Number(day))} 日`;
2042
- }
2043
2010
  const CELL = 10;
2044
2011
  const GAP = 3;
2045
- function buildCells(days) {
2012
+ function buildCells(days, windowDays) {
2046
2013
  const max = Math.max(1, ...days.map((day) => day.inputTokens + day.outputTokens));
2047
2014
  const level = (day) => {
2048
2015
  const tokens = day.inputTokens + day.outputTokens;
@@ -2059,7 +2026,9 @@ function buildCells(days) {
2059
2026
  let lastMonth = -1;
2060
2027
  const pushDay = (cell, date) => {
2061
2028
  if (date.getMonth() !== lastMonth) {
2062
- if (current.length < 7) months.push({ column: columns.length, label: `${String(date.getMonth() + 1)}月` });
2029
+ if (current.length < 7 && !months.some((month) => month.column === columns.length)) {
2030
+ months.push({ column: columns.length, label: `${String(date.getMonth() + 1)}月` });
2031
+ }
2063
2032
  lastMonth = date.getMonth();
2064
2033
  }
2065
2034
  current.push(cell);
@@ -2071,7 +2040,7 @@ function buildCells(days) {
2071
2040
  const today = /* @__PURE__ */ new Date();
2072
2041
  today.setHours(12, 0, 0, 0);
2073
2042
  const firstDate = /* @__PURE__ */ new Date(`${days[0]?.date ?? ""}T12:00:00`);
2074
- const windowStart = new Date(today.getTime() - 52 * 7 * 864e5);
2043
+ const windowStart = new Date(today.getTime() - Math.max(0, windowDays - 1) * 864e5);
2075
2044
  const alignedStart = new Date(Math.min(firstDate.getTime(), windowStart.getTime()));
2076
2045
  alignedStart.setDate(alignedStart.getDate() - alignedStart.getDay());
2077
2046
  for (let at = new Date(alignedStart); at < firstDate; at.setDate(at.getDate() + 1)) {
@@ -2083,32 +2052,51 @@ function buildCells(days) {
2083
2052
  if (current.length > 0) columns.push(current);
2084
2053
  return { columns, months };
2085
2054
  }
2055
+ const SERIES_COLORS = [
2056
+ "var(--dsc-accent)",
2057
+ "var(--dsc-green)",
2058
+ "var(--dsc-orange)",
2059
+ "var(--dsc-purple)"
2060
+ ];
2061
+ function fmtTokens(value) {
2062
+ if (value >= 1e8) return `${(value / 1e8).toFixed(value >= 1e9 ? 1 : 2)} 亿`;
2063
+ if (value >= 1e4) return `${(value / 1e4).toFixed(1)} 万`;
2064
+ return String(value);
2065
+ }
2066
+ function fmtDate(dateKey) {
2067
+ const [, month, day] = dateKey.split("-");
2068
+ return `${String(Number(month))} 月 ${String(Number(day))} 日`;
2069
+ }
2086
2070
  function Heatmap(props) {
2087
- const { columns, months } = react.useMemo(() => buildCells(props.days), [props.days]);
2071
+ const { columns, months } = react.useMemo(() => buildCells(props.days, props.windowDays), [props.days, props.windowDays]);
2088
2072
  if (props.days.length === 0) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "settings-empty", children: "还没有逐日记录。" });
2089
2073
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hm", children: [
2090
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hm-months", style: { marginLeft: 26 }, children: months.map((month) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: { left: month.column * (CELL + GAP) }, children: month.label }, `${String(month.column)}-${month.label}`)) }),
2091
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hm-body", children: [
2092
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hm-weekdays", children: [
2093
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { gridRow: 2 }, children: "一" }),
2094
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { gridRow: 4 }, children: "三" }),
2095
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { gridRow: 6 }, children: "五" })
2096
- ] }),
2097
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hm-grid", role: "img", "aria-label": "Token 活动热力图", children: columns.map(
2098
- (column, columnIndex) => column.map((cell, rowIndex) => {
2099
- if (cell === null) return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hm-cell hm-l0" }, `${String(columnIndex)}-${String(rowIndex)}`);
2100
- const tokens = cell.day.inputTokens + cell.day.outputTokens;
2101
- return /* @__PURE__ */ jsxRuntime.jsx(
2102
- "span",
2103
- {
2104
- className: `hm-cell hm-l${String(cell.level)}`,
2105
- title: `${cell.day.date} · ${fmtTokens(tokens)} tokens · ${String(cell.day.turns)} 轮`
2106
- },
2107
- `${String(columnIndex)}-${String(rowIndex)}`
2108
- );
2109
- })
2110
- ) })
2111
- ] }),
2074
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hm-scroll", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hm-canvas", children: [
2075
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hm-months", style: { marginLeft: 26 }, children: months.map((month) => /* @__PURE__ */ jsxRuntime.jsx("span", { style: { left: month.column * (CELL + GAP) }, children: month.label }, `${String(month.column)}-${month.label}`)) }),
2076
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hm-body", children: [
2077
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hm-weekdays", children: [
2078
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { gridRow: 2 }, children: "一" }),
2079
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { gridRow: 4 }, children: "三" }),
2080
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { gridRow: 6 }, children: "五" })
2081
+ ] }),
2082
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hm-grid", role: "img", "aria-label": "Token 活动热力图", children: columns.map(
2083
+ (column, columnIndex) => column.map((cell, rowIndex) => {
2084
+ if (cell === null) {
2085
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "hm-cell hm-l0" }, `${String(columnIndex)}-${String(rowIndex)}`);
2086
+ }
2087
+ const tokens = cell.day.inputTokens + cell.day.outputTokens;
2088
+ return /* @__PURE__ */ jsxRuntime.jsx(
2089
+ "span",
2090
+ {
2091
+ className: `hm-cell hm-l${String(cell.level)}`,
2092
+ title: `${cell.day.date} · ${fmtTokens(tokens)} tokens · ${String(cell.day.turns)} 轮`
2093
+ },
2094
+ `${String(columnIndex)}-${String(rowIndex)}`
2095
+ );
2096
+ })
2097
+ ) })
2098
+ ] })
2099
+ ] }) }),
2112
2100
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hm-legend", children: [
2113
2101
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "少" }),
2114
2102
  [0, 1, 2, 3, 4].map((level) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: `hm-cell hm-l${String(level)}` }, level)),
@@ -2236,21 +2224,28 @@ function UsageGroup() {
2236
2224
  const [stats, setStats] = react.useState(null);
2237
2225
  const [error, setError] = react.useState("");
2238
2226
  const [range, setRange] = react.useState(7);
2227
+ const [heatRange, setHeatRange] = react.useState(364);
2239
2228
  const reload = () => {
2240
2229
  channel.invoke("usageStats").then((next) => {
2241
2230
  setStats(next);
2242
2231
  setError("");
2243
- }).catch((err) => setError(text$2(err)));
2232
+ }).catch((err) => setError(uiPrimitives.errText(err)));
2244
2233
  };
2245
2234
  react.useEffect(reload, [channel]);
2246
2235
  if (error !== "") {
2247
2236
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "settings-empty", children: [
2248
2237
  "用量统计读取失败:",
2249
- error,
2238
+ uiPrimitives.humanErrorText(error).text,
2250
2239
  /* @__PURE__ */ jsxRuntime.jsx("button", { className: "text-btn", onClick: reload, style: { marginLeft: 8 }, children: "重试" })
2251
2240
  ] });
2252
2241
  }
2253
- if (stats === null) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "settings-empty", children: "正在读取用量记录…" });
2242
+ if (stats === null) {
2243
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "settings-loading", role: "status", "aria-label": "正在读取用量记录", children: [
2244
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "settings-loading-cards", children: Array.from({ length: 4 }, (_, index) => /* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.Skeleton, { height: 62, radius: 12 }, index)) }),
2245
+ /* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.Skeleton, { height: 148, radius: 12 }),
2246
+ /* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.SkeletonText, { lines: 3 })
2247
+ ] });
2248
+ }
2254
2249
  if (stats.sinceTs === null) {
2255
2250
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "settings-empty usage-empty", children: [
2256
2251
  /* @__PURE__ */ jsxRuntime.jsx(ui$1.IconChart, { size: 22 }),
@@ -2264,6 +2259,7 @@ function UsageGroup() {
2264
2259
  }
2265
2260
  const total = stats.totalInputTokens + stats.totalOutputTokens;
2266
2261
  const trendDays = stats.days.slice(-range);
2262
+ const heatDays = stats.days.slice(-heatRange);
2267
2263
  const cards = [
2268
2264
  { label: "累计 Token", value: fmtTokens(total) },
2269
2265
  {
@@ -2289,16 +2285,22 @@ function UsageGroup() {
2289
2285
  /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "usage-block", children: [
2290
2286
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usage-block-head", children: [
2291
2287
  /* @__PURE__ */ jsxRuntime.jsx("h3", { children: "Token 活动" }),
2292
- /* @__PURE__ */ jsxRuntime.jsx(
2293
- "span",
2288
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dsc-segmented", role: "group", "aria-label": "热力图时间范围", children: [1, 7, 30, 364].map((value) => /* @__PURE__ */ jsxRuntime.jsx(
2289
+ "button",
2294
2290
  {
2295
- className: "usage-block-hint",
2291
+ type: "button",
2292
+ className: "dsc-segmented__btn",
2293
+ "aria-selected": heatRange === value,
2296
2294
  title: `${fmtDate(firstDay.date)} 至今 · 累计 ${fmtTokens(total)} tokens`,
2297
- children: "最近一年"
2298
- }
2299
- )
2295
+ onClick: () => {
2296
+ setHeatRange(value);
2297
+ },
2298
+ children: value === 1 ? "今天" : value === 364 ? "近一年" : `近 ${String(value)} 天`
2299
+ },
2300
+ value
2301
+ )) })
2300
2302
  ] }),
2301
- /* @__PURE__ */ jsxRuntime.jsx(Heatmap, { days: stats.days })
2303
+ /* @__PURE__ */ jsxRuntime.jsx(Heatmap, { days: heatDays, windowDays: heatRange })
2302
2304
  ] }),
2303
2305
  /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "usage-block", children: [
2304
2306
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "usage-block-head", children: [
@@ -2336,9 +2338,6 @@ function UsageGroup() {
2336
2338
  ] })
2337
2339
  ] });
2338
2340
  }
2339
- function text$1(error) {
2340
- return error instanceof Error ? error.message : String(error);
2341
- }
2342
2341
  function groupByWorkspace(items) {
2343
2342
  const map = /* @__PURE__ */ new Map();
2344
2343
  for (const item of items) {
@@ -2366,7 +2365,7 @@ function ArchiveGroup() {
2366
2365
  const [page, setPage] = react.useState(null);
2367
2366
  const [note, setNote] = react.useState(null);
2368
2367
  const load = () => {
2369
- void channel.invoke("listArchivedSessions").then(setPage).catch((error) => setNote({ tone: "error", text: `读取归档失败:${text$1(error)}` }));
2368
+ void channel.invoke("listArchivedSessions").then(setPage).catch((error) => setNote({ tone: "error", text: `读取归档失败:${uiPrimitives.humanErrorText(error).text}` }));
2370
2369
  };
2371
2370
  const reload = () => {
2372
2371
  setNote(null);
@@ -2382,7 +2381,7 @@ function ArchiveGroup() {
2382
2381
  }
2383
2382
  setNote({ tone: "ok", text: result.notice ?? fallbackNotice });
2384
2383
  load();
2385
- }).catch((error) => setNote({ tone: "error", text: `操作失败:${text$1(error)}` }));
2384
+ }).catch((error) => setNote({ tone: "error", text: `操作失败:${uiPrimitives.humanErrorText(error).text}` }));
2386
2385
  };
2387
2386
  const openTrash = (trashDir) => {
2388
2387
  setNote(null);
@@ -2390,7 +2389,7 @@ function ArchiveGroup() {
2390
2389
  if (problem === "") setNote({ tone: "ok", text: "已在文件管理器中打开回收站" });
2391
2390
  else setNote({ tone: "error", text: `打开失败:${problem}` });
2392
2391
  }).catch(
2393
- (error) => setNote({ tone: "error", text: `这个窗口里没有原生桥,打不开目录(桌面窗口可用):${text$1(error)}` })
2392
+ (error) => setNote({ tone: "error", text: `这个窗口里没有原生桥,打不开目录(桌面窗口可用):${uiPrimitives.errText(error)}` })
2394
2393
  );
2395
2394
  };
2396
2395
  const groups = react.useMemo(() => groupByWorkspace(page?.items ?? []), [page]);
@@ -2408,7 +2407,11 @@ function ArchiveGroup() {
2408
2407
  " 刷新"
2409
2408
  ] })
2410
2409
  ] }),
2411
- page.items.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "settings-empty", children: "归档区是空的。在侧边栏会话行点击归档按钮可归档单个会话,或在工作区行点击归档按钮归档整组会话。" }),
2410
+ page.items.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "empty-card compact", children: [
2411
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "empty-card-icon", children: /* @__PURE__ */ jsxRuntime.jsx(ui$1.IconArchive, { size: 18 }) }),
2412
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "empty-card-title", children: "归档区是空的" }),
2413
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "empty-card-desc", children: "侧栏会话行的归档按钮收单个会话,工作区行的归档按钮收整组。放这儿的东西 30 天后自动清理。" })
2414
+ ] }),
2412
2415
  groups.map((group) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "arch-group", children: [
2413
2416
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "arch-group-head", children: [
2414
2417
  /* @__PURE__ */ jsxRuntime.jsx(ui$1.IconArchive, { size: 14 }),
@@ -4526,7 +4529,7 @@ function requireBrowser() {
4526
4529
  const QRCode2 = requireQrcode();
4527
4530
  const CanvasRenderer = requireCanvas();
4528
4531
  const SvgRenderer = requireSvgTag();
4529
- function renderCanvas(renderFunc, canvas2, text2, opts, cb) {
4532
+ function renderCanvas(renderFunc, canvas2, text, opts, cb) {
4530
4533
  const args = [].slice.call(arguments, 1);
4531
4534
  const argsNum = args.length;
4532
4535
  const isLastArgCb = typeof args[argsNum - 1] === "function";
@@ -4538,8 +4541,8 @@ function requireBrowser() {
4538
4541
  throw new Error("Too few arguments provided");
4539
4542
  }
4540
4543
  if (argsNum === 2) {
4541
- cb = text2;
4542
- text2 = canvas2;
4544
+ cb = text;
4545
+ text = canvas2;
4543
4546
  canvas2 = opts = void 0;
4544
4547
  } else if (argsNum === 3) {
4545
4548
  if (canvas2.getContext && typeof cb === "undefined") {
@@ -4547,8 +4550,8 @@ function requireBrowser() {
4547
4550
  opts = void 0;
4548
4551
  } else {
4549
4552
  cb = opts;
4550
- opts = text2;
4551
- text2 = canvas2;
4553
+ opts = text;
4554
+ text = canvas2;
4552
4555
  canvas2 = void 0;
4553
4556
  }
4554
4557
  }
@@ -4557,16 +4560,16 @@ function requireBrowser() {
4557
4560
  throw new Error("Too few arguments provided");
4558
4561
  }
4559
4562
  if (argsNum === 1) {
4560
- text2 = canvas2;
4563
+ text = canvas2;
4561
4564
  canvas2 = opts = void 0;
4562
4565
  } else if (argsNum === 2 && !canvas2.getContext) {
4563
- opts = text2;
4564
- text2 = canvas2;
4566
+ opts = text;
4567
+ text = canvas2;
4565
4568
  canvas2 = void 0;
4566
4569
  }
4567
4570
  return new Promise(function(resolve, reject) {
4568
4571
  try {
4569
- const data = QRCode2.create(text2, opts);
4572
+ const data = QRCode2.create(text, opts);
4570
4573
  resolve(renderFunc(data, canvas2, opts));
4571
4574
  } catch (e) {
4572
4575
  reject(e);
@@ -4574,7 +4577,7 @@ function requireBrowser() {
4574
4577
  });
4575
4578
  }
4576
4579
  try {
4577
- const data = QRCode2.create(text2, opts);
4580
+ const data = QRCode2.create(text, opts);
4578
4581
  cb(null, renderFunc(data, canvas2, opts));
4579
4582
  } catch (e) {
4580
4583
  cb(e);
@@ -4685,8 +4688,8 @@ function PairModal(props) {
4685
4688
  document.addEventListener("keydown", onKey, true);
4686
4689
  return () => document.removeEventListener("keydown", onKey, true);
4687
4690
  }, []);
4688
- const copy = (text2) => {
4689
- void navigator.clipboard.writeText(text2).then(
4691
+ const copy = (text) => {
4692
+ void navigator.clipboard.writeText(text).then(
4690
4693
  () => ui$1.toastOk("已复制"),
4691
4694
  () => ui$1.toastErr("复制失败,请手动选中")
4692
4695
  );
@@ -4765,9 +4768,6 @@ function PairModal(props) {
4765
4768
  document.body
4766
4769
  );
4767
4770
  }
4768
- function text(error) {
4769
- return error instanceof Error ? error.message : String(error);
4770
- }
4771
4771
  const HIDDEN_SECTIONS = /* @__PURE__ */ new Set(["skills"]);
4772
4772
  function sectionIcon(id) {
4773
4773
  const size = 15;
@@ -4779,12 +4779,9 @@ function sectionIcon(id) {
4779
4779
  if (id === "about") return /* @__PURE__ */ jsxRuntime.jsx(ui$1.IconInfo, { size });
4780
4780
  return /* @__PURE__ */ jsxRuntime.jsx(ui$1.IconGear, { size });
4781
4781
  }
4782
- let settingsOpen = false;
4783
- const listeners = /* @__PURE__ */ new Set();
4782
+ const settingsOpen = ui$1.createSignal(false);
4784
4783
  function setSettingsOpen(next) {
4785
- if (next === settingsOpen) return;
4786
- settingsOpen = next;
4787
- for (const listener of listeners) listener();
4784
+ settingsOpen.set(next);
4788
4785
  }
4789
4786
  const ui = ui$1.defineUiPlugin({
4790
4787
  name: "设置",
@@ -4798,6 +4795,9 @@ function SettingsPanel() {
4798
4795
  const [sections, setSections] = react.useState(null);
4799
4796
  const [active, setActive] = react.useState("");
4800
4797
  const [loadError, setLoadError] = react.useState("");
4798
+ const dialog = uiPrimitives.useDialogFocus(open, () => {
4799
+ setSettingsOpen(false);
4800
+ });
4801
4801
  react.useEffect(() => {
4802
4802
  const onOpen = (event) => {
4803
4803
  setSettingsOpen(true);
@@ -4807,17 +4807,6 @@ function SettingsPanel() {
4807
4807
  window.addEventListener("shell.settings.open", onOpen);
4808
4808
  return () => window.removeEventListener("shell.settings.open", onOpen);
4809
4809
  }, []);
4810
- react.useEffect(() => {
4811
- if (!open) return void 0;
4812
- const onKey = (event) => {
4813
- if (event.key !== "Escape") return;
4814
- if (event.defaultPrevented) return;
4815
- event.preventDefault();
4816
- setSettingsOpen(false);
4817
- };
4818
- window.addEventListener("keydown", onKey);
4819
- return () => window.removeEventListener("keydown", onKey);
4820
- }, [open]);
4821
4810
  const loadSections = react.useCallback(() => {
4822
4811
  setLoadError("");
4823
4812
  void channel.invoke("getSettingsSections").then((all) => {
@@ -4826,19 +4815,39 @@ function SettingsPanel() {
4826
4815
  setActive((current) => list.some((item) => item.id === current) ? current : list[0]?.id ?? "");
4827
4816
  }).catch((error) => {
4828
4817
  setSections([]);
4829
- setLoadError(text(error));
4818
+ setLoadError(uiPrimitives.humanErrorText(error).text);
4830
4819
  });
4831
4820
  }, [channel]);
4832
4821
  react.useEffect(() => {
4833
4822
  if (!open) return;
4834
4823
  loadSections();
4835
4824
  }, [open, loadSections]);
4825
+ react.useEffect(() => {
4826
+ if (sections === null) loadSections();
4827
+ }, [sections, loadSections]);
4828
+ const nav = react.useMemo(
4829
+ () => (sections ?? []).filter((section2) => !HIDDEN_SECTIONS.has(section2.id)).map((section2) => ({ id: section2.id, title: section2.title, subtitle: section2.subtitle })),
4830
+ [sections]
4831
+ );
4832
+ const actions = ui$1.useService(ui$1.ACTIONS_SERVICE);
4833
+ react.useEffect(() => {
4834
+ if (actions === void 0 || sections === null) return void 0;
4835
+ return actions.register(
4836
+ "settings",
4837
+ nav.map((item) => ({
4838
+ id: `settings.${item.id}`,
4839
+ label: `设置 · ${item.title}`,
4840
+ ...item.subtitle === void 0 ? {} : { hint: item.subtitle },
4841
+ group: "设置",
4842
+ keywords: ["设置", "settings", item.id],
4843
+ run: () => {
4844
+ setActive(item.id);
4845
+ setSettingsOpen(true);
4846
+ }
4847
+ }))
4848
+ );
4849
+ }, [actions, nav, sections]);
4836
4850
  if (!open) return null;
4837
- const nav = (sections ?? []).filter((section2) => !HIDDEN_SECTIONS.has(section2.id)).map((section2) => ({
4838
- id: section2.id,
4839
- title: section2.title,
4840
- subtitle: section2.subtitle
4841
- }));
4842
4851
  const section = (sections ?? []).find((item) => item.id === active && !HIDDEN_SECTIONS.has(item.id));
4843
4852
  const head = nav.find((item) => item.id === active);
4844
4853
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -4848,7 +4857,7 @@ function SettingsPanel() {
4848
4857
  onMouseDown: (event) => {
4849
4858
  if (event.target === event.currentTarget) setSettingsOpen(false);
4850
4859
  },
4851
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "settings", role: "dialog", "aria-modal": "true", "aria-label": "Pneuma 设置", children: [
4860
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "settings", role: "dialog", "aria-modal": "true", "aria-label": "Pneuma 设置", ref: dialog.ref, children: [
4852
4861
  /* @__PURE__ */ jsxRuntime.jsxs("nav", { className: "settings-nav", children: [
4853
4862
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "settings-nav-head", children: "设置" }),
4854
4863
  nav.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
@@ -4890,7 +4899,18 @@ function SettingsPanel() {
4890
4899
  }
4891
4900
  )
4892
4901
  ] }),
4893
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `settings-body${active === "models" ? " settings-body-fill" : ""}`, children: active === "" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "settings-empty", children: loadError === "" ? "正在读取分区…" : `分区加载失败:${loadError}` }) : section === void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "settings-empty", children: [
4902
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `settings-body${active === "models" ? " settings-body-fill" : ""}`, children: active === "" ? loadError === "" ? (
4903
+ // 数据还没回来:画骨架而不是一行灰字(P0-2)。高度按真实分区估:
4904
+ // 标题 + 一句副标题 + 两组字段,读完不会"先缩后弹"。
4905
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "settings-loading", role: "status", "aria-label": "正在读取设置分区", children: [
4906
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "settings-loading-head", children: [
4907
+ /* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.Skeleton, { width: 168, height: 17, radius: 5 }),
4908
+ /* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.Skeleton, { width: 300, height: 11 })
4909
+ ] }),
4910
+ /* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.SkeletonText, { lines: 4 }),
4911
+ /* @__PURE__ */ jsxRuntime.jsx(uiPrimitives.SkeletonText, { lines: 2, widths: ["100%", "48%"] })
4912
+ ] })
4913
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "settings-empty", children: `分区加载失败:${loadError}` }) : section === void 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "settings-empty", children: [
4894
4914
  "分区加载失败:",
4895
4915
  loadError === "" ? "未知分区" : loadError
4896
4916
  ] }) : section.custom ? section.id === "presets" ? /* @__PURE__ */ jsxRuntime.jsx(PresetsGroup, {}) : section.id === "models" ? /* @__PURE__ */ jsxRuntime.jsx(ModelsGroup, {}) : section.id === "usage" ? /* @__PURE__ */ jsxRuntime.jsx(UsageGroup, {}) : section.id === "archive" ? /* @__PURE__ */ jsxRuntime.jsx(ArchiveGroup, {}) : /* @__PURE__ */ jsxRuntime.jsx(NotYetPanel, { section }) : (
@@ -4930,7 +4950,7 @@ function GenericFields({
4930
4950
  void channel.invoke("getSectionValues", [section.id]).then((next) => {
4931
4951
  if (alive) setValues(next);
4932
4952
  }).catch((error) => {
4933
- if (alive) setNote({ tone: "error", text: `读取设置失败:${text(error)}` });
4953
+ if (alive) setNote({ tone: "error", text: `读取设置失败:${uiPrimitives.errText(error)}` });
4934
4954
  });
4935
4955
  return () => {
4936
4956
  alive = false;
@@ -4949,7 +4969,7 @@ function GenericFields({
4949
4969
  if (result.notice !== void 0) setNote({ tone: "ok", text: result.notice });
4950
4970
  reload();
4951
4971
  }).catch((error) => {
4952
- setNote({ tone: "error", text: `保存失败:${text(error)}` });
4972
+ setNote({ tone: "error", text: `保存失败:${uiPrimitives.errText(error)}` });
4953
4973
  });
4954
4974
  };
4955
4975
  const openExternal = (url) => {
@@ -4959,7 +4979,7 @@ function GenericFields({
4959
4979
  return;
4960
4980
  }
4961
4981
  void native.invoke("openExternal", [url]).catch((error) => {
4962
- setNote({ tone: "error", text: `打开链接失败:${text(error)}` });
4982
+ setNote({ tone: "error", text: `打开链接失败:${uiPrimitives.errText(error)}` });
4963
4983
  });
4964
4984
  };
4965
4985
  const act = (action) => {
@@ -4980,7 +5000,7 @@ function GenericFields({
4980
5000
  }
4981
5001
  reload();
4982
5002
  }).catch((error) => {
4983
- setNote({ tone: "error", text: `操作失败:${text(error)}` });
5003
+ setNote({ tone: "error", text: `操作失败:${uiPrimitives.errText(error)}` });
4984
5004
  });
4985
5005
  };
4986
5006
  const switchConfigFile = async (reset) => {
@@ -5004,7 +5024,7 @@ function GenericFields({
5004
5024
  setNote({ tone: "ok", text: result.notice ?? "已换配置文件" });
5005
5025
  onConfigFileChanged?.();
5006
5026
  } catch (error) {
5007
- setNote({ tone: "error", text: `换配置文件失败:${text(error)}` });
5027
+ setNote({ tone: "error", text: `换配置文件失败:${uiPrimitives.errText(error)}` });
5008
5028
  }
5009
5029
  };
5010
5030
  const regeneratePair = async (action) => {
@@ -5018,7 +5038,7 @@ function GenericFields({
5018
5038
  reload();
5019
5039
  return { ok: true, data };
5020
5040
  } catch (error) {
5021
- return { ok: false, error: `操作失败:${text(error)}` };
5041
+ return { ok: false, error: `操作失败:${uiPrimitives.errText(error)}` };
5022
5042
  }
5023
5043
  };
5024
5044
  const render = (field, index) => {
@@ -5064,7 +5084,7 @@ function GenericFields({
5064
5084
  void native.invoke("openPath", [field.text]).then((problem) => {
5065
5085
  if (problem !== "") setNote({ tone: "error", text: `打开失败:${problem}` });
5066
5086
  }).catch((error) => {
5067
- setNote({ tone: "error", text: `打开失败:${text(error)}` });
5087
+ setNote({ tone: "error", text: `打开失败:${uiPrimitives.errText(error)}` });
5068
5088
  });
5069
5089
  },
5070
5090
  children: "打开"
@@ -5250,6 +5270,12 @@ function GenericFields({
5250
5270
  extra
5251
5271
  ] });
5252
5272
  }
5273
+ const THEME_TILES = [
5274
+ { value: "light", label: "浅色" },
5275
+ { value: "claude", label: "Claude" },
5276
+ { value: "dark", label: "深色" },
5277
+ { value: "system", label: "跟随系统" }
5278
+ ];
5253
5279
  function AppearanceRows() {
5254
5280
  const channel = ui$1.useHostChannel();
5255
5281
  const [appearance, setAppearance] = react.useState(null);
@@ -5259,7 +5285,7 @@ function AppearanceRows() {
5259
5285
  void channel.invoke("getUiPrefs").then((prefs) => {
5260
5286
  if (alive) setAppearance(normalizePrefs(prefs));
5261
5287
  }).catch((error) => {
5262
- if (alive) setNote(`读外观失败:${text(error)}`);
5288
+ if (alive) setNote(`读外观失败:${uiPrimitives.errText(error)}`);
5263
5289
  });
5264
5290
  return () => {
5265
5291
  alive = false;
@@ -5279,7 +5305,7 @@ function AppearanceRows() {
5279
5305
  }).catch((error) => {
5280
5306
  setAppearance(appearance);
5281
5307
  ui$1.requestAppearance(appearance);
5282
- setNote(`没写进去:${text(error)}`);
5308
+ setNote(`没写进去:${uiPrimitives.errText(error)}`);
5283
5309
  });
5284
5310
  };
5285
5311
  if (appearance === null) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "settings-empty", children: note === "" ? "正在读外观…" : note });
@@ -5289,24 +5315,22 @@ function AppearanceRows() {
5289
5315
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "setting-row", children: [
5290
5316
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "setting-text", children: [
5291
5317
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "setting-label", children: "主题" }),
5292
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "setting-help", children: "「跟随系统」随系统的深浅自动切换。" })
5318
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "setting-help", children: "「Claude」是暖米白配色(Ivory + 陶土色),「跟随系统」随系统深浅自动切换。" })
5293
5319
  ] }),
5294
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "setting-control", children: /* @__PURE__ */ jsxRuntime.jsx(
5295
- uiPrimitives.Select,
5320
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "setting-control theme-tiles", role: "radiogroup", "aria-label": "主题", children: THEME_TILES.map((tile) => /* @__PURE__ */ jsxRuntime.jsx(
5321
+ "button",
5296
5322
  {
5297
- className: "setting-select",
5298
- ariaLabel: "主题",
5299
- value: appearance.themeMode,
5300
- options: [
5301
- { value: "dark", label: "深色" },
5302
- { value: "light", label: "浅色" },
5303
- { value: "system", label: "跟随系统" }
5304
- ],
5305
- onPick: (next) => {
5306
- change({ themeMode: next });
5307
- }
5308
- }
5309
- ) })
5323
+ type: "button",
5324
+ role: "radio",
5325
+ "aria-checked": appearance.themeMode === tile.value,
5326
+ className: "theme-tile",
5327
+ onClick: () => {
5328
+ change({ themeMode: tile.value });
5329
+ },
5330
+ children: tile.label
5331
+ },
5332
+ tile.value
5333
+ )) })
5310
5334
  ] }),
5311
5335
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "setting-row", children: [
5312
5336
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "setting-text", children: [
@@ -5361,7 +5385,7 @@ function AppearanceRows() {
5361
5385
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "setting-row", children: [
5362
5386
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "setting-text", children: [
5363
5387
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "setting-label", children: "过程折叠程度" }),
5364
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "setting-help", children: "定稿的回合收得多紧:紧凑=只剩「用时」一行;标准=思考行带首行摘要、跑动中报实时详情;详细=跑动中的那一轮也摊开不分组(定稿的仍收);完全展开=定稿的回合也不收。" })
5388
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "setting-help", children: "定稿的回合收得多紧:紧凑=只剩「用时」一行;标准=跑动中报实时详情;详细=跑动中的那一轮也摊开不分组(定稿的仍收);完全展开=定稿的回合也不收。四档的思考行都带首行摘要——摘要回答「这条思考讲了什么」,与整轮折不折是两件事。" })
5365
5389
  ] }),
5366
5390
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "setting-control", children: /* @__PURE__ */ jsxRuntime.jsx(
5367
5391
  uiPrimitives.Select,
@@ -5434,7 +5458,7 @@ function normalizePrefs(prefs) {
5434
5458
  const fromLegacy = typeof raw === "string" ? legacy[raw] : void 0;
5435
5459
  const second = fromLegacy ?? size;
5436
5460
  return {
5437
- themeMode: prefs?.themeMode === "light" || prefs?.themeMode === "system" ? prefs.themeMode : "dark",
5461
+ themeMode: prefs?.themeMode === "light" || prefs?.themeMode === "dark" || prefs?.themeMode === "system" ? prefs.themeMode : "claude",
5438
5462
  fontSize: Math.min(1.35, Math.max(0.85, Math.round(second * 100) / 100)),
5439
5463
  density: prefs?.density === "compact" || prefs?.density === "roomy" ? prefs.density : "standard",
5440
5464
  processFold: prefs?.processFold === "compact" || prefs?.processFold === "detailed" || prefs?.processFold === "verbose" ? prefs.processFold : "standard",
@@ -5454,17 +5478,7 @@ function NotYetPanel({ section }) {
5454
5478
  ] });
5455
5479
  }
5456
5480
  function useSettingsOpen() {
5457
- const [open, setOpen] = react.useState(settingsOpen);
5458
- react.useEffect(() => {
5459
- const listener = () => {
5460
- setOpen(settingsOpen);
5461
- };
5462
- listeners.add(listener);
5463
- return () => {
5464
- listeners.delete(listener);
5465
- };
5466
- }, []);
5467
- return open;
5481
+ return react.useSyncExternalStore(settingsOpen.subscribe, () => settingsOpen.get(), () => false);
5468
5482
  }
5469
5483
  exports.default = ui;
5470
5484
  };