agentid-sdk 0.1.40 → 0.1.42
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 +83 -2
- package/dist/{agentid-BWlN5KCq.d.mts → agentid-DbTWrLnN.d.mts} +30 -0
- package/dist/{agentid-BWlN5KCq.d.ts → agentid-DbTWrLnN.d.ts} +30 -0
- package/dist/{chunk-25SZBEYX.mjs → chunk-C5U4L4JY.mjs} +706 -537
- package/dist/index.d.mts +27 -3
- package/dist/index.d.ts +27 -3
- package/dist/index.js +738 -541
- package/dist/index.mjs +32 -5
- package/dist/langchain.d.mts +8 -1
- package/dist/langchain.d.ts +8 -1
- package/dist/langchain.js +301 -71
- package/dist/langchain.mjs +129 -44
- package/dist/transparency-badge.d.mts +1 -1
- package/dist/transparency-badge.d.ts +1 -1
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PIIAnonymizeOptions, a as PIIManager } from './agentid-
|
|
2
|
-
export { A as AgentEventType, b as AgentID, c as AgentIDWorkflowRunHooks, d as AgentIDWorkflowStep, e as AgentIDWorkflowStepParams, f as AgentIDWorkflowTrail, g as AgentIDWorkflowTrailOptions, h as AgentOperationCategory, i as AgentOperationStatus, j as AgentTelemetryContext, D as DependencyError, G as GuardAttachment, k as GuardParams, l as GuardResponse, L as LogParams, O as OperationLogParams, m as PIIMapping, n as PreparedInput, R as RequestOptions, S as SecurityBlockError, T as TransparencyMetadata, W as WrapOpenAIOptions, o as createAgentIdCorrelationId, p as createAgentIdOperationLog, q as createAgentIdTelemetryContext, r as createAgentIdWorkflowTrail } from './agentid-
|
|
1
|
+
import { P as PIIAnonymizeOptions, a as PIIManager } from './agentid-DbTWrLnN.mjs';
|
|
2
|
+
export { A as AgentEventType, b as AgentID, c as AgentIDWorkflowRunHooks, d as AgentIDWorkflowStep, e as AgentIDWorkflowStepParams, f as AgentIDWorkflowTrail, g as AgentIDWorkflowTrailOptions, h as AgentOperationCategory, i as AgentOperationStatus, j as AgentTelemetryContext, D as DependencyError, G as GuardAttachment, k as GuardParams, l as GuardResponse, L as LogParams, O as OperationLogParams, m as PIIMapping, n as PreparedInput, R as RequestOptions, S as SecurityBlockError, T as TransparencyMetadata, W as WrapOpenAIOptions, o as createAgentIdCorrelationId, p as createAgentIdOperationLog, q as createAgentIdTelemetryContext, r as createAgentIdWorkflowTrail } from './agentid-DbTWrLnN.mjs';
|
|
3
3
|
|
|
4
4
|
type TokenUsage = Record<string, unknown>;
|
|
5
5
|
type ExtractedGuardAttachment = {
|
|
@@ -10,6 +10,7 @@ type ExtractedGuardAttachment = {
|
|
|
10
10
|
interface LLMAdapter {
|
|
11
11
|
extractInput(req: unknown): string | null;
|
|
12
12
|
extractAttachments(req: unknown): ExtractedGuardAttachment[];
|
|
13
|
+
extractPromptContext(req: unknown): string | null;
|
|
13
14
|
getModelName(req: unknown, res?: unknown): string;
|
|
14
15
|
extractOutput(res: unknown): string;
|
|
15
16
|
getTokenUsage(res: unknown): TokenUsage | undefined;
|
|
@@ -18,6 +19,7 @@ interface LLMAdapter {
|
|
|
18
19
|
declare class OpenAIAdapter implements LLMAdapter {
|
|
19
20
|
extractInput(req: any): string | null;
|
|
20
21
|
extractAttachments(req: any): ExtractedGuardAttachment[];
|
|
22
|
+
extractPromptContext(req: any): string | null;
|
|
21
23
|
getModelName(req: any, res?: any): string;
|
|
22
24
|
extractOutput(res: any): string;
|
|
23
25
|
getTokenUsage(res: any): TokenUsage | undefined;
|
|
@@ -30,8 +32,30 @@ type ProtectMessageHistoryResult<T> = {
|
|
|
30
32
|
transformed: boolean;
|
|
31
33
|
textPartsCount: number;
|
|
32
34
|
transformedTextPartsCount: number;
|
|
35
|
+
placeholderMapping: Record<string, string>;
|
|
36
|
+
};
|
|
37
|
+
type AgentIdTranscriptMode = "masked" | "raw";
|
|
38
|
+
type AgentIdTranscriptPolicy = {
|
|
39
|
+
ui?: AgentIdTranscriptMode;
|
|
40
|
+
provider?: AgentIdTranscriptMode;
|
|
41
|
+
persistence?: AgentIdTranscriptMode;
|
|
42
|
+
};
|
|
43
|
+
type ProtectChatStateOptions = ProtectMessageHistoryOptions & {
|
|
44
|
+
transcript?: AgentIdTranscriptPolicy;
|
|
45
|
+
};
|
|
46
|
+
type ProtectChatStateResult<T> = {
|
|
47
|
+
rawMessages: T;
|
|
48
|
+
uiMessages: T;
|
|
49
|
+
providerMessages: T;
|
|
50
|
+
persistenceMessages: T;
|
|
51
|
+
transformed: boolean;
|
|
52
|
+
textPartsCount: number;
|
|
53
|
+
transformedTextPartsCount: number;
|
|
54
|
+
placeholderMapping: Record<string, string>;
|
|
55
|
+
transcript: Required<AgentIdTranscriptPolicy>;
|
|
33
56
|
};
|
|
34
57
|
declare function protectMessageHistory<T>(messages: T, options?: ProtectMessageHistoryOptions): ProtectMessageHistoryResult<T>;
|
|
58
|
+
declare function protectChatState<T>(messages: T, options?: ProtectChatStateOptions): ProtectChatStateResult<T>;
|
|
35
59
|
|
|
36
60
|
type InjectionScanParams = {
|
|
37
61
|
prompt: string;
|
|
@@ -63,4 +87,4 @@ declare class InjectionScanner {
|
|
|
63
87
|
}
|
|
64
88
|
declare function getInjectionScanner(): InjectionScanner;
|
|
65
89
|
|
|
66
|
-
export { type ExtractedGuardAttachment, type InjectionScanParams, InjectionScanner, type LLMAdapter, OpenAIAdapter, PIIAnonymizeOptions, PIIManager, type ProtectMessageHistoryOptions, type ProtectMessageHistoryResult, type TokenUsage, getInjectionScanner, protectMessageHistory, scanWithRegex };
|
|
90
|
+
export { type AgentIdTranscriptMode, type AgentIdTranscriptPolicy, type ExtractedGuardAttachment, type InjectionScanParams, InjectionScanner, type LLMAdapter, OpenAIAdapter, PIIAnonymizeOptions, PIIManager, type ProtectChatStateOptions, type ProtectChatStateResult, type ProtectMessageHistoryOptions, type ProtectMessageHistoryResult, type TokenUsage, getInjectionScanner, protectChatState, protectMessageHistory, scanWithRegex };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PIIAnonymizeOptions, a as PIIManager } from './agentid-
|
|
2
|
-
export { A as AgentEventType, b as AgentID, c as AgentIDWorkflowRunHooks, d as AgentIDWorkflowStep, e as AgentIDWorkflowStepParams, f as AgentIDWorkflowTrail, g as AgentIDWorkflowTrailOptions, h as AgentOperationCategory, i as AgentOperationStatus, j as AgentTelemetryContext, D as DependencyError, G as GuardAttachment, k as GuardParams, l as GuardResponse, L as LogParams, O as OperationLogParams, m as PIIMapping, n as PreparedInput, R as RequestOptions, S as SecurityBlockError, T as TransparencyMetadata, W as WrapOpenAIOptions, o as createAgentIdCorrelationId, p as createAgentIdOperationLog, q as createAgentIdTelemetryContext, r as createAgentIdWorkflowTrail } from './agentid-
|
|
1
|
+
import { P as PIIAnonymizeOptions, a as PIIManager } from './agentid-DbTWrLnN.js';
|
|
2
|
+
export { A as AgentEventType, b as AgentID, c as AgentIDWorkflowRunHooks, d as AgentIDWorkflowStep, e as AgentIDWorkflowStepParams, f as AgentIDWorkflowTrail, g as AgentIDWorkflowTrailOptions, h as AgentOperationCategory, i as AgentOperationStatus, j as AgentTelemetryContext, D as DependencyError, G as GuardAttachment, k as GuardParams, l as GuardResponse, L as LogParams, O as OperationLogParams, m as PIIMapping, n as PreparedInput, R as RequestOptions, S as SecurityBlockError, T as TransparencyMetadata, W as WrapOpenAIOptions, o as createAgentIdCorrelationId, p as createAgentIdOperationLog, q as createAgentIdTelemetryContext, r as createAgentIdWorkflowTrail } from './agentid-DbTWrLnN.js';
|
|
3
3
|
|
|
4
4
|
type TokenUsage = Record<string, unknown>;
|
|
5
5
|
type ExtractedGuardAttachment = {
|
|
@@ -10,6 +10,7 @@ type ExtractedGuardAttachment = {
|
|
|
10
10
|
interface LLMAdapter {
|
|
11
11
|
extractInput(req: unknown): string | null;
|
|
12
12
|
extractAttachments(req: unknown): ExtractedGuardAttachment[];
|
|
13
|
+
extractPromptContext(req: unknown): string | null;
|
|
13
14
|
getModelName(req: unknown, res?: unknown): string;
|
|
14
15
|
extractOutput(res: unknown): string;
|
|
15
16
|
getTokenUsage(res: unknown): TokenUsage | undefined;
|
|
@@ -18,6 +19,7 @@ interface LLMAdapter {
|
|
|
18
19
|
declare class OpenAIAdapter implements LLMAdapter {
|
|
19
20
|
extractInput(req: any): string | null;
|
|
20
21
|
extractAttachments(req: any): ExtractedGuardAttachment[];
|
|
22
|
+
extractPromptContext(req: any): string | null;
|
|
21
23
|
getModelName(req: any, res?: any): string;
|
|
22
24
|
extractOutput(res: any): string;
|
|
23
25
|
getTokenUsage(res: any): TokenUsage | undefined;
|
|
@@ -30,8 +32,30 @@ type ProtectMessageHistoryResult<T> = {
|
|
|
30
32
|
transformed: boolean;
|
|
31
33
|
textPartsCount: number;
|
|
32
34
|
transformedTextPartsCount: number;
|
|
35
|
+
placeholderMapping: Record<string, string>;
|
|
36
|
+
};
|
|
37
|
+
type AgentIdTranscriptMode = "masked" | "raw";
|
|
38
|
+
type AgentIdTranscriptPolicy = {
|
|
39
|
+
ui?: AgentIdTranscriptMode;
|
|
40
|
+
provider?: AgentIdTranscriptMode;
|
|
41
|
+
persistence?: AgentIdTranscriptMode;
|
|
42
|
+
};
|
|
43
|
+
type ProtectChatStateOptions = ProtectMessageHistoryOptions & {
|
|
44
|
+
transcript?: AgentIdTranscriptPolicy;
|
|
45
|
+
};
|
|
46
|
+
type ProtectChatStateResult<T> = {
|
|
47
|
+
rawMessages: T;
|
|
48
|
+
uiMessages: T;
|
|
49
|
+
providerMessages: T;
|
|
50
|
+
persistenceMessages: T;
|
|
51
|
+
transformed: boolean;
|
|
52
|
+
textPartsCount: number;
|
|
53
|
+
transformedTextPartsCount: number;
|
|
54
|
+
placeholderMapping: Record<string, string>;
|
|
55
|
+
transcript: Required<AgentIdTranscriptPolicy>;
|
|
33
56
|
};
|
|
34
57
|
declare function protectMessageHistory<T>(messages: T, options?: ProtectMessageHistoryOptions): ProtectMessageHistoryResult<T>;
|
|
58
|
+
declare function protectChatState<T>(messages: T, options?: ProtectChatStateOptions): ProtectChatStateResult<T>;
|
|
35
59
|
|
|
36
60
|
type InjectionScanParams = {
|
|
37
61
|
prompt: string;
|
|
@@ -63,4 +87,4 @@ declare class InjectionScanner {
|
|
|
63
87
|
}
|
|
64
88
|
declare function getInjectionScanner(): InjectionScanner;
|
|
65
89
|
|
|
66
|
-
export { type ExtractedGuardAttachment, type InjectionScanParams, InjectionScanner, type LLMAdapter, OpenAIAdapter, PIIAnonymizeOptions, PIIManager, type ProtectMessageHistoryOptions, type ProtectMessageHistoryResult, type TokenUsage, getInjectionScanner, protectMessageHistory, scanWithRegex };
|
|
90
|
+
export { type AgentIdTranscriptMode, type AgentIdTranscriptPolicy, type ExtractedGuardAttachment, type InjectionScanParams, InjectionScanner, type LLMAdapter, OpenAIAdapter, PIIAnonymizeOptions, PIIManager, type ProtectChatStateOptions, type ProtectChatStateResult, type ProtectMessageHistoryOptions, type ProtectMessageHistoryResult, type TokenUsage, getInjectionScanner, protectChatState, protectMessageHistory, scanWithRegex };
|