@anvia/core 1.0.0-rc.2 → 1.0.0-rc.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/README.md +69 -9
- package/dist/agent/index.d.ts +20 -13
- package/dist/agent/index.js +36 -15
- package/dist/{agent-yBG8e9Jj.d.ts → agent-CXScUOpX.d.ts} +12 -15
- package/dist/{chunk-77AIYARB.js → chunk-3CMWKK32.js} +28 -19
- package/dist/chunk-3CMWKK32.js.map +1 -0
- package/dist/chunk-3RM57ZT2.js +31 -0
- package/dist/chunk-3RM57ZT2.js.map +1 -0
- package/dist/{chunk-EINTGEGY.js → chunk-5MK3BISB.js} +101 -26
- package/dist/chunk-5MK3BISB.js.map +1 -0
- package/dist/{chunk-KIDGIJM7.js → chunk-AZB6N7P4.js} +94 -86
- package/dist/chunk-AZB6N7P4.js.map +1 -0
- package/dist/{chunk-DBSCKTUL.js → chunk-BY4OMNIU.js} +1746 -840
- package/dist/chunk-BY4OMNIU.js.map +1 -0
- package/dist/{chunk-KR3RCCHJ.js → chunk-D2ECOWN5.js} +26 -11
- package/dist/chunk-D2ECOWN5.js.map +1 -0
- package/dist/{chunk-FMHLROPQ.js → chunk-GQL5KRAH.js} +13 -33
- package/dist/chunk-GQL5KRAH.js.map +1 -0
- package/dist/{chunk-OJH6HWHX.js → chunk-KFR4CDGK.js} +8 -2
- package/dist/chunk-KFR4CDGK.js.map +1 -0
- package/dist/{chunk-D37WMSP6.js → chunk-KV6QCRQ4.js} +50 -10
- package/dist/chunk-KV6QCRQ4.js.map +1 -0
- package/dist/{chunk-XKYYBABH.js → chunk-LXMAFD23.js} +2 -2
- package/dist/{chunk-TIZYTPJO.js → chunk-PK5LKOFL.js} +33 -2
- package/dist/chunk-PK5LKOFL.js.map +1 -0
- package/dist/chunk-TRQ3XRFD.js +54 -0
- package/dist/chunk-TRQ3XRFD.js.map +1 -0
- package/dist/{chunk-CWM7B2OO.js → chunk-VKYZZXP5.js} +10 -2
- package/dist/chunk-VKYZZXP5.js.map +1 -0
- package/dist/{chunk-4WI3VGZK.js → chunk-ZCPOIDAQ.js} +3 -3
- package/dist/{client-B8DT1vUG.d.ts → client-DvUatElp.d.ts} +4 -3
- package/dist/completion/index.d.ts +3 -3
- package/dist/completion/index.js +2 -2
- package/dist/documents/index.d.ts +34 -0
- package/dist/documents/index.js +315 -0
- package/dist/documents/index.js.map +1 -0
- package/dist/{dynamic-tools-KwEGRbHp.d.ts → dynamic-tools-AEBOTgu1.d.ts} +3 -3
- package/dist/embeddings/index.js +2 -1
- package/dist/evals/index.d.ts +19 -11
- package/dist/evals/index.js +88 -55
- package/dist/evals/index.js.map +1 -1
- package/dist/extractor/index.d.ts +1 -1
- package/dist/extractor/index.js +3 -3
- package/dist/guardrails/index.d.ts +6 -129
- package/dist/guardrails/index.js +1 -1
- package/dist/image-generation/index.d.ts +1 -1
- package/dist/index.d.ts +15 -14
- package/dist/index.js +40 -19
- package/dist/interactions-csssHYcN.d.ts +174 -0
- package/dist/internal/agent.d.ts +18 -22
- package/dist/internal/agent.js +45 -14
- package/dist/internal/agent.js.map +1 -1
- package/dist/mcp/index.d.ts +4 -4
- package/dist/mcp/index.js +6 -5
- package/dist/memory/index.d.ts +3 -3
- package/dist/memory/index.js +3 -3
- package/dist/{message-schema-Cn7ezRfJ.d.ts → message-schema-B2M7AYzR.d.ts} +1 -1
- package/dist/observability/index.d.ts +8 -7
- package/dist/observability/index.js +3 -3
- package/dist/pipeline/index.d.ts +18 -18
- package/dist/pipeline/index.js +20 -29
- package/dist/pipeline/index.js.map +1 -1
- package/dist/skills/index.d.ts +4 -4
- package/dist/skills/index.js +6 -5
- package/dist/speech-generation/index.d.ts +1 -1
- package/dist/text-C_6eKrbC.d.ts +32 -0
- package/dist/{think-tool-6H2QNQzQ.d.ts → think-tool-D8frXxwV.d.ts} +16 -2
- package/dist/tool/index.d.ts +6 -6
- package/dist/tool/index.js +9 -4
- package/dist/{tool--Mz4v1eL.d.ts → tool-r62gf3QY.d.ts} +3 -2
- package/dist/transcription/index.d.ts +1 -1
- package/dist/{types-Dld1TpWj.d.ts → types-C3gv9EX6.d.ts} +1 -1
- package/dist/{types-3x3mOLHU.d.ts → types-CElwurHZ.d.ts} +56 -35
- package/dist/types-CIPaIbZo.d.ts +105 -0
- package/dist/{types-CQ_ioXWK.d.ts → types-D9rKQ_as.d.ts} +24 -2
- package/dist/{types-BVzM4RsC.d.ts → types-DbolvLtZ.d.ts} +1 -1
- package/dist/{types-DiJqJejp.d.ts → types-RT3cuyRk.d.ts} +1 -1
- package/dist/vector-store/index.d.ts +4 -4
- package/dist/vector-store/index.js +4 -3
- package/package.json +6 -6
- package/dist/chunk-77AIYARB.js.map +0 -1
- package/dist/chunk-CWM7B2OO.js.map +0 -1
- package/dist/chunk-D37WMSP6.js.map +0 -1
- package/dist/chunk-DBSCKTUL.js.map +0 -1
- package/dist/chunk-EINTGEGY.js.map +0 -1
- package/dist/chunk-FMHLROPQ.js.map +0 -1
- package/dist/chunk-KIDGIJM7.js.map +0 -1
- package/dist/chunk-KR3RCCHJ.js.map +0 -1
- package/dist/chunk-OJH6HWHX.js.map +0 -1
- package/dist/chunk-TIZYTPJO.js.map +0 -1
- package/dist/loaders/index.d.ts +0 -87
- package/dist/loaders/index.js +0 -299
- package/dist/loaders/index.js.map +0 -1
- package/dist/middleware-C7PdmKF7.d.ts +0 -56
- /package/dist/{chunk-XKYYBABH.js.map → chunk-LXMAFD23.js.map} +0 -0
- /package/dist/{chunk-4WI3VGZK.js.map → chunk-ZCPOIDAQ.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b as RetrySetting } from '../retry-CjvSlKGW.js';
|
|
2
|
-
import { C as CompletionModel, J as JsonObject, U as Usage, g as CompletionResult } from '../types-
|
|
2
|
+
import { C as CompletionModel, J as JsonObject, U as Usage, g as CompletionResult } from '../types-D9rKQ_as.js';
|
|
3
3
|
import { Z as ZodSchema } from '../zod-schema-C7F4clpm.js';
|
|
4
4
|
import '../model-call-options-CZkSw_xN.js';
|
|
5
5
|
import 'zod';
|
package/dist/extractor/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ExtractionError,
|
|
3
3
|
extract
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-ZCPOIDAQ.js";
|
|
5
5
|
import "../chunk-MGNTXGTX.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-D2ECOWN5.js";
|
|
7
|
+
import "../chunk-PK5LKOFL.js";
|
|
8
8
|
import "../chunk-FN7HLLAZ.js";
|
|
9
9
|
export {
|
|
10
10
|
ExtractionError,
|
|
@@ -1,134 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
export { a as allow, f as appendGuardrailPolicies, b as block, d as defineGuardrailPolicy, c as defineInputGuardrail, e as defineOutputGuardrail, g as guardrails, h as hasEnforcedOutputGuardrails, n as normalizeGuardrailPolicies } from '../text-C_6eKrbC.js';
|
|
2
|
+
import { c as GuardrailPolicy, g as InputGuardrailContext, j as InputGuardrailRunResult, i as OutputGuardrailContext, k as OutputGuardrailRunResult } from '../types-CIPaIbZo.js';
|
|
3
|
+
export { l as GuardrailActionBase, m as GuardrailActionName, n as GuardrailAllow, o as GuardrailBlock, G as GuardrailBoundary, p as GuardrailCommonActions, a as GuardrailDecisionRecord, b as GuardrailMode, d as GuardrailPolicyInput, e as GuardrailPolicyOptions, q as GuardrailRunContext, I as InputGuardrail, f as InputGuardrailActions, r as InputGuardrailResult, s as InputGuardrailRewrite, O as OutputGuardrail, h as OutputGuardrailActions, t as OutputGuardrailResult, u as OutputGuardrailRewrite } from '../types-CIPaIbZo.js';
|
|
4
|
+
import '../types-D9rKQ_as.js';
|
|
3
5
|
import '../model-call-options-CZkSw_xN.js';
|
|
6
|
+
import '../type-utils-CtHVDRn_.js';
|
|
4
7
|
|
|
5
|
-
type GuardrailMode = "enforce" | "observe";
|
|
6
|
-
type GuardrailBoundary = "input" | "output";
|
|
7
|
-
type GuardrailRunContext = {
|
|
8
|
-
agentId: string;
|
|
9
|
-
runId: string;
|
|
10
|
-
sessionId?: string | undefined;
|
|
11
|
-
metadata?: JsonObject | undefined;
|
|
12
|
-
};
|
|
13
|
-
type GuardrailDecisionRecord = {
|
|
14
|
-
policyId: string;
|
|
15
|
-
guardrailId: string;
|
|
16
|
-
boundary: GuardrailBoundary;
|
|
17
|
-
mode: GuardrailMode;
|
|
18
|
-
action: GuardrailActionName;
|
|
19
|
-
applied: boolean;
|
|
20
|
-
reason?: string | undefined;
|
|
21
|
-
message?: string | undefined;
|
|
22
|
-
metadata?: JsonObject | undefined;
|
|
23
|
-
latencyMs: number;
|
|
24
|
-
};
|
|
25
|
-
type GuardrailActionName = "allow" | "block" | "rewrite" | "error";
|
|
26
|
-
type GuardrailActionBase = {
|
|
27
|
-
reason?: string | undefined;
|
|
28
|
-
metadata?: JsonObject | undefined;
|
|
29
|
-
};
|
|
30
|
-
type GuardrailAllow = GuardrailActionBase & {
|
|
31
|
-
action: "allow";
|
|
32
|
-
};
|
|
33
|
-
type GuardrailBlock = GuardrailActionBase & {
|
|
34
|
-
action: "block";
|
|
35
|
-
reason: string;
|
|
36
|
-
message?: string | undefined;
|
|
37
|
-
};
|
|
38
|
-
type InputGuardrailRewrite = GuardrailActionBase & {
|
|
39
|
-
action: "rewrite";
|
|
40
|
-
prompt?: Message | undefined;
|
|
41
|
-
inputText?: string | undefined;
|
|
42
|
-
};
|
|
43
|
-
type OutputGuardrailRewrite = GuardrailActionBase & {
|
|
44
|
-
action: "rewrite";
|
|
45
|
-
outputText: string;
|
|
46
|
-
};
|
|
47
|
-
type InputGuardrailResult = GuardrailAllow | GuardrailBlock | InputGuardrailRewrite;
|
|
48
|
-
type OutputGuardrailResult = GuardrailAllow | GuardrailBlock | OutputGuardrailRewrite;
|
|
49
|
-
type GuardrailCommonActions = {
|
|
50
|
-
allow(options?: GuardrailActionBase): GuardrailAllow;
|
|
51
|
-
block(options: Omit<GuardrailBlock, "action">): GuardrailBlock;
|
|
52
|
-
};
|
|
53
|
-
type InputGuardrailActions = GuardrailCommonActions & {
|
|
54
|
-
rewrite(options: Omit<InputGuardrailRewrite, "action">): InputGuardrailRewrite;
|
|
55
|
-
};
|
|
56
|
-
type OutputGuardrailActions = GuardrailCommonActions & {
|
|
57
|
-
rewrite(options: Omit<OutputGuardrailRewrite, "action">): OutputGuardrailRewrite;
|
|
58
|
-
};
|
|
59
|
-
type InputGuardrailContext = {
|
|
60
|
-
prompt: Message;
|
|
61
|
-
history: Message[];
|
|
62
|
-
inputText: string;
|
|
63
|
-
run: GuardrailRunContext;
|
|
64
|
-
};
|
|
65
|
-
type OutputGuardrailContext = {
|
|
66
|
-
outputText: string;
|
|
67
|
-
messages: Message[];
|
|
68
|
-
usage: Usage;
|
|
69
|
-
run: GuardrailRunContext;
|
|
70
|
-
};
|
|
71
|
-
type InputGuardrail = {
|
|
72
|
-
id: string;
|
|
73
|
-
check(context: InputGuardrailContext, actions: InputGuardrailActions): MaybePromise<InputGuardrailResult | undefined>;
|
|
74
|
-
};
|
|
75
|
-
type OutputGuardrail = {
|
|
76
|
-
id: string;
|
|
77
|
-
check(context: OutputGuardrailContext, actions: OutputGuardrailActions): MaybePromise<OutputGuardrailResult | undefined>;
|
|
78
|
-
};
|
|
79
|
-
type GuardrailPolicy = {
|
|
80
|
-
id: string;
|
|
81
|
-
mode: GuardrailMode;
|
|
82
|
-
input: InputGuardrail[];
|
|
83
|
-
output: OutputGuardrail[];
|
|
84
|
-
};
|
|
85
|
-
type GuardrailPolicyOptions = {
|
|
86
|
-
id: string;
|
|
87
|
-
mode?: GuardrailMode | undefined;
|
|
88
|
-
input?: InputGuardrail[] | undefined;
|
|
89
|
-
output?: OutputGuardrail[] | undefined;
|
|
90
|
-
};
|
|
91
|
-
type GuardrailPolicyInput = GuardrailPolicy | GuardrailPolicy[];
|
|
92
|
-
type InputGuardrailRunResult = {
|
|
93
|
-
prompt: Message;
|
|
94
|
-
inputText: string;
|
|
95
|
-
blocked: boolean;
|
|
96
|
-
message?: string | undefined;
|
|
97
|
-
decisions: GuardrailDecisionRecord[];
|
|
98
|
-
};
|
|
99
|
-
type OutputGuardrailRunResult = {
|
|
100
|
-
outputText: string;
|
|
101
|
-
blocked: boolean;
|
|
102
|
-
message?: string | undefined;
|
|
103
|
-
decisions: GuardrailDecisionRecord[];
|
|
104
|
-
};
|
|
105
|
-
declare function defineGuardrailPolicy(options: GuardrailPolicyOptions): GuardrailPolicy;
|
|
106
|
-
declare function defineInputGuardrail(guardrail: InputGuardrail): InputGuardrail;
|
|
107
|
-
declare function defineOutputGuardrail(guardrail: OutputGuardrail): OutputGuardrail;
|
|
108
|
-
declare function allow(options?: GuardrailActionBase): GuardrailAllow;
|
|
109
|
-
declare function block(options: Omit<GuardrailBlock, "action">): GuardrailBlock;
|
|
110
|
-
declare const guardrails: {
|
|
111
|
-
blockText: typeof blockText;
|
|
112
|
-
redactText: typeof redactText;
|
|
113
|
-
};
|
|
114
|
-
declare function normalizeGuardrailPolicies(policies: GuardrailPolicyInput | undefined): GuardrailPolicy[];
|
|
115
|
-
declare function appendGuardrailPolicies(current: GuardrailPolicy[], next: GuardrailPolicyInput): GuardrailPolicy[];
|
|
116
|
-
declare function hasEnforcedOutputGuardrails(policies: GuardrailPolicy[]): boolean;
|
|
117
8
|
declare function runInputGuardrails(policies: GuardrailPolicy[], context: InputGuardrailContext): Promise<InputGuardrailRunResult>;
|
|
118
9
|
declare function runOutputGuardrails(policies: GuardrailPolicy[], context: OutputGuardrailContext): Promise<OutputGuardrailRunResult>;
|
|
119
|
-
type TextPatternBoundary = "input" | "output";
|
|
120
|
-
type TextPatternGuardrailFor<Boundary extends TextPatternBoundary> = Boundary extends "input" ? InputGuardrail : OutputGuardrail;
|
|
121
|
-
type TextPatternGuardrailOptions<Boundary extends TextPatternBoundary = TextPatternBoundary> = {
|
|
122
|
-
id: string;
|
|
123
|
-
boundary: Boundary;
|
|
124
|
-
patterns: Array<string | RegExp>;
|
|
125
|
-
reason: string;
|
|
126
|
-
message?: string | undefined;
|
|
127
|
-
};
|
|
128
|
-
type TextPatternRedactOptions<Boundary extends TextPatternBoundary = TextPatternBoundary> = TextPatternGuardrailOptions<Boundary> & {
|
|
129
|
-
replacement?: string | undefined;
|
|
130
|
-
};
|
|
131
|
-
declare function blockText<Boundary extends TextPatternBoundary>(options: TextPatternGuardrailOptions<Boundary>): TextPatternGuardrailFor<Boundary>;
|
|
132
|
-
declare function redactText<Boundary extends TextPatternBoundary>(options: TextPatternRedactOptions<Boundary>): TextPatternGuardrailFor<Boundary>;
|
|
133
10
|
|
|
134
|
-
export {
|
|
11
|
+
export { GuardrailPolicy, InputGuardrailContext, InputGuardrailRunResult, OutputGuardrailContext, OutputGuardrailRunResult, runInputGuardrails, runOutputGuardrails };
|
package/dist/guardrails/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { M as ModelCallOptions } from '../model-call-options-CZkSw_xN.js';
|
|
2
2
|
import { b as RetrySetting } from '../retry-CjvSlKGW.js';
|
|
3
3
|
export { R as RetryContext, a as RetryOptions } from '../retry-CjvSlKGW.js';
|
|
4
|
-
import { J as JsonObject } from '../types-
|
|
4
|
+
import { J as JsonObject } from '../types-D9rKQ_as.js';
|
|
5
5
|
|
|
6
6
|
type ImageGenerationRequest = {
|
|
7
7
|
prompt: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
export { A as Agent, a as AgentContextInput, b as AgentMemory, c as AgentMemoryOptions, d as AgentOptions, e as AgentToolInput, f as AgentToolOptions, C as CreateHybridVectorContextOptions, g as CreateVectorContextOptions, V as VectorContext, h as VectorContextBaseOptions, i as createVectorContext, j as isVectorContext } from './agent-
|
|
2
|
-
export { AgentRunBlockedError, AgentRunCancelledError, MaxTurnsError } from './agent/index.js';
|
|
3
|
-
export { A as
|
|
1
|
+
export { A as Agent, a as AgentContextInput, b as AgentMemory, c as AgentMemoryOptions, d as AgentOptions, e as AgentToolInput, f as AgentToolOptions, C as CreateHybridVectorContextOptions, g as CreateVectorContextOptions, V as VectorContext, h as VectorContextBaseOptions, i as createVectorContext, j as isVectorContext } from './agent-CXScUOpX.js';
|
|
2
|
+
export { AgentRunBlockedError, AgentRunCancelledError, AgentStreamClosedError, AgentToolSuspensionError, MaxTurnsError } from './agent/index.js';
|
|
3
|
+
export { A as AgentContinuation, a as AgentInteractionRequest, b as AgentInteractionResponse, c as AgentMiddleware, d as AgentQuestionAnswer, e as AgentQuestionChoice, f as AgentQuestionPrompt, g as AgentToolApprovalRequest, h as AgentToolQuestionRequest, C as CompletionRequestMiddlewareArgs, i as CompletionRequestMiddlewareResult, j as CompletionResponseMiddlewareArgs, k as CompletionResponseMiddlewareResult, T as ToolInputMiddlewareArgs, l as ToolInputMiddlewareResult, m as ToolOutputMiddlewareArgs, n as ToolOutputMiddlewareResult, o as ToolResultMiddlewareArgs, p as agentContinuationSchema, q as agentInteractionRequestSchema, r as agentInteractionResponseSchema, s as createMiddleware, t as parseAgentContinuation, u as parseAgentInteractionRequest, v as parseAgentInteractionResponse } from './interactions-csssHYcN.js';
|
|
4
|
+
export { A as AgentBlockedResult, a as AgentChildStreamEvent, b as AgentDeltaEvent, c as AgentErrorEvent, d as AgentErrorStreamEvent, e as AgentFinishEvent, f as AgentInput, g as AgentLifecycle, h as AgentMemoryCompactionEvent, i as AgentPrompt, j as AgentResponse, k as AgentResult, l as AgentRunOptions, m as AgentRunSettings, n as AgentStartEvent, o as AgentSteerInput, p as AgentSteerReceipt, q as AgentStepFinishEvent, r as AgentStream, s as AgentStreamEvent, t as AgentSuspendedResult, u as AgentToolCallDeltaEvent, v as AgentToolFinishEvent, w as AgentToolStartEvent } from './types-CElwurHZ.js';
|
|
4
5
|
export { M as ModelCallOptions } from './model-call-options-CZkSw_xN.js';
|
|
5
6
|
export { R as RetryContext, a as RetryOptions, b as RetrySetting } from './retry-CjvSlKGW.js';
|
|
6
|
-
export { A as AssistantContentPart, a as AssistantGenerationMetadata, b as AssistantMessage, C as CompletionModel, c as CompletionModelInfo, d as CompletionModelStreamEvent, e as CompletionRequest, f as CompletionResponse, g as CompletionResult, h as CompletionSource, i as CompletionStreamEvent, j as CompletionTool, k as ContextUsage, D as Document, F as FileData, l as FilePart, I as ImageDetail, m as ImagePart, J as JsonObject, n as JsonPrimitive, o as JsonValue, M as Message, p as ModelContextLimits, P as ProviderTool, q as ProviderToolCall, R as ReasoningContentType, r as ReasoningDetail, s as ReasoningPart, S as SystemMessage, T as TextPart, t as ToolCallPart, u as ToolChoice, v as ToolDefinition, w as ToolMessage, x as ToolResultContentPart, y as ToolResultOutput, z as ToolResultPart, U as Usage, B as UserContentPart, E as UserMessage, G as calculateContextUsage, H as getAssistantGenerationMetadata, K as isProviderTool, L as resolveModelContextLimits, N as withContextUsage } from './types-
|
|
7
|
-
export { C as CompletionBaseOptions, a as CompletionInput, G as GenerateCompletionOptions, b as GenerateStructuredCompletionOptions, M as MessageMetadataSchema, S as StreamCompletionOptions, c as StreamStructuredCompletionOptions, d as createMessageSchema, g as generateCompletion, i as isJsonValue, e as isMessage, m as messageSchema, f as messagesSchema, p as parseMessage, h as parseMessages, s as streamCompletion } from './message-schema-
|
|
8
|
-
export {
|
|
7
|
+
export { A as AssistantContentPart, a as AssistantGenerationMetadata, b as AssistantMessage, C as CompletionModel, c as CompletionModelInfo, d as CompletionModelStreamEvent, e as CompletionRequest, f as CompletionResponse, g as CompletionResult, h as CompletionSource, i as CompletionStreamEvent, j as CompletionTool, k as ContextUsage, D as Document, F as FileData, l as FilePart, I as ImageDetail, m as ImagePart, J as JsonObject, n as JsonPrimitive, o as JsonValue, M as Message, p as ModelContextLimits, P as ProviderTool, q as ProviderToolCall, R as ReasoningContentType, r as ReasoningDetail, s as ReasoningPart, S as SystemMessage, T as TextPart, t as ToolCallPart, u as ToolChoice, v as ToolDefinition, w as ToolMessage, x as ToolResultContentPart, y as ToolResultOutput, z as ToolResultPart, U as Usage, B as UserContentPart, E as UserMessage, G as calculateContextUsage, H as getAssistantGenerationMetadata, K as isProviderTool, L as resolveModelContextLimits, N as withContextUsage } from './types-D9rKQ_as.js';
|
|
8
|
+
export { C as CompletionBaseOptions, a as CompletionInput, G as GenerateCompletionOptions, b as GenerateStructuredCompletionOptions, M as MessageMetadataSchema, S as StreamCompletionOptions, c as StreamStructuredCompletionOptions, d as createMessageSchema, g as generateCompletion, i as isJsonValue, e as isMessage, m as messageSchema, f as messagesSchema, p as parseMessage, h as parseMessages, s as streamCompletion } from './message-schema-B2M7AYzR.js';
|
|
9
|
+
export { a as allow, b as block, d as defineGuardrailPolicy, c as defineInputGuardrail, e as defineOutputGuardrail, g as guardrails } from './text-C_6eKrbC.js';
|
|
10
|
+
export { G as GuardrailBoundary, a as GuardrailDecisionRecord, b as GuardrailMode, c as GuardrailPolicy, d as GuardrailPolicyInput, e as GuardrailPolicyOptions, I as InputGuardrail, f as InputGuardrailActions, g as InputGuardrailContext, O as OutputGuardrail, h as OutputGuardrailActions, i as OutputGuardrailContext } from './types-CIPaIbZo.js';
|
|
9
11
|
export { GenerateImageOptions, GeneratedImage, ImageGenerationModel, ImageGenerationRequest, ImageGenerationResult, generateImage } from './image-generation/index.js';
|
|
10
12
|
export { MemoryCompactionConflictError, MemoryCompactionError, createMemoryScopeKey, createSummaryMemoryCompactor, isMemoryCompactionMessage } from './memory/index.js';
|
|
11
|
-
export { C as CreateMemoryScopeKeyOptions, a as CreateSummaryMemoryCompactorOptions, M as MemoryAppendOptions, b as MemoryClearOptions, c as MemoryCompactionCapability, d as MemoryCompactionConflictRetryOptions, e as MemoryCompactionInfo, f as MemoryCompactionMessage, g as MemoryCompactionMetadata, h as MemoryCompactionOptions, i as MemoryCompactionReplacePrefixOptions, j as MemoryCompactionReplacePrefixResult, k as MemoryCompactionSnapshot, l as MemoryCompactionSnapshotOptions, m as MemoryCompactor, n as MemoryCompactorInput, o as MemoryCompactorResult, p as MemoryConversation, q as MemoryConversationGetOptions, r as MemoryConversationListOptions, s as MemoryConversationMessage, t as MemoryConversationSummary, u as MemoryErrorOptions, v as MemoryInspector, w as MemoryLoadOptions, x as MemoryOptions, y as MemorySavePolicy, z as MemoryScope, A as MemoryScopeKeyOptions, B as MemoryScopeKeyResolver, D as MemoryStore } from './types-
|
|
13
|
+
export { C as CreateMemoryScopeKeyOptions, a as CreateSummaryMemoryCompactorOptions, M as MemoryAppendOptions, b as MemoryClearOptions, c as MemoryCompactionCapability, d as MemoryCompactionConflictRetryOptions, e as MemoryCompactionInfo, f as MemoryCompactionMessage, g as MemoryCompactionMetadata, h as MemoryCompactionOptions, i as MemoryCompactionReplacePrefixOptions, j as MemoryCompactionReplacePrefixResult, k as MemoryCompactionSnapshot, l as MemoryCompactionSnapshotOptions, m as MemoryCompactor, n as MemoryCompactorInput, o as MemoryCompactorResult, p as MemoryConversation, q as MemoryConversationGetOptions, r as MemoryConversationListOptions, s as MemoryConversationMessage, t as MemoryConversationSummary, u as MemoryErrorOptions, v as MemoryInspector, w as MemoryLoadOptions, x as MemoryOptions, y as MemorySavePolicy, z as MemoryScope, A as MemoryScopeKeyOptions, B as MemoryScopeKeyResolver, D as MemoryStore } from './types-DbolvLtZ.js';
|
|
12
14
|
export { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
|
|
13
15
|
export { loadSkills, skill } from './skills/index.js';
|
|
14
|
-
export { S as SkillValidationError } from './types-
|
|
16
|
+
export { S as SkillValidationError } from './types-RT3cuyRk.js';
|
|
15
17
|
export { GenerateSpeechOptions, SpeechGenerationModel, SpeechGenerationRequest, SpeechGenerationResult, generateSpeech } from './speech-generation/index.js';
|
|
16
|
-
export { C as CreateToolOptions, c as
|
|
17
|
-
export { A as AnyTool, T as Tool, a as ToolApprovalContext, b as ToolApprovalRequirement, c as ToolCallContext, d as ToolCallStreamEvent, e as ToolRequiresApproval } from './tool
|
|
18
|
-
export { A as AgentMiddleware, C as CompletionRequestMiddlewareArgs, a as CompletionRequestMiddlewareResult, b as CompletionResponseMiddlewareArgs, c as CompletionResponseMiddlewareResult, T as ToolInputMiddlewareArgs, d as ToolInputMiddlewareResult, e as ToolOutputMiddlewareArgs, f as ToolOutputMiddlewareResult, g as ToolResultMiddlewareArgs, h as createMiddleware } from './middleware-C7PdmKF7.js';
|
|
18
|
+
export { C as CreateToolOptions, c as createQuestionTool, a as createThinkTool, b as createTool } from './think-tool-D8frXxwV.js';
|
|
19
|
+
export { A as AnyTool, T as Tool, a as ToolApprovalContext, b as ToolApprovalRequirement, c as ToolCallContext, d as ToolCallStreamEvent, e as ToolRequiresApproval } from './tool-r62gf3QY.js';
|
|
19
20
|
export { TranscribeOptions, TranscriptionAudio, TranscriptionModel, TranscriptionRequest, TranscriptionResult, transcribe } from './transcription/index.js';
|
|
20
|
-
import './client-
|
|
21
|
+
import './client-DvUatElp.js';
|
|
21
22
|
import 'node:child_process';
|
|
22
23
|
import 'node:stream';
|
|
23
24
|
import '@modelcontextprotocol/sdk/client/auth.js';
|
|
24
25
|
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
25
26
|
import '@modelcontextprotocol/sdk/shared/transport.js';
|
|
26
|
-
import './dynamic-tools-
|
|
27
|
+
import './dynamic-tools-AEBOTgu1.js';
|
|
27
28
|
import './types-Cr4uiYo5.js';
|
|
28
|
-
import './types-
|
|
29
|
+
import './types-C3gv9EX6.js';
|
|
29
30
|
import './type-utils-CtHVDRn_.js';
|
|
30
31
|
import 'zod';
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,13 @@ import {
|
|
|
2
2
|
SkillValidationError,
|
|
3
3
|
loadSkills,
|
|
4
4
|
skill
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LXMAFD23.js";
|
|
6
6
|
import {
|
|
7
7
|
transcribe
|
|
8
8
|
} from "./chunk-GKDERULJ.js";
|
|
9
|
+
import {
|
|
10
|
+
generateImage
|
|
11
|
+
} from "./chunk-BEYBU7VJ.js";
|
|
9
12
|
import {
|
|
10
13
|
createMemoryScopeKey
|
|
11
14
|
} from "./chunk-QOUPWOGW.js";
|
|
@@ -14,30 +17,42 @@ import {
|
|
|
14
17
|
} from "./chunk-AI5JMUW7.js";
|
|
15
18
|
import {
|
|
16
19
|
Agent,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
agentContinuationSchema,
|
|
21
|
+
agentInteractionRequestSchema,
|
|
22
|
+
agentInteractionResponseSchema,
|
|
20
23
|
createVectorContext,
|
|
21
|
-
isVectorContext
|
|
22
|
-
|
|
24
|
+
isVectorContext,
|
|
25
|
+
parseAgentContinuation,
|
|
26
|
+
parseAgentInteractionRequest,
|
|
27
|
+
parseAgentInteractionResponse
|
|
28
|
+
} from "./chunk-BY4OMNIU.js";
|
|
23
29
|
import "./chunk-YK4WAAS4.js";
|
|
24
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-5MK3BISB.js";
|
|
25
31
|
import "./chunk-CQNNSZPG.js";
|
|
26
32
|
import {
|
|
27
33
|
createMiddleware,
|
|
34
|
+
createQuestionTool,
|
|
28
35
|
createThinkTool
|
|
29
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-KV6QCRQ4.js";
|
|
30
37
|
import {
|
|
31
38
|
createTool
|
|
32
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-3CMWKK32.js";
|
|
33
40
|
import {
|
|
34
41
|
MemoryCompactionConflictError,
|
|
35
42
|
MemoryCompactionError,
|
|
36
43
|
createSummaryMemoryCompactor,
|
|
37
44
|
isMemoryCompactionMessage
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import
|
|
45
|
+
} from "./chunk-KFR4CDGK.js";
|
|
46
|
+
import "./chunk-VKYZZXP5.js";
|
|
47
|
+
import {
|
|
48
|
+
AgentRunBlockedError,
|
|
49
|
+
AgentRunCancelledError,
|
|
50
|
+
AgentStreamClosedError,
|
|
51
|
+
AgentToolSuspensionError,
|
|
52
|
+
MaxTurnsError
|
|
53
|
+
} from "./chunk-TRQ3XRFD.js";
|
|
54
|
+
import "./chunk-GQL5KRAH.js";
|
|
55
|
+
import "./chunk-3RM57ZT2.js";
|
|
41
56
|
import "./chunk-MGNTXGTX.js";
|
|
42
57
|
import {
|
|
43
58
|
Usage,
|
|
@@ -48,7 +63,7 @@ import {
|
|
|
48
63
|
resolveModelContextLimits,
|
|
49
64
|
streamCompletion,
|
|
50
65
|
withContextUsage
|
|
51
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-D2ECOWN5.js";
|
|
52
67
|
import {
|
|
53
68
|
createMessageSchema,
|
|
54
69
|
isJsonValue,
|
|
@@ -57,7 +72,8 @@ import {
|
|
|
57
72
|
messagesSchema,
|
|
58
73
|
parseMessage,
|
|
59
74
|
parseMessages
|
|
60
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-PK5LKOFL.js";
|
|
76
|
+
import "./chunk-FN7HLLAZ.js";
|
|
61
77
|
import {
|
|
62
78
|
allow,
|
|
63
79
|
block,
|
|
@@ -65,26 +81,28 @@ import {
|
|
|
65
81
|
defineInputGuardrail,
|
|
66
82
|
defineOutputGuardrail,
|
|
67
83
|
guardrails
|
|
68
|
-
} from "./chunk-
|
|
69
|
-
import {
|
|
70
|
-
generateImage
|
|
71
|
-
} from "./chunk-BEYBU7VJ.js";
|
|
72
|
-
import "./chunk-FN7HLLAZ.js";
|
|
84
|
+
} from "./chunk-AZB6N7P4.js";
|
|
73
85
|
export {
|
|
74
86
|
Agent,
|
|
75
87
|
AgentRunBlockedError,
|
|
76
88
|
AgentRunCancelledError,
|
|
89
|
+
AgentStreamClosedError,
|
|
90
|
+
AgentToolSuspensionError,
|
|
77
91
|
MaxTurnsError,
|
|
78
92
|
MemoryCompactionConflictError,
|
|
79
93
|
MemoryCompactionError,
|
|
80
94
|
SkillValidationError,
|
|
81
95
|
Usage,
|
|
96
|
+
agentContinuationSchema,
|
|
97
|
+
agentInteractionRequestSchema,
|
|
98
|
+
agentInteractionResponseSchema,
|
|
82
99
|
allow,
|
|
83
100
|
block,
|
|
84
101
|
calculateContextUsage,
|
|
85
102
|
createMemoryScopeKey,
|
|
86
103
|
createMessageSchema,
|
|
87
104
|
createMiddleware,
|
|
105
|
+
createQuestionTool,
|
|
88
106
|
createSummaryMemoryCompactor,
|
|
89
107
|
createThinkTool,
|
|
90
108
|
createTool,
|
|
@@ -105,6 +123,9 @@ export {
|
|
|
105
123
|
loadSkills,
|
|
106
124
|
messageSchema,
|
|
107
125
|
messagesSchema,
|
|
126
|
+
parseAgentContinuation,
|
|
127
|
+
parseAgentInteractionRequest,
|
|
128
|
+
parseAgentInteractionResponse,
|
|
108
129
|
parseMessage,
|
|
109
130
|
parseMessages,
|
|
110
131
|
resolveModelContextLimits,
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { e as CompletionRequest, f as CompletionResponse, o as JsonValue, x as ToolResultContentPart, J as JsonObject, _ as ToolQuestionAnswer } from './types-D9rKQ_as.js';
|
|
2
|
+
import { M as MaybePromise } from './type-utils-CtHVDRn_.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
type CompletionRequestMiddlewareArgs = {
|
|
6
|
+
turn: number;
|
|
7
|
+
request: CompletionRequest;
|
|
8
|
+
originalRequest: CompletionRequest;
|
|
9
|
+
};
|
|
10
|
+
type CompletionRequestMiddlewareResult = {
|
|
11
|
+
request: CompletionRequest;
|
|
12
|
+
} | undefined;
|
|
13
|
+
type CompletionResponseMiddlewareArgs<RawResponse = unknown> = {
|
|
14
|
+
turn: number;
|
|
15
|
+
request: CompletionRequest;
|
|
16
|
+
response: CompletionResponse<RawResponse>;
|
|
17
|
+
originalResponse: CompletionResponse<RawResponse>;
|
|
18
|
+
};
|
|
19
|
+
type CompletionResponseMiddlewareResult<RawResponse = unknown> = {
|
|
20
|
+
response: CompletionResponse<RawResponse>;
|
|
21
|
+
} | undefined;
|
|
22
|
+
type ToolInputMiddlewareArgs = {
|
|
23
|
+
toolName: string;
|
|
24
|
+
args: string;
|
|
25
|
+
originalArgs: string;
|
|
26
|
+
turn: number;
|
|
27
|
+
toolCallId?: string | undefined;
|
|
28
|
+
internalCallId: string;
|
|
29
|
+
};
|
|
30
|
+
type ToolInputMiddlewareResult = {
|
|
31
|
+
args: JsonValue | string;
|
|
32
|
+
} | undefined;
|
|
33
|
+
type ToolResultMiddlewareArgs = {
|
|
34
|
+
toolName: string;
|
|
35
|
+
args: string;
|
|
36
|
+
result: string;
|
|
37
|
+
originalResult: string;
|
|
38
|
+
structuredResult?: readonly ToolResultContentPart[] | undefined;
|
|
39
|
+
originalStructuredResult?: readonly ToolResultContentPart[] | undefined;
|
|
40
|
+
turn: number;
|
|
41
|
+
toolCallId?: string | undefined;
|
|
42
|
+
internalCallId: string;
|
|
43
|
+
};
|
|
44
|
+
type ToolOutputMiddlewareArgs = ToolResultMiddlewareArgs;
|
|
45
|
+
type ToolOutputMiddlewareResult = string | {
|
|
46
|
+
result?: string | undefined;
|
|
47
|
+
structuredResult?: readonly ToolResultContentPart[] | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
interface AgentMiddleware<RawResponse = unknown> {
|
|
50
|
+
onCompletionRequest?(args: CompletionRequestMiddlewareArgs): MaybePromise<CompletionRequestMiddlewareResult>;
|
|
51
|
+
onCompletionResponse?(args: CompletionResponseMiddlewareArgs<RawResponse>): MaybePromise<CompletionResponseMiddlewareResult<RawResponse>>;
|
|
52
|
+
onToolInput?(args: ToolInputMiddlewareArgs): MaybePromise<ToolInputMiddlewareResult>;
|
|
53
|
+
onToolOutput?(args: ToolOutputMiddlewareArgs): MaybePromise<ToolOutputMiddlewareResult>;
|
|
54
|
+
}
|
|
55
|
+
declare function createMiddleware<RawResponse = unknown>(middleware: AgentMiddleware<RawResponse>): AgentMiddleware<RawResponse>;
|
|
56
|
+
|
|
57
|
+
type AgentQuestionChoice = Readonly<{
|
|
58
|
+
label: string;
|
|
59
|
+
value: string;
|
|
60
|
+
}>;
|
|
61
|
+
type AgentQuestionPrompt = Readonly<{
|
|
62
|
+
id: string;
|
|
63
|
+
text: string;
|
|
64
|
+
choices?: readonly AgentQuestionChoice[];
|
|
65
|
+
allowCustom?: boolean;
|
|
66
|
+
}>;
|
|
67
|
+
type AgentQuestionAnswer = ToolQuestionAnswer;
|
|
68
|
+
type AgentInteractionRequestBase = Readonly<{
|
|
69
|
+
id: string;
|
|
70
|
+
toolName: string;
|
|
71
|
+
toolCallId: string;
|
|
72
|
+
callId?: string;
|
|
73
|
+
internalCallId: string;
|
|
74
|
+
}>;
|
|
75
|
+
type AgentToolApprovalRequest = AgentInteractionRequestBase & Readonly<{
|
|
76
|
+
type: "tool-approval";
|
|
77
|
+
input: JsonValue;
|
|
78
|
+
reason?: string;
|
|
79
|
+
}>;
|
|
80
|
+
type AgentToolQuestionRequest = AgentInteractionRequestBase & Readonly<{
|
|
81
|
+
type: "tool-question";
|
|
82
|
+
questions: readonly AgentQuestionPrompt[];
|
|
83
|
+
}>;
|
|
84
|
+
type AgentInteractionRequest = AgentToolApprovalRequest | AgentToolQuestionRequest;
|
|
85
|
+
type AgentInteractionResponse = Readonly<{
|
|
86
|
+
type: "tool-approval";
|
|
87
|
+
approved: boolean;
|
|
88
|
+
reason?: string;
|
|
89
|
+
}> | Readonly<{
|
|
90
|
+
type: "tool-question";
|
|
91
|
+
answers: readonly AgentQuestionAnswer[];
|
|
92
|
+
}>;
|
|
93
|
+
type AgentContinuation = Readonly<{
|
|
94
|
+
version: 1;
|
|
95
|
+
agentId: string;
|
|
96
|
+
sourceRunId: string;
|
|
97
|
+
interaction: AgentInteractionRequest;
|
|
98
|
+
state: JsonObject;
|
|
99
|
+
}>;
|
|
100
|
+
declare const agentInteractionRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
101
|
+
input: z.ZodCustom<JsonValue, JsonValue>;
|
|
102
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
103
|
+
id: z.ZodString;
|
|
104
|
+
toolName: z.ZodString;
|
|
105
|
+
toolCallId: z.ZodString;
|
|
106
|
+
callId: z.ZodOptional<z.ZodString>;
|
|
107
|
+
internalCallId: z.ZodString;
|
|
108
|
+
type: z.ZodLiteral<"tool-approval">;
|
|
109
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
110
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
111
|
+
id: z.ZodString;
|
|
112
|
+
text: z.ZodString;
|
|
113
|
+
choices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
114
|
+
label: z.ZodString;
|
|
115
|
+
value: z.ZodString;
|
|
116
|
+
}, z.core.$strict>>>;
|
|
117
|
+
allowCustom: z.ZodOptional<z.ZodBoolean>;
|
|
118
|
+
}, z.core.$strict>>;
|
|
119
|
+
id: z.ZodString;
|
|
120
|
+
toolName: z.ZodString;
|
|
121
|
+
toolCallId: z.ZodString;
|
|
122
|
+
callId: z.ZodOptional<z.ZodString>;
|
|
123
|
+
internalCallId: z.ZodString;
|
|
124
|
+
type: z.ZodLiteral<"tool-question">;
|
|
125
|
+
}, z.core.$strict>], "type">;
|
|
126
|
+
declare const agentInteractionResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
127
|
+
type: z.ZodLiteral<"tool-approval">;
|
|
128
|
+
approved: z.ZodBoolean;
|
|
129
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
130
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
131
|
+
type: z.ZodLiteral<"tool-question">;
|
|
132
|
+
answers: z.ZodArray<z.ZodObject<{
|
|
133
|
+
questionId: z.ZodString;
|
|
134
|
+
value: z.ZodString;
|
|
135
|
+
}, z.core.$strict>>;
|
|
136
|
+
}, z.core.$strict>], "type">;
|
|
137
|
+
declare const agentContinuationSchema: z.ZodObject<{
|
|
138
|
+
version: z.ZodLiteral<1>;
|
|
139
|
+
agentId: z.ZodString;
|
|
140
|
+
sourceRunId: z.ZodString;
|
|
141
|
+
interaction: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
142
|
+
input: z.ZodCustom<JsonValue, JsonValue>;
|
|
143
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
144
|
+
id: z.ZodString;
|
|
145
|
+
toolName: z.ZodString;
|
|
146
|
+
toolCallId: z.ZodString;
|
|
147
|
+
callId: z.ZodOptional<z.ZodString>;
|
|
148
|
+
internalCallId: z.ZodString;
|
|
149
|
+
type: z.ZodLiteral<"tool-approval">;
|
|
150
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
151
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
152
|
+
id: z.ZodString;
|
|
153
|
+
text: z.ZodString;
|
|
154
|
+
choices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
155
|
+
label: z.ZodString;
|
|
156
|
+
value: z.ZodString;
|
|
157
|
+
}, z.core.$strict>>>;
|
|
158
|
+
allowCustom: z.ZodOptional<z.ZodBoolean>;
|
|
159
|
+
}, z.core.$strict>>;
|
|
160
|
+
id: z.ZodString;
|
|
161
|
+
toolName: z.ZodString;
|
|
162
|
+
toolCallId: z.ZodString;
|
|
163
|
+
callId: z.ZodOptional<z.ZodString>;
|
|
164
|
+
internalCallId: z.ZodString;
|
|
165
|
+
type: z.ZodLiteral<"tool-question">;
|
|
166
|
+
}, z.core.$strict>], "type">;
|
|
167
|
+
state: z.ZodCustom<JsonObject, JsonObject>;
|
|
168
|
+
}, z.core.$strict>;
|
|
169
|
+
declare function parseAgentInteractionRequest(value: unknown): AgentInteractionRequest;
|
|
170
|
+
declare function parseAgentInteractionResponse(value: unknown): AgentInteractionResponse;
|
|
171
|
+
declare function parseAgentContinuation(value: unknown): AgentContinuation;
|
|
172
|
+
declare function assertAgentInteractionResponse(request: AgentInteractionRequest, response: AgentInteractionResponse): void;
|
|
173
|
+
|
|
174
|
+
export { type AgentContinuation as A, type CompletionRequestMiddlewareArgs as C, type ToolInputMiddlewareArgs as T, type AgentInteractionRequest as a, type AgentInteractionResponse as b, type AgentMiddleware as c, type AgentQuestionAnswer as d, type AgentQuestionChoice as e, type AgentQuestionPrompt as f, type AgentToolApprovalRequest as g, type AgentToolQuestionRequest as h, type CompletionRequestMiddlewareResult as i, type CompletionResponseMiddlewareArgs as j, type CompletionResponseMiddlewareResult as k, type ToolInputMiddlewareResult as l, type ToolOutputMiddlewareArgs as m, type ToolOutputMiddlewareResult as n, type ToolResultMiddlewareArgs as o, agentContinuationSchema as p, agentInteractionRequestSchema as q, agentInteractionResponseSchema as r, createMiddleware as s, parseAgentContinuation as t, parseAgentInteractionRequest as u, parseAgentInteractionResponse as v, assertAgentInteractionResponse as w };
|
package/dist/internal/agent.d.ts
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
import { P as ProviderTool, M as Message, U as Usage, f as CompletionResponse, x as ToolResultContentPart } from '../types-
|
|
3
|
-
import { T as ToolIndex } from '../dynamic-tools-
|
|
4
|
-
import { A as AnyTool
|
|
5
|
-
import {
|
|
6
|
-
import { e as MemoryCompactionInfo } from '../types-BVzM4RsC.js';
|
|
1
|
+
import { R as ResolvedAgentOptions, A as Agent } from '../agent-CXScUOpX.js';
|
|
2
|
+
import { C as CompletionModel, P as ProviderTool, M as Message, U as Usage, f as CompletionResponse, x as ToolResultContentPart } from '../types-D9rKQ_as.js';
|
|
3
|
+
import { T as ToolIndex } from '../dynamic-tools-AEBOTgu1.js';
|
|
4
|
+
import { A as AnyTool } from '../tool-r62gf3QY.js';
|
|
5
|
+
import { e as MemoryCompactionInfo } from '../types-DbolvLtZ.js';
|
|
7
6
|
import '../retry-CjvSlKGW.js';
|
|
8
7
|
import '../zod-schema-C7F4clpm.js';
|
|
9
8
|
import 'zod';
|
|
10
|
-
import '../
|
|
9
|
+
import '../types-CIPaIbZo.js';
|
|
11
10
|
import '../type-utils-CtHVDRn_.js';
|
|
12
|
-
import '../
|
|
13
|
-
import '../client-B8DT1vUG.js';
|
|
11
|
+
import '../client-DvUatElp.js';
|
|
14
12
|
import 'node:child_process';
|
|
15
13
|
import 'node:stream';
|
|
16
14
|
import '@modelcontextprotocol/sdk/client/auth.js';
|
|
17
15
|
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
18
16
|
import '@modelcontextprotocol/sdk/shared/transport.js';
|
|
19
|
-
import '../
|
|
20
|
-
import '../
|
|
17
|
+
import '../types-CElwurHZ.js';
|
|
18
|
+
import '../interactions-csssHYcN.js';
|
|
19
|
+
import '../types-RT3cuyRk.js';
|
|
21
20
|
import '../types-Cr4uiYo5.js';
|
|
22
|
-
import '../
|
|
21
|
+
import '../model-call-options-CZkSw_xN.js';
|
|
22
|
+
import '../types-C3gv9EX6.js';
|
|
23
|
+
|
|
24
|
+
declare function createResolvedAgent<Output = string, M extends CompletionModel = CompletionModel, ContextDocument = unknown>(options: ResolvedAgentOptions<Output, M, ContextDocument>): Agent<Output, M, ContextDocument>;
|
|
25
|
+
declare function getResolvedAgentOptions<Output, M extends CompletionModel, ContextDocument>(agent: Agent<Output, M, ContextDocument>): ResolvedAgentOptions<Output, M, ContextDocument>;
|
|
23
26
|
|
|
24
27
|
type AgentToolState = {
|
|
25
28
|
configuredTools: readonly AnyTool[];
|
|
@@ -110,7 +113,8 @@ type CompletionErrorHookArgs = {
|
|
|
110
113
|
};
|
|
111
114
|
type ToolHookArgs = {
|
|
112
115
|
toolName: string;
|
|
113
|
-
toolCallId
|
|
116
|
+
toolCallId: string;
|
|
117
|
+
callId?: string;
|
|
114
118
|
internalCallId: string;
|
|
115
119
|
args: string;
|
|
116
120
|
};
|
|
@@ -142,14 +146,6 @@ interface AgentHook<RawResponse = unknown> {
|
|
|
142
146
|
|
|
143
147
|
declare function createHook<RawResponse = unknown>(hook: AgentHook<RawResponse>): AgentHook<RawResponse>;
|
|
144
148
|
|
|
145
|
-
type ToolApprovalRequest<Args = unknown> = ToolApprovalContext<Args> & {
|
|
146
|
-
id: string;
|
|
147
|
-
reason?: string | undefined;
|
|
148
|
-
rejectMessage?: string | undefined;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
declare function getAgentApprovalRequestDetails(approval: AgentToolApprovalRequest): ToolApprovalRequest | undefined;
|
|
152
|
-
|
|
153
149
|
type InternalAgentRunOptions = {
|
|
154
150
|
hook?: AgentHook | undefined;
|
|
155
151
|
onFailure?: ((failure: {
|
|
@@ -161,4 +157,4 @@ type InternalAgentRunOptions = {
|
|
|
161
157
|
};
|
|
162
158
|
declare function withInternalAgentRunOptions<T extends object>(options: T, internal: InternalAgentRunOptions): T;
|
|
163
159
|
|
|
164
|
-
export { type AgentHook, type InternalAgentRunOptions, createHook,
|
|
160
|
+
export { Agent, type AgentHook, type InternalAgentRunOptions, ResolvedAgentOptions, createHook, createResolvedAgent, getAgentToolState, getResolvedAgentOptions, withInternalAgentRunOptions };
|