@hienlh/ppm 0.12.12 → 0.13.2

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.
Files changed (119) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/README.md +11 -0
  3. package/assets/skills/ppm/SKILL.md +74 -0
  4. package/assets/skills/ppm/references/cli-reference.md +728 -0
  5. package/assets/skills/ppm/references/common-tasks.md +139 -0
  6. package/assets/skills/ppm/references/http-api.md +204 -0
  7. package/dist/web/assets/ai-settings-section-QE6nBNgN.js +1 -0
  8. package/dist/web/assets/{api-settings-C3T95dWg.js → api-settings-DAk7D-NP.js} +1 -1
  9. package/dist/web/assets/architecture-PBZL5I3N-DvZbltvY.js +1 -0
  10. package/dist/web/assets/{audio-preview-BkbgGtDH.js → audio-preview--hRMnXRZ.js} +1 -1
  11. package/dist/web/assets/chat-tab-4kL3DNxf.js +12 -0
  12. package/dist/web/assets/{code-editor-BtspASkW.js → code-editor-Caq5_BaF.js} +4 -4
  13. package/dist/web/assets/{conflict-editor-Dgsu6fmj.js → conflict-editor-Dlo25nmt.js} +1 -1
  14. package/dist/web/assets/{csv-preview-DcWCjQkZ.js → csv-preview-HMSavgBb.js} +1 -1
  15. package/dist/web/assets/{database-viewer-C85RxdMV.js → database-viewer-DcBl6OkV.js} +2 -2
  16. package/dist/web/assets/{diff-viewer-2pPy97Tl.js → diff-viewer-CCzPq1o-.js} +1 -1
  17. package/dist/web/assets/{esm-_CLpyLJ_.js → esm-K1XIK4vc.js} +1 -1
  18. package/dist/web/assets/{extension-store-BZDZ9QRc.js → extension-store-3yZYn07W.js} +1 -1
  19. package/dist/web/assets/{extension-webview-U1lMYZ0p.js → extension-webview-D7bGVSEd.js} +1 -1
  20. package/dist/web/assets/{file-store-4BpOJthN.js → file-store-BrbCNyLm.js} +1 -1
  21. package/dist/web/assets/gitGraph-HDMCJU4V-BxhdxFgj.js +1 -0
  22. package/dist/web/assets/{image-preview-BcT1SbY2.js → image-preview-CfkqnhXJ.js} +1 -1
  23. package/dist/web/assets/index-BGFG66Gh.js +27 -0
  24. package/dist/web/assets/index-Bce0weeW.css +2 -0
  25. package/dist/web/assets/info-3K5VOQVL-BwAZ2zd8.js +1 -0
  26. package/dist/web/assets/{input-2eDVjcRZ.js → input-Dk49gO8E.js} +1 -1
  27. package/dist/web/assets/{keybindings-store-BOG1yviy.js → keybindings-store-B-zET-0o.js} +1 -1
  28. package/dist/web/assets/keybindings-store-DaBV6qhz.js +1 -0
  29. package/dist/web/assets/{markdown-renderer-Dbam_-04.js → markdown-renderer-DyAm7zuA.js} +3 -3
  30. package/dist/web/assets/packet-RMMSAZCW-tx2n5Qry.js +1 -0
  31. package/dist/web/assets/{pdf-preview-BmHVGx32.js → pdf-preview-CZPcuy5c.js} +1 -1
  32. package/dist/web/assets/pie-UPGHQEXC-D6S2MqVT.js +1 -0
  33. package/dist/web/assets/plus-51UQ45rf.js +1 -0
  34. package/dist/web/assets/{port-forwarding-tab-Dkq1upWC.js → port-forwarding-tab-3RNozlZ5.js} +1 -1
  35. package/dist/web/assets/{postgres-viewer-BgBJAJ9q.js → postgres-viewer-CXJv4TXc.js} +3 -3
  36. package/dist/web/assets/radar-KQ55EAFF-BviZcL-b.js +1 -0
  37. package/dist/web/assets/{scroll-area-CdxNNnN-.js → scroll-area-BEllam7_.js} +1 -1
  38. package/dist/web/assets/{settings-store-CMAssqyb.js → settings-store-BLLR7ed8.js} +2 -2
  39. package/dist/web/assets/settings-tab-Cnav4g2u.js +1 -0
  40. package/dist/web/assets/{sql-query-editor-b7zJ8XPp.js → sql-query-editor-CVAnRFbi.js} +1 -1
  41. package/dist/web/assets/{sqlite-viewer-4lLAz1es.js → sqlite-viewer-C8WUEFhA.js} +1 -1
  42. package/dist/web/assets/{tab-store-DNBsLdPn.js → tab-store-B3M9hjho.js} +1 -1
  43. package/dist/web/assets/{terminal-tab-BtnqkN1H.js → terminal-tab-CaEsMxp8.js} +1 -1
  44. package/dist/web/assets/treemap-KZPCXAKY-CM54VdaB.js +1 -0
  45. package/dist/web/assets/{use-blob-url-QX-XajU8.js → use-blob-url-e9uTXjv5.js} +1 -1
  46. package/dist/web/assets/{use-monaco-theme-D68oX3XU.js → use-monaco-theme-BkZDwoVd.js} +1 -1
  47. package/dist/web/assets/{vendor-mermaid-sQS4C_iL.js → vendor-mermaid-Dx86tuVP.js} +2 -2
  48. package/dist/web/assets/{video-preview-CkOKvVLt.js → video-preview-Dfz71RGb.js} +1 -1
  49. package/dist/web/index.html +18 -18
  50. package/dist/web/sw.js +1 -1
  51. package/docs/project-changelog.md +15 -1
  52. package/package.json +3 -3
  53. package/scripts/generate-ppm-skill.ts +23 -0
  54. package/scripts/lib/generate-cli-reference.ts +81 -0
  55. package/scripts/lib/generate-common-tasks.ts +14 -0
  56. package/scripts/lib/generate-http-api.ts +145 -0
  57. package/scripts/lib/generate-skill-md.ts +28 -0
  58. package/scripts/lib/write-output.ts +17 -0
  59. package/src/cli/commands/export-cmd.ts +85 -0
  60. package/src/index.ts +167 -153
  61. package/src/server/index.ts +12 -4
  62. package/src/services/autostart-generator.ts +3 -1
  63. package/src/services/autostart-register.ts +17 -0
  64. package/src/services/sd-notify.ts +27 -0
  65. package/src/services/skill-export/backup-existing.ts +33 -0
  66. package/src/services/skill-export/copy-bundled-skill.ts +36 -0
  67. package/src/services/skill-export/generate-db-schema.ts +66 -0
  68. package/src/services/skill-export/index.ts +6 -0
  69. package/src/services/skill-export/resolve-assets-dir.ts +31 -0
  70. package/src/services/skill-export/resolve-target-dir.ts +17 -0
  71. package/src/services/supervisor.ts +31 -5
  72. package/src/web/components/chat/chat-history-bar.tsx +2 -9
  73. package/src/web/components/chat/chat-history-panel.tsx +2 -9
  74. package/src/web/components/chat/chat-tab.tsx +6 -1
  75. package/src/web/components/chat/chat-welcome.tsx +1 -18
  76. package/src/web/components/chat/message-list.tsx +96 -43
  77. package/src/web/components/layout/draggable-tab.tsx +12 -5
  78. package/src/web/hooks/use-chat.ts +37 -1
  79. package/src/web/hooks/use-notification-badge.ts +7 -7
  80. package/src/web/lib/favicon.ts +37 -15
  81. package/src/web/lib/flatten-expansions.ts +36 -0
  82. package/src/web/lib/format-date.ts +21 -0
  83. package/src/web/styles/globals.css +12 -0
  84. package/templates/skill/SKILL.md.tmpl +74 -0
  85. package/templates/skill/common-tasks.md +139 -0
  86. package/assets/skills/ppm-guide/SKILL.md +0 -61
  87. package/bun.lock +0 -2062
  88. package/bunfig.toml +0 -2
  89. package/dist/web/assets/ai-settings-section-NNWp6nw7.js +0 -1
  90. package/dist/web/assets/architecture-PBZL5I3N-DDuzYaUV.js +0 -1
  91. package/dist/web/assets/chat-tab-BZlP1qjX.js +0 -12
  92. package/dist/web/assets/chevron-up-BWBvMZkp.js +0 -1
  93. package/dist/web/assets/gitGraph-HDMCJU4V-BURAevTc.js +0 -1
  94. package/dist/web/assets/index-BWSRKVZn.js +0 -23
  95. package/dist/web/assets/index-b6tIZImC.css +0 -2
  96. package/dist/web/assets/info-3K5VOQVL-tSD4Fpi3.js +0 -1
  97. package/dist/web/assets/keybindings-store-BvdUoEC7.js +0 -1
  98. package/dist/web/assets/packet-RMMSAZCW-DmDLZUrV.js +0 -1
  99. package/dist/web/assets/pie-UPGHQEXC-w03Pc9ZR.js +0 -1
  100. package/dist/web/assets/pre-compact-button-Dp7Hs49L.js +0 -1
  101. package/dist/web/assets/pre-compact-section-DnM5fGSR.js +0 -1
  102. package/dist/web/assets/radar-KQ55EAFF-C9XQvoey.js +0 -1
  103. package/dist/web/assets/settings-tab-zYWKTq5z.js +0 -1
  104. package/dist/web/assets/treemap-KZPCXAKY-lmftxSky.js +0 -1
  105. package/scripts/generate-ppm-guide.ts +0 -92
  106. package/src/web/components/chat/pre-compact-section.tsx +0 -69
  107. /package/dist/web/assets/{api-client-DIhJ5qVW.js → api-client-Dvzcc_EO.js} +0 -0
  108. /package/dist/web/assets/{csv-parser-B5QW8pZ6.js → csv-parser--2WJNgS7.js} +0 -0
  109. /package/dist/web/assets/{dist-GtkSekuX.js → dist-im4ynINo.js} +0 -0
  110. /package/dist/web/assets/{katex-C3cZrCvP.js → katex-CKoArbIw.js} +0 -0
  111. /package/dist/web/assets/{lib-Bu71-TFS.js → lib-DQHnkzGy.js} +0 -0
  112. /package/dist/web/assets/{react-DMIOAtcX.js → react-GqWghJ-L.js} +0 -0
  113. /package/dist/web/assets/{refresh-cw-BjrAbUJe.js → refresh-cw-LlbZDJpO.js} +0 -0
  114. /package/dist/web/assets/{sql-completion-provider-CULTsCqR.js → sql-completion-provider-C3cq9j99.js} +0 -0
  115. /package/dist/web/assets/{table-tf7pRkME.js → table-Dq575bPF.js} +0 -0
  116. /package/dist/web/assets/{text-wrap-BV-R4Vvy.js → text-wrap-Cn6BNQfq.js} +0 -0
  117. /package/dist/web/assets/{trash-2-DjQOpgUV.js → trash-2-CJYoLw7Q.js} +0 -0
  118. /package/dist/web/assets/{utils-CQux7CsO.js → utils-CTg5uAYR.js} +0 -0
  119. /package/dist/web/assets/{vendor-xterm-K3_Xwigj.js → vendor-xterm-CU2c3f0A.js} +0 -0
