@zespan/sdk 1.0.1 → 1.2.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.mts +8 -29
- package/dist/index.d.ts +8 -29
- package/dist/index.js +12 -8
- package/dist/index.mjs +12 -8
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -272,9 +272,7 @@ declare class ZespanClient {
|
|
|
272
272
|
}
|
|
273
273
|
declare const initZespan: (o: ZespanOptions) => void;
|
|
274
274
|
declare const getZespanClient: () => ZespanClient;
|
|
275
|
-
|
|
276
275
|
declare const init: (o: ZespanOptions) => void;
|
|
277
|
-
declare const getLumiqClient: () => ZespanClient;
|
|
278
276
|
|
|
279
277
|
declare function wrapOpenAI<T extends any>(client: T, options?: WrapperGuardrailsOptions): T;
|
|
280
278
|
|
|
@@ -333,7 +331,6 @@ declare class ZespanCallbackHandler extends BaseCallbackHandler {
|
|
|
333
331
|
handleRetrieverEnd(documents: any[], runId: string): Promise<void>;
|
|
334
332
|
handleRetrieverError(err: any, runId: string): Promise<void>;
|
|
335
333
|
}
|
|
336
|
-
declare const LumiqCallbackHandler: typeof ZespanCallbackHandler;
|
|
337
334
|
|
|
338
335
|
declare class ZespanADKCallbackHandler {
|
|
339
336
|
private agentStates;
|
|
@@ -343,7 +340,7 @@ declare class ZespanADKCallbackHandler {
|
|
|
343
340
|
private getParentAgentState;
|
|
344
341
|
beforeAgentCallback: (context: any) => undefined;
|
|
345
342
|
afterAgentCallback: (context: any) => undefined;
|
|
346
|
-
beforeModelCallback: ({ context, request
|
|
343
|
+
beforeModelCallback: ({ context, request }: any) => undefined;
|
|
347
344
|
afterModelCallback: ({ context, response }: any) => undefined;
|
|
348
345
|
beforeToolCallback: ({ tool, args, context }: any) => undefined;
|
|
349
346
|
afterToolCallback: ({ tool: _tool, args: _args, context, response }: any) => undefined;
|
|
@@ -351,7 +348,7 @@ declare class ZespanADKCallbackHandler {
|
|
|
351
348
|
get callbacks(): {
|
|
352
349
|
beforeAgentCallback: (context: any) => undefined;
|
|
353
350
|
afterAgentCallback: (context: any) => undefined;
|
|
354
|
-
beforeModelCallback: ({ context, request
|
|
351
|
+
beforeModelCallback: ({ context, request }: any) => undefined;
|
|
355
352
|
afterModelCallback: ({ context, response }: any) => undefined;
|
|
356
353
|
beforeToolCallback: ({ tool, args, context }: any) => undefined;
|
|
357
354
|
afterToolCallback: ({ tool: _tool, args: _args, context, response }: any) => undefined;
|
|
@@ -398,9 +395,9 @@ declare function instrumentVercelAI(): {
|
|
|
398
395
|
tracer: Tracer;
|
|
399
396
|
telemetry: TelemetrySettings;
|
|
400
397
|
};
|
|
401
|
-
declare function
|
|
398
|
+
declare function getZespanVercelTelemetry(): TelemetrySettings;
|
|
402
399
|
|
|
403
|
-
declare class
|
|
400
|
+
declare class ZespanLlamaIndexHandler {
|
|
404
401
|
private runs;
|
|
405
402
|
private guardrailSettings;
|
|
406
403
|
constructor(options?: WrapperGuardrailsOptions);
|
|
@@ -447,8 +444,6 @@ interface ZespanContextOptions {
|
|
|
447
444
|
declare function withZespanContext<T>(options: ZespanContextOptions, fn: () => T | Promise<T>): T | Promise<T>;
|
|
448
445
|
declare function withZespanTrace<T>(fn: () => T | Promise<T>, options?: ZespanContextOptions): T | Promise<T>;
|
|
449
446
|
declare const withZespan: typeof withZespanTrace;
|
|
450
|
-
type LumiqContextOptions = ZespanContextOptions;
|
|
451
|
-
declare const withLumiqContext: typeof withZespanContext;
|
|
452
447
|
|
|
453
448
|
interface AgentOptions {
|
|
454
449
|
name: string;
|
|
@@ -506,33 +501,17 @@ declare function injectAgentContext(headers: Record<string, string>, delegationR
|
|
|
506
501
|
*/
|
|
507
502
|
declare function extractAgentContext(headers: Record<string, string>): Context;
|
|
508
503
|
|
|
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
504
|
declare const CREWAI_OTEL_ENV: {
|
|
522
505
|
readonly OTEL_EXPORTER_OTLP_ENDPOINT: "http://localhost:4318";
|
|
523
506
|
readonly OTEL_SERVICE_NAME: "crewai-agent";
|
|
524
507
|
};
|
|
525
|
-
/**
|
|
526
|
-
* Configuration guide for CrewAI Python instrumentation.
|
|
527
|
-
*/
|
|
528
508
|
declare function getCrewAIInstrumentationGuide(): string;
|
|
529
509
|
|
|
530
510
|
/**
|
|
531
511
|
* Attach trace context to an AutoGen message payload.
|
|
532
|
-
* Call before sending a message to another AutoGen agent over HTTP.
|
|
533
512
|
*/
|
|
534
513
|
declare function attachTraceToAutoGenMessage<T extends Record<string, unknown>>(message: T, delegationReason?: string): T & {
|
|
535
|
-
|
|
514
|
+
_zespan_trace: Record<string, string>;
|
|
536
515
|
};
|
|
537
516
|
/**
|
|
538
517
|
* Extract trace context from an incoming AutoGen message.
|
|
@@ -581,8 +560,8 @@ declare const zespan: {
|
|
|
581
560
|
markFrameworkActive: typeof markFrameworkActive;
|
|
582
561
|
markFrameworkInactive: typeof markFrameworkInactive;
|
|
583
562
|
instrumentVercelAI: typeof instrumentVercelAI;
|
|
584
|
-
|
|
585
|
-
|
|
563
|
+
getZespanVercelTelemetry: typeof getZespanVercelTelemetry;
|
|
564
|
+
ZespanLlamaIndexHandler: typeof ZespanLlamaIndexHandler;
|
|
586
565
|
};
|
|
587
566
|
|
|
588
|
-
export { type ADKAgentOptions, type ADKRunnerOptions, AgentContext, type AgentOptions, BaggageSpanProcessor, CREWAI_OTEL_ENV, GuardrailBlockedError, type GuardrailCheckInput, type GuardrailCheckResponse, type GuardrailResult, type InstrumentADKOptions,
|
|
567
|
+
export { type ADKAgentOptions, type ADKRunnerOptions, AgentContext, type AgentOptions, BaggageSpanProcessor, CREWAI_OTEL_ENV, GuardrailBlockedError, type GuardrailCheckInput, type GuardrailCheckResponse, type GuardrailResult, type InstrumentADKOptions, type OTelConfig, type Prompt, PromptClient, type PromptOptions, type ResolvedWrapperGuardrailsSettings, type WrapperGuardrailsOptions, type WrapperGuardrailsSettings, ZespanADKCallbackHandler, ZespanCallbackHandler, ZespanClient, type ZespanContextOptions, ZespanLlamaIndexHandler, attachTraceToAutoGenMessage, autopatch, createSpan, extractAgentContext, extractAgentContext as extractAutoGenContext, extractTraceFromAutoGenMessage, getCrewAIInstrumentationGuide, getPydanticAIConfig, getTracer, getZespanClient, getZespanVercelTelemetry, init, initOTel, initZespan, injectAgentContext, injectAgentContext as injectAutoGenContext, instrumentADK, instrumentVercelAI, markFrameworkActive, markFrameworkInactive, startSpan, withAgent, withSpan, withZespan, withZespanContext, withZespanTrace, wrapADKAgent, wrapADKRunner, wrapAnthropic, wrapBedrock, wrapGoogle, wrapGroq, wrapLiteLLM, wrapMistral, wrapOpenAI, wrapOpenRouter, wrapZespanADKAgent, zespan };
|
package/dist/index.d.ts
CHANGED
|
@@ -272,9 +272,7 @@ declare class ZespanClient {
|
|
|
272
272
|
}
|
|
273
273
|
declare const initZespan: (o: ZespanOptions) => void;
|
|
274
274
|
declare const getZespanClient: () => ZespanClient;
|
|
275
|
-
|
|
276
275
|
declare const init: (o: ZespanOptions) => void;
|
|
277
|
-
declare const getLumiqClient: () => ZespanClient;
|
|
278
276
|
|
|
279
277
|
declare function wrapOpenAI<T extends any>(client: T, options?: WrapperGuardrailsOptions): T;
|
|
280
278
|
|
|
@@ -333,7 +331,6 @@ declare class ZespanCallbackHandler extends BaseCallbackHandler {
|
|
|
333
331
|
handleRetrieverEnd(documents: any[], runId: string): Promise<void>;
|
|
334
332
|
handleRetrieverError(err: any, runId: string): Promise<void>;
|
|
335
333
|
}
|
|
336
|
-
declare const LumiqCallbackHandler: typeof ZespanCallbackHandler;
|
|
337
334
|
|
|
338
335
|
declare class ZespanADKCallbackHandler {
|
|
339
336
|
private agentStates;
|
|
@@ -343,7 +340,7 @@ declare class ZespanADKCallbackHandler {
|
|
|
343
340
|
private getParentAgentState;
|
|
344
341
|
beforeAgentCallback: (context: any) => undefined;
|
|
345
342
|
afterAgentCallback: (context: any) => undefined;
|
|
346
|
-
beforeModelCallback: ({ context, request
|
|
343
|
+
beforeModelCallback: ({ context, request }: any) => undefined;
|
|
347
344
|
afterModelCallback: ({ context, response }: any) => undefined;
|
|
348
345
|
beforeToolCallback: ({ tool, args, context }: any) => undefined;
|
|
349
346
|
afterToolCallback: ({ tool: _tool, args: _args, context, response }: any) => undefined;
|
|
@@ -351,7 +348,7 @@ declare class ZespanADKCallbackHandler {
|
|
|
351
348
|
get callbacks(): {
|
|
352
349
|
beforeAgentCallback: (context: any) => undefined;
|
|
353
350
|
afterAgentCallback: (context: any) => undefined;
|
|
354
|
-
beforeModelCallback: ({ context, request
|
|
351
|
+
beforeModelCallback: ({ context, request }: any) => undefined;
|
|
355
352
|
afterModelCallback: ({ context, response }: any) => undefined;
|
|
356
353
|
beforeToolCallback: ({ tool, args, context }: any) => undefined;
|
|
357
354
|
afterToolCallback: ({ tool: _tool, args: _args, context, response }: any) => undefined;
|
|
@@ -398,9 +395,9 @@ declare function instrumentVercelAI(): {
|
|
|
398
395
|
tracer: Tracer;
|
|
399
396
|
telemetry: TelemetrySettings;
|
|
400
397
|
};
|
|
401
|
-
declare function
|
|
398
|
+
declare function getZespanVercelTelemetry(): TelemetrySettings;
|
|
402
399
|
|
|
403
|
-
declare class
|
|
400
|
+
declare class ZespanLlamaIndexHandler {
|
|
404
401
|
private runs;
|
|
405
402
|
private guardrailSettings;
|
|
406
403
|
constructor(options?: WrapperGuardrailsOptions);
|
|
@@ -447,8 +444,6 @@ interface ZespanContextOptions {
|
|
|
447
444
|
declare function withZespanContext<T>(options: ZespanContextOptions, fn: () => T | Promise<T>): T | Promise<T>;
|
|
448
445
|
declare function withZespanTrace<T>(fn: () => T | Promise<T>, options?: ZespanContextOptions): T | Promise<T>;
|
|
449
446
|
declare const withZespan: typeof withZespanTrace;
|
|
450
|
-
type LumiqContextOptions = ZespanContextOptions;
|
|
451
|
-
declare const withLumiqContext: typeof withZespanContext;
|
|
452
447
|
|
|
453
448
|
interface AgentOptions {
|
|
454
449
|
name: string;
|
|
@@ -506,33 +501,17 @@ declare function injectAgentContext(headers: Record<string, string>, delegationR
|
|
|
506
501
|
*/
|
|
507
502
|
declare function extractAgentContext(headers: Record<string, string>): Context;
|
|
508
503
|
|
|
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
504
|
declare const CREWAI_OTEL_ENV: {
|
|
522
505
|
readonly OTEL_EXPORTER_OTLP_ENDPOINT: "http://localhost:4318";
|
|
523
506
|
readonly OTEL_SERVICE_NAME: "crewai-agent";
|
|
524
507
|
};
|
|
525
|
-
/**
|
|
526
|
-
* Configuration guide for CrewAI Python instrumentation.
|
|
527
|
-
*/
|
|
528
508
|
declare function getCrewAIInstrumentationGuide(): string;
|
|
529
509
|
|
|
530
510
|
/**
|
|
531
511
|
* Attach trace context to an AutoGen message payload.
|
|
532
|
-
* Call before sending a message to another AutoGen agent over HTTP.
|
|
533
512
|
*/
|
|
534
513
|
declare function attachTraceToAutoGenMessage<T extends Record<string, unknown>>(message: T, delegationReason?: string): T & {
|
|
535
|
-
|
|
514
|
+
_zespan_trace: Record<string, string>;
|
|
536
515
|
};
|
|
537
516
|
/**
|
|
538
517
|
* Extract trace context from an incoming AutoGen message.
|
|
@@ -581,8 +560,8 @@ declare const zespan: {
|
|
|
581
560
|
markFrameworkActive: typeof markFrameworkActive;
|
|
582
561
|
markFrameworkInactive: typeof markFrameworkInactive;
|
|
583
562
|
instrumentVercelAI: typeof instrumentVercelAI;
|
|
584
|
-
|
|
585
|
-
|
|
563
|
+
getZespanVercelTelemetry: typeof getZespanVercelTelemetry;
|
|
564
|
+
ZespanLlamaIndexHandler: typeof ZespanLlamaIndexHandler;
|
|
586
565
|
};
|
|
587
566
|
|
|
588
|
-
export { type ADKAgentOptions, type ADKRunnerOptions, AgentContext, type AgentOptions, BaggageSpanProcessor, CREWAI_OTEL_ENV, GuardrailBlockedError, type GuardrailCheckInput, type GuardrailCheckResponse, type GuardrailResult, type InstrumentADKOptions,
|
|
567
|
+
export { type ADKAgentOptions, type ADKRunnerOptions, AgentContext, type AgentOptions, BaggageSpanProcessor, CREWAI_OTEL_ENV, GuardrailBlockedError, type GuardrailCheckInput, type GuardrailCheckResponse, type GuardrailResult, type InstrumentADKOptions, type OTelConfig, type Prompt, PromptClient, type PromptOptions, type ResolvedWrapperGuardrailsSettings, type WrapperGuardrailsOptions, type WrapperGuardrailsSettings, ZespanADKCallbackHandler, ZespanCallbackHandler, ZespanClient, type ZespanContextOptions, ZespanLlamaIndexHandler, attachTraceToAutoGenMessage, autopatch, createSpan, extractAgentContext, extractAgentContext as extractAutoGenContext, extractTraceFromAutoGenMessage, getCrewAIInstrumentationGuide, getPydanticAIConfig, getTracer, getZespanClient, getZespanVercelTelemetry, init, initOTel, initZespan, injectAgentContext, injectAgentContext as injectAutoGenContext, instrumentADK, instrumentVercelAI, markFrameworkActive, markFrameworkInactive, startSpan, withAgent, withSpan, withZespan, withZespanContext, withZespanTrace, wrapADKAgent, wrapADKRunner, wrapAnthropic, wrapBedrock, wrapGoogle, wrapGroq, wrapLiteLLM, wrapMistral, wrapOpenAI, wrapOpenRouter, wrapZespanADKAgent, zespan };
|