@zespan/sdk 1.3.1 → 1.3.3
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 +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.js +12 -12
- package/dist/index.mjs +12 -12
- package/package.json +4 -3
package/dist/index.d.mts
CHANGED
|
@@ -8,13 +8,30 @@ import { BaseCallbackHandler } from '@langchain/core/callbacks/base';
|
|
|
8
8
|
import { Serialized } from '@langchain/core/load/serializable';
|
|
9
9
|
import { SpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
type PiiPreset = "gdpr" | "hipaa" | "ccpa" | "pci-dss" | "soc2" | "finance" | "education" | "transportation";
|
|
12
|
+
type PiiCategory = "personal" | "financial" | "government_ids" | "healthcare" | "digital_identity";
|
|
13
|
+
type PiiRedactionMode = "placeholder" | "mask-middle" | "mask-all";
|
|
14
|
+
interface ZespanPiiConfig {
|
|
15
|
+
piiPreset?: PiiPreset;
|
|
16
|
+
piiCategories?: PiiCategory[];
|
|
17
|
+
piiIncludeNames?: boolean;
|
|
18
|
+
piiIncludeEmails?: boolean;
|
|
19
|
+
piiIncludePhones?: boolean;
|
|
20
|
+
piiIncludeAddresses?: boolean;
|
|
21
|
+
piiConfidenceThreshold?: number;
|
|
22
|
+
piiRedactionMode?: PiiRedactionMode;
|
|
23
|
+
piiWhitelist?: string[];
|
|
24
|
+
piiCustomPatterns?: RegExp[];
|
|
25
|
+
}
|
|
26
|
+
interface ZespanOptions extends ZespanPiiConfig {
|
|
12
27
|
apiKey: string;
|
|
13
28
|
endpoint?: string;
|
|
14
29
|
baseURL?: string;
|
|
15
30
|
environment?: string;
|
|
16
31
|
storePrompts?: boolean;
|
|
17
32
|
redactKeys?: string[];
|
|
33
|
+
/** Pattern-based PII detection via openredaction. OFF by default — must opt in. */
|
|
34
|
+
redactPii?: boolean;
|
|
18
35
|
sampleRate?: number;
|
|
19
36
|
debug?: boolean;
|
|
20
37
|
batchSize?: number;
|
|
@@ -246,6 +263,7 @@ declare class ZespanClient {
|
|
|
246
263
|
readonly environment: string;
|
|
247
264
|
readonly storePrompts: boolean;
|
|
248
265
|
readonly redactKeys: string[];
|
|
266
|
+
readonly redactPii: boolean;
|
|
249
267
|
readonly sampleRate: number;
|
|
250
268
|
readonly debug: boolean;
|
|
251
269
|
readonly enableOTel: boolean;
|
|
@@ -258,6 +276,9 @@ declare class ZespanClient {
|
|
|
258
276
|
constructor(opts: ZespanOptions);
|
|
259
277
|
enqueue(event: ZespanEvent): void;
|
|
260
278
|
redactForStorage(value: unknown): string;
|
|
279
|
+
redactValueAsync(value: unknown): Promise<string>;
|
|
280
|
+
redactTextAsync(text: string): Promise<string>;
|
|
281
|
+
redactObjectAsync(obj: Record<string, unknown>): Promise<Record<string, unknown> | undefined>;
|
|
261
282
|
private resolveGuardrailsUrl;
|
|
262
283
|
checkGuardrails(input: GuardrailCheckInput): Promise<GuardrailCheckResponse>;
|
|
263
284
|
flush(): Promise<void>;
|
|
@@ -568,4 +589,4 @@ declare const zespan: {
|
|
|
568
589
|
ZespanLlamaIndexHandler: typeof ZespanLlamaIndexHandler;
|
|
569
590
|
};
|
|
570
591
|
|
|
571
|
-
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, wrapGoogleGenAI, wrapGroq, wrapLiteLLM, wrapMistral, wrapOpenAI, wrapOpenRouter, wrapZespanADKAgent, zespan };
|
|
592
|
+
export { type ADKAgentOptions, type ADKRunnerOptions, AgentContext, type AgentOptions, BaggageSpanProcessor, CREWAI_OTEL_ENV, GuardrailBlockedError, type GuardrailCheckInput, type GuardrailCheckResponse, type GuardrailResult, type InstrumentADKOptions, type OTelConfig, type PiiCategory, type PiiPreset, type PiiRedactionMode, type Prompt, PromptClient, type PromptOptions, type ResolvedWrapperGuardrailsSettings, type WrapperGuardrailsOptions, type WrapperGuardrailsSettings, ZespanADKCallbackHandler, ZespanCallbackHandler, ZespanClient, type ZespanContextOptions, ZespanLlamaIndexHandler, type ZespanOptions, type ZespanPiiConfig, 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, wrapGoogleGenAI, wrapGroq, wrapLiteLLM, wrapMistral, wrapOpenAI, wrapOpenRouter, wrapZespanADKAgent, zespan };
|
package/dist/index.d.ts
CHANGED
|
@@ -8,13 +8,30 @@ import { BaseCallbackHandler } from '@langchain/core/callbacks/base';
|
|
|
8
8
|
import { Serialized } from '@langchain/core/load/serializable';
|
|
9
9
|
import { SpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
type PiiPreset = "gdpr" | "hipaa" | "ccpa" | "pci-dss" | "soc2" | "finance" | "education" | "transportation";
|
|
12
|
+
type PiiCategory = "personal" | "financial" | "government_ids" | "healthcare" | "digital_identity";
|
|
13
|
+
type PiiRedactionMode = "placeholder" | "mask-middle" | "mask-all";
|
|
14
|
+
interface ZespanPiiConfig {
|
|
15
|
+
piiPreset?: PiiPreset;
|
|
16
|
+
piiCategories?: PiiCategory[];
|
|
17
|
+
piiIncludeNames?: boolean;
|
|
18
|
+
piiIncludeEmails?: boolean;
|
|
19
|
+
piiIncludePhones?: boolean;
|
|
20
|
+
piiIncludeAddresses?: boolean;
|
|
21
|
+
piiConfidenceThreshold?: number;
|
|
22
|
+
piiRedactionMode?: PiiRedactionMode;
|
|
23
|
+
piiWhitelist?: string[];
|
|
24
|
+
piiCustomPatterns?: RegExp[];
|
|
25
|
+
}
|
|
26
|
+
interface ZespanOptions extends ZespanPiiConfig {
|
|
12
27
|
apiKey: string;
|
|
13
28
|
endpoint?: string;
|
|
14
29
|
baseURL?: string;
|
|
15
30
|
environment?: string;
|
|
16
31
|
storePrompts?: boolean;
|
|
17
32
|
redactKeys?: string[];
|
|
33
|
+
/** Pattern-based PII detection via openredaction. OFF by default — must opt in. */
|
|
34
|
+
redactPii?: boolean;
|
|
18
35
|
sampleRate?: number;
|
|
19
36
|
debug?: boolean;
|
|
20
37
|
batchSize?: number;
|
|
@@ -246,6 +263,7 @@ declare class ZespanClient {
|
|
|
246
263
|
readonly environment: string;
|
|
247
264
|
readonly storePrompts: boolean;
|
|
248
265
|
readonly redactKeys: string[];
|
|
266
|
+
readonly redactPii: boolean;
|
|
249
267
|
readonly sampleRate: number;
|
|
250
268
|
readonly debug: boolean;
|
|
251
269
|
readonly enableOTel: boolean;
|
|
@@ -258,6 +276,9 @@ declare class ZespanClient {
|
|
|
258
276
|
constructor(opts: ZespanOptions);
|
|
259
277
|
enqueue(event: ZespanEvent): void;
|
|
260
278
|
redactForStorage(value: unknown): string;
|
|
279
|
+
redactValueAsync(value: unknown): Promise<string>;
|
|
280
|
+
redactTextAsync(text: string): Promise<string>;
|
|
281
|
+
redactObjectAsync(obj: Record<string, unknown>): Promise<Record<string, unknown> | undefined>;
|
|
261
282
|
private resolveGuardrailsUrl;
|
|
262
283
|
checkGuardrails(input: GuardrailCheckInput): Promise<GuardrailCheckResponse>;
|
|
263
284
|
flush(): Promise<void>;
|
|
@@ -568,4 +589,4 @@ declare const zespan: {
|
|
|
568
589
|
ZespanLlamaIndexHandler: typeof ZespanLlamaIndexHandler;
|
|
569
590
|
};
|
|
570
591
|
|
|
571
|
-
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, wrapGoogleGenAI, wrapGroq, wrapLiteLLM, wrapMistral, wrapOpenAI, wrapOpenRouter, wrapZespanADKAgent, zespan };
|
|
592
|
+
export { type ADKAgentOptions, type ADKRunnerOptions, AgentContext, type AgentOptions, BaggageSpanProcessor, CREWAI_OTEL_ENV, GuardrailBlockedError, type GuardrailCheckInput, type GuardrailCheckResponse, type GuardrailResult, type InstrumentADKOptions, type OTelConfig, type PiiCategory, type PiiPreset, type PiiRedactionMode, type Prompt, PromptClient, type PromptOptions, type ResolvedWrapperGuardrailsSettings, type WrapperGuardrailsOptions, type WrapperGuardrailsSettings, ZespanADKCallbackHandler, ZespanCallbackHandler, ZespanClient, type ZespanContextOptions, ZespanLlamaIndexHandler, type ZespanOptions, type ZespanPiiConfig, 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, wrapGoogleGenAI, wrapGroq, wrapLiteLLM, wrapMistral, wrapOpenAI, wrapOpenRouter, wrapZespanADKAgent, zespan };
|