Skip to content

Commit dc6f560

Browse files
committed
Merge branch 'main' into feature/changelog
2 parents 591274a + 7723ddd commit dc6f560

13 files changed

Lines changed: 509 additions & 82 deletions

File tree

.deepcode/AGENTS.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ packages/
1414
│ ├── prompt.ts # System prompt builder & tool definitions
1515
│ └── settings.ts # Settings resolution from ~/.deepcode/settings.json
1616
├── cli/src/ # Terminal UI (Ink/React)
17-
│ ├── cli.tsx # Entry point — parses args (-p, -v), renders AppContainer
18-
│ ├── ui/views/ # Top-level screens (App, PromptInput, SessionList, PermissionPrompt, etc.)
17+
│ ├── cli.tsx # Entry point — renders AppContainer
18+
│ ├── cli-args.ts # CLI argument parsing (yargs: -p, -r, -v, -h)
19+
│ ├── common/ # Update checker
20+
│ ├── utils/ # stdio helpers, version, package info
21+
│ ├── generated/ # Build-time git commit info
22+
│ ├── ui/views/ # Top-level screens (App, PromptInput, SessionList, PermissionPrompt, WelcomeScreen, UpdatePrompt, McpStatusList, etc.)
1923
│ ├── ui/components/ # Reusable Ink components (MessageView, DropdownMenu, ModelsDropdown, etc.)
2024
│ ├── ui/core/ # Prompt buffer, slash commands, file mentions, clipboard, undo/redo
21-
│ ├── ui/hooks/ # Custom hooks (cursor, history navigation, paste handling, terminal input)
25+
│ ├── ui/hooks/ # Custom hooks (cursor, history navigation, paste handling, terminal input, statusline)
2226
│ ├── ui/contexts/ # React contexts (AppContext, RawModeContext)
27+
│ ├── ui/statusline/ # Pluggable statusline providers (command, module)
2328
│ └── tests/ # UI-focused tests with run-tests.mjs runner
2429
├── vscode-ide-companion/ # VSCode extension companion
2530
│ └── src/ # extension.ts, provider.ts, utils.ts
@@ -45,6 +50,7 @@ All commands run from the repo root.
4550
| `npm run check` | Runs typecheck + lint + format:check together |
4651
| `npm run build` | Orchestrates full build (scripts/build.js) — compiles core + bundles CLI + copies assets |
4752
| `npm run bundle` | Generates git commit info + esbuild bundle + copies bundled assets |
53+
| `npm run build:vscode` | Builds the VSCode extension companion |
4854
| `npm test` | Runs all workspace tests (`npm run test --workspaces --if-present`) |
4955
| `npm run start` | Runs the locally built CLI (`scripts/start.js`) |
5056
| `npm run build-and-start` | Builds then starts the CLI |
@@ -115,9 +121,9 @@ A **file history system** (`packages/core/src/common/file-history.ts`) provides
115121

116122
**Slash commands**: `/skills`, `/model`, `/new`, `/init`, `/resume`, `/continue`, `/undo`, `/mcp`, `/raw`, `/exit`, plus dynamic `/skill-name` for each loaded skill.
117123

118-
**Key UI features**: `@` file mentions in the prompt input, `Ctrl+O` to view live process stdout, `Ctrl+V` to paste images, Shift+Enter for newlines, MCP server status display, undo selector, and permission prompts.
124+
**Key UI features**: `@` file mentions in the prompt input, `Ctrl+O` to view live process stdout, `Ctrl+V` to paste images, `Ctrl+X` to clear images, Shift+Enter for newlines, pluggable statusline, MCP server status display, undo selector, and permission prompts.
119125

120-
**CLI flags**: `-p <prompt>` / `--prompt` to auto-submit a prompt on launch, `-v` / `--version`, `-h` / `--help`.
126+
**CLI flags**: `-p <prompt>` / `--prompt` to auto-submit a prompt on launch, `-r [sessionId]` / `--resume [sessionId]` to resume a session or show the session picker, `-v` / `--version`, `-h` / `--help`.
121127

122128
## Agent-Specific Instructions
123129

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,18 @@ cd deepcode-cli
159159
# 安装依赖
160160
npm install
161161

162-
# 本地开发(类型检查 + lint + 格式检查 + 构建)
163-
npm run build
164-
165162
# 运行测试
166163
npm test
167164

