@anvia/core 1.0.0-rc.5 → 1.0.0-rc.6

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.
Files changed (58) hide show
  1. package/README.md +22 -6
  2. package/dist/agent/index.d.ts +20 -14
  3. package/dist/agent/index.js +5 -5
  4. package/dist/agent/interactions/index.d.ts +1 -1
  5. package/dist/{agent-LlCD_2UQ.d.ts → agent-BK3jud9q.d.ts} +10 -10
  6. package/dist/{chunk-E5J4OY4K.js → chunk-7O45T5F2.js} +2 -2
  7. package/dist/{chunk-YDJA4R37.js → chunk-BOCJCECN.js} +2 -2
  8. package/dist/{chunk-HSA6NL2E.js → chunk-HT4P3SSG.js} +61 -5
  9. package/dist/chunk-HT4P3SSG.js.map +1 -0
  10. package/dist/{chunk-DNQNOHD5.js → chunk-QXQQ2DBM.js} +2 -2
  11. package/dist/{chunk-FCANRQ5Q.js → chunk-QXSVVYQK.js} +151 -28
  12. package/dist/chunk-QXSVVYQK.js.map +1 -0
  13. package/dist/{chunk-TEV3OB7N.js → chunk-VGJRXUPT.js} +10 -3
  14. package/dist/chunk-VGJRXUPT.js.map +1 -0
  15. package/dist/{client-DvUatElp.d.ts → client-BdQ_QZsY.d.ts} +2 -2
  16. package/dist/completion/index.d.ts +3 -3
  17. package/dist/completion/index.js +3 -1
  18. package/dist/{dynamic-tools-AEBOTgu1.d.ts → dynamic-tools--Aw37H9d.d.ts} +3 -3
  19. package/dist/evals/index.d.ts +6 -6
  20. package/dist/evals/index.js +3 -3
  21. package/dist/extractor/index.d.ts +1 -1
  22. package/dist/extractor/index.js +2 -2
  23. package/dist/guardrails/index.d.ts +4 -4
  24. package/dist/image-generation/index.d.ts +1 -1
  25. package/dist/index.d.ts +14 -14
  26. package/dist/index.js +7 -5
  27. package/dist/internal/agent.d.ts +11 -11
  28. package/dist/internal/agent.js +5 -5
  29. package/dist/mcp/index.d.ts +4 -4
  30. package/dist/memory/index.d.ts +3 -3
  31. package/dist/memory/index.js +2 -2
  32. package/dist/{message-schema-B2M7AYzR.d.ts → message-schema-_sP_RKhh.d.ts} +18 -2
  33. package/dist/{middleware-BqtLB_Xt.d.ts → middleware-QZsbz7Hf.d.ts} +1 -1
  34. package/dist/observability/index.d.ts +6 -6
  35. package/dist/observability/index.js +2 -2
  36. package/dist/pipeline/index.d.ts +11 -11
  37. package/dist/pipeline/index.js +3 -3
  38. package/dist/skills/index.d.ts +4 -4
  39. package/dist/speech-generation/index.d.ts +1 -1
  40. package/dist/{text-C_6eKrbC.d.ts → text-DTg1a8Mg.d.ts} +1 -1
  41. package/dist/{think-tool-Cz3QYNPX.d.ts → think-tool-C0n_dF2K.d.ts} +1 -1
  42. package/dist/tool/index.d.ts +6 -6
  43. package/dist/{tool-r62gf3QY.d.ts → tool-xHM_GmzT.d.ts} +1 -1
  44. package/dist/transcription/index.d.ts +1 -1
  45. package/dist/{types-1KpjDfoN.d.ts → types-2DBdXArn.d.ts} +7 -5
  46. package/dist/{types-DbolvLtZ.d.ts → types-B1KL4w14.d.ts} +1 -1
  47. package/dist/{types-C3gv9EX6.d.ts → types-D0Y2ZWS3.d.ts} +1 -1
  48. package/dist/{types-CIPaIbZo.d.ts → types-D7A6CIGt.d.ts} +1 -1
  49. package/dist/{types-D9rKQ_as.d.ts → types-DboZvHR_.d.ts} +8 -1
  50. package/dist/{types-RT3cuyRk.d.ts → types-Dyp7arZQ.d.ts} +1 -1
  51. package/dist/vector-store/index.d.ts +4 -4
  52. package/package.json +1 -1
  53. package/dist/chunk-FCANRQ5Q.js.map +0 -1
  54. package/dist/chunk-HSA6NL2E.js.map +0 -1
  55. package/dist/chunk-TEV3OB7N.js.map +0 -1
  56. /package/dist/{chunk-E5J4OY4K.js.map → chunk-7O45T5F2.js.map} +0 -0
  57. /package/dist/{chunk-YDJA4R37.js.map → chunk-BOCJCECN.js.map} +0 -0
  58. /package/dist/{chunk-DNQNOHD5.js.map → chunk-QXQQ2DBM.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
3
- import { e as ToolRequiresApproval, c as ToolCallContext, T as Tool } from './tool-r62gf3QY.js';
3
+ import { e as ToolRequiresApproval, c as ToolCallContext, T as Tool } from './tool-xHM_GmzT.js';
4
4
  import { AgentQuestionPrompt, AgentQuestionAnswer } from './agent/interactions/index.js';
5
5
 
6
6
  type CreateToolOptions<InputSchema extends ZodSchema, OutputSchema extends ZodSchema | undefined = undefined, Output = unknown> = {
@@ -1,15 +1,15 @@
1
- export { d as CreateQuestionToolOptions, e as CreateThinkToolOptions, C as CreateToolOptions, Q as QuestionToolInput, f as QuestionToolOutput, c as createQuestionTool, a as createThinkTool, b as createTool, i as isQuestionTool } from '../think-tool-Cz3QYNPX.js';
2
- export { C as CreateToolIndexOptions, E as EmbedToolsOptions, T as ToolIndex, a as ToolSearchDocument, c as createToolIndex, e as embedTools, i as isToolIndex } from '../dynamic-tools-AEBOTgu1.js';
3
- 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-BqtLB_Xt.js';
4
- export { A as AnyTool, N as NormalizedToolOutput, R as RichToolOutput, T as Tool, a as ToolApprovalContext, b as ToolApprovalRequirement, f as ToolApprovalRunContext, c as ToolCallContext, d as ToolCallStreamEvent, g as ToolOutput, e as ToolRequiresApproval, h as ToolResultSerializationError, n as normalizeToolResultOutput, p as parseToolArgs, t as toolResultContentToText } from '../tool-r62gf3QY.js';
1
+ export { d as CreateQuestionToolOptions, e as CreateThinkToolOptions, C as CreateToolOptions, Q as QuestionToolInput, f as QuestionToolOutput, c as createQuestionTool, a as createThinkTool, b as createTool, i as isQuestionTool } from '../think-tool-C0n_dF2K.js';
2
+ export { C as CreateToolIndexOptions, E as EmbedToolsOptions, T as ToolIndex, a as ToolSearchDocument, c as createToolIndex, e as embedTools, i as isToolIndex } from '../dynamic-tools--Aw37H9d.js';
3
+ 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-QZsbz7Hf.js';
4
+ export { A as AnyTool, N as NormalizedToolOutput, R as RichToolOutput, T as Tool, a as ToolApprovalContext, b as ToolApprovalRequirement, f as ToolApprovalRunContext, c as ToolCallContext, d as ToolCallStreamEvent, g as ToolOutput, e as ToolRequiresApproval, h as ToolResultSerializationError, n as normalizeToolResultOutput, p as parseToolArgs, t as toolResultContentToText } from '../tool-xHM_GmzT.js';
5
5
  import 'zod';
6
6
  import '../zod-schema-C7F4clpm.js';
7
7
  import '../agent/interactions/index.js';
8
- import '../types-D9rKQ_as.js';
8
+ import '../types-DboZvHR_.js';
9
9
  import '../model-call-options-CZkSw_xN.js';
10
10
  import '../retry-CjvSlKGW.js';
11
11
  import '../types-Cr4uiYo5.js';
12
- import '../types-C3gv9EX6.js';
12
+ import '../types-D0Y2ZWS3.js';
13
13
  import '../type-utils-CtHVDRn_.js';
14
14
 
15
15
  declare class ToolCallError extends Error {
@@ -1,4 +1,4 @@
1
- import { J as JsonObject, v as ToolDefinition, o as JsonValue, y as ToolResultOutput, x as ToolResultContentPart } from './types-D9rKQ_as.js';
1
+ import { J as JsonObject, w as ToolDefinition, p as JsonValue, z as ToolResultOutput, y as ToolResultContentPart } from './types-DboZvHR_.js';
2
2
 
3
3
  type ToolApprovalRunContext = {
4
4
  agentId: string;
@@ -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-D9rKQ_as.js';
4
+ import { J as JsonObject } from '../types-DboZvHR_.js';
5
5
 
6
6
  type TranscriptionRequest = {
7
7
  data: Uint8Array;
@@ -1,11 +1,11 @@
1
1
  import { AgentInteractionRequest, AgentContinuation, AgentInteractionResponse } from './agent/interactions/index.js';
2
2
  import { b as RetrySetting } from './retry-CjvSlKGW.js';
3
- import { M as Message, f as CompletionResponse, U as Usage, R as ReasoningContentType, t as ToolCallPart, h as CompletionSource, q as ProviderToolCall, E as UserMessage, k as ContextUsage, e as CompletionRequest, y as ToolResultOutput, x as ToolResultContentPart, Z as ToolInteractionResponsePart, Y as ToolCallArgumentsMode, J as JsonObject, Q as CompletionModelCapabilities, v as ToolDefinition } from './types-D9rKQ_as.js';
4
- import { d as GuardrailPolicyInput, a as GuardrailDecisionRecord } from './types-CIPaIbZo.js';
5
- import { e as MemoryCompactionInfo, z as MemoryScope } from './types-DbolvLtZ.js';
3
+ import { M as Message, g as CompletionResponse, U as Usage, R as ReasoningContentType, u as ToolCallPart, i as CompletionSource, r as ProviderToolCall, G as UserMessage, C as CompletionFinishReason, l as ContextUsage, f as CompletionRequest, z as ToolResultOutput, y as ToolResultContentPart, _ as ToolInteractionResponsePart, Z as ToolCallArgumentsMode, J as JsonObject, V as CompletionModelCapabilities, w as ToolDefinition } from './types-DboZvHR_.js';
4
+ import { d as GuardrailPolicyInput, a as GuardrailDecisionRecord } from './types-D7A6CIGt.js';
5
+ import { e as MemoryCompactionInfo, z as MemoryScope } from './types-B1KL4w14.js';
6
6
  import { D as DeepReadonly, M as MaybePromise } from './type-utils-CtHVDRn_.js';
7
- import { d as ToolCallStreamEvent } from './tool-r62gf3QY.js';
8
- import { A as AgentMiddleware } from './middleware-BqtLB_Xt.js';
7
+ import { d as ToolCallStreamEvent } from './tool-xHM_GmzT.js';
8
+ import { A as AgentMiddleware } from './middleware-QZsbz7Hf.js';
9
9
 
10
10
  type AgentLifecycleRunEvent = {
11
11
  runId: string;
@@ -112,6 +112,8 @@ type AgentResultBase = {
112
112
  runId: string;
113
113
  text: string;
114
114
  usage: Usage;
115
+ finishReason?: CompletionFinishReason | undefined;
116
+ providerFinishReason?: string | undefined;
115
117
  contextUsage?: ContextUsage | undefined;
116
118
  messages: Message[];
117
119
  trace?: AgentTraceInfo | undefined;
@@ -1,4 +1,4 @@
1
- import { U as Usage, J as JsonObject, M as Message, S as SystemMessage, C as CompletionModel } from './types-D9rKQ_as.js';
1
+ import { U as Usage, J as JsonObject, M as Message, S as SystemMessage, c as CompletionModel } from './types-DboZvHR_.js';
2
2
  import { b as RetrySetting } from './retry-CjvSlKGW.js';
3
3
 
4
4
  type MemorySavePolicy = "message" | "turn" | "run";
@@ -1,5 +1,5 @@
1
1
  import { b as RetrySetting } from './retry-CjvSlKGW.js';
2
- import { J as JsonObject } from './types-D9rKQ_as.js';
2
+ import { J as JsonObject } from './types-DboZvHR_.js';
3
3
  import { b as VectorMetadataValue, V as VectorMetadata, a as EmbeddedDocument, S as SparseVector, E as EmbeddingModel, c as SparseEmbeddingModel } from './types-Cr4uiYo5.js';
4
4
 
5
5
  type VectorFilter = {
@@ -1,4 +1,4 @@
1
- import { M as Message, J as JsonObject, U as Usage } from './types-D9rKQ_as.js';
1
+ import { M as Message, J as JsonObject, U as Usage } from './types-DboZvHR_.js';
2
2
  import { M as MaybePromise } from './type-utils-CtHVDRn_.js';
3
3
 
4
4
  type GuardrailMode = "enforce" | "observe";
@@ -211,6 +211,8 @@ type AssistantGenerationMetadata = {
211
211
  provider: string;
212
212
  modelId: string;
213
213
  usage: Usage;
214
+ finishReason?: CompletionFinishReason;
215
+ providerFinishReason?: string;
214
216
  contextUsage?: ContextUsage;
215
217
  sources?: CompletionSource[];
216
218
  providerToolCalls?: ProviderToolCall[];
@@ -240,9 +242,12 @@ type CompletionRequest = {
240
242
  providerOptions?: JsonObject;
241
243
  outputSchema?: JsonObject;
242
244
  };
245
+ type CompletionFinishReason = "stop" | "length" | "content-filter" | "tool-calls" | "other";
243
246
  type CompletionResponse<RawResponse = unknown> = {
244
247
  choice: AssistantContentPart[];
245
248
  usage: Usage;
249
+ finishReason?: CompletionFinishReason;
250
+ providerFinishReason?: string;
246
251
  contextUsage?: ContextUsage;
247
252
  rawResponse: RawResponse;
248
253
  messageId?: string;
@@ -254,6 +259,8 @@ type CompletionResult<Output = string, RawResponse = unknown> = {
254
259
  text: string;
255
260
  content: readonly AssistantContentPart[];
256
261
  usage: Usage;
262
+ finishReason?: CompletionFinishReason;
263
+ providerFinishReason?: string;
257
264
  contextUsage?: ContextUsage;
258
265
  rawResponse: RawResponse;
259
266
  messageId?: string;
@@ -338,4 +345,4 @@ declare function assertCompletionRequestSupported(model: CompletionModel, reques
338
345
  }): void;
339
346
  declare function textFromAssistantContent(content: readonly AssistantContentPart[]): string;
340
347
 
341
- export { type ToolQuestionResponsePart as $, type AssistantContentPart as A, type UserContentPart as B, type CompletionModel as C, type Document as D, type UserMessage as E, type FileData as F, calculateContextUsage as G, getAssistantGenerationMetadata as H, type ImageDetail as I, type JsonObject as J, isProviderTool as K, resolveModelContextLimits as L, type Message as M, withContextUsage as N, CompletionCapabilityError as O, type ProviderTool as P, type CompletionModelCapabilities as Q, type ReasoningContentType as R, type SystemMessage as S, type TextPart as T, Usage as U, type CompletionStreamPart as V, type StreamingCompletionModel as W, type ToolApprovalResponsePart as X, type ToolCallArgumentsMode as Y, type ToolInteractionResponsePart as Z, type ToolQuestionAnswer as _, type AssistantGenerationMetadata as a, type UsageDetails as a0, assertCompletionRequestSupported as a1, reasoningDisplayText as a2, textFromAssistantContent as a3, type AssistantMessage as b, type CompletionModelInfo as c, type CompletionModelStreamEvent as d, type CompletionRequest as e, type CompletionResponse as f, type CompletionResult as g, type CompletionSource as h, type CompletionStreamEvent as i, type CompletionTool as j, type ContextUsage as k, type FilePart as l, type ImagePart as m, type JsonPrimitive as n, type JsonValue as o, type ModelContextLimits as p, type ProviderToolCall as q, type ReasoningDetail as r, type ReasoningPart as s, type ToolCallPart as t, type ToolChoice as u, type ToolDefinition as v, type ToolMessage as w, type ToolResultContentPart as x, type ToolResultOutput as y, type ToolResultPart as z };
348
+ export { type ToolQuestionAnswer as $, type AssistantContentPart as A, type ToolResultPart as B, type CompletionFinishReason as C, type Document as D, type UserContentPart as E, type FileData as F, type UserMessage as G, calculateContextUsage as H, type ImageDetail as I, type JsonObject as J, getAssistantGenerationMetadata as K, isProviderTool as L, type Message as M, resolveModelContextLimits as N, withContextUsage as O, type ProviderTool as P, CompletionCapabilityError as Q, type ReasoningContentType as R, type SystemMessage as S, type TextPart as T, Usage as U, type CompletionModelCapabilities as V, type CompletionStreamPart as W, type StreamingCompletionModel as X, type ToolApprovalResponsePart as Y, type ToolCallArgumentsMode as Z, type ToolInteractionResponsePart as _, type AssistantGenerationMetadata as a, type ToolQuestionResponsePart as a0, type UsageDetails as a1, assertCompletionRequestSupported as a2, reasoningDisplayText as a3, textFromAssistantContent as a4, type AssistantMessage as b, type CompletionModel as c, type CompletionModelInfo as d, type CompletionModelStreamEvent as e, type CompletionRequest as f, type CompletionResponse as g, type CompletionResult as h, type CompletionSource as i, type CompletionStreamEvent as j, type CompletionTool as k, type ContextUsage as l, type FilePart as m, type ImagePart as n, type JsonPrimitive as o, type JsonValue as p, type ModelContextLimits as q, type ProviderToolCall as r, type ReasoningDetail as s, type ReasoningPart as t, type ToolCallPart as u, type ToolChoice as v, type ToolDefinition as w, type ToolMessage as x, type ToolResultContentPart as y, type ToolResultOutput as z };
@@ -1,4 +1,4 @@
1
- import { A as AnyTool } from './tool-r62gf3QY.js';
1
+ import { A as AnyTool } from './tool-xHM_GmzT.js';
2
2
 
3
3
  type Skill = {
4
4
  readonly name: string;
@@ -1,10 +1,10 @@
1
1
  import { V as VectorMetadata, b as VectorMetadataValue, a as EmbeddedDocument } from '../types-Cr4uiYo5.js';
2
- import { T as Tool } from '../tool-r62gf3QY.js';
3
- import { V as VectorFilter, R as RetrieveDocumentsOptions, a as VectorSearchResult, f as RetrieveHybridDocumentsOptions, d as VectorStore, I as IndexStrategy, g as VectorStoreUpsertOptions, h as VectorSearchRequest, b as VectorInspectRequest, c as VectorInspectPage, i as VectorSearchToolOptions } from '../types-C3gv9EX6.js';
4
- export { D as DenseVectorSearchToolOptions, j as HybridVectorSearchRequest, k as HybridVectorSearchToolOptions, H as HybridVectorStore, L as LshOptions, l as RetrieveDocumentsBaseOptions, e as VectorFusion, m as VectorInspectItem, n as VectorMetric, o as VectorSearchToolBaseOptions } from '../types-C3gv9EX6.js';
2
+ import { T as Tool } from '../tool-xHM_GmzT.js';
3
+ import { V as VectorFilter, R as RetrieveDocumentsOptions, a as VectorSearchResult, f as RetrieveHybridDocumentsOptions, d as VectorStore, I as IndexStrategy, g as VectorStoreUpsertOptions, h as VectorSearchRequest, b as VectorInspectRequest, c as VectorInspectPage, i as VectorSearchToolOptions } from '../types-D0Y2ZWS3.js';
4
+ export { D as DenseVectorSearchToolOptions, j as HybridVectorSearchRequest, k as HybridVectorSearchToolOptions, H as HybridVectorStore, L as LshOptions, l as RetrieveDocumentsBaseOptions, e as VectorFusion, m as VectorInspectItem, n as VectorMetric, o as VectorSearchToolBaseOptions } from '../types-D0Y2ZWS3.js';
5
5
  import '../model-call-options-CZkSw_xN.js';
6
6
  import '../retry-CjvSlKGW.js';
7
- import '../types-D9rKQ_as.js';
7
+ import '../types-DboZvHR_.js';
8
8
 
9
9
  declare const vectorFilter: {
10
10
  eq(key: string, value: VectorMetadataValue): VectorFilter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvia/core",
3
- "version": "1.0.0-rc.5",
3
+ "version": "1.0.0-rc.6",
4
4
  "description": "Core runtime primitives for context-aware Anvia agents.",
5
5
  "author": "anvia",
6
6
  "maintainer": "Indra Zulfi",