postgresai 0.17.0-rc.1 → 0.17.0-rc.3

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
@@ -250,7 +250,7 @@ postgresai mon health [--wait <sec>] # Check monitoring services health
250
250
 
251
251
  When `--instance-id <uuid>` (or `PGAI_INSTANCE_ID`) is set, `local-install` forwards the id to the platform, which **adopts** the already-provisioned monitoring instance instead of self-registering a duplicate under an auto-created `postgres-ai-monitoring` project. The CLI then persists the adopted instance's real project to `.pgwatch-config`, so checkup reports upload alongside the rest of that instance's health data. Adoption is awaited (with one automatic retry); if it fails, the CLI warns and reports fall back to the default project until you re-run `local-install`. Without the flag, the legacy self-registration path is byte-for-byte unchanged.
252
252
 
253
- `local-install` writes `.env` in the monitoring directory. It preserves existing `REPLICATOR_PASSWORD` and `VM_AUTH_*` values or generates new random ones when missing; `VM_AUTH_USERNAME` defaults to `vmauth` when absent. The replication password is used by the demo PostgreSQL standby replication user, and the VM auth credentials are required before Docker Compose can provision Grafana datasources. If you run `docker compose` directly or maintain `.env` yourself, set both VM auth values before upgrading. For rotation, run `VM_AUTH_PASSWORD="$(openssl rand -base64 18)" ./scripts/rotate-vm-auth.sh` from the monitoring directory so `.env`, `sink-prometheus`, and `grafana` update together.
253
+ `local-install` writes `.env` in the monitoring directory. It preserves existing `REPLICATOR_PASSWORD`, `VM_AUTH_*` and the VictoriaMetrics admin-endpoint keys (`VM_DELETE_AUTH_KEY`, `VM_SNAPSHOT_AUTH_KEY`, `VM_FORCE_MERGE_AUTH_KEY`, `VM_PPROF_AUTH_KEY`, added in 0.17) or generates new random ones when missing. The admin keys live on the `sink-prometheus` command line, so `mon update` and `mon update-config` also recreate that container to apply them; `mon restart` (`docker compose restart`) does not; `VM_AUTH_USERNAME` defaults to `vmauth` when absent. The replication password is used by the demo PostgreSQL standby replication user, and the VM auth credentials are required before Docker Compose can provision Grafana datasources. If you run `docker compose` directly or maintain `.env` yourself, set both VM auth values before upgrading. For rotation, run `VM_AUTH_PASSWORD="$(openssl rand -base64 18)" ./scripts/rotate-vm-auth.sh` from the monitoring directory so `.env`, `sink-prometheus`, and `grafana` update together.
254
254
 
255
255
  #### Monitoring target databases (`mon targets` subgroup)
256
256
  ```bash
@@ -271,6 +271,35 @@ postgresai mon check # System readiness check
271
271
  postgresai mon shell <service> # Open shell to monitoring service
272
272
  ```
273
273
 
