@zespan/sdk 1.0.0 → 1.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.
package/README.md CHANGED
@@ -18,7 +18,7 @@ pnpm add @zespan/sdk
18
18
  import { init } from "@zespan/sdk";
19
19
 
20
20
  init({
21
- apiKey: "lqt_your_key_here",
21
+ apiKey: "zsp_your_key_here",
22
22
  projectId: "your_project_id",
23
23
  });
24
24
  ```
@@ -35,7 +35,7 @@ By default, `init()` patches OpenAI, Anthropic, and Google GenAI as soon as they
35
35
  import { init } from "@zespan/sdk";
36
36
  import OpenAI from "openai";
37
37
 
38
- init({ apiKey: "lqt_...", projectId: "proj_..." });
38
+ init({ apiKey: "zsp_...", projectId: "proj_..." });
39
39
 
40
40
  const openai = new OpenAI();
41
41
  // This call is automatically traced
@@ -48,7 +48,7 @@ const response = await openai.chat.completions.create({
48
48
  To disable autopatch and wrap manually:
49
49
 
50
50
  ```ts
51
- init({ apiKey: "lqt_...", autopatch: false });
51
+ init({ apiKey: "zsp_...", autopatch: false });
52
52
  ```
53
53
 
54
54
  ## Manual wrappers
@@ -61,7 +61,7 @@ import OpenAI from "openai";
61
61
  import Anthropic from "@anthropic-ai/sdk";
62
62
  import { GoogleGenerativeAI } from "@google/generative-ai";
63
63
 
64
- init({ apiKey: "lqt_...", autopatch: false });
64
+ init({ apiKey: "zsp_...", autopatch: false });
65
65
 
66
66
  const openai = wrapOpenAI(new OpenAI());
67
67
  const anthropic = wrapAnthropic(new Anthropic());
@@ -85,7 +85,7 @@ const google = wrapGoogle(new GoogleGenerativeAI(process.env.GOOGLE_API_KEY!));
85
85
 
86
86
  ```ts
