@hienlh/ppm 0.13.53 → 0.13.54

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 (34) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/assets/skills/ppm/SKILL.md +2 -2
  3. package/assets/skills/ppm/references/cli-reference.md +11 -0
  4. package/assets/skills/ppm/references/http-api.md +1 -1
  5. package/dist/web/assets/{audio-preview-DzlMrjXC.js → audio-preview-BF1LU0eY.js} +1 -1
  6. package/dist/web/assets/{chat-tab-BpP-9jSF.js → chat-tab-CCOkAmh8.js} +3 -3
  7. package/dist/web/assets/{code-editor-DUrnjDXe.js → code-editor-BptkAFVa.js} +2 -2
  8. package/dist/web/assets/{conflict-editor-DsL9J6Ao.js → conflict-editor-DcVj0Z-q.js} +1 -1
  9. package/dist/web/assets/{database-viewer-BzZ_B08X.js → database-viewer-CYrsNjRy.js} +1 -1
  10. package/dist/web/assets/{diff-viewer-BTtOJWuk.js → diff-viewer-DMBviO6l.js} +1 -1
  11. package/dist/web/assets/{extension-webview-SqqLBksj.js → extension-webview-DCmfZH6p.js} +1 -1
  12. package/dist/web/assets/{glide-data-grid-YCbGSPc8.js → glide-data-grid-DhZjCUqu.js} +1 -1
  13. package/dist/web/assets/{image-preview-CVERB6Hn.js → image-preview-BIJGvZ5-.js} +1 -1
  14. package/dist/web/assets/{index-D3gMHLKc.js → index-BA8zQtSN.js} +3 -3
  15. package/dist/web/assets/keybindings-store-BXumit4n.js +1 -0
  16. package/dist/web/assets/{markdown-renderer-F5aFyJ-g.js → markdown-renderer-CwKRCQuc.js} +1 -1
  17. package/dist/web/assets/notification-store-B3Fgo6Qw.js +1 -0
  18. package/dist/web/assets/{pdf-preview-RgwYR2Lj.js → pdf-preview-CbUTv4dX.js} +1 -1
  19. package/dist/web/assets/{port-forwarding-tab-CRBTvvYM.js → port-forwarding-tab-Nn3-C-Vu.js} +1 -1
  20. package/dist/web/assets/{postgres-viewer-Dq2nI9jE.js → postgres-viewer-C-A4MMtt.js} +1 -1
  21. package/dist/web/assets/{settings-tab-BrtuPA9W.js → settings-tab-Bzlcvim9.js} +1 -1
  22. package/dist/web/assets/{sql-query-editor-CL6O_4eW.js → sql-query-editor-Cu9mYyfb.js} +1 -1
  23. package/dist/web/assets/{sqlite-viewer-CcJz9Bva.js → sqlite-viewer-D6ngJJgP.js} +1 -1
  24. package/dist/web/assets/{terminal-tab-BlyuDIu5.js → terminal-tab-CyuBxW2x.js} +1 -1
  25. package/dist/web/assets/{video-preview-C8s0VXIf.js → video-preview-ChP5ypMo.js} +1 -1
  26. package/dist/web/index.html +1 -1
  27. package/dist/web/sw.js +1 -1
  28. package/package.json +1 -1
  29. package/src/cli/commands/db-cmd.ts +30 -4
  30. package/src/services/ppmbot/cli-reference-default.ts +6 -1
  31. package/src/web/components/editor/editor-breadcrumb.tsx +8 -1
  32. package/templates/skill/SKILL.md.tmpl +1 -1
  33. package/dist/web/assets/keybindings-store-BY4JJMPB.js +0 -1
  34. package/dist/web/assets/notification-store-CmFhp1D7.js +0 -1
