Skip to content

Commit 587a602

Browse files
committed
Merge branch 'main' into feature/mcp-refactor
2 parents d9a3e15 + 55bb8b4 commit 587a602

10 files changed

Lines changed: 16 additions & 16 deletions

File tree

.deepcode/AGENTS.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ src/
88
├── session.ts # SessionManager — LLM loop, compaction, tool orchestration
99
├── settings.ts # Settings resolution from ~/.deepcode/settings.json
1010
├── prompt.ts # System prompt builder, tool definitions, agent-drift-guard skill
11-
├── model-capabilities.ts # Model detection and thinking-mode defaults
11+
├── common/
12+
│ ├── model-capabilities.ts # Model detection and thinking-mode defaults
13+
│ ├── file-utils.ts # File read/write with encoding and diff preview
14+
│ ├── shell-utils.ts # Shell path resolution (Git Bash, zsh, bash)
15+
│ ├── state.ts # In-memory file state and snippet tracking
16+
│ └── runtime.ts # Tool validation runtime helpers
1217
├── ui/
1318
│ ├── App.tsx # Root Ink component — state, routing, session orchestration
1419
│ ├── PromptInput.tsx # Multi-line input with slash commands, image paste, skills
@@ -20,11 +25,6 @@ src/
2025
├── mcp/
2126
│ ├── mcp-client.ts # MCP client — JSON-RPC communication with MCP servers
2227
│ └── mcp-manager.ts # MCP manager — lifecycle, tool registration, execution
23-
├── common/
24-
│ ├── file-utils.ts # File read/write with encoding and diff preview
25-
│ ├── shell-utils.ts # Shell path resolution (Git Bash, zsh, bash)
26-
│ ├── state.ts # In-memory file state and snippet tracking
27-
│ └── runtime.ts # Tool validation runtime helpers
2828
├── tools/
2929
│ ├── executor.ts # ToolExecutor — dispatches tool calls to handlers
3030
│ ├── bash-handler.ts # Executes shell commands
@@ -52,7 +52,7 @@ dist/ # Bundled CLI output (gitignored)
5252
| `npm run format:check` | Prettier in check-only mode |
5353
| `npm run check` | Runs typecheck + lint + format:check together |
5454
| `npm run bundle` | esbuild bundles `src/cli.tsx``dist/cli.js` (ESM, Node 18) |
55-
| `npm run build` | `check` + `bundle` — full CI gate before publish |
55+
| `npm run build` | `check` + `bundle` + chmod 755 — full CI gate before publish |
5656
| `npm test` | Runs all tests via `tsx --test src/tests/*.test.ts` |
5757
| `npm run test:single -- <file>` | Run a single test file (e.g., `npm run test:single -- src/tests/session.test.ts`) |
5858

File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ReasoningEffort } from "./settings";
1+
import type { ReasoningEffort } from "../settings";
22

33
type ThinkingConfig = {
44
type: "enabled" | "disabled";

src/session.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import { fileURLToPath } from "url";
66
import matter from "gray-matter";
77
import ejs from "ejs";
88
import type { ChatCompletionMessageParam, ChatCompletionContentPart } from "openai/resources/chat/completions";
9-
import { launchNotifyScript } from "./notify";
10-
import { buildThinkingRequestOptions } from "./openai-thinking";
9+
import { launchNotifyScript } from "./common/notify";
10+
import { buildThinkingRequestOptions } from "./common/openai-thinking";
1111
import { DEEPSEEK_V4_MODELS, supportsMultimodal } from "./common/model-capabilities";
1212
import { getCompactPrompt, getSystemPrompt, getTools, AGENT_DRIFT_GUARD_SKILL, type ToolDefinition } from "./prompt";
1313
import { ToolExecutor, type CreateOpenAIClient } from "./tools/executor";
1414
import { McpManager } from "./mcp/mcp-manager";
1515
import type { McpServerConfig } from "./settings";
16-
import { logApiError } from "./error-logger";
17-
import { logOpenAIChatCompletionDebug, normalizeDebugError } from "./debug-logger";
16+
import { logApiError } from "./common/error-logger";
17+
import { logOpenAIChatCompletionDebug, normalizeDebugError } from "./common/debug-logger";
1818

1919
const MAX_SESSION_ENTRIES = 50;
2020
const DEFAULT_NEW_PROMPT_API_URL = "https://deepcode.vegamo.cn/api/plugin/new";

src/tests/debug-logger.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import assert from "node:assert/strict";
33
import * as fs from "fs";
44
import * as os from "os";
55
import * as path from "path";
6-
import { getDebugLogPath, logOpenAIChatCompletionDebug } from "../debug-logger";
6+
import { getDebugLogPath, logOpenAIChatCompletionDebug } from "../common/debug-logger";
77

88
test("debug logger appends full entries without rotation", () => {
99
const originalHome = process.env.HOME;

src/tests/openai-thinking.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { test } from "node:test";
22
import assert from "node:assert/strict";
3-
import { buildThinkingRequestOptions } from "../openai-thinking";
3+
import { buildThinkingRequestOptions } from "../common/openai-thinking";
44

55
test("buildThinkingRequestOptions explicitly disables thinking", () => {
66
assert.deepEqual(buildThinkingRequestOptions(false, "https://api.deepseek.com"), {

src/tests/settings-and-notify.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { test } from "node:test";
22
import assert from "node:assert/strict";
3-
import { buildNotifyEnv, formatDurationSeconds, launchNotifyScript, type NotifySpawn } from "../notify";
3+
import { buildNotifyEnv, formatDurationSeconds, launchNotifyScript, type NotifySpawn } from "../common/notify";
44
import { applyModelConfigSelection, resolveSettings, resolveSettingsSources } from "../settings";
55

66
const TEST_PROCESS_ENV = {};

src/tools/edit-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as fs from "fs";
22
import { z } from "zod";
3-
import { buildThinkingRequestOptions } from "../openai-thinking";
3+
import { buildThinkingRequestOptions } from "../common/openai-thinking";
44
import type { ToolExecutionContext, ToolExecutionResult } from "./executor";
55
import {
66
buildDiffPreview,

0 commit comments

Comments
 (0)