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
@@ -7,6 +7,8 @@ import type { PermissionRow } from './permissions.ts';
7
7
  import type { PresetRow } from './presets.ts';
8
8
  import type { PluginRow } from './plugin-inventory.ts';
9
9
  import type { SessionDirectoryOptions, SessionRow } from './session-directory.ts';
10
+ import type { ReviewBranch, ReviewCommit, ReviewSelection } from './git-workflow.ts';
11
+ import { type UsageView } from './render/usage.ts';
10
12
  import { type StatusItemId } from './render/status.ts';
11
13
  /**
12
14
  * Apply one keystroke to a panel search query. IME commits arrive as one
@@ -19,19 +21,19 @@ export declare function editQuery(query: string, input: string, key: {
19
21
  }): string | undefined;
20
22
  export declare function ModePanel({ current, load, select, close }: {
21
23
  current: string;
22
- load(): Promise<readonly PresetRow[]>;
23
- select(id: string): void;
24
- close(): void;
24
+ load: () => Promise<readonly PresetRow[]>;
25
+ select: (id: string) => void;
26
+ close: () => void;
25
27
  }): ReactElement;
26
28
  export declare function PermissionPanel({ current, load, select, close }: {
27
29
  current: string;
28
- load(): Promise<readonly PermissionRow[]>;
29
- select(id: string): void;
30
- close(): void;
30
+ load: () => Promise<readonly PermissionRow[]>;
31
+ select: (id: string) => void;
32
+ close: () => void;
31
33
  }): ReactElement;
32
34
  export declare function PluginPanel({ load, close, initialQuery }: {
33
- load(): readonly PluginRow[];
34
- close(): void;
35
+ load: () => readonly PluginRow[];
36
+ close: () => void;
35
37
  initialQuery?: string;
36
38
  }): ReactElement;
37
39
  /** One background job snapshot for the /jobs panel (the registry's read-only view). */
@@ -61,23 +63,25 @@ export declare function runClock(ms: number): string;
61
63
  * registry renders as the plain empty state (a harmless missing service).
62
64
  */
63
65
  export declare function JobsPanel({ load, close }: {
64
- load(): readonly JobRow[];
65
- close(): void;
66
+ load: () => readonly JobRow[];
67
+ close: () => void;
66
68
  }): ReactElement;
67
- export declare function ResumePanel({ currentCwd, load, readTranscript, select, requestDelete, deleteConfirmId, reloadToken, deleteMode, close }: {
69
+ export declare function ResumePanel({ currentCwd, load, readTranscript, select, requestDelete, deleteConfirmId, reloadToken, deleteMode, presetId, close }: {
68
70
  currentCwd: string;
69
- load(options: SessionDirectoryOptions, signal?: AbortSignal): Promise<readonly SessionRow[]>;
70
- readTranscript(id: string, signal?: AbortSignal): Promise<string>;
71
- select(row: SessionRow): void;
71
+ load: (options: SessionDirectoryOptions, signal?: AbortSignal) => Promise<readonly SessionRow[]>;
72
+ readTranscript: (id: string, signal?: AbortSignal) => Promise<string>;
73
+ select: (row: SessionRow) => void;
72
74
  /** Arm the composer-based delete confirm for one row (App owns the keys). */
73
- requestDelete?(row: SessionRow): void;
75
+ requestDelete?: (row: SessionRow) => void;
74
76
  /** The row id awaiting y/n in the composer, when any (App-owned). */
75
77
  deleteConfirmId?: string;
76
78
  /** Bump to reload the listing (e.g. after a deletion). */
77
79
  reloadToken?: number;
78
80
  /** Opened via /delete: hint-first delete mode. */
79
81
  deleteMode?: boolean;
80
- close(): void;
82
+ /** `/delete <id>` argument to resolve after the listing loads. */
83
+ presetId?: string;
84
+ close: () => void;
81
85
  }): ReactElement;
82
86
  /**
83
87
  * The /history recall panel (Codex composer-history search, bounded): one
@@ -89,8 +93,51 @@ export declare function HistoryPanel({ entries, fill, close }: {
89
93
  /** Newest-first recall entries (persistent + in-session, deduped). */
90
94
  entries: readonly string[];
91
95
  /** Accept one entry: its text plus its recall-space index (browsing resumes there). */
92
- fill(text: string, index: number): void;
93
- close(): void;
96
+ fill: (text: string, index: number) => void;
97
+ close: () => void;
98
+ }): ReactElement;
99
+ /**
100
+ * The /review candidate picker (Codex's preset popup): bare /review opens a
101
+ * four-way preset — review uncommitted changes, pick a base branch, pick a
102
+ * recent commit, or type a custom focus. Branch and commit phases are
103
+ * type-to-filter lists; every selection resolves to the same /review
104
+ * argument string the direct command accepts.
105
+ */
106
+ export declare function ReviewPickerPanel({ loadBranches, loadCommits, choose, close }: {
107
+ loadBranches: (signal?: AbortSignal) => Promise<readonly ReviewBranch[]>;
108
+ loadCommits: (signal?: AbortSignal) => Promise<readonly ReviewCommit[]>;
109
+ /** Run the review for one picker selection. */
110
+ choose: (selection: ReviewSelection) => void;
111
+ close: () => void;
112
+ }): ReactElement;
113
+ /** One cross-session full-text search hit mapped from the session-query engine. */
114
+ export interface SearchRow {
115
+ /** Session id (Enter resumes it through the switch machinery). */
116
+ readonly id: string;
117
+ /** Display label: session title or the short id form. */
118
+ readonly label: string;
119
+ /** Secondary facts line (workspace · preset markers). */
120
+ readonly detail: string;
121
+ /** Bounded plain-text excerpt around the strongest match. */
122
+ readonly snippet: string;
123
+ /** Match timestamp (relative labels derive from it). */
124
+ readonly updatedAt: number;
125
+ /** Whether the hit is a delegated subagent conversation (not resumable). */
126
+ readonly subagent: boolean;
127
+ /** Whether Enter may switch into it. */
128
+ readonly resumable: boolean;
129
+ }
130
+ /**
131
+ * The /search panel: full-text search over every persisted session through
132
+ * the in-process session-query engine (the same corpus the model's
133
+ * session_search tool reads). Type a query, Enter searches, Enter again
134
+ * resumes the hit; the query line edits like every kernel panel.
135
+ */
136
+ export declare function SearchPanel({ load, select, initialQuery, close }: {
137
+ load: (query: string, signal?: AbortSignal) => Promise<readonly SearchRow[]>;
138
+ select: (row: SearchRow) => void;
139
+ initialQuery?: string;
140
+ close: () => void;
94
141
  }): ReactElement;