@@ -0,0 +1,36 @@
1
+ import type { ChatMessage } from "../../types/chat";
2
+
3
+ /** Simple deterministic hash of a jsonlPath → short prefix (non-cryptographic). */
4
+ function hashPath(path: string): string {
5
+ let h = 0;
6
+ for (let i = 0; i < path.length; i++) h = ((h << 5) - h + path.charCodeAt(i)) | 0;
7
+ return Math.abs(h).toString(36);
8
+ }
9
+
10
+ /**
11
+ * Prefix pre-compact message IDs so they don't collide with current-session IDs.
12
+ * React keys rely on `id`; collisions cause render corruption.
13
+ */
14
+ export function prefixPreCompactIds(msgs: ChatMessage[], jsonlPath: string): ChatMessage[] {
15
+ const prefix = `pc-${hashPath(jsonlPath)}-`;
16
+ return msgs.map((m) => (m.id ? { ...m, id: `${prefix}${m.id}` } : m));
17
+ }
18
+
19
+ /**
20
+ * Flatten messages with expansions prepended before their corresponding compact message.
21
+ * Key of `expansions` = compact message id. Values = already-prefixed ChatMessage[].
22
+ * Preserves reference equality when expansions is empty (zero-cost for non-compact chats).
23
+ */
24
+ export function flattenWithExpansions(
25
+ messages: ChatMessage[],
26
+ expansions: Map<string, ChatMessage[]>,
27
+ ): ChatMessage[] {
28
+ if (expansions.size === 0) return messages;
29
+ const out: ChatMessage[] = [];
30
+ for (const m of messages) {
31
+ const pre = m.id ? expansions.get(m.id) : undefined;
32
+ if (pre && pre.length > 0) out.push(...pre);
33
+ out.push(m);
34
+ }
35
+ return out;
36
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Format an ISO timestamp as a short English relative time string.
3
+ * Examples: "just now", "5m ago", "3h ago", "2d ago", "Apr 21".
4
+ */
5
+ export function formatRelativeDate(iso: string): string {
6
+ try {
7
+ const date = new Date(iso);
8
+ const now = new Date();
9
+ const diffMs = now.getTime() - date.getTime();
10
+ const diffMin = Math.floor(diffMs / 60_000);
11
+ if (diffMin < 1) return "just now";
12
+ if (diffMin < 60) return `${diffMin}m ago`;
13
+ const diffHr = Math.floor(diffMin / 60);
14
+ if (diffHr < 24) return `${diffHr}h ago`;
15
+ const diffDay = Math.floor(diffHr / 24);
16
+ if (diffDay < 7) return `${diffDay}d ago`;
17
+ return date.toLocaleDateString(undefined, { month: "short", day: "numeric" });
18
+ } catch {
19
+ return "";
20
+ }
21
+ }
@@ -294,3 +294,15 @@ html, body {
294
294
  @media (prefers-reduced-motion: reduce) {
295
295
  .markdown-content.is-streaming > *:last-child { animation: none; }
296
296
  }
297
+
298
+ /* Tab streaming indicator — 3 dots bouncing inside chat bubble icon (Messenger typing style) */
299
+ @keyframes tabTypingBounce {
300
+ 0%, 60%, 100% { transform: translateY(0); }
301
+ 30% { transform: translateY(-1.5px); }
302
+ }
303
+ .tab-typing-dot {
304
+ animation: tabTypingBounce 1s ease-in-out infinite;
305
+ }
306
+ @media (prefers-reduced-motion: reduce) {
307
+ .tab-typing-dot { animation: none; }
308
+ }
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: ppm
3
+ description: Control PPM (Project & Process Manager) via its CLI, HTTP API, and SQLite config database. Use when the user wants to manage PPM projects, query database connections, start/stop the PPM server, view logs, or read/write PPM config.
4
+ ---
5
+
6
+ # PPM Skill
7
+
8
+ PPM is a local-first web IDE + project manager. This skill describes how to control PPM from the terminal, over HTTP, and by inspecting its SQLite config database.
9
+
10
+ ## Quick Reference
11
+
12
+ | What | Where |
13
+ |---|---|
14
+ | CLI binary | `ppm` |
15
+ | Default server | `http://localhost:8080` |
16
+ | Config DB (prod) | `~/.ppm/ppm.db` (SQLite) |
17
+ | Config DB (dev) | `~/.ppm/ppm.dev.db` (port 8081) |
18
+ | Skill root (user) | `~/.claude/skills/` |
19
+ | Skill root (project) | `<project>/.claude/skills/` |
20
+
21
+ ## When to Use This Skill
22
+
23
+ Invoke when the user asks to:
24
+ - Start, stop, restart, or check the PPM server
25
+ - Manage registered projects (`projects list/add/remove`)
26
+ - Manage database connections stored in PPM config (`db list/add/test/query`)
27
+ - Get or set PPM config values (`config get/set`)
28
+ - View PPM logs, status, or report a bug
29
+ - Install, upgrade, or inspect bundled skills / extensions
30
+ - Control the PPM daemon autostart registration
31
+
32
+ ## Top Tasks
33
+
34
+ 1. **Check if PPM is running** → `ppm status`
35
+ 2. **Start server** → `ppm start` (use `--port <n>` to override, `--profile dev` for dev DB)
36
+ 3. **List projects** → `ppm projects list`
37
+ 4. **Add project** → `ppm projects add <path>`
38
+ 5. **List DB connections** → `ppm db list`
39
+ 6. **Query a saved DB connection** → `ppm db query <connection-name> "<sql>"`
40
+ 7. **Read config** → `ppm config get <key>` (e.g. `port`, `auth.enabled`)
41
+ 8. **Tail logs** → `ppm logs --tail 100` or `ppm logs -f` to follow
42
+ 9. **Upgrade PPM** → `ppm upgrade` (or `--check` to only check)
43
+ 10. **Open in browser** → `ppm open`
44
+
45
+ ## Rules of Thumb
46
+
47
+ - Always run `ppm status` before assuming the server is up.
48
+ - Commands exit non-zero on failure and print to stderr. Capture both streams.
49
+ - Listing commands accept `--json` for structured output; prefer JSON when parsing.
50
+ - The config DB is **SQLite**. You may open `~/.ppm/ppm.db` read-only for inspection — see [references/db-schema.md](references/db-schema.md).
51
+ - Do NOT edit the config DB directly while the server is running; use `ppm config set` or the HTTP API.
52
+
53
+ ## Links
54
+
55
+ - Complete CLI options, every subcommand → [references/cli-reference.md](references/cli-reference.md)
56
+ - HTTP API routes (25+) → [references/http-api.md](references/http-api.md)
57
+ - Config DB schema (runtime-generated from user's DB) → [references/db-schema.md](references/db-schema.md)
58
+ - Worked recipes for common tasks → [references/common-tasks.md](references/common-tasks.md)
59
+
60
+ ## Error Handling
61
+
62
+ - Server not running → `ppm status` exits non-zero; start with `ppm start`.
63
+ - Port conflict → `ppm config set port <n>` then `ppm restart`.
64
+ - Missing config DB → `ppm init` creates defaults.
65
+ - Upgrade failure → re-run `ppm upgrade` or `npm i -g @hienlh/ppm@latest`.
66
+
67
+ ## Scope Boundaries
68
+
69
+ This skill covers the `ppm` CLI, its HTTP API, and its config DB. It does **not** cover:
70
+ - Projects managed by PPM (those are user code, outside skill scope).
71
+ - Third-party extensions (inspect via `ppm ext list`).
72
+ - The Claude Agent SDK internals (separate skill).
73
+
74
+ <!-- AUTO:version_footer -->
@@ -0,0 +1,139 @@
1
+ # PPM Common Tasks
2
+
3
+ Practical recipes for controlling PPM. Prefer these stable shell invocations over HTTP unless the user has specifically asked for HTTP.
4
+
5
+ ## Task 1: Confirm PPM is running
6
+
7
+ ```bash
8
+ ppm status --json
9
+ ```
10
+
11
+ Non-zero exit = server not running. Use `ppm status` (no flag) for a human-readable view.
12
+
13
+ ## Task 2: Start the server
14
+
15
+ ```bash
16
+ # Default port (from config, usually 8080)
17
+ ppm start
18
+
19
+ # Override port
20
+ ppm start --port 9090
21
+
22
+ # Use dev DB profile (port 8081, ~/.ppm/ppm.dev.db)
23
+ ppm start --profile dev
24
+ ```
25
+
26
+ ## Task 3: Register a project
27
+
28
+ ```bash
29
+ # Add the current directory
30
+ ppm projects add "$PWD"
31
+
32
+ # List registered projects as JSON
33
+ ppm projects list --json
34
+ ```
35
+
36
+ ## Task 4: Add and test a database connection
37
+
38
+ ```bash
39
+ # Interactive add
40
+ ppm db add
41
+
42
+ # Non-interactive (check `ppm db add --help` for full flag list)
43
+ ppm db add --name staging --type postgres --host db.example.com --port 5432 --user app --database myapp
44
+
45
+ # Test the connection
46
+ ppm db test staging
47
+ ```
48
+
49
+ ## Task 5: Query a saved DB connection
50
+
51
+ ```bash
52
+ # Run a SQL query against a registered connection
53
+ ppm db query staging "SELECT count(*) AS total FROM users"
54
+
55
+ # Output as JSON for scripting
56
+ ppm db query staging "SELECT id, email FROM users LIMIT 10" --json
57
+ ```
58
+
59
+ ## Task 6: Read or change config
60
+
61
+ ```bash
62
+ # Read a value
63
+ ppm config get port
64
+ ppm config get auth.enabled
65
+
66
+ # Set a value (takes effect on next restart)
67
+ ppm config set port 9090
68
+ ppm config set auth.enabled true
69
+
70
+ # List all keys
71
+ ppm config list
72
+ ```
73
+
74
+ ## Task 7: Tail the daemon log
75
+
76
+ ```bash
77
+ # Last 100 lines
78
+ ppm logs --tail 100
79
+
80
+ # Follow live
81
+ ppm logs -f
82
+
83
+ # Clear the log
84
+ ppm logs --clear
85
+ ```
86
+
87
+ ## Task 8: Upgrade PPM
88
+
89
+ ```bash
90
+ # Check for a new version without installing
91
+ ppm upgrade --check
92
+
93
+ # Install the latest
94
+ ppm upgrade
95
+ ```
96
+
97
+ ## Task 9: Manage auto-start on boot
98
+
99
+ ```bash
100
+ ppm autostart enable # register
101
+ ppm autostart status --json # inspect
102
+ ppm autostart disable # unregister
103
+ ```
104
+
105
+ ## Task 10: Inspect installed skills
106
+
107
+ ```bash
108
+ ppm skills list
109
+ ppm skills list --json
110
+ ```
111
+
112
+ ## HTTP API Quick Calls
113
+
114
+ Assume `PPM_BASE=http://localhost:8080`. See [http-api.md](http-api.md) for full list.
115
+
116
+ ```bash
117
+ # List projects over HTTP
118
+ curl -s $PPM_BASE/api/projects | jq
119
+
120
+ # List DB connections
121
+ curl -s $PPM_BASE/api/db/connections | jq
122
+
123
+ # Get server status (via CLI is easier; HTTP equivalent varies)
124
+ ```
125
+
126
+ ## Troubleshooting
127
+
128
+ | Symptom | Check |
129
+ |---|---|
130
+ | `ppm: command not found` | Ensure `npm i -g @hienlh/ppm` ran; check `$PATH` includes npm bin. |
131
+ | Server won't start | `ppm logs --tail 50`; check port conflict with `lsof -i :8080`. |
132
+ | Stale tunnel URL | `ppm restart --force`. |
133
+ | Auth prompts unexpected | `ppm config get auth.enabled`; toggle with `ppm config set auth.enabled false`. |
134
+
135
+ ## Exit Code Convention
136
+
137
+ - `0` — success
138
+ - `1` — generic error (IO, validation, server not running)
139
+ - `2` — asset/setup missing (e.g. bundled skill assets)
@@ -1,61 +0,0 @@
1
- ---
2
- name: ppm-guide
3
- description: PPM project structure, commands, config, and development workflow reference
4
- argument-hint: "[topic]"
5
- ---
6
-
7
- # PPM Guide
8
-
9
- ## Overview
10
- # PPM Project Overview & Product Development Requirements
11
- ## Project Description
12
- **PPM** (Personal Project Manager) is a full-stack, mobile-first web IDE designed for developers to manage code projects with AI-powered assistance. It combines a responsive web interface, real-time terminal access, AI chat with tool support, and Git integration into a cohesive development environment.
13
- Built on the **Bun runtime** for performance, PPM enables developers to:
14
- - Browse and edit project files with Monaco Editor syntax highlighting
15
- - Execute commands via xterm.js terminal with full PTY support
16
- - Chat with Claude AI with file attachments and slash commands
17
- - View Git status, diffs, and commit graphs in real-time
18
-
19
- ## CLI Commands
20
- ```bash
21
- bun dev:server # Start backend dev (port 8081, uses ~/.ppm/ppm.dev.db)
22
- bun dev:web # Start Vite frontend (port 5173)
23
- bun test # Run all tests
24
- bun test tests/integration/ # Integration tests only
25
- ```
26
-
27
- ## Dev Config
28
- Config is stored in **SQLite** (`~/.ppm/ppm.db`). Dev uses a separate DB:
29
-
30
- - **Dev**: `~/.ppm/ppm.dev.db` — port **8081**
31
- - **Production**: `~/.ppm/ppm.db` — port **8080**
32
-
33
- `bun dev:server` automatically uses the dev database. On a new machine, run `ppm init` to create default config, then `ppm config set port 8081` for dev.
34
-
35
- ## Architecture
36
- - `src/providers/claude-agent-sdk.ts` — SDK integration, tool execution, streaming
37
- - `src/server/ws/chat.ts` — WebSocket chat handler
38
- - `src/web/hooks/use-chat.ts` — Frontend chat state management
39
- - `src/services/config.service.ts` — Config from SQLite (`~/.ppm/ppm.db`)
40
-
41
- ## Code Standards
42
- # PPM Code Standards & Conventions
43
- ## File Naming
44
- | File Type | Convention | Example | Purpose |
45
- |-----------|-----------|---------|---------|
46
- | CLI commands | kebab-case | `start-cmd.ts`, `init.ts` | Descriptive command names |
47
- | Services | kebab-case | `chat.service.ts`, `file.service.ts` | `{feature}.service.ts` pattern |
48
- | Providers | kebab-case | `claude-agent-sdk.ts`, `mock-provider.ts` | `{name}-provider.ts` or `{name}.ts` |
49
- | Routes | kebab-case | `chat.ts`, `project-scoped.ts` | Describe HTTP route group |
50
- | WebSocket | kebab-case | `chat.ts`, `terminal.ts` | Match feature area |
51
- | Components | PascalCase | `ChatTab.tsx`, `FileTree.tsx` | React convention |
52
-
53
- ## Slash Commands
54
- Use `/skills` to list all available skills and commands.
55
- Use `/help` for session help, `/status` for context usage, `/compact` to reduce context.
56
-
57
- ## Dev Workflow
58
- 1. `bun dev:server` — Start backend (port 8081, dev DB)
59
- 2. `bun dev:web` — Start Vite frontend (port 5173)
60
- 3. `bun test` — Run all tests
61
- 4. `bun run typecheck` — TypeScript type checking