@anvia/core 0.16.0 → 0.17.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.
Files changed (68) hide show
  1. package/dist/agent/index.d.ts +11 -11
  2. package/dist/agent/index.js +8 -8
  3. package/dist/{agent-BTiQ4RZn.d.ts → agent-Cg0UigNK.d.ts} +7 -7
  4. package/dist/audio-generation/index.d.ts +1 -1
  5. package/dist/{chunk-3PRP2DV4.js → chunk-54S4I3SX.js} +6 -6
  6. package/dist/{chunk-DC2GJDPR.js → chunk-77D7XBWL.js} +2 -2
  7. package/dist/{chunk-3QG4SFH4.js → chunk-BQCTJSNL.js} +5 -5
  8. package/dist/{chunk-I7TM7TKX.js → chunk-F3C5653H.js} +4 -4
  9. package/dist/{chunk-K72JKDZ7.js → chunk-GCED5ZNM.js} +2 -2
  10. package/dist/{chunk-PJCJ45RJ.js → chunk-OPAEENGD.js} +38 -13
  11. package/dist/chunk-OPAEENGD.js.map +1 -0
  12. package/dist/{chunk-R6QERZAB.js → chunk-PJDL5UT2.js} +52 -4
  13. package/dist/chunk-PJDL5UT2.js.map +1 -0
  14. package/dist/{chunk-A7AYX6BD.js → chunk-RWAOHGRL.js} +4 -4
  15. package/dist/{chunk-IT426VXL.js → chunk-SWUH4G2I.js} +2 -2
  16. package/dist/{chunk-4PMAWIGM.js → chunk-SWUIBS4N.js} +6 -6
  17. package/dist/completion/index.d.ts +3 -3
  18. package/dist/completion/index.js +2 -2
  19. package/dist/evals/index.d.ts +8 -8
  20. package/dist/evals/index.js +9 -9
  21. package/dist/extractor/index.d.ts +8 -8
  22. package/dist/extractor/index.js +9 -9
  23. package/dist/guardrails/index.d.ts +1 -1
  24. package/dist/hooks/index.d.ts +3 -3
  25. package/dist/image-generation/index.d.ts +1 -1
  26. package/dist/{index-Du1vCw6J.d.ts → index-XTUEMWhU.d.ts} +16 -8
  27. package/dist/index.d.ts +12 -12
  28. package/dist/index.js +11 -11
  29. package/dist/internal/agent.d.ts +8 -8
  30. package/dist/internal/agent.js +7 -7
  31. package/dist/{json-D_Ijo4lJ.d.ts → json-D9IvOgx_.d.ts} +1 -1
  32. package/dist/loaders/index.d.ts +1 -1
  33. package/dist/mcp/index.d.ts +4 -4
  34. package/dist/memory/index.d.ts +3 -3
  35. package/dist/{middleware-CsxdqqjJ.d.ts → middleware-Cp0tm6zE.d.ts} +3 -3
  36. package/dist/observability/index.d.ts +3 -3
  37. package/dist/observability/index.js.map +1 -1
  38. package/dist/pipeline/index.d.ts +8 -8
  39. package/dist/request/index.d.ts +8 -8
  40. package/dist/request/index.js +6 -6
  41. package/dist/skills/index.d.ts +4 -4
  42. package/dist/skills/index.js +5 -5
  43. package/dist/{think-tool-BTFFKn1m.d.ts → think-tool-CpCKo8Q8.d.ts} +1 -1
  44. package/dist/tool/index.d.ts +5 -5
  45. package/dist/tool/index.js +5 -5
  46. package/dist/{tool-sKozRXMI.d.ts → tool-Dhwg__1L.d.ts} +1 -1
  47. package/dist/transcription/index.d.ts +1 -1
  48. package/dist/{types-yf-Exga_.d.ts → types-BBEf34DP.d.ts} +2 -2
  49. package/dist/{types-CHFrSm-3.d.ts → types-BCA8p0sb.d.ts} +1 -1
  50. package/dist/{types-DMQ8JEf8.d.ts → types-CBmhLT_r.d.ts} +1 -1
  51. package/dist/{types-BkTDw00d.d.ts → types-DMGvEFRf.d.ts} +1 -1
  52. package/dist/{types-nybevqL9.d.ts → types-XjIh933x.d.ts} +9 -1
  53. package/dist/{types-BT1n5oU4.d.ts → types-fBv8mhvP.d.ts} +1 -1
  54. package/dist/ui/index.d.ts +1 -1
  55. package/dist/ui/index.js +2 -2
  56. package/dist/vector-store/index.d.ts +4 -4
  57. package/dist/vector-store/index.js +2 -2
  58. package/package.json +1 -1
  59. package/dist/chunk-PJCJ45RJ.js.map +0 -1
  60. package/dist/chunk-R6QERZAB.js.map +0 -1
  61. /package/dist/{chunk-3PRP2DV4.js.map → chunk-54S4I3SX.js.map} +0 -0
  62. /package/dist/{chunk-DC2GJDPR.js.map → chunk-77D7XBWL.js.map} +0 -0
  63. /package/dist/{chunk-3QG4SFH4.js.map → chunk-BQCTJSNL.js.map} +0 -0
  64. /package/dist/{chunk-I7TM7TKX.js.map → chunk-F3C5653H.js.map} +0 -0
  65. /package/dist/{chunk-K72JKDZ7.js.map → chunk-GCED5ZNM.js.map} +0 -0
  66. /package/dist/{chunk-A7AYX6BD.js.map → chunk-RWAOHGRL.js.map} +0 -0
  67. /package/dist/{chunk-IT426VXL.js.map → chunk-SWUH4G2I.js.map} +0 -0
  68. /package/dist/{chunk-4PMAWIGM.js.map → chunk-SWUIBS4N.js.map} +0 -0