95
142
  /**
96
143
  * The /statusline picker (the Codex setup-view contract): one bounded list
@@ -100,8 +147,8 @@ export declare function HistoryPanel({ entries, fill, close }: {
100
147
  */
101
148
  export declare function StatuslinePanel({ enabled, change, close }: {
102
149
  enabled: readonly StatusItemId[];
103
- change(items: readonly StatusItemId[]): void;
104
- close(): void;
150
+ change: (items: readonly StatusItemId[]) => void;
151
+ close: () => void;
105
152
  }): ReactElement;
106
153
  /**
107
154
  * The `/model` reasoning-effort stage (the Codex model → reasoning popup
@@ -122,11 +169,11 @@ export declare function EffortPanel({ row, current, select, back, onExit }: {
122
169
  /** Effective effort currently in force ('' when none), for the ● mark. */
123
170
  current: string | undefined;
124
171
  /** Accept one advertised effort id, or '' for the provider default. */
125
- select(effortId: string): void;
172
+ select: (effortId: string) => void;
126
173
  /** Return to the model list without applying. */
127
- back(): void;
174
+ back: () => void;
128
175
  /** Leave the whole /model flow (Ctrl+C). */
129
- onExit(): void;
176
+ onExit: () => void;
130
177
  }): ReactElement;
131
178
  /**
132
179
  * The /agents panel (the Codex agent-picker contract, read-only): this
@@ -139,10 +186,10 @@ export declare function AgentsPanel({ live, load, readTranscript, close }: {
139
186
  /** Live feed rows (child sessions observed this process). */
140
187
  live: readonly SubagentRow[];
141
188
  /** Load this session's persisted child sessions by lineage. */
142
- load(): Promise<readonly SessionRow[]>;
189
+ load: () => Promise<readonly SessionRow[]>;
143
190
  /** Read one child session's full transcript as markdown. */
144
- readTranscript(id: string, signal?: AbortSignal): Promise<string>;
145
- close(): void;
191
+ readTranscript: (id: string, signal?: AbortSignal) => Promise<string>;
192
+ close: () => void;
146
193
  }): ReactElement;
147
194
  /**
148
195
  * The /subagent model panel: which model configuration delegated subagents
@@ -159,12 +206,12 @@ export declare function AgentsPanel({ live, load, readTranscript, close }: {
159
206
  export declare function SubagentPanel({ current, load, pick, inherit, close }: {
160
207
  /** Display label of the override in force, '' when following the current model. */
161
208
  current: string;
162
- load(): Promise<ModelDirectory>;
209
+ load: () => Promise<ModelDirectory>;
163
210
  /** Apply one model (with an advertised effort, when picked) as the override. */
164
- pick(row: ModelRow, effortId?: string): void;
211
+ pick: (row: ModelRow, effortId?: string) => void;
165
212
  /** Drop the override: subagents follow the current model again. */
166
- inherit(): void;
167
- close(): void;
213
+ inherit: () => void;
214
+ close: () => void;
168
215
  }): ReactElement;
169
216
  /**
170
217
  * The /schedule panel: the read-only catalog of active reminders folded from
@@ -185,6 +232,16 @@ export declare function scheduleRelative(targetAt: number, now: number): string;
185
232
  /** Ordered display rows: overdue first (error tone), then ascending target. */
186
233
  export declare function scheduleDisplayRows(rows: readonly ScheduleRow[], now: number): readonly ScheduleDisplayRow[];
187
234
  export declare function SchedulePanel({ rows, close }: {
188
- rows(): readonly ScheduleRow[];
189
- close(): void;
235
+ rows: () => readonly ScheduleRow[];
236
+ close: () => void;
237
+ }): ReactElement;
238
+ /**
239
+ * The /usage panel: the session's provider-reported token totals, its context
240
+ * pressure and estimated composition, and the exact per-turn accounting, in
241
+ * one bounded scrollable surface. Read-only — Esc or q closes it.
242
+ */
243
+ export declare function UsagePanel({ load, close }: {
244
+ /** Read the current session's usage blocks from the mounted projections. */
245
+ load: () => Promise<UsageView>;
246
+ close: () => void;
190
247
  }): ReactElement;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The /language picker: one row per interface language, the active one
3
+ * marked, arrow selection, Enter applies (persisting through the runner and
4
+ * repainting the whole screen so Static-region text switches too).
5
+ */
6
+ import { type ReactElement } from 'react';
7
+ import { type LanguageName } from './i18n.ts';
8
+ export declare function LanguagePanel({ current, select, close }: {
9
+ current: LanguageName;
10
+ select: (name: LanguageName) => void;
11
+ close: () => void;
12
+ }): ReactElement;