87
87
  init({
88
- apiKey: "lqt_...", // required
88
+ apiKey: "zsp_...", // required
89
89
  projectId: "proj_...", // required — links traces to a project
90
90
  environment: "production", // default: "production"
91
91
  storePrompts: false, // store prompt/completion text (default: false)
@@ -315,7 +315,7 @@ Enable native OTEL export alongside Zespan:
315
315
 
316
316
  ```ts
317
317
  init({
318
- apiKey: "lqt_...",
318
+ apiKey: "zsp_...",
319
319
  enableOTel: true,
320
320
  otelEndpoint: "http://localhost:4318",
321
321
  otelServiceName: "my-service",
package/dist/index.d.mts CHANGED
@@ -343,7 +343,7 @@ declare class ZespanADKCallbackHandler {
343
343
  private getParentAgentState;
344
344
  beforeAgentCallback: (context: any) => undefined;
345
345
  afterAgentCallback: (context: any) => undefined;
346
- beforeModelCallback: ({ context, request: _request }: any) => undefined;
346
+ beforeModelCallback: ({ context, request }: any) => undefined;
347
347
  afterModelCallback: ({ context, response }: any) => undefined;
348
348
  beforeToolCallback: ({ tool, args, context }: any) => undefined;
349
349
  afterToolCallback: ({ tool: _tool, args: _args, context, response }: any) => undefined;
@@ -351,7 +351,7 @@ declare class ZespanADKCallbackHandler {
351
351
  get callbacks(): {
352
352
  beforeAgentCallback: (context: any) => undefined;
353
353
  afterAgentCallback: (context: any) => undefined;
354
- beforeModelCallback: ({ context, request: _request }: any) => undefined;
354
+ beforeModelCallback: ({ context, request }: any) => undefined;
355
355
  afterModelCallback: ({ context, response }: any) => undefined;
356
356
  beforeToolCallback: ({ tool, args, context }: any) => undefined;
357
357
  afterToolCallback: ({ tool: _tool, args: _args, context, response }: any) => undefined;
@@ -506,30 +506,14 @@ declare function injectAgentContext(headers: Record<string, string>, delegationR
506
506
  */
507
507
  declare function extractAgentContext(headers: Record<string, string>): Context;
508
508
 
509
- /**
510
- * CrewAI context bridge for Zespan.
511
- *
512
- * Python-side: use openinference-instrumentation-crewai (PyPI).
513
- * When a CrewAI agent makes an HTTP call to a Node.js service,
514
- * the downstream service uses extractAgentContext() to continue the trace.
515
- *
516
- * Usage in the receiving Node.js service:
517
- * import { extractAgentContext } from '@zespan/sdk';
518
- * const ctx = extractAgentContext(req.headers);
519
- * const span = tracer.startSpan('invoke_agent SubAgent', undefined, ctx);
520
- */
521
509
  declare const CREWAI_OTEL_ENV: {
522
510
  readonly OTEL_EXPORTER_OTLP_ENDPOINT: "http://localhost:4318";
523
511
  readonly OTEL_SERVICE_NAME: "crewai-agent";
524
512
  };
525
- /**
526
- * Configuration guide for CrewAI Python instrumentation.
527
- */
528
513
  declare function getCrewAIInstrumentationGuide(): string;
529
514
 
530
515
  /**
531
516
  * Attach trace context to an AutoGen message payload.
532
- * Call before sending a message to another AutoGen agent over HTTP.
533
517
  */
534
518
  declare function attachTraceToAutoGenMessage<T extends Record<string, unknown>>(message: T, delegationReason?: string): T & {
535
519
  _lumiq_trace: Record<string, string>;
package/dist/index.d.ts CHANGED
@@ -343,7 +343,7 @@ declare class ZespanADKCallbackHandler {
343
343
  private getParentAgentState;
344
344
  beforeAgentCallback: (context: any) => undefined;
345
345
  afterAgentCallback: (context: any) => undefined;
346
- beforeModelCallback: ({ context, request: _request }: any) => undefined;
346
+ beforeModelCallback: ({ context, request }: any) => undefined;
347
347
  afterModelCallback: ({ context, response }: any) => undefined;
348
348
  beforeToolCallback: ({ tool, args, context }: any) => undefined;
349
349
  afterToolCallback: ({ tool: _tool, args: _args, context, response }: any) => undefined;
@@ -351,7 +351,7 @@ declare class ZespanADKCallbackHandler {
351
351
  get callbacks(): {
352
352
  beforeAgentCallback: (context: any) => undefined;
353
353
  afterAgentCallback: (context: any) => undefined;
354
- beforeModelCallback: ({ context, request: _request }: any) => undefined;
354
+ beforeModelCallback: ({ context, request }: any) => undefined;
355
355
  afterModelCallback: ({ context, response }: any) => undefined;
356
356
  beforeToolCallback: ({ tool, args, context }: any) => undefined;
357
357
  afterToolCallback: ({ tool: _tool, args: _args, context, response }: any) => undefined;
@@ -506,30 +506,14 @@ declare function injectAgentContext(headers: Record<string, string>, delegationR
506
506
  */
507
507
  declare function extractAgentContext(headers: Record<string, string>): Context;
508
508
 
509
- /**
510
- * CrewAI context bridge for Zespan.
511
- *
512
- * Python-side: use openinference-instrumentation-crewai (PyPI).
513
- * When a CrewAI agent makes an HTTP call to a Node.js service,
514
- * the downstream service uses extractAgentContext() to continue the trace.
515
- *
516
- * Usage in the receiving Node.js service:
517
- * import { extractAgentContext } from '@zespan/sdk';
518
- * const ctx = extractAgentContext(req.headers);
519
- * const span = tracer.startSpan('invoke_agent SubAgent', undefined, ctx);
520
- */
521
509
  declare const CREWAI_OTEL_ENV: {
522
510
  readonly OTEL_EXPORTER_OTLP_ENDPOINT: "http://localhost:4318";
523
511
  readonly OTEL_SERVICE_NAME: "crewai-agent";
524
512
  };
525
- /**
526
- * Configuration guide for CrewAI Python instrumentation.
527
- */
528
513
  declare function getCrewAIInstrumentationGuide(): string;
529
514
 
530
515
  /**
531
516
  * Attach trace context to an AutoGen message payload.
532
- * Call before sending a message to another AutoGen agent over HTTP.
533
517
  */
534
518
  declare function attachTraceToAutoGenMessage<T extends Record<string, unknown>>(message: T, delegationReason?: string): T & {
535
519
  _lumiq_trace: Record<string, string>;