@hypequery/cli 1.23.0 → 1.24.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.
@@ -27,7 +27,7 @@ export function renderTelemetryCatalog() {
27
27
  const parts = [
28
28
  '{/* Generated by pnpm --filter @hypequery/cli telemetry:docs. Do not edit this section by hand. */}',
29
29
  '## Event reference',
30
- `Schema version: **${EVENT_SCHEMA_VERSION}**. Default collection is inactive. Debug or explicitly configured ingest mode emits command/crash lifecycle events, init and generation metrics, and dev/MCP session events. Cloud command and project-feature instrumentation follows separately.`,
30
+ `Schema version: **${EVENT_SCHEMA_VERSION}**. Unless opted out, the CLI sends command/crash lifecycle events, init and generation metrics, and dev/MCP session events to the first-party ingest proxy; debug mode prints them instead. Cloud command and project-feature instrumentation follows separately.`,
31
31
  'Unknown events, properties, record keys, flag names, enum values, and malformed identities or versions are rejected. No argument values, paths, names, SQL, messages, stacks, hosts, tenants, or credentials are permitted.',
32
32
  'Counts use inclusive integer ranges: 0, 1, 2–5, 6–20, 21–100, and 101 or more. Duration and nonzero size buckets include their lower bound and exclude their upper bound. Raw counts, durations, ports and byte sizes are never sent.',
33
33
  '### Common properties',
@@ -1,5 +1,7 @@
1
1
  export declare const TELEMETRY_SCHEMA_VERSION = 1;
2
2
  export declare const TELEMETRY_DOCS_URL = "https://hypequery.com/docs/telemetry";
3
+ /** First-party ingest proxy; `HYPEQUERY_TELEMETRY_URL` overrides it for staging or self-hosting. */
4
+ export declare const DEFAULT_TELEMETRY_ENDPOINT = "https://hypequery.com/api/telemetry";
3
5
  export interface TelemetryConfig {
4
6
  readonly schema_version: typeof TELEMETRY_SCHEMA_VERSION;
5
7
  readonly enabled: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"config-schema.d.ts","sourceRoot":"","sources":["../../../src/utils/telemetry/config-schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,kBAAkB,yCAAyC,CAAC;AAEzE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,cAAc,EAAE,OAAO,wBAAwB,CAAC;IACzD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACpD;AAED,mFAAmF;AACnF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAyB1E"}
1
+ {"version":3,"file":"config-schema.d.ts","sourceRoot":"","sources":["../../../src/utils/telemetry/config-schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,kBAAkB,yCAAyC,CAAC;AACzE,oGAAoG;AACpG,eAAO,MAAM,0BAA0B,wCAAwC,CAAC;AAEhF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,cAAc,EAAE,OAAO,wBAAwB,CAAC;IACzD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACpD;AAED,mFAAmF;AACnF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAyB1E"}
@@ -1,6 +1,8 @@
1
1
  import { matchesTelemetryFormat } from './value-formats.js';
2
2
  export const TELEMETRY_SCHEMA_VERSION = 1;
3
3
  export const TELEMETRY_DOCS_URL = 'https://hypequery.com/docs/telemetry';
4
+ /** First-party ingest proxy; `HYPEQUERY_TELEMETRY_URL` overrides it for staging or self-hosting. */
5
+ export const DEFAULT_TELEMETRY_ENDPOINT = 'https://hypequery.com/api/telemetry';
4
6
  /** Reject malformed or future settings rather than silently enabling telemetry. */
5
7
  export function parseTelemetryConfig(input) {
6
8
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"invocation.d.ts","sourceRoot":"","sources":["../../../src/utils/telemetry/invocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG/E,OAAO,EAAyB,KAAK,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAEtF,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAG3E,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC7E,MAAM,WAAW,iBAAkB,SAAQ,0BAA0B;IACnE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,cAAc,CAAC,EAAE,kBAAkB,CAAC;IAC7C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACvD;AAED,uFAAuF;AACvF,qBAAa,mBAAmB;IAEV,QAAQ,CAAC,MAAM,EAAE,yBAAyB;IAD9D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;IAC/C,OAAO;WAIM,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAuBpF,MAAM,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IACnC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CACvB"}
1
+ {"version":3,"file":"invocation.d.ts","sourceRoot":"","sources":["../../../src/utils/telemetry/invocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG/E,OAAO,EAAyB,KAAK,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAGtF,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAG3E,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC7E,MAAM,WAAW,iBAAkB,SAAQ,0BAA0B;IACnE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,cAAc,CAAC,EAAE,kBAAkB,CAAC;IAC7C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACvD;AAED,uFAAuF;AACvF,qBAAa,mBAAmB;IAEV,QAAQ,CAAC,MAAM,EAAE,yBAAyB;IAD9D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;IAC/C,OAAO;WAIM,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAqBpF,MAAM,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IACnC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CACvB"}
@@ -2,6 +2,7 @@ import { collectEnvironment } from './environment.js';
2
2
  import { inspectProject } from './project-context.js';
3
3
  import { invocationIdentity } from './identity.js';
4
4
  import { resolveTelemetryState } from './opt-out.js';
5
+ import { DEFAULT_TELEMETRY_ENDPOINT } from './config-schema.js';
5
6
  import { showTelemetryNotice } from './notice.js';
6
7
  import { TelemetryTransport } from './transport.js';
7
8
  import { getCliVersion } from '../cli-version.js';
@@ -16,12 +17,9 @@ export class TelemetryInvocation {
16
17
  static async create(options) {
17
18
  try {
18
19
  const env = options.env ?? process.env;
19
- // Collection is staged until the first-party proxy and rollout are ready.
20
- // Normal runs do not inspect projects or create identities just for telemetry.
21
- if (!env.HYPEQUERY_TELEMETRY_URL && env.HYPEQUERY_TELEMETRY_DEBUG !== '1')
22
- return null;
23
20
  if (options.command === 'telemetry')
24
21
  return null;
22
+ // Opt-outs resolve before any project inspection or identity creation.
25
23
  const cliVersion = options.cliVersion ?? getCliVersion();
26
24
  const state = await resolveTelemetryState({ ...options, cliVersion });
27
25
  if (!state.enabled || !state.config)
@@ -31,7 +29,7 @@ export class TelemetryInvocation {
31
29
  const common = { ...environment, ...invocationIdentity(state.config, project), is_first_run: state.source === 'default' };
32
30
  const invocation = new TelemetryInvocation(common, {
33
31
  ...options.transportOptions,
34
- enabled: true, endpoint: env.HYPEQUERY_TELEMETRY_URL,
32
+ enabled: true, endpoint: env.HYPEQUERY_TELEMETRY_URL || DEFAULT_TELEMETRY_ENDPOINT,
35
33
  debug: env.HYPEQUERY_TELEMETRY_DEBUG === '1',
36
34
  });
37
35
  await showTelemetryNotice({ ...options, enabled: true, isTTY: common.is_tty, isCI: common.is_ci });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypequery/cli",
3
- "version": "1.23.0",
3
+ "version": "1.24.0",
4
4
  "description": "CLI for scaffolding type-safe ClickHouse analytics, semantic datasets, React manifests, and deployments",
5
5
  "keywords": [
6
6
  "clickhouse",