@illuma-ai/observability-core 0.1.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.
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Abstract base class for all observability clients.
3
+ *
4
+ * Platform-specific packages (Node.js, browser) extend this class and
5
+ * implement `fetchWithRetry` using the appropriate HTTP primitive.
6
+ *
7
+ * The core client owns:
8
+ * - Event batching and auto-flush logic
9
+ * - Auth header construction
10
+ * - Retry policy with exponential backoff
11
+ * - 207 Multi-Status response handling
12
+ */
13
+ import type { ObservabilityClientConfig, TraceParams, ScoreParams, IngestionEvent, FetchOptions, FetchResponse } from './types.js';
14
+ import { TraceClient } from './trace-client.js';
15
+ export declare abstract class ObservabilityCoreClient {
16
+ protected readonly publicKey: string;
17
+ protected readonly secretKey: string;
18
+ protected readonly baseUrl: string;
19
+ protected readonly flushAt: number;
20
+ protected readonly flushInterval: number;
21
+ protected readonly maxRetries: number;
22
+ protected readonly enabled: boolean;
23
+ protected readonly release: string | undefined;
24
+ protected readonly requestTimeout: number;
25
+ /** Buffered events waiting to be flushed. */
26
+ private _queue;
27
+ /** Periodic flush timer handle (platform-agnostic — both Node and browser return a value). */
28
+ private _flushTimer;
29
+ /** Guards against concurrent flushes stomping the queue. */
30
+ private _flushInProgress;
31
+ /** Pre-computed authorization header. */
32
+ private readonly _authHeader;
33
+ /** Logger — can be overridden by subclasses for platform-specific logging. */
34
+ protected logger: {
35
+ debug: (..._args: unknown[]) => void;
36
+ info: (..._args: unknown[]) => void;
37
+ warn: (...args: unknown[]) => void;
38
+ error: (...args: unknown[]) => void;
39
+ };
40
+ constructor(config: ObservabilityClientConfig);
41
+ /**
42
+ * Perform an HTTP fetch with retry logic.
43
+ *
44
+ * Subclasses implement this using their platform's HTTP client (e.g. `node:fetch`,
45
+ * `globalThis.fetch`, `undici`, etc.).
46
+ *
47
+ * @param url - Fully qualified URL to request.
48
+ * @param options - Method, headers, body, and optional AbortSignal.
49
+ * @returns A simplified response object.
50
+ */
51
+ protected abstract fetchWithRetry(url: string, options: FetchOptions): Promise<FetchResponse>;
52
+ /**
53
+ * Create (or upsert) a trace and return a handle for adding child observations.
54
+ *
55
+ * @param params - Trace parameters.
56
+ * @returns A TraceClient bound to this trace ID.
57
+ */
58
+ trace(params?: TraceParams): TraceClient;
59
+ /**
60
+ * Submit a standalone score (not attached via a TraceClient).
61
+ *
62
+ * @param params - Score parameters including the target traceId.
63
+ */
64
+ score(params: ScoreParams): void;
65
+ /**
66
+ * Add an event to the internal queue.
67
+ * Triggers an automatic flush when the queue reaches `flushAt`.
68
+ *
69
+ * @param event - The ingestion event to buffer.
70
+ */
71
+ enqueue(event: IngestionEvent): void;
72
+ /**
73
+ * Flush all buffered events to the server.
74
+ *
75
+ * Safe to call concurrently — only one flush runs at a time.
76
+ * Events queued during a flush are picked up on the next flush.
77
+ */
78
+ flush(): Promise<void>;
79
+ /**
80
+ * Flush remaining events and stop the periodic flush timer.
81
+ *
82
+ * Call this before process exit (Node.js) or page unload (browser) to
83
+ * ensure no events are lost.
84
+ */
85
+ shutdown(): Promise<void>;
86
+ /**
87
+ * Return the current event queue. Intended for testing.
88
+ */
89
+ getQueue(): ReadonlyArray<IngestionEvent>;
90
+ /**
91
+ * Send a batch of events to the ingestion endpoint with retry.
92
+ *
93
+ * Handles 207 Multi-Status responses by logging per-event errors.
94
+ */
95
+ private _sendBatch;
96
+ /**
97
+ * Platform-agnostic sleep helper.
98
+ */
99
+ private _sleep;
100
+ }
101
+ //# sourceMappingURL=core-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-client.d.ts","sourceRoot":"","sources":["../src/core-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,yBAAyB,EACzB,WAAW,EACX,WAAW,EACX,cAAc,EAGd,YAAY,EACZ,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,MAAM,mBA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B5B;;;;;OAKG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAU/B;;OAEG;IACH,QAAQ,IAAI,aAAa,CAAC,cAAc,CAAC;IAMzC;;;;OAIG;YACW,UAAU;IAsExB;;OAEG;IACH,OAAO,CAAC,MAAM;CAGf"}
@@ -0,0 +1,253 @@
1
+ /**
2
+ * Abstract base class for all observability clients.
3
+ *
4
+ * Platform-specific packages (Node.js, browser) extend this class and
5
+ * implement `fetchWithRetry` using the appropriate HTTP primitive.
6
+ *
7
+ * The core client owns:
8
+ * - Event batching and auto-flush logic
9
+ * - Auth header construction
10
+ * - Retry policy with exponential backoff
11
+ * - 207 Multi-Status response handling
12
+ */
13
+ import { IngestionEventType } from './types.js';
14
+ import { TraceClient } from './trace-client.js';
15
+ import { generateId, currentISOTimestamp, encodeBasicAuth, backoffDelay, defaultLogger, safeStringify, } from './utils.js';
16
+ // ---------------------------------------------------------------------------
17
+ // Default configuration values
18
+ // ---------------------------------------------------------------------------
19
+ const DEFAULT_BASE_URL = 'http://localhost:3000';
20
+ const DEFAULT_FLUSH_AT = 15;
21
+ const DEFAULT_FLUSH_INTERVAL_MS = 10_000;
22
+ const DEFAULT_MAX_RETRIES = 3;
23
+ const DEFAULT_REQUEST_TIMEOUT_MS = 10_000;
24
+ const SDK_NAME = '@illuma-ai/observability-core';
25
+ const SDK_VERSION = '0.1.0';
26
+ // ---------------------------------------------------------------------------
27
+ // Abstract core client
28
+ // ---------------------------------------------------------------------------
29
+ export class ObservabilityCoreClient {
30
+ // -- Configuration --------------------------------------------------------
31
+ publicKey;
32
+ secretKey;
33
+ baseUrl;
34
+ flushAt;
35
+ flushInterval;
36
+ maxRetries;
37
+ enabled;
38
+ release;
39
+ requestTimeout;
40
+ // -- Internal state -------------------------------------------------------
41
+ /** Buffered events waiting to be flushed. */
42
+ _queue = [];
43
+ /** Periodic flush timer handle (platform-agnostic — both Node and browser return a value). */
44
+ _flushTimer = null;
45
+ /** Guards against concurrent flushes stomping the queue. */
46
+ _flushInProgress = false;
47
+ /** Pre-computed authorization header. */
48
+ _authHeader;
49
+ /** Logger — can be overridden by subclasses for platform-specific logging. */
50
+ logger = defaultLogger;
51
+ // -- Constructor ----------------------------------------------------------
52
+ constructor(config) {
53
+ if (!config.publicKey || !config.secretKey) {
54
+ throw new Error('ObservabilityCoreClient: publicKey and secretKey are required.');
55
+ }
56
+ this.publicKey = config.publicKey;
57
+ this.secretKey = config.secretKey;
58
+ this.baseUrl = (config.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, '');
59
+ this.flushAt = config.flushAt ?? DEFAULT_FLUSH_AT;
60
+ this.flushInterval = config.flushInterval ?? DEFAULT_FLUSH_INTERVAL_MS;
61
+ this.maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;
62
+ this.enabled = config.enabled ?? true;
63
+ this.release = config.release;
64
+ this.requestTimeout = config.requestTimeout ?? DEFAULT_REQUEST_TIMEOUT_MS;
65
+ this._authHeader = encodeBasicAuth(this.publicKey, this.secretKey);
66
+ // Start periodic flush timer
67
+ if (this.enabled && this.flushInterval > 0) {
68
+ this._flushTimer = setInterval(() => {
69
+ void this.flush();
70
+ }, this.flushInterval);
71
+ // Allow Node.js to exit even if the timer is still alive
72
+ if (typeof this._flushTimer === 'object' && 'unref' in this._flushTimer) {
73
+ this._flushTimer.unref();
74
+ }
75
+ }
76
+ }
77
+ // -- Public API -----------------------------------------------------------
78
+ /**
79
+ * Create (or upsert) a trace and return a handle for adding child observations.
80
+ *
81
+ * @param params - Trace parameters.
82
+ * @returns A TraceClient bound to this trace ID.
83
+ */
84
+ trace(params) {
85
+ if (!this.enabled) {
86
+ // Return a no-op-safe client that still has the right shape
87
+ const traceId = params?.id ?? generateId();
88
+ return new TraceClient(traceId, () => { });
89
+ }
90
+ const traceId = params?.id ?? generateId();
91
+ const timestamp = params?.timestamp ?? currentISOTimestamp();
92
+ this.enqueue({
93
+ id: generateId(),
94
+ type: IngestionEventType.TRACE_CREATE,
95
+ timestamp: currentISOTimestamp(),
96
+ body: {
97
+ ...params,
98
+ id: traceId,
99
+ timestamp,
100
+ ...(this.release && !params?.version ? { version: this.release } : {}),
101
+ },
102
+ });
103
+ return new TraceClient(traceId, (event) => this.enqueue(event));
104
+ }
105
+ /**
106
+ * Submit a standalone score (not attached via a TraceClient).
107
+ *
108
+ * @param params - Score parameters including the target traceId.
109
+ */
110
+ score(params) {
111
+ if (!this.enabled)
112
+ return;
113
+ this.enqueue({
114
+ id: generateId(),
115
+ type: IngestionEventType.SCORE_CREATE,
116
+ timestamp: currentISOTimestamp(),
117
+ body: {
118
+ id: params.id ?? generateId(),
119
+ ...params,
120
+ },
121
+ });
122
+ }
123
+ /**
124
+ * Add an event to the internal queue.
125
+ * Triggers an automatic flush when the queue reaches `flushAt`.
126
+ *
127
+ * @param event - The ingestion event to buffer.
128
+ */
129
+ enqueue(event) {
130
+ if (!this.enabled)
131
+ return;
132
+ this._queue.push(event);
133
+ if (this._queue.length >= this.flushAt) {
134
+ void this.flush();
135
+ }
136
+ }
137
+ /**
138
+ * Flush all buffered events to the server.
139
+ *
140
+ * Safe to call concurrently — only one flush runs at a time.
141
+ * Events queued during a flush are picked up on the next flush.
142
+ */
143
+ async flush() {
144
+ if (!this.enabled)
145
+ return;
146
+ if (this._flushInProgress)
147
+ return;
148
+ if (this._queue.length === 0)
149
+ return;
150
+ this._flushInProgress = true;
151
+ // Snapshot and clear the queue atomically so new events go to a fresh array
152
+ const batch = this._queue;
153
+ this._queue = [];
154
+ try {
155
+ await this._sendBatch(batch);
156
+ }
157
+ catch (err) {
158
+ // Re-queue failed events so they can be retried on the next flush
159
+ this.logger.error('Flush failed, re-queuing events:', err);
160
+ this._queue = batch.concat(this._queue);
161
+ }
162
+ finally {
163
+ this._flushInProgress = false;
164
+ }
165
+ }
166
+ /**
167
+ * Flush remaining events and stop the periodic flush timer.
168
+ *
169
+ * Call this before process exit (Node.js) or page unload (browser) to
170
+ * ensure no events are lost.
171
+ */
172
+ async shutdown() {
173
+ if (this._flushTimer !== null) {
174
+ clearInterval(this._flushTimer);
175
+ this._flushTimer = null;
176
+ }
177
+ // Final flush
178
+ await this.flush();
179
+ }
180
+ /**
181
+ * Return the current event queue. Intended for testing.
182
+ */
183
+ getQueue() {
184
+ return this._queue;
185
+ }
186
+ // -- Internal -------------------------------------------------------------
187
+ /**
188
+ * Send a batch of events to the ingestion endpoint with retry.
189
+ *
190
+ * Handles 207 Multi-Status responses by logging per-event errors.
191
+ */
192
+ async _sendBatch(batch) {
193
+ const url = `${this.baseUrl}/api/public/ingestion`;
194
+ const requestBody = {
195
+ batch,
196
+ metadata: {
197
+ sdkName: SDK_NAME,
198
+ sdkVersion: SDK_VERSION,
199
+ publicKey: this.publicKey,
200
+ },
201
+ };
202
+ let lastError;
203
+ for (let attempt = 0; attempt <= this.maxRetries; attempt++) {
204
+ try {
205
+ const response = await this.fetchWithRetry(url, {
206
+ method: 'POST',
207
+ headers: {
208
+ 'Content-Type': 'application/json',
209
+ Authorization: this._authHeader,
210
+ },
211
+ body: safeStringify(requestBody),
212
+ });
213
+ // 207 Multi-Status — some events may have failed individually
214
+ if (response.status === 207) {
215
+ const result = (await response.json());
216
+ if (result.errors && result.errors.length > 0) {
217
+ this.logger.warn(`Ingestion batch partially failed: ${result.errors.length} error(s)`, result.errors);
218
+ }
219
+ return; // Batch accepted (even if some events had errors)
220
+ }
221
+ // 2xx — full success
222
+ if (response.ok) {
223
+ return;
224
+ }
225
+ // 4xx client errors (except 429) — retrying won't help
226
+ if (response.status >= 400 && response.status < 500 && response.status !== 429) {
227
+ const text = await response.text();
228
+ this.logger.error(`Ingestion batch rejected (${response.status}): ${text}`);
229
+ return; // Drop the batch — it won't succeed on retry
230
+ }
231
+ // 429 or 5xx — transient, will retry
232
+ lastError = new Error(`HTTP ${response.status}: ${response.statusText}`);
233
+ }
234
+ catch (err) {
235
+ lastError = err instanceof Error ? err : new Error(String(err));
236
+ }
237
+ // Wait before retrying (skip wait after last attempt)
238
+ if (attempt < this.maxRetries) {
239
+ const delay = backoffDelay(attempt);
240
+ await this._sleep(delay);
241
+ }
242
+ }
243
+ // All retries exhausted — throw so the caller can re-queue
244
+ throw lastError ?? new Error('Flush failed after retries');
245
+ }
246
+ /**
247
+ * Platform-agnostic sleep helper.
248
+ */
249
+ _sleep(ms) {
250
+ return new Promise((resolve) => setTimeout(resolve, ms));
251
+ }
252
+ }
253
+ //# sourceMappingURL=core-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-client.js","sourceRoot":"","sources":["../src/core-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,GACd,MAAM,YAAY,CAAC;AAEpB,8EAA8E;AAC9E,+BAA+B;AAC/B,8EAA8E;AAE9E,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AACjD,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,yBAAyB,GAAG,MAAM,CAAC;AACzC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAC1C,MAAM,QAAQ,GAAG,+BAA+B,CAAC;AACjD,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B,8EAA8E;AAC9E,uBAAuB;AACvB,8EAA8E;AAE9E,MAAM,OAAgB,uBAAuB;IAC3C,4EAA4E;IAEzD,SAAS,CAAS;IAClB,SAAS,CAAS;IAClB,OAAO,CAAS;IAChB,OAAO,CAAS;IAChB,aAAa,CAAS;IACtB,UAAU,CAAS;IACnB,OAAO,CAAU;IACjB,OAAO,CAAqB;IAC5B,cAAc,CAAS;IAE1C,4EAA4E;IAE5E,6CAA6C;IACrC,MAAM,GAAqB,EAAE,CAAC;IA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K,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC;QAED,2DAA2D;QAC3D,MAAM,SAAS,IAAI,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAC7D,CAAC;IAED;;OAEG;IACK,MAAM,CAAC,EAAU;QACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;CACF"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Client handle for an LLM generation observation.
3
+ *
4
+ * Returned by `TraceClient.generation()` or `SpanClient.generation()`.
5
+ * Allows scoring, ending, and updating the generation after creation.
6
+ */
7
+ import type { GenerationParams, IngestionEvent, ScoreParams } from './types.js';
8
+ export declare class GenerationClient {
9
+ /** Observation ID of this generation. */
10
+ readonly id: string;
11
+ /** Trace this generation belongs to. */
12
+ readonly traceId: string;
13
+ /** Enqueueing callback provided by the owning core client. */
14
+ private readonly _enqueue;
15
+ constructor(id: string, traceId: string, enqueue: (event: IngestionEvent) => void);
16
+ /**
17
+ * Update this generation with additional data (e.g. output, usage, endTime).
18
+ *
19
+ * @param params - Fields to merge into the existing generation.
20
+ * @returns This GenerationClient for chaining.
21
+ */
22
+ update(params: Partial<GenerationParams>): this;
23
+ /**
24
+ * Convenience method to mark this generation as complete.
25
+ * Sets `endTime` to now and merges any additional params.
26
+ *
27
+ * @param params - Optional fields to set on completion (output, usage, etc.).
28
+ * @returns This GenerationClient for chaining.
29
+ */
30
+ end(params?: Partial<GenerationParams>): this;
31
+ /**
32
+ * Attach a score to this generation.
33
+ *
34
+ * @param params - Score parameters. `traceId` and `observationId` are set automatically.
35
+ */
36
+ score(params: Omit<ScoreParams, 'traceId' | 'observationId'>): void;
37
+ }
38
+ //# sourceMappingURL=generation-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generation-client.d.ts","sourceRoot":"","sources":["../src/generation-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,WAAW,EACZ,MAAM,YAAY,CAAC;AAIpB,qBAAa,gBAAgB;IAC3B,yCAAyC;IACzC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,8DAA8D;IAC9D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;gBAGzD,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI;IAO1C;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAe/C;;;;;;OAMG;IACH,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAO7C;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,eAAe,CAAC,GAAG,IAAI;CAapE"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Client handle for an LLM generation observation.
3
+ *
4
+ * Returned by `TraceClient.generation()` or `SpanClient.generation()`.
5
+ * Allows scoring, ending, and updating the generation after creation.
6
+ */
7
+ import { IngestionEventType } from './types.js';
8
+ import { generateId, currentISOTimestamp } from './utils.js';
9
+ export class GenerationClient {
10
+ /** Observation ID of this generation. */
11
+ id;
12
+ /** Trace this generation belongs to. */
13
+ traceId;
14
+ /** Enqueueing callback provided by the owning core client. */
15
+ _enqueue;
16
+ constructor(id, traceId, enqueue) {
17
+ this.id = id;
18
+ this.traceId = traceId;
19
+ this._enqueue = enqueue;
20
+ }
21
+ /**
22
+ * Update this generation with additional data (e.g. output, usage, endTime).
23
+ *
24
+ * @param params - Fields to merge into the existing generation.
25
+ * @returns This GenerationClient for chaining.
26
+ */
27
+ update(params) {
28
+ this._enqueue({
29
+ id: generateId(),
30
+ type: IngestionEventType.GENERATION_UPDATE,
31
+ timestamp: currentISOTimestamp(),
32
+ body: {
33
+ id: this.id,
34
+ traceId: this.traceId,
35
+ ...params,
36
+ },
37
+ });
38
+ return this;
39
+ }
40
+ /**
41
+ * Convenience method to mark this generation as complete.
42
+ * Sets `endTime` to now and merges any additional params.
43
+ *
44
+ * @param params - Optional fields to set on completion (output, usage, etc.).
45
+ * @returns This GenerationClient for chaining.
46
+ */
47
+ end(params) {
48
+ return this.update({
49
+ ...params,
50
+ endTime: params?.endTime ?? currentISOTimestamp(),
51
+ });
52
+ }
53
+ /**
54
+ * Attach a score to this generation.
55
+ *
56
+ * @param params - Score parameters. `traceId` and `observationId` are set automatically.
57
+ */
58
+ score(params) {
59
+ this._enqueue({
60
+ id: generateId(),
61
+ type: IngestionEventType.SCORE_CREATE,
62
+ timestamp: currentISOTimestamp(),
63
+ body: {
64
+ id: params.id ?? generateId(),
65
+ traceId: this.traceId,
66
+ observationId: this.id,
67
+ ...params,
68
+ },
69
+ });
70
+ }
71
+ }
72
+ //# sourceMappingURL=generation-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generation-client.js","sourceRoot":"","sources":["../src/generation-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE7D,MAAM,OAAO,gBAAgB;IAC3B,yCAAyC;IAChC,EAAE,CAAS;IAEpB,wCAAwC;IAC/B,OAAO,CAAS;IAEzB,8DAA8D;IAC7C,QAAQ,CAAkC;IAE3D,YACE,EAAU,EACV,OAAe,EACf,OAAwC;QAExC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,MAAiC;QACtC,IAAI,CAAC,QAAQ,CAAC;YACZ,EAAE,EAAE,UAAU,EAAE;YAChB,IAAI,EAAE,kBAAkB,CAAC,iBAAiB;YAC1C,SAAS,EAAE,mBAAmB,EAAE;YAChC,IAAI,EAAE;gBACJ,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,GAAG,MAAM;aAC4B;SACxC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACH,GAAG,CAAC,MAAkC;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC;YACjB,GAAG,MAAM;YACT,OAAO,EAAE,MAAM,EAAE,OAAO,IAAI,mBAAmB,EAAE;SAClD,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAsD;QAC1D,IAAI,CAAC,QAAQ,CAAC;YACZ,EAAE,EAAE,UAAU,EAAE;YAChB,IAAI,EAAE,kBAAkB,CAAC,YAAY;YACrC,SAAS,EAAE,mBAAmB,EAAE;YAChC,IAAI,EAAE;gBACJ,EAAE,EAAE,MAAM,CAAC,EAAE,IAAI,UAAU,EAAE;gBAC7B,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,aAAa,EAAE,IAAI,CAAC,EAAE;gBACtB,GAAG,MAAM;aAC4B;SACxC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @illuma-ai/observability-core
3
+ *
4
+ * Shared foundation for Node.js and browser observability clients.
5
+ * This package provides:
6
+ * - All TypeScript types and interfaces for the observability system
7
+ * - Abstract `ObservabilityCoreClient` base class with batching, auth, and retry
8
+ * - Trace / Span / Generation / Event client handles
9
+ * - Utility functions (ID generation, timestamps, serialization)
10
+ *
11
+ * Platform-specific packages (`@illuma-ai/observability-node`,
12
+ * `@illuma-ai/observability-web`) extend `ObservabilityCoreClient` and
13
+ * implement the abstract `fetchWithRetry` method.
14
+ */
15
+ export { ObservationLevel, IngestionEventType, type ObservabilityClientConfig, type TraceParams, type GenerationParams, type SpanParams, type EventParams, type ScoreParams, type UsageParams, type UsageDetailsParams, type IngestionEvent, type IngestionBatchRequest, type IngestionBatchResponse, type IngestionEventResult, type FetchOptions, type FetchResponse, } from './types.js';
16
+ export { ObservabilityCoreClient } from './core-client.js';
17
+ export { TraceClient } from './trace-client.js';
18
+ export { SpanClient } from './span-client.js';
19
+ export { GenerationClient } from './generation-client.js';
20
+ export { generateId, currentISOTimestamp, safeStringify, encodeBasicAuth, backoffDelay, defaultLogger, } from './utils.js';
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,aAAa,GACd,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @illuma-ai/observability-core
3
+ *
4
+ * Shared foundation for Node.js and browser observability clients.
5
+ * This package provides:
6
+ * - All TypeScript types and interfaces for the observability system
7
+ * - Abstract `ObservabilityCoreClient` base class with batching, auth, and retry
8
+ * - Trace / Span / Generation / Event client handles
9
+ * - Utility functions (ID generation, timestamps, serialization)
10
+ *
11
+ * Platform-specific packages (`@illuma-ai/observability-node`,
12
+ * `@illuma-ai/observability-web`) extend `ObservabilityCoreClient` and
13
+ * implement the abstract `fetchWithRetry` method.
14
+ */
15
+ // Types & constants
16
+ export { ObservationLevel, IngestionEventType, } from './types.js';
17
+ // Abstract core client
18
+ export { ObservabilityCoreClient } from './core-client.js';
19
+ // Observation handle clients
20
+ export { TraceClient } from './trace-client.js';
21
+ export { SpanClient } from './span-client.js';
22
+ export { GenerationClient } from './generation-client.js';
23
+ // Utilities
24
+ export { generateId, currentISOTimestamp, safeStringify, encodeBasicAuth, backoffDelay, defaultLogger, } from './utils.js';
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,oBAAoB;AACpB,OAAO,EACL,gBAAgB,EAChB,kBAAkB,GAenB,MAAM,YAAY,CAAC;AAEpB,uBAAuB;AACvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,6BAA6B;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,YAAY;AACZ,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,aAAa,GACd,MAAM,YAAY,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Client handle for a span observation.
3
+ *
4
+ * Returned by `TraceClient.span()` or another `SpanClient.span()`.
5
+ * Supports nested span and generation creation, enabling arbitrarily deep
6
+ * observation trees.
7
+ */
8
+ import type { SpanParams, GenerationParams, EventParams, ScoreParams, IngestionEvent } from './types.js';
9
+ import { GenerationClient } from './generation-client.js';
10
+ export declare class SpanClient {
11
+ /** Observation ID of this span. */
12
+ readonly id: string;
13
+ /** Trace this span belongs to. */
14
+ readonly traceId: string;
15
+ /** Enqueueing callback provided by the owning core client. */
16
+ private readonly _enqueue;
17
+ constructor(id: string, traceId: string, enqueue: (event: IngestionEvent) => void);
18
+ /**
19
+ * Create a child span nested under this span.
20
+ *
21
+ * @param params - Span parameters. `traceId` and `parentObservationId` are set automatically.
22
+ * @returns A new SpanClient for the child span.
23
+ */
24
+ span(params?: Partial<SpanParams>): SpanClient;
25
+ /**
26
+ * Create an LLM generation observation nested under this span.
27
+ *
28
+ * @param params - Generation parameters. `traceId` and `parentObservationId` are set automatically.
29
+ * @returns A GenerationClient for the new generation.
30
+ */
31
+ generation(params?: Partial<GenerationParams>): GenerationClient;
32
+ /**
33
+ * Create a point-in-time event nested under this span.
34
+ *
35
+ * @param params - Event parameters. `traceId` and `parentObservationId` are set automatically.
36
+ */
37
+ event(params?: Partial<EventParams>): void;
38
+ /**
39
+ * Attach a score to this span.
40
+ *
41
+ * @param params - Score parameters. `traceId` and `observationId` are set automatically.
42
+ */
43
+ score(params: Omit<ScoreParams, 'traceId' | 'observationId'>): void;
44
+ /**
45
+ * Update this span with additional data.
46
+ *
47
+ * @param params - Fields to merge into the existing span.
48
+ * @returns This SpanClient for chaining.
49
+ */
50
+ update(params: Partial<SpanParams>): this;
51
+ /**
52
+ * Convenience method to mark this span as complete.
53
+ * Sets `endTime` to now and merges any additional params.
54
+ *
55
+ * @param params - Optional fields to set on completion (output, metadata, etc.).
56
+ * @returns This SpanClient for chaining.
57
+ */
58
+ end(params?: Partial<SpanParams>): this;
59
+ }
60
+ //# sourceMappingURL=span-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"span-client.d.ts","sourceRoot":"","sources":["../src/span-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,qBAAa,UAAU;IACrB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,kCAAkC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,8DAA8D;IAC9D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;gBAGzD,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI;IAO1C;;;;;OAKG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU;IAoB9C;;;;;OAKG;IACH,UAAU,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,gBAAgB;IAoBhE;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI;IAkB1C;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,eAAe,CAAC,GAAG,IAAI;IAcnE;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI;IAezC;;;;;;OAMG;IACH,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI;CAMxC"}