dsh-code 1.0.7 → 1.3.0

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 (89) hide show
  1. package/README.en.md +70 -24
  2. package/README.md +71 -25
  3. package/bin/deepseek.mjs +202 -39
  4. package/cordis.patch.yml +13 -4
  5. package/lib/index.mjs +5002 -1061
  6. package/lib/session-query.mjs +3 -2
  7. package/lib/startup.mjs +4 -4
  8. package/lib/{theme-DCT8Y2xf.mjs → theme-B3orFUYz.mjs} +665 -20
  9. package/lib/types/app.d.ts +120 -63
  10. package/lib/types/attachments.d.ts +16 -7
  11. package/lib/types/authorization-panel.d.ts +3 -3
  12. package/lib/types/git-workflow.d.ts +91 -2
  13. package/lib/types/history.d.ts +10 -0
  14. package/lib/types/i18n.d.ts +39 -0
  15. package/lib/types/index.d.ts +74 -2
  16. package/lib/types/input-split.d.ts +1 -1
  17. package/lib/types/kernel-panels.d.ts +89 -32
  18. package/lib/types/language-panel.d.ts +12 -0
  19. package/lib/types/locales/en.d.ts +498 -0
  20. package/lib/types/locales/zh.d.ts +9 -0
  21. package/lib/types/mentions.d.ts +7 -3
  22. package/lib/types/models.d.ts +14 -0
  23. package/lib/types/panel-accent.d.ts +28 -0
  24. package/lib/types/rainbow.d.ts +69 -0
  25. package/lib/types/render/animations.d.ts +42 -0
  26. package/lib/types/render/inspector.d.ts +26 -0
  27. package/lib/types/render/lines.d.ts +21 -1
  28. package/lib/types/render/markdown.d.ts +1 -1
  29. package/lib/types/render/projection.d.ts +95 -4
  30. package/lib/types/render/status.d.ts +12 -9
  31. package/lib/types/render/text.d.ts +6 -0
  32. package/lib/types/render/usage.d.ts +113 -0
  33. package/lib/types/session-directory.d.ts +42 -1
  34. package/lib/types/session-switch.d.ts +8 -0
  35. package/lib/types/startup.d.ts +1 -1
  36. package/lib/types/terminal-title.d.ts +8 -0
  37. package/lib/types/theme-panel.d.ts +2 -2
  38. package/lib/types/theme.d.ts +271 -52
  39. package/lib/types/update-panel.d.ts +27 -6
  40. package/lib/types/update.d.ts +10 -1
  41. package/lib/types/version.d.ts +6 -3
  42. package/package.json +26 -7
  43. package/src/app.ts +1426 -627
  44. package/src/approval.ts +166 -166
  45. package/src/attachments.ts +65 -19
  46. package/src/authorization-panel.ts +24 -18
  47. package/src/editor-keys.ts +371 -371
  48. package/src/fork.ts +11 -7
  49. package/src/git-workflow.ts +229 -3
  50. package/src/history.ts +14 -0
  51. package/src/i18n.ts +68 -0
  52. package/src/index.ts +503 -128
  53. package/src/input-split.ts +27 -7
  54. package/src/kernel-panels.ts +528 -113
  55. package/src/keyboard.ts +5 -4
  56. package/src/language-panel.ts +53 -0
  57. package/src/locales/en.ts +538 -0
  58. package/src/locales/zh.ts +537 -0
  59. package/src/mentions.ts +8 -4
  60. package/src/models.ts +264 -212
  61. package/src/panel-accent.ts +41 -0
  62. package/src/presets.ts +1 -1
  63. package/src/provider-settings.ts +1 -1
  64. package/src/rainbow.ts +218 -0
  65. package/src/render/animations.ts +104 -6
  66. package/src/render/editor.ts +20 -20
  67. package/src/render/export.ts +116 -95
  68. package/src/render/inspector.ts +42 -0
  69. package/src/render/lines.ts +628 -415
  70. package/src/render/markdown.ts +15 -3
  71. package/src/render/projection.ts +429 -19
  72. package/src/render/status.ts +119 -62
  73. package/src/render/text.ts +15 -0
  74. package/src/render/tool-preview.ts +77 -77
  75. package/src/render/usage.ts +430 -0
  76. package/src/render/width.ts +2 -2
  77. package/src/session-directory.ts +90 -9
  78. package/src/session-query.ts +8 -4
  79. package/src/session-switch.ts +14 -0
  80. package/src/startup.ts +3 -3
  81. package/src/store.ts +19 -1
  82. package/src/subagents.ts +229 -229
  83. package/src/terminal-title.ts +22 -5
  84. package/src/theme-panel.ts +17 -21
  85. package/src/theme.ts +281 -33
  86. package/src/update-panel.ts +148 -31
  87. package/src/update.ts +19 -3
  88. package/src/version.ts +63 -20
  89. package/src/whale-glyph.ts +23 -23
