@lelemondev/sdk 0.4.0 → 0.5.1
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/README.md +438 -10
- package/dist/{express-Cmb_A4sI.d.mts → express-Dt5wT6_n.d.mts} +24 -4
- package/dist/{express-Cmb_A4sI.d.ts → express-Dt5wT6_n.d.ts} +24 -4
- package/dist/express.d.mts +1 -1
- package/dist/express.d.ts +1 -1
- package/dist/express.js.map +1 -1
- package/dist/express.mjs.map +1 -1
- package/dist/{hono-ChTmQk_V.d.mts → hono-Dzmu77iW.d.mts} +23 -4
- package/dist/{hono-ChTmQk_V.d.ts → hono-Dzmu77iW.d.ts} +23 -4
- package/dist/hono.d.mts +1 -1
- package/dist/hono.d.ts +1 -1
- package/dist/hono.js.map +1 -1
- package/dist/hono.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +949 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +949 -3
- package/dist/index.mjs.map +1 -1
- package/dist/integrations.d.mts +4 -4
- package/dist/integrations.d.ts +4 -4
- package/dist/integrations.js.map +1 -1
- package/dist/integrations.mjs.map +1 -1
- package/dist/{lambda-DQmEfWXC.d.mts → lambda-CAuiF9dH.d.mts} +7 -3
- package/dist/{lambda-DQmEfWXC.d.ts → lambda-CAuiF9dH.d.ts} +7 -3
- package/dist/lambda.d.mts +1 -1
- package/dist/lambda.d.ts +1 -1
- package/dist/lambda.js.map +1 -1
- package/dist/lambda.mjs.map +1 -1
- package/dist/{next-0nso_zEN.d.mts → next-BC9PmEho.d.mts} +8 -2
- package/dist/{next-0nso_zEN.d.ts → next-BC9PmEho.d.ts} +8 -2
- package/dist/next.d.mts +1 -1
- package/dist/next.d.ts +1 -1
- package/dist/next.js.map +1 -1
- package/dist/next.mjs.map +1 -1
- package/package.json +31 -8
|
@@ -11,10 +11,16 @@
|
|
|
11
11
|
* const app = new Hono();
|
|
12
12
|
* app.use(createMiddleware());
|
|
13
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* Execution context for edge runtimes (Cloudflare Workers, Deno Deploy)
|
|
16
|
+
*/
|
|
14
17
|
interface ExecutionContext {
|
|
15
18
|
waitUntil(promise: Promise<unknown>): void;
|
|
16
19
|
passThroughOnException(): void;
|
|
17
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Minimal Hono context type (avoids requiring hono as dependency)
|
|
23
|
+
*/
|
|
18
24
|
interface HonoContext {
|
|
19
25
|
req: {
|
|
20
26
|
raw: Request;
|
|
@@ -24,8 +30,17 @@ interface HonoContext {
|
|
|
24
30
|
executionCtx?: ExecutionContext;
|
|
25
31
|
[key: string]: unknown;
|
|
26
32
|
}
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Hono next function type
|
|
35
|
+
*/
|
|
36
|
+
type HonoNextFunction = () => Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Hono middleware function type
|
|
39
|
+
*
|
|
40
|
+
* @param c - Hono context object
|
|
41
|
+
* @param next - Next function to continue middleware chain
|
|
42
|
+
*/
|
|
43
|
+
type HonoMiddleware = (c: HonoContext, next: HonoNextFunction) => Promise<void>;
|
|
29
44
|
/**
|
|
30
45
|
* Create Hono middleware for automatic trace flushing
|
|
31
46
|
*
|
|
@@ -53,9 +68,13 @@ type HonoMiddleware = (c: HonoContext, next: NextFunction) => Promise<void>;
|
|
|
53
68
|
*/
|
|
54
69
|
declare function createMiddleware(): HonoMiddleware;
|
|
55
70
|
|
|
71
|
+
type hono_ExecutionContext = ExecutionContext;
|
|
72
|
+
type hono_HonoContext = HonoContext;
|
|
73
|
+
type hono_HonoMiddleware = HonoMiddleware;
|
|
74
|
+
type hono_HonoNextFunction = HonoNextFunction;
|
|
56
75
|
declare const hono_createMiddleware: typeof createMiddleware;
|
|
57
76
|
declare namespace hono {
|
|
58
|
-
export { hono_createMiddleware as createMiddleware };
|
|
77
|
+
export { type hono_ExecutionContext as ExecutionContext, type hono_HonoContext as HonoContext, type hono_HonoMiddleware as HonoMiddleware, type hono_HonoNextFunction as HonoNextFunction, hono_createMiddleware as createMiddleware };
|
|
59
78
|
}
|
|
60
79
|
|
|
61
|
-
export { createMiddleware as c, hono as h };
|
|
80
|
+
export { type ExecutionContext as E, type HonoContext as H, type HonoNextFunction as a, type HonoMiddleware as b, createMiddleware as c, hono as h };
|
|
@@ -11,10 +11,16 @@
|
|
|
11
11
|
* const app = new Hono();
|
|
12
12
|
* app.use(createMiddleware());
|
|
13
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* Execution context for edge runtimes (Cloudflare Workers, Deno Deploy)
|
|
16
|
+
*/
|
|
14
17
|
interface ExecutionContext {
|
|
15
18
|
waitUntil(promise: Promise<unknown>): void;
|
|
16
19
|
passThroughOnException(): void;
|
|
17
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Minimal Hono context type (avoids requiring hono as dependency)
|
|
23
|
+
*/
|
|
18
24
|
interface HonoContext {
|
|
19
25
|
req: {
|
|
20
26
|
raw: Request;
|
|
@@ -24,8 +30,17 @@ interface HonoContext {
|
|
|
24
30
|
executionCtx?: ExecutionContext;
|
|
25
31
|
[key: string]: unknown;
|
|
26
32
|
}
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Hono next function type
|
|
35
|
+
*/
|
|
36
|
+
type HonoNextFunction = () => Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Hono middleware function type
|
|
39
|
+
*
|
|
40
|
+
* @param c - Hono context object
|
|
41
|
+
* @param next - Next function to continue middleware chain
|
|
42
|
+
*/
|
|
43
|
+
type HonoMiddleware = (c: HonoContext, next: HonoNextFunction) => Promise<void>;
|
|
29
44
|
/**
|
|
30
45
|
* Create Hono middleware for automatic trace flushing
|
|
31
46
|
*
|
|
@@ -53,9 +68,13 @@ type HonoMiddleware = (c: HonoContext, next: NextFunction) => Promise<void>;
|
|
|
53
68
|
*/
|
|
54
69
|
declare function createMiddleware(): HonoMiddleware;
|
|
55
70
|
|
|
71
|
+
type hono_ExecutionContext = ExecutionContext;
|
|
72
|
+
type hono_HonoContext = HonoContext;
|
|
73
|
+
type hono_HonoMiddleware = HonoMiddleware;
|
|
74
|
+
type hono_HonoNextFunction = HonoNextFunction;
|
|
56
75
|
declare const hono_createMiddleware: typeof createMiddleware;
|
|
57
76
|
declare namespace hono {
|
|
58
|
-
export { hono_createMiddleware as createMiddleware };
|
|
77
|
+
export { type hono_ExecutionContext as ExecutionContext, type hono_HonoContext as HonoContext, type hono_HonoMiddleware as HonoMiddleware, type hono_HonoNextFunction as HonoNextFunction, hono_createMiddleware as createMiddleware };
|
|
59
78
|
}
|
|
60
79
|
|
|
61
|
-
export { createMiddleware as c, hono as h };
|
|
80
|
+
export { type ExecutionContext as E, type HonoContext as H, type HonoNextFunction as a, type HonoMiddleware as b, createMiddleware as c, hono as h };
|
package/dist/hono.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { c as createMiddleware } from './hono-
|
|
1
|
+
export { E as ExecutionContext, H as HonoContext, b as HonoMiddleware, a as HonoNextFunction, c as createMiddleware } from './hono-Dzmu77iW.mjs';
|
package/dist/hono.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { c as createMiddleware } from './hono-
|
|
1
|
+
export { E as ExecutionContext, H as HonoContext, b as HonoMiddleware, a as HonoNextFunction, c as createMiddleware } from './hono-Dzmu77iW.js';
|
package/dist/hono.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/config.ts","../src/integrations/hono.ts"],"names":[],"mappings":";;;;AAuEA,eAAsB,KAAA,GAAuB;AAI7C;;;
|
|
1
|
+
{"version":3,"sources":["../src/core/config.ts","../src/integrations/hono.ts"],"names":[],"mappings":";;;;AAuEA,eAAsB,KAAA,GAAuB;AAI7C;;;ACQO,SAAS,gBAAA,GAAmC;AACjD,EAAA,OAAO,OAAO,GAAG,IAAA,KAAS;AACxB,IAAA,MAAM,IAAA,EAAK;AAGX,IAAA,IAAI,CAAA,CAAE,cAAc,SAAA,EAAW;AAC7B,MAAA,CAAA,CAAE,YAAA,CAAa,SAAA,CAAU,KAAA,EAAO,CAAA;AAAA,IAClC,CAAA,MAAO;AAEL,MAAA,KAAA,EAAM,CAAE,MAAM,MAAM;AAAA,MAAC,CAAC,CAAA;AAAA,IACxB;AAAA,EACF,CAAA;AACF","file":"hono.js","sourcesContent":["/**\n * Global Configuration\n *\n * Manages SDK configuration and transport instance.\n */\n\nimport type { LelemonConfig } from './types';\nimport { Transport } from './transport';\n\n// ─────────────────────────────────────────────────────────────\n// Global State\n// ─────────────────────────────────────────────────────────────\n\nlet globalConfig: LelemonConfig = {};\nlet globalTransport: Transport | null = null;\nlet initialized = false;\n\n// ─────────────────────────────────────────────────────────────\n// Configuration\n// ─────────────────────────────────────────────────────────────\n\nconst DEFAULT_ENDPOINT = 'https://lelemon.dev';\n\n/**\n * Initialize the SDK\n * Call once at app startup\n */\nexport function init(config: LelemonConfig = {}): void {\n globalConfig = config;\n globalTransport = createTransport(config);\n initialized = true;\n}\n\n/**\n * Get current config\n */\nexport function getConfig(): LelemonConfig {\n return globalConfig;\n}\n\n/**\n * Check if SDK is initialized\n */\nexport function isInitialized(): boolean {\n return initialized;\n}\n\n/**\n * Check if SDK is enabled\n */\nexport function isEnabled(): boolean {\n return getTransport().isEnabled();\n}\n\n// ─────────────────────────────────────────────────────────────\n// Transport\n// ─────────────────────────────────────────────────────────────\n\n/**\n * Get or create transport instance\n */\nexport function getTransport(): Transport {\n if (!globalTransport) {\n globalTransport = createTransport(globalConfig);\n }\n return globalTransport;\n}\n\n/**\n * Flush all pending traces\n */\nexport async function flush(): Promise<void> {\n if (globalTransport) {\n await globalTransport.flush();\n }\n}\n\n/**\n * Create transport instance\n */\nfunction createTransport(config: LelemonConfig): Transport {\n const apiKey = config.apiKey ?? getEnvVar('LELEMON_API_KEY');\n\n if (!apiKey && !config.disabled) {\n console.warn(\n '[Lelemon] No API key provided. Set apiKey in init() or LELEMON_API_KEY env var. Tracing disabled.'\n );\n }\n\n return new Transport({\n apiKey: apiKey ?? '',\n endpoint: config.endpoint ?? DEFAULT_ENDPOINT,\n debug: config.debug ?? false,\n disabled: config.disabled ?? !apiKey,\n batchSize: config.batchSize,\n flushIntervalMs: config.flushIntervalMs,\n requestTimeoutMs: config.requestTimeoutMs,\n });\n}\n\n/**\n * Get environment variable (works in Node and edge)\n */\nfunction getEnvVar(name: string): string | undefined {\n if (typeof process !== 'undefined' && process.env) {\n return process.env[name];\n }\n return undefined;\n}\n","/**\n * Hono Integration\n *\n * Middleware for Hono framework (Cloudflare Workers, Deno, Bun, Node.js).\n * Uses executionCtx.waitUntil() when available for non-blocking flush.\n *\n * @example\n * import { Hono } from 'hono';\n * import { createMiddleware } from '@lelemondev/sdk/hono';\n *\n * const app = new Hono();\n * app.use(createMiddleware());\n */\n\nimport { flush } from '../core/config';\n\n// ─────────────────────────────────────────────────────────────\n// Types (minimal to avoid requiring hono as dependency)\n// ─────────────────────────────────────────────────────────────\n\n/**\n * Execution context for edge runtimes (Cloudflare Workers, Deno Deploy)\n */\nexport interface ExecutionContext {\n waitUntil(promise: Promise<unknown>): void;\n passThroughOnException(): void;\n}\n\n/**\n * Minimal Hono context type (avoids requiring hono as dependency)\n */\nexport interface HonoContext {\n req: {\n raw: Request;\n [key: string]: unknown;\n };\n res: Response | undefined;\n executionCtx?: ExecutionContext;\n [key: string]: unknown;\n}\n\n/**\n * Hono next function type\n */\nexport type HonoNextFunction = () => Promise<void>;\n\n/**\n * Hono middleware function type\n *\n * @param c - Hono context object\n * @param next - Next function to continue middleware chain\n */\nexport type HonoMiddleware = (c: HonoContext, next: HonoNextFunction) => Promise<void>;\n\n// ─────────────────────────────────────────────────────────────\n// Middleware\n// ─────────────────────────────────────────────────────────────\n\n/**\n * Create Hono middleware for automatic trace flushing\n *\n * On Cloudflare Workers/Deno Deploy: uses executionCtx.waitUntil() for non-blocking flush\n * On Node.js/Bun: flushes after response (fire-and-forget)\n *\n * @returns Hono middleware function\n *\n * @example\n * import { Hono } from 'hono';\n * import { createMiddleware } from '@lelemondev/sdk/hono';\n *\n * const app = new Hono();\n *\n * // Global middleware\n * app.use(createMiddleware());\n *\n * app.post('/chat', async (c) => {\n * const openai = observe(new OpenAI());\n * const result = await openai.chat.completions.create({...});\n * return c.json(result);\n * });\n *\n * export default app;\n */\nexport function createMiddleware(): HonoMiddleware {\n return async (c, next) => {\n await next();\n\n // Use waitUntil if available (Cloudflare Workers, Deno Deploy)\n if (c.executionCtx?.waitUntil) {\n c.executionCtx.waitUntil(flush());\n } else {\n // Fire-and-forget for Node.js/Bun\n flush().catch(() => {});\n }\n };\n}\n"]}
|
package/dist/hono.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/config.ts","../src/integrations/hono.ts"],"names":[],"mappings":";;AAuEA,eAAsB,KAAA,GAAuB;AAI7C;;;
|
|
1
|
+
{"version":3,"sources":["../src/core/config.ts","../src/integrations/hono.ts"],"names":[],"mappings":";;AAuEA,eAAsB,KAAA,GAAuB;AAI7C;;;ACQO,SAAS,gBAAA,GAAmC;AACjD,EAAA,OAAO,OAAO,GAAG,IAAA,KAAS;AACxB,IAAA,MAAM,IAAA,EAAK;AAGX,IAAA,IAAI,CAAA,CAAE,cAAc,SAAA,EAAW;AAC7B,MAAA,CAAA,CAAE,YAAA,CAAa,SAAA,CAAU,KAAA,EAAO,CAAA;AAAA,IAClC,CAAA,MAAO;AAEL,MAAA,KAAA,EAAM,CAAE,MAAM,MAAM;AAAA,MAAC,CAAC,CAAA;AAAA,IACxB;AAAA,EACF,CAAA;AACF","file":"hono.mjs","sourcesContent":["/**\n * Global Configuration\n *\n * Manages SDK configuration and transport instance.\n */\n\nimport type { LelemonConfig } from './types';\nimport { Transport } from './transport';\n\n// ─────────────────────────────────────────────────────────────\n// Global State\n// ─────────────────────────────────────────────────────────────\n\nlet globalConfig: LelemonConfig = {};\nlet globalTransport: Transport | null = null;\nlet initialized = false;\n\n// ─────────────────────────────────────────────────────────────\n// Configuration\n// ─────────────────────────────────────────────────────────────\n\nconst DEFAULT_ENDPOINT = 'https://lelemon.dev';\n\n/**\n * Initialize the SDK\n * Call once at app startup\n */\nexport function init(config: LelemonConfig = {}): void {\n globalConfig = config;\n globalTransport = createTransport(config);\n initialized = true;\n}\n\n/**\n * Get current config\n */\nexport function getConfig(): LelemonConfig {\n return globalConfig;\n}\n\n/**\n * Check if SDK is initialized\n */\nexport function isInitialized(): boolean {\n return initialized;\n}\n\n/**\n * Check if SDK is enabled\n */\nexport function isEnabled(): boolean {\n return getTransport().isEnabled();\n}\n\n// ─────────────────────────────────────────────────────────────\n// Transport\n// ─────────────────────────────────────────────────────────────\n\n/**\n * Get or create transport instance\n */\nexport function getTransport(): Transport {\n if (!globalTransport) {\n globalTransport = createTransport(globalConfig);\n }\n return globalTransport;\n}\n\n/**\n * Flush all pending traces\n */\nexport async function flush(): Promise<void> {\n if (globalTransport) {\n await globalTransport.flush();\n }\n}\n\n/**\n * Create transport instance\n */\nfunction createTransport(config: LelemonConfig): Transport {\n const apiKey = config.apiKey ?? getEnvVar('LELEMON_API_KEY');\n\n if (!apiKey && !config.disabled) {\n console.warn(\n '[Lelemon] No API key provided. Set apiKey in init() or LELEMON_API_KEY env var. Tracing disabled.'\n );\n }\n\n return new Transport({\n apiKey: apiKey ?? '',\n endpoint: config.endpoint ?? DEFAULT_ENDPOINT,\n debug: config.debug ?? false,\n disabled: config.disabled ?? !apiKey,\n batchSize: config.batchSize,\n flushIntervalMs: config.flushIntervalMs,\n requestTimeoutMs: config.requestTimeoutMs,\n });\n}\n\n/**\n * Get environment variable (works in Node and edge)\n */\nfunction getEnvVar(name: string): string | undefined {\n if (typeof process !== 'undefined' && process.env) {\n return process.env[name];\n }\n return undefined;\n}\n","/**\n * Hono Integration\n *\n * Middleware for Hono framework (Cloudflare Workers, Deno, Bun, Node.js).\n * Uses executionCtx.waitUntil() when available for non-blocking flush.\n *\n * @example\n * import { Hono } from 'hono';\n * import { createMiddleware } from '@lelemondev/sdk/hono';\n *\n * const app = new Hono();\n * app.use(createMiddleware());\n */\n\nimport { flush } from '../core/config';\n\n// ─────────────────────────────────────────────────────────────\n// Types (minimal to avoid requiring hono as dependency)\n// ─────────────────────────────────────────────────────────────\n\n/**\n * Execution context for edge runtimes (Cloudflare Workers, Deno Deploy)\n */\nexport interface ExecutionContext {\n waitUntil(promise: Promise<unknown>): void;\n passThroughOnException(): void;\n}\n\n/**\n * Minimal Hono context type (avoids requiring hono as dependency)\n */\nexport interface HonoContext {\n req: {\n raw: Request;\n [key: string]: unknown;\n };\n res: Response | undefined;\n executionCtx?: ExecutionContext;\n [key: string]: unknown;\n}\n\n/**\n * Hono next function type\n */\nexport type HonoNextFunction = () => Promise<void>;\n\n/**\n * Hono middleware function type\n *\n * @param c - Hono context object\n * @param next - Next function to continue middleware chain\n */\nexport type HonoMiddleware = (c: HonoContext, next: HonoNextFunction) => Promise<void>;\n\n// ─────────────────────────────────────────────────────────────\n// Middleware\n// ─────────────────────────────────────────────────────────────\n\n/**\n * Create Hono middleware for automatic trace flushing\n *\n * On Cloudflare Workers/Deno Deploy: uses executionCtx.waitUntil() for non-blocking flush\n * On Node.js/Bun: flushes after response (fire-and-forget)\n *\n * @returns Hono middleware function\n *\n * @example\n * import { Hono } from 'hono';\n * import { createMiddleware } from '@lelemondev/sdk/hono';\n *\n * const app = new Hono();\n *\n * // Global middleware\n * app.use(createMiddleware());\n *\n * app.post('/chat', async (c) => {\n * const openai = observe(new OpenAI());\n * const result = await openai.chat.completions.create({...});\n * return c.json(result);\n * });\n *\n * export default app;\n */\nexport function createMiddleware(): HonoMiddleware {\n return async (c, next) => {\n await next();\n\n // Use waitUntil if available (Cloudflare Workers, Deno Deploy)\n if (c.executionCtx?.waitUntil) {\n c.executionCtx.waitUntil(flush());\n } else {\n // Fire-and-forget for Node.js/Bun\n flush().catch(() => {});\n }\n };\n}\n"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
interface LelemonConfig {
|
|
5
5
|
/** API key (or set LELEMON_API_KEY env var) */
|
|
6
6
|
apiKey?: string;
|
|
7
|
-
/** API endpoint (default: https://
|
|
7
|
+
/** API endpoint (default: https://lelemon.dev) */
|
|
8
8
|
endpoint?: string;
|
|
9
9
|
/** Enable debug logging */
|
|
10
10
|
debug?: boolean;
|
|
@@ -17,7 +17,7 @@ interface LelemonConfig {
|
|
|
17
17
|
/** Request timeout in ms (default: 10000) */
|
|
18
18
|
requestTimeoutMs?: number;
|
|
19
19
|
}
|
|
20
|
-
type ProviderName = 'openai' | 'anthropic' | '
|
|
20
|
+
type ProviderName = 'openai' | 'anthropic' | 'gemini' | 'bedrock' | 'openrouter' | 'unknown';
|
|
21
21
|
interface ObserveOptions {
|
|
22
22
|
/** Session ID to group related calls */
|
|
23
23
|
sessionId?: string;
|
|
@@ -58,7 +58,7 @@ declare function flush(): Promise<void>;
|
|
|
58
58
|
/**
|
|
59
59
|
* Wrap an LLM client with automatic tracing
|
|
60
60
|
*
|
|
61
|
-
* @param client - OpenAI or
|
|
61
|
+
* @param client - OpenAI, Anthropic, or Bedrock client instance
|
|
62
62
|
* @param options - Optional context (sessionId, userId, etc.)
|
|
63
63
|
* @returns The wrapped client with the same type
|
|
64
64
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
interface LelemonConfig {
|
|
5
5
|
/** API key (or set LELEMON_API_KEY env var) */
|
|
6
6
|
apiKey?: string;
|
|
7
|
-
/** API endpoint (default: https://
|
|
7
|
+
/** API endpoint (default: https://lelemon.dev) */
|
|
8
8
|
endpoint?: string;
|
|
9
9
|
/** Enable debug logging */
|
|
10
10
|
debug?: boolean;
|
|
@@ -17,7 +17,7 @@ interface LelemonConfig {
|
|
|
17
17
|
/** Request timeout in ms (default: 10000) */
|
|
18
18
|
requestTimeoutMs?: number;
|
|
19
19
|
}
|
|
20
|
-
type ProviderName = 'openai' | 'anthropic' | '
|
|
20
|
+
type ProviderName = 'openai' | 'anthropic' | 'gemini' | 'bedrock' | 'openrouter' | 'unknown';
|
|
21
21
|
interface ObserveOptions {
|
|
22
22
|
/** Session ID to group related calls */
|
|
23
23
|
sessionId?: string;
|
|
@@ -58,7 +58,7 @@ declare function flush(): Promise<void>;
|
|
|
58
58
|
/**
|
|
59
59
|
* Wrap an LLM client with automatic tracing
|
|
60
60
|
*
|
|
61
|
-
* @param client - OpenAI or
|
|
61
|
+
* @param client - OpenAI, Anthropic, or Bedrock client instance
|
|
62
62
|
* @param options - Optional context (sessionId, userId, etc.)
|
|
63
63
|
* @returns The wrapped client with the same type
|
|
64
64
|
*
|