@@ -67,14 +67,26 @@ export function registerDbCommands(program: Command): void {
67
67
  // ── ppm db list ──────────────────────────────────────────────────────
68
68
  db.command("list")
69
69
  .description("List all saved database connections")
70
- .action(async () => {
70
+ .option("--json", "Output as JSON")
71
+ .action(async (options: { json?: boolean }) => {
71
72
  try {
72
73
  const { getConnections } = await import("../../services/db.service.ts");
73
74
  const conns = getConnections();
74
75
  if (conns.length === 0) {
76
+ if (options.json) { console.log("[]"); return; }
75
77
  console.log(`${C.yellow}No connections saved.${C.reset} Run: ppm db add`);
76
78
  return;
77
79
  }
80
+ if (options.json) {
81
+ const data = conns.map((c) => {
82
+ const cfg = parseConfig(c);
83
+ let target = cfg.connectionString ?? cfg.path ?? null;
84
+ if (cfg.connectionString) target = maskPassword(target!);
85
+ return { id: c.id, name: c.name, type: c.type, group: c.group_name ?? null, readonly: !!c.readonly, connection: target };
86
+ });
87
+ console.log(JSON.stringify(data, null, 2));
88
+ return;
89
+ }
78
90
  const rows = conns.map((c) => {
79
91
  const cfg = parseConfig(c);
80
92
  let target = cfg.connectionString ?? cfg.path ?? "-";
@@ -197,7 +209,8 @@ export function registerDbCommands(program: Command): void {
197
209
  // ── ppm db tables ────────────────────────────────────────────────────
198
210
  db.command("tables <name>")
199
211
  .description("List tables in a database connection")
200
- .action(async (nameOrId: string) => {
212
+ .option("--json", "Output as JSON")
213
+ .action(async (nameOrId: string, options: { json?: boolean }) => {
201
214
  try {
202
215
  const { resolveConnection } = await import("../../services/db.service.ts");
203
216
  const conn = resolveConnection(nameOrId);
@@ -212,9 +225,11 @@ export function registerDbCommands(program: Command): void {
212
225
  const tables = await postgresService.getTables(cfg.connectionString!);
213
226
  await postgresService.closeAll();
214
227
  if (tables.length === 0) {
228
+ if (options.json) { console.log("[]"); return; }
215
229
  console.log(`${C.dim}No tables found.${C.reset}`);
216
230
  return;
217
231
  }
232
+ if (options.json) { console.log(JSON.stringify(tables, null, 2)); return; }
218
233
  printTable(
219
234
  ["Schema", "Table", "Rows (est.)"],
220
235
  tables.map((t) => [t.schema, t.name, String(t.rowCount)]),
@@ -224,9 +239,11 @@ export function registerDbCommands(program: Command): void {
224
239
  const tables = sqliteService.getTables(cfg.path!, cfg.path!);
225
240
  sqliteService.closeAll();
226
241
  if (tables.length === 0) {
242
+ if (options.json) { console.log("[]"); return; }
227
243
  console.log(`${C.dim}No tables found.${C.reset}`);
228
244
  return;
229
245
  }
246
+ if (options.json) { console.log(JSON.stringify(tables, null, 2)); return; }
230
247
  printTable(
231
248
  ["Table", "Rows"],
232
249
  tables.map((t) => [t.name, String(t.rowCount)]),
@@ -242,7 +259,8 @@ export function registerDbCommands(program: Command): void {
242
259
  db.command("schema <name> <table>")
243
260
  .description("Show table schema (columns, types, constraints)")
244
261
  .option("-s, --schema <schema>", "PostgreSQL schema name", "public")
245
- .action(async (nameOrId: string, table: string, options: { schema: string }) => {
262
+ .option("--json", "Output as JSON")
263
+ .action(async (nameOrId: string, table: string, options: { schema: string; json?: boolean }) => {
246
264
  try {
247
265
  const { resolveConnection } = await import("../../services/db.service.ts");
248
266
  const conn = resolveConnection(nameOrId);
@@ -256,6 +274,7 @@ export function registerDbCommands(program: Command): void {
256
274
  const { postgresService } = await import("../../services/postgres.service.ts");
257
275
  const cols = await postgresService.getTableSchema(cfg.connectionString!, table, options.schema);
258
276
  await postgresService.closeAll();
277
+ if (options.json) { console.log(JSON.stringify(cols, null, 2)); return; }
259
278
  printTable(
260
279
  ["Column", "Type", "Nullable", "PK", "Default"],
261
280
  cols.map((c) => [c.name, c.type, c.nullable ? "YES" : "NO", c.pk ? "PK" : "", c.defaultValue ?? ""]),
@@ -264,6 +283,7 @@ export function registerDbCommands(program: Command): void {
264
283
  const { sqliteService } = await import("../../services/sqlite.service.ts");
265
284
  const cols = sqliteService.getTableSchema(cfg.path!, cfg.path!, table);
266
285
  sqliteService.closeAll();
286
+ if (options.json) { console.log(JSON.stringify(cols, null, 2)); return; }
267
287
  printTable(
268
288
  ["Column", "Type", "Not Null", "PK", "Default"],
269
289
  cols.map((c) => [c.name, c.type, c.notnull ? "YES" : "NO", c.pk ? "PK" : "", c.dflt_value ?? ""]),
@@ -283,6 +303,7 @@ export function registerDbCommands(program: Command): void {
283
303
  .option("--order <column>", "Order by column")
284
304
  .option("--desc", "Descending order")
285
305
  .option("-s, --schema <schema>", "PostgreSQL schema name", "public")
306
+ .option("--json", "Output as JSON")
286
307
  .action(async (nameOrId: string, table: string, options) => {
287
308
  try {
288
309
  const { resolveConnection } = await import("../../services/db.service.ts");
@@ -302,6 +323,7 @@ export function registerDbCommands(program: Command): void {
302
323
  cfg.connectionString!, table, options.schema, page, limit, options.order, orderDir,
303
324
  );
304
325
  await postgresService.closeAll();
326
+ if (options.json) { console.log(JSON.stringify(result, null, 2)); return; }
305
327
  console.log(`${C.cyan}${table}${C.reset} — page ${result.page}, ${result.total} total rows\n`);
306
328
  formatRows(result.columns, result.rows, limit);
307
329
  } else {
@@ -310,6 +332,7 @@ export function registerDbCommands(program: Command): void {
310
332
  cfg.path!, cfg.path!, table, page, limit, options.order, orderDir,
311
333
  );
312
334
  sqliteService.closeAll();
335
+ if (options.json) { console.log(JSON.stringify(result, null, 2)); return; }
313
336
  console.log(`${C.cyan}${table}${C.reset} — page ${result.page}, ${result.total} total rows\n`);
314
337
  formatRows(result.columns, result.rows, limit);
315
338
  }
@@ -322,7 +345,8 @@ export function registerDbCommands(program: Command): void {
322
345
  // ── ppm db query ─────────────────────────────────────────────────────
323
346
  db.command("query <name> <sql>")
324
347
  .description("Execute a SQL query against a saved connection")
325
- .action(async (nameOrId: string, sql: string) => {
348
+ .option("--json", "Output as JSON")
349
+ .action(async (nameOrId: string, sql: string, options: { json?: boolean }) => {
326
350
  try {
327
351
  const { resolveConnection } = await import("../../services/db.service.ts");
328
352
  const conn = resolveConnection(nameOrId);
@@ -343,6 +367,7 @@ export function registerDbCommands(program: Command): void {
343
367
  const { postgresService } = await import("../../services/postgres.service.ts");
344
368
  const result = await postgresService.executeQuery(cfg.connectionString!, sql);
345
369
  await postgresService.closeAll();
370
+ if (options.json) { console.log(JSON.stringify(result, null, 2)); return; }
346
371
  if (result.changeType === "select") {
347
372
  formatRows(result.columns, result.rows);
348
373
  } else {
@@ -352,6 +377,7 @@ export function registerDbCommands(program: Command): void {
352
377
  const { sqliteService } = await import("../../services/sqlite.service.ts");
353
378
  const result = sqliteService.executeQuery(cfg.path!, cfg.path!, sql);
354
379
  sqliteService.closeAll();
380
+ if (options.json) { console.log(JSON.stringify(result, null, 2)); return; }
355
381
  if (result.changeType === "select") {
356
382
  formatRows(result.columns, result.rows);
357
383
  } else {
@@ -161,6 +161,7 @@ ppm chat delete <session-id>
161
161
  \`\`\`
162
162
  ppm db list
163
163
  List all saved database connections
164
+ --json — Output as JSON
164
165
 
165
166
  ppm db add
166
167
  Add a new database connection
@@ -179,10 +180,12 @@ ppm db test <name>
179
180
 
180
181
  ppm db tables <name>
181
182
  List tables in a database connection
183
+ --json — Output as JSON
182
184
 
183
185
  ppm db schema <name> <table>
184
186
  Show table schema (columns, types, constraints)
185
187
  -s, --schema <schema> — PostgreSQL schema name [default: public]
188
+ --json — Output as JSON
186
189
 
187
190
  ppm db data <name> <table>
188
191
  View table data (paginated)
@@ -191,9 +194,11 @@ ppm db data <name> <table>
191
194
  --order <column> — Order by column
192
195
  --desc — Descending order
193
196
  -s, --schema <schema> — PostgreSQL schema name [default: public]
197
+ --json — Output as JSON
194
198
 
195
199
  ppm db query <name> <sql>
196
200
  Execute a SQL query against a saved connection
201
+ --json — Output as JSON
197
202
  \`\`\`
198
203
  ## ppm autostart — Auto-start on boot
199
204
  \`\`\`
@@ -322,6 +327,6 @@ ppm bot memory forget "<topic>"
322
327
  \`\`\`
323
328
 
324
329
  ## Tips
325
- - Use \`--json\` flag when parsing command output programmatically
330
+ - Use \`--json\` flag when parsing command output programmatically (available on most list/status commands — check \`--help\`)
326
331
  - For git/chat/db operations: always specify \`--project <name>\` or connection name
327
332
  `;
@@ -165,7 +165,14 @@ function SegmentDropdown({ segment, isLast, projectName, onFileClick }: SegmentD
165
165
 
166
166
  function handleOpenChange(open: boolean) {
167
167
  if (open && !isLoaded) {
168
- loadChildren(projectName, segment.parentPath);
168
+ // Load ancestor directories top-down so mergeChildren can traverse
169
+ // the tree to the target (needed when file opened via search/quick-open)
170
+ const parts = segment.parentPath.split("/").filter(Boolean);
171
+ (async () => {
172
+ for (let i = 0; i <= parts.length; i++) {
173
+ await loadChildren(projectName, parts.slice(0, i).join("/"));
174
+ }
175
+ })();
169
176
  }
170
177
  }
171
178
 
@@ -46,7 +46,7 @@ Invoke when the user asks to:
46
46
 
47
47
  - Always run `ppm status` before assuming the server is up.
48
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.
49
+ - Most listing commands accept `--json` for structured output; prefer JSON when parsing. Check `--help` if unsure.
50
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
51
  - Do NOT edit the config DB directly while the server is running; use `ppm config set` or the HTTP API.
52
52
 
@@ -1 +0,0 @@
1
- import"./vendor-markdown-0Mxgxy0L.js";import"./api-client-DIhJ5qVW.js";import{T as e}from"./index-D3gMHLKc.js";export{e as useKeybindingsStore};
@@ -1 +0,0 @@
1
- import"./vendor-markdown-0Mxgxy0L.js";import"./api-client-DIhJ5qVW.js";import{j as e}from"./index-D3gMHLKc.js";export{e as useNotificationStore};