@toddzheng024/dscode-bundle 0.7.12 → 0.7.14
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/THIRD_PARTY_NOTICES.md +3 -3
- package/cordis.patch.yml +6 -2
- package/package.json +7 -5
- package/plugins/code-review/index.mjs +5 -2
- package/plugins/compaction/threshold.mjs +12 -0
- package/plugins/credentials/index.mjs +13 -0
- package/plugins/grok/adapter.mjs +114 -0
- package/plugins/grok/auth.mjs +76 -0
- package/plugins/grok/billing.mjs +146 -0
- package/plugins/grok/index.mjs +118 -0
- package/plugins/grok/models.mjs +129 -0
- package/plugins/grok/status.mjs +28 -0
- package/plugins/grok/wire.mjs +268 -0
- package/plugins/i18n/messages.mjs +6 -6
- package/plugins/providers/catalog.mjs +2 -0
- package/plugins/session-metrics/view.mjs +34 -3
- package/vendor/compaction-basic/index.js +91 -1
- package/vendor/persistent/index.js +10 -9
- package/vendor/terminal/index.js +5 -0
- package/vendor/tui/lib/app.mjs +6711 -0
- package/vendor/tui/lib/approval.mjs +122 -0
- package/vendor/tui/lib/attachments.mjs +218 -0
- package/vendor/tui/lib/authorization-panel.mjs +242 -0
- package/vendor/tui/lib/authorization.mjs +111 -0
- package/vendor/tui/lib/commands.mjs +123 -0
- package/vendor/tui/lib/dscode/chat.mjs +84 -0
- package/vendor/tui/lib/dscode/flags.mjs +32 -0
- package/vendor/tui/lib/dscode/model-search.mjs +68 -0
- package/vendor/tui/lib/dscode/paste.mjs +87 -0
- package/vendor/tui/lib/dscode/telemetry.mjs +82 -0
- package/vendor/tui/lib/dscode/welcome.mjs +100 -0
- package/vendor/tui/lib/editor-keys.mjs +346 -0
- package/vendor/tui/lib/editor.mjs +50 -0
- package/vendor/tui/lib/fork.mjs +24 -0
- package/vendor/tui/lib/git-workflow.mjs +278 -0
- package/vendor/tui/{types/history.d.ts → lib/history.mjs} +69 -26
- package/vendor/tui/{types/i18n.d.ts → lib/i18n.mjs} +23 -15
- package/vendor/tui/lib/index.mjs +2200 -0
- package/vendor/tui/lib/input-split.mjs +170 -0
- package/vendor/tui/lib/internals.mjs +90 -0
- package/vendor/tui/lib/invariant.mjs +22 -0
- package/vendor/tui/lib/kernel-panels.mjs +1265 -0
- package/vendor/tui/lib/keyboard.mjs +283 -0
- package/vendor/tui/lib/language-panel.mjs +41 -0
- package/vendor/tui/lib/locales/en.mjs +495 -0
- package/vendor/tui/lib/locales/zh.mjs +495 -0
- package/vendor/tui/lib/mentions.mjs +150 -0
- package/vendor/tui/lib/model-capabilities.mjs +245 -0
- package/vendor/tui/lib/models.mjs +215 -0
- package/vendor/tui/{types/panel-accent.d.ts → lib/panel-accent.mjs} +11 -7
- package/vendor/tui/lib/permissions.mjs +45 -0
- package/vendor/tui/lib/plugin-inventory.mjs +27 -0
- package/vendor/tui/lib/presets.mjs +46 -0
- package/vendor/tui/lib/provider-settings.mjs +600 -0
- package/vendor/tui/lib/questions.mjs +116 -0
- package/vendor/tui/lib/rainbow.mjs +181 -0
- package/vendor/tui/lib/render/animations.mjs +665 -0
- package/vendor/tui/lib/render/editor.mjs +437 -0
- package/vendor/tui/lib/render/export.mjs +119 -0
- package/vendor/tui/lib/render/fuzzy.mjs +79 -0
- package/vendor/tui/lib/render/ime-cursor.mjs +135 -0
- package/vendor/tui/lib/render/inspector.mjs +93 -0
- package/vendor/tui/lib/render/lines.mjs +538 -0
- package/vendor/tui/lib/render/markdown.mjs +592 -0
- package/vendor/tui/lib/render/projection.mjs +1864 -0
- package/vendor/tui/lib/render/status.mjs +591 -0
- package/vendor/tui/lib/render/text.mjs +157 -0
- package/vendor/tui/lib/render/tool-detail.mjs +187 -0
- package/vendor/tui/lib/render/tool-preview.mjs +79 -0
- package/vendor/tui/lib/render/usage.mjs +336 -0
- package/vendor/tui/lib/render/width.mjs +191 -0
- package/vendor/tui/lib/session-directory.mjs +329 -0
- package/vendor/tui/lib/session-query.mjs +184 -0
- package/vendor/tui/lib/session-switch.mjs +51 -0
- package/vendor/tui/lib/settings-file.mjs +75 -0
- package/vendor/tui/lib/skills.mjs +119 -0
- package/vendor/tui/lib/startup.mjs +111 -0
- package/vendor/tui/lib/store.mjs +129 -0
- package/vendor/tui/lib/subagents.mjs +200 -0
- package/vendor/tui/lib/terminal-title.mjs +186 -0
- package/vendor/tui/lib/theme-panel.mjs +60 -0
- package/vendor/tui/lib/theme.mjs +379 -0
- package/vendor/tui/lib/update-panel.mjs +239 -0
- package/vendor/tui/lib/update.mjs +101 -0
- package/vendor/tui/lib/version.mjs +105 -0
- package/vendor/tui/lib/whale-glyph.mjs +20 -0
- package/vendor/tui/LICENSE +0 -21
- package/vendor/tui/devtools-CdTl3MNy.mjs +0 -3643
- package/vendor/tui/dscode-email/cli.mjs +0 -32
- package/vendor/tui/dscode-email/contacts.mjs +0 -36
- package/vendor/tui/dscode-email/gmail-oauth.mjs +0 -69
- package/vendor/tui/dscode-email/gmail-store.mjs +0 -2
- package/vendor/tui/dscode-email/gmail.mjs +0 -194
- package/vendor/tui/dscode-email/imap.mjs +0 -136
- package/vendor/tui/dscode-email/inbox.d.mts +0 -25
- package/vendor/tui/dscode-email/inbox.mjs +0 -76
- package/vendor/tui/dscode-email/smtp.mjs +0 -69
- package/vendor/tui/dscode-email/store.mjs +0 -32
- package/vendor/tui/dscode-providers/catalog.mjs +0 -136
- package/vendor/tui/dscode-providers/effort.mjs +0 -35
- package/vendor/tui/dscode-providers/openrouter-account.mjs +0 -171
- package/vendor/tui/index.mjs +0 -44441
- package/vendor/tui/invariant.mjs +0 -21
- package/vendor/tui/rolldown-runtime-CMFfr-1z.mjs +0 -26
- package/vendor/tui/session-query.mjs +0 -150
- package/vendor/tui/startup.mjs +0 -109
- package/vendor/tui/theme-7u5Qo3dF.mjs +0 -1265
- package/vendor/tui/types/app.d.ts +0 -348
- package/vendor/tui/types/approval.d.ts +0 -59
- package/vendor/tui/types/attachments.d.ts +0 -52
- package/vendor/tui/types/authorization-panel.d.ts +0 -22
- package/vendor/tui/types/authorization.d.ts +0 -36
- package/vendor/tui/types/commands.d.ts +0 -52
- package/vendor/tui/types/editor-keys.d.ts +0 -105
- package/vendor/tui/types/editor.d.ts +0 -6
- package/vendor/tui/types/fork.d.ts +0 -8
- package/vendor/tui/types/git-workflow.d.ts +0 -121
- package/vendor/tui/types/index.d.ts +0 -223
- package/vendor/tui/types/input-split.d.ts +0 -54
- package/vendor/tui/types/internals.d.ts +0 -26
- package/vendor/tui/types/invariant.d.ts +0 -15
- package/vendor/tui/types/kernel-panels.d.ts +0 -245
- package/vendor/tui/types/keyboard.d.ts +0 -80
- package/vendor/tui/types/language-panel.d.ts +0 -12
- package/vendor/tui/types/locales/en.d.ts +0 -450
- package/vendor/tui/types/locales/zh.d.ts +0 -9
- package/vendor/tui/types/mentions.d.ts +0 -85
- package/vendor/tui/types/model-capabilities.d.ts +0 -82
- package/vendor/tui/types/models.d.ts +0 -133
- package/vendor/tui/types/permissions.d.ts +0 -27
- package/vendor/tui/types/plugin-inventory.d.ts +0 -11
- package/vendor/tui/types/presets.d.ts +0 -22
- package/vendor/tui/types/provider-settings.d.ts +0 -239
- package/vendor/tui/types/questions.d.ts +0 -54
- package/vendor/tui/types/rainbow.d.ts +0 -69
- package/vendor/tui/types/render/animations.d.ts +0 -307
- package/vendor/tui/types/render/editor.d.ts +0 -163
- package/vendor/tui/types/render/export.d.ts +0 -9
- package/vendor/tui/types/render/fuzzy.d.ts +0 -21
- package/vendor/tui/types/render/ime-cursor.d.ts +0 -60
- package/vendor/tui/types/render/inspector.d.ts +0 -62
- package/vendor/tui/types/render/lines.d.ts +0 -86
- package/vendor/tui/types/render/markdown.d.ts +0 -29
- package/vendor/tui/types/render/projection.d.ts +0 -587
- package/vendor/tui/types/render/status.d.ts +0 -196
- package/vendor/tui/types/render/text.d.ts +0 -64
- package/vendor/tui/types/render/tool-detail.d.ts +0 -94
- package/vendor/tui/types/render/tool-preview.d.ts +0 -28
- package/vendor/tui/types/render/usage.d.ts +0 -113
- package/vendor/tui/types/render/width.d.ts +0 -29
- package/vendor/tui/types/session-directory.d.ts +0 -190
- package/vendor/tui/types/session-query.d.ts +0 -92
- package/vendor/tui/types/session-switch.d.ts +0 -17
- package/vendor/tui/types/settings-file.d.ts +0 -41
- package/vendor/tui/types/skills.d.ts +0 -47
- package/vendor/tui/types/startup.d.ts +0 -65
- package/vendor/tui/types/store.d.ts +0 -58
- package/vendor/tui/types/subagents.d.ts +0 -70
- package/vendor/tui/types/terminal-title.d.ts +0 -66
- package/vendor/tui/types/theme-panel.d.ts +0 -24
- package/vendor/tui/types/theme.d.ts +0 -434
- package/vendor/tui/types/update-panel.d.ts +0 -49
- package/vendor/tui/types/update.d.ts +0 -75
- package/vendor/tui/types/version.d.ts +0 -19
- package/vendor/tui/types/whale-glyph.d.ts +0 -6
- /package/vendor/tui/{dscode-clipboard-image → lib/dscode/clipboard-image}/clipboard-image.swift +0 -0
- /package/vendor/tui/{dscode-clipboard-image → lib/dscode/clipboard-image}/index.mjs +0 -0
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* VS Code-family terminal keybinding repair. VS Code hands Ctrl+R to the
|
|
3
|
-
* workbench (Open Recent) even while an integrated terminal owns focus, so
|
|
4
|
-
* the reasoning-fold key never reaches the TUI. Workspace-scoped keybindings
|
|
5
|
-
* do not exist, so the fix is one user-level keybindings.json rule that
|
|
6
|
-
* forwards the raw Ctrl byte via sendSequence under terminalFocus. This
|
|
7
|
-
* module detects the hosting editor variant, resolves its user
|
|
8
|
-
* keybindings.json, and merges the rule idempotently; pure merge/detect
|
|
9
|
-
* helpers are separated from the fs orchestration so both stay testable.
|
|
10
|
-
* @module @deepseek-ai/dsh-code/editor-keys
|
|
11
|
-
*/
|
|
12
|
-
/** Integrated-terminal editor variants this module can repair. */
|
|
13
|
-
export type EditorTerminalFamily = 'vscode' | 'cursor' | 'vscodium' | 'windsurf';
|
|
14
|
-
/**
|
|
15
|
-
* Detect the editor hosting this integrated terminal.
|
|
16
|
-
* @param env - process environment (TERM_PROGRAM decides; case/whitespace tolerant).
|
|
17
|
-
* @returns the family, or undefined outside VS Code-family terminals.
|
|
18
|
-
*/
|
|
19
|
-
export declare function detectEditorTerminalFamily(env?: NodeJS.ProcessEnv): EditorTerminalFamily | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* Whether the pty is hosted away from the editor UI (ssh/container/tunnel).
|
|
22
|
-
* Keybindings live on the client machine, so a remote session must never
|
|
23
|
-
* write them server-side.
|
|
24
|
-
*/
|
|
25
|
-
export declare function isRemoteTerminalEnv(env?: NodeJS.ProcessEnv): boolean;
|
|
26
|
-
/** Filesystem anchors used to resolve editor config paths (injectable for tests). */
|
|
27
|
-
export interface EditorPathContext {
|
|
28
|
-
/** User home directory. */
|
|
29
|
-
homedir: string;
|
|
30
|
-
/** %APPDATA% on Windows; only read for win32 resolution. */
|
|
31
|
-
appdata?: string;
|
|
32
|
-
/** Node platform qualifier. */
|
|
33
|
-
platform: NodeJS.Platform;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Resolve the user keybindings.json candidates for one family, most likely
|
|
37
|
-
* install first. Only paths that exist on disk are repaired.
|
|
38
|
-
*/
|
|
39
|
-
export declare function editorKeybindingCandidates(family: EditorTerminalFamily, context: EditorPathContext): readonly string[];
|
|
40
|
-
/** The one workbench rule that hands Ctrl+R to the focused terminal. */
|
|
41
|
-
export declare const CTRL_R_PASSTHROUGH_RULE: {
|
|
42
|
-
readonly key: "ctrl+r";
|
|
43
|
-
readonly command: "workbench.action.terminal.sendSequence";
|
|
44
|
-
readonly args: {
|
|
45
|
-
readonly text: "\u0012";
|
|
46
|
-
};
|
|
47
|
-
readonly when: "terminalFocus";
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Remove // and block comments from one JSONC document. Double-quoted strings
|
|
51
|
-
* survive untouched, so comment markers inside string values are preserved.
|
|
52
|
-
*/
|
|
53
|
-
export declare function stripJsoncComments(text: string): string;
|
|
54
|
-
/** Parse one JSONC document; trailing commas are tolerated. */
|
|
55
|
-
export declare function parseJsonc(text: string): unknown;
|
|
56
|
-
/** Outcome of merging the passthrough rule into one keybindings document. */
|
|
57
|
-
export type KeybindingsMerge = {
|
|
58
|
-
readonly status: 'present';
|
|
59
|
-
} | {
|
|
60
|
-
readonly status: 'updated';
|
|
61
|
-
readonly text: string;
|
|
62
|
-
} | {
|
|
63
|
-
readonly status: 'created';
|
|
64
|
-
readonly text: string;
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Merge the Ctrl+R passthrough into one keybindings.json document. The raw
|
|
68
|
-
* text is preserved verbatim (comments included); the rule is inserted right
|
|
69
|
-
* after the array opener so it cannot be shadowed by later conflicting user
|
|
70
|
-
* rules. Missing files resolve to a fresh template.
|
|
71
|
-
* @throws when the document does not carry a rule array.
|
|
72
|
-
*/
|
|
73
|
-
export declare function mergeCtrlRPassthrough(raw: string | undefined): KeybindingsMerge;
|
|
74
|
-
/** User-level marker file content: the startup hint fires at most once per install. */
|
|
75
|
-
export interface EditorKeysFlag {
|
|
76
|
-
hintShownAt?: string;
|
|
77
|
-
}
|
|
78
|
-
/** Parse one flag file snapshot; missing or corrupt content degrades to unshown. */
|
|
79
|
-
export declare function parseEditorKeysFlag(raw: string | undefined): EditorKeysFlag;
|
|
80
|
-
/** Persist the shown marker; best-effort, the hint is cosmetic and never a gate. */
|
|
81
|
-
export declare function markEditorKeysHintShown(path: string): Promise<void>;
|
|
82
|
-
/** Inputs shared by the apply and startup-hint flows. */
|
|
83
|
-
export interface EditorKeysEnv {
|
|
84
|
-
/** Process environment (TERM_PROGRAM / VSCODE_IPC_HOOK_CLI). */
|
|
85
|
-
env: NodeJS.ProcessEnv;
|
|
86
|
-
/** Filesystem anchors for editor config resolution. */
|
|
87
|
-
paths: EditorPathContext;
|
|
88
|
-
/** Absolute path of the one-shot hint marker under the DSH home. */
|
|
89
|
-
flagPath: string;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Apply the Ctrl+R passthrough to every local keybindings.json of the hosting
|
|
93
|
-
* editor and mark the startup hint shown. Existing files get a .dsh-bak
|
|
94
|
-
* backup before the first write.
|
|
95
|
-
* @returns a one-line user-facing summary.
|
|
96
|
-
* @throws with an actionable message when the environment cannot be repaired.
|
|
97
|
-
*/
|
|
98
|
-
export declare function applyCtrlRPassthrough({ env, paths, flagPath }: EditorKeysEnv): Promise<string>;
|
|
99
|
-
/**
|
|
100
|
-
* Resolve the one-shot startup hint for VS Code-family terminals. Fires at
|
|
101
|
-
* most once per install (flag file), never when the passthrough rule is
|
|
102
|
-
* already present, and never in remote ptys where the repair cannot run.
|
|
103
|
-
* @returns the hint line, or undefined to stay silent.
|
|
104
|
-
*/
|
|
105
|
-
export declare function resolveEditorKeysStartupHint({ env, paths, flagPath }: EditorKeysEnv): Promise<string | undefined>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/** Host editor and clipboard adapters used by the terminal surface. */
|
|
2
|
-
import type { TranscriptView } from './render/projection.ts';
|
|
3
|
-
/** Copy UTF-8 text through the platform clipboard command. */
|
|
4
|
-
export declare function copyText(text: string): Promise<void>;
|
|
5
|
-
/** Latest complete assistant text, excluding streaming and reasoning. */
|
|
6
|
-
export declare function latestAssistantText(view: TranscriptView): string | undefined;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** Pure session-fork boundary policy shared by the TUI command and tests. */
|
|
2
|
-
import type { SessionEvent } from '@deepseek-ai/dsh-session';
|
|
3
|
-
export interface ForkSeed {
|
|
4
|
-
readonly boundarySeq: number;
|
|
5
|
-
readonly events: readonly SessionEvent[];
|
|
6
|
-
}
|
|
7
|
-
/** Select a completed turn and trailing between-turn metadata. */
|
|
8
|
-
export declare function selectForkSeed(events: readonly SessionEvent[], atSeq?: number): ForkSeed;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Read-only Git inspection used by /diff and /review. Every diff
|
|
3
|
-
* invocation carries --no-ext-diff and --no-textconv, so configured
|
|
4
|
-
* external diff drivers and text converters can never execute as a
|
|
5
|
-
* side effect of reading a diff.
|
|
6
|
-
*/
|
|
7
|
-
export interface GitDiffSpec {
|
|
8
|
-
readonly label: string;
|
|
9
|
-
readonly args: readonly string[];
|
|
10
|
-
}
|
|
11
|
-
/** One file section from a unified diff, retained in source order. */
|
|
12
|
-
export interface GitDiffFile {
|
|
13
|
-
readonly path: string;
|
|
14
|
-
readonly lines: readonly string[];
|
|
15
|
-
}
|
|
16
|
-
/** A parsed diff ready for a file-oriented terminal viewport. */
|
|
17
|
-
export interface GitDiffView {
|
|
18
|
-
readonly title: string;
|
|
19
|
-
readonly files: readonly GitDiffFile[];
|
|
20
|
-
}
|
|
21
|
-
/** Split Git's stable `diff --git` framing without interpreting patch content. */
|
|
22
|
-
export declare function parseGitDiffFiles(text: string): readonly GitDiffFile[];
|
|
23
|
-
/** Parse the intentionally small, option-safe /diff argument vocabulary. */
|
|
24
|
-
export declare function parseGitDiffSpec(argument: string): GitDiffSpec;
|
|
25
|
-
/**
|
|
26
|
-
* Load one complete textual diff without invoking external programs.
|
|
27
|
-
* @param signal - aborted by the caller on session switches/quit, killing the
|
|
28
|
-
* git subprocess instead of letting a stale repository's diff land later.
|
|
29
|
-
*/
|
|
30
|
-
export declare function loadGitDiff(cwd: string, argument: string, signal?: AbortSignal): Promise<GitDiffView>;
|
|
31
|
-
/** One /review run's selection: what to review plus an optional user note. */
|
|
32
|
-
export type ReviewSelection = {
|
|
33
|
-
readonly kind: 'uncommitted';
|
|
34
|
-
} | {
|
|
35
|
-
readonly kind: 'base-branch';
|
|
36
|
-
readonly branch: string;
|
|
37
|
-
readonly mergeBase?: string;
|
|
38
|
-
} | {
|
|
39
|
-
readonly kind: 'commit';
|
|
40
|
-
readonly sha: string;
|
|
41
|
-
} | {
|
|
42
|
-
readonly kind: 'custom';
|
|
43
|
-
readonly instructions: string;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* The /review argument is always a free-form note applied to the uncommitted
|
|
47
|
-
* working tree (`/review 使用中文` reviews the uncommitted diff in Chinese);
|
|
48
|
-
* branch and commit targets come from the candidate picker, never from
|
|
49
|
-
* argument guessing.
|
|
50
|
-
*/
|
|
51
|
-
export declare function parseReviewArgument(argument: string): ReviewSelection;
|
|
52
|
-
/** The merge base of HEAD and one branch, or undefined when git cannot compute one. */
|
|
53
|
-
export declare function mergeBaseWith(cwd: string, branch: string, signal?: AbortSignal): Promise<string | undefined>;
|
|
54
|
-
/** One commit's own patch (parent..commit), falling back to `git show` for root commits. */
|
|
55
|
-
export declare function loadCommitDiff(cwd: string, sha: string, signal?: AbortSignal): Promise<GitDiffView>;
|
|
56
|
-
/**
|
|
57
|
-
* Build the in-session review prompt: the diff is pasted whole (truncated at
|
|
58
|
-
* the character cap with an explicit marker the model can see), the rubric's
|
|
59
|
-
* essentials ride along — P0-P3 priorities, file/line anchors, only defects
|
|
60
|
-
* this change introduced — and an optional user note (language, focus)
|
|
61
|
-
* prefixes everything as the user's explicit instruction.
|
|
62
|
-
*/
|
|
63
|
-
export declare function buildReviewPrompt(diff: string, label: string, note?: string, maxChars?: number): string;
|
|
64
|
-
/** One branch candidate for the review picker. */
|
|
65
|
-
export interface ReviewBranch {
|
|
66
|
-
readonly name: string;
|
|
67
|
-
}
|
|
68
|
-
/** One commit candidate for the review picker. */
|
|
69
|
-
export interface ReviewCommit {
|
|
70
|
-
readonly sha: string;
|
|
71
|
-
readonly title: string;
|
|
72
|
-
/** Committer timestamp in Unix epoch milliseconds. */
|
|
73
|
-
readonly at: number;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Local branch names for the review picker, newest activity first and with
|
|
77
|
-
* the current branch excluded (reviewing against it is always empty).
|
|
78
|
-
*/
|
|
79
|
-
export declare function listReviewBranches(cwd: string, signal?: AbortSignal): Promise<readonly ReviewBranch[]>;
|
|
80
|
-
/** Recent commits on the current branch for the review picker. */
|
|
81
|
-
export declare function listReviewCommits(cwd: string, signal?: AbortSignal, limit?: number): Promise<readonly ReviewCommit[]>;
|
|
82
|
-
/** One finished review, ready for the terminal's result panel. */
|
|
83
|
-
export interface ReviewResultView {
|
|
84
|
-
/** Panel header naming what was reviewed. */
|
|
85
|
-
readonly title: string;
|
|
86
|
-
/** The reviewer's reply markdown (the findings list). */
|
|
87
|
-
readonly body: string;
|
|
88
|
-
/** Compact summary: finding counts per priority plus the verdict. */
|
|
89
|
-
readonly summary: string;
|
|
90
|
-
/** The review session id, so follow-ups can @-reference its context. */
|
|
91
|
-
readonly sessionId: string;
|
|
92
|
-
}
|
|
93
|
-
/** One parsed review finding from the reviewer's closing JSON block. */
|
|
94
|
-
export interface ReviewFinding {
|
|
95
|
-
/** Priority 0-3 for P0-P3; undefined when the reviewer omitted it. */
|
|
96
|
-
readonly priority?: number;
|
|
97
|
-
/** Finding title, already free of the [P#] prefix when present. */
|
|
98
|
-
readonly title: string;
|
|
99
|
-
/** File path the finding anchors to, when stated. */
|
|
100
|
-
readonly path?: string;
|
|
101
|
-
/** Line range as written, when stated. */
|
|
102
|
-
readonly range?: string;
|
|
103
|
-
}
|
|
104
|
-
/** The parsed conclusion of one review reply. */
|
|
105
|
-
export interface ReviewConclusion {
|
|
106
|
-
readonly findings: readonly ReviewFinding[];
|
|
107
|
-
readonly overall?: 'correct' | 'incorrect';
|
|
108
|
-
readonly explanation?: string;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Parse the reviewer's reply into a conclusion: whole-text JSON first, then
|
|
112
|
-
* the first balanced JSON object anywhere in the text, then undefined (the
|
|
113
|
-
* reply renders as plain markdown with no summary line). Malformed fields
|
|
114
|
-
* are dropped, never thrown.
|
|
115
|
-
*/
|
|
116
|
-
export declare function parseReviewConclusion(text: string): ReviewConclusion | undefined;
|
|
117
|
-
/**
|
|
118
|
-
* One compact summary line for a finished review: finding counts per
|
|
119
|
-
* priority plus the overall verdict, or a no-findings phrasing.
|
|
120
|
-
*/
|
|
121
|
-
export declare function reviewSummaryLine(conclusion: ReviewConclusion): string;
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deepseek-ai/dsh-code — the interactive terminal driver. The bundle patch
|
|
3
|
-
* rides over dsh-base without Host, HTTP, or browser plugins; this runner
|
|
4
|
-
* creates or resumes preset-composed Agents through the core registry, keeps
|
|
5
|
-
* one Ink owner while the active session changes, folds submitted prompts
|
|
6
|
-
* into the selected durable session, answers approval asks with a y/n bar,
|
|
7
|
-
* dispatches slash commands, and on quit flushes and requests process exit.
|
|
8
|
-
*
|
|
9
|
-
* @module @deepseek-ai/dsh-code
|
|
10
|
-
*/
|
|
11
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
12
|
-
import z from '@deepseek-ai/schemastery';
|
|
13
|
-
import type { Agent, AgentStatus, Inbox } from '@deepseek-ai/dsh-agent';
|
|
14
|
-
import { type ContentBlock } from '@deepseek-ai/dsh-llm';
|
|
15
|
-
import { SessionId, type SessionEvent, type SessionHeader, type UserMessage } from '@deepseek-ai/dsh-session';
|
|
16
|
-
import type { SessionPersistence } from '@deepseek-ai/dsh-session-persistence';
|
|
17
|
-
import { type QueueMutation } from './app.ts';
|
|
18
|
-
import type { TuiStartup } from './startup.ts';
|
|
19
|
-
import type { SearchRow } from './kernel-panels.ts';
|
|
20
|
-
/** Stable Cordis plugin name. */
|
|
21
|
-
export declare const name = "tui-runner";
|
|
22
|
-
/** Core services required before the interactive session can start. */
|
|
23
|
-
export declare const inject: string[];
|
|
24
|
-
/** Plugin config: the startup resolved from this app's injected provider service. */
|
|
25
|
-
export interface Config {
|
|
26
|
-
/** How this invocation obtains its session identity (validated loosely; narrowed in {@link apply}). */
|
|
27
|
-
startup: {
|
|
28
|
-
kind: string;
|
|
29
|
-
sessionId?: string;
|
|
30
|
-
mode?: string;
|
|
31
|
-
theme?: string;
|
|
32
|
-
prompt?: string;
|
|
33
|
-
images?: string[];
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export declare const Config: z<Config>;
|
|
37
|
-
/** The session identity this invocation will run, plus whether it is resumed. */
|
|
38
|
-
interface Target {
|
|
39
|
-
sessionId: string;
|
|
40
|
-
resume: boolean;
|
|
41
|
-
mode?: string;
|
|
42
|
-
cwd?: string;
|
|
43
|
-
seed?: readonly SessionEvent[];
|
|
44
|
-
parentSession?: SessionId;
|
|
45
|
-
/** Marks the session as a subagent conversation in the durable header. */
|
|
46
|
-
origin?: 'subagent';
|
|
47
|
-
seedLength?: number;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Reduce a session id to a filename-safe /export default-name suffix. Session
|
|
51
|
-
* ids are normally minted `session-<uuid>`, but `--session` accepts arbitrary
|
|
52
|
-
* user text: path separators must never leak into the default export filename
|
|
53
|
-
* (which would escape the session cwd).
|
|
54
|
-
* @param id - the session id.
|
|
55
|
-
* @returns at most the last 8 filename-safe characters.
|
|
56
|
-
*/
|
|
57
|
-
export declare function exportSessionIdSuffix(id: string): string;
|
|
58
|
-
/** One ordered step of the terminal quit cleanup. */
|
|
59
|
-
export interface QuitCleanupStep {
|
|
60
|
-
/** Step label used in diagnostics and tests. */
|
|
61
|
-
readonly name: string;
|
|
62
|
-
/** The step's async work; a rejection is contained by the sequence. */
|
|
63
|
-
readonly run: () => Promise<void>;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Run the ordered quit cleanup, then request exit. Every step rejection is
|
|
67
|
-
* contained (reported through `onError`) so a failed flush or dispose never
|
|
68
|
-
* skips the remaining cleanup; the exit request is always reached exactly
|
|
69
|
-
* once.
|
|
70
|
-
* @param steps - the cleanup steps in dependency order (settle the visible
|
|
71
|
-
* session, await the final in-flight composition, await durable recall).
|
|
72
|
-
* @param exit - the terminal exit request (code 0).
|
|
73
|
-
* @param onError - optional failure sink; called once per failing step and
|
|
74
|
-
* itself contained, so a throwing sink cannot abort the sequence.
|
|
75
|
-
* @returns the names of the steps that started, in order (for tests).
|
|
76
|
-
*/
|
|
77
|
-
export declare function runQuitSequence(steps: readonly QuitCleanupStep[], exit: (code: number) => void, onError?: (name: string, error: unknown) => void): Promise<readonly string[]>;
|
|
78
|
-
/** One composer submission waiting behind the startup delivery. */
|
|
79
|
-
export interface QueuedSubmission {
|
|
80
|
-
readonly text: string;
|
|
81
|
-
/** `steer` inserts into the running turn; `followup` waits for the next one. */
|
|
82
|
-
readonly mode: 'followup' | 'steer';
|
|
83
|
-
readonly images: readonly ContentBlock[];
|
|
84
|
-
}
|
|
85
|
-
/** What one requested queue mutation did; the runner maps it to one notice. */
|
|
86
|
-
export type QueueMutationOutcome = 'removed' | 'edited' | 'steered' | 'unavailable' | 'empty' | 'steerUnavailable';
|
|
87
|
-
/**
|
|
88
|
-
* Replace one queued message's text while keeping its attachments. A queue
|
|
89
|
-
* edit rewrites what the user typed, not what they attached: image and file
|
|
90
|
-
* blocks ride through in delivery order (text first, then attachments, the
|
|
91
|
-
* shape {@link deliverLine} submits). Dropping them here would silently strip
|
|
92
|
-
* an attachment the user already confirmed, so this is the edit's single
|
|
93
|
-
* definition and the panel's read-only marker only mirrors it.
|
|
94
|
-
*/
|
|
95
|
-
export declare function queueEditContent(content: readonly ContentBlock[], text: string): ContentBlock[];
|
|
96
|
-
/**
|
|
97
|
-
* Apply one terminal queue mutation to the live inbox. The decision and the
|
|
98
|
-
* inbox change are pure over the supplied handles so every branch is testable
|
|
99
|
-
* without an agent; steering itself is injected because it wakes the driver
|
|
100
|
-
* rather than mutating the inbox. The durable inbox splices remain the UI's
|
|
101
|
-
* single source of truth — this helper never reports a state the inbox did not
|
|
102
|
-
* actually reach.
|
|
103
|
-
* @param inbox - the live agent inbox (pending lists plus its mutators).
|
|
104
|
-
* @param status - the agent's lifecycle status; steering needs `running`.
|
|
105
|
-
* @param messageId - identity of the queued message to mutate.
|
|
106
|
-
* @param action - the requested mutation.
|
|
107
|
-
* @param steer - submits the removed message as next-step steering.
|
|
108
|
-
* @returns the outcome the caller reports.
|
|
109
|
-
*/
|
|
110
|
-
export declare function applyQueueMutation(inbox: Pick<Inbox, 'nextTurn' | 'append' | 'remove' | 'replace'>, status: AgentStatus, messageId: string, action: QueueMutation, steer: (message: UserMessage) => void): QueueMutationOutcome;
|
|
111
|
-
/**
|
|
112
|
-
* Cancel the active turn while keeping the next-turn queue, then wake the
|
|
113
|
-
* driver again so the preserved messages actually run. `cancel` clears
|
|
114
|
-
* pending work by default and never wakes the driver on its own, so the queue
|
|
115
|
-
* is captured first and re-submitted afterwards: a waking submission latches
|
|
116
|
-
* the wake while the aborted activity converges to idle, which is what turns
|
|
117
|
-
* "preserved" into "sent next" instead of "parked forever". Next-step
|
|
118
|
-
* steering is deliberately dropped — it belonged to the cancelled turn.
|
|
119
|
-
* @param agent - the live agent handle.
|
|
120
|
-
* @returns how many queued messages were preserved across the abort.
|
|
121
|
-
*/
|
|
122
|
-
export declare function cancelPreservingQueue(agent: Pick<Agent, 'inbox' | 'cancel' | 'followup'>): number;
|
|
123
|
-
/**
|
|
124
|
-
* Whether a tagged submission still belongs to the active session. Attachment
|
|
125
|
-
* prepares resolve on the microtask timeline, while a queued session switch
|
|
126
|
-
* remounts the app asynchronously — the composing instance's unmount cleanup
|
|
127
|
-
* runs too late to abort, so the delivery itself carries the composing
|
|
128
|
-
* session's full id and the runner drops it here when the world moved on.
|
|
129
|
-
* An untagged (synchronous) or pending-session ('') submission always passes.
|
|
130
|
-
*/
|
|
131
|
-
export declare function submissionBelongsToSession(origin: string | undefined, activeSessionId: string | undefined): boolean;
|
|
132
|
-
/**
|
|
133
|
-
* Root-log catalog facts a resumed session must replay into the subagent
|
|
134
|
-
* feed: constructor seeds never fire on the live bus, so without this the
|
|
135
|
-
* children of a resumed session vanish behind a restart. The empty-child
|
|
136
|
-
* placeholder row (childId '') is a placeholder, not a child, and stays out.
|
|
137
|
-
*/
|
|
138
|
-
export declare function subagentCatalogSeed(events: readonly SessionEvent[]): readonly SessionEvent<'subagent/catalog'>[];
|
|
139
|
-
/**
|
|
140
|
-
* Map one cross-session full-text hit onto the /search panel's row (pure).
|
|
141
|
-
* Labels fall back to the short id form — the engine's hit carries the
|
|
142
|
-
* strongest matching event, not the title observation.
|
|
143
|
-
*/
|
|
144
|
-
export declare function searchHitToRow(hit: {
|
|
145
|
-
header: SessionHeader;
|
|
146
|
-
bestMatch: {
|
|
147
|
-
snippet: string;
|
|
148
|
-
time: number;
|
|
149
|
-
};
|
|
150
|
-
}): SearchRow;
|
|
151
|
-
/** One Shift+Tab station decision for the mode cycle. */
|
|
152
|
-
export type ModeCycleDecision = {
|
|
153
|
-
readonly kind: 'permission';
|
|
154
|
-
readonly preset: string;
|
|
155
|
-
} | {
|
|
156
|
-
readonly kind: 'plan-on';
|
|
157
|
-
} | {
|
|
158
|
-
readonly kind: 'plan-off';
|
|
159
|
-
readonly preset: string;
|
|
160
|
-
};
|
|
161
|
-
/**
|
|
162
|
-
* Decide the next Shift+Tab station. The cycle keeps the preset table's
|
|
163
|
-
* own order (most restrictive first) and inserts ONE plan station between
|
|
164
|
-
* the most restrictive preset and the wrap target: with the shipped three
|
|
165
|
-
* presets the user sees workspace-write → danger-full-access → read-only
|
|
166
|
-
* → plan → workspace-write. Plan IS the most restrictive preset plus the
|
|
167
|
-
* plan prompt layer — entering it switches nothing (the cycle is already
|
|
168
|
-
* parked on read-only), and leaving it lands on the next preset after the
|
|
169
|
-
* most restrictive one. Without the /plan command the cycle is exactly the
|
|
170
|
-
* preset table.
|
|
171
|
-
*
|
|
172
|
-
* `planIntent` covers the committed fold's commit lag: upstream queues a
|
|
173
|
-
* plan switch during an open turn (and the command pipeline is async even
|
|
174
|
-
* idle), so the durable plan/mode event lands AFTER the press that chose
|
|
175
|
-
* it. While an intent from an earlier press is in flight it — not the
|
|
176
|
-
* stale committed fold — decides the station, so repeated presses advance
|
|
177
|
-
* the cycle instead of re-issuing the same plan transition (the stuck
|
|
178
|
-
* plan-on/plan-off toggle). Undefined falls back to the committed fold.
|
|
179
|
-
*/
|
|
180
|
-
export declare function planCycleDecision(input: {
|
|
181
|
-
readonly names: readonly string[];
|
|
182
|
-
readonly current: string;
|
|
183
|
-
readonly inPlan: boolean;
|
|
184
|
-
readonly planAvailable: boolean;
|
|
185
|
-
readonly planIntent?: boolean;
|
|
186
|
-
}): ModeCycleDecision | undefined;
|
|
187
|
-
/**
|
|
188
|
-
* Order-preserving gate for composer input while the startup prompt/images
|
|
189
|
-
* are still preparing. Anything submitted before the startup delivery settles
|
|
190
|
-
* queues and flushes afterwards in submit order, so the initial request can
|
|
191
|
-
* never be overtaken by typing that raced a slow image preparation. The flush
|
|
192
|
-
* also runs when the startup delivery fails: user input is never stranded.
|
|
193
|
-
*/
|
|
194
|
-
export declare class StartupInputGate {
|
|
195
|
-
private readonly deliver;
|
|
196
|
-
private readonly queued;
|
|
197
|
-
private pending;
|
|
198
|
-
constructor(deliver: (submission: QueuedSubmission) => void);
|
|
199
|
-
/** Submit one line: delivered now while idle, queued behind the startup delivery otherwise. */
|
|
200
|
-
submit(submission: QueuedSubmission): void;
|
|
201
|
-
/**
|
|
202
|
-
* Run the startup delivery — the callback receives the direct-delivery sink
|
|
203
|
-
* for the startup prompt itself — then flush everything that queued behind
|
|
204
|
-
* it, in order, even when the callback rejects.
|
|
205
|
-
*/
|
|
206
|
-
run(startup: (deliver: (submission: QueuedSubmission) => void) => Promise<void>): Promise<void>;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Resolve the invocation's target session against the persisted headers.
|
|
210
|
-
* @param startup - the parsed startup flags.
|
|
211
|
-
* @param persistence - the persistence service; required for resume/latest.
|
|
212
|
-
* @param cwd - the working directory `--continue` filters by.
|
|
213
|
-
* @returns the target identity.
|
|
214
|
-
* @throws with a user-facing message when the flags name nothing resolvable.
|
|
215
|
-
*/
|
|
216
|
-
export declare function resolveTarget(startup: TuiStartup, persistence: SessionPersistence | undefined, cwd: string): Promise<Target>;
|
|
217
|
-
/**
|
|
218
|
-
* Mount the interactive terminal driver.
|
|
219
|
-
* @param ctx - plugin context carrying core services and the launcher-provided exit request.
|
|
220
|
-
* @param config - validated startup config resolved from the tuiStartup provider.
|
|
221
|
-
*/
|
|
222
|
-
export declare function apply(ctx: Context, config: Config): void;
|
|
223
|
-
export {};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Terminal input arrives as byte chunks, and one chunk can carry several
|
|
3
|
-
* keypresses: a fast space-then-enter, a bridged stdin that batches reads, a
|
|
4
|
-
* middle-click paste. Ink parses each chunk as exactly one keypress —
|
|
5
|
-
* `parseKeypress(' \r')` matches neither member, so both keys silently
|
|
6
|
-
* vanish (a multi-select question answered with an empty set). The splitter
|
|
7
|
-
* below cuts every chunk into the individual keypress units Ink's parser
|
|
8
|
-
* expects, keeping escape sequences and bracketed-paste blocks intact, and
|
|
9
|
-
* the stdin proxy feeds the split stream to the Ink mount.
|
|
10
|
-
*
|
|
11
|
-
* @module @deepseek-ai/dsh-tui/input-split
|
|
12
|
-
*/
|
|
13
|
-
import { PassThrough } from 'node:stream';
|
|
14
|
-
/** One keypress cut from the input stream. */
|
|
15
|
-
export interface KeypressSplitter {
|
|
16
|
-
/** Feed one chunk; returns every keypress unit this chunk completed. */
|
|
17
|
-
push(chunk: string): string[];
|
|
18
|
-
/** Whether an unterminated bracketed-paste block is currently held. */
|
|
19
|
-
openPaste(): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Last-resort escape hatch for a paste whose end marker never arrived:
|
|
22
|
-
* drop the start marker and emit the held bytes as plain keypress units so
|
|
23
|
-
* nothing (Esc and Ctrl+C included) stays hostage. Inert when no paste is
|
|
24
|
-
* open.
|
|
25
|
-
*/
|
|
26
|
-
releaseStalePaste(): string[];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Build a stateful chunk splitter. A partial unit at the end of one chunk
|
|
30
|
-
* (a cut CSI sequence, an open paste block) waits in the buffer for the
|
|
31
|
-
* rest. A chunk-trailing lone ESC emits as the Escape key right away:
|
|
32
|
-
* terminals send Escape as its own chunk, and holding it hostage for a
|
|
33
|
-
* sequence that may never continue would break every Esc cancel.
|
|
34
|
-
*/
|
|
35
|
-
export declare function createKeypressSplitter(): KeypressSplitter;
|
|
36
|
-
/** The stdin-shaped stream the Ink mount renders through. */
|
|
37
|
-
export interface TuiStdin extends PassThrough {
|
|
38
|
-
/** Mirrors the real stdin so Ink's raw-mode gate passes. */
|
|
39
|
-
isTTY: boolean;
|
|
40
|
-
/** Forwarded to the real stdin; Ink toggles it around focus. */
|
|
41
|
-
setRawMode(value: boolean): unknown;
|
|
42
|
-
ref(): void;
|
|
43
|
-
unref(): void;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Wrap one real stdin in the splitting proxy: keypress units flow into a
|
|
47
|
-
* PassThrough Ink reads, while raw-mode/ref calls forward to the source.
|
|
48
|
-
* @param source - the process (or harness) input stream in raw mode.
|
|
49
|
-
* @returns the proxy stream plus a dispose that detaches the tap.
|
|
50
|
-
*/
|
|
51
|
-
export declare function createSplitStdin(source: NodeJS.ReadStream): {
|
|
52
|
-
stdin: TuiStdin;
|
|
53
|
-
dispose: () => void;
|
|
54
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Injectable process-facing effects for the TUI runner. Tests substitute the
|
|
3
|
-
* Ink mount with a capturing fake and the streams with string sinks, keeping
|
|
4
|
-
* the runner's lifecycle testable without a terminal.
|
|
5
|
-
*
|
|
6
|
-
* @module @deepseek-ai/dsh-tui/internals
|
|
7
|
-
*/
|
|
8
|
-
import type { ReactElement } from 'react';
|
|
9
|
-
/** A mounted terminal app instance; the runner owns unmount ordering. */
|
|
10
|
-
export interface TuiMount {
|
|
11
|
-
/** Replace the root element while preserving Ink's single terminal owner. */
|
|
12
|
-
rerender(element: ReactElement): void;
|
|
13
|
-
/** Tear the terminal app down before flush and exit. */
|
|
14
|
-
unmount(): void;
|
|
15
|
-
}
|
|
16
|
-
/** The Ink mount seam: renders the app element and returns its handle. */
|
|
17
|
-
export type Mount = (element: ReactElement) => TuiMount;
|
|
18
|
-
/** Substitutable runner effects; production values write to the real terminal. */
|
|
19
|
-
export declare const internals: {
|
|
20
|
-
/** Ink renderer mount; tests substitute a fake that captures the element. */
|
|
21
|
-
mount: Mount;
|
|
22
|
-
/** Diagnostics stream for direct-driver failures. */
|
|
23
|
-
stderr: {
|
|
24
|
-
write(chunk: string): unknown;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Package-owned invariant companion for `dsh-code`.
|
|
3
|
-
* @module dsh-code/invariant
|
|
4
|
-
*/
|
|
5
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
-
/** Cordis companion plugin name. */
|
|
7
|
-
export declare const name = "tui-invariant";
|
|
8
|
-
/** Service required before the companion can register. */
|
|
9
|
-
export declare const inject: string[];
|
|
10
|
-
/**
|
|
11
|
-
* Register this package's invariant companion.
|
|
12
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
13
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
14
|
-
*/
|
|
15
|
-
export declare const apply: (ctx: Context) => Promise<() => void>;
|