Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ When adding documentation, prefer clarity over comprehensiveness. A short, corre

### Prerequisites

| Dependency | Minimum Version | Notes |
|---------------|-----------------|------------------------------------------|
| Bun | ^1.3.9 | Package manager and runtime |
| Node.js | ^24.13.1 | Also required for some tooling |
| Git | 2.30+ | For version control integration |
| Codex CLI | latest | Required for Codex provider support |
| Dependency | Minimum Version | Notes |
| ---------- | --------------- | ----------------------------------- |
| Bun | ^1.3.9 | Package manager and runtime |
| Node.js | ^24.13.1 | Also required for some tooling |
| Git | 2.30+ | For version control integration |
| Codex CLI | latest | Required for Codex provider support |

The project uses **Bun** as its package manager with the `isolated` linker. Do not use `npm` or `yarn`.

Expand Down Expand Up @@ -172,15 +172,15 @@ If the UI shows no threads after connecting, the issue is likely a WebSocket aut

### Monorepo Packages

| Path | Role |
|-----------------------|-------------------------------------------------------------|
| Path | Role |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `apps/server` | Node.js WebSocket server. Wraps Codex app-server (JSON-RPC over stdio), serves the React web app, manages provider sessions. |
| `apps/web` | React/Vite UI. Session UX, conversation rendering, client-side state. Connects via WebSocket. |
| `apps/desktop` | Electron desktop shell. Wraps the web app as a native desktop application. |
| `apps/marketing` | Marketing / landing page site. |
| `packages/contracts` | Effect-TS Schema definitions and TypeScript contracts. Schema-only — no runtime logic. |
| `packages/shared` | Runtime utilities consumed by server and web. Uses explicit subpath exports — no barrel index. |
| `packages/effect-acp` | Effect-TS ACP (Agents, Context, Policies) integration. |
| `apps/web` | React/Vite UI. Session UX, conversation rendering, client-side state. Connects via WebSocket. |
| `apps/desktop` | Electron desktop shell. Wraps the web app as a native desktop application. |
| `apps/marketing` | Marketing / landing page site. |
| `packages/contracts` | Effect-TS Schema definitions and TypeScript contracts. Schema-only — no runtime logic. |
| `packages/shared` | Runtime utilities consumed by server and web. Uses explicit subpath exports — no barrel index. |
| `packages/effect-acp` | Effect-TS ACP (Agents, Context, Policies) integration. |

### Event Lifecycle

Expand Down Expand Up @@ -279,7 +279,7 @@ All code must pass `bun run lint` and `bun run fmt:check` before opening a PR.
### What Makes a Good PR

- **Small and focused.** Prefer PRs under 200 lines. Large PRs are difficult to review and more likely to be rejected.
- **Clear motivation.** Explain *what* changed and *why*. If the change is non-obvious, include the reasoning.
- **Clear motivation.** Explain _what_ changed and _why_. If the change is non-obvious, include the reasoning.
- **Tests included.** New functionality must include tests. Bug fixes must include a regression test.
- **Quality checks pass.** Run `bun run test`, `bun run lint`, `bun run fmt:check`, and `bun run typecheck` before opening the PR.
- **UI changes include screenshots.** Before/after images are required. Videos for animation/interaction changes.
Expand Down Expand Up @@ -379,4 +379,4 @@ This is recorded once per repository and does not need to be repeated for subseq

---

*Thank you for helping make Peak Code better. Every thoughtful contribution — whether a bug report, a documentation fix, or a code change — moves the project forward.*
_Thank you for helping make Peak Code better. Every thoughtful contribution — whether a bug report, a documentation fix, or a code change — moves the project forward._
30 changes: 15 additions & 15 deletions CONTRIBUTING.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@

### 前置条件

| 依赖 | 最低版本 | 说明 |
|--------------|------------|------------------------------|
| Bun | ^1.3.9 | 包管理器及运行时 |
| Node.js | ^24.13.1 | 部分工具链所需 |
| Git | 2.30+ | 版本控制集成 |
| Codex CLI | latest | Codex 提供方支持所需 |
| 依赖 | 最低版本 | 说明 |
| --------- | -------- | -------------------- |
| Bun | ^1.3.9 | 包管理器及运行时 |
| Node.js | ^24.13.1 | 部分工具链所需 |
| Git | 2.30+ | 版本控制集成 |
| Codex CLI | latest | Codex 提供方支持所需 |

本项目使用 **Bun** 作为包管理器,采用 `isolated` 链接器。请勿使用 `npm` 或 `yarn`。

Expand Down Expand Up @@ -172,15 +172,15 @@ env -u PEAKCODE_AUTH_TOKEN PEAKCODE_PORT_OFFSET=3158 \

### Monorepo 包结构

| 路径 | 职责 |
|-----------------------|----------------------------------------------------------------|
| 路径 | 职责 |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `apps/server` | Node.js WebSocket 服务器。包装 Codex app-server(通过 stdio 进行 JSON-RPC 通信),提供 React Web 应用,管理 AI 提供方会话。 |
| `apps/web` | React/Vite UI。会话用户体验、对话渲染、客户端状态管理。通过 WebSocket 连接。 |
| `apps/desktop` | Electron 桌面外壳。将 Web 应用封装为原生桌面应用。 |
| `apps/marketing` | 营销/落地页网站。 |
| `packages/contracts` | Effect-TS Schema 定义和 TypeScript 合约。仅包含 Schema——不含运行时逻辑。 |
| `packages/shared` | 被服务器和 Web 共同使用的运行时工具库。使用显式子路径导出——不使用 barrel index。 |
| `packages/effect-acp` | Effect-TS ACP(Agents, Context, Policies)集成。 |
| `apps/web` | React/Vite UI。会话用户体验、对话渲染、客户端状态管理。通过 WebSocket 连接。 |
| `apps/desktop` | Electron 桌面外壳。将 Web 应用封装为原生桌面应用。 |
| `apps/marketing` | 营销/落地页网站。 |
| `packages/contracts` | Effect-TS Schema 定义和 TypeScript 合约。仅包含 Schema——不含运行时逻辑。 |
| `packages/shared` | 被服务器和 Web 共同使用的运行时工具库。使用显式子路径导出——不使用 barrel index。 |
| `packages/effect-acp` | Effect-TS ACP(Agents, Context, Policies)集成。 |