@@ -2,15 +2,15 @@ import {
2
2
  SkillValidationError,
3
3
  loadSkills,
4
4
  skill
5
- } from "../chunk-DC2GJDPR.js";
5
+ } from "../chunk-77D7XBWL.js";
6
6
  import "../chunk-CQNNSZPG.js";
7
7
  import "../chunk-YK4WAAS4.js";
8
- import "../chunk-4PMAWIGM.js";
9
- import "../chunk-I7TM7TKX.js";
10
- import "../chunk-R6QERZAB.js";
11
- import "../chunk-WQKHFADH.js";
8
+ import "../chunk-SWUIBS4N.js";
9
+ import "../chunk-F3C5653H.js";
12
10
  import "../chunk-YBBD4HZ3.js";
13
11
  import "../chunk-OIMLU4SF.js";
12
+ import "../chunk-PJDL5UT2.js";
13
+ import "../chunk-WQKHFADH.js";
14
14
  export {
15
15
  SkillValidationError,
16
16
  loadSkills,
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { Z as ZodSchema } from './zod-schema-C7F4clpm.js';
3
- import { c as ToolApprovalPolicy, f as ToolCallContext, T as Tool } from './tool-sKozRXMI.js';
3
+ import { c as ToolApprovalPolicy, f as ToolCallContext, T as Tool } from './tool-Dhwg__1L.js';
4
4
 
5
5
  type CreateToolOptions<InputSchema extends ZodSchema, OutputSchema extends ZodSchema | undefined = undefined, Output = unknown> = {
6
6
  name: string;
@@ -1,11 +1,11 @@
1
- export { b as CreateThinkToolOptions, C as CreateToolOptions, c as createThinkTool, a as createTool } from '../think-tool-BTFFKn1m.js';
2
- export { A as AgentMiddleware, C as CompletionRequestMiddlewareArgs, a as CompletionRequestMiddlewareResult, b as CompletionResponseMiddlewareArgs, c as CompletionResponseMiddlewareResult, D as DynamicToolIndex, E as EmbedToolsOptions, T as ToolInputMiddlewareArgs, d as ToolInputMiddlewareResult, e as ToolMiddleware, f as ToolOutputMiddlewareArgs, g as ToolOutputMiddlewareResult, h as ToolResultMiddlewareArgs, k as ToolSearchDocument, l as ToolSet, i as createMiddleware, m as createToolIndex, j as createToolMiddleware, n as embedTools, o as isDynamicToolIndex } from '../middleware-CsxdqqjJ.js';
3
- export { A as AnyTool, N as NormalizedToolOutput, T as Tool, a as ToolApprovalContext, b as ToolApprovalDecision, c as ToolApprovalPolicy, d as ToolApprovalRequest, h as ToolApprovalRunContext, e as ToolApprovalsOptions, f as ToolCallContext, g as ToolCallStreamEvent, i as ToolOutput, n as normalizeToolResultOutput, p as parseToolArgs, t as toolResultContentToText } from '../tool-sKozRXMI.js';
4
- export { x as isToolResultContentArray, y as serializeToolOutput } from '../types-nybevqL9.js';
1
+ export { b as CreateThinkToolOptions, C as CreateToolOptions, c as createThinkTool, a as createTool } from '../think-tool-CpCKo8Q8.js';
2
+ export { A as AgentMiddleware, C as CompletionRequestMiddlewareArgs, a as CompletionRequestMiddlewareResult, b as CompletionResponseMiddlewareArgs, c as CompletionResponseMiddlewareResult, D as DynamicToolIndex, E as EmbedToolsOptions, T as ToolInputMiddlewareArgs, d as ToolInputMiddlewareResult, e as ToolMiddleware, f as ToolOutputMiddlewareArgs, g as ToolOutputMiddlewareResult, h as ToolResultMiddlewareArgs, k as ToolSearchDocument, l as ToolSet, i as createMiddleware, m as createToolIndex, j as createToolMiddleware, n as embedTools, o as isDynamicToolIndex } from '../middleware-Cp0tm6zE.js';
3
+ export { A as AnyTool, N as NormalizedToolOutput, T as Tool, a as ToolApprovalContext, b as ToolApprovalDecision, c as ToolApprovalPolicy, d as ToolApprovalRequest, h as ToolApprovalRunContext, e as ToolApprovalsOptions, f as ToolCallContext, g as ToolCallStreamEvent, i as ToolOutput, n as normalizeToolResultOutput, p as parseToolArgs, t as toolResultContentToText } from '../tool-Dhwg__1L.js';
4
+ export { x as isToolResultContentArray, y as serializeToolOutput } from '../types-XjIh933x.js';
5
5
  import 'zod';
6
6
  import '../zod-schema-C7F4clpm.js';
7
7
  import '../types-DHHZztGO.js';
8
- import '../types-BkTDw00d.js';
8
+ import '../types-DMGvEFRf.js';
9
9
 
10
10
  declare class ToolCallError extends Error {
11
11
  readonly cause?: unknown | undefined;
@@ -13,17 +13,17 @@ import {
13
13
  normalizeToolResultOutput,
14
14
  parseToolArgs,
15
15
  toolResultContentToText
16
- } from "../chunk-4PMAWIGM.js";
16
+ } from "../chunk-SWUIBS4N.js";
17
17
  import {
18
18
  createTool
19
- } from "../chunk-I7TM7TKX.js";
19
+ } from "../chunk-F3C5653H.js";
20
+ import "../chunk-YBBD4HZ3.js";
21
+ import "../chunk-OIMLU4SF.js";
20
22
  import {
21
23
  isToolResultContentArray,
22
24
  serializeToolResultOutput
23
- } from "../chunk-R6QERZAB.js";
25
+ } from "../chunk-PJDL5UT2.js";
24
26
  import "../chunk-WQKHFADH.js";
