@hienlh/ppm 0.12.11 → 0.13.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +18 -0
  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/bun.lock +2062 -0
  8. package/bunfig.toml +2 -0
  9. package/dist/web/assets/{audio-preview-DnQmf9fu.js → audio-preview-J5neETTY.js} +1 -1
  10. package/dist/web/assets/chat-tab-sVHRa1Fz.js +12 -0
  11. package/dist/web/assets/{code-editor-B-lU1fz3.js → code-editor-tMfcFaQ5.js} +2 -2
  12. package/dist/web/assets/{conflict-editor-BYzf3LuW.js → conflict-editor-FydCxWTC.js} +1 -1
  13. package/dist/web/assets/{database-viewer-DjvnIn8p.js → database-viewer-Celi1puH.js} +1 -1
  14. package/dist/web/assets/diff-viewer-NgDJLTk9.js +4 -0
  15. package/dist/web/assets/{extension-webview-4xMREn_x.js → extension-webview-xWAdCj3q.js} +1 -1
  16. package/dist/web/assets/{image-preview-CkS2PVdQ.js → image-preview-C6bFkdZD.js} +1 -1
  17. package/dist/web/assets/index-BMhiElt6.css +2 -0
  18. package/dist/web/assets/{index-FGlF8IWZ.js → index-DtbAoxyy.js} +2 -2
  19. package/dist/web/assets/{markdown-renderer-Bj2B05Km.js → markdown-renderer-BAnnk1pI.js} +1 -1
  20. package/dist/web/assets/{pdf-preview-CCyw5cuH.js → pdf-preview-BNuFTSOL.js} +1 -1
  21. package/dist/web/assets/{port-forwarding-tab-Cebb5Eix.js → port-forwarding-tab-BbDlGxAs.js} +1 -1
  22. package/dist/web/assets/{postgres-viewer-BrOiliEv.js → postgres-viewer-Cman1YRO.js} +1 -1
  23. package/dist/web/assets/{settings-tab-D0XjupJm.js → settings-tab-n5X_Dbu4.js} +1 -1
  24. package/dist/web/assets/{sqlite-viewer-OEVq_-Po.js → sqlite-viewer-D6JT11uu.js} +1 -1
  25. package/dist/web/assets/{terminal-tab-MjmJaQyA.js → terminal-tab-B4kMthYo.js} +1 -1
  26. package/dist/web/assets/{video-preview-B819qvlp.js → video-preview-BftQOOzF.js} +1 -1
  27. package/dist/web/index.html +2 -2
  28. package/dist/web/sw.js +1 -1
  29. package/docs/project-changelog.md +15 -1
  30. package/package.json +3 -3
  31. package/scripts/generate-ppm-skill.ts +23 -0
  32. package/scripts/lib/generate-cli-reference.ts +81 -0
  33. package/scripts/lib/generate-common-tasks.ts +14 -0
  34. package/scripts/lib/generate-http-api.ts +145 -0
  35. package/scripts/lib/generate-skill-md.ts +28 -0
  36. package/scripts/lib/write-output.ts +17 -0
  37. package/src/cli/commands/export-cmd.ts +85 -0
  38. package/src/index.ts +167 -153
  39. package/src/providers/claude-agent-sdk.ts +1 -135
  40. package/src/server/index.ts +2 -1
  41. package/src/server/routes/chat.ts +18 -0
  42. package/src/server/routes/git.ts +16 -0
  43. package/src/services/git.service.ts +34 -0
  44. package/src/services/jsonl-transcript-parser.ts +216 -0
  45. package/src/services/skill-export/backup-existing.ts +33 -0
  46. package/src/services/skill-export/copy-bundled-skill.ts +36 -0
  47. package/src/services/skill-export/generate-db-schema.ts +66 -0
  48. package/src/services/skill-export/index.ts +6 -0
  49. package/src/services/skill-export/resolve-assets-dir.ts +31 -0
  50. package/src/services/skill-export/resolve-target-dir.ts +17 -0
  51. package/src/services/supervisor.ts +2 -1
  52. package/src/web/components/chat/chat-tab.tsx +6 -1
  53. package/src/web/components/chat/message-list.tsx +101 -9
  54. package/src/web/components/chat/pre-compact-button.tsx +50 -0
  55. package/src/web/components/editor/diff-viewer.tsx +21 -5
  56. package/src/web/hooks/use-chat.ts +37 -1
  57. package/src/web/lib/flatten-expansions.ts +36 -0
  58. package/templates/skill/SKILL.md.tmpl +74 -0
  59. package/templates/skill/common-tasks.md +139 -0
  60. package/assets/skills/ppm-guide/SKILL.md +0 -61
  61. package/dist/web/assets/chat-tab-Cf6T3mGO.js +0 -12
  62. package/dist/web/assets/diff-viewer-CP2jcR5J.js +0 -4
  63. package/dist/web/assets/index-BTjuH4fn.css +0 -2
  64. package/scripts/generate-ppm-guide.ts +0 -92