168-
# 链接到全局(即本地全局安装)
165+
# CLI本地开发(类型检查 + lint + 格式检查 + 构建)
166+
npm run build
167+
168+
# CLI链接到全局(即本地全局安装)
169169
npm link
170+
171+
# VSCode插件本地开发
172+
npm run build:vscode
173+
170174
```
171175

172176
- 提交 PR 前请确保 `npm run check` 通过(类型检查 + lint + 格式检查)

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vegamo/deepcode-cli",
3-
"version": "0.1.31",
3+
"version": "0.1.33",
44
"description": "Deep Code CLI - Vibe coding for the deepseek-v4 model in your terminal",
55
"license": "MIT",
66
"type": "module",
@@ -15,6 +15,8 @@
1515
"main": "./dist/cli.js",
1616
"files": [
1717
"dist/cli.js",
18+
"dist/chunks/**",
19+
"dist/templates/**",
1820
"dist/bundled/**",
1921
"README.md",
2022
"LICENSE"

packages/cli/src/ui/views/App.tsx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import type {
4848
} from "@vegamo/deepcode-core";
4949
import { SessionManager } from "@vegamo/deepcode-core";
5050
import { getCompactPromptTokenThreshold } from "@vegamo/deepcode-core";
51+
import { writeStdoutLine } from "../../utils/stdio-helpers";
5152

5253
type View = "chat" | "session-list" | "undo" | "mcp-status";
5354

@@ -145,8 +146,8 @@ function App({ projectRoot, initialPrompt, resumeSessionId, onRestart }: AppProp
145146
onAssistantMessage: (message: SessionMessage) => {
146147
setMessages((prev) => [...prev, message]);
147148
if (rawModeRef.current === RawMode.Raw) {
148-
process.stdout.write("\n");
149-
process.stdout.write(renderMessageToStdout(message, rawModeRef.current) + "\n\n");
149+
writeStdoutLine("\n");
150+
writeStdoutLine(renderMessageToStdout(message, rawModeRef.current) + "\n\n");
150151
}
151152
},
152153
onSessionEntryUpdated: (entry) => {
@@ -196,7 +197,7 @@ function App({ projectRoot, initialPrompt, resumeSessionId, onRestart }: AppProp
196197
const resetStaticView = useCallback(
197198
(loadedMessages: SessionMessage[], options?: { clearScreen?: boolean }): Promise<void> => {
198199
if (options?.clearScreen) {
199-
process.stdout.write(ANSI_CLEAR_SCREEN);
200+
writeStdoutLine(ANSI_CLEAR_SCREEN);
200201
}
201202
setMessages([]);
202203
setWelcomeNonce((n) => n + 1);
@@ -298,19 +299,19 @@ function App({ projectRoot, initialPrompt, resumeSessionId, onRestart }: AppProp
298299
const session = activeSessionId ? sessionManager.getSession(activeSessionId) : null;
299300
const resumeHint = buildResumeHintText(activeSessionId ?? undefined);
300301

301-
process.stdout.write("\n");
302+
writeStdoutLine("\n");
302303
if (showCommand) {
303-
process.stdout.write(chalk.rgb(34, 154, 195)("> /exit "));
304-
process.stdout.write("\n\n");
304+
writeStdoutLine(chalk.rgb(34, 154, 195)(" > /exit "));
305+
writeStdoutLine("\n");
305306
}
306307
if (showSummary) {
307308
const summary = buildExitSummaryText({ session, sessionId: activeSessionId ?? undefined });
308-
process.stdout.write(summary);
309-
process.stdout.write("\n\n");
309+
writeStdoutLine(summary);
310+
writeStdoutLine("\n");
310311
}
311312
if (resumeHint) {
312-
process.stdout.write(resumeHint);
313-
process.stdout.write("\n");
313+
writeStdoutLine(resumeHint);
314+
writeStdoutLine("\n");
314315
}
315316

316317
sessionManager.dispose();
@@ -628,7 +629,7 @@ function App({ projectRoot, initialPrompt, resumeSessionId, onRestart }: AppProp
628629
setShowWelcome(false);
629630
setMessages([]);
630631
// Clear screen to remove stale formatted text.
631-
process.stdout.write(ANSI_CLEAR_SCREEN);
632+
writeStdoutLine(ANSI_CLEAR_SCREEN);
632633

633634
setTimeout(() => {
634635
if (nextMode === RawMode.Raw) {
@@ -667,7 +668,7 @@ function App({ projectRoot, initialPrompt, resumeSessionId, onRestart }: AppProp
667668
if (mode === RawMode.Raw) {
668669
// In raw mode, re-render all messages directly to stdout at the new width.
669670
// Use process.stdout.write instead of writeRef to avoid Ink interference.
670-
process.stdout.write(ANSI_CLEAR_SCREEN);
671+
writeStdoutLine(ANSI_CLEAR_SCREEN);
671672
const activeSessionId = sessionManager.getActiveSessionId();
672673
const allMessages = activeSessionId ? loadVisibleMessages(sessionManager, activeSessionId) : [];
673674
renderRawModeMessages(allMessages, mode);
@@ -898,7 +899,7 @@ function App({ projectRoot, initialPrompt, resumeSessionId, onRestart }: AppProp
898899
);
899900
}}
900901
</Static>
901-
{busy || statusLine ? <StatusLine busy={busy} text={statusLine} /> : null}
902+
{(busy || statusLine) && !isExiting ? <StatusLine busy={busy} text={statusLine} /> : null}
902903
{errorLine ? (
903904
<Box>
904905
<Text color="red">Error: {errorLine}</Text>

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vegamo/deepcode-core",
3-
"version": "0.1.31",
3+
"version": "0.1.33",
44
"description": "Deep Code core library — LLM session management, tool execution, and shared utilities",
55
"license": "MIT",
66
"type": "module",

packages/vscode-ide-companion/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "deepcode-vscode",
3-
"version": "0.1.22",
3+
"version": "0.1.23",
44
"publisher": "vegamo",
55
"displayName": "Deep Code",
66
"description": "Deep Code VSCode companion — AI-assisted development in your editor",

0 commit comments

Comments
 (0)