@anvia/core 0.21.0 → 0.22.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/agent/index.d.ts +11 -11
- package/dist/agent/index.js +11 -11
- package/dist/{agent-Q7FT1xmG.d.ts → agent-x3YTyv5i.d.ts} +8 -7
- package/dist/audio-generation/index.d.ts +1 -1
- package/dist/{chunk-6X2UTX3L.js → chunk-2NDQHV7V.js} +6 -6
- package/dist/{chunk-MELYDKWQ.js → chunk-4BGN6PYF.js} +4 -4
- package/dist/{chunk-WHAPIIEZ.js → chunk-4HWN7734.js} +5 -5
- package/dist/{chunk-PJDL5UT2.js → chunk-ADH7NNCS.js} +63 -1
- package/dist/chunk-ADH7NNCS.js.map +1 -0
- package/dist/{chunk-NCPN4SJR.js → chunk-BCA4VZ5W.js} +2 -2
- package/dist/{chunk-SWUH4G2I.js → chunk-I6XOQ4LK.js} +2 -2
- package/dist/{chunk-ZSTUMG7G.js → chunk-KYEBWN3E.js} +6 -6
- package/dist/{chunk-F56AMXMQ.js → chunk-MC3CCKEB.js} +2 -2
- package/dist/{chunk-TGLNXVII.js → chunk-MRQLEK2B.js} +3 -3
- package/dist/{chunk-MTGNA4OS.js → chunk-Q25IWLBT.js} +2 -2
- package/dist/{chunk-ZNTIUOKL.js → chunk-UQX6EXWG.js} +2 -2
- package/dist/{chunk-3IYTCGHS.js → chunk-VXONXP2G.js} +17 -10
- package/dist/{chunk-3IYTCGHS.js.map → chunk-VXONXP2G.js.map} +1 -1
- package/dist/{chunk-N3YV3WCO.js → chunk-YEBIVZM2.js} +22 -5
- package/dist/chunk-YEBIVZM2.js.map +1 -0
- package/dist/completion/index.d.ts +3 -3
- package/dist/completion/index.js +11 -5
- package/dist/{errors-Bf661V89.d.ts → errors-2moLDuuN.d.ts} +2 -2
- package/dist/evals/index.d.ts +8 -8
- package/dist/evals/index.js +12 -12
- package/dist/extractor/index.d.ts +8 -8
- package/dist/extractor/index.js +12 -12
- package/dist/guardrails/index.d.ts +1 -1
- package/dist/hooks/index.d.ts +3 -3
- package/dist/image-generation/index.d.ts +1 -1
- package/dist/{index-XTUEMWhU.d.ts → index-BxSbmOMr.d.ts} +4 -2
- package/dist/index.d.ts +13 -13
- package/dist/index.js +22 -16
- package/dist/internal/agent.d.ts +8 -8
- package/dist/internal/agent.js +9 -9
- package/dist/{json-D9IvOgx_.d.ts → json-BVPssigK.d.ts} +1 -1
- package/dist/loaders/index.d.ts +1 -1
- package/dist/mcp/index.d.ts +4 -4
- package/dist/memory/index.d.ts +4 -4
- package/dist/memory/index.js +4 -4
- package/dist/{middleware-DfMc30in.d.ts → middleware-Dp3d_pxi.d.ts} +3 -3
- package/dist/observability/index.d.ts +3 -3
- package/dist/pipeline/index.d.ts +8 -8
- package/dist/request/index.d.ts +8 -8
- package/dist/request/index.js +8 -8
- package/dist/skills/index.d.ts +4 -4
- package/dist/skills/index.js +5 -5
- package/dist/{think-tool-CpCKo8Q8.d.ts → think-tool-DfCMuO8e.d.ts} +1 -1
- package/dist/tool/index.d.ts +5 -5
- package/dist/tool/index.js +5 -5
- package/dist/{tool-Dhwg__1L.d.ts → tool-Cohdv5GC.d.ts} +1 -1
- package/dist/transcription/index.d.ts +1 -1
- package/dist/{types-fBv8mhvP.d.ts → types-04LqWrmy.d.ts} +1 -1
- package/dist/{types-DBHzPsbx.d.ts → types-BrLbKnEz.d.ts} +1 -1
- package/dist/{types-BCA8p0sb.d.ts → types-D9JpeAPF.d.ts} +1 -1
- package/dist/{types-XjIh933x.d.ts → types-G12i56s2.d.ts} +26 -1
- package/dist/{types-BBEf34DP.d.ts → types-JJCxRnaZ.d.ts} +2 -2
- package/dist/{types-BrxxAtcJ.d.ts → types-O-abTIin.d.ts} +1 -1
- package/dist/ui/index.d.ts +2 -1
- package/dist/ui/index.js +2 -2
- package/dist/vector-store/index.d.ts +4 -4
- package/dist/vector-store/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-N3YV3WCO.js.map +0 -1
- package/dist/chunk-PJDL5UT2.js.map +0 -1
- /package/dist/{chunk-6X2UTX3L.js.map → chunk-2NDQHV7V.js.map} +0 -0
- /package/dist/{chunk-MELYDKWQ.js.map → chunk-4BGN6PYF.js.map} +0 -0
- /package/dist/{chunk-WHAPIIEZ.js.map → chunk-4HWN7734.js.map} +0 -0
- /package/dist/{chunk-NCPN4SJR.js.map → chunk-BCA4VZ5W.js.map} +0 -0
- /package/dist/{chunk-SWUH4G2I.js.map → chunk-I6XOQ4LK.js.map} +0 -0
- /package/dist/{chunk-ZSTUMG7G.js.map → chunk-KYEBWN3E.js.map} +0 -0
- /package/dist/{chunk-F56AMXMQ.js.map → chunk-MC3CCKEB.js.map} +0 -0
- /package/dist/{chunk-TGLNXVII.js.map → chunk-MRQLEK2B.js.map} +0 -0
- /package/dist/{chunk-MTGNA4OS.js.map → chunk-Q25IWLBT.js.map} +0 -0
- /package/dist/{chunk-ZNTIUOKL.js.map → chunk-UQX6EXWG.js.map} +0 -0
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PromptRequest
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VXONXP2G.js";
|
|
4
4
|
import {
|
|
5
5
|
isSkillTool
|
|
6
6
|
} from "./chunk-YK4WAAS4.js";
|
|
7
7
|
import {
|
|
8
8
|
ToolSet
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2NDQHV7V.js";
|
|
10
10
|
import {
|
|
11
11
|
createTool
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4BGN6PYF.js";
|
|
13
13
|
import {
|
|
14
14
|
isStreamingCompletionModel
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-MC3CCKEB.js";
|
|
16
|
+
import {
|
|
17
|
+
getAssistantGenerationMetadata
|
|
18
|
+
} from "./chunk-ADH7NNCS.js";
|
|
16
19
|
|
|
17
20
|
// src/agent/agent.ts
|
|
18
21
|
import { z } from "zod";
|
|
@@ -186,6 +189,20 @@ var AgentSession = class {
|
|
|
186
189
|
}
|
|
187
190
|
return memory.store.load(this.context);
|
|
188
191
|
}
|
|
192
|
+
async contextUsage() {
|
|
193
|
+
const messages = await this.messages();
|
|
194
|
+
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
195
|
+
const message = messages[index];
|
|
196
|
+
if (message === void 0) {
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
const generation = getAssistantGenerationMetadata(message);
|
|
200
|
+
if (generation !== void 0) {
|
|
201
|
+
return generation.contextUsage;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return void 0;
|
|
205
|
+
}
|
|
189
206
|
async clear() {
|
|
190
207
|
const memory = this.agent.memory;
|
|
191
208
|
if (memory === void 0) {
|
|
@@ -205,4 +222,4 @@ export {
|
|
|
205
222
|
Agent,
|
|
206
223
|
AgentSession
|
|
207
224
|
};
|
|
208
|
-
//# sourceMappingURL=chunk-
|
|
225
|
+
//# sourceMappingURL=chunk-YEBIVZM2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/agent/agent.ts","../src/agent/ids.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { isStreamingCompletionModel } from \"../completion/create-completion\";\nimport type {\n CompletionModel,\n ContextUsage,\n Document,\n JsonObject,\n JsonValue,\n Message as MessageType,\n ProviderTool,\n ToolChoice,\n} from \"../completion/index\";\nimport { getAssistantGenerationMetadata } from \"../completion/types\";\nimport type { GuardrailPolicy } from \"../guardrails\";\nimport type { PromptHook } from \"../hooks\";\nimport type { MemoryContext, MemoryRegistration, SessionOptions } from \"../memory/types\";\nimport type { AgentObserverRegistration } from \"../observability\";\nimport { PromptRequest } from \"../request\";\nimport { createTool } from \"../tool/create-tool\";\nimport type { ToolSearchDocument } from \"../tool/dynamic-tools\";\nimport type { AgentMiddleware } from \"../tool/middleware\";\nimport { isSkillTool } from \"../tool/skill-tool-marker\";\nimport type {\n AnyTool,\n NormalizedToolOutput,\n Tool,\n ToolApprovalsOptions,\n ToolCallContext,\n ToolCallStreamEvent,\n} from \"../tool/tool\";\nimport { ToolSet } from \"../tool/tool-set\";\nimport type { VectorSearchIndex } from \"../vector-store\";\nimport { normalizeAgentId } from \"./ids\";\nimport type {\n AgentEventStoreRegistration,\n AgentOptions,\n AgentToolOptions,\n DynamicContextRegistration,\n DynamicToolRegistration,\n} from \"./types\";\n\nexport const DEFAULT_MAX_TURNS = 20;\n\nexport class Agent<M extends CompletionModel = CompletionModel> {\n readonly id: string;\n readonly name: string | undefined;\n readonly description: string | undefined;\n readonly model: M;\n readonly instructions: string | undefined;\n readonly staticContext: Document[];\n readonly temperature: number | undefined;\n readonly maxTokens: number | undefined;\n readonly additionalParams: JsonValue | undefined;\n readonly toolSet: ToolSet;\n readonly providerTools: ProviderTool[];\n readonly toolChoice: ToolChoice | undefined;\n readonly defaultMaxTurns: number | undefined;\n readonly hook: PromptHook | undefined;\n readonly outputSchema: JsonObject | undefined;\n readonly observers: AgentObserverRegistration[];\n readonly approvals: ToolApprovalsOptions | undefined;\n readonly guardrails: GuardrailPolicy[];\n readonly dynamicContexts: DynamicContextRegistration[];\n readonly dynamicTools: DynamicToolRegistration[];\n readonly middlewares: AgentMiddleware[];\n readonly memory: MemoryRegistration | undefined;\n readonly eventStore: AgentEventStoreRegistration | undefined;\n\n constructor(options: AgentOptions<M>) {\n this.id = normalizeAgentId(options.id);\n this.name = options.name;\n this.description = options.description;\n this.model = options.model;\n this.instructions = options.instructions;\n this.staticContext = [...(options.staticContext ?? [])];\n this.temperature = options.temperature;\n this.maxTokens = options.maxTokens;\n this.additionalParams = options.additionalParams;\n this.toolSet = options.toolSet ?? new ToolSet();\n this.providerTools = [...(options.providerTools ?? [])];\n this.toolChoice = options.toolChoice;\n this.defaultMaxTurns = options.defaultMaxTurns ?? DEFAULT_MAX_TURNS;\n this.hook = options.hook;\n this.outputSchema = options.outputSchema;\n this.observers = [...(options.observers ?? [])];\n this.approvals = options.approvals;\n this.guardrails = [...(options.guardrails ?? [])];\n this.dynamicContexts = [...(options.dynamicContexts ?? [])];\n this.dynamicTools = [...(options.dynamicTools ?? [])];\n this.middlewares = [...(options.middlewares ?? [])];\n this.memory = options.memory;\n this.eventStore = options.eventStore;\n }\n\n prompt(prompt: string | MessageType | MessageType[]): PromptRequest<M> {\n return PromptRequest.fromAgent(this, prompt);\n }\n\n session(sessionId: string, options: SessionOptions = {}): AgentSession<M> {\n if (this.memory === undefined) {\n throw new Error(`Agent \"${this.id}\" has no memory store configured.`);\n }\n const normalized = sessionId.trim();\n if (normalized.length === 0) {\n throw new TypeError(\"Session id must be a non-empty string.\");\n }\n const context: MemoryContext = {\n sessionId: normalized,\n };\n if (options.userId !== undefined) {\n context.userId = options.userId;\n }\n if (options.metadata !== undefined) {\n context.metadata = options.metadata;\n }\n return new AgentSession(this, context);\n }\n\n asTool(options: AgentToolOptions): Tool<{ prompt: string }, string> {\n const description =\n options.description ?? this.description ?? `Prompt the ${options.name} agent.`;\n\n return createTool({\n name: options.name,\n description,\n input: z.object({\n prompt: z.string().describe(\"The prompt to send to the agent.\"),\n }),\n output: z.string(),\n execute: async ({ prompt }, context: ToolCallContext) => {\n const request = this.prompt(prompt);\n const childRequest =\n options.maxTurns === undefined ? request : request.maxTurns(options.maxTurns);\n if (\n options.stream === true &&\n context.emitStreamEvent !== undefined &&\n this.model.capabilities.streaming &&\n isStreamingCompletionModel(this.model)\n ) {\n let output = \"\";\n const childStream =\n context.includeToolCallDeltas === false\n ? childRequest.stream({ includeToolCallDeltas: false })\n : childRequest.stream();\n for await (const event of childStream) {\n const streamEvent: ToolCallStreamEvent = {\n agentId: this.id,\n event,\n };\n if (this.name !== undefined) {\n streamEvent.agentName = this.name;\n }\n await context.emitStreamEvent(streamEvent);\n if (event.type === \"final\") {\n output = event.output;\n }\n }\n return output;\n }\n const response = await childRequest.send();\n return response.output;\n },\n });\n }\n\n getTool(toolName: string): AnyTool | undefined {\n const staticTool = this.toolSet.get(toolName);\n if (staticTool !== undefined) {\n return staticTool;\n }\n\n for (const registration of this.dynamicTools) {\n const dynamicTool = dynamicToolSetFromIndex(registration.index)?.get(toolName);\n if (dynamicTool !== undefined) {\n return dynamicTool;\n }\n }\n\n return undefined;\n }\n\n async callTool(\n toolName: string,\n args: string,\n context?: ToolCallContext,\n ): Promise<NormalizedToolOutput> {\n if (this.toolSet.contains(toolName)) {\n return this.toolSet.call(toolName, args, context);\n }\n\n for (const registration of this.dynamicTools) {\n const toolSet = dynamicToolSetFromIndex(registration.index);\n if (toolSet?.contains(toolName)) {\n return toolSet.call(toolName, args, context);\n }\n }\n\n return this.toolSet.call(toolName, args, context);\n }\n\n shouldApplyToolMiddleware(toolName: string): boolean {\n return !isSkillTool(this.getTool(toolName));\n }\n}\n\nexport class AgentSession<M extends CompletionModel = CompletionModel> {\n constructor(\n private readonly agent: Agent<M>,\n private readonly context: {\n sessionId: string;\n userId?: string | undefined;\n metadata?: JsonObject | undefined;\n },\n ) {}\n\n prompt(prompt: string | MessageType): PromptRequest<M> {\n if (Array.isArray(prompt)) {\n throw new TypeError(\"AgentSession.prompt does not accept Message[] transcripts.\");\n }\n return PromptRequest.fromAgent(this.agent, prompt, { memoryContext: this.context });\n }\n\n async messages(): Promise<MessageType[]> {\n const memory = this.agent.memory;\n if (memory === undefined) {\n throw new Error(`Agent \"${this.agent.id}\" has no memory store configured.`);\n }\n return memory.store.load(this.context);\n }\n\n async contextUsage(): Promise<ContextUsage | undefined> {\n const messages = await this.messages();\n for (let index = messages.length - 1; index >= 0; index -= 1) {\n const message = messages[index];\n if (message === undefined) {\n continue;\n }\n const generation = getAssistantGenerationMetadata(message);\n if (generation !== undefined) {\n return generation.contextUsage;\n }\n }\n return undefined;\n }\n\n async clear(): Promise<void> {\n const memory = this.agent.memory;\n if (memory === undefined) {\n throw new Error(`Agent \"${this.agent.id}\" has no memory store configured.`);\n }\n await memory.store.clear(this.context);\n }\n}\n\nfunction dynamicToolSetFromIndex(\n index: VectorSearchIndex<ToolSearchDocument>,\n): ToolSet | undefined {\n const maybeIndex = index as { toolSet?: unknown };\n return maybeIndex.toolSet instanceof ToolSet ? maybeIndex.toolSet : undefined;\n}\n","export function normalizeAgentId(id: string): string {\n if (typeof id !== \"string\") {\n throw new TypeError(\"Agent id must be a string.\");\n }\n\n const normalized = id.trim();\n if (normalized.length === 0) {\n throw new TypeError(\"Agent id must be a non-empty string.\");\n }\n\n return normalized;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;;;ACAX,SAAS,iBAAiB,IAAoB;AACnD,MAAI,OAAO,OAAO,UAAU;AAC1B,UAAM,IAAI,UAAU,4BAA4B;AAAA,EAClD;AAEA,QAAM,aAAa,GAAG,KAAK;AAC3B,MAAI,WAAW,WAAW,GAAG;AAC3B,UAAM,IAAI,UAAU,sCAAsC;AAAA,EAC5D;AAEA,SAAO;AACT;;;AD8BO,IAAM,oBAAoB;AAE1B,IAAM,QAAN,MAAyD;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,SAA0B;AACpC,SAAK,KAAK,iBAAiB,QAAQ,EAAE;AACrC,SAAK,OAAO,QAAQ;AACpB,SAAK,cAAc,QAAQ;AAC3B,SAAK,QAAQ,QAAQ;AACrB,SAAK,eAAe,QAAQ;AAC5B,SAAK,gBAAgB,CAAC,GAAI,QAAQ,iBAAiB,CAAC,CAAE;AACtD,SAAK,cAAc,QAAQ;AAC3B,SAAK,YAAY,QAAQ;AACzB,SAAK,mBAAmB,QAAQ;AAChC,SAAK,UAAU,QAAQ,WAAW,IAAI,QAAQ;AAC9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ACpB;AAAA,IACF;AACA,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,QAAuB;AAC3B,UAAM,SAAS,KAAK,MAAM;AAC1B,QAAI,WAAW,QAAW;AACxB,YAAM,IAAI,MAAM,UAAU,KAAK,MAAM,EAAE,mCAAmC;AAAA,IAC5E;AACA,UAAM,OAAO,MAAM,MAAM,KAAK,OAAO;AAAA,EACvC;AACF;AAEA,SAAS,wBACP,OACqB;AACrB,QAAM,aAAa;AACnB,SAAO,WAAW,mBAAmB,UAAU,WAAW,UAAU;AACtE;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { C as CreateCompletionBaseOptions, a as CreateCompletionInput, b as CreateCompletionOptions, c as CreateCompletionResult, d as CreateCompletionStreamOptions, e as CreateParsedCompletionOptions, f as CreateParsedCompletionResult, g as createCompletion, h as createCompletionStream, i as createParsedCompletion, j as isJsonValue, k as isStreamingCompletionModel } from '../json-
|
|
2
|
-
import { D as Document, M as Message, C as CompletionModel,
|
|
3
|
-
export { A as AssistantContent, a as AssistantGenerationMetadata, b as AssistantMessage, c as AssistantMessageOptions,
|
|
1
|
+
export { C as CreateCompletionBaseOptions, a as CreateCompletionInput, b as CreateCompletionOptions, c as CreateCompletionResult, d as CreateCompletionStreamOptions, e as CreateParsedCompletionOptions, f as CreateParsedCompletionResult, g as createCompletion, h as createCompletionStream, i as createParsedCompletion, j as isJsonValue, k as isStreamingCompletionModel } from '../json-BVPssigK.js';
|
|
2
|
+
import { D as Document, M as Message, C as CompletionModel, i as CompletionTool, L as ToolChoice, l as JsonValue, J as JsonObject, f as CompletionRequest, g as CompletionResponse } from '../types-G12i56s2.js';
|
|
3
|
+
export { A as AssistantContent, a as AssistantGenerationMetadata, b as AssistantMessage, c as AssistantMessageOptions, N as CompletionCapabilityError, O as CompletionModelCapabilities, d as CompletionModelInfo, e as CompletionModelMetadataOptions, h as CompletionSource, Q as CompletionStreamEvent, j as ContextUsage, R as DocumentContent, I as ImageContent, V as ImageDetail, k as JsonPrimitive, m as MessageOptions, n as ModelContextLimits, P as ProviderTool, o as ProviderToolCall, W as Reasoning, X as ReasoningContent, Y as ReasoningContentType, Z as StreamingCompletionModel, S as SystemMessage, T as Text, p as ToolCall, _ as ToolCallArgumentsMode, q as ToolContent, r as ToolDefinition, $ as ToolFunction, s as ToolMessage, t as ToolResult, u as ToolResultContent, v as ToolResultMessageOptions, w as ToolResultOptions, U as Usage, a0 as UsageDetails, x as UserContent, y as UserMessage, a1 as assertCompletionRequestSupported, z as calculateContextUsage, B as getAssistantGenerationMetadata, E as isProviderTool, H as isToolResultContentArray, a2 as reasoningDisplayText, F as resolveCompletionModelInfo, K as serializeToolResultOutput, a3 as textFromAssistantContent, G as withContextUsage } from '../types-G12i56s2.js';
|
|
4
4
|
import '../zod-schema-C7F4clpm.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
package/dist/completion/index.js
CHANGED
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
CompletionRequestBuilder,
|
|
3
3
|
formatDocument,
|
|
4
4
|
normalizeDocuments
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-Q25IWLBT.js";
|
|
6
6
|
import {
|
|
7
7
|
createCompletion,
|
|
8
8
|
createCompletionStream,
|
|
9
9
|
createParsedCompletion,
|
|
10
10
|
isStreamingCompletionModel
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-MC3CCKEB.js";
|
|
12
12
|
import {
|
|
13
13
|
AssistantContent,
|
|
14
14
|
CompletionCapabilityError,
|
|
@@ -17,14 +17,17 @@ import {
|
|
|
17
17
|
Usage,
|
|
18
18
|
UserContent,
|
|
19
19
|
assertCompletionRequestSupported,
|
|
20
|
+
calculateContextUsage,
|
|
20
21
|
getAssistantGenerationMetadata,
|
|
21
22
|
isJsonValue,
|
|
22
23
|
isProviderTool,
|
|
23
24
|
isToolResultContentArray,
|
|
24
25
|
reasoningDisplayText,
|
|
26
|
+
resolveCompletionModelInfo,
|
|
25
27
|
serializeToolResultOutput,
|
|
26
|
-
textFromAssistantContent
|
|
27
|
-
|
|
28
|
+
textFromAssistantContent,
|
|
29
|
+
withContextUsage
|
|
30
|
+
} from "../chunk-ADH7NNCS.js";
|
|
28
31
|
import "../chunk-WQKHFADH.js";
|
|
29
32
|
export {
|
|
30
33
|
AssistantContent,
|
|
@@ -35,6 +38,7 @@ export {
|
|
|
35
38
|
Usage,
|
|
36
39
|
UserContent,
|
|
37
40
|
assertCompletionRequestSupported,
|
|
41
|
+
calculateContextUsage,
|
|
38
42
|
createCompletion,
|
|
39
43
|
createCompletionStream,
|
|
40
44
|
createParsedCompletion,
|
|
@@ -46,7 +50,9 @@ export {
|
|
|
46
50
|
isToolResultContentArray,
|
|
47
51
|
normalizeDocuments,
|
|
48
52
|
reasoningDisplayText,
|
|
53
|
+
resolveCompletionModelInfo,
|
|
49
54
|
serializeToolResultOutput,
|
|
50
|
-
textFromAssistantContent
|
|
55
|
+
textFromAssistantContent,
|
|
56
|
+
withContextUsage
|
|
51
57
|
};
|
|
52
58
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CompletionModel, M as Message, U as Usage } from './types-
|
|
2
|
-
import { S as SummaryMemoryCompactorOptions, e as MemoryCompactor } from './types-
|
|
1
|
+
import { C as CompletionModel, M as Message, U as Usage } from './types-G12i56s2.js';
|
|
2
|
+
import { S as SummaryMemoryCompactorOptions, e as MemoryCompactor } from './types-BrLbKnEz.js';
|
|
3
3
|
|
|
4
4
|
declare function createSummaryMemoryCompactor(model: CompletionModel, options?: SummaryMemoryCompactorOptions): MemoryCompactor;
|
|
5
5
|
declare function isMemoryCompactionSummary(message: Message): boolean;
|
package/dist/evals/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { A as Agent } from '../agent-
|
|
2
|
-
import {
|
|
3
|
-
import { P as PromptResponse } from '../index-
|
|
1
|
+
import { A as Agent } from '../agent-x3YTyv5i.js';
|
|
2
|
+
import { l as JsonValue, M as Message, C as CompletionModel } from '../types-G12i56s2.js';
|
|
3
|
+
import { P as PromptResponse } from '../index-BxSbmOMr.js';
|
|
4
4
|
import { Z as ZodSchema } from '../zod-schema-C7F4clpm.js';
|
|
5
5
|
import { E as EmbeddingModel } from '../types-BCTRUGex.js';
|
|
6
6
|
import '../guardrails/index.js';
|
|
7
|
-
import '../types-
|
|
8
|
-
import '../types-
|
|
9
|
-
import '../tool-
|
|
10
|
-
import '../middleware-
|
|
11
|
-
import '../types-
|
|
7
|
+
import '../types-D9JpeAPF.js';
|
|
8
|
+
import '../types-BrLbKnEz.js';
|
|
9
|
+
import '../tool-Cohdv5GC.js';
|
|
10
|
+
import '../middleware-Dp3d_pxi.js';
|
|
11
|
+
import '../types-O-abTIin.js';
|
|
12
12
|
import 'zod';
|
|
13
13
|
|
|
14
14
|
type EvalOutcome<Score = unknown> = {
|
package/dist/evals/index.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ExtractorBuilder
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-KYEBWN3E.js";
|
|
4
|
+
import "../chunk-4HWN7734.js";
|
|
5
|
+
import "../chunk-YEBIVZM2.js";
|
|
6
|
+
import "../chunk-VXONXP2G.js";
|
|
7
7
|
import "../chunk-YK4WAAS4.js";
|
|
8
8
|
import "../chunk-XUUY2L2D.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-2NDQHV7V.js";
|
|
10
|
+
import "../chunk-4BGN6PYF.js";
|
|
11
11
|
import "../chunk-2ODTMRHP.js";
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-UQX6EXWG.js";
|
|
13
|
+
import "../chunk-MRQLEK2B.js";
|
|
14
|
+
import "../chunk-Q25IWLBT.js";
|
|
15
|
+
import "../chunk-MC3CCKEB.js";
|
|
16
|
+
import "../chunk-ADH7NNCS.js";
|
|
17
|
+
import "../chunk-WQKHFADH.js";
|
|
14
18
|
import {
|
|
15
19
|
cosineSimilarity,
|
|
16
20
|
embedText
|
|
@@ -18,10 +22,6 @@ import {
|
|
|
18
22
|
import {
|
|
19
23
|
mapWithConcurrency
|
|
20
24
|
} from "../chunk-OIMLU4SF.js";
|
|
21
|
-
import "../chunk-MTGNA4OS.js";
|
|
22
|
-
import "../chunk-F56AMXMQ.js";
|
|
23
|
-
import "../chunk-PJDL5UT2.js";
|
|
24
|
-
import "../chunk-WQKHFADH.js";
|
|
25
25
|
import "../chunk-CWUJUSOS.js";
|
|
26
26
|
|
|
27
27
|
// src/evals/agent-target.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { A as Agent } from '../agent-
|
|
1
|
+
import { A as Agent } from '../agent-x3YTyv5i.js';
|
|
2
2
|
import { Z as ZodSchema } from '../zod-schema-C7F4clpm.js';
|
|
3
|
-
import { U as Usage, M as Message, C as CompletionModel,
|
|
3
|
+
import { U as Usage, M as Message, C as CompletionModel, l as JsonValue, L as ToolChoice } from '../types-G12i56s2.js';
|
|
4
4
|
import '../guardrails/index.js';
|
|
5
|
-
import '../types-
|
|
6
|
-
import '../types-
|
|
7
|
-
import '../index-
|
|
8
|
-
import '../tool-
|
|
9
|
-
import '../middleware-
|
|
5
|
+
import '../types-D9JpeAPF.js';
|
|
6
|
+
import '../types-BrLbKnEz.js';
|
|
7
|
+
import '../index-BxSbmOMr.js';
|
|
8
|
+
import '../tool-Cohdv5GC.js';
|
|
9
|
+
import '../middleware-Dp3d_pxi.js';
|
|
10
10
|
import '../types-BCTRUGex.js';
|
|
11
|
-
import '../types-
|
|
11
|
+
import '../types-O-abTIin.js';
|
|
12
12
|
import 'zod';
|
|
13
13
|
|
|
14
14
|
type ExtractionResponse<T> = {
|
package/dist/extractor/index.js
CHANGED
|
@@ -2,23 +2,23 @@ import {
|
|
|
2
2
|
ExtractionError,
|
|
3
3
|
Extractor,
|
|
4
4
|
ExtractorBuilder
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-KYEBWN3E.js";
|
|
6
|
+
import "../chunk-4HWN7734.js";
|
|
7
|
+
import "../chunk-YEBIVZM2.js";
|
|
8
|
+
import "../chunk-VXONXP2G.js";
|
|
9
9
|
import "../chunk-YK4WAAS4.js";
|
|
10
10
|
import "../chunk-XUUY2L2D.js";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-2NDQHV7V.js";
|
|
12
|
+
import "../chunk-4BGN6PYF.js";
|
|
13
13
|
import "../chunk-2ODTMRHP.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-UQX6EXWG.js";
|
|
15
|
+
import "../chunk-MRQLEK2B.js";
|
|
16
|
+
import "../chunk-Q25IWLBT.js";
|
|
17
|
+
import "../chunk-MC3CCKEB.js";
|
|
18
|
+
import "../chunk-ADH7NNCS.js";
|
|
19
|
+
import "../chunk-WQKHFADH.js";
|
|
16
20
|
import "../chunk-MNWK2USR.js";
|
|
17
21
|
import "../chunk-OIMLU4SF.js";
|
|
18
|
-
import "../chunk-MTGNA4OS.js";
|
|
19
|
-
import "../chunk-F56AMXMQ.js";
|
|
20
|
-
import "../chunk-PJDL5UT2.js";
|
|
21
|
-
import "../chunk-WQKHFADH.js";
|
|
22
22
|
import "../chunk-CWUJUSOS.js";
|
|
23
23
|
export {
|
|
24
24
|
ExtractionError,
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { H as HookAction, P as PromptHook, T as ToolApprovalRequestOptions, a as ToolCallHookAction, R as RunControl, b as ToolCallControl } from '../types-
|
|
2
|
-
export { C as CompletionCallHookArgs, c as CompletionErrorHookArgs, d as CompletionResponseHookArgs, e as HookResult, f as RunEndHookArgs, g as RunErrorHookArgs, h as RunStartHookArgs, i as ToolCallHookArgs, j as ToolCallHookResult, k as ToolErrorHookArgs, l as ToolHookArgs, m as ToolResultHookArgs, n as TurnEndHookArgs, o as TurnStartHookArgs } from '../types-
|
|
3
|
-
import '../types-
|
|
1
|
+
import { H as HookAction, P as PromptHook, T as ToolApprovalRequestOptions, a as ToolCallHookAction, R as RunControl, b as ToolCallControl } from '../types-D9JpeAPF.js';
|
|
2
|
+
export { C as CompletionCallHookArgs, c as CompletionErrorHookArgs, d as CompletionResponseHookArgs, e as HookResult, f as RunEndHookArgs, g as RunErrorHookArgs, h as RunStartHookArgs, i as ToolCallHookArgs, j as ToolCallHookResult, k as ToolErrorHookArgs, l as ToolHookArgs, m as ToolResultHookArgs, n as TurnEndHookArgs, o as TurnStartHookArgs } from '../types-D9JpeAPF.js';
|
|
3
|
+
import '../types-G12i56s2.js';
|
|
4
4
|
|
|
5
5
|
declare function createHook<RawResponse = unknown>(hook: PromptHook<RawResponse>): PromptHook<RawResponse>;
|
|
6
6
|
declare function cancelPrompt(reason: string): HookAction;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Y as ReasoningContentType, p as ToolCall, h as CompletionSource, o as ProviderToolCall, U as Usage, j as ContextUsage, M as Message, f as CompletionRequest, u as ToolResultContent, g as CompletionResponse, _ as ToolCallArgumentsMode, J as JsonObject, O as CompletionModelCapabilities, r as ToolDefinition, l as JsonValue } from './types-G12i56s2.js';
|
|
2
2
|
import { GuardrailDecisionRecord } from './guardrails/index.js';
|
|
3
|
-
import { g as ToolCallStreamEvent } from './tool-
|
|
3
|
+
import { g as ToolCallStreamEvent } from './tool-Cohdv5GC.js';
|
|
4
4
|
|
|
5
5
|
type PromptResponse = {
|
|
6
6
|
output: string;
|
|
7
7
|
usage: Usage;
|
|
8
|
+
contextUsage?: ContextUsage | undefined;
|
|
8
9
|
messages: Message[];
|
|
9
10
|
trace?: AgentTraceInfo | undefined;
|
|
10
11
|
guardrails?: GuardrailDecisionRecord[] | undefined;
|
|
@@ -105,6 +106,7 @@ type AgentChildStreamEventBase<RawResponse = unknown> = {
|
|
|
105
106
|
runId: string;
|
|
106
107
|
output: string;
|
|
107
108
|
usage: Usage;
|
|
109
|
+
contextUsage?: ContextUsage | undefined;
|
|
108
110
|
messages: Message[];
|
|
109
111
|
trace?: AgentTraceInfo | undefined;
|
|
110
112
|
guardrails?: GuardrailDecisionRecord[] | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
export { AgentBuilder } from './agent/index.js';
|
|
2
|
-
export { C as CreateCompletionBaseOptions, a as CreateCompletionInput, b as CreateCompletionOptions, c as CreateCompletionResult, d as CreateCompletionStreamOptions, e as CreateParsedCompletionOptions, f as CreateParsedCompletionResult, g as createCompletion, h as createCompletionStream, i as createParsedCompletion, j as isJsonValue } from './json-
|
|
3
|
-
export { A as AssistantContent, a as AssistantGenerationMetadata, b as AssistantMessage, c as AssistantMessageOptions, C as CompletionModel, d as
|
|
2
|
+
export { C as CreateCompletionBaseOptions, a as CreateCompletionInput, b as CreateCompletionOptions, c as CreateCompletionResult, d as CreateCompletionStreamOptions, e as CreateParsedCompletionOptions, f as CreateParsedCompletionResult, g as createCompletion, h as createCompletionStream, i as createParsedCompletion, j as isJsonValue } from './json-BVPssigK.js';
|
|
3
|
+
export { A as AssistantContent, a as AssistantGenerationMetadata, b as AssistantMessage, c as AssistantMessageOptions, C as CompletionModel, d as CompletionModelInfo, e as CompletionModelMetadataOptions, f as CompletionRequest, g as CompletionResponse, h as CompletionSource, i as CompletionTool, j as ContextUsage, D as Document, I as ImageContent, J as JsonObject, k as JsonPrimitive, l as JsonValue, M as Message, m as MessageOptions, n as ModelContextLimits, P as ProviderTool, o as ProviderToolCall, S as SystemMessage, T as Text, p as ToolCall, q as ToolContent, r as ToolDefinition, s as ToolMessage, t as ToolResult, u as ToolResultContent, v as ToolResultMessageOptions, w as ToolResultOptions, U as Usage, x as UserContent, y as UserMessage, z as calculateContextUsage, B as getAssistantGenerationMetadata, E as isProviderTool, F as resolveCompletionModelInfo, G as withContextUsage } from './types-G12i56s2.js';
|
|
4
4
|
export { GuardrailBoundary, GuardrailDecisionRecord, GuardrailMode, GuardrailPolicy, GuardrailPolicyInput, GuardrailPolicyOptions, InputGuardrail, InputGuardrailActions, InputGuardrailContext, OutputGuardrail, OutputGuardrailActions, OutputGuardrailContext, allow, block, defineGuardrailPolicy, defineInputGuardrail, defineOutputGuardrail, guardrails } from './guardrails/index.js';
|
|
5
5
|
export { cancelPrompt, createHook, requestToolApproval, runControl, skipTool, toolCallControl } from './hooks/index.js';
|
|
6
|
-
export { M as MemoryCompactionConflictError, a as MemoryCompactionError, c as createSummaryMemoryCompactor, i as isMemoryCompactionSummary } from './errors-
|
|
7
|
-
export { M as MemoryCompactionCommitInput, a as MemoryCompactionCommitResult, b as MemoryCompactionOptions, c as MemoryCompactionSnapshot, d as MemoryCompactionStore, e as MemoryCompactor, f as MemoryCompactorInput, g as MemoryCompactorResult, h as MemoryConversation, i as MemoryConversationListOptions, j as MemoryConversationMessage, k as MemoryConversationSummary, l as MemoryInspector, m as MemoryStore, R as ResolvedMemoryCompactionOptions, S as SummaryMemoryCompactorOptions } from './types-
|
|
6
|
+
export { M as MemoryCompactionConflictError, a as MemoryCompactionError, c as createSummaryMemoryCompactor, i as isMemoryCompactionSummary } from './errors-2moLDuuN.js';
|
|
7
|
+
export { M as MemoryCompactionCommitInput, a as MemoryCompactionCommitResult, b as MemoryCompactionOptions, c as MemoryCompactionSnapshot, d as MemoryCompactionStore, e as MemoryCompactor, f as MemoryCompactorInput, g as MemoryCompactorResult, h as MemoryConversation, i as MemoryConversationListOptions, j as MemoryConversationMessage, k as MemoryConversationSummary, l as MemoryInspector, m as MemoryStore, R as ResolvedMemoryCompactionOptions, S as SummaryMemoryCompactorOptions } from './types-BrLbKnEz.js';
|
|
8
8
|
export { MaxTurnsError, PromptCancelledError, ToolApprovalRequiredError } from './request/index.js';
|
|
9
|
-
export { C as CompletionRetryContext, a as CompletionRetryOptions } from './agent-
|
|
10
|
-
export { A as AgentChildStreamEvent, a as AgentChildStreamEventWithToolCallDeltas, b as AgentChildStreamEventWithoutToolCallDeltas, c as AgentErrorStreamEvent, d as AgentStreamEvent, e as AgentStreamEventWithToolCallDeltas, f as AgentStreamEventWithoutToolCallDeltas, g as AgentStreamOptions, h as AgentToolCallDeltaEvent, P as PromptResponse } from './index-
|
|
9
|
+
export { C as CompletionRetryContext, a as CompletionRetryOptions } from './agent-x3YTyv5i.js';
|
|
10
|
+
export { A as AgentChildStreamEvent, a as AgentChildStreamEventWithToolCallDeltas, b as AgentChildStreamEventWithoutToolCallDeltas, c as AgentErrorStreamEvent, d as AgentStreamEvent, e as AgentStreamEventWithToolCallDeltas, f as AgentStreamEventWithoutToolCallDeltas, g as AgentStreamOptions, h as AgentToolCallDeltaEvent, P as PromptResponse } from './index-BxSbmOMr.js';
|
|
11
11
|
export { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
|
|
12
12
|
export { loadSkills, skill } from './skills/index.js';
|
|
13
|
-
export { S as SkillValidationError } from './types-
|
|
14
|
-
export { C as CreateToolOptions, c as createThinkTool, a as createTool } from './think-tool-
|
|
15
|
-
export { A as AnyTool, T as Tool, a as ToolApprovalContext, b as ToolApprovalDecision, c as ToolApprovalPolicy, d as ToolApprovalRequest, e as ToolApprovalsOptions, f as ToolCallContext, g as ToolCallStreamEvent } from './tool-
|
|
16
|
-
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-
|
|
13
|
+
export { S as SkillValidationError } from './types-04LqWrmy.js';
|
|
14
|
+
export { C as CreateToolOptions, c as createThinkTool, a as createTool } from './think-tool-DfCMuO8e.js';
|
|
15
|
+
export { A as AnyTool, T as Tool, a as ToolApprovalContext, b as ToolApprovalDecision, c as ToolApprovalPolicy, d as ToolApprovalRequest, e as ToolApprovalsOptions, f as ToolCallContext, g as ToolCallStreamEvent } from './tool-Cohdv5GC.js';
|
|
16
|
+
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-Dp3d_pxi.js';
|
|
17
17
|
export { CreateUIAttachment, UIAttachment, UIError, UIMessage, UIMessagePart, UIMessageRole, UIStreamEvent, UIStreamRequest, UIStreamResume, coreMessagesToUIMessages, uiMessagesToCoreMessages } from './ui/index.js';
|
|
18
|
-
import './types-
|
|
19
|
-
import './types-
|
|
18
|
+
import './types-D9JpeAPF.js';
|
|
19
|
+
import './types-JJCxRnaZ.js';
|
|
20
20
|
import '@modelcontextprotocol/sdk/client/sse.js';
|
|
21
21
|
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
22
22
|
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
23
|
-
import './types-
|
|
23
|
+
import './types-O-abTIin.js';
|
|
24
24
|
import './types-BCTRUGex.js';
|
|
25
25
|
import 'zod';
|
package/dist/index.js
CHANGED
|
@@ -2,31 +2,31 @@ import {
|
|
|
2
2
|
SkillValidationError,
|
|
3
3
|
loadSkills,
|
|
4
4
|
skill
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-BCA4VZ5W.js";
|
|
6
6
|
import {
|
|
7
7
|
coreMessagesToUIMessages,
|
|
8
8
|
uiMessagesToCoreMessages
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-I6XOQ4LK.js";
|
|
10
10
|
import "./chunk-CQNNSZPG.js";
|
|
11
11
|
import "./chunk-XWUC7CIT.js";
|
|
12
12
|
import {
|
|
13
13
|
AgentBuilder
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-4HWN7734.js";
|
|
15
|
+
import "./chunk-YEBIVZM2.js";
|
|
16
16
|
import {
|
|
17
17
|
MaxTurnsError,
|
|
18
18
|
PromptCancelledError,
|
|
19
19
|
ToolApprovalRequiredError
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-VXONXP2G.js";
|
|
21
21
|
import "./chunk-YK4WAAS4.js";
|
|
22
22
|
import "./chunk-XUUY2L2D.js";
|
|
23
23
|
import {
|
|
24
24
|
createMiddleware,
|
|
25
25
|
createThinkTool
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-2NDQHV7V.js";
|
|
27
27
|
import {
|
|
28
28
|
createTool
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-4BGN6PYF.js";
|
|
30
30
|
import {
|
|
31
31
|
cancelPrompt,
|
|
32
32
|
createHook,
|
|
@@ -35,32 +35,35 @@ import {
|
|
|
35
35
|
skipTool,
|
|
36
36
|
toolCallControl
|
|
37
37
|
} from "./chunk-2ODTMRHP.js";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-UQX6EXWG.js";
|
|
39
39
|
import {
|
|
40
40
|
MemoryCompactionConflictError,
|
|
41
41
|
MemoryCompactionError,
|
|
42
42
|
createSummaryMemoryCompactor,
|
|
43
43
|
isMemoryCompactionSummary
|
|
44
|
-
} from "./chunk-
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-OIMLU4SF.js";
|
|
47
|
-
import "./chunk-MTGNA4OS.js";
|
|
44
|
+
} from "./chunk-MRQLEK2B.js";
|
|
45
|
+
import "./chunk-Q25IWLBT.js";
|
|
48
46
|
import {
|
|
49
47
|
createCompletion,
|
|
50
48
|
createCompletionStream,
|
|
51
49
|
createParsedCompletion
|
|
52
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-MC3CCKEB.js";
|
|
53
51
|
import {
|
|
54
52
|
AssistantContent,
|
|
55
53
|
Message,
|
|
56
54
|
ToolContent,
|
|
57
55
|
Usage,
|
|
58
56
|
UserContent,
|
|
57
|
+
calculateContextUsage,
|
|
59
58
|
getAssistantGenerationMetadata,
|
|
60
59
|
isJsonValue,
|
|
61
|
-
isProviderTool
|
|
62
|
-
|
|
60
|
+
isProviderTool,
|
|
61
|
+
resolveCompletionModelInfo,
|
|
62
|
+
withContextUsage
|
|
63
|
+
} from "./chunk-ADH7NNCS.js";
|
|
63
64
|
import "./chunk-WQKHFADH.js";
|
|
65
|
+
import "./chunk-MNWK2USR.js";
|
|
66
|
+
import "./chunk-OIMLU4SF.js";
|
|
64
67
|
import {
|
|
65
68
|
allow,
|
|
66
69
|
block,
|
|
@@ -84,6 +87,7 @@ export {
|
|
|
84
87
|
UserContent,
|
|
85
88
|
allow,
|
|
86
89
|
block,
|
|
90
|
+
calculateContextUsage,
|
|
87
91
|
cancelPrompt,
|
|
88
92
|
coreMessagesToUIMessages,
|
|
89
93
|
createCompletion,
|
|
@@ -104,10 +108,12 @@ export {
|
|
|
104
108
|
isProviderTool,
|
|
105
109
|
loadSkills,
|
|
106
110
|
requestToolApproval,
|
|
111
|
+
resolveCompletionModelInfo,
|
|
107
112
|
runControl,
|
|
108
113
|
skill,
|
|
109
114
|
skipTool,
|
|
110
115
|
toolCallControl,
|
|
111
|
-
uiMessagesToCoreMessages
|
|
116
|
+
uiMessagesToCoreMessages,
|
|
117
|
+
withContextUsage
|
|
112
118
|
};
|
|
113
119
|
//# sourceMappingURL=index.js.map
|
package/dist/internal/agent.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { A as Agent, e as AgentEventAppendInput, f as AgentEventRecord, c as AgentEventStore, g as AgentEventStoreInclude, d as AgentEventStoreOptions, j as AgentEventStoreRegistration, k as AgentOptions, h as AgentSession, i as AgentToolOptions, l as DEFAULT_MAX_TURNS, D as DynamicContextOptions, m as DynamicContextRegistration, b as DynamicToolOptions, n as DynamicToolRegistration } from '../agent-
|
|
2
|
-
import '../types-
|
|
1
|
+
export { A as Agent, e as AgentEventAppendInput, f as AgentEventRecord, c as AgentEventStore, g as AgentEventStoreInclude, d as AgentEventStoreOptions, j as AgentEventStoreRegistration, k as AgentOptions, h as AgentSession, i as AgentToolOptions, l as DEFAULT_MAX_TURNS, D as DynamicContextOptions, m as DynamicContextRegistration, b as DynamicToolOptions, n as DynamicToolRegistration } from '../agent-x3YTyv5i.js';
|
|
2
|
+
import '../types-G12i56s2.js';
|
|
3
3
|
import '../guardrails/index.js';
|
|
4
|
-
import '../types-
|
|
5
|
-
import '../types-
|
|
6
|
-
import '../index-
|
|
7
|
-
import '../tool-
|
|
8
|
-
import '../middleware-
|
|
4
|
+
import '../types-D9JpeAPF.js';
|
|
5
|
+
import '../types-BrLbKnEz.js';
|
|
6
|
+
import '../index-BxSbmOMr.js';
|
|
7
|
+
import '../tool-Cohdv5GC.js';
|
|
8
|
+
import '../middleware-Dp3d_pxi.js';
|
|
9
9
|
import '../types-BCTRUGex.js';
|
|
10
|
-
import '../types-
|
|
10
|
+
import '../types-O-abTIin.js';
|
package/dist/internal/agent.js
CHANGED
|
@@ -2,20 +2,20 @@ import {
|
|
|
2
2
|
Agent,
|
|
3
3
|
AgentSession,
|
|
4
4
|
DEFAULT_MAX_TURNS
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-YEBIVZM2.js";
|
|
6
|
+
import "../chunk-VXONXP2G.js";
|
|
7
7
|
import "../chunk-YK4WAAS4.js";
|
|
8
8
|
import "../chunk-XUUY2L2D.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-2NDQHV7V.js";
|
|
10
|
+
import "../chunk-4BGN6PYF.js";
|
|
11
11
|
import "../chunk-2ODTMRHP.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-MRQLEK2B.js";
|
|
13
|
+
import "../chunk-Q25IWLBT.js";
|
|
14
|
+
import "../chunk-MC3CCKEB.js";
|
|
15
|
+
import "../chunk-ADH7NNCS.js";
|
|
16
|
+
import "../chunk-WQKHFADH.js";
|
|
13
17
|
import "../chunk-MNWK2USR.js";
|
|
14
18
|
import "../chunk-OIMLU4SF.js";
|
|
15
|
-
import "../chunk-MTGNA4OS.js";
|
|
16
|
-
import "../chunk-F56AMXMQ.js";
|
|
17
|
-
import "../chunk-PJDL5UT2.js";
|
|
18
|
-
import "../chunk-WQKHFADH.js";
|
|
19
19
|
import "../chunk-CWUJUSOS.js";
|
|
20
20
|
export {
|
|
21
21
|
Agent,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
|
|
2
|
-
import { M as Message, D as Document,
|
|
2
|
+
import { M as Message, D as Document, i as CompletionTool, L as ToolChoice, J as JsonObject, l as JsonValue, A as AssistantContent, U as Usage, g as CompletionResponse, C as CompletionModel, Z as StreamingCompletionModel, Q as CompletionStreamEvent } from './types-G12i56s2.js';
|
|
3
3
|
|
|
4
4
|
type CreateCompletionInput = string | Message | Message[];
|
|
5
5
|
type CreateCompletionBaseOptions = {
|
package/dist/loaders/index.d.ts
CHANGED
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { M as McpConnection, a as McpServer, b as McpStdioOptions, c as McpHttpOptions, d as McpSseOptions } from '../types-
|
|
2
|
-
export { e as McpClient, f as McpToolCallContent, g as McpToolCallResult, h as McpToolDefinition } from '../types-
|
|
1
|
+
import { M as McpConnection, a as McpServer, b as McpStdioOptions, c as McpHttpOptions, d as McpSseOptions } from '../types-JJCxRnaZ.js';
|
|
2
|
+
export { e as McpClient, f as McpToolCallContent, g as McpToolCallResult, h as McpToolDefinition } from '../types-JJCxRnaZ.js';
|
|
3
3
|
import '@modelcontextprotocol/sdk/client/sse.js';
|
|
4
4
|
import '@modelcontextprotocol/sdk/client/stdio.js';
|
|
5
5
|
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
6
|
-
import '../types-
|
|
7
|
-
import '../tool-
|
|
6
|
+
import '../types-G12i56s2.js';
|
|
7
|
+
import '../tool-Cohdv5GC.js';
|
|
8
8
|
|
|
9
9
|
declare function connectMcp(connection: McpConnection): Promise<McpServer>;
|
|
10
10
|
|
package/dist/memory/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { M as MemoryCompactionConflictError, a as MemoryCompactionError, c as createSummaryMemoryCompactor, i as isMemoryCompactionSummary } from '../errors-
|
|
2
|
-
import { n as MemoryOptions, o as ResolvedMemoryOptions } from '../types-
|
|
3
|
-
export { p as MemoryAppendInput, M as MemoryCompactionCommitInput, a as MemoryCompactionCommitResult, b as MemoryCompactionOptions, c as MemoryCompactionSnapshot, d as MemoryCompactionStore, e as MemoryCompactor, f as MemoryCompactorInput, g as MemoryCompactorResult, q as MemoryContext, h as MemoryConversation, i as MemoryConversationListOptions, j as MemoryConversationMessage, k as MemoryConversationSummary, r as MemoryErrorInput, l as MemoryInspector, s as MemoryRegistration, t as MemorySavePolicy, m as MemoryStore, R as ResolvedMemoryCompactionOptions, u as SessionOptions, S as SummaryMemoryCompactorOptions } from '../types-
|
|
4
|
-
import '../types-
|
|
1
|
+
export { M as MemoryCompactionConflictError, a as MemoryCompactionError, c as createSummaryMemoryCompactor, i as isMemoryCompactionSummary } from '../errors-2moLDuuN.js';
|
|
2
|
+
import { n as MemoryOptions, o as ResolvedMemoryOptions } from '../types-BrLbKnEz.js';
|
|
3
|
+
export { p as MemoryAppendInput, M as MemoryCompactionCommitInput, a as MemoryCompactionCommitResult, b as MemoryCompactionOptions, c as MemoryCompactionSnapshot, d as MemoryCompactionStore, e as MemoryCompactor, f as MemoryCompactorInput, g as MemoryCompactorResult, q as MemoryContext, h as MemoryConversation, i as MemoryConversationListOptions, j as MemoryConversationMessage, k as MemoryConversationSummary, r as MemoryErrorInput, l as MemoryInspector, s as MemoryRegistration, t as MemorySavePolicy, m as MemoryStore, R as ResolvedMemoryCompactionOptions, u as SessionOptions, S as SummaryMemoryCompactorOptions } from '../types-BrLbKnEz.js';
|
|
4
|
+
import '../types-G12i56s2.js';
|
|
5
5
|
|
|
6
6
|
declare function resolveMemoryOptions(options?: MemoryOptions): ResolvedMemoryOptions;
|
|
7
7
|
|
package/dist/memory/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import "../chunk-XWUC7CIT.js";
|
|
2
2
|
import {
|
|
3
3
|
resolveMemoryOptions
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-UQX6EXWG.js";
|
|
5
5
|
import {
|
|
6
6
|
MemoryCompactionConflictError,
|
|
7
7
|
MemoryCompactionError,
|
|
8
8
|
createSummaryMemoryCompactor,
|
|
9
9
|
isMemoryCompactionSummary
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-MRQLEK2B.js";
|
|
11
|
+
import "../chunk-MC3CCKEB.js";
|
|
12
|
+
import "../chunk-ADH7NNCS.js";
|
|
13
13
|
import "../chunk-WQKHFADH.js";
|
|
14
14
|
export {
|
|
15
15
|
MemoryCompactionConflictError,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as ToolDefinition, f as CompletionRequest, g as CompletionResponse, l as JsonValue, u as ToolResultContent } from './types-G12i56s2.js';
|
|
2
2
|
import { V as VectorMetadata, E as EmbeddingModel, c as EmbeddedDocument } from './types-BCTRUGex.js';
|
|
3
|
-
import { A as AnyTool, f as ToolCallContext, N as NormalizedToolOutput } from './tool-
|
|
4
|
-
import { a as VectorSearchIndex } from './types-
|
|
3
|
+
import { A as AnyTool, f as ToolCallContext, N as NormalizedToolOutput } from './tool-Cohdv5GC.js';
|
|
4
|
+
import { a as VectorSearchIndex } from './types-O-abTIin.js';
|
|
5
5
|
|
|
6
6
|
declare class ToolSet {
|
|
7
7
|
private readonly tools;
|