@hienlh/ppm 0.1.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.
- package/.claude/agent-memory/tester/MEMORY.md +3 -0
- package/.claude/agent-memory/tester/project-ppm-test-conventions.md +32 -0
- package/.env.example +1 -0
- package/.github/workflows/release.yml +46 -0
- package/README.md +349 -0
- package/bun.lock +1217 -0
- package/components.json +21 -0
- package/docs/code-standards.md +574 -0
- package/docs/codebase-summary.md +294 -0
- package/docs/deployment-guide.md +631 -0
- package/docs/design-guidelines.md +661 -0
- package/docs/project-overview-pdr.md +142 -0
- package/docs/project-roadmap.md +400 -0
- package/docs/system-architecture.md +459 -0
- package/package.json +68 -0
- package/plans/260314-2009-ppm-implementation/phase-01-project-skeleton.md +81 -0
- package/plans/260314-2009-ppm-implementation/phase-02-backend-core.md +148 -0
- package/plans/260314-2009-ppm-implementation/phase-03-frontend-shell.md +256 -0
- package/plans/260314-2009-ppm-implementation/phase-04-file-explorer-editor.md +120 -0
- package/plans/260314-2009-ppm-implementation/phase-05-web-terminal.md +174 -0
- package/plans/260314-2009-ppm-implementation/phase-06-git-integration.md +244 -0
- package/plans/260314-2009-ppm-implementation/phase-07-ai-chat.md +242 -0
- package/plans/260314-2009-ppm-implementation/phase-08-cli-commands.md +143 -0
- package/plans/260314-2009-ppm-implementation/phase-09-pwa-build-deploy.md +209 -0
- package/plans/260314-2009-ppm-implementation/phase-10-testing.md +311 -0
- package/plans/260314-2009-ppm-implementation/plan.md +202 -0
- package/plans/260315-0356-project-scoped-api-refactor/phase-01-backend-project-router.md +145 -0
- package/plans/260315-0356-project-scoped-api-refactor/phase-02-frontend-api-migration.md +107 -0
- package/plans/260315-0356-project-scoped-api-refactor/phase-03-per-project-tabs.md +100 -0
- package/plans/260315-0356-project-scoped-api-refactor/phase-04-websocket-migration.md +66 -0
- package/plans/260315-0356-project-scoped-api-refactor/plan.md +87 -0
- package/plans/reports/brainstorm-260314-1938-final-techstack.md +342 -0
- package/plans/reports/docs-manager-260315-1314-documentation-creation.md +386 -0
- package/plans/reports/fullstack-developer-260314-2252-phase-02-backend-core.md +57 -0
- package/plans/reports/fullstack-developer-260314-2253-phase-03-frontend-shell.md +70 -0
- package/plans/reports/fullstack-developer-260314-2300-phase-04-05-file-api-terminal-ws.md +49 -0
- package/plans/reports/fullstack-developer-260314-2300-phase-04-05-file-explorer-editor-terminal.md +52 -0
- package/plans/reports/fullstack-developer-260314-2307-ai-chat-phase7.md +58 -0
- package/plans/reports/fullstack-developer-260314-2307-phase-06-git-integration.md +33 -0
- package/plans/reports/research-260314-1911-ppm-tech-stack.md +318 -0
- package/plans/reports/research-260314-1930-claude-code-integration.md +293 -0
- package/plans/reports/researcher-260314-2232-node-pty-bun-crash-analysis.md +305 -0
- package/plans/reports/researcher-260314-2232-ui-style.md +942 -0
- package/plans/reports/researcher-260315-0300-opcode-claude-interaction.md +745 -0
- package/plans/reports/researcher-260315-0303-opcode-deep-analysis.md +742 -0
- package/plans/reports/researcher-260315-0305-claude-agent-sdk-github-research.md +423 -0
- package/plans/reports/tester-260314-2053-initial-test-suite.md +81 -0
- package/ppm.example.yaml +14 -0
- package/repomix-output.xml +23745 -0
- package/scripts/build.ts +13 -0
- package/src/cli/commands/chat-cmd.ts +259 -0
- package/src/cli/commands/config-cmd.ts +121 -0
- package/src/cli/commands/git-cmd.ts +315 -0
- package/src/cli/commands/init.ts +57 -0
- package/src/cli/commands/open.ts +19 -0
- package/src/cli/commands/projects.ts +100 -0
- package/src/cli/commands/start.ts +3 -0
- package/src/cli/commands/stop.ts +33 -0
- package/src/cli/utils/project-resolver.ts +27 -0
- package/src/index.ts +59 -0
- package/src/providers/claude-agent-sdk.ts +499 -0
- package/src/providers/claude-binary-finder.ts +256 -0
- package/src/providers/claude-code-cli.ts +413 -0
- package/src/providers/claude-process-registry.ts +106 -0
- package/src/providers/mock-provider.ts +171 -0
- package/src/providers/provider.interface.ts +10 -0
- package/src/providers/registry.ts +45 -0
- package/src/server/helpers/resolve-project.ts +22 -0
- package/src/server/index.ts +181 -0
- package/src/server/middleware/auth.ts +30 -0
- package/src/server/routes/chat.ts +153 -0
- package/src/server/routes/files.ts +168 -0
- package/src/server/routes/git.ts +261 -0
- package/src/server/routes/project-scoped.ts +27 -0
- package/src/server/routes/projects.ts +57 -0
- package/src/server/routes/static.ts +26 -0
- package/src/server/ws/chat.ts +130 -0
- package/src/server/ws/terminal.ts +89 -0
- package/src/services/chat.service.ts +110 -0
- package/src/services/claude-usage.service.ts +113 -0
- package/src/services/config.service.ts +90 -0
- package/src/services/file.service.ts +261 -0
- package/src/services/git-dirs.service.ts +112 -0
- package/src/services/git.service.ts +372 -0
- package/src/services/project.service.ts +107 -0
- package/src/services/slash-items.service.ts +184 -0
- package/src/services/terminal.service.ts +212 -0
- package/src/types/api.ts +37 -0
- package/src/types/chat.ts +92 -0
- package/src/types/config.ts +41 -0
- package/src/types/git.ts +50 -0
- package/src/types/project.ts +18 -0
- package/src/types/terminal.ts +20 -0
- package/src/web/app.tsx +168 -0
- package/src/web/components/auth/login-screen.tsx +88 -0
- package/src/web/components/chat/attachment-chips.tsx +55 -0
- package/src/web/components/chat/chat-placeholder.tsx +10 -0
- package/src/web/components/chat/chat-tab.tsx +301 -0
- package/src/web/components/chat/file-picker.tsx +126 -0
- package/src/web/components/chat/message-input.tsx +420 -0
- package/src/web/components/chat/message-list.tsx +838 -0
- package/src/web/components/chat/session-picker.tsx +139 -0
- package/src/web/components/chat/slash-command-picker.tsx +135 -0
- package/src/web/components/chat/usage-badge.tsx +186 -0
- package/src/web/components/editor/code-editor.tsx +329 -0
- package/src/web/components/editor/diff-viewer.tsx +276 -0
- package/src/web/components/editor/editor-placeholder.tsx +10 -0
- package/src/web/components/explorer/file-actions.tsx +191 -0
- package/src/web/components/explorer/file-tree.tsx +298 -0
- package/src/web/components/git/git-graph.tsx +727 -0
- package/src/web/components/git/git-placeholder.tsx +55 -0
- package/src/web/components/git/git-status-panel.tsx +850 -0
- package/src/web/components/layout/mobile-drawer.tsx +137 -0
- package/src/web/components/layout/mobile-nav.tsx +103 -0
- package/src/web/components/layout/sidebar.tsx +90 -0
- package/src/web/components/layout/tab-bar.tsx +152 -0
- package/src/web/components/layout/tab-content.tsx +85 -0
- package/src/web/components/projects/dir-suggest.tsx +152 -0
- package/src/web/components/projects/project-list.tsx +187 -0
- package/src/web/components/settings/settings-tab.tsx +57 -0
- package/src/web/components/terminal/terminal-placeholder.tsx +10 -0
- package/src/web/components/terminal/terminal-tab.tsx +133 -0
- package/src/web/components/ui/button.tsx +64 -0
- package/src/web/components/ui/context-menu.tsx +250 -0
- package/src/web/components/ui/dialog.tsx +156 -0
- package/src/web/components/ui/dropdown-menu.tsx +257 -0
- package/src/web/components/ui/input.tsx +21 -0
- package/src/web/components/ui/scroll-area.tsx +56 -0
- package/src/web/components/ui/separator.tsx +26 -0
- package/src/web/components/ui/sonner.tsx +40 -0
- package/src/web/components/ui/tabs.tsx +91 -0
- package/src/web/components/ui/tooltip.tsx +57 -0
- package/src/web/hooks/use-chat.ts +420 -0
- package/src/web/hooks/use-terminal.ts +182 -0
- package/src/web/hooks/use-url-sync.ts +66 -0
- package/src/web/hooks/use-websocket.ts +48 -0
- package/src/web/index.html +16 -0
- package/src/web/lib/api-client.ts +90 -0
- package/src/web/lib/file-support.ts +68 -0
- package/src/web/lib/utils.ts +6 -0
- package/src/web/lib/ws-client.ts +100 -0
- package/src/web/main.tsx +10 -0
- package/src/web/public/icon-192.svg +5 -0
- package/src/web/public/icon-512.svg +5 -0
- package/src/web/stores/file-store.ts +81 -0
- package/src/web/stores/project-store.ts +50 -0
- package/src/web/stores/settings-store.ts +65 -0
- package/src/web/stores/tab-store.ts +187 -0
- package/src/web/styles/globals.css +227 -0
- package/src/web/vite-env.d.ts +1 -0
- package/tests/integration/api/chat-routes.test.ts +95 -0
- package/tests/integration/claude-agent-sdk-integration.test.ts +228 -0
- package/tests/integration/ws/chat-websocket.test.ts +312 -0
- package/tests/test-setup.ts +5 -0
- package/tests/unit/providers/claude-agent-sdk.test.ts +339 -0
- package/tests/unit/providers/mock-provider.test.ts +143 -0
- package/tests/unit/services/chat-service.test.ts +100 -0
- package/tsconfig.json +32 -0
- package/vite.config.ts +62 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: PPM test conventions and gotchas
|
|
3
|
+
description: Key patterns, pitfalls, and setup details for writing tests in the PPM project
|
|
4
|
+
type: project
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Test runner: `bun test` (Jest-compatible API from `bun:test`)
|
|
8
|
+
|
|
9
|
+
## Test structure
|
|
10
|
+
- `tests/setup.ts` — shared helpers: `createTempDir`, `cleanupDir`, `createTempGitRepo`, `buildTestApp`
|
|
11
|
+
- `tests/unit/services/` — unit tests for ConfigService, ProjectService, FileService, GitService
|
|
12
|
+
- `tests/integration/api/` — integration tests using `app.request()` (no real server needed)
|
|
13
|
+
|
|
14
|
+
## Critical gotchas
|
|
15
|
+
|
|
16
|
+
### ppm.yaml in CWD
|
|
17
|
+
The project root has a real `ppm.yaml` with `port: 5555`. `ConfigService.load(missingPath)` falls through to `LOCAL_CONFIG = "ppm.yaml"` in CWD when the given path doesn't exist. Always write an actual file before calling `load()` to avoid picking up this real config.
|
|
18
|
+
|
|
19
|
+
### Global configService in git routes
|
|
20
|
+
`src/server/routes/git.ts` imports and uses the global `configService` singleton (not injected). Integration tests for git API must mutate `configService.config.projects` directly to register the test repo. Restore to `[]` in `afterEach`.
|
|
21
|
+
|
|
22
|
+
### ConfigService.load() fallback behavior
|
|
23
|
+
Candidates checked in order: explicit path → PPM_CONFIG env → LOCAL_CONFIG (ppm.yaml) → HOME_CONFIG (~/.ppm/config.yaml). A missing explicit path does NOT stop the fallback chain.
|
|
24
|
+
|
|
25
|
+
### buildTestApp in setup.ts
|
|
26
|
+
Overrides `configService.save = () => {}` (no-op) to prevent tests writing to disk. Injects config directly by mutating private fields via `as unknown as`.
|
|
27
|
+
|
|
28
|
+
### Real git repos for git tests
|
|
29
|
+
`createTempGitRepo()` uses `Bun.spawn` with git env vars (author name/email) to create a real repo with an initial commit. No mocks for git operations.
|
|
30
|
+
|
|
31
|
+
**Why:** Tests must use real implementations — no fakes/mocks that diverge from production behavior.
|
|
32
|
+
**How to apply:** Always use `createTempGitRepo` for anything touching GitService or git API routes.
|
package/.env.example
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ANTHROPIC_API_KEY=your-api-key-here
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ['v*']
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
strategy:
|
|
10
|
+
matrix:
|
|
11
|
+
include:
|
|
12
|
+
- os: ubuntu-latest
|
|
13
|
+
target: bun-linux-x64
|
|
14
|
+
artifact: ppm-linux-x64
|
|
15
|
+
- os: macos-latest
|
|
16
|
+
target: bun-darwin-arm64
|
|
17
|
+
artifact: ppm-darwin-arm64
|
|
18
|
+
- os: macos-13
|
|
19
|
+
target: bun-darwin-x64
|
|
20
|
+
artifact: ppm-darwin-x64
|
|
21
|
+
|
|
22
|
+
runs-on: ${{ matrix.os }}
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
- uses: oven-sh/setup-bun@v2
|
|
26
|
+
- run: bun install
|
|
27
|
+
- run: bun run build:web
|
|
28
|
+
- run: bun build src/index.ts --compile --target=${{ matrix.target }} --outfile=dist/${{ matrix.artifact }}
|
|
29
|
+
- uses: actions/upload-artifact@v4
|
|
30
|
+
with:
|
|
31
|
+
name: ${{ matrix.artifact }}
|
|
32
|
+
path: dist/${{ matrix.artifact }}
|
|
33
|
+
|
|
34
|
+
release:
|
|
35
|
+
needs: build
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
permissions:
|
|
38
|
+
contents: write
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/download-artifact@v4
|
|
41
|
+
- uses: softprops/action-gh-release@v2
|
|
42
|
+
with:
|
|
43
|
+
files: |
|
|
44
|
+
ppm-linux-x64/ppm-linux-x64
|
|
45
|
+
ppm-darwin-arm64/ppm-darwin-arm64
|
|
46
|
+
ppm-darwin-x64/ppm-darwin-x64
|
package/README.md
ADDED
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
# PPM — Personal Project Manager
|
|
2
|
+
|
|
3
|
+
A **mobile-first web IDE** for managing code projects with AI-powered assistance. Built on Bun, React, and Hono.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
┌─────────────────────────────────────────────────────────┐
|
|
7
|
+
│ File Explorer │ Code Editor │ Terminal │ Chat │
|
|
8
|
+
│ + Git │ + Diff View │ Full PTY │ + Tools │
|
|
9
|
+
└─────────────────────────────────────────────────────────┘
|
|
10
|
+
↓
|
|
11
|
+
Claude AI Integration
|
|
12
|
+
(streaming, file attachments, tool use)
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- **📁 File Explorer** — Browse, create, edit, delete files with syntax highlighting
|
|
18
|
+
- **🖥️ Terminal** — Full xterm.js with Bun PTY, multiple sessions per project
|
|
19
|
+
- **💬 AI Chat** — Stream Claude AI with file attachments, slash commands, tool execution
|
|
20
|
+
- **🔧 Git Integration** — Status, diffs, commits, branching with visual graph
|
|
21
|
+
- **📱 Mobile-First** — Responsive design optimized for mobile, tablet, and desktop
|
|
22
|
+
- **🔐 Authentication** — Token-based auth with auto-generated tokens
|
|
23
|
+
- **💾 PWA** — Installable web app with offline support
|
|
24
|
+
- **⚡ Fast** — Built on Bun runtime, sub-200ms API responses
|
|
25
|
+
|
|
26
|
+
## Quick Start
|
|
27
|
+
|
|
28
|
+
### Prerequisites
|
|
29
|
+
- **Bun:** v1.3.6+ ([install](https://bun.sh))
|
|
30
|
+
- **Git:** v2.0+ (for git operations)
|
|
31
|
+
- **Node.js:** Optional (if using terminal to run npm commands)
|
|
32
|
+
|
|
33
|
+
### Installation
|
|
34
|
+
|
|
35
|
+
#### Option 1: Build from Source
|
|
36
|
+
```bash
|
|
37
|
+
# Clone & install
|
|
38
|
+
git clone https://github.com/hienlh/ppm.git
|
|
39
|
+
cd ppm
|
|
40
|
+
bun install
|
|
41
|
+
|
|
42
|
+
# Build
|
|
43
|
+
bun run build
|
|
44
|
+
|
|
45
|
+
# Run
|
|
46
|
+
./dist/ppm start
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### Option 2: Pre-built Binary
|
|
50
|
+
```bash
|
|
51
|
+
# Download from releases
|
|
52
|
+
wget https://github.com/hienlh/ppm/releases/download/v2.0/ppm-macos-x64
|
|
53
|
+
chmod +x ppm-macos-x64
|
|
54
|
+
sudo mv ppm-macos-x64 /usr/local/bin/ppm
|
|
55
|
+
|
|
56
|
+
# Run
|
|
57
|
+
ppm start
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### First-Time Setup
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Initialize config (scan for git repos)
|
|
64
|
+
ppm init
|
|
65
|
+
|
|
66
|
+
# Start server (foreground)
|
|
67
|
+
ppm start
|
|
68
|
+
|
|
69
|
+
# Or daemon mode
|
|
70
|
+
ppm start --daemon
|
|
71
|
+
|
|
72
|
+
# Open browser
|
|
73
|
+
ppm open
|
|
74
|
+
# → http://localhost:8080
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Usage
|
|
78
|
+
|
|
79
|
+
1. **Enter auth token** from `ppm.yaml` or terminal output
|
|
80
|
+
2. **Select a project** from the sidebar
|
|
81
|
+
3. **Browse files** in file explorer
|
|
82
|
+
4. **Open terminal** or **chat with Claude**
|
|
83
|
+
5. **Stage & commit** via git panel
|
|
84
|
+
|
|
85
|
+
## Development Setup
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Install dependencies
|
|
89
|
+
bun install
|
|
90
|
+
|
|
91
|
+
# Hot reload CLI
|
|
92
|
+
bun run dev
|
|
93
|
+
|
|
94
|
+
# Hot reload frontend (separate terminal)
|
|
95
|
+
bun run dev:web
|
|
96
|
+
|
|
97
|
+
# Type check
|
|
98
|
+
bun run typecheck
|
|
99
|
+
|
|
100
|
+
# Build
|
|
101
|
+
bun run build
|
|
102
|
+
|
|
103
|
+
# Run tests
|
|
104
|
+
bun test
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Project Structure
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
src/
|
|
111
|
+
├── index.ts # CLI entry point
|
|
112
|
+
├── cli/commands/ # ppm start, init, projects, git, chat
|
|
113
|
+
├── server/ # Hono HTTP server, WebSocket handlers
|
|
114
|
+
├── services/ # Business logic (chat, git, files, terminal)
|
|
115
|
+
├── providers/ # AI provider adapters (Claude SDK, CLI fallback)
|
|
116
|
+
├── types/ # TypeScript interfaces
|
|
117
|
+
└── web/ # React frontend (Vite)
|
|
118
|
+
├── components/ # React UI components
|
|
119
|
+
├── stores/ # Zustand state (project, tab, file, settings)
|
|
120
|
+
├── hooks/ # Custom hooks (useChat, useTerminal, useWebSocket)
|
|
121
|
+
├── lib/ # Utilities (API client, file detection)
|
|
122
|
+
└── styles/ # Tailwind CSS
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**See [`docs/codebase-summary.md`](docs/codebase-summary.md) for detailed structure.**
|
|
126
|
+
|
|
127
|
+
## Configuration
|
|
128
|
+
|
|
129
|
+
### Config File (`ppm.yaml`)
|
|
130
|
+
|
|
131
|
+
Auto-generated on `ppm init`:
|
|
132
|
+
|
|
133
|
+
```yaml
|
|
134
|
+
port: 8080
|
|
135
|
+
host: 0.0.0.0
|
|
136
|
+
auth:
|
|
137
|
+
enabled: true
|
|
138
|
+
token: "auto-generated-token"
|
|
139
|
+
projects:
|
|
140
|
+
- name: my-project
|
|
141
|
+
path: /path/to/my-project
|
|
142
|
+
providers:
|
|
143
|
+
default: claude-agent-sdk
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Environment Variables
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
export PPM_PORT=8080
|
|
150
|
+
export PPM_AUTH_TOKEN="my-token"
|
|
151
|
+
export ANTHROPIC_API_KEY="sk-ant-..." # For Claude integration
|
|
152
|
+
ppm start
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**See [`docs/deployment-guide.md`](docs/deployment-guide.md) for detailed config options.**
|
|
156
|
+
|
|
157
|
+
## Build & Deployment
|
|
158
|
+
|
|
159
|
+
### Development
|
|
160
|
+
```bash
|
|
161
|
+
bun run dev # CLI with hot reload
|
|
162
|
+
bun run dev:web # Frontend dev server (http://localhost:5173)
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Production
|
|
166
|
+
```bash
|
|
167
|
+
bun run build # Compile CLI binary to dist/ppm
|
|
168
|
+
./dist/ppm start # Run compiled binary
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Daemon Mode
|
|
172
|
+
```bash
|
|
173
|
+
ppm start --daemon # Background process
|
|
174
|
+
ppm stop # Graceful shutdown
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### systemd (Linux)
|
|
178
|
+
```bash
|
|
179
|
+
sudo cp dist/ppm /usr/local/bin/
|
|
180
|
+
# Create systemd service file (see docs/deployment-guide.md)
|
|
181
|
+
sudo systemctl start ppm
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**See [`docs/deployment-guide.md`](docs/deployment-guide.md) for full deployment instructions.**
|
|
185
|
+
|
|
186
|
+
## API Overview
|
|
187
|
+
|
|
188
|
+
### REST Endpoints
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
GET /api/health # Health check
|
|
192
|
+
GET /api/projects # List projects
|
|
193
|
+
POST /api/projects # Create project
|
|
194
|
+
DELETE /api/projects/:name # Delete project
|
|
195
|
+
|
|
196
|
+
GET /api/project/:name/chat/sessions # Chat sessions
|
|
197
|
+
POST /api/project/:name/chat/sessions # Create session
|
|
198
|
+
GET /api/project/:name/git/status # Git status
|
|
199
|
+
POST /api/project/:name/git/commit # Commit changes
|
|
200
|
+
GET /api/project/:name/files/tree # File tree
|
|
201
|
+
PUT /api/project/:name/files/write # Write file
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### WebSocket
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
WS /ws/project/:name/chat/:sessionId # Chat streaming
|
|
208
|
+
WS /ws/project/:name/terminal/:id # Terminal I/O
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**See [`docs/system-architecture.md`](docs/system-architecture.md) for detailed architecture.**
|
|
212
|
+
|
|
213
|
+
## Code Standards
|
|
214
|
+
|
|
215
|
+
- **TypeScript strict mode** — Full type safety
|
|
216
|
+
- **ESLint + Prettier** — Code formatting (run before commit)
|
|
217
|
+
- **Conventional commits** — Clear commit history
|
|
218
|
+
- **Unit + integration tests** — Verify functionality
|
|
219
|
+
|
|
220
|
+
**See [`docs/code-standards.md`](docs/code-standards.md) for detailed conventions.**
|
|
221
|
+
|
|
222
|
+
## Tech Stack
|
|
223
|
+
|
|
224
|
+
| Layer | Technology | Version |
|
|
225
|
+
|-------|-----------|---------|
|
|
226
|
+
| **Runtime** | Bun | 1.3.6+ |
|
|
227
|
+
| **Backend** | Hono | 4.12.8 |
|
|
228
|
+
| **Frontend** | React | 19.2.4 |
|
|
229
|
+
| **State** | Zustand | 5.0 |
|
|
230
|
+
| **Editor** | CodeMirror | 6.0 |
|
|
231
|
+
| **Terminal** | xterm.js | 6.0 |
|
|
232
|
+
| **UI** | Tailwind + Radix + shadcn | Latest |
|
|
233
|
+
| **AI** | Claude Agent SDK | 0.2.76 |
|
|
234
|
+
| **Build** | Vite | 8.0 |
|
|
235
|
+
|
|
236
|
+
## Documentation
|
|
237
|
+
|
|
238
|
+
- **[Project Overview & PDR](docs/project-overview-pdr.md)** — Goals, features, decisions
|
|
239
|
+
- **[Codebase Summary](docs/codebase-summary.md)** — Architecture, module responsibilities
|
|
240
|
+
- **[Code Standards](docs/code-standards.md)** — Conventions, patterns, best practices
|
|
241
|
+
- **[System Architecture](docs/system-architecture.md)** — Layers, protocols, data flows
|
|
242
|
+
- **[Project Roadmap](docs/project-roadmap.md)** — v2 status, v3 plans, known issues
|
|
243
|
+
- **[Deployment Guide](docs/deployment-guide.md)** — Installation, configuration, troubleshooting
|
|
244
|
+
- **[Design Guidelines](docs/design-guidelines.md)** — UI framework, colors, components
|
|
245
|
+
|
|
246
|
+
## Requirements
|
|
247
|
+
|
|
248
|
+
### System
|
|
249
|
+
- macOS or Linux (Windows support planned for v3)
|
|
250
|
+
- 512 MB RAM minimum, 2 GB recommended
|
|
251
|
+
- 500 MB disk space
|
|
252
|
+
|
|
253
|
+
### Software
|
|
254
|
+
- Bun v1.3.6+
|
|
255
|
+
- Git v2.0+
|
|
256
|
+
- Node.js (optional, for running npm commands in terminal)
|
|
257
|
+
|
|
258
|
+
### API Access (Optional)
|
|
259
|
+
- **Anthropic API key** for Claude integration
|
|
260
|
+
- Set `ANTHROPIC_API_KEY` environment variable
|
|
261
|
+
- Or use Claude CLI fallback (offline mode)
|
|
262
|
+
|
|
263
|
+
## Known Issues
|
|
264
|
+
|
|
265
|
+
### v2.0
|
|
266
|
+
- **Terminal on Windows** — Bun PTY may not work; requires node-pty or WSL
|
|
267
|
+
- **Large files** — Files >10MB not streamed; should chunk reads
|
|
268
|
+
- **Git performance** — Large repos may slow down graph rendering
|
|
269
|
+
- **Session persistence** — Chat history lost on server restart (not persisted)
|
|
270
|
+
|
|
271
|
+
See [Roadmap](docs/project-roadmap.md#known-issues--gaps-v2) for full list.
|
|
272
|
+
|
|
273
|
+
## Contributing
|
|
274
|
+
|
|
275
|
+
Contributions welcome! Please:
|
|
276
|
+
|
|
277
|
+
1. Fork the repository
|
|
278
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
279
|
+
3. Commit changes (`git commit -m "feat: add amazing feature"`)
|
|
280
|
+
4. Push to branch (`git push origin feature/amazing-feature`)
|
|
281
|
+
5. Open a Pull Request
|
|
282
|
+
|
|
283
|
+
**See [`docs/code-standards.md`](docs/code-standards.md) for contribution guidelines.**
|
|
284
|
+
|
|
285
|
+
## Roadmap
|
|
286
|
+
|
|
287
|
+
### v2.0 (In Progress)
|
|
288
|
+
- [x] Multi-project support
|
|
289
|
+
- [x] Project-scoped APIs
|
|
290
|
+
- [x] File attachments in chat
|
|
291
|
+
- [ ] Complete test coverage (60% done)
|
|
292
|
+
|
|
293
|
+
### v3.0 (Planned Q2 2026)
|
|
294
|
+
- [ ] Collaborative editing (multi-user)
|
|
295
|
+
- [ ] Custom tool registry
|
|
296
|
+
- [ ] Plugin architecture
|
|
297
|
+
- [ ] Windows support
|
|
298
|
+
|
|
299
|
+
**See [Project Roadmap](docs/project-roadmap.md) for detailed timeline.**
|
|
300
|
+
|
|
301
|
+
## Troubleshooting
|
|
302
|
+
|
|
303
|
+
### Port Already in Use
|
|
304
|
+
```bash
|
|
305
|
+
# Use different port
|
|
306
|
+
ppm start --port 3000
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Git Commands Failing
|
|
310
|
+
```bash
|
|
311
|
+
# Verify git is installed
|
|
312
|
+
git --version
|
|
313
|
+
|
|
314
|
+
# Verify project is git repository
|
|
315
|
+
cd /path/to/project && git status
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Claude Not Responding
|
|
319
|
+
```bash
|
|
320
|
+
# Check API key
|
|
321
|
+
echo $ANTHROPIC_API_KEY
|
|
322
|
+
|
|
323
|
+
# Try fallback provider
|
|
324
|
+
ppm config set providers.default claude-code-cli
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
**See [`docs/deployment-guide.md`](docs/deployment-guide.md#troubleshooting) for full troubleshooting.**
|
|
328
|
+
|
|
329
|
+
## License
|
|
330
|
+
|
|
331
|
+
MIT License — See LICENSE file for details.
|
|
332
|
+
|
|
333
|
+
## Acknowledgments
|
|
334
|
+
|
|
335
|
+
Built with:
|
|
336
|
+
- [Bun](https://bun.sh) — Fast JavaScript runtime
|
|
337
|
+
- [Hono](https://hono.dev) — Lightweight web framework
|
|
338
|
+
- [React](https://react.dev) — UI library
|
|
339
|
+
- [CodeMirror](https://codemirror.net) — Code editor
|
|
340
|
+
- [xterm.js](https://xtermjs.org) — Terminal emulator
|
|
341
|
+
- [Anthropic Claude](https://anthropic.com) — AI model
|
|
342
|
+
- [Tailwind CSS](https://tailwindcss.com) — Utility CSS
|
|
343
|
+
- [Radix UI](https://www.radix-ui.com) — Accessible components
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
**Questions?** Open an issue on [GitHub](https://github.com/hienlh/ppm/issues).
|
|
348
|
+
|
|
349
|
+
**Want to contribute?** See [Code Standards](docs/code-standards.md#contributing) for guidelines.
|