@velum-labs/routekit-telemetry-core 0.18.6 → 1.0.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/dist/index.d.ts +2 -6
- package/dist/index.js +15 -27
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -21,8 +21,6 @@ export type ConsentOptions = {
|
|
|
21
21
|
now?: () => Date;
|
|
22
22
|
randomId?: () => string;
|
|
23
23
|
};
|
|
24
|
-
/** @deprecated Use the event schema inventory instead. */
|
|
25
|
-
export declare const CLI_COMMAND_TELEMETRY_FIELDS: readonly ["command", "cli_version", "os", "arch", "node_major", "duration_bucket", "exit_kind", "is_ci"];
|
|
26
24
|
export type TelemetryFieldMap = Readonly<Record<string, readonly string[]>>;
|
|
27
25
|
export type TelemetryDestination = {
|
|
28
26
|
provider: "posthog";
|
|
@@ -51,7 +49,7 @@ export declare const DURATION_BUCKETS: readonly ["<1s", "1-10s", "10-60s", "1-5m
|
|
|
51
49
|
export declare function durationBucket(ms: number): (typeof DURATION_BUCKETS)[number];
|
|
52
50
|
export declare const TELEMETRY_OUTCOMES: readonly ["success", "error", "cancelled"];
|
|
53
51
|
declare const OUTCOMES: readonly ["success", "error", "cancelled"];
|
|
54
|
-
export declare const COMMAND_PATHS: readonly ["start", "stop", "status", "doctor", "usage", "usage.redeem", "leaderboard", "accounts.login", "accounts.add", "accounts.rename", "accounts.remove", "accounts.list", "accounts.status", "calls.inspect", "config.path", "config.show", "config.init", "config.edit", "config.import", "
|
|
52
|
+
export declare const COMMAND_PATHS: readonly ["start", "stop", "status", "doctor", "usage", "usage.redeem", "leaderboard", "accounts.login", "accounts.add", "accounts.rename", "accounts.remove", "accounts.list", "accounts.status", "calls.inspect", "config.path", "config.show", "config.init", "config.edit", "config.import", "providers.add", "providers.remove", "providers.status", "models.list", "models.info", "remote.add", "remote.install", "remote.list", "remote.show", "remote.use", "remote.remove", "peer.add", "peer.show", "peer.remove", "token.issue", "token.list", "token.revoke", "codex", "claude", "codex.install", "codex.uninstall", "claude.install", "claude.uninstall", "daemon.reload", "daemon.auth.show", "daemon.service.install", "daemon.service.uninstall", "daemon.service.status", "daemon.logs", "daemon.restart", "daemon.upgrade", "eval.setup", "eval.status", "eval.answer", "eval.propose.dimensions", "eval.propose.evaluations", "eval.approve.dimensions", "eval.approve.evaluations", "eval.validate", "eval.estimate", "eval.run", "eval.results", "eval.publish", "policy.show"];
|
|
55
53
|
export declare const COMMAND_EXIT_KINDS: readonly ["success", "usage_error", "command_error", "cancelled"];
|
|
56
54
|
export declare const COMMAND_TARGET_KINDS: readonly ["local", "remote", "peer"];
|
|
57
55
|
export declare const COMMAND_OS_VALUES: readonly ["darwin", "linux", "win32", "other"];
|
|
@@ -73,7 +71,7 @@ export declare const TELEMETRY_EVENT_DEFINITIONS: {
|
|
|
73
71
|
readonly command: {
|
|
74
72
|
readonly type: "string";
|
|
75
73
|
readonly maxLength: 64;
|
|
76
|
-
readonly values: readonly ["start", "stop", "status", "doctor", "usage", "usage.redeem", "leaderboard", "accounts.login", "accounts.add", "accounts.rename", "accounts.remove", "accounts.list", "accounts.status", "calls.inspect", "config.path", "config.show", "config.init", "config.edit", "config.import", "
|
|
74
|
+
readonly values: readonly ["start", "stop", "status", "doctor", "usage", "usage.redeem", "leaderboard", "accounts.login", "accounts.add", "accounts.rename", "accounts.remove", "accounts.list", "accounts.status", "calls.inspect", "config.path", "config.show", "config.init", "config.edit", "config.import", "providers.add", "providers.remove", "providers.status", "models.list", "models.info", "remote.add", "remote.install", "remote.list", "remote.show", "remote.use", "remote.remove", "peer.add", "peer.show", "peer.remove", "token.issue", "token.list", "token.revoke", "codex", "claude", "codex.install", "codex.uninstall", "claude.install", "claude.uninstall", "daemon.reload", "daemon.auth.show", "daemon.service.install", "daemon.service.uninstall", "daemon.service.status", "daemon.logs", "daemon.restart", "daemon.upgrade", "eval.setup", "eval.status", "eval.answer", "eval.propose.dimensions", "eval.propose.evaluations", "eval.approve.dimensions", "eval.approve.evaluations", "eval.validate", "eval.estimate", "eval.run", "eval.results", "eval.publish", "policy.show"];
|
|
77
75
|
};
|
|
78
76
|
readonly cli_version: {
|
|
79
77
|
readonly type: "string";
|
|
@@ -423,8 +421,6 @@ export declare function telemetryStatusMetadata(decision: ConsentDecision, desti
|
|
|
423
421
|
installId: string | null;
|
|
424
422
|
fields: TelemetryFieldMap;
|
|
425
423
|
};
|
|
426
|
-
/** @deprecated Prefer buildTelemetryEvent, which rejects unknown properties. */
|
|
427
|
-
export declare function allowlistedProperties(source: Record<string, unknown>, allow: readonly string[]): Record<string, unknown>;
|
|
428
424
|
export declare function anonymousEventProperties(properties: Record<string, unknown>): Record<string, unknown>;
|
|
429
425
|
export declare function boundedShutdown(shutdown: () => Promise<unknown>, timeoutMs?: number): Promise<void>;
|
|
430
426
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { chmodSync, existsSync, mkdirSync, readFileSync, rmSync } from "node:fs";
|
|
3
3
|
import { dirname } from "node:path";
|
|
4
|
-
import { writeFileAtomic } from "@velum-labs/routekit-runtime";
|
|
4
|
+
import { writeFileAtomic } from "@velum-labs/routekit-runtime/filesystem";
|
|
5
5
|
export const TELEMETRY_CATEGORIES = ["usage", "reliability", "adoption"];
|
|
6
6
|
export const DEFAULT_TELEMETRY_CATEGORIES = Object.freeze({
|
|
7
7
|
usage: true,
|
|
8
8
|
reliability: true,
|
|
9
9
|
adoption: true
|
|
10
10
|
});
|
|
11
|
-
/** @deprecated Use the event schema inventory instead. */
|
|
12
|
-
export const CLI_COMMAND_TELEMETRY_FIELDS = [
|
|
13
|
-
"command",
|
|
14
|
-
"cli_version",
|
|
15
|
-
"os",
|
|
16
|
-
"arch",
|
|
17
|
-
"node_major",
|
|
18
|
-
"duration_bucket",
|
|
19
|
-
"exit_kind",
|
|
20
|
-
"is_ci"
|
|
21
|
-
];
|
|
22
11
|
const truthy = (value) => value !== undefined && ["1", "true", "on", "yes"].includes(value.toLowerCase());
|
|
23
12
|
const falsy = (value) => value !== undefined && ["0", "false", "off", "no"].includes(value.toLowerCase());
|
|
24
13
|
function categories(value) {
|
|
@@ -220,7 +209,6 @@ export const COMMAND_PATHS = [
|
|
|
220
209
|
"config.init",
|
|
221
210
|
"config.edit",
|
|
222
211
|
"config.import",
|
|
223
|
-
"config.migrate",
|
|
224
212
|
"providers.add",
|
|
225
213
|
"providers.remove",
|
|
226
214
|
"providers.status",
|
|
@@ -240,23 +228,31 @@ export const COMMAND_PATHS = [
|
|
|
240
228
|
"token.revoke",
|
|
241
229
|
"codex",
|
|
242
230
|
"claude",
|
|
243
|
-
"cursor",
|
|
244
|
-
"opencode",
|
|
245
231
|
"codex.install",
|
|
246
232
|
"codex.uninstall",
|
|
247
233
|
"claude.install",
|
|
248
234
|
"claude.uninstall",
|
|
249
235
|
"daemon.reload",
|
|
250
|
-
"daemon.status",
|
|
251
236
|
"daemon.auth.show",
|
|
252
237
|
"daemon.service.install",
|
|
253
238
|
"daemon.service.uninstall",
|
|
254
239
|
"daemon.service.status",
|
|
255
240
|
"daemon.logs",
|
|
256
|
-
"daemon.start",
|
|
257
|
-
"daemon.stop",
|
|
258
241
|
"daemon.restart",
|
|
259
|
-
"daemon.upgrade"
|
|
242
|
+
"daemon.upgrade",
|
|
243
|
+
"eval.setup",
|
|
244
|
+
"eval.status",
|
|
245
|
+
"eval.answer",
|
|
246
|
+
"eval.propose.dimensions",
|
|
247
|
+
"eval.propose.evaluations",
|
|
248
|
+
"eval.approve.dimensions",
|
|
249
|
+
"eval.approve.evaluations",
|
|
250
|
+
"eval.validate",
|
|
251
|
+
"eval.estimate",
|
|
252
|
+
"eval.run",
|
|
253
|
+
"eval.results",
|
|
254
|
+
"eval.publish",
|
|
255
|
+
"policy.show"
|
|
260
256
|
];
|
|
261
257
|
export const COMMAND_EXIT_KINDS = ["success", "usage_error", "command_error", "cancelled"];
|
|
262
258
|
export const COMMAND_TARGET_KINDS = ["local", "remote", "peer"];
|
|
@@ -479,14 +475,6 @@ export function telemetryStatusMetadata(decision, destinationOrFields, schema =
|
|
|
479
475
|
schema
|
|
480
476
|
};
|
|
481
477
|
}
|
|
482
|
-
/** @deprecated Prefer buildTelemetryEvent, which rejects unknown properties. */
|
|
483
|
-
export function allowlistedProperties(source, allow) {
|
|
484
|
-
const properties = {};
|
|
485
|
-
for (const key of allow)
|
|
486
|
-
if (source[key] !== undefined)
|
|
487
|
-
properties[key] = source[key];
|
|
488
|
-
return properties;
|
|
489
|
-
}
|
|
490
478
|
export function anonymousEventProperties(properties) {
|
|
491
479
|
return { ...properties, $process_person_profile: false, $ip: null };
|
|
492
480
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@velum-labs/routekit-telemetry-core",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/velum-labs/routekit.git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"provenance": true
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@velum-labs/routekit-runtime": "0.
|
|
29
|
+
"@velum-labs/routekit-runtime": "1.0.0"
|
|
30
30
|
},
|
|
31
31
|
"keywords": [
|
|
32
32
|
"routekit",
|