### 事件生命周期

Expand Down Expand Up @@ -379,4 +379,4 @@ I have read the CLA Document and I hereby sign the CLA

---

*感谢您帮助 Peak Code 变得更好。每一份深思熟虑的贡献——无论是 Bug 报告、文档修复还是代码修改——都在推动项目向前发展。*
_感谢您帮助 Peak Code 变得更好。每一份深思熟虑的贡献——无论是 Bug 报告、文档修复还是代码修改——都在推动项目向前发展。_
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Small things

- [ ] Submitting new messages should scroll to bottom
- [ ] Only show last 10 threads for a given project
- [x] Only show last 10 threads for a given project
- [ ] Thread archiving
- [ ] New projects should go on top
- [ ] Projects should be sorted by latest thread update
Expand Down
16 changes: 4 additions & 12 deletions apps/server/src/provider/Layers/ProviderHealth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -740,9 +740,7 @@ const runCommandHealthProbe = <R>(effect: Effect.Effect<CommandResult, unknown,
Effect.timeoutOption(DEFAULT_TIMEOUT_MS),
Effect.exit,
Effect.map((exit) =>
Exit.isSuccess(exit)
? Result.succeed(exit.value)
: Result.fail(Cause.squash(exit.cause)),
Exit.isSuccess(exit) ? Result.succeed(exit.value) : Result.fail(Cause.squash(exit.cause)),
),
);

Expand Down Expand Up @@ -1087,9 +1085,7 @@ export const makeCheckClaudeProviderStatus = (
const executable = nonEmptyTrimmed(binaryPath) ?? "claude";

// Probe 1: `claude --version` — is the CLI reachable?
const versionProbe = yield* runCommandHealthProbe(
runClaudeCommand(["--version"], executable),
);
const versionProbe = yield* runCommandHealthProbe(runClaudeCommand(["--version"], executable));

if (Result.isFailure(versionProbe)) {
const error = versionProbe.failure;
Expand Down Expand Up @@ -1202,9 +1198,7 @@ export const makeCheckGeminiProviderStatus = (
const checkedAt = new Date().toISOString();
const executable = nonEmptyTrimmed(binaryPath) ?? "gemini";

const versionProbe = yield* runCommandHealthProbe(
runGeminiCommand(["--version"], executable),
);
const versionProbe = yield* runCommandHealthProbe(runGeminiCommand(["--version"], executable));

if (Result.isFailure(versionProbe)) {
const error = versionProbe.failure;
Expand Down Expand Up @@ -1551,9 +1545,7 @@ export const makeCheckCursorProviderStatus = (
const checkedAt = new Date().toISOString();
const executable = resolveCursorAgentBinaryPath(nonEmptyTrimmed(binaryPath));

const versionProbe = yield* runCommandHealthProbe(
runCursorCommand(["--version"], executable),
);
const versionProbe = yield* runCommandHealthProbe(runCursorCommand(["--version"], executable));

if (Result.isFailure(versionProbe)) {
const error = versionProbe.failure;
Expand Down
4 changes: 1 addition & 3 deletions apps/web/src/components/BrowserPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,7 @@ function isBrowserPerfLoggingEnabled(): boolean {
}

try {
return (
window.localStorage.getItem("peakcode:browser-perf") === "1"
);
return window.localStorage.getItem("peakcode:browser-perf") === "1";
} catch {
return false;
}
Expand Down
5 changes: 5 additions & 0 deletions apps/web/src/components/Sidebar.logic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
shouldShowDebugFeatureFlagsMenu,
shouldPrunePinnedThreads,
shouldClearThreadSelectionOnMouseDown,
SIDEBAR_THREAD_PREVIEW_LIMIT,
sortProjectsForSidebar,
sortThreadsForSidebar,
} from "./Sidebar.logic";
Expand Down Expand Up @@ -598,6 +599,10 @@ describe("resolveProjectStatusIndicator", () => {
});

describe("getVisibleThreadsForProject", () => {
it("keeps the collapsed project preview aligned with the ten-thread sidebar target", () => {
expect(SIDEBAR_THREAD_PREVIEW_LIMIT).toBe(10);
});

it("includes the active thread even when it falls below the folded preview", () => {
const threads = Array.from({ length: 8 }, (_, index) =>
makeThread({
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/components/Sidebar.logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export {
} from "../lib/projectCreateRecovery";

export const THREAD_SELECTION_SAFE_SELECTOR = "[data-thread-item], [data-thread-selection-safe]";
export const SIDEBAR_THREAD_PREVIEW_LIMIT = 10;
export const SIDEBAR_THREAD_PREWARM_LIMIT = 10;
export const DEBUG_FEATURE_FLAGS_MENU_STORAGE_KEY = "peakcode:show-debug-feature-flags-menu";
export type SidebarNewThreadEnvMode = "local" | "worktree";
Expand Down
Loading
Loading