274
+ ### PromQL queries (`promql`)
275
+
276
+ Ask a monitoring instance a PromQL question through the platform. The platform
277
+ never connects to the instance: it queues the query as a job, the instance picks
278
+ it up on its next poll, runs it against its own metric store, and posts the
279
+ answer back.
280
+
281
+ ```bash
282
+ # instant query
283
+ pgai promql 'up' --instance <instance-uuid>
284
+
285
+ # range query
286
+ pgai promql 'sum(rate(pgwatch_db_stats_xact_commit[5m]))' \
287
+ --instance <instance-uuid> \
288
+ --range --start 2026-09-21T00:00:00Z --end 2026-09-21T01:00:00Z --step 60
289
+
290
+ # on the box itself, --instance is read from .pgwatch-config
291
+ pgai promql 'up'
292
+ ```
293
+
294
+ `--at <time>` evaluates an instant query at a given moment (ignored with
295
+ `--range`). `--json` prints every point instead of the first and last per series.
296
+ The wait is sized from the instance's poll pacing; `--timeout` overrides it. A
297
+ result too large for the byte budget is trimmed and flagged `truncated`.
298
+
299
+ Requires platform-all !809
300
+ (https://gitlab.com/postgres-ai/platform-all/-/merge_requests/809); until it is
301
+ deployed the command returns a PGRST202 404.
302
+
274
303
  ### MCP server (`mcp` group)
275
304
 
276
305
  ```bash
@@ -299,10 +328,10 @@ required** — the server will not assume an organization. Call `orgs_list` (or
299
328
  run `pgai orgs`) to discover the available ids.
300
329
 
301
330
  Tools exposed:
302
- - `list_issues`: returns the same JSON as `postgresai issues list` (args: `{ org_id, status?, hidden_only?, limit?, offset?, debug? }`).
331
+ - `list_issues`: returns the same JSON as `postgresai issues list` (args: `{ org_id, status?, hidden_only?, limit?, offset?, debug? }`). Unlike the CLI, omitting `status` returns open and closed issues; pass `status: "open"` to match the CLI default.
303
332
  - `view_issue`: view a single issue with its comments (args: `{ issue_id, org_id, debug? }`).
304
- - `create_issue`: create a new issue (args: `{ title, description?, org_id, attachments?, debug? }`).
305
- - `update_issue`: update title/description/status/labels (args: `{ issue_id, org_id, title?, description?, status?, labels?, attachments?, debug? }`).
333
+ - `create_issue`: create a new issue (args: `{ title, description?, org_id, project_id?, labels?, attachments?, is_hidden?, debug? }`).
334
+ - `update_issue`: update title/description/status/labels/is_hidden (args: `{ issue_id, org_id, title?, description?, status?, labels?, attachments?, is_hidden?, debug? }`).
306
335
  - `post_issue_comment`: post a comment (args: `{ issue_id, org_id, content?, parent_comment_id?, attachments?, debug? }`).
307
336
  - `update_issue_comment`: update an existing comment (args: `{ comment_id, org_id, content?, attachments?, debug? }`).
308
337
  - `upload_file`: upload a local file and return the storage URL plus a ready-to-paste markdown link (args: `{ path, org_id, debug? }`).
@@ -350,11 +379,14 @@ sensitive.
350
379
  ### Issues management (`issues` group)
351
380
 
352
381
  ```bash
353
- postgresai issues list # List issues (shows: id, title, status, created_at; is_hidden only when set)
382
+ postgresai issues list # List OPEN issues (shows: id, title, status, created_at; is_hidden only when set)
383
+ postgresai issues list --status closed # Only closed issues (--status all for both)
354
384
  postgresai issues list --hidden-only # Only hidden issues (PostgresAI staff)
355
385
  postgresai issues view <issueId> # View issue details and comments
356
- postgresai issues create --org-id <id> --title <t> # Create a new issue
386
+ postgresai issues create --org-id <id> <title> # Create a new issue
387
+ postgresai issues create --org-id <id> <title> --hidden # Create a hidden issue (PostgresAI staff)
357
388
  postgresai issues update <issueId> [--title ... --status ...]# Update an existing issue
389
+ postgresai issues update <issueId> --hidden|--no-hidden # Hide / unhide an issue (PostgresAI staff)
358
390
  postgresai issues post-comment <issueId> <content> # Post a comment to an issue
359
391
  postgresai issues update-comment <commentId> <content> # Update an existing comment
360
392
  postgresai issues files upload <path> # Upload a file, print URL + markdown
@@ -370,7 +402,11 @@ postgresai issues files download <url> [-o <path>] # Download a file
370
402
  Hidden issues are staff-internal. `issues list` and `issues view` mark them
371
403
  with `is_hidden: true`; the key is omitted entirely otherwise, so ordinary
372
404
  issues look exactly as they always have. `--hidden-only` lists just the hidden
373
- ones, filtered server-side.
405
+ ones, filtered server-side. `issues create --hidden` creates one, and
406
+ `issues update --hidden` / `--no-hidden` hides or unhides an existing issue
407
+ (MCP: `is_hidden` on `create_issue` / `update_issue`). The CLI does no staff
408
+ check of its own: the platform refuses a visibility change for a non-staff
409
+ credential with a plain error, and the CLI prints it and exits non-zero.
374
410
 
375
411
  Staff access is granted per credential, not per person, and a credential that
376
412
  does not qualify simply sees nothing — `--hidden-only` returns an empty list