dsh-code 0.9.1 → 1.0.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.
- package/README.en.md +278 -249
- package/README.md +131 -102
- package/bin/deepseek.mjs +100 -6
- package/cordis.patch.yml +36 -1
- package/lib/index.mjs +3055 -819
- package/lib/startup.mjs +21 -11
- package/lib/{theme-BEi4i_aN.mjs → theme-DCT8Y2xf.mjs} +13 -9
- package/lib/types/app.d.ts +84 -16
- package/lib/types/attachments.d.ts +20 -0
- package/lib/types/authorization-panel.d.ts +22 -0
- package/lib/types/authorization.d.ts +36 -0
- package/lib/types/editor.d.ts +6 -0
- package/lib/types/fork.d.ts +8 -0
- package/lib/types/git-workflow.d.ts +23 -0
- package/lib/types/index.d.ts +6 -0
- package/lib/types/kernel-panels.d.ts +39 -0
- package/lib/types/keyboard.d.ts +41 -0
- package/lib/types/mentions.d.ts +30 -38
- package/lib/types/models.d.ts +3 -1
- package/lib/types/permissions.d.ts +4 -14
- package/lib/types/presets.d.ts +5 -20
- package/lib/types/provider-settings.d.ts +16 -0
- package/lib/types/render/animations.d.ts +10 -39
- package/lib/types/render/editor.d.ts +137 -0
- package/lib/types/render/export.d.ts +1 -1
- package/lib/types/render/lines.d.ts +6 -2
- package/lib/types/render/markdown.d.ts +3 -1
- package/lib/types/render/projection.d.ts +29 -3
- package/lib/types/render/status.d.ts +6 -13
- package/lib/types/session-directory.d.ts +1 -3
- package/lib/types/startup.d.ts +14 -11
- package/lib/types/store.d.ts +11 -9
- package/lib/types/subagents.d.ts +3 -3
- package/lib/types/theme.d.ts +14 -1
- package/lib/types/version.d.ts +15 -2
- package/package.json +159 -141
- package/src/app.ts +1490 -663
- package/src/attachments.ts +128 -0
- package/src/authorization-panel.ts +285 -0
- package/src/authorization.ts +147 -0
- package/src/editor.ts +51 -0
- package/src/fork.ts +31 -0
- package/src/git-workflow.ts +87 -0
- package/src/index.ts +1523 -1374
- package/src/internals.ts +14 -1
- package/src/kernel-panels.ts +914 -798
- package/src/keyboard.ts +126 -0
- package/src/mentions.ts +78 -117
- package/src/models.ts +20 -14
- package/src/permissions.ts +5 -13
- package/src/presets.ts +6 -22
- package/src/provider-settings.ts +95 -1
- package/src/render/animations.ts +420 -450
- package/src/render/editor.ts +398 -0
- package/src/render/export.ts +79 -79
- package/src/render/lines.ts +342 -236
- package/src/render/markdown.ts +99 -26
- package/src/render/projection.ts +106 -19
- package/src/render/status.ts +713 -650
- package/src/render/text.ts +150 -150
- package/src/render/tool-detail.ts +3 -1
- package/src/session-directory.ts +4 -4
- package/src/startup.ts +136 -119
- package/src/store.ts +23 -11
- package/src/subagents.ts +13 -5
- package/src/theme.ts +214 -206
- package/src/version.ts +58 -1
package/src/internals.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { render } from 'ink'
|
|
10
10
|
import type { ReactElement } from 'react'
|
|
11
|
+
import { BRACKETED_PASTE_DISABLE, BRACKETED_PASTE_ENABLE, KEYBOARD_ENHANCE_DISABLE, KEYBOARD_ENHANCE_ENABLE } from './keyboard.ts'
|
|
11
12
|
|
|
12
13
|
/** A mounted terminal app instance; the runner owns unmount ordering. */
|
|
13
14
|
export interface TuiMount {
|
|
@@ -28,13 +29,25 @@ export const internals: {
|
|
|
28
29
|
stderr: { write(chunk: string): unknown }
|
|
29
30
|
} = {
|
|
30
31
|
mount: (element: ReactElement): TuiMount => {
|
|
31
|
-
|
|
32
|
+
// Codex keyboard_modes parity: push the kitty keyboard protocol so
|
|
33
|
+
// modified controls remain distinguishable, and enable bracketed paste so
|
|
34
|
+
// pasted newlines insert instead of submitting. Both are inert in
|
|
35
|
+
// terminals without support.
|
|
36
|
+
process.stdout.write(KEYBOARD_ENHANCE_ENABLE + BRACKETED_PASTE_ENABLE)
|
|
37
|
+
// App owns Ctrl+C's deliberate three-state contract (interrupt, clear
|
|
38
|
+
// draft, quit). Ink's default `exitOnCtrlC: true` would intercept the
|
|
39
|
+
// normalized control byte first, unmount only its renderer, and leave the
|
|
40
|
+
// Harness runner plus the pushed keyboard protocol alive.
|
|
41
|
+
const instance = render(element, { exitOnCtrlC: false })
|
|
32
42
|
return {
|
|
33
43
|
rerender(element: ReactElement): void {
|
|
34
44
|
instance.rerender(element)
|
|
35
45
|
},
|
|
36
46
|
unmount(): void {
|
|
37
47
|
instance.unmount()
|
|
48
|
+
// Pop the stack so the parent shell does not inherit enhanced key
|
|
49
|
+
// reporting (Codex resets even harder on forced exit).
|
|
50
|
+
process.stdout.write(KEYBOARD_ENHANCE_DISABLE + BRACKETED_PASTE_DISABLE)
|
|
38
51
|
},
|
|
39
52
|
}
|
|
40
53
|
},
|