@opendatalabs/connect 0.12.2 → 0.13.1-canary.5f3c748
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/cli/telemetry-contract.d.ts +146 -0
- package/dist/cli/telemetry-contract.d.ts.map +1 -0
- package/dist/cli/telemetry-contract.js +56 -0
- package/dist/cli/telemetry-contract.js.map +1 -0
- package/dist/cli/telemetry.d.ts +15 -31
- package/dist/cli/telemetry.d.ts.map +1 -1
- package/dist/cli/telemetry.js +388 -261
- package/dist/cli/telemetry.js.map +1 -1
- package/dist/connectors/registry.d.ts.map +1 -1
- package/dist/connectors/registry.js +4 -1
- package/dist/connectors/registry.js.map +1 -1
- package/dist/runtime/playwright/in-process-run.d.ts.map +1 -1
- package/dist/runtime/playwright/in-process-run.js +101 -46
- package/dist/runtime/playwright/in-process-run.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
export declare const TELEMETRY_PRODUCERS: readonly ["cli", "data_connect", "personal_server"];
|
|
2
|
+
export type TelemetryProducer = (typeof TELEMETRY_PRODUCERS)[number];
|
|
3
|
+
export declare const TELEMETRY_ERROR_CLASSES: readonly ["auth_failed", "personal_server_unavailable", "network_error", "timeout", "runtime_error", "unknown"];
|
|
4
|
+
export type TelemetryErrorClass = (typeof TELEMETRY_ERROR_CLASSES)[number];
|
|
5
|
+
export declare const TELEMETRY_CANCELLATION_REASONS: readonly ["user_aborted", "abandoned", "timeout"];
|
|
6
|
+
export type TelemetryCancellationReason = (typeof TELEMETRY_CANCELLATION_REASONS)[number];
|
|
7
|
+
export declare const TELEMETRY_INTERACTION_KINDS: readonly ["login", "otp", "captcha", "manual_action"];
|
|
8
|
+
export type TelemetryInteractionKind = (typeof TELEMETRY_INTERACTION_KINDS)[number];
|
|
9
|
+
export declare const TELEMETRY_SYNC_SKIP_REASONS: readonly ["server_unavailable", "not_requested"];
|
|
10
|
+
export type TelemetrySyncSkipReason = (typeof TELEMETRY_SYNC_SKIP_REASONS)[number];
|
|
11
|
+
export declare const TELEMETRY_OS_VALUES: readonly ["linux", "macos", "windows"];
|
|
12
|
+
export type TelemetryOs = (typeof TELEMETRY_OS_VALUES)[number];
|
|
13
|
+
export declare const TELEMETRY_ARCH_VALUES: readonly ["x86_64", "arm64"];
|
|
14
|
+
export type TelemetryArch = (typeof TELEMETRY_ARCH_VALUES)[number];
|
|
15
|
+
export interface TelemetryIdentity {
|
|
16
|
+
eventId: string;
|
|
17
|
+
eventVersion: number;
|
|
18
|
+
}
|
|
19
|
+
export interface TelemetryTime {
|
|
20
|
+
occurredAt: string;
|
|
21
|
+
durationMs?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface TelemetryAttribution {
|
|
24
|
+
producer: TelemetryProducer;
|
|
25
|
+
installId: string;
|
|
26
|
+
appSessionId?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface TelemetryContext {
|
|
29
|
+
hostPlatform: string;
|
|
30
|
+
os: TelemetryOs;
|
|
31
|
+
arch: TelemetryArch;
|
|
32
|
+
producerVersion: string;
|
|
33
|
+
connectorVersion?: string;
|
|
34
|
+
authMode?: string;
|
|
35
|
+
}
|
|
36
|
+
export type TelemetryCorrelation = {
|
|
37
|
+
scope: "host";
|
|
38
|
+
hostRunId: string;
|
|
39
|
+
} | {
|
|
40
|
+
scope: "collection";
|
|
41
|
+
hostRunId: string;
|
|
42
|
+
collectionRunId: string;
|
|
43
|
+
source: string;
|
|
44
|
+
} | {
|
|
45
|
+
scope: "sync";
|
|
46
|
+
hostRunId: string;
|
|
47
|
+
syncRunId: string;
|
|
48
|
+
source: string;
|
|
49
|
+
collectionRunId?: string;
|
|
50
|
+
} | {
|
|
51
|
+
scope: "grant";
|
|
52
|
+
hostRunId: string;
|
|
53
|
+
grantFlowId: string;
|
|
54
|
+
};
|
|
55
|
+
export type TelemetryKind = {
|
|
56
|
+
lifecycle: "host";
|
|
57
|
+
phase: "started";
|
|
58
|
+
} | {
|
|
59
|
+
lifecycle: "host";
|
|
60
|
+
phase: "terminal";
|
|
61
|
+
outcome: "success";
|
|
62
|
+
} | {
|
|
63
|
+
lifecycle: "host";
|
|
64
|
+
phase: "terminal";
|
|
65
|
+
outcome: "failure";
|
|
66
|
+
errorClass: TelemetryErrorClass;
|
|
67
|
+
} | {
|
|
68
|
+
lifecycle: "collection";
|
|
69
|
+
phase: "started";
|
|
70
|
+
} | {
|
|
71
|
+
lifecycle: "collection";
|
|
72
|
+
phase: "needs_input";
|
|
73
|
+
interactionKind?: TelemetryInteractionKind;
|
|
74
|
+
} | {
|
|
75
|
+
lifecycle: "collection";
|
|
76
|
+
phase: "terminal";
|
|
77
|
+
outcome: "success";
|
|
78
|
+
recordCount?: number;
|
|
79
|
+
} | {
|
|
80
|
+
lifecycle: "collection";
|
|
81
|
+
phase: "terminal";
|
|
82
|
+
outcome: "failure";
|
|
83
|
+
errorClass: TelemetryErrorClass;
|
|
84
|
+
} | {
|
|
85
|
+
lifecycle: "collection";
|
|
86
|
+
phase: "terminal";
|
|
87
|
+
outcome: "cancelled";
|
|
88
|
+
reason?: TelemetryCancellationReason;
|
|
89
|
+
} | {
|
|
90
|
+
lifecycle: "sync";
|
|
91
|
+
phase: "started";
|
|
92
|
+
} | {
|
|
93
|
+
lifecycle: "sync";
|
|
94
|
+
phase: "terminal";
|
|
95
|
+
outcome: "success";
|
|
96
|
+
storedScopeCount: number;
|
|
97
|
+
failedScopeCount: number;
|
|
98
|
+
} | {
|
|
99
|
+
lifecycle: "sync";
|
|
100
|
+
phase: "terminal";
|
|
101
|
+
outcome: "failure";
|
|
102
|
+
errorClass: TelemetryErrorClass;
|
|
103
|
+
} | {
|
|
104
|
+
lifecycle: "sync";
|
|
105
|
+
phase: "skipped";
|
|
106
|
+
reason: TelemetrySyncSkipReason;
|
|
107
|
+
} | {
|
|
108
|
+
lifecycle: "grant";
|
|
109
|
+
phase: "started";
|
|
110
|
+
} | {
|
|
111
|
+
lifecycle: "grant";
|
|
112
|
+
phase: "terminal";
|
|
113
|
+
outcome: "approved";
|
|
114
|
+
} | {
|
|
115
|
+
lifecycle: "grant";
|
|
116
|
+
phase: "terminal";
|
|
117
|
+
outcome: "denied";
|
|
118
|
+
} | {
|
|
119
|
+
lifecycle: "grant";
|
|
120
|
+
phase: "terminal";
|
|
121
|
+
outcome: "expired";
|
|
122
|
+
} | {
|
|
123
|
+
lifecycle: "grant";
|
|
124
|
+
phase: "terminal";
|
|
125
|
+
outcome: "failure";
|
|
126
|
+
errorClass: TelemetryErrorClass;
|
|
127
|
+
};
|
|
128
|
+
export interface TelemetryEvent {
|
|
129
|
+
identity: TelemetryIdentity;
|
|
130
|
+
time: TelemetryTime;
|
|
131
|
+
attribution: TelemetryAttribution;
|
|
132
|
+
context: TelemetryContext;
|
|
133
|
+
correlation: TelemetryCorrelation;
|
|
134
|
+
kind: TelemetryKind;
|
|
135
|
+
debug?: string;
|
|
136
|
+
extensions?: Record<string, unknown>;
|
|
137
|
+
}
|
|
138
|
+
export interface TelemetryBatch {
|
|
139
|
+
batchId: string;
|
|
140
|
+
sentAt: string;
|
|
141
|
+
events: TelemetryEvent[];
|
|
142
|
+
}
|
|
143
|
+
export declare const TELEMETRY_ENDPOINT = "https://telemetry.opendatalabs.com/v1/telemetry/events";
|
|
144
|
+
export declare const TELEMETRY_EVENT_VERSION = 1;
|
|
145
|
+
export declare const TELEMETRY_PRODUCER_NAME: TelemetryProducer;
|
|
146
|
+
//# sourceMappingURL=telemetry-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-contract.d.ts","sourceRoot":"","sources":["../../src/cli/telemetry-contract.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,mBAAmB,qDAItB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAIrE,eAAO,MAAM,uBAAuB,iHAO1B,CAAC;AACX,MAAM,MAAM,mBAAmB,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BAAiB,CAAC;IAC5B,IAAI,EAAE,aAAa,CAAC;IACpB,WAAW,EAAE,oBAAoB,CAAC;IAClC,OAAO,EAAE,gBAAgB,CAAC;IAC1B,WAAW,EAAE,oBAAoB,CAAC;IAClC,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAID,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B;AAID,eAAO,MAAM,kBAAkB,2DAC2B,CAAC;AAC3D,eAAO,MAAM,uBAAuB,IAAI,CAAC;AACzC,eAAO,MAAM,uBAAuB,EAAE,iBAAyB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Canonical telemetry contract — copied from context-gateway.
|
|
3
|
+
//
|
|
4
|
+
// SOURCE OF TRUTH:
|
|
5
|
+
// https://github.com/vana-com/context-gateway/blob/main/packages/contracts/src/telemetry.ts
|
|
6
|
+
// https://github.com/vana-com/context-gateway/blob/main/packages/contracts/TELEMETRY.md
|
|
7
|
+
//
|
|
8
|
+
// Context-gateway is a private monorepo, so this file is manually synced
|
|
9
|
+
// rather than imported from npm. When the canonical contract changes, this
|
|
10
|
+
// file MUST be updated to match. The server validates events against its
|
|
11
|
+
// own copy; a mismatch will cause events from this client to be rejected.
|
|
12
|
+
//
|
|
13
|
+
// See TELEMETRY.md in context-gateway for the state machine and the rollup
|
|
14
|
+
// rules. All type definitions below mirror the upstream contract exactly.
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
// ── Producers ───────────────────────────────────────────────────────────────
|
|
17
|
+
export const TELEMETRY_PRODUCERS = [
|
|
18
|
+
"cli",
|
|
19
|
+
"data_connect",
|
|
20
|
+
"personal_server",
|
|
21
|
+
];
|
|
22
|
+
// ── Error classes ───────────────────────────────────────────────────────────
|
|
23
|
+
export const TELEMETRY_ERROR_CLASSES = [
|
|
24
|
+
"auth_failed",
|
|
25
|
+
"personal_server_unavailable",
|
|
26
|
+
"network_error",
|
|
27
|
+
"timeout",
|
|
28
|
+
"runtime_error",
|
|
29
|
+
"unknown",
|
|
30
|
+
];
|
|
31
|
+
// ── Cancellation reasons ────────────────────────────────────────────────────
|
|
32
|
+
export const TELEMETRY_CANCELLATION_REASONS = [
|
|
33
|
+
"user_aborted",
|
|
34
|
+
"abandoned",
|
|
35
|
+
"timeout",
|
|
36
|
+
];
|
|
37
|
+
// ── Interaction kinds ───────────────────────────────────────────────────────
|
|
38
|
+
export const TELEMETRY_INTERACTION_KINDS = [
|
|
39
|
+
"login",
|
|
40
|
+
"otp",
|
|
41
|
+
"captcha",
|
|
42
|
+
"manual_action",
|
|
43
|
+
];
|
|
44
|
+
// ── Sync skip reasons ───────────────────────────────────────────────────────
|
|
45
|
+
export const TELEMETRY_SYNC_SKIP_REASONS = [
|
|
46
|
+
"server_unavailable",
|
|
47
|
+
"not_requested",
|
|
48
|
+
];
|
|
49
|
+
// ── Host context enums ──────────────────────────────────────────────────────
|
|
50
|
+
export const TELEMETRY_OS_VALUES = ["linux", "macos", "windows"];
|
|
51
|
+
export const TELEMETRY_ARCH_VALUES = ["x86_64", "arm64"];
|
|
52
|
+
// ── Endpoint ────────────────────────────────────────────────────────────────
|
|
53
|
+
export const TELEMETRY_ENDPOINT = "https://telemetry.opendatalabs.com/v1/telemetry/events";
|
|
54
|
+
export const TELEMETRY_EVENT_VERSION = 1;
|
|
55
|
+
export const TELEMETRY_PRODUCER_NAME = "cli";
|
|
56
|
+
//# sourceMappingURL=telemetry-contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-contract.js","sourceRoot":"","sources":["../../src/cli/telemetry-contract.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,8DAA8D;AAC9D,EAAE;AACF,mBAAmB;AACnB,8FAA8F;AAC9F,0FAA0F;AAC1F,EAAE;AACF,yEAAyE;AACzE,2EAA2E;AAC3E,yEAAyE;AACzE,0EAA0E;AAC1E,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,8EAA8E;AAE9E,+EAA+E;AAE/E,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK;IACL,cAAc;IACd,iBAAiB;CACT,CAAC;AAGX,+EAA+E;AAE/E,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,aAAa;IACb,6BAA6B;IAC7B,eAAe;IACf,SAAS;IACT,eAAe;IACf,SAAS;CACD,CAAC;AAGX,+EAA+E;AAE/E,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,cAAc;IACd,WAAW;IACX,SAAS;CACD,CAAC;AAIX,+EAA+E;AAE/E,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,OAAO;IACP,KAAK;IACL,SAAS;IACT,eAAe;CACP,CAAC;AAIX,+EAA+E;AAE/E,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,oBAAoB;IACpB,eAAe;CACP,CAAC;AAIX,+EAA+E;AAE/E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAU,CAAC;AAG1E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU,CAAC;AA8IlE,+EAA+E;AAE/E,MAAM,CAAC,MAAM,kBAAkB,GAC7B,wDAAwD,CAAC;AAC3D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AACzC,MAAM,CAAC,MAAM,uBAAuB,GAAsB,KAAK,CAAC"}
|
package/dist/cli/telemetry.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { CliChannel, CliEvent, CliInstallMethod, CliOutcome } from "../core/cli-types.js";
|
|
2
2
|
type TelemetryReason = "default" | "config_enabled" | "config_disabled" | "env_disabled" | "env_debug" | "local_only";
|
|
3
|
-
type TelemetryMetadata = Record<string, string | number | boolean | null>;
|
|
4
3
|
export interface TelemetryCommandContext {
|
|
5
4
|
command: string;
|
|
6
5
|
subcommand?: string;
|
|
@@ -25,44 +24,26 @@ export interface TelemetryStatus {
|
|
|
25
24
|
endpoint: string;
|
|
26
25
|
queuedBatches: number;
|
|
27
26
|
}
|
|
28
|
-
interface TelemetryStoredEvent {
|
|
29
|
-
eventId: string;
|
|
30
|
-
eventVersion: number;
|
|
31
|
-
timestamp: string;
|
|
32
|
-
installId: string;
|
|
33
|
-
runId: string;
|
|
34
|
-
eventName: string;
|
|
35
|
-
command: string;
|
|
36
|
-
subcommand: string | null;
|
|
37
|
-
source: string | null;
|
|
38
|
-
connectorVersion: string | null;
|
|
39
|
-
authMode: string | null;
|
|
40
|
-
platform: string;
|
|
41
|
-
os: string;
|
|
42
|
-
arch: string;
|
|
43
|
-
cliVersion: string;
|
|
44
|
-
channel: CliChannel;
|
|
45
|
-
installMethod: CliInstallMethod;
|
|
46
|
-
ci: boolean;
|
|
47
|
-
agent: boolean;
|
|
48
|
-
interactive: boolean;
|
|
49
|
-
outcome: string | null;
|
|
50
|
-
errorClass: string | null;
|
|
51
|
-
durationMs: number | null;
|
|
52
|
-
storedScopeCount: number | null;
|
|
53
|
-
failedScopeCount: number | null;
|
|
54
|
-
metadata: TelemetryMetadata | null;
|
|
55
|
-
}
|
|
56
27
|
interface CommandResult {
|
|
57
28
|
exitCode: number;
|
|
58
29
|
outcome?: string | null;
|
|
59
30
|
errorClass?: string | null;
|
|
60
31
|
}
|
|
61
32
|
export interface CliTelemetrySession {
|
|
33
|
+
/** Translate a CLI-native event into canonical telemetry events. */
|
|
62
34
|
trackCliEvent(event: CliEvent | CliOutcome): void;
|
|
63
|
-
|
|
35
|
+
/**
|
|
36
|
+
* No-op shim for call sites that emitted ad-hoc custom events. The
|
|
37
|
+
* canonical contract does not support arbitrary event names; the
|
|
38
|
+
* intended way to carry producer-specific detail is via
|
|
39
|
+
* `extensions` on host events, already handled by the session.
|
|
40
|
+
*/
|
|
41
|
+
trackCustomEvent(eventName: string, patch?: Record<string, unknown>): void;
|
|
42
|
+
/** Mark the overall command result and emit host/collection terminals. */
|
|
64
43
|
markCommandResult(result: CommandResult): void;
|
|
44
|
+
/** Persist queued events to the outbox. */
|
|
65
45
|
persist(): Promise<void>;
|
|
46
|
+
/** Attempt to flush outbox files to the server. */
|
|
66
47
|
flush(): Promise<void>;
|
|
67
48
|
}
|
|
68
49
|
export declare function flushTelemetryOutbox(): Promise<void>;
|
|
@@ -70,7 +51,10 @@ export declare function getTelemetryStatus(): Promise<TelemetryStatus>;
|
|
|
70
51
|
export declare function setTelemetryEnabled(enabled: boolean): Promise<void>;
|
|
71
52
|
export declare function setActiveTelemetrySession(session: CliTelemetrySession | null): void;
|
|
72
53
|
export declare function getActiveTelemetrySession(): CliTelemetrySession | null;
|
|
73
|
-
export declare function trackActiveTelemetryEvent(eventName: string, patch?: Partial<TelemetryStoredEvent>): void;
|
|
74
54
|
export declare function createCliTelemetrySession(context: TelemetryCommandContext): Promise<CliTelemetrySession>;
|
|
55
|
+
/** @deprecated trackCustomEvent on the session is a no-op in the canonical
|
|
56
|
+
* model. This top-level helper is also a no-op — kept only to satisfy
|
|
57
|
+
* existing call sites. */
|
|
58
|
+
export declare function trackActiveTelemetryEvent(_eventName?: string, _patch?: unknown): void;
|
|
75
59
|
export {};
|
|
76
60
|
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/cli/telemetry.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACX,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/cli/telemetry.ts"],"names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