chore(cli): add changeset and fix knip unused-export warning

- Add minor changeset for hdx query / hdx connections / --patterns.
- Revert ConnectionResponse to a non-exported interface; knip flagged
  it as an unused export and the type isn't consumed outside client.ts.
This commit is contained in:
Warren Lee 2026-04-17 12:14:53 -07:00
parent e86b2eb49a
commit f6d9817bad
2 changed files with 11 additions and 1 deletions

View file

@ -0,0 +1,10 @@
---
"@hyperdx/cli": minor
---
Add `hdx query` and `hdx connections` commands for agentic ClickHouse workflows:
- **`hdx connections`** — list ClickHouse connections (`id`, `name`, `host`) for the authenticated team. Supports `--json` for programmatic consumption.
- **`hdx query --connection-id <id> --sql <query>`** — run raw SQL against a configured ClickHouse connection via the `/clickhouse-proxy`. Default `--format` is `JSONEachRow` (NDJSON); any ClickHouse format is accepted. Exit codes: `0` on success (empty stdout = zero rows), `1` on failure. On error, a lazy connection lookup distinguishes "unknown connection ID" from "bad SQL".
- **`hdx query --patterns`** — post-process the result with the Drain algorithm (`@hyperdx/common-utils/dist/drain`) and emit one NDJSON pattern object per cluster, sorted by count desc: `{"pattern":"<template>","count":<n>,"sample":"<first sample>"}`. Use `--body-column <name>` to cluster a single column's string value; defaults to the whole row JSON-serialized so any SELECT shape works.
- `--help` documents the exit-code contract and includes sampling guidance (`ORDER BY rand()` + selective WHERE warning) for mining over large tables.

View file

@ -345,7 +345,7 @@ export interface SourceResponse {
sessionSourceId?: string;
}
export interface ConnectionResponse {
interface ConnectionResponse {
id: string;
_id: string;
name: string;