@ivotoby/postgram-cli 1.2.0 → 1.3.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/README.md CHANGED
@@ -56,6 +56,9 @@ pgm task complete <task-id> --version 1
56
56
  # Sync markdown directory
57
57
  pgm sync ./notes --repo my-notes
58
58
 
59
+ # Check enrichment/extraction queue status
60
+ pgm queue
61
+
59
62
  # JSON output (all commands)
60
63
  pgm store "hello" --json
61
64
  ```
package/dist/client.js CHANGED
@@ -159,6 +159,9 @@ export function createPgmClient(options) {
159
159
  const query = qs.toString();
160
160
  return request(options, `/api/entities/${entityId}/edges${query ? `?${query}` : ''}`);
161
161
  },
162
+ getQueueStatus() {
163
+ return request(options, '/api/queue');
164
+ },
162
165
  expandGraph(entityId, params = {}) {
163
166
  const qs = new URLSearchParams();
164
167
  if (params.depth !== undefined)
package/dist/pgm.js CHANGED
@@ -476,6 +476,29 @@ taskCommand
476
476
  });
477
477
  });
478
478
  });
479
+ program
480
+ .command('queue')
481
+ .description('Show enrichment and extraction queue status')
482
+ .action(async (_options, command) => {
483
+ await runWithClient(command, async (client, json) => {
484
+ const body = await client.getQueueStatus();
485
+ if (json)
486
+ return body;
487
+ const e = body.embedding;
488
+ const age = e.oldest_pending_secs !== null ? ` oldest_pending=${e.oldest_pending_secs}s` : '';
489
+ const lines = [
490
+ `embedding: pending=${e.pending} completed=${e.completed} failed=${e.failed} retry_eligible=${e.retry_eligible}${age}`
491
+ ];
492
+ if (body.extraction) {
493
+ const x = body.extraction;
494
+ lines.push(`extraction: pending=${x.pending} completed=${x.completed} failed=${x.failed}`);
495
+ }
496
+ else {
497
+ lines.push('extraction: disabled');
498
+ }
499
+ return lines;
500
+ });
501
+ });
479
502
  program
480
503
  .command('backup')
481
504
  .description('Create a database backup')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ivotoby/postgram-cli",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Postgram CLI — store, search, and manage entities from the command line",
5
5
  "type": "module",
6
6
  "bin": {