@@ -60,12 +60,32 @@ export function createKeypressSplitter(): KeypressSplitter {
60
60
  buffer = buffer.slice(stop)
61
61
  continue
62
62
  }
63
- const head = buffer[0]!
63
+ const head = buffer[0]
64
64
  if (head !== '\x1b') {
65
- // Plain bytes key one at a time; a surrogate pair is one grapheme
66
- // and must not split into two lone surrogates.
67
- const pair = head >= '\uD800' && head <= '\uDBFF' && buffer[1] !== undefined
68
- const take = pair ? 2 : 1
65
+ // C0 / DEL stay one key so a coalesced ` \r` is still space then
66
+ // Enter. A printable run (file drag or unbracketed path paste on
67
+ // any platform, including CJK) must stay ONE unit: splitting a
68
+ // long path into tens of setStates overflows React's update depth
69
+ // and never reaches the attachment parser. Typed keys still
70
+ // arrive as one-byte chunks, so this only batches what the OS
71
+ // already coalesced.
72
+ if (head < ' ' || head === '\x7f') {
73
+ units.push(head)
74
+ buffer = buffer.slice(1)
75
+ continue
76
+ }
77
+ let take = 0
78
+ while (take < buffer.length) {
79
+ const ch = buffer[take]
80
+ if (ch === '\x1b' || ch < ' ' || ch === '\x7f') break
81
+ if (ch >= '\uD800' && ch <= '\uDBFF') {
82
+ if (buffer[take + 1] === undefined) break
83
+ take += 2
84
+ continue
85
+ }
86
+ take += 1
87
+ }
88
+ if (take === 0) break
69
89
  units.push(buffer.slice(0, take))
70
90
  buffer = buffer.slice(take)
71
91
  continue
@@ -74,7 +94,7 @@ export function createKeypressSplitter(): KeypressSplitter {
74
94
  if (buffer[1] === '[') {
75
95
  let end = -1
76
96
  for (let at = 2; at < buffer.length; at += 1) {
77
- if (isCsiFinal(buffer[at]!)) {
97
+ if (isCsiFinal(buffer[at])) {
78
98
  end = at
79
99
  break
80
100
  }
@@ -134,7 +154,7 @@ export interface TuiStdin extends PassThrough {
134
154
  * @param source - the process (or harness) input stream in raw mode.
135
155
  * @returns the proxy stream plus a dispose that detaches the tap.
136
156
  */
137
- export function createSplitStdin(source: NodeJS.ReadStream): { stdin: TuiStdin; dispose(): void } {
157
+ export function createSplitStdin(source: NodeJS.ReadStream): { stdin: TuiStdin; dispose: () => void } {
138
158
  // Object mode matters: a plain stream's read() without a size drains the
139
159
  // whole buffer as one chunk, which would re-coalesce the units this module
140
160
  // exists to separate. In object mode every pushed unit reads back alone.