@@ -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)
@@ -0,0 +1,204 @@
1
+ # PPM HTTP API
2
+
3
+ _Auto-generated. Do not edit._
4
+
5
+ _Base URL: `http://localhost:8080` (default; override via `ppm config set port <n>`)._
6
+
7
+ ## /
8
+
9
+ - `GET *`
10
+
11
+ ## /api/accounts
12
+
13
+ - `GET /api/accounts`
14
+ - `GET /api/accounts/active`
15
+ - `GET /api/accounts/settings`
16
+ - `PUT /api/accounts/settings`
17
+ - `POST /api/accounts`
18
+ - `GET /api/accounts/oauth/start`
19
+ - `GET /api/accounts/oauth/url`
20
+ - `POST /api/accounts/oauth/exchange`
21
+ - `GET /api/accounts/oauth/callback`
22
+ - `POST /api/accounts/oauth/refresh/:id`
23
+ - `POST /api/accounts/export`
24
+ - `POST /api/accounts/import`
25
+ - `GET /api/accounts/usage`
26
+ - `GET /api/accounts/:id/usage`
27
+ - `GET /api/accounts/:id/usage-history`
28
+ - `POST /api/accounts/:id/verify`
29
+ - `POST /api/accounts/test-export`
30
+ - `POST /api/accounts/test-raw-token`
31
+ - `POST /api/accounts/:id/test-token`
32
+ - `DELETE /api/accounts/:id`
33
+ - `PATCH /api/accounts/:id`
34
+
35
+ ## /api/cloud
36
+
37
+ - `GET /api/cloud/status`
38
+ - `GET /api/cloud/cloud_url`
39
+ - `POST /api/cloud/login`
40
+ - `GET /api/cloud/cloud_url`
41
+ - `POST /api/cloud/logout`
42
+ - `POST /api/cloud/link`
43
+ - `POST /api/cloud/unlink`
44
+ - `GET /api/cloud/login-url`
45
+ - `GET /api/cloud/cloud_url`
46
+
47
+ ## /api/db
48
+
49
+ - `GET /api/db/connections`
50
+ - `GET /api/db/connections/export`
51
+ - `POST /api/db/connections/import`
52
+ - `GET /api/db/connections/:id`
53
+ - `POST /api/db/connections`
54
+ - `PUT /api/db/connections/:id`
55
+ - `DELETE /api/db/connections/:id`
56
+ - `POST /api/db/test`
57
+ - `POST /api/db/connections/:id/test`
58
+ - `GET /api/db/connections/:id/tables`
59
+ - `GET /api/db/connections/:id/schema`
60
+ - `GET /api/db/connections/:id/data`
61
+ - `POST /api/db/connections/:id/query`
62
+ - `PUT /api/db/connections/:id/cell`
63
+ - `DELETE /api/db/connections/:id/row`
64
+ - `POST /api/db/connections/:id/rows/delete`
65
+ - `POST /api/db/connections/:id/row`
66
+ - `GET /api/db/connections/:id/export`
67
+ - `GET /api/db/search`
68
+
69
+ ## /api/extensions
70
+
71
+ - `GET /api/extensions`
72
+ - `GET /api/extensions/contributions`
73
+ - `GET /api/extensions/:id{.+}`
74
+ - `POST /api/extensions/install`
75
+ - `POST /api/extensions/dev-link`
76
+ - `DELETE /api/extensions/:id{.+}`
77
+ - `PATCH /api/extensions/:id{.+}`
78
+
79
+ ## /api/fs
80
+
81
+ - `GET /api/fs/browse`
82
+ - `GET /api/fs/list`
83
+ - `GET /api/fs/read`
84
+ - `GET /api/fs/raw`
85
+ - `DELETE /api/fs/rmdir`
86
+ - `POST /api/fs/mkdir`
87
+ - `PUT /api/fs/write`
88
+
89
+ ## /api/postgres
90
+
91
+ - `POST /api/postgres/test`
92
+ - `POST /api/postgres/tables`
93
+ - `POST /api/postgres/schema`
94
+ - `POST /api/postgres/data`
95
+ - `POST /api/postgres/query`
96
+ - `POST /api/postgres/cell`
97
+
98
+ ## /api/preview
99
+
100
+ - `POST /api/preview/tunnel`
101
+ - `DELETE /api/preview/tunnel/:port{[0-9]+}`
102
+ - `GET /api/preview/tunnels`
103
+
104
+ ## /api/projects
105
+
106
+ - `GET /api/projects`
107
+ - `POST /api/projects`
108
+ - `GET /api/projects/suggest-dirs`
109
+ - `PATCH /api/projects/reorder`
110
+ - `GET /api/projects/projects`
111
+ - `PATCH /api/projects/:name/color`
112
+ - `GET /api/projects/projects`
113
+ - `GET /api/projects/:name/settings`
114
+ - `GET /api/projects/projects`
115
+ - `PATCH /api/projects/:name/settings`
116
+ - `GET /api/projects/projects`
117
+ - `PATCH /api/projects/:name`
118
+ - `DELETE /api/projects/:name`
119
+
120
+ ## /api/push
121
+
122
+ - `GET /api/push/vapid-key`
123
+ - `POST /api/push/subscribe`
124
+ - `DELETE /api/push/subscribe`
125
+
126
+ ## /api/settings
127
+
128
+ - `PUT /api/settings/device-name`
129
+ - `GET /api/settings/theme`
130
+ - `GET /api/settings/theme`
131
+ - `PUT /api/settings/theme`
132
+ - `GET /api/settings/ai`
133
+ - `GET /api/settings/ai`
134
+ - `PUT /api/settings/ai`
135
+ - `GET /api/settings/ai`
136
+ - `GET /api/settings/ai/providers/:id/models`
137
+ - `GET /api/settings/keybindings`
138
+ - `PUT /api/settings/keybindings`
139
+ - `GET /api/settings/telegram`
140
+ - `GET /api/settings/telegram`
141
+ - `PUT /api/settings/telegram`
142
+ - `GET /api/settings/telegram`
143
+ - `POST /api/settings/telegram/test`
144
+ - `GET /api/settings/telegram`
145
+ - `PUT /api/settings/auth/password`
146
+ - `GET /api/settings/auth`
147
+ - `GET /api/settings/port`
148
+ - `GET /api/settings/proxy`
149
+ - `PUT /api/settings/proxy`
150
+ - `GET /api/settings/clawbot`
151
+ - `GET /api/settings/clawbot`
152
+ - `PUT /api/settings/clawbot`
153
+ - `GET /api/settings/clawbot`
154
+ - `GET /api/settings/clawbot/paired`
155
+ - `POST /api/settings/clawbot/paired/approve`
156
+ - `DELETE /api/settings/clawbot/paired/:chatId`
157
+ - `GET /api/settings/clawbot/memories`
158
+ - `DELETE /api/settings/clawbot/memories/:id`
159
+ - `GET /api/settings/files`
160
+ - `PATCH /api/settings/files`
161
+ - `GET /api/settings/clawbot/tasks`
162
+
163
+ ## /api/settings/mcp
164
+
165
+ - `GET /api/settings/mcp`
166
+ - `GET /api/settings/mcp/import/preview`
167
+ - `POST /api/settings/mcp/import`
168
+ - `GET /api/settings/mcp/:name`
169
+ - `POST /api/settings/mcp`
170
+ - `PUT /api/settings/mcp/:name`
171
+ - `DELETE /api/settings/mcp/:name`
172
+
173
+ ## /api/teams
174
+
175
+ - `GET /api/teams`
176
+ - `GET /api/teams/:name`
177
+ - `DELETE /api/teams/:name`
178
+
179
+ ## /api/tunnel
180
+
181
+ - `GET /api/tunnel`
182
+ - `GET /api/tunnel/port`
183
+ - `POST /api/tunnel/start`
184
+ - `GET /api/tunnel/port`
185
+ - `POST /api/tunnel/stop`
186
+
187
+ ## /api/upgrade
188
+
189
+ - `GET /api/upgrade`
190
+ - `POST /api/upgrade/apply`
191
+
192
+ ## /proxy
193
+
194
+ - `POST /proxy/v1/messages`
195
+ - `POST /proxy/v1/chat/completions`
196
+ - `POST /proxy/v1/messages/count_tokens`
197
+
198
+ ## WebSocket
199
+
200
+ - `ws://<host>/ws/chat` — AI chat stream (Claude Agent SDK)
201
+ - `ws://<host>/ws/terminal` — PTY terminal multiplexer
202
+ - `ws://<host>/ws/extensions` — extension host channel
203
+
204
+ <!-- Generated from src/server/routes/ for PPM v0.13.0 -->