25
- import "../chunk-YBBD4HZ3.js";
26
- import "../chunk-OIMLU4SF.js";
27
27
  export {
28
28
  ToolCallError,
29
29
  ToolJsonError,
@@ -1,4 +1,4 @@
1
- import { J as JsonObject, n as ToolDefinition, q as ToolResultContent, i as JsonValue } from './types-nybevqL9.js';
1
+ import { J as JsonObject, n as ToolDefinition, q as ToolResultContent, i as JsonValue } from './types-XjIh933x.js';
2
2
 
3
3
  type ToolApprovalRunContext = {
4
4
  agentId: string;
@@ -1,4 +1,4 @@
1
- import { i as JsonValue } from '../types-nybevqL9.js';
1
+ import { i as JsonValue } from '../types-XjIh933x.js';
2
2
 
3
3
  type TranscriptionRequest = {
4
4
  data: Uint8Array;
@@ -1,8 +1,8 @@
1
1
  import { SSEClientTransportOptions } from '@modelcontextprotocol/sdk/client/sse.js';
2
2
  import { StdioServerParameters } from '@modelcontextprotocol/sdk/client/stdio.js';
3
3
  import { StreamableHTTPClientTransportOptions } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
4
- import { J as JsonObject } from './types-nybevqL9.js';
5
- import { A as AnyTool } from './tool-sKozRXMI.js';
4
+ import { J as JsonObject } from './types-XjIh933x.js';
5
+ import { A as AnyTool } from './tool-Dhwg__1L.js';
6
6
 
7
7
  type McpToolDefinition = {
8
8
  name: string;
@@ -1,4 +1,4 @@
1
- import { M as Message, U as Usage, e as CompletionResponse, q as ToolResultContent } from './types-nybevqL9.js';
1
+ import { M as Message, U as Usage, e as CompletionResponse, q as ToolResultContent } from './types-XjIh933x.js';
2
2
 
3
3
  type HookAction = {
4
4
  type: "continue";
@@ -1,4 +1,4 @@
1
- import { J as JsonObject, M as Message } from './types-nybevqL9.js';
1
+ import { J as JsonObject, M as Message } from './types-XjIh933x.js';
2
2
 
3
3
  type MemorySavePolicy = "message" | "turn" | "run";
4
4
  type MemoryContext = {
@@ -1,5 +1,5 @@
1
1
  import { V as VectorMetadata, a as VectorMetadataValue } from './types-DHHZztGO.js';
2
- import { T as Tool } from './tool-sKozRXMI.js';
2
+ import { T as Tool } from './tool-Dhwg__1L.js';
3
3
 
4
4
  type VectorFilter = {
5
5
  type: "eq";
@@ -210,6 +210,13 @@ type ProviderToolCall = {
210
210
  status?: string;
211
211
  details?: JsonObject;
212
212
  };
213
+ /**
214
+ * Provider-normalized, mutually exclusive usage buckets.
215
+ *
216
+ * Every token should appear in exactly one non-total bucket. `total` is the
217
+ * only aggregate key and should equal the sum of the other buckets.
218
+ */
219
+ type UsageDetails = Record<string, number>;
213
220
  type AssistantGenerationMetadata = {
214
221
  provider: string;
215
222
  model: string;
@@ -223,6 +230,7 @@ type Usage = {
223
230
  totalTokens: number;
224
231
  cachedInputTokens: number;
225
232
  cacheCreationInputTokens: number;
233
+ details?: UsageDetails;
226
234
  };
227
235
  declare const Usage: {
228
236
  empty(): Usage;
@@ -318,4 +326,4 @@ declare function assertCompletionRequestSupported(model: CompletionModel, reques
318
326
  }): void;
319
327
  declare function textFromAssistantContent(content: AssistantContent[]): string;
320
328
 
321
- export { AssistantContent as A, CompletionCapabilityError as B, type CompletionModel as C, type Document as D, type CompletionModelCapabilities as E, type CompletionStreamEvent as F, type DocumentContent as G, type ImageDetail as H, type ImageContent as I, type JsonObject as J, type ReasoningContent as K, type ReasoningContentType as L, Message as M, type StreamingCompletionModel as N, type ToolCallArgumentsMode as O, type ProviderTool as P, type ToolFunction as Q, type Reasoning as R, type SystemMessage as S, type Text as T, Usage as U, assertCompletionRequestSupported as V, reasoningDisplayText as W, textFromAssistantContent as X, type AssistantGenerationMetadata as a, type AssistantMessage as b, type AssistantMessageOptions as c, type CompletionRequest as d, type CompletionResponse as e, type CompletionSource as f, type CompletionTool as g, type JsonPrimitive as h, type JsonValue as i, type MessageOptions as j, type ProviderToolCall as k, type ToolCall as l, ToolContent as m, type ToolDefinition as n, type ToolMessage as o, type ToolResult as p, type ToolResultContent as q, type ToolResultMessageOptions as r, type ToolResultOptions as s, UserContent as t, type UserMessage as u, getAssistantGenerationMetadata as v, isProviderTool as w, isToolResultContentArray as x, serializeToolResultOutput as y, type ToolChoice as z };
329
+ export { AssistantContent as A, CompletionCapabilityError as B, type CompletionModel as C, type Document as D, type CompletionModelCapabilities as E, type CompletionStreamEvent as F, type DocumentContent as G, type ImageDetail as H, type ImageContent as I, type JsonObject as J, type ReasoningContent as K, type ReasoningContentType as L, Message as M, type StreamingCompletionModel as N, type ToolCallArgumentsMode as O, type ProviderTool as P, type ToolFunction as Q, type Reasoning as R, type SystemMessage as S, type Text as T, Usage as U, type UsageDetails as V, assertCompletionRequestSupported as W, reasoningDisplayText as X, textFromAssistantContent as Y, type AssistantGenerationMetadata as a, type AssistantMessage as b, type AssistantMessageOptions as c, type CompletionRequest as d, type CompletionResponse as e, type CompletionSource as f, type CompletionTool as g, type JsonPrimitive as h, type JsonValue as i, type MessageOptions as j, type ProviderToolCall as k, type ToolCall as l, ToolContent as m, type ToolDefinition as n, type ToolMessage as o, type ToolResult as p, type ToolResultContent as q, type ToolResultMessageOptions as r, type ToolResultOptions as s, UserContent as t, type UserMessage as u, getAssistantGenerationMetadata as v, isProviderTool as w, isToolResultContentArray as x, serializeToolResultOutput as y, type ToolChoice as z };
@@ -1,4 +1,4 @@
1
- import { A as AnyTool } from './tool-sKozRXMI.js';
1
+ import { A as AnyTool } from './tool-Dhwg__1L.js';
2
2
 
3
3
  type Skill = {
4
4
  readonly name: string;
@@ -1,4 +1,4 @@
1
- import { H as ImageDetail, i as JsonValue, U as Usage, M as Message } from '../types-nybevqL9.js';
1
+ import { H as ImageDetail, i as JsonValue, U as Usage, M as Message } from '../types-XjIh933x.js';
2
2
 
3
3
  type UIMessageRole = "system" | "user" | "assistant" | "tool";
4
4
  type UIError = {
package/dist/ui/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  coreMessagesToUIMessages,
3
3
  uiMessagesToCoreMessages
4
- } from "../chunk-IT426VXL.js";
5
- import "../chunk-R6QERZAB.js";
4
+ } from "../chunk-SWUH4G2I.js";
5
+ import "../chunk-PJDL5UT2.js";
6
6
  export {
7
7
  coreMessagesToUIMessages,
8
8
  uiMessagesToCoreMessages
@@ -1,8 +1,8 @@
1
1
  import { a as VectorMetadataValue, V as VectorMetadata, E as EmbeddingModel, c as EmbeddedDocument, d as Embedding } from '../types-DHHZztGO.js';
2
- import { T as Tool } from '../tool-sKozRXMI.js';
3
- import { V as VectorFilter, a as VectorSearchIndex, I as IndexStrategy, b as VectorSearchRequest, c as VectorSearchResult, d as VectorInspectRequest, e as VectorInspectPage, f as VectorSearchToolOptions } from '../types-BkTDw00d.js';
4
- export { L as LshOptions, g as VectorInspectItem } from '../types-BkTDw00d.js';
5
- import '../types-nybevqL9.js';
2
+ import { T as Tool } from '../tool-Dhwg__1L.js';
3
+ import { V as VectorFilter, a as VectorSearchIndex, I as IndexStrategy, b as VectorSearchRequest, c as VectorSearchResult, d as VectorInspectRequest, e as VectorInspectPage, f as VectorSearchToolOptions } from '../types-DMGvEFRf.js';
4
+ export { L as LshOptions, g as VectorInspectItem } from '../types-DMGvEFRf.js';
5
+ import '../types-XjIh933x.js';
6
6
 
7
7
  declare const vectorFilter: {
8
8
  eq(key: string, value: VectorMetadataValue): VectorFilter;
@@ -3,10 +3,10 @@ import {
3
3
  InMemoryVectorStore,
4
4
  createVectorSearchTool,
5
5
  vectorFilter
6
- } from "../chunk-I7TM7TKX.js";
7
- import "../chunk-WQKHFADH.js";
6
+ } from "../chunk-F3C5653H.js";
8
7
  import "../chunk-YBBD4HZ3.js";
9
8
  import "../chunk-OIMLU4SF.js";
9
+ import "../chunk-WQKHFADH.js";
10
10
  export {
11
11
  InMemoryVectorIndex,
12
12
  InMemoryVectorStore,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anvia/core",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Core runtime primitives for context-aware Anvia agents.",
5
5
  "author": "anvia",
6
6
  "maintainer": "Indra Zulfi",