From 2f6e4b35a4e056b65cc917808cff2c2264eb57c1 Mon Sep 17 00:00:00 2001 From: Nikhil Pareek Date: Sun, 4 Oct 2026 17:07:25 -0700 Subject: [PATCH 01/18] feat(voltagent): add @traceai/voltagent span processor New package typescript/packages/traceai_voltagent. FIVoltAgentSpanProcessor goes into VoltAgent's ObservabilityConfig.spanProcessors (no Agent patching). On each ended VoltAgent span it builds a copy with fi.span.kind, gen_ai.span.kind, openinference.span.kind, session.id, gen_ai.request.model, gen_ai.provider.name, gen_ai.usage.*, gen_ai.tool.* and exports the copy through the register() provider's exporter with that provider's resource (project_name, project_type). The span VoltAgent hands to VoltOps and its other processors is not modified. Content is off unless captureContent: true. @voltagent/core is a peer dependency (^2.11.0) and is not bundled. Tested against @voltagent/core 2.11.0 (npm latest), ai 6.0.97 MockLanguageModelV3, Node 20.20.2 / 22.23.3 / 26.8.1. No vendor calls. Tests: 48 jest tests (mapping, real VoltAgent agent with mock model, AC-04 subagent, AC-06 coexistence, streamText, failure isolation, global-provider misconfiguration) and 11 shared-harness contract tests (python/tests/harness Receiver, real fi-core exporter to /tracer/v1/traces, burst, collector down, pack check, ESM/CJS on three Node versions). pnpm-lock.yaml: only this importer plus 115 packages / 124 snapshots it needs (+1391 lines, 0 removed). pnpm 10.30.1 also re-resolved zod and ts-node peers in other importers; those changes were left out. Verified with pnpm install --frozen-lockfile --ignore-scripts. Deviations from TH-8239 architecture/ADR/docs (paths are @voltagent/core 2.11.0 sources recovered from dist/index.js.map): - LLM spans use their own keys, not ai.model.name/usage.*: llm.model, llm.provider, llm.messages, llm.usage.prompt_tokens/... (agent.ts:4552-4558, 4607, 4643-4655). ai.model.name and usage.* are on the agent root only (trace-context.ts:331, 352-365). Both are mapped. - usage.* on the root is the operation total (usage-normalizer.ts:16-23, agent.ts:1446-1455), so it goes to voltagent.usage.*, not gen_ai.usage.* (the collector promotes token keys on any span and Observe sums the trace). Promoted keys are written on llm spans only. - The llm span records response.usage, the last AI SDK step only (agent.ts:1413-1419). The processor holds llm spans until the operation root ends; with exactly one successful main call it exports the root total on that llm span and keeps the step values in voltagent.llm.last_step_usage.*. Trace token sum now equals the mock model's calls (24 = 11 + 13; tested). - Tool name key exists: tool.name, tool.call.id (agent.ts:6451-6452), so gen_ai.tool.name / gen_ai.tool.call.id are set. - memory.read is a read (agent.ts:5044-5047, memory.operation=read) -> RETRIEVER; memory.write / memory.steps.write (memory-manager.ts:123-127, 326-329) -> CHAIN. - span-helpers.ts (embedding.query, vector.query) is not in 2.11.0; 2.11.0 emits embedding.generate / vector.search with vector.operation and input (memory-manager.ts:1010-1040). Both vocabularies are handled. - More content keys than input/output: agent.instructions (trace-context.ts:315), agent.messages/.ui, agent.context, agent.stateSnapshot (agent.ts:1270-1279), llm.messages (agent.ts:4607), middleware.input/output.* (middleware.ts:196-331), guardrail.input/output.* (guardrail.ts:327-552), tool.search.query (agent.ts:6971). All dropped by default. Credential-like keys are always dropped. - Copy, do not delete holds for the original span. The exported copy drops content, moves promoted keys off non-model spans, and rewrites llm.usage.* on a reconciled llm span. - Cost: VoltAgent does set usage.cost, from OpenRouter metadata only (agent.ts:4666). Passed through, not promoted to gen_ai.cost.total. - Batching: register() attaches a SimpleSpanProcessor (fi-core otel.ts:385) and the OTLP exporter rejects more than 30 requests in flight (otlp-exporter-base 0.202.0 configuration/shared-configuration.js:43-45, otlp-export-delegate.js:46). A 20-run burst delivered 30 of 200 spans. register({ batch: true }) writes _registeredSpanProcessors (otel.ts:599), which SDK 2.x does not read. The processor wraps the provider's exporter in its own BatchSpanProcessor (queue 2048). It never shuts that exporter down. - register() defaults to setGlobalTracerProvider=true (otel.ts:486, 605). VoltAgentObservability then cannot register its provider and takes the global tracer (node/volt-agent-observability.ts:93-96), so VoltAgent spans skip every spanProcessors entry, unmapped and with content. Docs require setGlobalTracerProvider: false; the constructor warns; a test reproduces it. - wait-until.ts read: setWaitUntil(waitUntil: (promise: Promise) => void): void (wait-until.ts:30). Documented with forceFlush. - Cache/reasoning tokens are also written to the traceAI TS keys gen_ai.usage.cache_read_tokens / gen_ai.usage.output_tokens.reasoning next to the architecture's OTel names. - Exported resource is the Future AGI provider's resource; VoltAgent's service.name=voltagent resource is not merged. - License: the @voltagent/core 2.11.0 tarball has no LICENSE file. package.json says MIT; README.md:355-357 and docs/community/licence.md carry the MIT text ("Copyright (c) 2025 VoltAgent"). approved: Nikhil 2026-10-03 blanket Refs: TH-8239 --- README.md | 2 + .../packages/traceai_voltagent/CHANGELOG.md | 5 + .../packages/traceai_voltagent/README.md | 180 +++ .../contract/run_fixture.mjs | 194 +++ .../contract/test_harness_contract.py | 358 +++++ .../packages/traceai_voltagent/jest.config.js | 26 + .../packages/traceai_voltagent/package.json | 76 + .../src/FIVoltAgentSpanProcessor.ts | 327 ++++ .../src/__tests__/global-provider.test.ts | 34 + .../src/__tests__/helpers.ts | 204 +++ .../src/__tests__/mapping.test.ts | 329 ++++ .../src/__tests__/processor.test.ts | 377 +++++ .../traceai_voltagent/src/attributes.ts | 107 ++ .../packages/traceai_voltagent/src/index.ts | 17 + .../packages/traceai_voltagent/src/mapping.ts | 387 +++++ .../traceai_voltagent/tsconfig.esm.json | 17 + .../traceai_voltagent/tsconfig.esnext.json | 17 + .../packages/traceai_voltagent/tsconfig.json | 14 + typescript/pnpm-lock.yaml | 1391 +++++++++++++++++ 19 files changed, 4062 insertions(+) create mode 100644 typescript/packages/traceai_voltagent/CHANGELOG.md create mode 100644 typescript/packages/traceai_voltagent/README.md create mode 100644 typescript/packages/traceai_voltagent/contract/run_fixture.mjs create mode 100644 typescript/packages/traceai_voltagent/contract/test_harness_contract.py create mode 100644 typescript/packages/traceai_voltagent/jest.config.js create mode 100644 typescript/packages/traceai_voltagent/package.json create mode 100644 typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts create mode 100644 typescript/packages/traceai_voltagent/src/__tests__/global-provider.test.ts create mode 100644 typescript/packages/traceai_voltagent/src/__tests__/helpers.ts create mode 100644 typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts create mode 100644 typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts create mode 100644 typescript/packages/traceai_voltagent/src/attributes.ts create mode 100644 typescript/packages/traceai_voltagent/src/index.ts create mode 100644 typescript/packages/traceai_voltagent/src/mapping.ts create mode 100644 typescript/packages/traceai_voltagent/tsconfig.esm.json create mode 100644 typescript/packages/traceai_voltagent/tsconfig.esnext.json create mode 100644 typescript/packages/traceai_voltagent/tsconfig.json diff --git a/README.md b/README.md index 214680868..c85f8b204 100644 --- a/README.md +++ b/README.md @@ -329,6 +329,7 @@ var tracer = TraceAI.Register(opts => | [`@traceai/openai-agents`](https://www.npmjs.com/package/@traceai/openai-agents) | OpenAI Agents | [![npm](https://img.shields.io/npm/v/@traceai/openai-agents)](https://www.npmjs.com/package/@traceai/openai-agents) | | [`@traceai/fi-instrumentation-google-adk`](https://www.npmjs.com/package/@traceai/fi-instrumentation-google-adk) | Google ADK | [![npm](https://img.shields.io/npm/v/@traceai/fi-instrumentation-google-adk)](https://www.npmjs.com/package/@traceai/fi-instrumentation-google-adk) | | [`@traceai/mastra`](https://www.npmjs.com/package/@traceai/mastra) | Mastra | [![npm](https://img.shields.io/npm/v/@traceai/mastra)](https://www.npmjs.com/package/@traceai/mastra) | +| [`@traceai/voltagent`](https://www.npmjs.com/package/@traceai/voltagent) | VoltAgent | [![npm](https://img.shields.io/npm/v/@traceai/voltagent)](https://www.npmjs.com/package/@traceai/voltagent) | | [`@traceai/beeai`](https://www.npmjs.com/package/@traceai/beeai) | IBM BeeAI | [![npm](https://img.shields.io/npm/v/@traceai/beeai)](https://www.npmjs.com/package/@traceai/beeai) | | [`@traceai/strands`](https://www.npmjs.com/package/@traceai/strands) | AWS Strands Agents | [![npm](https://img.shields.io/npm/v/@traceai/strands)](https://www.npmjs.com/package/@traceai/strands) | @@ -462,6 +463,7 @@ Available on [NuGet](https://www.nuget.org/packages/fi-instrumentation-otel). | | AWS Strands Agents | ✅ | ✅ | | | | | IBM BeeAI | ✅ | ✅ | | | | | Mastra | | ✅ | | | +| | VoltAgent | | ✅ | | | | | LangChain4j | | | ✅ | | | | Spring AI | | | ✅ | | | | Semantic Kernel | | | ✅ | | diff --git a/typescript/packages/traceai_voltagent/CHANGELOG.md b/typescript/packages/traceai_voltagent/CHANGELOG.md new file mode 100644 index 000000000..f134df02b --- /dev/null +++ b/typescript/packages/traceai_voltagent/CHANGELOG.md @@ -0,0 +1,5 @@ +# @traceai/voltagent + +## 0.1.0 + +- Initial release: `FIVoltAgentSpanProcessor` for `ObservabilityConfig.spanProcessors` in `@voltagent/core` 2.x. Maps VoltAgent span kinds, model, usage, session and tool keys onto Future AGI / GenAI keys on an exported copy, keeps promoted token keys on model-call spans only, drops content unless `captureContent: true`, and batches through the `register()` provider's exporter. diff --git a/typescript/packages/traceai_voltagent/README.md b/typescript/packages/traceai_voltagent/README.md new file mode 100644 index 000000000..abfccf8d6 --- /dev/null +++ b/typescript/packages/traceai_voltagent/README.md @@ -0,0 +1,180 @@ +# @traceai/voltagent + +Future AGI tracing for [VoltAgent](https://github.com/VoltAgent/voltagent). VoltAgent already +emits OpenTelemetry spans, but with its own keys (`entity.type`, `span.type`, `ai.model.name`, +`llm.usage.prompt_tokens`, `conversation.id`, bare `input` / `output`). `FIVoltAgentSpanProcessor` +copies those onto the keys the Future AGI collector and trace UI read (`fi.span.kind`, +`gen_ai.*`, `session.id`) and exports the copy through the traceAI exporter. + +It plugs into VoltAgent's own `ObservabilityConfig.spanProcessors`. It does not patch `Agent`, and +it does not change the span VoltAgent hands to its other processors (VoltOps, local storage, +websocket): it exports a mapped copy. + +Status: alpha. Fixture-validated against `@voltagent/core` 2.11.0 with the AI SDK mock model; no +live model provider was called. + +## Install + +```bash +npm install @traceai/voltagent @traceai/fi-core @voltagent/core +``` + +`@voltagent/core` is a peer dependency (`^2.11.0`); this package never bundles it. + +```bash +export FI_API_KEY="YOUR_API_KEY" +export FI_SECRET_KEY="YOUR_SECRET_KEY" +export FI_PROJECT_NAME="my-voltagent-app" +``` + +## Set up + +```typescript +import { ProjectType, register } from "@traceai/fi-core"; +import { FIVoltAgentSpanProcessor } from "@traceai/voltagent"; +import { Agent, VoltAgent, VoltAgentObservability } from "@voltagent/core"; + +const tracerProvider = register({ + projectName: "my-voltagent-app", + projectType: ProjectType.OBSERVE, + // Required: VoltAgent registers its own provider globally. If the Future AGI provider is + // global, VoltAgent's spans bypass every ObservabilityConfig processor (this one included). + setGlobalTracerProvider: false, +}); + +const observability = new VoltAgentObservability({ + spanProcessors: [ + // ...keep any processors you already have here... + new FIVoltAgentSpanProcessor({ tracerProvider }), // captureContent defaults to false + ], +}); + +const agent = new Agent({ name: "assistant", instructions: "...", model: /* AI SDK model */ }); +new VoltAgent({ agents: { assistant: agent }, observability }); +``` + +The constructor warns (`console.warn`) when the provider you pass is the global one. + +VoltAgent's own VoltOps export, local storage and websocket processors keep running; you do not +remove them. VoltAgent's sampling wrapper only wraps its VoltOps exporter, so a processor in +`spanProcessors` receives every span. VoltAgent's span filter (instrumentation scope +`@voltagent/core` by default) applies to every processor in the array, including this one. + +### Options + +| Option | Default | Meaning | +|---|---|---| +| `tracerProvider` | | The provider from `register()`. Spans carry its resource (`project_name`, `project_type`) and go out through its OTLP exporter (`/tracer/v1/traces`, `x-api-key` / `x-secret-key`). | +| `exporter`, `resource` | | Instead of `tracerProvider`: any `SpanExporter`, and the resource to export with. | +| `captureContent` | `false` | Export prompts, messages, instructions, tool arguments/results and retrieval queries. | +| `batch` | `true` | Batch through a `BatchSpanProcessor` (with `tracerProvider`, it wraps the provider's exporter). `false` exports each span as it ends. | +| `batchConfig` | SDK defaults | `BatchSpanProcessor` settings: queue 2048, batch 512, delay 5000 ms. Spans beyond a full queue are dropped by the SDK. | +| `usageReconciliationTimeoutMs` | `30000` | How long an llm span waits for its operation's root span (see Tokens). | + +## What is mapped + +Every original VoltAgent key stays on the exported copy, except content (below), credentials, and +promoted token keys on spans that are not model calls (moved under `voltagent.`). + +| Future AGI field | VoltAgent source (2.11.0) | Notes | +|---|---|---| +| `fi.span.kind`, `gen_ai.span.kind`, `openinference.span.kind` | `span.type`, `entity.type` | root agent span (`entity.type=agent`, no `span.type`) and `span.type=agent` → `AGENT`; `llm` → `LLM`; `tool` → `TOOL`; `retriever`, `vector` → `RETRIEVER`; `embedding` → `EMBEDDING`; `memory` with `memory.operation=read` → `RETRIEVER`, other memory operations (`write`, `write_steps`) → `CHAIN`; `guardrail`, `middleware`, `summary`, workflow and unknown types → `CHAIN`. An existing `fi.span.kind` is kept. | +| `gen_ai.operation.name` | kind | `invoke_agent`, `chat`, `execute_tool`, `embeddings` | +| `session.id`, `gen_ai.conversation.id` | `conversation.id` | not overwritten if already set | +| `user.id` | `user.id` | already the Future AGI key | +| `gen_ai.request.model`, `gen_ai.response.model` | `llm.model` (llm spans), `ai.model.name` (agent span) | the model name VoltAgent resolved | +| `gen_ai.provider.name` | `llm.provider`, `ai.model.provider` | VoltAgent parses it from the model string (text before `/`); it is not a vendor id | +| `gen_ai.request.temperature`, `.max_tokens`, `.top_p` | `llm.temperature`, `llm.max_output_tokens`, `llm.top_p`, `ai.model.*` | | +| `gen_ai.response.finish_reasons` | `llm.finish_reason`, `ai.response.finish_reason` | | +| `gen_ai.usage.input_tokens`, `.output_tokens`, `.total_tokens` | `llm.usage.prompt_tokens`, `.completion_tokens`, `.total_tokens` | **llm spans only** (see Tokens) | +| `gen_ai.usage.cache_read.input_tokens`, `gen_ai.usage.cache_read_tokens` | `llm.usage.cached_tokens` | llm spans only, when > 0 | +| `gen_ai.usage.reasoning.output_tokens`, `gen_ai.usage.output_tokens.reasoning` | `llm.usage.reasoning_tokens` | llm spans only, when > 0 | +| `voltagent.usage.input_tokens`, `.output_tokens`, `.total_tokens`, `.cache_read_tokens`, `.reasoning_tokens` | `usage.prompt_tokens`, ... on the agent span | the operation total; namespaced so it is not counted twice | +| `gen_ai.tool.name`, `gen_ai.tool.call.id`, `gen_ai.tool.description` | `tool.name`, `tool.call.id`, `tool.description` | | +| status, `exception` events, `error.*` | passed through | a failing tool is an `ERROR` span | +| `input.value`, `output.value` | `input`, `output` (`vector.query` / `embedding.query` as retriever input) | **only with `captureContent: true`** | +| cost | not mapped | VoltAgent sets `usage.cost` only from OpenRouter provider metadata; it is passed through unchanged and not promoted | + +### Tokens + +The Future AGI collector promotes `gen_ai.usage.*`, `llm.usage.*` and `llm.token_count.*` into +token columns on any span, and Observe sums them over the whole trace. So promoted keys appear only +on llm (model-call) spans. The agent span's summed usage is exported as `voltagent.usage.*`. + +VoltAgent 2.11.0 wraps a whole multi-step AI SDK call (for example: tool call, then answer) in one +`llm:` span and records the AI SDK's `usage` on it, which is the **last step only**, +while the agent span gets `totalUsage` across all steps. To keep the trace total equal to the +tokens of every model step, the processor holds each llm span until its operation's root span ends. +When the operation has exactly one successful `generateText` / `streamText` / `generateObject` / +`streamObject` llm span and the root total is larger, the exported copy of that llm span carries +the root total (`voltagent.usage.reconciled = true`) and keeps the last-step values under +`voltagent.llm.last_step_usage.*`. Otherwise (several main calls, failed attempts, no root within +`usageReconciliationTimeoutMs`, or a flush in between), the llm span is exported as VoltAgent wrote it. + +## Content + +Off by default. VoltAgent itself has no capture flag: it writes the prompt, the answer, system +instructions, message history, tool arguments and results, and memory payloads onto its spans. The +Future AGI copy drops them unless you pass `captureContent: true`. This is stricter than VoltAgent; +a VoltOps export of the same run still has the originals. + +Dropped keys: `input`, `output`, `agent.instructions`, `agent.messages`, `agent.messages.ui`, +`agent.context`, `agent.stateSnapshot`, `llm.messages`, `workflow.context`, +`workspace.sandbox.command`, `workspace.sandbox.args`, `suspension.checkpoint`, any key with an +`input` or `output` segment (`middleware.input.original`, `guardrail.output.after`, ...), and string +values whose last segment is `messages`, `instructions`, `query`, `context`, `data`, `checkpoint`, +`prompt(s)`, `completion`, `content`, `arguments` or `args` (`tool.search.query`, `vector.query`, +`resume.data`, ...). Counts such as `llm.messages.count` stay. + +Credentials are never exported, whatever `captureContent` says: keys with a segment like +`api_key`, `secret`, `secret_key`, `password`, `authorization`, `cookie` or `header(s)` are dropped. + +## Flushing, serverless and failures + +- Spans are batched. Flush before a short-lived process or a serverless handler returns: + `await observability.forceFlush()` (VoltAgent flushes every processor) or + `await processor.forceFlush()`. `observability.shutdown()` flushes too. VoltAgent ends some + memory spans in the background just after `generateText` resolves, so flush at the end of the + handler. +- On platforms with `waitUntil`, VoltAgent's serverless observability can flush in the background: + `setWaitUntil(waitUntil: (promise: Promise) => void)` from `@voltagent/core` + (`src/observability/wait-until.ts`). +- `register()` attaches a `SimpleSpanProcessor`, which sends one request per span; the OTLP + exporter rejects more than 30 requests in flight, so a burst loses spans. With `tracerProvider`, + this processor batches through the provider's exporter instead (on OpenTelemetry SDK 2.x, + `register({ batch: true })` does not replace that processor). The provider's exporter is shared: + `shutdown()` flushes it but never shuts it down. +- A collector that is down or rejects a batch never fails the agent: export errors are logged + through the OpenTelemetry diag logger, and `forceFlush()` / `shutdown()` never throw. + +## Tested versions + +| Component | Version | +|---|---| +| `@voltagent/core` | 2.11.0 (npm `latest` on 2026-10-04) | +| `ai` (mock model, `ai/test` `MockLanguageModelV3`) | 6.0.97 | +| `@traceai/fi-core` exporter | workspace (OpenTelemetry SDK 2.0.1, OTLP HTTP exporter 0.202.0) | +| Node.js | 20.20.2, 22.23.3, 26.8.1 | + +`@voltagent/core` 2.11.0 is MIT-licensed (`license` in its `package.json`; the published tarball +has no LICENSE file, its README and `docs/community/licence.md` carry the MIT text, "Copyright (c) +2025 VoltAgent"). It is a peer dependency and is not redistributed here. + +## Not covered + +- Workflows (`entity.type=workflow`) map to `CHAIN`; they were not exercised by the fixture. +- Retriever, embedding and vector spans are mapped from source reading; the fixture runs only the + agent's memory spans (`memory.read`, `memory.write`, `memory.steps.write`). +- VoltAgent logs (`RemoteLogProcessor`) and evals are not exported. +- Only the Node runtime was tested; edge runtimes were not. + +## Development + +```bash +pnpm --filter @traceai/voltagent run build +pnpm --filter @traceai/voltagent test +# Shared-harness contract test (from the repo root): +PYTHONPATH="python/tests" uv run --no-project --python 3.11 --with pytest --with protobuf \ + --with opentelemetry-proto pytest typescript/packages/traceai_voltagent/contract -q \ + -p no:cacheprovider --noconftest -o addopts='' +``` diff --git a/typescript/packages/traceai_voltagent/contract/run_fixture.mjs b/typescript/packages/traceai_voltagent/contract/run_fixture.mjs new file mode 100644 index 000000000..f6c18eb8d --- /dev/null +++ b/typescript/packages/traceai_voltagent/contract/run_fixture.mjs @@ -0,0 +1,194 @@ +// Contract fixture for @traceai/voltagent (TH-8239). +// +// Runs a real VoltAgent 2.x agent against an AI SDK mock model (no vendor call), with the BUILT +// package's FIVoltAgentSpanProcessor appended to ObservabilityConfig.spanProcessors next to a +// recording processor (standing in for VoltOps / any user processor). The real @traceai/fi-core +// exporter posts to FI_BASE_URL + /tracer/v1/traces (the shared harness Receiver in tests). +// +// Env: FI_BASE_URL, FI_API_KEY, FI_SECRET_KEY, FI_PROJECT_NAME (placeholders in tests), +// JOURNEY = tools | subagent | burst | collector-down, CAPTURE_CONTENT = "true" to opt in. +// Prints one line "RESULT_JSON:{...}" on stdout. +import { ProjectType, register } from "@traceai/fi-core"; +import { FIVoltAgentSpanProcessor } from "@traceai/voltagent"; +import { Agent, VoltAgent, VoltAgentObservability, createTool } from "@voltagent/core"; +import { MockLanguageModelV3, convertArrayToReadableStream } from "ai/test"; +import { z } from "zod"; + +const JOURNEY = process.env.JOURNEY ?? "tools"; +const CAPTURE = process.env.CAPTURE_CONTENT === "true"; +const BURST = 20; + +export const MARKERS = { + prompt: "SECRET_PROMPT_MARKER", + instructions: "SECRET_INSTRUCTIONS_MARKER", + toolArg: "SECRET_TOOL_ARG_MARKER", + toolResult: "SECRET_TOOL_RESULT_MARKER", + answer: "SECRET_ANSWER_MARKER", + subtask: "SECRET_SUBTASK_MARKER", +}; + +const modelCalls = []; + +function scriptedModel(modelId, steps) { + let index = 0; + const next = () => { + const step = steps[index % steps.length]; + index += 1; + modelCalls.push({ modelId, input: step.input, output: step.output }); + const usage = { + inputTokens: { total: step.input, noCache: step.input, cacheRead: undefined, cacheWrite: undefined }, + outputTokens: { total: step.output, text: step.output, reasoning: undefined }, + }; + return { step, usage }; + }; + return new MockLanguageModelV3({ + provider: "mock-provider", + modelId, + doGenerate: async () => { + const { step, usage } = next(); + if (step.text !== undefined) { + return { content: [{ type: "text", text: step.text }], finishReason: { unified: "stop", raw: "stop" }, usage, warnings: [] }; + } + return { + content: step.calls.map((call) => ({ type: "tool-call", toolCallId: call.id, toolName: call.name, input: JSON.stringify(call.args) })), + finishReason: { unified: "tool-calls", raw: "tool_calls" }, + usage, + warnings: [], + }; + }, + doStream: async () => { + const { step, usage } = next(); + const parts = [{ type: "stream-start", warnings: [] }]; + if (step.text !== undefined) { + parts.push( + { type: "text-start", id: "t1" }, + { type: "text-delta", id: "t1", delta: step.text }, + { type: "text-end", id: "t1" }, + { type: "finish", finishReason: { unified: "stop", raw: "stop" }, usage }, + ); + } else { + for (const call of step.calls) { + parts.push({ type: "tool-call", toolCallId: call.id, toolName: call.name, input: JSON.stringify(call.args) }); + } + parts.push({ type: "finish", finishReason: { unified: "tool-calls", raw: "tool_calls" }, usage }); + } + return { stream: convertArrayToReadableStream(parts) }; + }, + }); +} + +const toolSteps = () => [ + { + calls: [ + { id: "call-weather", name: "get_weather", args: { city: MARKERS.toolArg } }, + { id: "call-explode", name: "explode", args: { x: 1 } }, + ], + input: 11, + output: 7, + }, + { text: MARKERS.answer, input: 13, output: 5 }, +]; + +const weatherTool = createTool({ + name: "get_weather", + description: "Look up the weather for a city", + parameters: z.object({ city: z.string() }), + execute: async ({ city }) => ({ forecast: `${MARKERS.toolResult} sunny in ${city}` }), +}); +const explodingTool = createTool({ + name: "explode", + description: "Always fails", + parameters: z.object({ x: z.number() }), + execute: async () => { + throw new Error("tool exploded"); + }, +}); + +// Stands in for VoltOps or any other processor the user already has in the array. +const recorded = []; +const recorder = { + onStart() {}, + onEnd(span) { + recorded.push({ name: span.name, spanId: span.spanContext().spanId, traceId: span.spanContext().traceId }); + }, + forceFlush: async () => {}, + shutdown: async () => {}, +}; + +// setGlobalTracerProvider: false, so VoltAgent's own provider stays the global one and every +// VoltAgent span reaches ObservabilityConfig.spanProcessors. +const tracerProvider = register({ + projectName: process.env.FI_PROJECT_NAME, + projectType: ProjectType.OBSERVE, + setGlobalTracerProvider: false, +}); +const processor = new FIVoltAgentSpanProcessor({ tracerProvider, captureContent: CAPTURE }); +const observability = new VoltAgentObservability({ spanProcessors: [recorder, processor] }); + +const result = { journey: JOURNEY, captureContent: CAPTURE }; +const started = Date.now(); + +if (JOURNEY === "subagent") { + const researcher = new Agent({ + name: "researcher", + instructions: MARKERS.instructions, + model: scriptedModel("mockai/child-model", [{ text: "child answer", input: 5, output: 3 }]), + }); + const supervisor = new Agent({ + name: "supervisor", + instructions: MARKERS.instructions, + model: scriptedModel("mockai/supervisor-model", [ + { + calls: [{ id: "call-delegate", name: "delegate_task", args: { task: MARKERS.subtask, targetAgents: ["researcher"] } }], + input: 20, + output: 9, + }, + { text: "final", input: 30, output: 4 }, + ]), + subAgents: [researcher], + }); + new VoltAgent({ agents: { supervisor, researcher }, observability, checkDependencies: false }); + const out = await supervisor.generateText(MARKERS.prompt, { conversationId: "conv-sub", userId: "user-1", maxSteps: 4 }); + result.text = out.text; +} else { + const agent = new Agent({ + name: "assistant", + instructions: MARKERS.instructions, + model: scriptedModel("mockai/mock-model-1", toolSteps()), + tools: [weatherTool, explodingTool], + }); + new VoltAgent({ agents: { assistant: agent }, observability, checkDependencies: false }); + const runs = JOURNEY === "burst" ? BURST : 1; + const texts = []; + for (let i = 0; i < runs; i += 1) { + const out = await agent.generateText(MARKERS.prompt, { conversationId: `conv-${i === 0 ? "123" : i}`, userId: "user-9", maxSteps: 4 }); + texts.push(out.text); + } + result.text = texts[0]; + result.texts = texts; + result.runs = runs; +} +result.agentMs = Date.now() - started; + +// VoltAgent ends some memory spans in the background after generateText resolves; a request +// handler that returns right away would flush before they end. Wait until the span stream is quiet. +for (let seen = -1; seen !== recorded.length; ) { + seen = recorded.length; + await new Promise((resolve) => setTimeout(resolve, 100)); +} + +// Serverless-style: flush before returning. forceFlush/shutdown never throw. +await processor.forceFlush(); +result.flushMs = Date.now() - started; +const traceIds = [...new Set(recorded.map((span) => span.traceId))]; +result.recorded = recorded; +result.traceIds = traceIds; +const storedCounts = []; +for (const traceId of traceIds) storedCounts.push((await observability.getTraceFromStorage(traceId)).length); +result.storedCount = storedCounts.reduce((sum, count) => sum + count, 0); +result.modelCalls = modelCalls; +await processor.shutdown(); +await tracerProvider.shutdown().catch(() => undefined); +result.totalMs = Date.now() - started; +process.stdout.write(`\nRESULT_JSON:${JSON.stringify(result)}\n`); +process.exit(0); diff --git a/typescript/packages/traceai_voltagent/contract/test_harness_contract.py b/typescript/packages/traceai_voltagent/contract/test_harness_contract.py new file mode 100644 index 000000000..0046ff5a9 --- /dev/null +++ b/typescript/packages/traceai_voltagent/contract/test_harness_contract.py @@ -0,0 +1,358 @@ +"""Shared-harness contract tests for @traceai/voltagent (TH-8239). + +Each test starts the shared loopback Receiver (python/tests/harness), runs +`node contract/run_fixture.mjs` through `harness.run`, and reads what the real +@traceai/fi-core OTLP/HTTP exporter posted to `{origin}/tracer/v1/traces`. +The fixture drives a real @voltagent/core agent with the AI SDK's +MockLanguageModelV3 (no vendor call, no network beyond 127.0.0.1) and imports +the BUILT package (dist/esm through package.json exports). + +Run from the repo root: + PYTHONPATH="python/tests" uv run --no-project --python 3.11 --with pytest \ + --with protobuf --with opentelemetry-proto \ + pytest typescript/packages/traceai_voltagent/contract -q -p no:cacheprovider \ + --noconftest -o addopts='' + +Set TRACEAI_NODE_MATRIX=/path/to/node20:/path/to/node22 to run every journey on +several Node binaries. +""" + +from __future__ import annotations + +import json +import os +import shutil +import socket +import subprocess +import sys +import tarfile +from pathlib import Path +from typing import Any, Dict, List + +import pytest + +PKG_DIR = Path(__file__).resolve().parents[1] +REPO_ROOT = PKG_DIR.parents[2] +sys.path.insert(0, str(REPO_ROOT / "python" / "tests")) + +from harness import Receiver, run # noqa: E402 + +NODE = os.environ.get("NODE_BINARY") or shutil.which("node") or "node" +NODES = [p for p in os.environ.get("TRACEAI_NODE_MATRIX", "").split(os.pathsep) if p] or [NODE] +PNPM = shutil.which("pnpm") or "pnpm" +VOLTAGENT_DIR = PKG_DIR / "node_modules" / "@voltagent" / "core" + +PROJECT = "th8239-harness-contract" +PLACEHOLDER_API_KEY = "contract-api-key-PLACEHOLDER" +PLACEHOLDER_SECRET_KEY = "contract-secret-key-PLACEHOLDER" +MARKERS = ( + "SECRET_PROMPT_MARKER", + "SECRET_INSTRUCTIONS_MARKER", + "SECRET_TOOL_ARG_MARKER", + "SECRET_TOOL_RESULT_MARKER", + "SECRET_ANSWER_MARKER", + "SECRET_SUBTASK_MARKER", +) +CONTENT_KEYS = ("input", "output", "input.value", "output.value", "llm.messages", "agent.instructions", + "agent.messages", "agent.messages.ui", "agent.stateSnapshot") +PROMOTED_EXACT = {"gen_ai.usage.input_tokens", "gen_ai.usage.output_tokens", "gen_ai.usage.total_tokens", + "gen_ai.cost.total", "llm.cost.total"} +PROMOTED_PREFIXES = ("llm.token_count.", "llm.usage.") +INPUT_TOKEN_KEYS = ("gen_ai.usage.input_tokens", "llm.usage.prompt_tokens", "llm.token_count.prompt") + + +def _check(result: subprocess.CompletedProcess, what: str) -> None: + assert not getattr(result, "timed_out", False), f"{what} timed out\n{result.stderr.decode()[-4000:]}" + assert result.returncode == 0, ( + f"{what} exited {result.returncode}\nstdout:\n{result.stdout.decode()[-4000:]}" + f"\nstderr:\n{result.stderr.decode()[-4000:]}" + ) + + +def _base_env() -> Dict[str, str]: + return {"PATH": os.environ.get("PATH", ""), "HOME": os.environ.get("HOME", ""), "NO_PROXY": "127.0.0.1,localhost"} + + +@pytest.fixture(scope="session") +def built_package() -> Path: + result = run([PNPM, "--dir", str(PKG_DIR), "run", "build"], env=_base_env(), stdin=None, timeout=300) + _check(result, "pnpm run build") + assert (PKG_DIR / "dist" / "src" / "index.js").is_file() + assert (PKG_DIR / "dist" / "esm" / "index.js").is_file() + return PKG_DIR + + +def _run_fixture(node: str, base_url: str, journey: str, extra_env: Dict[str, str] | None = None, + timeout: float = 120) -> Dict[str, Any]: + env = _base_env() + env.update({ + "FI_BASE_URL": base_url, # fi-core appends /tracer/v1/traces + "FI_API_KEY": PLACEHOLDER_API_KEY, + "FI_SECRET_KEY": PLACEHOLDER_SECRET_KEY, + "FI_PROJECT_NAME": PROJECT, + "JOURNEY": journey, + }) + env.update(extra_env or {}) + result = run([node, str(PKG_DIR / "contract" / "run_fixture.mjs")], env=env, stdin=None, timeout=timeout) + _check(result, f"{node} run_fixture.mjs ({journey})") + lines = [line for line in result.stdout.decode().splitlines() if line.startswith("RESULT_JSON:")] + assert len(lines) == 1, result.stdout.decode()[-4000:] + return json.loads(lines[0][len("RESULT_JSON:"):]) + + +def _value(value: Dict[str, Any]) -> Any: + for key in ("stringValue", "boolValue", "doubleValue"): + if key in value: + return value[key] + if "intValue" in value: + return int(value["intValue"]) + if "arrayValue" in value: + return [_value(v) for v in value["arrayValue"].get("values", [])] + return value + + +def _attrs(span: Dict[str, Any]) -> Dict[str, Any]: + return {item["key"]: _value(item["value"]) for item in span.get("attributes", [])} + + +def _status(span: Dict[str, Any]) -> int: + code = span.get("status", {}).get("code", 0) + names = {"STATUS_CODE_UNSET": 0, "STATUS_CODE_OK": 1, "STATUS_CODE_ERROR": 2} + return names[code] if isinstance(code, str) else int(code) + + +def _kind(span: Dict[str, Any]) -> str: + kind = span.get("kind", "SPAN_KIND_INTERNAL") + return kind if isinstance(kind, str) else {1: "SPAN_KIND_INTERNAL", 3: "SPAN_KIND_CLIENT"}.get(kind, str(kind)) + + +def _one(spans: List[Dict[str, Any]], name: str) -> Dict[str, Any]: + matches = [span for span in spans if span["name"] == name] + assert len(matches) == 1, f"expected one {name}, got {sorted(s['name'] for s in spans)}" + return matches[0] + + +def _is_promoted(key: str) -> bool: + return key in PROMOTED_EXACT or key.startswith(PROMOTED_PREFIXES) + + +def _promoted_input_tokens(spans: List[Dict[str, Any]]) -> int: + """What Observe adds up: one promoted input-token value per span, over the whole trace.""" + total = 0 + for span in spans: + a = _attrs(span) + values = {a[key] for key in INPUT_TOKEN_KEYS if key in a} + assert len(values) <= 1, f"conflicting promoted input tokens on {span['name']}: {values}" + total += values.pop() if values else 0 + return total + + +def _assert_collector_contract(requests: List[Dict[str, Any]]) -> None: + assert requests, "exporter sent nothing" + for request in requests: + assert request["path"] == "/tracer/v1/traces" + headers = request["headers"] + assert headers["x-api-key"] == PLACEHOLDER_API_KEY + assert headers["x-secret-key"] == PLACEHOLDER_SECRET_KEY + assert "authorization" not in headers + assert request["resource_attributes"] + for resource in request["resource_attributes"]: + assert resource["project_name"] == PROJECT + assert resource["project_type"] == "observe" + + +@pytest.mark.parametrize("node", NODES) +def test_tool_journey_reaches_collector_path_mapped_with_content_off(built_package: Path, node: str) -> None: + with Receiver() as receiver: + output = _run_fixture(node, receiver.origin, "tools") + spans = receiver.spans() + requests = receiver.requests() + + assert output["text"] == "SECRET_ANSWER_MARKER" + _assert_collector_contract(requests) + + # AC-06: the other processor in the same array and VoltAgent's own storage saw every span, + # and Future AGI received exactly the spans VoltAgent emitted. + recorded_ids = sorted(span["spanId"] for span in output["recorded"]) + assert len(spans) == len(output["recorded"]) == output["storedCount"] + assert sorted(_hex_span_id(span["spanId"]) for span in spans) == recorded_ids + + names = sorted(span["name"] for span in spans) + for expected in ("assistant", "llm:generateText", "tool.execution:get_weather", "tool.execution:explode", + "memory.read"): + assert expected in names, names + assert len({span["traceId"] for span in spans}) == 1 + + root = _one(spans, "assistant") + llm = _one(spans, "llm:generateText") + weather = _one(spans, "tool.execution:get_weather") + failing = _one(spans, "tool.execution:explode") + r, l, w, f = _attrs(root), _attrs(llm), _attrs(weather), _attrs(failing) + + # Kinds: fi.span.kind (collector reads it first) and gen_ai.span.kind. + assert (r["fi.span.kind"], r["gen_ai.span.kind"]) == ("AGENT", "AGENT") + assert (l["fi.span.kind"], l["gen_ai.span.kind"]) == ("LLM", "LLM") + assert (w["fi.span.kind"], f["fi.span.kind"]) == ("TOOL", "TOOL") + for span in spans: + a = _attrs(span) + if span["name"] == "memory.read": + assert a["fi.span.kind"] == "RETRIEVER" + if span["name"] in ("memory.write", "memory.steps.write"): + assert a["fi.span.kind"] == "CHAIN" + assert "fi.span.kind" in a and "gen_ai.span.kind" in a, span["name"] + assert _kind(llm) == "SPAN_KIND_CLIENT" + + # Parenting. + assert not root.get("parentSpanId") + for child in (llm, weather, failing): + assert child["parentSpanId"] == root["spanId"] + + # Model, provider, tool, session, user. + assert l["gen_ai.request.model"] == "mockai/mock-model-1" and l["gen_ai.provider.name"] == "mockai" + assert r["gen_ai.request.model"] == "mockai/mock-model-1" + assert (w["gen_ai.tool.name"], w["gen_ai.tool.call.id"]) == ("get_weather", "call-weather") + for span in spans: + a = _attrs(span) + assert a["session.id"] == "conv-123" and a["user.id"] == "user-9", span["name"] + + # Tokens: promoted keys on the model-call span only; the trace sums to the mock model's calls. + calls = output["modelCalls"] + assert len(calls) == 2 + assert _promoted_input_tokens(spans) == sum(call["input"] for call in calls) == 24 + assert l["gen_ai.usage.input_tokens"] == 24 and l["gen_ai.usage.output_tokens"] == 12 + assert l["gen_ai.usage.total_tokens"] == 36 + assert l["voltagent.llm.last_step_usage.prompt_tokens"] == 13 + for span in spans: + if _attrs(span).get("fi.span.kind") != "LLM": + assert not [key for key in _attrs(span) if _is_promoted(key)], span["name"] + assert r["voltagent.usage.input_tokens"] == 24 and r["usage.prompt_tokens"] == 24 + + # Errors. + assert _status(failing) == 2 + assert f["error.message"] == "tool exploded" + assert "exception" in [event["name"] for event in failing.get("events", [])] + assert _status(weather) == 1 and _status(root) == 1 + + # No content by default, no credentials anywhere on spans. + blob = json.dumps(spans) + for marker in MARKERS: + assert marker not in blob, marker + for span in spans: + for key in CONTENT_KEYS: + assert key not in _attrs(span), (span["name"], key) + assert PLACEHOLDER_API_KEY not in blob and PLACEHOLDER_SECRET_KEY not in blob + + +def _hex_span_id(span_id: str) -> str: + """OTLP/JSON from protobuf MessageToDict encodes bytes ids as base64.""" + import base64 + import binascii + + if len(span_id) == 16 and all(c in "0123456789abcdef" for c in span_id): + return span_id + return binascii.hexlify(base64.b64decode(span_id)).decode() + + +def test_content_is_exported_only_after_opt_in(built_package: Path) -> None: + with Receiver() as receiver: + _run_fixture(NODE, receiver.origin, "tools", {"CAPTURE_CONTENT": "true"}) + spans = receiver.spans() + root = _attrs(_one(spans, "assistant")) + weather = _attrs(_one(spans, "tool.execution:get_weather")) + assert root["input.value"] == "SECRET_PROMPT_MARKER" + assert root["output.value"] == "SECRET_ANSWER_MARKER" + assert "SECRET_TOOL_ARG_MARKER" in weather["input.value"] + assert "SECRET_TOOL_RESULT_MARKER" in weather["output.value"] + assert PLACEHOLDER_API_KEY not in json.dumps(spans) + + +def test_subagent_is_one_trace_under_the_supervisor(built_package: Path) -> None: + with Receiver() as receiver: + output = _run_fixture(NODE, receiver.origin, "subagent") + spans = receiver.spans() + requests = receiver.requests() + _assert_collector_contract(requests) + assert len({span["traceId"] for span in spans}) == 1 + root = _one(spans, "supervisor") + delegate = _one(spans, "tool.execution:delegate_task") + subagents = [span for span in spans if span["name"].startswith("subagent:")] + assert len(subagents) == 1 + assert delegate["parentSpanId"] == root["spanId"] + assert subagents[0]["parentSpanId"] == delegate["spanId"] + assert _attrs(subagents[0])["fi.span.kind"] == "AGENT" + assert _status(subagents[0]) == 1 + calls = output["modelCalls"] + assert len(calls) == 3 # supervisor x2, subagent x1 + assert _promoted_input_tokens(spans) == sum(call["input"] for call in calls) + assert len(spans) == len(output["recorded"]) + assert "SECRET_SUBTASK_MARKER" not in json.dumps(spans) + + +def test_burst_then_flush_drops_nothing(built_package: Path) -> None: + """AC-05 style: 20 invocations, one forceFlush before the process exits, zero dropped.""" + with Receiver() as receiver: + output = _run_fixture(NODE, receiver.origin, "burst", timeout=300) + spans = receiver.spans() + assert output["runs"] == 20 + assert len(output["traceIds"]) == 20 + assert len(spans) == len(output["recorded"]) == output["storedCount"] + assert len({span["traceId"] for span in spans}) == 20 + assert _promoted_input_tokens(spans) == sum(call["input"] for call in output["modelCalls"]) == 20 * 24 + + +def _closed_port() -> int: + with socket.socket() as sock: + sock.bind(("127.0.0.1", 0)) + return sock.getsockname()[1] + + +def test_collector_down_never_breaks_the_agent(built_package: Path) -> None: + output = _run_fixture(NODE, f"http://127.0.0.1:{_closed_port()}", "tools", timeout=120) + assert output["text"] == "SECRET_ANSWER_MARKER" + assert len(output["recorded"]) > 0 # VoltAgent's own processors still ran + + +def test_packed_tarball_has_no_voltagent_sources(built_package: Path, tmp_path: Path) -> None: + result = run([PNPM, "--dir", str(PKG_DIR), "pack", "--pack-destination", str(tmp_path)], + env=_base_env(), stdin=None, timeout=300) + _check(result, "pnpm pack") + tarballs = list(tmp_path.glob("*.tgz")) + assert len(tarballs) == 1, tarballs + voltagent_files = {p.name for p in VOLTAGENT_DIR.resolve().rglob("*") if p.is_file()} + assert "index.mjs" in voltagent_files, "installed @voltagent/core not found; cannot compare" + with tarfile.open(tarballs[0]) as tar: + members = [m for m in tar.getmembers() if m.isfile()] + manifest = json.loads(tar.extractfile("package/package.json").read()) # type: ignore[union-attr] + for member in members: + relative = member.name[len("package/"):] + assert relative.split("/")[0] in {"dist", "package.json", "README.md", "LICENSE"}, relative + assert "node_modules" not in member.name and "__tests__" not in member.name + assert "voltagent/core" not in member.name.lower() + data = tar.extractfile(member).read() # type: ignore[union-attr] + assert b"Copyright (c) 2025 VoltAgent" not in data, relative + assert b"class VoltAgentObservability" not in data, relative + assert manifest["peerDependencies"] == {"@voltagent/core": "^2.11.0"} + assert "@voltagent/core" not in manifest.get("dependencies", {}) + assert not manifest.get("bundledDependencies") and not manifest.get("bundleDependencies") + assert manifest["license"] == "Apache-2.0" + assert all(not v.startswith("workspace:") for v in manifest.get("dependencies", {}).values()) + + +@pytest.mark.parametrize("node", NODES) +def test_esm_and_cjs_entry_points_import(built_package: Path, tmp_path: Path, node: str) -> None: + """require() and import() of the package name resolve through package.json exports.""" + scope = tmp_path / "node_modules" / "@traceai" + scope.mkdir(parents=True) + (scope / "voltagent").symlink_to(PKG_DIR, target_is_directory=True) + check = ( + "const names=['FIVoltAgentSpanProcessor','mapVoltAgentAttributes','resolveSpanKind'];" + "function ok(m,kind){for(const n of names){if(!(n in m))throw new Error(kind+' missing '+n)}}" + ) + cjs = run([node, "-e", check + "ok(require('@traceai/voltagent'),'cjs');console.log(process.version,'cjs ok')"], + env={**_base_env(), "NODE_PATH": str(tmp_path / "node_modules")}, stdin=None, timeout=60) + script = tmp_path / "check.mjs" + script.write_text(check + "ok(await import('@traceai/voltagent'),'esm');console.log(process.version,'esm ok');") + esm = run([node, str(script)], env=_base_env(), stdin=None, timeout=60) + _check(cjs, f"{node} require") + _check(esm, f"{node} import") + assert b"cjs ok" in cjs.stdout and b"esm ok" in esm.stdout diff --git a/typescript/packages/traceai_voltagent/jest.config.js b/typescript/packages/traceai_voltagent/jest.config.js new file mode 100644 index 000000000..c34e8feb7 --- /dev/null +++ b/typescript/packages/traceai_voltagent/jest.config.js @@ -0,0 +1,26 @@ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', + roots: ['/src'], + testMatch: [ + '**/__tests__/**/*.test.ts', + '**/?(*.)+(spec|test).ts' + ], + collectCoverageFrom: [ + 'src/**/*.ts', + '!src/**/*.d.ts', + '!src/index.ts' + ], + coverageDirectory: 'coverage', + coverageReporters: ['text', 'lcov'], + transform: { + '^.+\\.ts$': 'ts-jest' + }, + moduleNameMapper: { + // Source uses NodeNext `.js` import specifiers; map them back to the .ts source. + '^(\\.{1,2}/.*)\\.js$': '$1', + '^@traceai/fi-core$': '/../fi-core/src', + '^@traceai/fi-semantic-conventions$': '/../fi-semantic-conventions/src' + }, + testTimeout: 10000 +}; \ No newline at end of file diff --git a/typescript/packages/traceai_voltagent/package.json b/typescript/packages/traceai_voltagent/package.json new file mode 100644 index 000000000..828dd1509 --- /dev/null +++ b/typescript/packages/traceai_voltagent/package.json @@ -0,0 +1,76 @@ +{ + "name": "@traceai/voltagent", + "version": "0.1.0", + "description": "Future AGI span processor for VoltAgent: maps VoltAgent's native OpenTelemetry spans onto Future AGI / GenAI conventions", + "main": "./dist/src/index.js", + "module": "./dist/esm/index.js", + "esnext": "./dist/esnext/index.js", + "types": "./dist/src/index.d.ts", + "exports": { + ".": { + "types": "./dist/src/index.d.ts", + "import": "./dist/esm/index.js", + "require": "./dist/src/index.js" + } + }, + "scripts": { + "prebuild": "rimraf dist", + "build": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json && tsc-alias -p tsconfig.esm.json && pnpm run postbuild", + "postbuild": "echo '{\"type\": \"module\"}' > ./dist/esm/package.json", + "test": "jest", + "test:watch": "jest --watch", + "test:coverage": "jest --coverage", + "lint": "eslint . --ext .ts", + "prepare": "pnpm run build" + }, + "files": [ + "dist", + "README.md" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/future-agi/traceAI.git", + "directory": "typescript/packages/traceai_voltagent" + }, + "bugs": { + "url": "https://github.com/future-agi/traceAI/issues" + }, + "homepage": "https://github.com/future-agi/traceAI/tree/main/typescript/packages/traceai_voltagent#readme", + "dependencies": { + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/sdk-trace-base": "^2.0.1", + "@traceai/fi-core": "workspace:^", + "@traceai/fi-semantic-conventions": "workspace:^" + }, + "peerDependencies": { + "@voltagent/core": "^2.11.0" + }, + "devDependencies": { + "@ai-sdk/provider-utils": "^4.0.0", + "@opentelemetry/core": "^2.0.1", + "@opentelemetry/resources": "^2.0.1", + "@types/jest": "^29.5.12", + "@types/node": "^22.15.29", + "@voltagent/core": "2.11.0", + "@voltagent/logger": "2.0.2", + "ai": "6.0.97", + "jest": "^29.7.0", + "rimraf": "^6.0.1", + "ts-jest": "^29.1.4", + "tsc-alias": "^1.8.16", + "typescript": "^5.8.3", + "zod": "4.3.6" + }, + "keywords": [ + "opentelemetry", + "instrumentation", + "typescript", + "voltagent", + "futureagi" + ], + "license": "Apache-2.0", + "author": "Future AGI ", + "publishConfig": { + "access": "public" + } +} diff --git a/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts b/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts new file mode 100644 index 000000000..6af1480ea --- /dev/null +++ b/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts @@ -0,0 +1,327 @@ +import { type Attributes, type Context, SpanStatusCode, diag, trace } from "@opentelemetry/api"; +import { + BatchSpanProcessor, + type BufferConfig, + type ReadableSpan, + SimpleSpanProcessor, + type Span, + type SpanExporter, + type SpanProcessor, +} from "@opentelemetry/sdk-trace-base"; +import { mapVoltAgentAttributes, reconcileOperationUsage } from "./mapping"; + +type Resource = ReadableSpan["resource"]; + +/** + * Anything shaped like an OpenTelemetry SDK 2.x `BasicTracerProvider`, such as the + * `FITracerProvider` returned by `register()` from `@traceai/fi-core`. + */ +export interface TracerProviderLike { + forceFlush(): Promise; + shutdown?(): Promise; +} + +export interface FIVoltAgentSpanProcessorOptions { + /** + * The Future AGI tracer provider from `register({ ..., setGlobalTracerProvider: false })`. + * Mapped spans carry its resource (`project_name`, `project_type`) and are exported through + * its OTLP exporter (endpoint and `x-api-key` / `x-secret-key` headers from fi-core). + */ + tracerProvider?: TracerProviderLike; + /** Alternative to `tracerProvider`: export mapped spans through this exporter. */ + exporter?: SpanExporter; + /** Exporter mode only: the resource to export with. Defaults to the VoltAgent span's own. */ + resource?: Resource; + /** + * Batch spans (default true) or export each span as it ends. With `tracerProvider`, batching + * wraps the provider's exporter in this processor's own BatchSpanProcessor. + */ + batch?: boolean; + /** BatchSpanProcessor settings (SDK defaults: queue 2048, batch 512, delay 5000 ms). */ + batchConfig?: BufferConfig; + /** + * Export prompts, messages, instructions, tool arguments/results and retrieval queries. + * Default false. VoltAgent itself has no such flag and always writes them; this processor + * drops them from the Future AGI copy unless you opt in. + */ + captureContent?: boolean; + /** + * How long an llm span waits for its operation's root span before it is exported without + * usage reconciliation. Default 30000 ms. + */ + usageReconciliationTimeoutMs?: number; +} + +interface Delegate { + processor: SpanProcessor; + resource?: Resource; + flush(): Promise; + shutdown(): Promise; +} + +interface PendingLLMSpan { + original: ReadableSpan; + source: Attributes; + attributes: Attributes; + isError: boolean; +} + +interface PendingOperation { + spans: PendingLLMSpan[]; + timer?: ReturnType; +} + +const DEFAULT_RECONCILIATION_TIMEOUT_MS = 30_000; +const MAX_PENDING_OPERATIONS = 1_000; + +let globalConflictWarned = false; + +/** + * Maps VoltAgent's native OpenTelemetry spans onto Future AGI / GenAI conventions and forwards + * a mapped copy to the traceAI exporter. + * + * Append it to `ObservabilityConfig.spanProcessors`. The span VoltAgent hands to other processors + * (VoltOps, local storage, websocket) is never modified: this processor exports a copy. + */ +export class FIVoltAgentSpanProcessor implements SpanProcessor { + private readonly captureContent: boolean; + private readonly reconciliationTimeoutMs: number; + private readonly delegate: Delegate; + private readonly pending = new Map(); + private isShutdown = false; + + constructor(options: FIVoltAgentSpanProcessorOptions) { + if (!options || (!options.tracerProvider && !options.exporter)) { + throw new Error("FIVoltAgentSpanProcessor needs a tracerProvider (from register()) or an exporter"); + } + this.captureContent = options.captureContent === true; + this.reconciliationTimeoutMs = options.usageReconciliationTimeoutMs ?? DEFAULT_RECONCILIATION_TIMEOUT_MS; + this.delegate = options.tracerProvider + ? delegateFromProvider(options.tracerProvider, options) + : delegateFromExporter(options); + } + + onStart(_span: Span, _parentContext: Context): void { + // The mapped copy is built when the span ends; nothing to do at start. + } + + onEnd(span: ReadableSpan): void { + if (this.isShutdown) return; + try { + const source = span.attributes ?? {}; + const mapped = mapVoltAgentAttributes(source, { captureContent: this.captureContent }); + + if (mapped.isModelCall && mapped.operationId) { + this.hold(mapped.operationId, { + original: span, + source, + attributes: mapped.attributes, + isError: span.status?.code === SpanStatusCode.ERROR, + }); + return; + } + + if (mapped.isOperationRoot && mapped.operationId) { + const operation = this.take(mapped.operationId); + if (operation) { + try { + reconcileOperationUsage(source, operation.spans); + } catch (error) { + diag.warn("@traceai/voltagent: usage reconciliation failed", error); + } + for (const held of operation.spans) this.forward(held.original, held.attributes); + } + } + + this.forward(span, mapped.attributes); + } catch (error) { + diag.error("@traceai/voltagent: failed to map or export a VoltAgent span", error); + } + } + + async forceFlush(): Promise { + try { + this.releaseAll(); + await this.delegate.flush(); + } catch (error) { + diag.error("@traceai/voltagent: forceFlush failed", error); + } + } + + async shutdown(): Promise { + if (this.isShutdown) return; + try { + this.releaseAll(); + this.isShutdown = true; + await this.delegate.shutdown(); + } catch (error) { + this.isShutdown = true; + diag.error("@traceai/voltagent: shutdown failed", error); + } + } + + private hold(operationId: string, span: PendingLLMSpan): void { + let operation = this.pending.get(operationId); + if (!operation) { + if (this.pending.size >= MAX_PENDING_OPERATIONS) { + const oldest = this.pending.keys().next().value; + if (oldest !== undefined) this.release(oldest); + } + operation = { spans: [] }; + operation.timer = setTimeout(() => this.release(operationId), this.reconciliationTimeoutMs); + (operation.timer as { unref?: () => void }).unref?.(); + this.pending.set(operationId, operation); + } + operation.spans.push(span); + } + + private take(operationId: string): PendingOperation | undefined { + const operation = this.pending.get(operationId); + if (!operation) return undefined; + if (operation.timer) clearTimeout(operation.timer); + this.pending.delete(operationId); + return operation; + } + + /** Export held llm spans without reconciliation (root never arrived, flush, or shutdown). */ + private release(operationId: string): void { + const operation = this.take(operationId); + if (!operation) return; + for (const held of operation.spans) this.forward(held.original, held.attributes); + } + + private releaseAll(): void { + for (const operationId of Array.from(this.pending.keys())) this.release(operationId); + } + + private forward(span: ReadableSpan, attributes: Attributes): void { + try { + this.delegate.processor.onEnd(copySpan(span, attributes, this.delegate.resource ?? span.resource)); + } catch (error) { + diag.error("@traceai/voltagent: exporter rejected a span", error); + } + } +} + +/** A ReadableSpan with new attributes and resource; every other field reads through. */ +export function copySpan(span: ReadableSpan, attributes: Attributes, resource: Resource): ReadableSpan { + const spanContext = span.spanContext(); + const copy = { + name: span.name, + kind: span.kind, + spanContext: () => spanContext, + parentSpanContext: span.parentSpanContext, + startTime: span.startTime, + endTime: span.endTime, + status: span.status, + attributes, + links: span.links, + events: span.events, + duration: span.duration, + ended: span.ended, + resource, + instrumentationScope: span.instrumentationScope, + droppedAttributesCount: span.droppedAttributesCount, + droppedEventsCount: span.droppedEventsCount, + droppedLinksCount: span.droppedLinksCount, + } as ReadableSpan & Record; + // SDK 1.x field names, in case the exporter in use still reads them. + const legacy = span as unknown as Record; + if (legacy.parentSpanId !== undefined) copy.parentSpanId = legacy.parentSpanId; + if (legacy.instrumentationLibrary !== undefined) copy.instrumentationLibrary = legacy.instrumentationLibrary; + return copy; +} + +function delegateFromProvider(provider: TracerProviderLike, options: FIVoltAgentSpanProcessorOptions): Delegate { + // OpenTelemetry SDK 2.x keeps these private; there is no public way to hand a finished span + // from one provider to another provider's processors. + const internals = provider as unknown as { + _activeSpanProcessor?: SpanProcessor & { _spanProcessors?: unknown[] }; + _resource?: Resource; + _config?: { resource?: Resource }; + }; + const active = internals._activeSpanProcessor; + if (!active || typeof active.onEnd !== "function") { + throw new Error( + "FIVoltAgentSpanProcessor: tracerProvider has no span processor. Pass the provider returned by register() from @traceai/fi-core (OpenTelemetry SDK 2.x), or pass an exporter.", + ); + } + warnIfGlobalProvider(provider); + const resource = internals._resource ?? internals._config?.resource; + + // register() attaches a SimpleSpanProcessor (one OTLP request per span; the OTLP exporter + // rejects requests beyond 30 in flight, so a burst drops spans), and register({ batch: true }) + // does not replace it on SDK 2.x. Batch through the provider's own exporter instead. + const exporters = (active._spanProcessors ?? []) + .map((processor) => (processor as { _exporter?: SpanExporter })._exporter) + .filter((exporter): exporter is SpanExporter => !!exporter && typeof exporter.export === "function"); + if (options.batch !== false && exporters.length === 1) { + const batch = new BatchSpanProcessor(new SharedExporter(exporters[0]), options.batchConfig); + return { + processor: batch, + resource, + flush: () => batch.forceFlush(), + // SharedExporter.shutdown only flushes: the exporter still belongs to the provider. + shutdown: () => batch.shutdown(), + }; + } + + return { + processor: active, + resource, + flush: () => provider.forceFlush(), + // The provider belongs to the caller (other instrumentations may share it); flush only. + shutdown: () => provider.forceFlush(), + }; +} + +/** Exports through an exporter this processor does not own; never shuts it down. */ +class SharedExporter implements SpanExporter { + constructor(private readonly inner: SpanExporter) {} + export(spans: ReadableSpan[], resultCallback: Parameters[1]): void { + this.inner.export(spans, resultCallback); + } + async shutdown(): Promise { + await this.forceFlush(); + } + async forceFlush(): Promise { + await this.inner.forceFlush?.(); + } +} + +function delegateFromExporter(options: FIVoltAgentSpanProcessorOptions): Delegate { + const exporter = options.exporter as SpanExporter; + const processor = + options.batch === false ? new SimpleSpanProcessor(exporter) : new BatchSpanProcessor(exporter, options.batchConfig); + return { + processor, + resource: options.resource, + flush: () => processor.forceFlush(), + shutdown: () => processor.shutdown(), + }; +} + +/** + * VoltAgentObservability registers its own NodeTracerProvider globally and takes its tracer from + * the global API. If register() already made the Future AGI provider global, VoltAgent's + * registration fails, its spans go straight to the Future AGI provider unmapped and with content, + * and no span processor in ObservabilityConfig (this one or VoltOps) ever sees them. + */ +function warnIfGlobalProvider(provider: TracerProviderLike): void { + try { + const global = trace.getTracerProvider() as unknown as { getDelegate?: () => unknown }; + const active = typeof global.getDelegate === "function" ? global.getDelegate() : global; + if (active === provider && !globalConflictWarned) { + globalConflictWarned = true; + const message = + "@traceai/voltagent: the Future AGI tracer provider is the global OpenTelemetry provider. " + + "VoltAgent's spans will bypass FIVoltAgentSpanProcessor (unmapped, content included). " + + "Call register({ ..., setGlobalTracerProvider: false })."; + diag.warn(message); + // eslint-disable-next-line no-console + console.warn(message); + } + } catch { + // Diagnostics only. + } +} diff --git a/typescript/packages/traceai_voltagent/src/__tests__/global-provider.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/global-provider.test.ts new file mode 100644 index 000000000..3ed99d74f --- /dev/null +++ b/typescript/packages/traceai_voltagent/src/__tests__/global-provider.test.ts @@ -0,0 +1,34 @@ +import { trace } from "@opentelemetry/api"; +import { Agent } from "@voltagent/core"; +import { FIVoltAgentSpanProcessor } from "../FIVoltAgentSpanProcessor"; +import { RecordingProcessor, fiProvider, resetOtelGlobals, scriptedModel, voltagent } from "./helpers"; + +let observability: ReturnType | undefined; +afterEach(async () => { + await resetOtelGlobals(observability); +}); + +describe("register() with setGlobalTracerProvider left on", () => { + it("warns, because VoltAgent's spans then bypass every ObservabilityConfig processor", async () => { + const warn = jest.spyOn(console, "warn").mockImplementation(() => undefined); + const { exporter, provider } = fiProvider(); + trace.setGlobalTracerProvider(provider); // what register() does by default + + const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider }); + expect(warn).toHaveBeenCalledWith(expect.stringContaining("setGlobalTracerProvider: false")); + + // The failure mode the warning describes, reproduced with VoltAgent 2.11.0. + const recorder = new RecordingProcessor(); + const { model } = scriptedModel("mockai/mock-model-1", [{ kind: "text", text: "ok", input: 1, output: 1 }]); + const agent = new Agent({ name: "assistant", instructions: "x", model }); + observability = voltagent({ assistant: agent }, [recorder, processor]); + await agent.generateText("hi"); + await processor.forceFlush(); + + expect(recorder.spans).toHaveLength(0); // VoltOps / user processors see nothing + const raw = exporter.getFinishedSpans(); + expect(raw.length).toBeGreaterThan(0); // spans went straight to the FI provider... + expect(raw.every((span) => span.attributes["fi.span.kind"] === undefined)).toBe(true); // ...unmapped + warn.mockRestore(); + }); +}); diff --git a/typescript/packages/traceai_voltagent/src/__tests__/helpers.ts b/typescript/packages/traceai_voltagent/src/__tests__/helpers.ts new file mode 100644 index 000000000..bc64a496a --- /dev/null +++ b/typescript/packages/traceai_voltagent/src/__tests__/helpers.ts @@ -0,0 +1,204 @@ +/* Shared fixtures for the jest tests: a scripted AI SDK mock model and VoltAgent wiring. */ +import { context, propagation, trace } from "@opentelemetry/api"; +import { resourceFromAttributes } from "@opentelemetry/resources"; +import { + BasicTracerProvider, + InMemorySpanExporter, + type ReadableSpan, + SimpleSpanProcessor, + type SpanProcessor, +} from "@opentelemetry/sdk-trace-base"; +import { Agent, VoltAgent, VoltAgentObservability, createTool } from "@voltagent/core"; +import { MockLanguageModelV3, convertArrayToReadableStream } from "ai/test"; +import { z } from "zod"; + +export const MARKERS = { + prompt: "SECRET_PROMPT_MARKER", + instructions: "SECRET_INSTRUCTIONS_MARKER", + toolArg: "SECRET_TOOL_ARG_MARKER", + toolResult: "SECRET_TOOL_RESULT_MARKER", + answer: "SECRET_ANSWER_MARKER", + subtask: "SECRET_SUBTASK_MARKER", +} as const; + +export type Step = + | { kind: "text"; text: string; input: number; output: number } + | { kind: "tools"; calls: Array<{ id: string; name: string; args: unknown }>; input: number; output: number } + | { kind: "error"; message: string }; + +/** + * An AI SDK V3 mock model that plays `steps` in order (generate or stream) and records the + * usage it reported. VoltAgent subagents call streamText, so both paths are scripted. + */ +export function scriptedModel(modelId: string, steps: Step[]) { + const reported: Array<{ input: number; output: number }> = []; + let index = 0; + const next = () => { + const step = steps[Math.min(index, steps.length - 1)]; + index += 1; + if (step.kind === "error") throw new Error(step.message); + reported.push({ input: step.input, output: step.output }); + const usage = { + inputTokens: { total: step.input, noCache: step.input, cacheRead: undefined, cacheWrite: undefined }, + outputTokens: { total: step.output, text: step.output, reasoning: undefined }, + }; + return { step, usage }; + }; + const model = new MockLanguageModelV3({ + provider: "mock-provider", + modelId, + doStream: async () => { + const { step, usage } = next(); + const parts: unknown[] = [{ type: "stream-start", warnings: [] }]; + if (step.kind === "text") { + parts.push( + { type: "text-start", id: "t1" }, + { type: "text-delta", id: "t1", delta: step.text }, + { type: "text-end", id: "t1" }, + { type: "finish", finishReason: { unified: "stop", raw: "stop" }, usage }, + ); + } else { + for (const call of step.calls) { + parts.push({ type: "tool-call", toolCallId: call.id, toolName: call.name, input: JSON.stringify(call.args) }); + } + parts.push({ type: "finish", finishReason: { unified: "tool-calls", raw: "tool_calls" }, usage }); + } + return { stream: convertArrayToReadableStream(parts) as never }; + }, + doGenerate: async () => { + const { step, usage } = next(); + if (step.kind === "text") { + return { + content: [{ type: "text" as const, text: step.text }], + finishReason: { unified: "stop" as const, raw: "stop" }, + usage, + warnings: [], + }; + } + return { + content: step.calls.map((call) => ({ + type: "tool-call" as const, + toolCallId: call.id, + toolName: call.name, + input: JSON.stringify(call.args), + })), + finishReason: { unified: "tool-calls" as const, raw: "tool_calls" }, + usage, + warnings: [], + }; + }, + }); + return { model, reported }; +} + +export const weatherTool = createTool({ + name: "get_weather", + description: "Look up the weather for a city", + parameters: z.object({ city: z.string() }), + execute: async ({ city }: { city: string }) => ({ forecast: `${MARKERS.toolResult} sunny in ${city}` }), +}); + +export const explodingTool = createTool({ + name: "explode", + description: "Always fails", + parameters: z.object({ x: z.number() }), + execute: async () => { + throw new Error("tool exploded"); + }, +}); + +/** Two model calls: the first asks for both tools (one fails), the second answers. */ +export function toolCallingSteps(): Step[] { + return [ + { + kind: "tools", + calls: [ + { id: "call-weather", name: "get_weather", args: { city: MARKERS.toolArg } }, + { id: "call-explode", name: "explode", args: { x: 1 } }, + ], + input: 11, + output: 7, + }, + { kind: "text", text: MARKERS.answer, input: 13, output: 5 }, + ]; +} + +/** Records every span VoltAgent hands to it, as VoltOps or any other user processor would. */ +export class RecordingProcessor implements SpanProcessor { + readonly spans: ReadableSpan[] = []; + onStart(): void {} + onEnd(span: ReadableSpan): void { + this.spans.push(span); + } + async forceFlush(): Promise {} + async shutdown(): Promise {} +} + +/** Wait until no new span has reached `recorder` for `quietMs`. */ +export async function settle(recorder: RecordingProcessor, quietMs = 100, maxMs = 5_000): Promise { + const deadline = Date.now() + maxMs; + let seen = -1; + while (seen !== recorder.spans.length && Date.now() < deadline) { + seen = recorder.spans.length; + await new Promise((resolve) => setTimeout(resolve, quietMs)); + } +} + +export const FI_RESOURCE_ATTRIBUTES = { + "service.name": "th8239-jest", + project_name: "th8239-jest", + project_type: "observe", +}; + +/** A stand-in for the provider register() returns: SDK 2.x BasicTracerProvider + in-memory exporter. */ +export function fiProvider() { + const exporter = new InMemorySpanExporter(); + const provider = new BasicTracerProvider({ + resource: resourceFromAttributes(FI_RESOURCE_ATTRIBUTES), + spanProcessors: [new SimpleSpanProcessor(exporter)], + }); + return { exporter, provider }; +} + +/** Wire agents into a fresh VoltAgentObservability whose spanProcessors are `processors`. */ +export function voltagent(agents: Record, processors: SpanProcessor[]) { + const observability = new VoltAgentObservability({ spanProcessors: processors }); + new VoltAgent({ agents, observability, checkDependencies: false }); + return observability; +} + +/** VoltAgentObservability registers its provider globally; reset between tests. */ +export async function resetOtelGlobals(observability?: { shutdown(): Promise }) { + if (observability) await observability.shutdown().catch(() => undefined); + trace.disable(); + context.disable(); + propagation.disable(); +} + +export const attrs = (span: ReadableSpan) => span.attributes as Record; +export const byName = (spans: ReadableSpan[], name: string) => spans.filter((span) => span.name === name); +export function one(spans: ReadableSpan[], name: string): ReadableSpan { + const found = byName(spans, name); + if (found.length !== 1) { + throw new Error(`expected one ${name}, got ${spans.map((span) => span.name).join(", ")}`); + } + return found[0]; +} +export const parentId = (span: ReadableSpan) => span.parentSpanContext?.spanId; + +/** Sum of the promoted input-token keys over every exported span (what Observe adds up). */ +export function promotedInputTokens(spans: ReadableSpan[]): number { + let total = 0; + for (const span of spans) { + const a = attrs(span); + // One hot column per span: the collector reads one value per span, whichever key it prefers. + const values = ["gen_ai.usage.input_tokens", "llm.usage.prompt_tokens", "llm.token_count.prompt"] + .map((key) => a[key]) + .filter((value): value is number => typeof value === "number"); + if (values.length > 0) { + if (new Set(values).size !== 1) throw new Error(`conflicting promoted input tokens on ${span.name}: ${values}`); + total += values[0]; + } + } + return total; +} diff --git a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts new file mode 100644 index 000000000..272b0d134 --- /dev/null +++ b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts @@ -0,0 +1,329 @@ +import { FISpanKind } from "@traceai/fi-semantic-conventions"; +import { + isContentKey, + isPromotedUsageKey, + isSecretKey, + mapVoltAgentAttributes, + reconcileOperationUsage, + resolveSpanKind, +} from "../mapping"; + +const OFF = { captureContent: false }; +const ON = { captureContent: true }; + +/** Keys trace-context.ts (2.11.0) writes on an agent root span. */ +function rootSpanAttributes() { + return { + "user.id": "user-9", + "conversation.id": "conv-123", + "operation.id": "op-1", + "entity.id": "assistant", + "entity.type": "agent", + "entity.name": "assistant", + "agent.state": "completed", + input: "SECRET_PROMPT", + output: "SECRET_ANSWER", + "agent.instructions": "SECRET_INSTRUCTIONS", + "agent.messages": '[{"role":"user","content":"SECRET_PROMPT"}]', + "agent.messages.ui": "[]", + "agent.stateSnapshot": '{"instructions":"SECRET_INSTRUCTIONS"}', + "ai.model.name": "openai/gpt-4o-mini", + "ai.model.provider": "openai", + "ai.model.temperature": 0.2, + "ai.model.max_tokens": 256, + "ai.response.finish_reason": "stop", + "usage.prompt_tokens": 24, + "usage.completion_tokens": 12, + "usage.total_tokens": 36, + "usage.cached_tokens": 3, + "usage.reasoning_tokens": 0, + }; +} + +/** Keys agent.ts (2.11.0) writes on an `llm:` span. */ +function llmSpanAttributes(overrides: Record = {}) { + return { + "user.id": "user-9", + "conversation.id": "conv-123", + "operation.id": "op-1", + "entity.type": "agent", + "span.type": "llm", + "llm.operation": "generateText", + "llm.model": "openai/gpt-4o-mini", + "llm.provider": "openai", + "llm.temperature": 0.2, + "llm.max_output_tokens": 256, + "llm.messages": '[{"role":"user","content":"SECRET_PROMPT"}]', + "llm.messages.count": 2, + "llm.usage.prompt_tokens": 13, + "llm.usage.completion_tokens": 5, + "llm.usage.total_tokens": 18, + "llm.usage.cached_tokens": 2, + "llm.usage.reasoning_tokens": 4, + "llm.finish_reason": "stop", + ...overrides, + }; +} + +describe("resolveSpanKind (AC-03)", () => { + it.each([ + [{ "span.type": "agent" }, FISpanKind.AGENT], + [{ "span.type": "llm" }, FISpanKind.LLM], + [{ "span.type": "tool" }, FISpanKind.TOOL], + [{ "span.type": "retriever" }, FISpanKind.RETRIEVER], + [{ "span.type": "vector" }, FISpanKind.RETRIEVER], + [{ "span.type": "embedding" }, FISpanKind.EMBEDDING], + [{ "span.type": "memory", "memory.operation": "read" }, FISpanKind.RETRIEVER], + [{ "span.type": "memory", "memory.operation": "write" }, FISpanKind.CHAIN], + [{ "span.type": "memory", "memory.operation": "write_steps" }, FISpanKind.CHAIN], + [{ "span.type": "guardrail" }, FISpanKind.CHAIN], + [{ "span.type": "middleware" }, FISpanKind.CHAIN], + [{ "span.type": "summary" }, FISpanKind.CHAIN], + [{ "span.type": "workflow-step" }, FISpanKind.CHAIN], + [{ "span.type": "something-new" }, FISpanKind.CHAIN], + [{ "entity.type": "agent" }, FISpanKind.AGENT], + [{ "entity.type": "workflow" }, FISpanKind.CHAIN], + // span.type wins over the inherited entity.type on child spans. + [{ "entity.type": "agent", "span.type": "tool" }, FISpanKind.TOOL], + ])("%j -> %s", (attributes, kind) => { + expect(resolveSpanKind(attributes)).toBe(kind); + }); + + it("leaves spans without VoltAgent type keys untyped", () => { + expect(resolveSpanKind({ "http.method": "GET" })).toBeUndefined(); + const mapped = mapVoltAgentAttributes({ "http.method": "GET" }, OFF); + expect(mapped.attributes["fi.span.kind"]).toBeUndefined(); + expect(mapped.attributes["http.method"]).toBe("GET"); + }); + + it("sets fi.span.kind, gen_ai.span.kind and openinference.span.kind together", () => { + const { attributes } = mapVoltAgentAttributes({ "span.type": "tool", "tool.name": "x" }, OFF); + expect(attributes["fi.span.kind"]).toBe("TOOL"); + expect(attributes["gen_ai.span.kind"]).toBe("TOOL"); + expect(attributes["openinference.span.kind"]).toBe("TOOL"); + expect(attributes["voltagent.span_type"]).toBe("tool"); + }); + + it("does not override a kind that is already set", () => { + const { attributes } = mapVoltAgentAttributes({ "span.type": "tool", "fi.span.kind": "GUARDRAIL" }, OFF); + expect(attributes["fi.span.kind"]).toBe("GUARDRAIL"); + }); +}); + +describe("mapVoltAgentAttributes (AC-02)", () => { + it("maps the agent root span: session, user, model, provider; summed usage off promoted keys", () => { + const source = rootSpanAttributes(); + const before = JSON.stringify(source); + const mapped = mapVoltAgentAttributes(source, OFF); + const a = mapped.attributes; + + expect(JSON.stringify(source)).toBe(before); // input not mutated + expect(mapped.kind).toBe(FISpanKind.AGENT); + expect(mapped.isOperationRoot).toBe(true); + expect(mapped.isModelCall).toBe(false); + expect(mapped.operationId).toBe("op-1"); + + expect(a["fi.span.kind"]).toBe("AGENT"); + expect(a["gen_ai.operation.name"]).toBe("invoke_agent"); + expect(a["session.id"]).toBe("conv-123"); + expect(a["gen_ai.conversation.id"]).toBe("conv-123"); + expect(a["user.id"]).toBe("user-9"); + expect(a["gen_ai.request.model"]).toBe("openai/gpt-4o-mini"); + expect(a["gen_ai.response.model"]).toBe("openai/gpt-4o-mini"); + expect(a["gen_ai.provider.name"]).toBe("openai"); + expect(a["gen_ai.request.temperature"]).toBe(0.2); + expect(a["gen_ai.request.max_tokens"]).toBe(256); + expect(a["gen_ai.response.finish_reasons"]).toEqual(["stop"]); + + // Summed usage is namespaced, never on a promoted key. + expect(a["voltagent.usage.input_tokens"]).toBe(24); + expect(a["voltagent.usage.output_tokens"]).toBe(12); + expect(a["voltagent.usage.total_tokens"]).toBe(36); + expect(a["voltagent.usage.cache_read_tokens"]).toBe(3); + for (const key of Object.keys(a)) expect(isPromotedUsageKey(key)).toBe(false); + + // Copy, do not delete. + expect(a["entity.type"]).toBe("agent"); + expect(a["usage.prompt_tokens"]).toBe(24); + expect(a["ai.model.name"]).toBe("openai/gpt-4o-mini"); + expect(a["conversation.id"]).toBe("conv-123"); + }); + + it("maps llm span usage onto the promoted GenAI keys", () => { + const mapped = mapVoltAgentAttributes(llmSpanAttributes(), OFF); + const a = mapped.attributes; + expect(mapped.isModelCall).toBe(true); + expect(a["fi.span.kind"]).toBe("LLM"); + expect(a["gen_ai.operation.name"]).toBe("chat"); + expect(a["gen_ai.request.model"]).toBe("openai/gpt-4o-mini"); + expect(a["gen_ai.provider.name"]).toBe("openai"); + expect(a["gen_ai.request.max_tokens"]).toBe(256); + expect(a["gen_ai.usage.input_tokens"]).toBe(13); + expect(a["gen_ai.usage.output_tokens"]).toBe(5); + expect(a["gen_ai.usage.total_tokens"]).toBe(18); + expect(a["gen_ai.usage.cache_read.input_tokens"]).toBe(2); + expect(a["gen_ai.usage.cache_read_tokens"]).toBe(2); + expect(a["gen_ai.usage.reasoning.output_tokens"]).toBe(4); + expect(a["gen_ai.usage.output_tokens.reasoning"]).toBe(4); + expect(a["llm.usage.prompt_tokens"]).toBe(13); // original kept + expect(a["llm.messages.count"]).toBe(2); // counts are not content + }); + + it("does not overwrite an existing session.id", () => { + const { attributes } = mapVoltAgentAttributes({ ...rootSpanAttributes(), "session.id": "explicit" }, OFF); + expect(attributes["session.id"]).toBe("explicit"); + expect(attributes["gen_ai.conversation.id"]).toBe("conv-123"); + }); + + it("maps tool name, call id and description", () => { + const { attributes } = mapVoltAgentAttributes( + { + "span.type": "tool", + "tool.name": "get_weather", + "tool.call.id": "call-1", + "tool.description": "weather", + input: '{"city":"SECRET"}', + }, + OFF, + ); + expect(attributes["gen_ai.tool.name"]).toBe("get_weather"); + expect(attributes["gen_ai.tool.call.id"]).toBe("call-1"); + expect(attributes["gen_ai.tool.description"]).toBe("weather"); + expect(attributes["gen_ai.operation.name"]).toBe("execute_tool"); + expect(attributes.input).toBeUndefined(); + }); + + it("moves promoted token/cost keys off spans that are not model calls", () => { + const { attributes } = mapVoltAgentAttributes( + { + "entity.type": "agent", + "agent.state": "completed", + "gen_ai.usage.input_tokens": 99, + "llm.usage.prompt_tokens": 98, + "llm.token_count.prompt": 97, + "gen_ai.cost.total": 0.5, + "llm.cost.total": 0.4, + }, + OFF, + ); + for (const key of Object.keys(attributes)) expect(isPromotedUsageKey(key)).toBe(false); + expect(attributes["voltagent.gen_ai.usage.input_tokens"]).toBe(99); + expect(attributes["voltagent.llm.usage.prompt_tokens"]).toBe(98); + expect(attributes["voltagent.gen_ai.cost.total"]).toBe(0.5); + }); +}); + +describe("content (AC-07)", () => { + const contentCarrier = { + ...rootSpanAttributes(), + "llm.messages": "SECRET", + "agent.context": "SECRET", + "middleware.input.original": "SECRET", + "guardrail.output.after": "SECRET", + "tool.search.query": "SECRET", + "workspace.search.query": "SECRET", + "vector.query": "SECRET", + "embedding.query": "SECRET", + "workflow.resume.data": "SECRET", + "suspension.checkpoint": "SECRET", + "workspace.sandbox.command": "SECRET", + }; + + it("drops prompts, messages, instructions, tool payloads and queries by default", () => { + const { attributes } = mapVoltAgentAttributes(contentCarrier, OFF); + expect(JSON.stringify(attributes)).not.toContain("SECRET"); + expect(attributes["input.value"]).toBeUndefined(); + expect(attributes["output.value"]).toBeUndefined(); + }); + + it("copies input/output to input.value/output.value only after opt-in", () => { + const { attributes } = mapVoltAgentAttributes(rootSpanAttributes(), ON); + expect(attributes["input.value"]).toBe("SECRET_PROMPT"); + expect(attributes["input.mime_type"]).toBe("text/plain"); + expect(attributes["output.value"]).toBe("SECRET_ANSWER"); + expect(attributes.input).toBe("SECRET_PROMPT"); + expect(attributes["agent.instructions"]).toBe("SECRET_INSTRUCTIONS"); + }); + + it("uses the vector/embedding query as retriever input only after opt-in", () => { + const off = mapVoltAgentAttributes({ "span.type": "vector", "vector.query": "find cats" }, OFF); + expect(off.attributes["input.value"]).toBeUndefined(); + const on = mapVoltAgentAttributes({ "span.type": "vector", "vector.query": "find cats" }, ON); + expect(on.attributes["input.value"]).toBe("find cats"); + expect(on.attributes["fi.span.kind"]).toBe("RETRIEVER"); + }); + + it("classifies keys", () => { + expect(isContentKey("input", "x")).toBe(true); + expect(isContentKey("llm.messages", "x")).toBe(true); + expect(isContentKey("llm.messages.count", 2)).toBe(false); + expect(isContentKey("memory.context_limit", 10)).toBe(false); + expect(isContentKey("gen_ai.usage.input_tokens", 3)).toBe(false); + expect(isContentKey("tool.name", "x")).toBe(false); + }); +}); + +describe("credentials", () => { + it("never exports API keys or headers, even with captureContent", () => { + const { attributes } = mapVoltAgentAttributes( + { + "span.type": "llm", + "llm.api_key": "sk-PLACEHOLDER", + "http.request.headers": "x-api-key: PLACEHOLDER", + "provider.authorization": "Bearer PLACEHOLDER", + "voltops.secret_key": "PLACEHOLDER", + }, + ON, + ); + expect(JSON.stringify(attributes)).not.toContain("PLACEHOLDER"); + expect(isSecretKey("usage.total_tokens")).toBe(false); + }); +}); + +describe("reconcileOperationUsage", () => { + const held = (overrides: Record = {}, isError = false) => { + const source = llmSpanAttributes(overrides); + return { source, attributes: mapVoltAgentAttributes(source, OFF).attributes, isError }; + }; + + it("puts the operation total on the single main llm span and keeps the last step", () => { + const span = held(); + const result = reconcileOperationUsage(rootSpanAttributes(), [span]); + expect(result).toBe(span.attributes); + const a = span.attributes; + expect(a["gen_ai.usage.input_tokens"]).toBe(24); + expect(a["gen_ai.usage.output_tokens"]).toBe(12); + expect(a["gen_ai.usage.total_tokens"]).toBe(36); + expect(a["llm.usage.prompt_tokens"]).toBe(24); + expect(a["llm.usage.completion_tokens"]).toBe(12); + expect(a["gen_ai.usage.cache_read.input_tokens"]).toBe(3); + expect(a["gen_ai.usage.reasoning.output_tokens"]).toBeUndefined(); // root reported 0 + expect(a["llm.usage.reasoning_tokens"]).toBeUndefined(); + expect(a["voltagent.llm.last_step_usage.prompt_tokens"]).toBe(13); + expect(a["voltagent.llm.last_step_usage.completion_tokens"]).toBe(5); + expect(a["voltagent.usage.reconciled"]).toBe(true); + }); + + it("leaves single-step calls alone", () => { + const span = held({ "llm.usage.prompt_tokens": 24, "llm.usage.completion_tokens": 12 }); + expect(reconcileOperationUsage(rootSpanAttributes(), [span])).toBeUndefined(); + expect(span.attributes["gen_ai.usage.input_tokens"]).toBe(24); + }); + + it("does nothing when the main call is ambiguous or failed", () => { + expect(reconcileOperationUsage(rootSpanAttributes(), [held(), held()])).toBeUndefined(); + expect(reconcileOperationUsage(rootSpanAttributes(), [held({}, true)])).toBeUndefined(); + expect( + reconcileOperationUsage(rootSpanAttributes(), [held({ "llm.operation": "generateTitle" })]), + ).toBeUndefined(); + const { "usage.prompt_tokens": _p, "usage.completion_tokens": _c, ...noUsage } = rootSpanAttributes(); + expect(reconcileOperationUsage(noUsage, [held()])).toBeUndefined(); + }); + + it("reconciles the one main call even when a title-generation call is present", () => { + const main = held(); + const title = held({ "llm.operation": "generateTitle", "llm.usage.prompt_tokens": 4 }); + expect(reconcileOperationUsage(rootSpanAttributes(), [main, title])).toBe(main.attributes); + expect(title.attributes["gen_ai.usage.input_tokens"]).toBe(4); + }); +}); diff --git a/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts new file mode 100644 index 000000000..c1534c6e3 --- /dev/null +++ b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts @@ -0,0 +1,377 @@ +import { SpanKind, SpanStatusCode } from "@opentelemetry/api"; +import { ExportResultCode } from "@opentelemetry/core"; +import { InMemorySpanExporter, type ReadableSpan, type SpanExporter } from "@opentelemetry/sdk-trace-base"; +import { Agent } from "@voltagent/core"; +import { FIVoltAgentSpanProcessor } from "../FIVoltAgentSpanProcessor"; +import { isPromotedUsageKey } from "../mapping"; +import { + FI_RESOURCE_ATTRIBUTES, + MARKERS, + RecordingProcessor, + attrs, + byName, + explodingTool, + fiProvider, + one, + parentId, + promotedInputTokens, + resetOtelGlobals, + scriptedModel, + settle, + toolCallingSteps, + voltagent, + weatherTool, +} from "./helpers"; + +type Observability = ReturnType; +let observability: Observability | undefined; + +afterEach(async () => { + await resetOtelGlobals(observability); + observability = undefined; +}); + +async function runToolCallingAgent(options: { captureContent?: boolean } = {}) { + const { exporter, provider } = fiProvider(); + const recorder = new RecordingProcessor(); + const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider, ...options }); + const { model, reported } = scriptedModel("mockai/mock-model-1", toolCallingSteps()); + const agent = new Agent({ + name: "assistant", + instructions: MARKERS.instructions, + model, + tools: [weatherTool, explodingTool], + }); + observability = voltagent({ assistant: agent }, [recorder, processor]); + + const result = await agent.generateText(MARKERS.prompt, { + conversationId: "conv-123", + userId: "user-9", + maxSteps: 4, + }); + // VoltAgent ends some memory spans in the background after generateText resolves. + await settle(recorder); + await processor.forceFlush(); + return { result, exported: exporter.getFinishedSpans(), recorded: recorder.spans, reported, observability }; +} + +describe("FIVoltAgentSpanProcessor with a real VoltAgent agent (AC-01)", () => { + it("exports a mapped copy of every VoltAgent span with kinds, parenting, model, session and errors", async () => { + const { result, exported } = await runToolCallingAgent(); + expect(result.text).toBe(MARKERS.answer); + + const root = one(exported, "assistant"); + const llm = one(exported, "llm:generateText"); + const weather = one(exported, "tool.execution:get_weather"); + const failing = one(exported, "tool.execution:explode"); + + expect(new Set(exported.map((span) => span.spanContext().traceId)).size).toBe(1); + expect(parentId(root)).toBeUndefined(); + for (const child of [llm, weather, failing]) expect(parentId(child)).toBe(root.spanContext().spanId); + + expect(attrs(root)["fi.span.kind"]).toBe("AGENT"); + expect(attrs(llm)["fi.span.kind"]).toBe("LLM"); + expect(attrs(weather)["fi.span.kind"]).toBe("TOOL"); + expect(attrs(failing)["gen_ai.span.kind"]).toBe("TOOL"); + for (const span of byName(exported, "memory.read")) expect(attrs(span)["fi.span.kind"]).toBe("RETRIEVER"); + for (const span of byName(exported, "memory.write")) expect(attrs(span)["fi.span.kind"]).toBe("CHAIN"); + expect(llm.kind).toBe(SpanKind.CLIENT); + + expect(attrs(llm)["gen_ai.request.model"]).toBe("mockai/mock-model-1"); + expect(attrs(llm)["gen_ai.provider.name"]).toBe("mockai"); + expect(attrs(root)["gen_ai.request.model"]).toBe("mockai/mock-model-1"); + expect(attrs(weather)["gen_ai.tool.name"]).toBe("get_weather"); + expect(attrs(weather)["gen_ai.tool.call.id"]).toBe("call-weather"); + + for (const span of exported) { + expect(attrs(span)["session.id"]).toBe("conv-123"); + expect(attrs(span)["user.id"]).toBe("user-9"); + expect(span.resource.attributes).toMatchObject(FI_RESOURCE_ATTRIBUTES); + } + + expect(failing.status.code).toBe(SpanStatusCode.ERROR); + expect(failing.events.map((event) => event.name)).toContain("exception"); + expect(attrs(failing)["error.message"]).toBe("tool exploded"); + expect(weather.status.code).toBe(SpanStatusCode.OK); + expect(root.status.code).toBe(SpanStatusCode.OK); + }); + + it("keeps promoted token keys on model-call spans only, summing to the model calls", async () => { + const { exported, reported } = await runToolCallingAgent(); + expect(reported).toHaveLength(2); // two model steps: tool calls, then the answer + const modelCallInputTokens = reported.reduce((sum, step) => sum + step.input, 0); + const modelCallOutputTokens = reported.reduce((sum, step) => sum + step.output, 0); + + expect(promotedInputTokens(exported)).toBe(modelCallInputTokens); + for (const span of exported) { + if (attrs(span)["fi.span.kind"] === "LLM") continue; + for (const key of Object.keys(attrs(span))) expect(isPromotedUsageKey(key)).toBe(false); + } + + const llm = attrs(one(exported, "llm:generateText")); + expect(llm["gen_ai.usage.input_tokens"]).toBe(modelCallInputTokens); + expect(llm["gen_ai.usage.output_tokens"]).toBe(modelCallOutputTokens); + expect(llm["voltagent.llm.last_step_usage.prompt_tokens"]).toBe(reported[1].input); + expect(llm["voltagent.usage.reconciled"]).toBe(true); + const root = attrs(one(exported, "assistant")); + expect(root["voltagent.usage.input_tokens"]).toBe(modelCallInputTokens); + expect(root["usage.prompt_tokens"]).toBe(modelCallInputTokens); + }); + + it("exports no content by default", async () => { + const { exported } = await runToolCallingAgent(); + const blob = JSON.stringify(exported.map((span) => [span.name, span.attributes, span.events])); + for (const marker of Object.values(MARKERS)) expect(blob).not.toContain(marker); + for (const span of exported) { + for (const key of ["input", "output", "input.value", "output.value", "llm.messages", "agent.instructions"]) { + expect(attrs(span)[key]).toBeUndefined(); + } + } + }); + + it("exports content only after captureContent: true (control run)", async () => { + const { exported } = await runToolCallingAgent({ captureContent: true }); + const root = attrs(one(exported, "assistant")); + expect(root["input.value"]).toBe(MARKERS.prompt); + expect(root["output.value"]).toBe(MARKERS.answer); + const weather = attrs(one(exported, "tool.execution:get_weather")); + expect(String(weather["input.value"])).toContain(MARKERS.toolArg); + expect(String(weather["output.value"])).toContain(MARKERS.toolResult); + }); +}); + +describe("streamText", () => { + it("maps the streaming path and reconciles its multi-step usage", async () => { + const { exporter, provider } = fiProvider(); + const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider }); + const { model, reported } = scriptedModel("mockai/mock-model-1", toolCallingSteps()); + const agent = new Agent({ name: "assistant", instructions: "x", model, tools: [weatherTool, explodingTool] }); + observability = voltagent({ assistant: agent }, [processor]); + const stream = await agent.streamText(MARKERS.prompt, { conversationId: "conv-stream", maxSteps: 4 }); + expect(await stream.text).toBe(MARKERS.answer); + await new Promise((resolve) => setTimeout(resolve, 50)); + await processor.forceFlush(); + const spans = exporter.getFinishedSpans(); + const llm = attrs(one(spans, "llm:streamText")); + expect(reported).toHaveLength(2); + expect(promotedInputTokens(spans)).toBe(reported.reduce((sum, step) => sum + step.input, 0)); + expect(llm["fi.span.kind"]).toBe("LLM"); + expect(attrs(one(spans, "assistant"))["session.id"]).toBe("conv-stream"); + expect(JSON.stringify(spans.map((span) => span.attributes))).not.toContain(MARKERS.prompt); + }); +}); + +describe("coexistence with other processors in the same array (AC-06)", () => { + it("every processor still receives every span, unchanged, and our export count matches", async () => { + const { exported, recorded, observability: obs } = await runToolCallingAgent(); + expect(recorded.length).toBeGreaterThan(0); + expect(exported).toHaveLength(recorded.length); + expect(exported.map((span) => span.spanContext().spanId).sort()).toEqual( + recorded.map((span) => span.spanContext().spanId).sort(), + ); + + // VoltAgent's own local storage processor (the VoltOps console's source) saw the same spans. + const traceId = recorded[0].spanContext().traceId; + const stored = await obs.getTraceFromStorage(traceId); + expect(stored).toHaveLength(recorded.length); + + // The span other processors hold is the original: no FI keys added, VoltAgent keys intact. + const originalRoot = one(recorded, "assistant"); + expect(attrs(originalRoot)["fi.span.kind"]).toBeUndefined(); + expect(attrs(originalRoot).input).toBe(MARKERS.prompt); + expect(attrs(originalRoot)["usage.prompt_tokens"]).toBe(24); + const originalLLM = one(recorded, "llm:generateText"); + expect(attrs(originalLLM)["llm.usage.prompt_tokens"]).toBe(13); + expect(originalRoot.resource.attributes["service.name"]).toBe("voltagent"); + }); +}); + +describe("subagents (AC-04)", () => { + it("puts the subagent in the supervisor's trace under the delegate_task tool span", async () => { + const { exporter, provider } = fiProvider(); + const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider }); + const child = scriptedModel("mockai/child-model", [{ kind: "text", text: "child answer", input: 5, output: 3 }]); + const supervisorModel = scriptedModel("mockai/supervisor-model", [ + { + kind: "tools", + calls: [ + { + id: "call-delegate", + name: "delegate_task", + args: { task: MARKERS.subtask, targetAgents: ["researcher"] }, + }, + ], + input: 20, + output: 9, + }, + { kind: "text", text: "final", input: 30, output: 4 }, + ]); + const researcher = new Agent({ name: "researcher", instructions: "research", model: child.model }); + const supervisor = new Agent({ + name: "supervisor", + instructions: "delegate", + model: supervisorModel.model, + subAgents: [researcher], + }); + observability = voltagent({ supervisor, researcher }, [processor]); + + await supervisor.generateText("go", { conversationId: "conv-sub", userId: "user-1", maxSteps: 4 }); + await processor.forceFlush(); + const spans = exporter.getFinishedSpans(); + expect(child.reported).toHaveLength(1); // the subagent really ran (through streamText) + expect(supervisorModel.reported).toHaveLength(2); + + expect(new Set(spans.map((span) => span.spanContext().traceId)).size).toBe(1); + const root = one(spans, "supervisor"); + const delegate = one(spans, "tool.execution:delegate_task"); + const subagent = spans.find((span) => span.name.startsWith("subagent:")); + expect(subagent).toBeDefined(); + expect(parentId(root)).toBeUndefined(); + expect(parentId(delegate)).toBe(root.spanContext().spanId); + expect(parentId(subagent as ReadableSpan)).toBe(delegate.spanContext().spanId); + expect(attrs(subagent as ReadableSpan)["fi.span.kind"]).toBe("AGENT"); + expect((subagent as ReadableSpan).status.code).toBe(SpanStatusCode.OK); + expect(delegate.status.code).toBe(SpanStatusCode.OK); + const childLLM = spans.filter( + (span) => attrs(span)["fi.span.kind"] === "LLM" && attrs(span)["llm.model"] === "mockai/child-model", + ); + expect(childLLM).toHaveLength(1); + expect(attrs(childLLM[0])["llm.operation"]).toBe("streamText"); + + const modelCalls = [...supervisorModel.reported, ...child.reported].reduce((sum, step) => sum + step.input, 0); + expect(promotedInputTokens(spans)).toBe(modelCalls); + expect(JSON.stringify(spans.map((span) => span.attributes))).not.toContain(MARKERS.subtask); + }); +}); + +describe("failure isolation", () => { + class ThrowingExporter implements SpanExporter { + export(): void { + throw new Error("collector down"); + } + async shutdown(): Promise { + throw new Error("shutdown failed"); + } + async forceFlush(): Promise { + throw new Error("flush failed"); + } + } + + it("an exporter that throws never breaks the agent, flush or shutdown", async () => { + const processor = new FIVoltAgentSpanProcessor({ exporter: new ThrowingExporter(), batch: false }); + const { model } = scriptedModel("mockai/mock-model-1", toolCallingSteps()); + const agent = new Agent({ name: "assistant", instructions: "x", model, tools: [weatherTool, explodingTool] }); + observability = voltagent({ assistant: agent }, [processor]); + const result = await agent.generateText("hi", { maxSteps: 4 }); + expect(result.text).toBe(MARKERS.answer); + await expect(processor.forceFlush()).resolves.toBeUndefined(); + await expect(processor.shutdown()).resolves.toBeUndefined(); + await expect(processor.shutdown()).resolves.toBeUndefined(); + }); + + it("an exporter that reports FAILED never breaks flush", async () => { + const failing: SpanExporter = { + export: (_spans, done) => done({ code: ExportResultCode.FAILED, error: new Error("503") }), + shutdown: async () => undefined, + }; + const processor = new FIVoltAgentSpanProcessor({ exporter: failing }); + const { model } = scriptedModel("mockai/mock-model-1", [{ kind: "text", text: "ok", input: 1, output: 1 }]); + const agent = new Agent({ name: "assistant", instructions: "x", model }); + observability = voltagent({ assistant: agent }, [processor]); + await expect(agent.generateText("hi")).resolves.toMatchObject({ text: "ok" }); + await expect(processor.forceFlush()).resolves.toBeUndefined(); + await expect(processor.shutdown()).resolves.toBeUndefined(); + }); + + it("ignores spans after shutdown and requires a destination", async () => { + expect(() => new FIVoltAgentSpanProcessor({})).toThrow(/tracerProvider/); + const exporter = new InMemorySpanExporter(); + const processor = new FIVoltAgentSpanProcessor({ exporter, batch: false }); + await processor.shutdown(); + const { exporter: other, provider } = fiProvider(); + const live = new FIVoltAgentSpanProcessor({ tracerProvider: provider }); + const recorder = new RecordingProcessor(); + const { model } = scriptedModel("mockai/mock-model-1", [{ kind: "text", text: "ok", input: 1, output: 1 }]); + const agent = new Agent({ name: "assistant", instructions: "x", model }); + observability = voltagent({ assistant: agent }, [recorder, processor, live]); + await agent.generateText("hi"); + await settle(recorder); + await live.forceFlush(); + expect(exporter.getFinishedSpans()).toHaveLength(0); + expect(other.getFinishedSpans().length).toBe(recorder.spans.length); + }); +}); + +describe("batching through the register() provider's exporter", () => { + it("sends one batch on flush, and shutdown leaves the provider's exporter usable", async () => { + const { exporter, provider } = fiProvider(); + const exportCalls: number[] = []; + const originalExport = exporter.export.bind(exporter); + exporter.export = (spans, done) => { + exportCalls.push(spans.length); + originalExport(spans, done); + }; + const processor = new FIVoltAgentSpanProcessor({ + tracerProvider: provider, + batchConfig: { scheduledDelayMillis: 60_000 }, + }); + const recorder = new RecordingProcessor(); + const { model } = scriptedModel("mockai/mock-model-1", toolCallingSteps()); + const agent = new Agent({ name: "assistant", instructions: "x", model, tools: [weatherTool, explodingTool] }); + observability = voltagent({ assistant: agent }, [recorder, processor]); + await agent.generateText("hi", { maxSteps: 4 }); + await settle(recorder); + expect(exportCalls).toEqual([]); // nothing sent per span + await processor.forceFlush(); + expect(exportCalls).toEqual([recorder.spans.length]); + await processor.shutdown(); + // The exporter still belongs to the provider: other instrumentations keep exporting. + provider.getTracer("other").startSpan("after-shutdown").end(); + await provider.forceFlush(); + expect(exporter.getFinishedSpans().map((span) => span.name)).toContain("after-shutdown"); + }); + + it("can export per span instead (batch: false)", async () => { + const { exporter, provider } = fiProvider(); + const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider, batch: false }); + const { model } = scriptedModel("mockai/mock-model-1", [{ kind: "text", text: "ok", input: 1, output: 1 }]); + const agent = new Agent({ name: "assistant", instructions: "x", model }); + const recorder = new RecordingProcessor(); + observability = voltagent({ assistant: agent }, [recorder, processor]); + await agent.generateText("hi"); + await settle(recorder); + expect(exporter.getFinishedSpans()).toHaveLength(recorder.spans.length); + }); +}); + +describe("usage reconciliation window", () => { + it("exports a held llm span unreconciled when its root never ends", async () => { + const exporter = new InMemorySpanExporter(); + const processor = new FIVoltAgentSpanProcessor({ exporter, batch: false, usageReconciliationTimeoutMs: 5 }); + const fakeLLM = { + name: "llm:generateText", + kind: SpanKind.CLIENT, + spanContext: () => ({ traceId: "a".repeat(32), spanId: "b".repeat(16), traceFlags: 1 }), + parentSpanContext: undefined, + startTime: [0, 0], + endTime: [0, 1], + status: { code: SpanStatusCode.OK }, + attributes: { "span.type": "llm", "operation.id": "op-x", "llm.usage.prompt_tokens": 7 }, + links: [], + events: [], + duration: [0, 1], + ended: true, + resource: { attributes: {} }, + instrumentationScope: { name: "@voltagent/core" }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, + } as unknown as ReadableSpan; + processor.onEnd(fakeLLM); + expect(exporter.getFinishedSpans()).toHaveLength(0); + await new Promise((resolve) => setTimeout(resolve, 30)); + const [span] = exporter.getFinishedSpans(); + expect(span.attributes["gen_ai.usage.input_tokens"]).toBe(7); + expect(span.attributes["voltagent.usage.reconciled"]).toBeUndefined(); + }); +}); diff --git a/typescript/packages/traceai_voltagent/src/attributes.ts b/typescript/packages/traceai_voltagent/src/attributes.ts new file mode 100644 index 000000000..a26703136 --- /dev/null +++ b/typescript/packages/traceai_voltagent/src/attributes.ts @@ -0,0 +1,107 @@ +import { SemanticConventions } from "@traceai/fi-semantic-conventions"; + +/** + * Attribute keys written by @voltagent/core 2.11.0. + * + * Source: the published 2.11.0 bundle (sources recovered from dist/index.js.map): + * - src/agent/open-telemetry/trace-context.ts (root + child span attributes) + * - src/agent/agent.ts (llm, tool, memory.read, retriever spans) + * - src/memory/manager/memory-manager.ts (memory.write, embedding, vector spans) + */ +export const VoltAgentAttributes = { + ENTITY_TYPE: "entity.type", + ENTITY_ID: "entity.id", + ENTITY_NAME: "entity.name", + SPAN_TYPE: "span.type", + OPERATION_ID: "operation.id", + AGENT_STATE: "agent.state", + CONVERSATION_ID: "conversation.id", + USER_ID: "user.id", + + // Root (agent) span model + summed usage (trace-context.ts setModelAttributes/setUsage) + AI_MODEL_NAME: "ai.model.name", + AI_MODEL_PROVIDER: "ai.model.provider", + AI_MODEL_TEMPERATURE: "ai.model.temperature", + AI_MODEL_MAX_TOKENS: "ai.model.max_tokens", + AI_MODEL_TOP_P: "ai.model.top_p", + AI_RESPONSE_FINISH_REASON: "ai.response.finish_reason", + USAGE_PROMPT_TOKENS: "usage.prompt_tokens", + USAGE_COMPLETION_TOKENS: "usage.completion_tokens", + USAGE_TOTAL_TOKENS: "usage.total_tokens", + USAGE_CACHED_TOKENS: "usage.cached_tokens", + USAGE_REASONING_TOKENS: "usage.reasoning_tokens", + + // LLM span (agent.ts buildLLMSpanAttributes / recordLLMUsage) + LLM_OPERATION: "llm.operation", + LLM_MODEL: "llm.model", + LLM_PROVIDER: "llm.provider", + LLM_TEMPERATURE: "llm.temperature", + LLM_MAX_OUTPUT_TOKENS: "llm.max_output_tokens", + LLM_TOP_P: "llm.top_p", + LLM_FINISH_REASON: "llm.finish_reason", + LLM_MODEL_RESOLUTION_FAILED: "llm.model_resolution_failed", + LLM_USAGE_PROMPT_TOKENS: "llm.usage.prompt_tokens", + LLM_USAGE_COMPLETION_TOKENS: "llm.usage.completion_tokens", + LLM_USAGE_TOTAL_TOKENS: "llm.usage.total_tokens", + LLM_USAGE_CACHED_TOKENS: "llm.usage.cached_tokens", + LLM_USAGE_REASONING_TOKENS: "llm.usage.reasoning_tokens", + + // Tool span (agent.ts tool.execution:) + TOOL_NAME: "tool.name", + TOOL_CALL_ID: "tool.call.id", + TOOL_DESCRIPTION: "tool.description", + + // Memory spans + MEMORY_OPERATION: "memory.operation", + + // Embedding / vector vocabulary (architecture: span-helpers.ts on main; not in 2.11.0) + EMBEDDING_QUERY: "embedding.query", + VECTOR_QUERY: "vector.query", + + INPUT: "input", + OUTPUT: "output", +} as const; + +/** OpenTelemetry GenAI / Future AGI keys this package writes. */ +export const FIAttributes = { + FI_SPAN_KIND: SemanticConventions.FI_SPAN_KIND, // "fi.span.kind" + GEN_AI_SPAN_KIND: "gen_ai.span.kind", + OPENINFERENCE_SPAN_KIND: "openinference.span.kind", + GEN_AI_OPERATION_NAME: SemanticConventions.GEN_AI_OPERATION_NAME, + SESSION_ID: SemanticConventions.SESSION_ID, // "session.id" + USER_ID: SemanticConventions.USER_ID, // "user.id" + GEN_AI_CONVERSATION_ID: SemanticConventions.GEN_AI_CONVERSATION_ID, + GEN_AI_REQUEST_MODEL: SemanticConventions.LLM_MODEL_NAME, // "gen_ai.request.model" + GEN_AI_RESPONSE_MODEL: SemanticConventions.GEN_AI_RESPONSE_MODEL, + GEN_AI_PROVIDER_NAME: SemanticConventions.LLM_PROVIDER, // "gen_ai.provider.name" + GEN_AI_REQUEST_TEMPERATURE: "gen_ai.request.temperature", + GEN_AI_REQUEST_MAX_TOKENS: "gen_ai.request.max_tokens", + GEN_AI_REQUEST_TOP_P: "gen_ai.request.top_p", + GEN_AI_RESPONSE_FINISH_REASONS: SemanticConventions.GEN_AI_RESPONSE_FINISH_REASONS, + GEN_AI_USAGE_INPUT_TOKENS: SemanticConventions.LLM_TOKEN_COUNT_PROMPT, + GEN_AI_USAGE_OUTPUT_TOKENS: SemanticConventions.LLM_TOKEN_COUNT_COMPLETION, + GEN_AI_USAGE_TOTAL_TOKENS: SemanticConventions.LLM_TOKEN_COUNT_TOTAL, + // Cache/reasoning: the OTel GenAI name (architecture) plus the traceAI TS constant. + GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS: "gen_ai.usage.cache_read.input_tokens", + FI_USAGE_CACHE_READ_TOKENS: SemanticConventions.LLM_TOKEN_COUNT_PROMPT_DETAILS_CACHE_READ, + GEN_AI_USAGE_REASONING_OUTPUT_TOKENS: "gen_ai.usage.reasoning.output_tokens", + FI_USAGE_REASONING_TOKENS: SemanticConventions.LLM_TOKEN_COUNT_COMPLETION_DETAILS_REASONING, + GEN_AI_TOOL_NAME: "gen_ai.tool.name", + GEN_AI_TOOL_CALL_ID: "gen_ai.tool.call.id", + GEN_AI_TOOL_DESCRIPTION: "gen_ai.tool.description", + INPUT_VALUE: SemanticConventions.INPUT_VALUE, // "input.value" + OUTPUT_VALUE: SemanticConventions.OUTPUT_VALUE, // "output.value" + INPUT_MIME_TYPE: SemanticConventions.INPUT_MIME_TYPE, + OUTPUT_MIME_TYPE: SemanticConventions.OUTPUT_MIME_TYPE, +} as const; + +/** Keys this package adds under its own namespace. */ +export const VoltAgentFIAttributes = { + /** Summed usage from a non-model span (agent root), moved off the promoted keys. */ + USAGE_PREFIX: "voltagent.usage.", + /** Last-step usage VoltAgent recorded on an llm span before reconciliation. */ + LAST_STEP_USAGE_PREFIX: "voltagent.llm.last_step_usage.", + USAGE_RECONCILED: "voltagent.usage.reconciled", + /** Original span.type / entity.type that produced the kind. */ + SOURCE_SPAN_TYPE: "voltagent.span_type", +} as const; diff --git a/typescript/packages/traceai_voltagent/src/index.ts b/typescript/packages/traceai_voltagent/src/index.ts new file mode 100644 index 000000000..33efdea90 --- /dev/null +++ b/typescript/packages/traceai_voltagent/src/index.ts @@ -0,0 +1,17 @@ +export { + FIVoltAgentSpanProcessor, + copySpan, + type FIVoltAgentSpanProcessorOptions, + type TracerProviderLike, +} from "./FIVoltAgentSpanProcessor"; +export { + mapVoltAgentAttributes, + reconcileOperationUsage, + resolveSpanKind, + isContentKey, + isPromotedUsageKey, + isSecretKey, + type MapOptions, + type MappedAttributes, +} from "./mapping"; +export { VoltAgentAttributes, FIAttributes, VoltAgentFIAttributes } from "./attributes"; diff --git a/typescript/packages/traceai_voltagent/src/mapping.ts b/typescript/packages/traceai_voltagent/src/mapping.ts new file mode 100644 index 000000000..bb5c5cbf9 --- /dev/null +++ b/typescript/packages/traceai_voltagent/src/mapping.ts @@ -0,0 +1,387 @@ +import type { Attributes, AttributeValue } from "@opentelemetry/api"; +import { FISpanKind } from "@traceai/fi-semantic-conventions"; +import { FIAttributes, VoltAgentAttributes as VA, VoltAgentFIAttributes } from "./attributes"; + +export interface MapOptions { + /** Copy prompts, messages, tool arguments/results and retrieval queries. Default false. */ + captureContent: boolean; +} + +export interface MappedAttributes { + attributes: Attributes; + /** Future AGI span kind, or undefined when the span carries no VoltAgent type. */ + kind?: FISpanKind; + /** True for VoltAgent `span.type=llm` spans: the only spans that keep promoted token keys. */ + isModelCall: boolean; + /** True for the root span of an agent operation (`agent.state` set, no `span.type`). */ + isOperationRoot: boolean; + operationId?: string; +} + +/** + * Token and cost keys the Future AGI collector promotes into hot columns on any span kind. + * Observe sums them over every span of a trace, so they may appear only on per-model-call spans. + */ +const PROMOTED_EXACT = new Set([ + "gen_ai.usage.input_tokens", + "gen_ai.usage.output_tokens", + "gen_ai.usage.total_tokens", + "gen_ai.cost.total", + "llm.cost.total", +]); +const PROMOTED_PREFIXES = ["llm.token_count.", "llm.usage."]; + +export function isPromotedUsageKey(key: string): boolean { + return PROMOTED_EXACT.has(key) || PROMOTED_PREFIXES.some((prefix) => key.startsWith(prefix)); +} + +/** + * Content-bearing keys VoltAgent 2.11.0 writes (prompts, messages, tool args/results, + * system instructions, memory payloads, retrieval queries). Dropped unless captureContent. + */ +const CONTENT_EXACT = new Set([ + "input", + "output", + "agent.instructions", + "agent.messages", + "agent.messages.ui", + "agent.context", + "agent.stateSnapshot", + "llm.messages", + "workflow.context", + "workspace.sandbox.command", + "workspace.sandbox.args", + "suspension.checkpoint", + // Future AGI / GenAI content keys, in case an upstream span already carries them. + "input.value", + "output.value", + "gen_ai.input.messages", + "gen_ai.output.messages", + "gen_ai.prompts", + "gen_ai.system_instructions", +]); +/** Any dotted segment equal to one of these marks content (middleware.input.original, ...). */ +const CONTENT_SEGMENTS = new Set(["input", "output"]); +/** A final segment equal to one of these marks content (tool.search.query, resume.data, ...). */ +const CONTENT_LAST_SEGMENTS = new Set([ + "messages", + "instructions", + "query", + "context", + "data", + "checkpoint", + "prompt", + "prompts", + "completion", + "content", + "arguments", + "args", +]); + +export function isContentKey(key: string, value: AttributeValue | undefined): boolean { + if (CONTENT_EXACT.has(key)) return true; + // Counts, flags and sizes are never content. + if (typeof value === "number" || typeof value === "boolean") return false; + const segments = key.split("."); + if (segments.some((segment) => CONTENT_SEGMENTS.has(segment))) return true; + return CONTENT_LAST_SEGMENTS.has(segments[segments.length - 1]); +} + +/** Credentials never belong on a span, whatever captureContent says. */ +const SECRET_SEGMENT = /^(api[_-]?key|apikey|secret|secret[_-]?key|password|passwd|authorization|auth[_-]?token|access[_-]?token|bearer|cookie|set-cookie|x-api-key|x-secret-key|headers?)$/i; + +export function isSecretKey(key: string): boolean { + return key.split(".").some((segment) => SECRET_SEGMENT.test(segment)); +} + +const asString = (value: AttributeValue | undefined): string | undefined => + typeof value === "string" && value.length > 0 ? value : undefined; +const asNumber = (value: AttributeValue | undefined): number | undefined => + typeof value === "number" && Number.isFinite(value) ? value : undefined; + +/** + * Kind map (architecture section 3, refined with the 2.11.0 inventory): + * agent root or span.type=agent -> AGENT, llm -> LLM, tool -> TOOL, retriever/vector -> RETRIEVER, + * embedding -> EMBEDDING, memory read -> RETRIEVER, memory write -> CHAIN, + * guardrail/middleware/summary/workflow/unknown types -> CHAIN. + */ +export function resolveSpanKind(attributes: Attributes): FISpanKind | undefined { + const spanType = asString(attributes[VA.SPAN_TYPE]); + const entityType = asString(attributes[VA.ENTITY_TYPE]); + if (spanType) { + switch (spanType) { + case "agent": + return FISpanKind.AGENT; + case "llm": + return FISpanKind.LLM; + case "tool": + return FISpanKind.TOOL; + case "retriever": + case "vector": + return FISpanKind.RETRIEVER; + case "embedding": + return FISpanKind.EMBEDDING; + case "memory": + return attributes[VA.MEMORY_OPERATION] === "read" ? FISpanKind.RETRIEVER : FISpanKind.CHAIN; + default: + // guardrail, middleware, summary, workflow-step, and any type added later. + return FISpanKind.CHAIN; + } + } + if (entityType === "agent") return FISpanKind.AGENT; + if (entityType === "workflow") return FISpanKind.CHAIN; + return undefined; +} + +const OPERATION_NAMES: Partial> = { + [FISpanKind.AGENT]: "invoke_agent", + [FISpanKind.LLM]: "chat", + [FISpanKind.TOOL]: "execute_tool", + [FISpanKind.EMBEDDING]: "embeddings", +}; + +/** VoltAgent usage key -> namespaced key used on non-model spans (agent root). */ +const ROOT_USAGE_TO_NAMESPACED: Array<[string, string]> = [ + [VA.USAGE_PROMPT_TOKENS, "input_tokens"], + [VA.USAGE_COMPLETION_TOKENS, "output_tokens"], + [VA.USAGE_TOTAL_TOKENS, "total_tokens"], + [VA.USAGE_CACHED_TOKENS, "cache_read_tokens"], + [VA.USAGE_REASONING_TOKENS, "reasoning_tokens"], +]; + +/** Writes GenAI usage keys for a model-call span. */ +export function setModelCallUsage( + attributes: Attributes, + usage: { input?: number; output?: number; total?: number; cached?: number; reasoning?: number }, +): void { + if (usage.input !== undefined) attributes[FIAttributes.GEN_AI_USAGE_INPUT_TOKENS] = usage.input; + if (usage.output !== undefined) attributes[FIAttributes.GEN_AI_USAGE_OUTPUT_TOKENS] = usage.output; + const total = + usage.total ?? + (usage.input !== undefined && usage.output !== undefined ? usage.input + usage.output : undefined); + if (total !== undefined) attributes[FIAttributes.GEN_AI_USAGE_TOTAL_TOKENS] = total; + if (usage.cached !== undefined && usage.cached > 0) { + attributes[FIAttributes.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS] = usage.cached; + attributes[FIAttributes.FI_USAGE_CACHE_READ_TOKENS] = usage.cached; + } + if (usage.reasoning !== undefined && usage.reasoning > 0) { + attributes[FIAttributes.GEN_AI_USAGE_REASONING_OUTPUT_TOKENS] = usage.reasoning; + attributes[FIAttributes.FI_USAGE_REASONING_TOKENS] = usage.reasoning; + } +} + +export function readLLMSpanUsage(attributes: Attributes) { + return { + input: asNumber(attributes[VA.LLM_USAGE_PROMPT_TOKENS]), + output: asNumber(attributes[VA.LLM_USAGE_COMPLETION_TOKENS]), + total: asNumber(attributes[VA.LLM_USAGE_TOTAL_TOKENS]), + cached: asNumber(attributes[VA.LLM_USAGE_CACHED_TOKENS]), + reasoning: asNumber(attributes[VA.LLM_USAGE_REASONING_TOKENS]), + }; +} + +export function readRootUsage(attributes: Attributes) { + return { + input: asNumber(attributes[VA.USAGE_PROMPT_TOKENS]), + output: asNumber(attributes[VA.USAGE_COMPLETION_TOKENS]), + total: asNumber(attributes[VA.USAGE_TOTAL_TOKENS]), + cached: asNumber(attributes[VA.USAGE_CACHED_TOKENS]), + reasoning: asNumber(attributes[VA.USAGE_REASONING_TOKENS]), + }; +} + +function setIfAbsent(attributes: Attributes, key: string, value: AttributeValue | undefined): void { + if (value === undefined || value === null) return; + if (attributes[key] !== undefined) return; + attributes[key] = value; +} + +/** + * Map one VoltAgent span's attributes onto Future AGI / GenAI keys. + * + * Copy, do not delete: VoltAgent's own keys are kept, except content (unless captureContent), + * credentials, and promoted token keys on spans that are not model calls (moved under + * `voltagent.`). The input object is never mutated; the result is a new object. + */ +export function mapVoltAgentAttributes(source: Attributes, options: MapOptions): MappedAttributes { + const kind = resolveSpanKind(source); + const isModelCall = kind === FISpanKind.LLM; + const spanType = asString(source[VA.SPAN_TYPE]); + const isOperationRoot = + spanType === undefined && + asString(source[VA.ENTITY_TYPE]) === "agent" && + source[VA.AGENT_STATE] !== undefined; + const operationId = asString(source[VA.OPERATION_ID]); + + const out: Attributes = {}; + for (const [key, value] of Object.entries(source)) { + if (value === undefined) continue; + if (isSecretKey(key)) continue; + if (!options.captureContent && isContentKey(key, value)) continue; + if (!isModelCall && isPromotedUsageKey(key)) { + // Summed or derived usage on a non-model span: keep it, but not on a promoted key. + out[`voltagent.${key}`] = value; + continue; + } + out[key] = value; + } + + if (kind !== undefined && out[FIAttributes.FI_SPAN_KIND] === undefined) { + out[FIAttributes.FI_SPAN_KIND] = kind; + setIfAbsent(out, FIAttributes.GEN_AI_SPAN_KIND, kind); + setIfAbsent(out, FIAttributes.OPENINFERENCE_SPAN_KIND, kind); + setIfAbsent(out, FIAttributes.GEN_AI_OPERATION_NAME, OPERATION_NAMES[kind]); + setIfAbsent(out, VoltAgentFIAttributes.SOURCE_SPAN_TYPE, spanType ?? asString(source[VA.ENTITY_TYPE])); + } + + // Session and user. + const conversationId = asString(source[VA.CONVERSATION_ID]); + setIfAbsent(out, FIAttributes.SESSION_ID, conversationId); + setIfAbsent(out, FIAttributes.GEN_AI_CONVERSATION_ID, conversationId); + // user.id is already the Future AGI key (SemanticConventions.USER_ID); nothing to copy. + + // Model, provider, request parameters. + const modelName = isModelCall + ? asString(source[VA.LLM_MODEL]) ?? asString(source[VA.AI_MODEL_NAME]) + : asString(source[VA.AI_MODEL_NAME]); + setIfAbsent(out, FIAttributes.GEN_AI_REQUEST_MODEL, modelName); + setIfAbsent(out, FIAttributes.GEN_AI_RESPONSE_MODEL, modelName); + setIfAbsent( + out, + FIAttributes.GEN_AI_PROVIDER_NAME, + asString(source[VA.LLM_PROVIDER]) ?? asString(source[VA.AI_MODEL_PROVIDER]), + ); + setIfAbsent( + out, + FIAttributes.GEN_AI_REQUEST_TEMPERATURE, + asNumber(source[VA.LLM_TEMPERATURE]) ?? asNumber(source[VA.AI_MODEL_TEMPERATURE]), + ); + setIfAbsent( + out, + FIAttributes.GEN_AI_REQUEST_MAX_TOKENS, + asNumber(source[VA.LLM_MAX_OUTPUT_TOKENS]) ?? asNumber(source[VA.AI_MODEL_MAX_TOKENS]), + ); + setIfAbsent( + out, + FIAttributes.GEN_AI_REQUEST_TOP_P, + asNumber(source[VA.LLM_TOP_P]) ?? asNumber(source[VA.AI_MODEL_TOP_P]), + ); + const finishReason = + asString(source[VA.LLM_FINISH_REASON]) ?? asString(source[VA.AI_RESPONSE_FINISH_REASON]); + if (finishReason) setIfAbsent(out, FIAttributes.GEN_AI_RESPONSE_FINISH_REASONS, [finishReason]); + + // Usage. Promoted keys only on model-call spans. + if (isModelCall) { + const llmUsage = readLLMSpanUsage(source); + const hasLLMUsage = Object.values(llmUsage).some((value) => value !== undefined); + setModelCallUsage(out, hasLLMUsage ? llmUsage : readRootUsage(source)); + } else { + for (const [sourceKey, suffix] of ROOT_USAGE_TO_NAMESPACED) { + setIfAbsent(out, `${VoltAgentFIAttributes.USAGE_PREFIX}${suffix}`, asNumber(source[sourceKey])); + } + } + + // Tools. + if (kind === FISpanKind.TOOL) { + setIfAbsent(out, FIAttributes.GEN_AI_TOOL_NAME, asString(source[VA.TOOL_NAME])); + setIfAbsent(out, FIAttributes.GEN_AI_TOOL_CALL_ID, asString(source[VA.TOOL_CALL_ID])); + setIfAbsent(out, FIAttributes.GEN_AI_TOOL_DESCRIPTION, asString(source[VA.TOOL_DESCRIPTION])); + } + + // Content, only after opt-in. + if (options.captureContent) { + const input = + asString(source[VA.INPUT]) ?? + asString(source[VA.VECTOR_QUERY]) ?? + asString(source[VA.EMBEDDING_QUERY]); + if (input !== undefined && out[FIAttributes.INPUT_VALUE] === undefined) { + out[FIAttributes.INPUT_VALUE] = input; + setIfAbsent(out, FIAttributes.INPUT_MIME_TYPE, looksLikeJson(input) ? "application/json" : "text/plain"); + } + const output = asString(source[VA.OUTPUT]); + if (output !== undefined && out[FIAttributes.OUTPUT_VALUE] === undefined) { + out[FIAttributes.OUTPUT_VALUE] = output; + setIfAbsent(out, FIAttributes.OUTPUT_MIME_TYPE, looksLikeJson(output) ? "application/json" : "text/plain"); + } + } + + return { attributes: out, kind, isModelCall, isOperationRoot, operationId }; +} + +function looksLikeJson(value: string): boolean { + const trimmed = value.trimStart(); + return trimmed.startsWith("{") || trimmed.startsWith("["); +} + +/** llm.operation values whose usage VoltAgent also rolls up onto the operation root. */ +const ROOT_ROLLED_UP_OPERATIONS = new Set(["generateText", "streamText", "generateObject", "streamObject"]); + +/** + * VoltAgent 2.11.0 wraps a whole multi-step AI SDK call in one `llm:` span and records + * `response.usage` on it, which is the LAST step only (agent.ts finalizeLLMSpan), while the + * operation root records `totalUsage` across all steps (usage-normalizer.ts resolveFinishUsage). + * + * When exactly one successful main-call llm span exists for an operation and the root total is + * larger, the exported copy of that llm span carries the root total on the promoted keys, so the + * trace-wide sum equals the tokens of every model step. The last-step values are kept under + * `voltagent.llm.last_step_usage.*`. Returns the reconciled span attributes, if any. + */ +export function reconcileOperationUsage( + rootSource: Attributes, + llmSpans: Array<{ source: Attributes; attributes: Attributes; isError: boolean }>, +): Attributes | undefined { + const rootUsage = readRootUsage(rootSource); + if (rootUsage.input === undefined && rootUsage.output === undefined) return undefined; + + const candidates = llmSpans.filter( + (span) => + !span.isError && + span.source[VA.LLM_MODEL_RESOLUTION_FAILED] !== true && + ROOT_ROLLED_UP_OPERATIONS.has(String(span.source[VA.LLM_OPERATION])), + ); + if (candidates.length !== 1) return undefined; + + const target = candidates[0]; + const stepUsage = readLLMSpanUsage(target.source); + const grows = (total?: number, step?: number) => total !== undefined && (step === undefined || total > step); + if (!grows(rootUsage.input, stepUsage.input) && !grows(rootUsage.output, stepUsage.output)) { + return undefined; + } + + const attributes = target.attributes; + const keep: Array<[string, number | undefined]> = [ + ["prompt_tokens", stepUsage.input], + ["completion_tokens", stepUsage.output], + ["total_tokens", stepUsage.total], + ["cached_tokens", stepUsage.cached], + ["reasoning_tokens", stepUsage.reasoning], + ]; + for (const [suffix, value] of keep) { + if (value !== undefined) attributes[`${VoltAgentFIAttributes.LAST_STEP_USAGE_PREFIX}${suffix}`] = value; + } + // Every promoted key on this span must agree, or the collector could pick the stale one. + for (const key of Object.keys(attributes)) { + if (isPromotedUsageKey(key)) delete attributes[key]; + } + for (const key of [ + FIAttributes.GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS, + FIAttributes.FI_USAGE_CACHE_READ_TOKENS, + FIAttributes.GEN_AI_USAGE_REASONING_OUTPUT_TOKENS, + FIAttributes.FI_USAGE_REASONING_TOKENS, + ]) { + delete attributes[key]; + } + const total = + rootUsage.total ?? + (rootUsage.input !== undefined && rootUsage.output !== undefined ? rootUsage.input + rootUsage.output : undefined); + if (rootUsage.input !== undefined) attributes[VA.LLM_USAGE_PROMPT_TOKENS] = rootUsage.input; + if (rootUsage.output !== undefined) attributes[VA.LLM_USAGE_COMPLETION_TOKENS] = rootUsage.output; + if (total !== undefined) attributes[VA.LLM_USAGE_TOTAL_TOKENS] = total; + if (rootUsage.cached !== undefined && rootUsage.cached > 0) attributes[VA.LLM_USAGE_CACHED_TOKENS] = rootUsage.cached; + if (rootUsage.reasoning !== undefined && rootUsage.reasoning > 0) { + attributes[VA.LLM_USAGE_REASONING_TOKENS] = rootUsage.reasoning; + } + setModelCallUsage(attributes, { ...rootUsage, total }); + attributes[VoltAgentFIAttributes.USAGE_RECONCILED] = true; + return attributes; +} diff --git a/typescript/packages/traceai_voltagent/tsconfig.esm.json b/typescript/packages/traceai_voltagent/tsconfig.esm.json new file mode 100644 index 000000000..e5d6f9b6c --- /dev/null +++ b/typescript/packages/traceai_voltagent/tsconfig.esm.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.base.esm.json", + "compilerOptions": { + "outDir": "dist/esm", + "rootDir": "src", + "tsBuildInfoFile": "dist/esm/tsconfig.esm.tsbuildinfo", + "baseUrl": "./src" + }, + "include": [ + "src/**/*.ts" + ], + "references": [], + "exclude": [ + "src/**/*.test.ts", + "src/**/__tests__/**" + ] +} diff --git a/typescript/packages/traceai_voltagent/tsconfig.esnext.json b/typescript/packages/traceai_voltagent/tsconfig.esnext.json new file mode 100644 index 000000000..a99f0fe06 --- /dev/null +++ b/typescript/packages/traceai_voltagent/tsconfig.esnext.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.base.esnext.json", + "compilerOptions": { + "outDir": "dist/esnext", + "rootDir": "src", + "tsBuildInfoFile": "dist/esnext/tsconfig.esnext.tsbuildinfo", + "baseUrl": "./src" + }, + "include": [ + "src/**/*.ts" + ], + "references": [], + "exclude": [ + "src/**/*.test.ts", + "src/**/__tests__/**" + ] +} diff --git a/typescript/packages/traceai_voltagent/tsconfig.json b/typescript/packages/traceai_voltagent/tsconfig.json new file mode 100644 index 000000000..0e2ed2808 --- /dev/null +++ b/typescript/packages/traceai_voltagent/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "dist", + "rootDir": ".", + "baseUrl": "./src" + }, + "include": ["src/**/*.ts", "test/**/*.ts"], + "exclude": ["src/**/*.test.ts", "src/**/__tests__/**", "test/**/*.ts"], + "references": [ + { "path": "../fi-core" }, + { "path": "../fi-semantic-conventions" } + ] +} \ No newline at end of file diff --git a/typescript/pnpm-lock.yaml b/typescript/pnpm-lock.yaml index c0f93ce14..45f94c507 100644 --- a/typescript/pnpm-lock.yaml +++ b/typescript/pnpm-lock.yaml @@ -1916,6 +1916,64 @@ importers: specifier: ^5.7.2 version: 5.8.3 + packages/traceai_voltagent: + dependencies: + '@opentelemetry/api': + specifier: ^1.9.0 + version: 1.9.1 + '@opentelemetry/sdk-trace-base': + specifier: ^2.0.1 + version: 2.7.1(@opentelemetry/api@1.9.1) + '@traceai/fi-core': + specifier: workspace:^ + version: link:../fi-core + '@traceai/fi-semantic-conventions': + specifier: workspace:^ + version: link:../fi-semantic-conventions + devDependencies: + '@ai-sdk/provider-utils': + specifier: ^4.0.0 + version: 4.0.27(zod@4.3.6) + '@opentelemetry/core': + specifier: ^2.0.1 + version: 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': + specifier: ^2.0.1 + version: 2.7.1(@opentelemetry/api@1.9.1) + '@types/jest': + specifier: ^29.5.12 + version: 29.5.14 + '@types/node': + specifier: ^22.15.29 + version: 22.15.33 + '@voltagent/core': + specifier: 2.11.0 + version: 2.11.0(@ai-sdk/provider-utils@4.0.27(zod@4.3.6))(@ai-sdk/provider@3.0.18)(@cfworker/json-schema@4.1.1)(@voltagent/logger@2.0.2(@opentelemetry/api@1.9.1))(ai@6.0.97(zod@4.3.6))(graphql@16.12.0)(ws@8.21.0)(zod@4.3.6) + '@voltagent/logger': + specifier: 2.0.2 + version: 2.0.2(@opentelemetry/api@1.9.1) + ai: + specifier: 6.0.97 + version: 6.0.97(zod@4.3.6) + jest: + specifier: ^29.7.0 + version: 29.7.0(@types/node@22.15.33)(ts-node@10.9.2(@types/node@22.15.33)(typescript@5.8.3)) + rimraf: + specifier: ^6.0.1 + version: 6.1.2 + ts-jest: + specifier: ^29.1.4 + version: 29.4.6(@babel/core@7.27.1)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.27.1))(jest-util@29.7.0)(jest@29.7.0(@types/node@22.15.33)(ts-node@10.9.2(@types/node@22.15.33)(typescript@5.8.3)))(typescript@5.8.3) + tsc-alias: + specifier: ^1.8.16 + version: 1.8.16 + typescript: + specifier: ^5.8.3 + version: 5.8.3 + zod: + specifier: 4.3.6 + version: 4.3.6 + packages/traceai_weaviate: dependencies: '@opentelemetry/api': @@ -2019,18 +2077,120 @@ packages: express: optional: true + '@ai-sdk/amazon-bedrock@3.0.138': + resolution: {integrity: sha512-lXb0Fbfy4nJXGXObdGfpUQ0uwL+5NVd3E6BrOkiOdDwvTXZSo6NtXMSTU8Zs9Gu5lX1Pofa2rISYKPi6qA3TXg==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + + '@ai-sdk/anthropic@2.0.108': + resolution: {integrity: sha512-mJbksqjU81Gj5tjK4LXWwQBepFgQRcS0TqSCmvDs5ydJdw7b4LGKjvzhF0SQd7KLrZOrYlQf9ZKK1+sgVjWRSw==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + + '@ai-sdk/anthropic@3.0.127': + resolution: {integrity: sha512-Inff1DmPRVWi6QGr9YL2wiA4maILZuve9I8id/O4keQEoq6fJv6EfvkrSFw/nNvm2jiTcIUfDrpczeHTuhl9mg==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + + '@ai-sdk/azure@3.0.133': + resolution: {integrity: sha512-iVCT1q6bRPWjzisu7Xy1bc1yWtegd3WSZzmi4+jkiFTKTxir703F5jH8mWPG0hPnqW/OjdkOrSzcQ063j7T/ng==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + + '@ai-sdk/cerebras@2.0.87': + resolution: {integrity: sha512-yt1MfKX3fXy3wnfsuq5v0Nug++26PxWvHF6n3PlvVfJ4DKZtSlu+zTFTAECgzx6gpZHxao6hdRZJuZTqktFuYg==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + + '@ai-sdk/cohere@3.0.67': + resolution: {integrity: sha512-eCRRz3C12MeHq99GKAHGpvPrnQ7WAzXRMcrNn2Nu+Z6VNkSoiZew0T/L0+Cu5pJ9T0Ir9a//i5ZEpxntkjbdiw==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + + '@ai-sdk/deepinfra@2.0.85': + resolution: {integrity: sha512-863De/kGQs/cMFfDSr06O91e8PxcLM6pZDAZCwZWQbhZwbdYRrWEF4lU+Rzm2TIy0pfdaBxt2L3jCNSrQiu7tg==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + + '@ai-sdk/deepseek@2.0.71': + resolution: {integrity: sha512-2uLtZBgONfzEP7tZOg23sBzi33n1/gcW1zLNNw96/PLt9vdqDYIkGQnKRd6F+/0Wwy77jVulU+gzpiudk3f0UQ==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/gateway@3.0.53': resolution: {integrity: sha512-QT3FEoNARMRlk8JJVR7L98exiK9C8AGfrEJVbRxBT1yIXKs/N19o/+PsjTRVsARgDJNcy9JbJp1FspKucEat0Q==} engines: {node: '>=18'} peerDependencies: zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/google-vertex@3.0.180': + resolution: {integrity: sha512-CEJo+6BtXerfs/821FFpNDVJnatkBA7+1pyVHxXUL2hUf6uUd9dCp7G3AhAlPDnH1jGmHTu6CKGTaHKniesUDQ==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + + '@ai-sdk/google@2.0.101': + resolution: {integrity: sha512-UKi6v3UDEmXvOb/V6GTwRAoPR0cmP1Cvpnnp0BOjUlupJhWlnWCeq94UkBqHoRcmfgbrW3uoXfxZNZdM9HNTcQ==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + + '@ai-sdk/google@3.0.130': + resolution: {integrity: sha512-DOhGfFT667LbopxMZU7kIiT4K8F2RNN8ziwmOxAfMbp3xTvAaxQ4ynPKNWBVXcCkGYDmzPb7QiazN1IRX8y3lw==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + + '@ai-sdk/groq@3.0.72': + resolution: {integrity: sha512-XZjv3yIGkUNHRoIo/jb5HGOJwTcXw6th5M5SSoV7s0YN9LmC4BKt3bWPcbJQwSLSka+N+xqVGwbBBo5unewBuw==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + + '@ai-sdk/mistral@3.0.70': + resolution: {integrity: sha512-0vkrpXtF2rX4N5VmBIwt98VM3Ar3D7p1WIKATSUoQZ6Hu4BwXaN3GrmgEu6hQUMG+NE3spF6ptMCKyyYENj09w==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + + '@ai-sdk/openai-compatible@1.0.58': + resolution: {integrity: sha512-IqsKBBEBtfZD38GZaLnpAq8aSJu1774UPX3vm2hirKnf5SS0uvXQVYtGFRWKHcOOPvtxELTCd/wL4oEfhvn4Jw==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + + '@ai-sdk/openai-compatible@2.0.81': + resolution: {integrity: sha512-L14Jd0lAFKNM42l9TxlpwkNiyMlSvSvGySLc9GN4FB0qOo4/WmYOeLyn/CPhghIr0K4O6vH1y0nChxGljq2ccg==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + + '@ai-sdk/openai@3.0.124': + resolution: {integrity: sha512-7DpRUPXzJ+S6XasEJBojzFCs04J3rNPs0FZFF3PEeix49IggZAwsMrqscUwB/+05+87r01SS/jeopQGOOL4AEQ==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/openai@3.0.37': resolution: {integrity: sha512-bcYjT3/58i/C0DN3AnrjiGsAb0kYivZLWWUtgTjsBurHSht/LTEy+w3dw5XQe3FmZwX7Z/mUQCiA3wB/5Kf7ow==} engines: {node: '>=18'} peerDependencies: zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/perplexity@3.1.2': + resolution: {integrity: sha512-36PUGuTdlGQWsh5qwc+tNIHHup/s6ue/ohPK348FVXDjxwoiK1elhNhg2Ynwx0AIwOGimhVtz6rBR/iTHQ6KWw==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/provider-utils@2.2.8': resolution: {integrity: sha512-fqhG+4sCVv8x7nFzYnFo19ryhAa3w096Kmc3hWxMQfW/TubPOmt3A6tYZhl4mUfQWWQMsuSkLrtjlWuXBVSGQA==} engines: {node: '>=18'} @@ -2043,6 +2203,12 @@ packages: peerDependencies: zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/provider-utils@3.0.41': + resolution: {integrity: sha512-xpURVGQud+AEOZ/uRZTBU0eVy2+dt/y/dUEp9ewjW3eTM6yu0vThzTvduhOSabpn6AExewg8WJW04P4D6USVXw==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/provider-utils@4.0.15': resolution: {integrity: sha512-8XiKWbemmCbvNN0CLR9u3PQiet4gtEVIrX4zzLxnCj06AwsEDJwJVBbKrEI4t6qE8XRSIvU2irka0dcpziKW6w==} engines: {node: '>=18'} @@ -2061,6 +2227,12 @@ packages: peerDependencies: zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/provider-utils@4.0.57': + resolution: {integrity: sha512-89a7sPvZqXsP3PigcAQLWntu/duIVEcN/RyChAB+j6p3C7NwW767sVttvL8r0+BetTg63uAXQoYHCZZueQKBSw==} + engines: {node: '>=18.17'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/provider@1.1.3': resolution: {integrity: sha512-qZMxYJ0qqX/RfnuIaab+zp8UAeJn/ygXXAffR5I4N0n1IrvA6qBsjc8hXLmBiMV2zoXlifkacF7sEFnYnjBcqg==} engines: {node: '>=18'} @@ -2069,23 +2241,55 @@ packages: resolution: {integrity: sha512-h88OPkavHTiN9tMn2l5awAznGB0lXzjcLhgR1/rvjB2zlLprsNxbM2tt6OJsHUxduLC3klq0/eqaSf6fX5XVww==} engines: {node: '>=18'} + '@ai-sdk/provider@2.0.5': + resolution: {integrity: sha512-cmG40u10QFEUrYXWYom6Lo6DLR+pND3wWABTTT9Nf7zg9F7BD46KNj+STekndp9Kg5ZAIPA0WxmTI0IwRvKvvQ==} + engines: {node: '>=18'} + '@ai-sdk/provider@3.0.10': resolution: {integrity: sha512-Q3BZ27qfpYqnCYGvE3vt+Qi6LGOF9R5Nmzn+9JoM1lCRsD9mYaIhfJLkSunN48nfGXJ6n+XNV0J/XVpqGQl7Dw==} engines: {node: '>=18'} + '@ai-sdk/provider@3.0.18': + resolution: {integrity: sha512-IpefF5ssZVOZCD4Wu7zxt6PwZoGT2HLVjxpJ10Bjx6EAmRfLYJPjyrfxb0RYDlwvXnDb9nkQ7Do/oJVDuRFzew==} + engines: {node: '>=18'} + '@ai-sdk/provider@3.0.8': resolution: {integrity: sha512-oGMAgGoQdBXbZqNG0Ze56CHjDZ1IDYOwGYxYjO5KLSlz5HiNQ9udIXsPZ61VWaHGZ5XW/jyjmr6t2xz2jGVwbQ==} engines: {node: '>=18'} + '@ai-sdk/togetherai@2.0.87': + resolution: {integrity: sha512-huozw2UgcyMKTBZYcLmzFm+y1Zq4qzUEYjnlAmzp+WItUULcglZ3rRH8HX3cbCycMWI8pUA4Mnh2dDClOQ1/Eg==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + '@ai-sdk/ui-utils@1.2.11': resolution: {integrity: sha512-3zcwCc8ezzFlwp3ZD15wAPjf2Au4s3vAbKsXQVyhxODHcmu0iyPO2Eua6D/vicq/AUm/BAo60r97O6HU+EI0+w==} engines: {node: '>=18'} peerDependencies: zod: ^3.23.8 + '@ai-sdk/vercel@2.0.83': + resolution: {integrity: sha512-KJtE2Vm8w/4dC/gPdRfw9BjRP+j2BeR06DRCR6733yb/0OflKS8bbgwbnRenCgPLxg6K8gJid+CUyIZVum51bQ==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + + '@ai-sdk/xai@3.0.139': + resolution: {integrity: sha512-epoKIfuCcmQh6uVn90OESeWmr7mqPJ3YtXNXStdpRvXLVqPmo47pnDUW/AH1vyvZ+6gsKg9TbSGVvyGeFQyHlg==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.1.8 + '@ai-zen/node-fetch-event-source@2.1.4': resolution: {integrity: sha512-OHFwPJecr+qwlyX5CGmTvKAKPZAdZaxvx/XDqS1lx4I2ZAk9riU0XnEaRGOOAEFrdcLZ98O5yWqubwjaQc0umg==} + '@aihubmix/ai-sdk-provider@1.0.3': + resolution: {integrity: sha512-6YSu/3rLkPlY7fqSHTwq6LMiK+0BLVZsbsi/28w+og2MrpUYPNaBhkj7F80K79NE28+HFOqIJROFgAUFmaoh6w==} + engines: {node: '>=18'} + peerDependencies: + zod: ^3.25.76 || ^4.0.0 + '@ampproject/remapping@2.3.0': resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} @@ -2093,9 +2297,22 @@ packages: '@anthropic-ai/sdk@0.27.3': resolution: {integrity: sha512-IjLt0gd3L4jlOfilxVXTifn42FnVffMgDC04RJK1KDZpmkBWLv0XC92MVVmkxrFZNS/7l3xWgP/I3nqtX1sQHw==} + '@anthropic-ai/sdk@0.71.2': + resolution: {integrity: sha512-TGNDEUuEstk/DKu0/TflXAEt+p+p/WhTlFzEnoosvbaDU2LTjm42igSdlL0VijrKpWejtOKxX0b8A7uc+XiSAQ==} + hasBin: true + peerDependencies: + zod: ^3.25.0 || ^4.0.0 + peerDependenciesMeta: + zod: + optional: true + '@anthropic-ai/sdk@0.9.1': resolution: {integrity: sha512-wa1meQ2WSfoY8Uor3EdrJq0jTiZJoKoSii2ZVWRY1oN4Tlr5s59pADg9T79FTbPe1/se5c3pBeZgJL63wmuoBA==} + '@anycable/core@0.9.2': + resolution: {integrity: sha512-x5ZXDcW/N4cxWl93CnbHs/u7qq4793jS2kNPWm+duPrXlrva+ml2ZGT7X9tuOBKzyIHf60zWCdIK7TUgMPAwXA==} + engines: {node: '>=18.0.0'} + '@aws-crypto/crc32@5.2.0': resolution: {integrity: sha512-nLbCWqQNgUiwwtFsen1AdzAtvuLRsQS8rYgMuxCrdKf9kOssamGLuPwyTY9wyYblNr9+1XM8v6zoDTPPSIeANg==} engines: {node: '>=16.0.0'} @@ -2612,12 +2829,24 @@ packages: cpu: [x64] os: [win32] + '@fastify/busboy@2.1.1': + resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} + engines: {node: '>=14'} + '@finom/zod-to-json-schema@3.24.11': resolution: {integrity: sha512-fL656yBPiWebtfGItvtXLWrFNGlF1NcDFS0WdMQXMs9LluVg0CfT5E2oXYp0pidl0vVG53XkW55ysijNkU5/hA==} deprecated: 'Use https://www.npmjs.com/package/zod-v3-to-json-schema instead. See issue comment for details: https://github.com/StefanTerdell/zod-to-json-schema/issues/178#issuecomment-3533122539' peerDependencies: zod: ^4.0.14 + '@gitlab/gitlab-ai-provider@3.6.1': + resolution: {integrity: sha512-8JihlrwiUuyxzMU+wnUqx9oZZ+JtFFMYcYAULxdr0IsXYfe1OUd6xfUAioLzdUfWBobFVRDTQSVS8788Zg786A==} + engines: {node: '>=18'} + deprecated: 'This package has moved to ''gitlab-ai-provider''. Please run: npm install gitlab-ai-provider' + peerDependencies: + '@ai-sdk/provider': '>=2.0.0' + '@ai-sdk/provider-utils': '>=3.0.0' + '@google-cloud/opentelemetry-cloud-monitoring-exporter@0.21.0': resolution: {integrity: sha512-+lAew44pWt6rA4l8dQ1gGhH7Uo95wZKfq/GBf9aEyuNDDLQ2XppGEEReu6ujesSqTtZ8ueQFt73+7SReSHbwqg==} engines: {node: '>=18'} @@ -3388,9 +3617,25 @@ packages: '@cfworker/json-schema': optional: true + '@modelcontextprotocol/sdk@1.32.0': + resolution: {integrity: sha512-8BviX/hK4Gd2eL1KdTwm0gfl4d3wdoErW0Jd00h6nomUAtk6IJk5vwQJc6kfWtJTzN5OEV/lgIiJKI8fiDGAlA==} + engines: {node: '>=18'} + peerDependencies: + '@cfworker/json-schema': ^4.1.1 + zod: ^3.25 || ^4.0 + peerDependenciesMeta: + '@cfworker/json-schema': + optional: true + '@mongodb-js/saslprep@1.4.5': resolution: {integrity: sha512-k64Lbyb7ycCSXHSLzxVdb2xsKGPMvYZfCICXvDsI8Z65CeWQzTEKS4YmGbnqw+U9RBvLPTsB6UCmwkgsDTGWIw==} + '@mymediset/sap-ai-provider@2.1.0': + resolution: {integrity: sha512-mvm2p+evS51GfNJwObLnGruhBrnV7DBCrm3SafYoZHrlmcFsAvCmRcofvk5AX7LdQpTCH+Q8pfo+gZvISOvnzA==} + engines: {node: '>=18'} + peerDependencies: + ai: ^6.0.0 + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -3434,6 +3679,14 @@ packages: resolution: {integrity: sha512-fTBjMqKCfotFWfLzaKyhjLvyEyq5vDKTTFfBmx21btv3gvy8Lq6N5Dh2OzqeuN4DjtpSvNT1uNVfg08eD2Rfxw==} engines: {node: '>=8.0.0'} + '@opentelemetry/api-logs@0.203.0': + resolution: {integrity: sha512-9B9RU0H7Ya1Dx/Rkyc4stuBZSGVQF27WigitInx2QQoj6KUpEFYPKoWjdFTunJYxmXmh17HeBvbMa1EhGyPmqQ==} + engines: {node: '>=8.0.0'} + + '@opentelemetry/api-logs@0.204.0': + resolution: {integrity: sha512-DqxY8yoAaiBPivoJD4UtgrMS8gEmzZ5lnaxzPojzLVHBGqPxgWm4zcuvcUHZiqQ6kRX2Klel2r9y8cA2HAtqpw==} + engines: {node: '>=8.0.0'} + '@opentelemetry/api-logs@0.205.0': resolution: {integrity: sha512-wBlPk1nFB37Hsm+3Qy73yQSobVn28F4isnWIBvKpd5IUH/eat8bwcL02H9yzmHyyPmukeccSl2mbN5sDQZYnPg==} engines: {node: '>=8.0.0'} @@ -3516,6 +3769,12 @@ packages: peerDependencies: '@opentelemetry/api': ^1.3.0 + '@opentelemetry/exporter-logs-otlp-http@0.204.0': + resolution: {integrity: sha512-cQyIIZxUnXy3M6n9LTW3uhw/cem4WP+k7NtrXp8pf4U3v0RljSCBeD0kA8TRotPJj2YutCjUIDrWOn0u+06PSA==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + '@opentelemetry/exporter-logs-otlp-http@0.218.0': resolution: {integrity: sha512-Qx+4rpVHzgg89dawcWRHyt+XRXeLnhFz/qBtvggmjkcgPUdr+NAB0/u/eIPA8yAeJV0J80Vz43JZCh/XFvZFGw==} engines: {node: ^18.19.0 || >=20.6.0} @@ -3552,6 +3811,12 @@ packages: peerDependencies: '@opentelemetry/api': ^1.3.0 + '@opentelemetry/exporter-trace-otlp-http@0.203.0': + resolution: {integrity: sha512-ZDiaswNYo0yq/cy1bBLJFe691izEJ6IgNmkjm4C6kE9ub/OMQqDXORx2D2j8fzTBTxONyzusbaZlqtfmyqURPw==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + '@opentelemetry/exporter-trace-otlp-http@0.218.0': resolution: {integrity: sha512-8dqezsmPhtKitIK/eTipZhYl9EX2/gNQ5zUMhaz3uxEURwfkNf8IPvo6yNfrzbxdtpAOybS/+h7wmIWYqFSpiw==} engines: {node: ^18.19.0 || >=20.6.0} @@ -3588,12 +3853,30 @@ packages: peerDependencies: '@opentelemetry/api': ^1.0.0 + '@opentelemetry/instrumentation-pino@0.50.1': + resolution: {integrity: sha512-pBbvuWiHA9iAumAuQ0SKYOXK7NRlbnVTf/qBV0nMdRnxBPrc/GZTbh0f7Y59gZfYsbCLhXLL1oRTEnS+PwS3CA==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + '@opentelemetry/instrumentation@0.202.0': resolution: {integrity: sha512-Uz3BxZWPgDwgHM2+vCKEQRh0R8WKrd/q6Tus1vThRClhlPO39Dyz7mDrOr6KuqGXAlBQ1e5Tnymzri4RMZNaWA==} engines: {node: ^18.19.0 || >=20.6.0} peerDependencies: '@opentelemetry/api': ^1.3.0 + '@opentelemetry/instrumentation@0.203.0': + resolution: {integrity: sha512-ke1qyM+3AK2zPuBPb6Hk/GCsc5ewbLvPNkEuELx/JmANeEp6ZjnZ+wypPAJSucTw0wvCGrUaibDSdcrGFoWxKQ==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/instrumentation@0.204.0': + resolution: {integrity: sha512-vV5+WSxktzoMP8JoYWKeopChy6G3HKk4UQ2hESCRDUUTZqQ3+nM3u8noVG0LmNfRWwcFBnbZ71GKC7vaYYdJ1g==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + '@opentelemetry/instrumentation@0.46.0': resolution: {integrity: sha512-a9TijXZZbk0vI5TGLZl+0kxyFfrXHhX6Svtz7Pp2/VBlCSKrazuULEyoJQrOknJyFWNMEmbbJgOciHCCpQcisw==} engines: {node: '>=14'} @@ -3624,6 +3907,18 @@ packages: peerDependencies: '@opentelemetry/api': ^1.3.0 + '@opentelemetry/otlp-exporter-base@0.203.0': + resolution: {integrity: sha512-Wbxf7k+87KyvxFr5D7uOiSq/vHXWommvdnNE7vECO3tAhsA2GfOlpWINCMWUEPdHZ7tCXxw6Epp3vgx3jU7llQ==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/otlp-exporter-base@0.204.0': + resolution: {integrity: sha512-K1LB1Ht4rGgOtZQ1N8xAwUnE1h9EQBfI4XUbSorbC6OxK6s/fLzl+UAhZX1cmBsDqM5mdx5+/k4QaKlDxX6UXQ==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + '@opentelemetry/otlp-exporter-base@0.205.0': resolution: {integrity: sha512-2MN0C1IiKyo34M6NZzD6P9Nv9Dfuz3OJ3rkZwzFmF6xzjDfqqCTatc9v1EpNfaP55iDOCLHFyYNCgs61FFgtUQ==} engines: {node: ^18.19.0 || >=20.6.0} @@ -3679,6 +3974,18 @@ packages: peerDependencies: '@opentelemetry/api': ^1.3.0 + '@opentelemetry/otlp-transformer@0.203.0': + resolution: {integrity: sha512-Y8I6GgoCna0qDQ2W6GCRtaF24SnvqvA8OfeTi7fqigD23u8Jpb4R5KFv/pRvrlGagcCLICMIyh9wiejp4TXu/A==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + + '@opentelemetry/otlp-transformer@0.204.0': + resolution: {integrity: sha512-AekB2dgHJ0PMS0b3LH7xA2HDKZ0QqqZW4n5r/AVZy00gKnFoeyVF9t0AUz051fm80G7tKjGSLqOUSazqfTNpVQ==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': ^1.3.0 + '@opentelemetry/otlp-transformer@0.205.0': resolution: {integrity: sha512-KmObgqPtk9k/XTlWPJHdMbGCylRAmMJNXIRh6VYJmvlRDMfe+DonH41G7eenG8t4FXn3fxOGh14o/WiMRR6vPg==} engines: {node: ^18.19.0 || >=20.6.0} @@ -3763,6 +4070,18 @@ packages: peerDependencies: '@opentelemetry/api': '>=1.4.0 <1.10.0' + '@opentelemetry/sdk-logs@0.203.0': + resolution: {integrity: sha512-vM2+rPq0Vi3nYA5akQD2f3QwossDnTDLvKbea6u/A2NZ3XDkPxMfo/PNrDoXhDUD/0pPo2CdH5ce/thn9K0kLw==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.4.0 <1.10.0' + + '@opentelemetry/sdk-logs@0.204.0': + resolution: {integrity: sha512-y32iNNmpMUVFWSqbNrXE8xY/6EMge+HX3PXsMnCDV4cXT4SNT+W/3NgyMDf80KJL0fUK17/a0NmfXcrBhkFWrg==} + engines: {node: ^18.19.0 || >=20.6.0} + peerDependencies: + '@opentelemetry/api': '>=1.4.0 <1.10.0' + '@opentelemetry/sdk-logs@0.205.0': resolution: {integrity: sha512-nyqhNQ6eEzPWQU60Nc7+A5LIq8fz3UeIzdEVBQYefB4+msJZ2vuVtRuk9KxPMw1uHoHDtYEwkr2Ct0iG29jU8w==} engines: {node: ^18.19.0 || >=20.6.0} @@ -4131,6 +4450,41 @@ packages: cpu: [x64] os: [win32] + '@sap-ai-sdk/ai-api@2.16.0': + resolution: {integrity: sha512-L5PfhyTE4NIWxACUmfBf7ULlF4I/YOd73j9LfkNaHO/Bhzo1ED36+pkJqqR18Z1dPm0hJcjrb2PDRWHdjoU2KQ==} + + '@sap-ai-sdk/core@2.16.0': + resolution: {integrity: sha512-njvfKccou923tIHDOFLgqR1bv+3OMB056Cc9LlJ7vY0XjkZsL5aS3XgTG/HvD9b7hASx5NZen0tu6UYX9cvWnw==} + + '@sap-ai-sdk/orchestration@2.16.0': + resolution: {integrity: sha512-jupRrvqtTKyikfYtJFCXAhIJUqXIt909OHnx4YT1t1kFbcrLIrNO1wsmhBJAKRRLLFYgsnLdXawNiuQ2faH5zA==} + + '@sap-ai-sdk/prompt-registry@2.16.0': + resolution: {integrity: sha512-pMKq/GCZ9et9y2Cn32g1nEIOSJgffEVAS6CEfpGVjuptjbENLzoi43VF4Ui71KLsarIjqV1GoC64qL9wbah4kg==} + + '@sap-cloud-sdk/connectivity@4.9.1': + resolution: {integrity: sha512-0deJBmdUd1LD1O3CX/wqYjTEKmnrnLsxnrSE8CyGtzbyomjjL1ePEXB3g6QUpQKmClVyOgJG/IbpyJFGGXXL5A==} + + '@sap-cloud-sdk/http-client@4.9.1': + resolution: {integrity: sha512-bsF8T/syitm+GI8eInOB1AfvHsTYJ8Qvg5dfGt5SGXEQjqV2amFEulPp7edNTzCLo0+BBbBa/jhvqLCvXSoV6A==} + + '@sap-cloud-sdk/openapi@4.9.1': + resolution: {integrity: sha512-o46XbWWjo4piTPsLWPE9yuGCNS8jIj1GfZSJpaHdWDO6ZF+CqaUwF21UtGTg0SJggoe6AsJlhVObL7QA6urcJg==} + + '@sap-cloud-sdk/resilience@4.9.1': + resolution: {integrity: sha512-14Hdd2VqEd3BarikR/ChZjquQuelC+CP69HKdMycADmmsuQEwaJkSXURW8cDl19bfx8Re1ldM/4Ig0gbCY4x/A==} + + '@sap-cloud-sdk/util@4.9.1': + resolution: {integrity: sha512-1tuv+c6o2Y8/1F3UEdqiv3TPWzZDpCjxuDpAFtFBM8C+weum8ixgwc2YXEWvBzWvtSEl7C5L/o8jBqiuhcXF4w==} + + '@sap/xsenv@6.2.2': + resolution: {integrity: sha512-SGn+yaVKeXND/rQaQhqTZC+M6g5ASW1YnqAdQiZqNL74E1T1kUsDHttgOjQNkLObMZ0fsxgQxRPMnuVcAgIODg==} + engines: {node: ^20.0.0 || ^22.0.0 || ^24.0.0} + + '@sap/xssec@4.15.0': + resolution: {integrity: sha512-I9TMMaWq4BNDNt9blJy8o2FV9uXjs2RyNTT7KBv9fK83bGoQxcipQ8e4DrxYb296GXg+HhE420kHuqmyXZSOuQ==} + engines: {node: '>=18'} + '@sec-ant/readable-stream@0.4.1': resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==} @@ -4361,6 +4715,9 @@ packages: '@so-ric/colorspace@1.1.6': resolution: {integrity: sha512-/KiKkpHNOBgkFJwu9sh48LkHSMYGyuTcSFK/qMBdnOAlrRJzRSXAOFB5qwzaVQuDl8wAvHVMkaASQDReTahxuw==} + '@socket.io/component-emitter@3.1.2': + resolution: {integrity: sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==} + '@standard-community/standard-json@0.3.5': resolution: {integrity: sha512-4+ZPorwDRt47i+O7RjyuaxHRK/37QY/LmgxlGrRrSTLYoFatEOzvqIc85GTlM18SFZ5E91C+v0o/M37wZPpUHA==} peerDependencies: @@ -4642,6 +4999,23 @@ packages: '@vitest/utils@3.2.4': resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} + '@voltagent/core@2.11.0': + resolution: {integrity: sha512-VHNlLyHg0e7+lxlet0CJlNeMWDDuzbtyjHvFSp6QH3JCFtkJ3ik/tQDqyAXS3Rt8O7af1NE7NOG3oG2S8j/Ceg==} + peerDependencies: + '@ai-sdk/provider-utils': 4.x + '@voltagent/logger': 2.0.2 + ai: ^6.0.0 + zod: ^3.25.0 || ^4.0.0 + peerDependenciesMeta: + '@voltagent/logger': + optional: true + + '@voltagent/internal@1.0.3': + resolution: {integrity: sha512-tw2L2PptjfsPThO6S4SjouwhAiXDGcjN6kKh9rc7IqWNNGZN+4mwj8gsOroMYOMmhIbfQEr2xT7TqZGNkteDlw==} + + '@voltagent/logger@2.0.2': + resolution: {integrity: sha512-WQKA257Sl+FEQKdIBay+b86jcBo1BzrE6V3XHuCEpDrml89Cu+itfuXwmWLcj6f2Mizr7DHWZgw1YOV2nTEezA==} + '@workflow/serde@4.1.0-beta.2': resolution: {integrity: sha512-8kkeoQKLDaKXefjV5dbhBj2aErfKp1Mc4pb6tj8144cF+Em5SPbyMbyLCHp+BVrFfFVCBluCtMx+jjvaFVZGww==} @@ -4775,6 +5149,13 @@ packages: resolution: {integrity: sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==} engines: {node: '>=8'} + asn1@0.2.6: + resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==} + + assert-plus@1.0.0: + resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==} + engines: {node: '>=0.8'} + assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} @@ -4792,9 +5173,15 @@ packages: resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} engines: {node: '>=8.0.0'} + aws4fetch@1.0.20: + resolution: {integrity: sha512-/djoAN709iY65ETD6LKCtyyEI04XIBP5xVvfmNxsEP0uJB5tyaGBztSryRr4HqMStr9R06PisQE7m9zDTXKu6g==} + axios@1.13.5: resolution: {integrity: sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q==} + axios@1.20.0: + resolution: {integrity: sha512-r8aOh8j9cGKpgQAqpzrUHnSIc6a59Y3Xf/cv8sy1DrHCkZHzQGEuoq1tARk6qSyDdtQGSDgpb9kFlruzPvrgwg==} + babel-jest@29.7.0: resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -5075,6 +5462,10 @@ packages: resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} engines: {node: '>=6'} + clone@2.1.2: + resolution: {integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==} + engines: {node: '>=0.8'} + cluster-key-slot@1.1.2: resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==} engines: {node: '>=0.10.0'} @@ -5117,6 +5508,9 @@ packages: resolution: {integrity: sha512-ezmVcLR3xAVp8kYOm4GS45ZLLgIE6SPAFoduLr6hTDajwb3KZ2F46gulK3XpcwRFb5KKGCSezCBAY4Dw4HsyXA==} engines: {node: '>=18'} + colorette@2.0.20: + resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} @@ -5169,6 +5563,9 @@ packages: resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} engines: {node: '>= 0.6'} + core-util-is@1.0.2: + resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} + cors@2.8.6: resolution: {integrity: sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==} engines: {node: '>= 0.10'} @@ -5202,6 +5599,9 @@ packages: resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==} engines: {node: '>= 12'} + dateformat@4.6.3: + resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==} + dayjs@1.11.19: resolution: {integrity: sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==} @@ -5350,6 +5750,13 @@ packages: end-of-stream@1.4.5: resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==} + engine.io-client@6.6.7: + resolution: {integrity: sha512-GyAvmPA7gnRCpDQbYACAy79Lg4ewevrmaPzySZz0OVvgyZc3gEfLLqPTYk8wVBScjOEpM9ZO4KryyFpVItjGEA==} + + engine.io-parser@5.2.3: + resolution: {integrity: sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==} + engines: {node: '>=10.0.0'} + entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} @@ -5483,6 +5890,13 @@ packages: extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} + extsprintf@1.4.1: + resolution: {integrity: sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==} + engines: {'0': node >=0.6.0} + + fast-copy@4.1.1: + resolution: {integrity: sha512-A4QTJmuiztpGtr6AMeJts9R4hbj2ZBUwtOaKrG6rw2y7t6+IaJKjz5M3XDs8BUznxDH43FVc6A0y/gWlMl4UtA==} + fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} @@ -5493,6 +5907,9 @@ packages: fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + fast-safe-stringify@2.1.1: + resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + fast-uri@3.1.0: resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} @@ -5565,6 +5982,15 @@ packages: debug: optional: true + follow-redirects@1.16.1: + resolution: {integrity: sha512-FNvFGzoMLWmE6Yj9spb/zjd7yiNCHiAW9/Tg9CXrQ8wuu32HtlJOwWO11OJafl5FfY3DxTdQ0vj42zU1kvv5jg==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + foreground-child@3.3.1: resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} engines: {node: '>=14'} @@ -5588,6 +6014,10 @@ packages: resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} engines: {node: '>= 6'} + form-data@4.0.6: + resolution: {integrity: sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==} + engines: {node: '>= 6'} + formdata-node@4.4.1: resolution: {integrity: sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==} engines: {node: '>= 12.20'} @@ -5779,10 +6209,17 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} + hasown@2.0.4: + resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==} + engines: {node: '>= 0.4'} + header-generator@2.1.80: resolution: {integrity: sha512-7gvv2Xm6Q0gNN3BzMD/D3sGvSJRcV1+k8XehPmBYTpTkBmKshwnYyi0jJJnpP3S6YP7vdOoEobeBV87aG9YTtQ==} engines: {node: '>=16.0.0'} + help-me@5.0.0: + resolution: {integrity: sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==} + hono-openapi@1.3.0: resolution: {integrity: sha512-xDvCWpWEIv0weEmnl3EjRQzqbHIO8LnfzMuYOCmbuyE5aes6aXxLg4vM3ybnoZD5TiTUkA6PuRQPJs3R7WRBig==} peerDependencies: @@ -5980,6 +6417,11 @@ packages: isomorphic-fetch@3.0.0: resolution: {integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==} + isomorphic-ws@5.0.0: + resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==} + peerDependencies: + ws: '*' + istanbul-lib-coverage@3.2.2: resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} engines: {node: '>=8'} @@ -6139,6 +6581,9 @@ packages: node-notifier: optional: true + jks-js@1.1.7: + resolution: {integrity: sha512-BeiDRKsAi1NwEwgx2JB/9/0tar5BNGIv+foGm1G5GgiyR35s/iUnfd/BWqYd16mLDD8qTaAVBrIcOOuVqXJZNQ==} + joplin-turndown-plugin-gfm@1.0.12: resolution: {integrity: sha512-qL4+1iycQjZ1fs8zk3jSRk7cg3ROBUHk7GKtiLAQLFzLPKErnILUvz5DLszSQvz3s1sTjPbywLDISVUtBY6HaA==} @@ -6148,6 +6593,10 @@ packages: jose@6.1.3: resolution: {integrity: sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ==} + joycon@3.1.1: + resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} + engines: {node: '>=10'} + js-tiktoken@1.0.20: resolution: {integrity: sha512-Xlaqhhs8VfCd6Sh7a1cFkZHQbYTLCwVJJWiHVxBYzLPxW0XsoxBy1hitmjkdIjD3Aon5BXLHFwU5O8WUx6HH+A==} @@ -6180,6 +6629,10 @@ packages: json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + json-schema-to-ts@3.1.1: + resolution: {integrity: sha512-+DWg8jCJG2TEnpy7kOm/7/AxaYoaRbjVB4LFZLySZlWn8exGs3A4OLJR966cVvU26N7X9TWxl+Jsw7dzAqKT6g==} + engines: {node: '>=16'} + json-schema-to-zod@2.8.1: resolution: {integrity: sha512-fRr1mHgZ7hboLKBUdR428gd9dIHUFGivUqOeiDcSmyXkNZCtB1uGaZLvsjZ4GaN5pwBIs+TGIOf6s+Rp5/R/zA==} hasBin: true @@ -6206,12 +6659,20 @@ packages: resolution: {integrity: sha512-Leuly0nbM4R+S5SVJk3VHfw1oxnlEK9KygdZvfUtEtTawNDyzB4qa1xWTmFt1aeoA7sXZkVTRuIixJ8bAvqVUg==} hasBin: true + jsonwebtoken@9.0.3: + resolution: {integrity: sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==} + engines: {node: '>=12', npm: '>=6'} + jwa@2.0.1: resolution: {integrity: sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==} jws@4.0.1: resolution: {integrity: sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==} + jwt-decode@4.0.0: + resolution: {integrity: sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==} + engines: {node: '>=18'} + kind-of@6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} @@ -6681,16 +7142,37 @@ packages: lodash.clonedeep@4.5.0: resolution: {integrity: sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==} + lodash.includes@4.3.0: + resolution: {integrity: sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==} + + lodash.isboolean@3.0.3: + resolution: {integrity: sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==} + lodash.isequal@4.5.0: resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} deprecated: This package is deprecated. Use require('node:util').isDeepStrictEqual instead. + lodash.isinteger@4.0.4: + resolution: {integrity: sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==} + + lodash.isnumber@3.0.3: + resolution: {integrity: sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==} + + lodash.isplainobject@4.0.6: + resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} + + lodash.isstring@4.0.1: + resolution: {integrity: sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==} + lodash.memoize@4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + lodash.once@4.1.1: + resolution: {integrity: sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==} + lodash@4.17.23: resolution: {integrity: sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==} @@ -7005,6 +7487,10 @@ packages: resolution: {integrity: sha512-BzQguy9W9NJgoVn2mRWzbFrFWWztGCcng2QI9+41frfk+Athwgx3qhqhvStz7ExeUUu7Kzw427sNzHpEZNINog==} engines: {node: '>=16.0.0'} + nanoevents@7.0.1: + resolution: {integrity: sha512-o6lpKiCxLeijK4hgsqfR6CNToPyRU3keKyyI6uwuHRvpRTbZ0wXw51WRgyldVugZqoJfkGFrjrIenYH3bfEO3Q==} + engines: {node: ^14.0.0 || ^16.0.0 || >=18.0.0} + nanoid@3.3.11: resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -7038,6 +7524,10 @@ packages: resolution: {integrity: sha512-/bRZty2mXUIFY/xU5HLvveNHlswNJej+RnxBjOMkidWfwZzgTbPG1E3K5TOxRLOR+5hX7bSofy8yf1hZevMS8A==} engines: {node: ^18 || ^20 || >= 21} + node-cache@5.1.2: + resolution: {integrity: sha512-t1QzWwnk4sjLWaQAS8CHgOJ+RAfmHpxFWmc36IWTiWHQfs0w5JDMBS1b1ZxQteo0vVVuWJvIUKHDkkeK7vIGCg==} + engines: {node: '>= 8.0.0'} + node-domexception@1.0.0: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} engines: {node: '>=10.5.0'} @@ -7056,6 +7546,10 @@ packages: resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + node-forge@1.4.0: + resolution: {integrity: sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ==} + engines: {node: '>= 6.13.0'} + node-gyp-build@4.8.4: resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} hasBin: true @@ -7066,6 +7560,9 @@ packages: node-releases@2.0.19: resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} + node-rsa@1.1.1: + resolution: {integrity: sha512-Jd4cvbJMryN21r5HgxQOpMEqv+ooke/korixNNK3mGqfGJmy0M77WDDzo/05969+OkMy3XW1UuZsSmW9KQm7Fw==} + normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -7094,6 +7591,12 @@ packages: resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} engines: {node: '>= 0.4'} + ollama-ai-provider-v2@1.5.5: + resolution: {integrity: sha512-1YwTFdPjhPNHny/DrOHO+s8oVGGIE5Jib61/KnnjPRNWQhVVimrJJdaAX3e6nNRRDXrY5zbb9cfm2+yVvgsrqw==} + engines: {node: '>=18'} + peerDependencies: + zod: ^4.0.16 + ollama-ai-provider-v2@3.3.1: resolution: {integrity: sha512-j4BBqqQnvf/uDz+aPYcgU4/MQZERw087Fn1DMGtViA/PgahBq36jHKHVoZfx8mxj+w8cxsKd3eYaDgyZPhE6YA==} engines: {node: '>=18'} @@ -7173,6 +7676,10 @@ packages: openapi-types@12.1.3: resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==} + opossum@10.0.0: + resolution: {integrity: sha512-sghtqL8Usj+et06Zui0nyn0R6FFsl7cyuoU+d7MctYU0nbS7Htzjleh+tWohFqk1Rp1srrFwbFa8Vxd0O64w6A==} + engines: {node: ^26 || ^24 || ^22} + ow@0.28.2: resolution: {integrity: sha512-dD4UpyBh/9m4X2NVjA+73/ZPBRF+uF4zIMFvvQsabMiEK8x41L3rQ8EENOi35kyyoaJwNxEeJcP6Fj1H4U409Q==} engines: {node: '>=12'} @@ -7346,6 +7853,13 @@ packages: pino-abstract-transport@2.0.0: resolution: {integrity: sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==} + pino-abstract-transport@3.0.0: + resolution: {integrity: sha512-wlfUczU+n7Hy/Ha5j9a/gZNy7We5+cXp8YL+X+PG8S0KXxw7n/JXA3c46Y0zQznIJ83URJiwy7Lh56WLokNuxg==} + + pino-pretty@13.2.0: + resolution: {integrity: sha512-jjghD1ML+Di/WxjJDz6j6Y4FT7hIXOlb8h27AyJ+ohtAXJXH4PS/xkv7si+RCCIW59HMgZsMKTDgzdr0RhuRrg==} + hasBin: true + pino-std-serializers@7.1.0: resolution: {integrity: sha512-BndPH67/JxGExRgiX1dX0w1FvZck5Wa4aal9198SrRhZjH3GxKQUKIBnYJTdj2HDN3UQAS06HlfcSbQj2OHmaw==} @@ -7438,6 +7952,13 @@ packages: proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + proxy-from-env@2.1.0: + resolution: {integrity: sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==} + engines: {node: '>=10'} + + pump@3.0.4: + resolution: {integrity: sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==} + punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -7639,6 +8160,9 @@ packages: secure-json-parse@2.7.0: resolution: {integrity: sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==} + secure-json-parse@4.1.0: + resolution: {integrity: sha512-l4KnYfEyqYJxDwlNVyRfO2E4NTHfMKAWdUuA8J0yve2Dz/E/PdBepY03RvyJpssIpRFwJoCD55wA+mEDs6ByWA==} + seedrandom@3.0.5: resolution: {integrity: sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==} @@ -7724,9 +8248,20 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} + socket.io-client@4.8.4: + resolution: {integrity: sha512-7wjKAvVXYOJsbmUgkWbnhPD4bFpkqrUR0++XOjpGFmqDqsqV1CI93VTraeExLxpjxEqrWgFoSRZu1ihjLWfkAA==} + engines: {node: '>=10.0.0'} + + socket.io-parser@4.2.7: + resolution: {integrity: sha512-IH/iSeO9T6gz1KkFleGDWkG9N3dl4jXVYUtMhIqH10Md0ttMer8nUNWiP1DKuNrybD2xBrixLJdCC9J6ECoYkg==} + engines: {node: '>=10.0.0'} + sonic-boom@4.2.1: resolution: {integrity: sha512-w6AxtubXa2wTXAUsZMMWERrsIRAdrK0Sc+FUytWvYAhBJLyuI4llrMIC1DtlNSdI99EI86KZum2MMq3EAZlF9Q==} + sonic-boom@5.0.1: + resolution: {integrity: sha512-I1E9tHuKe6SdS/Uab4bl2o1ZUBm2SCTDFF9eQ66ehyVcFIBixfecy9DlwXCtnRF8CUzPw7Q4Dn6JQE/8iVl/FQ==} + source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -7834,6 +8369,10 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} + strip-json-comments@5.0.3: + resolution: {integrity: sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==} + engines: {node: '>=14.16'} + strip-literal@3.1.0: resolution: {integrity: sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==} @@ -7935,6 +8474,9 @@ packages: trough@2.2.0: resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} + ts-algebra@2.0.0: + resolution: {integrity: sha512-FPAhNPFMrkwz76P7cdjdmiShwMynZYN6SgOujD1urY4oNm80Ou9oMdmbR45LotcKOXoy7wSmHkRFE6Mxbrhefw==} + ts-debounce@4.0.0: resolution: {integrity: sha512-+1iDGY6NmOGidq7i7xZGA4cm8DAa6fqdYcvO5Z6yBevH++Bdo9Qt/mN0TzHUgcCcKv1gmh9+W5dHqz8pMWbCbg==} @@ -7982,6 +8524,9 @@ packages: '@swc/wasm': optional: true + ts-pattern@5.9.0: + resolution: {integrity: sha512-6s5V71mX8qBUmlgbrfL33xDUwO0fq48rxAu2LBE11WBeGdpCPOsXksQbZJHvHwhrd3QjUusd3mAOM5Gg0mFBLg==} + tsc-alias@1.8.16: resolution: {integrity: sha512-QjCyu55NFyRSBAl6+MTFwplpFcnm2Pq01rR/uxfqJoLMm6X3O14KEGtaSDZpJYaE1bJBGDjD0eSuiIWPe2T58g==} engines: {node: '>=16.20.2'} @@ -8058,10 +8603,18 @@ packages: undici-types@7.16.0: resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} + undici@5.29.0: + resolution: {integrity: sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==} + engines: {node: '>=14.0'} + undici@6.23.0: resolution: {integrity: sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==} engines: {node: '>=18.17'} + undici@6.29.0: + resolution: {integrity: sha512-R+RODBqp6i2pPflGdq+xIOUkl+RNfGgHwoinecKu/JCuf2uO06cOKoDbI2P7Dn6KcswdKwrczbU6IYJ6K8X+wg==} + engines: {node: '>=18.17'} + unicorn-magic@0.3.0: resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==} engines: {node: '>=18'} @@ -8129,6 +8682,10 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} + verror@1.10.1: + resolution: {integrity: sha512-veufcmxri4e3XSrT0xwfUR7kguIkaxBeosDg00yDWhk49wdwkSUrvvsm7nc75e1PUyvIeZj6nS8VQRYz2/S4Xg==} + engines: {node: '>=0.6.0'} + vfile-message@4.0.3: resolution: {integrity: sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==} @@ -8208,6 +8765,13 @@ packages: jsdom: optional: true + voca@1.4.1: + resolution: {integrity: sha512-NJC/BzESaHT1p4B5k4JykxedeltmNbau4cummStd4RjFojgq/kLew5TzYge9N2geeWyI2w8T30wUET5v+F7ZHA==} + + vscode-jsonrpc@8.2.1: + resolution: {integrity: sha512-kdjOSJ2lLIn7r1rtrMbbNCHjyMPfRnowdKjBQ+mGq6NAW5QY2bEZC/khaC5OR8svbbjvLEaIXkOq45e2X9BIbQ==} + engines: {node: '>=14.0.0'} + walker@1.0.8: resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} @@ -8276,6 +8840,22 @@ packages: resolution: {integrity: sha512-0yweIbkINJodk27gX9LBGMzyQdBDan3s/dEAiwBOj+Mf0PPyWL6/rikalkv8EeD0E8jm4o5RXEOrFTP3NXbhJg==} engines: {node: '>=12.17'} + workers-ai-provider@3.3.1: + resolution: {integrity: sha512-vArwnmiAxQQF1clsXJd9ADn1xK9YUZVxE4umaMhrdsxM2kucxP430LfaoH4rn0AfoqtnuH3bfRhW1ak0r1x/8A==} + peerDependencies: + '@ai-sdk/anthropic': ^3.0.0 + '@ai-sdk/google': ^3.0.0 + '@ai-sdk/openai': ^3.0.0 + '@ai-sdk/provider': ^3.0.0 + ai: ^6.0.0 + peerDependenciesMeta: + '@ai-sdk/anthropic': + optional: true + '@ai-sdk/google': + optional: true + '@ai-sdk/openai': + optional: true + wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -8315,6 +8895,10 @@ packages: utf-8-validate: optional: true + xmlhttprequest-ssl@2.1.2: + resolution: {integrity: sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ==} + engines: {node: '>=0.4.0'} + xtend@4.0.2: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} @@ -8337,6 +8921,11 @@ packages: engines: {node: '>= 14.6'} hasBin: true + yaml@2.9.1: + resolution: {integrity: sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==} + engines: {node: '>= 14.6'} + hasBin: true + yargs-parser@20.2.9: resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} engines: {node: '>=10'} @@ -8398,6 +8987,9 @@ packages: zod@4.3.6: resolution: {integrity: sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==} + zod@4.6.5: + resolution: {integrity: sha512-v5l/aFXZQeai4awLbOpSoHecE9UiMrnfx75tEXLjNonXVARxQ5mOeipTjROUchszUNCqnE+hqAMujRsRHsut2Q==} + zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} @@ -8411,6 +9003,62 @@ snapshots: '@grpc/grpc-js': 1.14.3 express: 5.2.1 + '@ai-sdk/amazon-bedrock@3.0.138(zod@4.3.6)': + dependencies: + '@ai-sdk/anthropic': 2.0.108(zod@4.3.6) + '@ai-sdk/provider': 2.0.5 + '@ai-sdk/provider-utils': 3.0.41(zod@4.3.6) + '@smithy/eventstream-codec': 4.2.8 + '@smithy/util-utf8': 4.2.0 + aws4fetch: 1.0.20 + zod: 4.3.6 + + '@ai-sdk/anthropic@2.0.108(zod@4.3.6)': + dependencies: + '@ai-sdk/provider': 2.0.5 + '@ai-sdk/provider-utils': 3.0.41(zod@4.3.6) + zod: 4.3.6 + + '@ai-sdk/anthropic@3.0.127(zod@4.3.6)': + dependencies: + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + zod: 4.3.6 + + '@ai-sdk/azure@3.0.133(zod@4.3.6)': + dependencies: + '@ai-sdk/deepseek': 2.0.71(zod@4.3.6) + '@ai-sdk/openai': 3.0.124(zod@4.3.6) + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + zod: 4.3.6 + + '@ai-sdk/cerebras@2.0.87(zod@4.3.6)': + dependencies: + '@ai-sdk/openai-compatible': 2.0.81(zod@4.3.6) + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + zod: 4.3.6 + + '@ai-sdk/cohere@3.0.67(zod@4.3.6)': + dependencies: + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + zod: 4.3.6 + + '@ai-sdk/deepinfra@2.0.85(zod@4.3.6)': + dependencies: + '@ai-sdk/openai-compatible': 2.0.81(zod@4.3.6) + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + zod: 4.3.6 + + '@ai-sdk/deepseek@2.0.71(zod@4.3.6)': + dependencies: + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + zod: 4.3.6 + '@ai-sdk/gateway@3.0.53(zod@4.3.6)': dependencies: '@ai-sdk/provider': 3.0.8 @@ -8418,12 +9066,72 @@ snapshots: '@vercel/oidc': 3.1.0 zod: 4.3.6 + '@ai-sdk/google-vertex@3.0.180(zod@4.3.6)': + dependencies: + '@ai-sdk/anthropic': 2.0.108(zod@4.3.6) + '@ai-sdk/google': 2.0.101(zod@4.3.6) + '@ai-sdk/openai-compatible': 1.0.58(zod@4.3.6) + '@ai-sdk/provider': 2.0.5 + '@ai-sdk/provider-utils': 3.0.41(zod@4.3.6) + google-auth-library: 10.5.0 + zod: 4.3.6 + transitivePeerDependencies: + - supports-color + + '@ai-sdk/google@2.0.101(zod@4.3.6)': + dependencies: + '@ai-sdk/provider': 2.0.5 + '@ai-sdk/provider-utils': 3.0.41(zod@4.3.6) + zod: 4.3.6 + + '@ai-sdk/google@3.0.130(zod@4.3.6)': + dependencies: + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + zod: 4.3.6 + + '@ai-sdk/groq@3.0.72(zod@4.3.6)': + dependencies: + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + zod: 4.3.6 + + '@ai-sdk/mistral@3.0.70(zod@4.3.6)': + dependencies: + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + zod: 4.3.6 + + '@ai-sdk/openai-compatible@1.0.58(zod@4.3.6)': + dependencies: + '@ai-sdk/provider': 2.0.5 + '@ai-sdk/provider-utils': 3.0.41(zod@4.3.6) + zod: 4.3.6 + + '@ai-sdk/openai-compatible@2.0.81(zod@4.3.6)': + dependencies: + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + zod: 4.3.6 + + '@ai-sdk/openai@3.0.124(zod@4.3.6)': + dependencies: + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + zod: 4.3.6 + '@ai-sdk/openai@3.0.37(zod@4.3.6)': dependencies: '@ai-sdk/provider': 3.0.8 '@ai-sdk/provider-utils': 4.0.16(zod@4.3.6) zod: 4.3.6 + '@ai-sdk/perplexity@3.1.2(zod@4.3.6)': + dependencies: + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + zod: 4.3.6 + '@ai-sdk/provider-utils@2.2.8(zod@4.3.6)': dependencies: '@ai-sdk/provider': 1.1.3 @@ -8438,6 +9146,14 @@ snapshots: eventsource-parser: 3.0.6 zod: 4.3.6 + '@ai-sdk/provider-utils@3.0.41(zod@4.3.6)': + dependencies: + '@ai-sdk/provider': 2.0.5 + '@standard-schema/spec': 1.1.0 + eventsource-parser: 3.1.0 + undici: 5.29.0 + zod: 4.3.6 + '@ai-sdk/provider-utils@4.0.15(zod@4.3.6)': dependencies: '@ai-sdk/provider': 3.0.8 @@ -8459,6 +9175,14 @@ snapshots: eventsource-parser: 3.1.0 zod: 4.3.6 + '@ai-sdk/provider-utils@4.0.57(zod@4.3.6)': + dependencies: + '@ai-sdk/provider': 3.0.18 + '@standard-schema/spec': 1.1.0 + eventsource-parser: 3.1.0 + undici: 6.29.0 + zod: 4.3.6 + '@ai-sdk/provider@1.1.3': dependencies: json-schema: 0.4.0 @@ -8467,14 +9191,29 @@ snapshots: dependencies: json-schema: 0.4.0 + '@ai-sdk/provider@2.0.5': + dependencies: + json-schema: 0.4.0 + '@ai-sdk/provider@3.0.10': dependencies: json-schema: 0.4.0 + '@ai-sdk/provider@3.0.18': + dependencies: + json-schema: 0.4.0 + '@ai-sdk/provider@3.0.8': dependencies: json-schema: 0.4.0 + '@ai-sdk/togetherai@2.0.87(zod@4.3.6)': + dependencies: + '@ai-sdk/openai-compatible': 2.0.81(zod@4.3.6) + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + zod: 4.3.6 + '@ai-sdk/ui-utils@1.2.11(zod@4.3.6)': dependencies: '@ai-sdk/provider': 1.1.3 @@ -8482,12 +9221,35 @@ snapshots: zod: 4.3.6 zod-to-json-schema: 3.25.1(zod@4.3.6) + '@ai-sdk/vercel@2.0.83(zod@4.3.6)': + dependencies: + '@ai-sdk/openai-compatible': 2.0.81(zod@4.3.6) + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + zod: 4.3.6 + + '@ai-sdk/xai@3.0.139(zod@4.3.6)': + dependencies: + '@ai-sdk/openai-compatible': 2.0.81(zod@4.3.6) + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + zod: 4.3.6 + '@ai-zen/node-fetch-event-source@2.1.4': dependencies: cross-fetch: 4.1.0 transitivePeerDependencies: - encoding + '@aihubmix/ai-sdk-provider@1.0.3(zod@4.3.6)': + dependencies: + '@ai-sdk/anthropic': 3.0.127(zod@4.3.6) + '@ai-sdk/google': 3.0.130(zod@4.3.6) + '@ai-sdk/openai': 3.0.37(zod@4.3.6) + '@ai-sdk/provider': 3.0.10 + '@ai-sdk/provider-utils': 4.0.27(zod@4.3.6) + zod: 4.3.6 + '@ampproject/remapping@2.3.0': dependencies: '@jridgewell/gen-mapping': 0.3.8 @@ -8505,6 +9267,12 @@ snapshots: transitivePeerDependencies: - encoding + '@anthropic-ai/sdk@0.71.2(zod@3.25.76)': + dependencies: + json-schema-to-ts: 3.1.1 + optionalDependencies: + zod: 3.25.76 + '@anthropic-ai/sdk@0.9.1': dependencies: '@types/node': 18.19.100 @@ -8519,6 +9287,10 @@ snapshots: transitivePeerDependencies: - encoding + '@anycable/core@0.9.2': + dependencies: + nanoevents: 7.0.1 + '@aws-crypto/crc32@5.2.0': dependencies: '@aws-crypto/util': 5.2.0 @@ -9467,10 +10239,32 @@ snapshots: '@esbuild/win32-x64@0.27.2': optional: true + '@fastify/busboy@2.1.1': {} + '@finom/zod-to-json-schema@3.24.11(zod@4.3.6)': dependencies: zod: 4.3.6 + '@gitlab/gitlab-ai-provider@3.6.1(@ai-sdk/provider-utils@4.0.27(zod@4.3.6))(@ai-sdk/provider@3.0.18)(graphql@16.12.0)(ws@8.21.0)': + dependencies: + '@ai-sdk/provider': 3.0.18 + '@ai-sdk/provider-utils': 4.0.27(zod@4.3.6) + '@anthropic-ai/sdk': 0.71.2(zod@3.25.76) + '@anycable/core': 0.9.2 + graphql-request: 6.1.0(graphql@16.12.0) + isomorphic-ws: 5.0.0(ws@8.21.0) + openai: 6.22.0(ws@8.21.0)(zod@3.25.76) + socket.io-client: 4.8.4 + vscode-jsonrpc: 8.2.1 + zod: 3.25.76 + transitivePeerDependencies: + - bufferutil + - encoding + - graphql + - supports-color + - utf-8-validate + - ws + '@google-cloud/opentelemetry-cloud-monitoring-exporter@0.21.0(@opentelemetry/api@1.9.0)(@opentelemetry/core@2.7.1(@opentelemetry/api@1.9.0))(@opentelemetry/resources@2.7.1(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-metrics@2.7.1(@opentelemetry/api@1.9.0))': dependencies: '@google-cloud/opentelemetry-resource-util': 3.0.0(@opentelemetry/core@2.7.1(@opentelemetry/api@1.9.0))(@opentelemetry/resources@2.7.1(@opentelemetry/api@1.9.0)) @@ -10338,10 +11132,46 @@ snapshots: transitivePeerDependencies: - supports-color + '@modelcontextprotocol/sdk@1.32.0(@cfworker/json-schema@4.1.1)(zod@4.3.6)': + dependencies: + '@hono/node-server': 1.19.9(hono@4.12.23) + ajv: 8.20.0 + ajv-formats: 3.0.1(ajv@8.20.0) + content-type: 1.0.5 + cors: 2.8.6 + cross-spawn: 7.0.6 + eventsource: 3.0.7 + eventsource-parser: 3.1.0 + express: 5.2.1 + express-rate-limit: 8.2.1(express@5.2.1) + hono: 4.12.23 + jose: 6.1.3 + json-schema-typed: 8.0.2 + pkce-challenge: 5.0.1 + raw-body: 3.0.2 + zod: 4.3.6 + zod-to-json-schema: 3.25.1(zod@4.3.6) + optionalDependencies: + '@cfworker/json-schema': 4.1.1 + transitivePeerDependencies: + - supports-color + '@mongodb-js/saslprep@1.4.5': dependencies: sparse-bitfield: 3.0.3 + '@mymediset/sap-ai-provider@2.1.0(ai@6.0.97(zod@4.3.6))': + dependencies: + '@ai-sdk/provider': 3.0.10 + '@ai-sdk/provider-utils': 4.0.27(zod@4.3.6) + '@sap-ai-sdk/orchestration': 2.16.0 + ai: 6.0.97(zod@4.3.6) + zod: 4.3.6 + zod-to-json-schema: 3.25.1(zod@4.3.6) + transitivePeerDependencies: + - debug + - supports-color + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -10425,6 +11255,14 @@ snapshots: dependencies: '@opentelemetry/api': 1.9.0 + '@opentelemetry/api-logs@0.203.0': + dependencies: + '@opentelemetry/api': 1.9.1 + + '@opentelemetry/api-logs@0.204.0': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/api-logs@0.205.0': dependencies: '@opentelemetry/api': 1.9.0 @@ -10476,11 +11314,21 @@ snapshots: '@opentelemetry/api': 1.9.0 '@opentelemetry/semantic-conventions': 1.34.0 + '@opentelemetry/core@2.0.1(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/semantic-conventions': 1.34.0 + '@opentelemetry/core@2.1.0(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 '@opentelemetry/semantic-conventions': 1.34.0 + '@opentelemetry/core@2.1.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/semantic-conventions': 1.41.1 + '@opentelemetry/core@2.7.1(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 @@ -10502,6 +11350,15 @@ snapshots: '@opentelemetry/sdk-logs': 0.218.0(@opentelemetry/api@1.9.1) optional: true + '@opentelemetry/exporter-logs-otlp-http@0.204.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/api-logs': 0.204.0 + '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/otlp-exporter-base': 0.204.0(@opentelemetry/api@1.9.1) + '@opentelemetry/otlp-transformer': 0.204.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-logs': 0.204.0(@opentelemetry/api@1.9.1) + '@opentelemetry/exporter-logs-otlp-http@0.218.0(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 @@ -10574,6 +11431,15 @@ snapshots: '@opentelemetry/resources': 2.0.1(@opentelemetry/api@1.9.0) '@opentelemetry/sdk-trace-base': 2.0.1(@opentelemetry/api@1.9.0) + '@opentelemetry/exporter-trace-otlp-http@0.203.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.0.1(@opentelemetry/api@1.9.1) + '@opentelemetry/otlp-exporter-base': 0.203.0(@opentelemetry/api@1.9.1) + '@opentelemetry/otlp-transformer': 0.203.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.0.1(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-base': 2.0.1(@opentelemetry/api@1.9.1) + '@opentelemetry/exporter-trace-otlp-http@0.218.0(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 @@ -10640,6 +11506,15 @@ snapshots: '@opentelemetry/semantic-conventions': 1.41.1 optional: true + '@opentelemetry/instrumentation-pino@0.50.1(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/api-logs': 0.203.0 + '@opentelemetry/core': 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/instrumentation': 0.203.0(@opentelemetry/api@1.9.1) + transitivePeerDependencies: + - supports-color + '@opentelemetry/instrumentation@0.202.0(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 @@ -10649,6 +11524,24 @@ snapshots: transitivePeerDependencies: - supports-color + '@opentelemetry/instrumentation@0.203.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/api-logs': 0.203.0 + import-in-the-middle: 1.14.2 + require-in-the-middle: 7.5.2 + transitivePeerDependencies: + - supports-color + + '@opentelemetry/instrumentation@0.204.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/api-logs': 0.204.0 + import-in-the-middle: 1.14.2 + require-in-the-middle: 7.5.2 + transitivePeerDependencies: + - supports-color + '@opentelemetry/instrumentation@0.46.0(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 @@ -10696,6 +11589,18 @@ snapshots: '@opentelemetry/core': 2.0.1(@opentelemetry/api@1.9.0) '@opentelemetry/otlp-transformer': 0.202.0(@opentelemetry/api@1.9.0) + '@opentelemetry/otlp-exporter-base@0.203.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.0.1(@opentelemetry/api@1.9.1) + '@opentelemetry/otlp-transformer': 0.203.0(@opentelemetry/api@1.9.1) + + '@opentelemetry/otlp-exporter-base@0.204.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/otlp-transformer': 0.204.0(@opentelemetry/api@1.9.1) + '@opentelemetry/otlp-exporter-base@0.205.0(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 @@ -10772,6 +11677,28 @@ snapshots: '@opentelemetry/sdk-trace-base': 2.0.1(@opentelemetry/api@1.9.0) protobufjs: 7.5.4 + '@opentelemetry/otlp-transformer@0.203.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/api-logs': 0.203.0 + '@opentelemetry/core': 2.0.1(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.0.1(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-logs': 0.203.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-metrics': 2.0.1(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-base': 2.0.1(@opentelemetry/api@1.9.1) + protobufjs: 7.5.4 + + '@opentelemetry/otlp-transformer@0.204.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/api-logs': 0.204.0 + '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-logs': 0.204.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-metrics': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-base': 2.1.0(@opentelemetry/api@1.9.1) + protobufjs: 7.5.4 + '@opentelemetry/otlp-transformer@0.205.0(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 @@ -10863,12 +11790,24 @@ snapshots: '@opentelemetry/core': 2.0.1(@opentelemetry/api@1.9.0) '@opentelemetry/semantic-conventions': 1.34.0 + '@opentelemetry/resources@2.0.1(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.0.1(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': 1.34.0 + '@opentelemetry/resources@2.1.0(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.0) '@opentelemetry/semantic-conventions': 1.34.0 + '@opentelemetry/resources@2.1.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': 1.41.1 + '@opentelemetry/resources@2.7.1(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 @@ -10895,6 +11834,20 @@ snapshots: '@opentelemetry/core': 2.0.1(@opentelemetry/api@1.9.0) '@opentelemetry/resources': 2.0.1(@opentelemetry/api@1.9.0) + '@opentelemetry/sdk-logs@0.203.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/api-logs': 0.203.0 + '@opentelemetry/core': 2.0.1(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.0.1(@opentelemetry/api@1.9.1) + + '@opentelemetry/sdk-logs@0.204.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/api-logs': 0.204.0 + '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-logs@0.205.0(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 @@ -10951,12 +11904,24 @@ snapshots: '@opentelemetry/core': 2.0.1(@opentelemetry/api@1.9.0) '@opentelemetry/resources': 2.0.1(@opentelemetry/api@1.9.0) + '@opentelemetry/sdk-metrics@2.0.1(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.0.1(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.0.1(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-metrics@2.1.0(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.0) '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.0) + '@opentelemetry/sdk-metrics@2.1.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-metrics@2.7.1(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 @@ -10991,6 +11956,13 @@ snapshots: '@opentelemetry/resources': 2.0.1(@opentelemetry/api@1.9.0) '@opentelemetry/semantic-conventions': 1.34.0 + '@opentelemetry/sdk-trace-base@2.0.1(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.0.1(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.0.1(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': 1.34.0 + '@opentelemetry/sdk-trace-base@2.1.0(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 @@ -10998,6 +11970,13 @@ snapshots: '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.0) '@opentelemetry/semantic-conventions': 1.34.0 + '@opentelemetry/sdk-trace-base@2.1.0(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api': 1.9.1 + '@opentelemetry/core': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.1.0(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': 1.41.1 + '@opentelemetry/sdk-trace-base@2.7.1(@opentelemetry/api@1.9.0)': dependencies: '@opentelemetry/api': 1.9.0 @@ -11225,6 +12204,116 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.56.0': optional: true + '@sap-ai-sdk/ai-api@2.16.0': + dependencies: + '@sap-ai-sdk/core': 2.16.0 + '@sap-cloud-sdk/connectivity': 4.9.1 + '@sap-cloud-sdk/util': 4.9.1 + transitivePeerDependencies: + - debug + - supports-color + + '@sap-ai-sdk/core@2.16.0': + dependencies: + '@sap-cloud-sdk/connectivity': 4.9.1 + '@sap-cloud-sdk/http-client': 4.9.1 + '@sap-cloud-sdk/openapi': 4.9.1 + '@sap-cloud-sdk/util': 4.9.1 + transitivePeerDependencies: + - debug + - supports-color + + '@sap-ai-sdk/orchestration@2.16.0': + dependencies: + '@sap-ai-sdk/ai-api': 2.16.0 + '@sap-ai-sdk/core': 2.16.0 + '@sap-ai-sdk/prompt-registry': 2.16.0 + '@sap-cloud-sdk/util': 4.9.1 + yaml: 2.9.1 + transitivePeerDependencies: + - debug + - supports-color + + '@sap-ai-sdk/prompt-registry@2.16.0': + dependencies: + '@sap-ai-sdk/core': 2.16.0 + zod: 4.6.5 + transitivePeerDependencies: + - debug + - supports-color + + '@sap-cloud-sdk/connectivity@4.9.1': + dependencies: + '@sap-cloud-sdk/resilience': 4.9.1 + '@sap-cloud-sdk/util': 4.9.1 + '@sap/xsenv': 6.2.2 + '@sap/xssec': 4.15.0 + async-retry: 1.3.3 + axios: 1.20.0 + jks-js: 1.1.7 + jsonwebtoken: 9.0.3 + safe-stable-stringify: 2.5.0 + transitivePeerDependencies: + - debug + - supports-color + + '@sap-cloud-sdk/http-client@4.9.1': + dependencies: + '@sap-cloud-sdk/connectivity': 4.9.1 + '@sap-cloud-sdk/resilience': 4.9.1 + '@sap-cloud-sdk/util': 4.9.1 + axios: 1.20.0 + transitivePeerDependencies: + - debug + - supports-color + + '@sap-cloud-sdk/openapi@4.9.1': + dependencies: + '@sap-cloud-sdk/connectivity': 4.9.1 + '@sap-cloud-sdk/http-client': 4.9.1 + '@sap-cloud-sdk/resilience': 4.9.1 + '@sap-cloud-sdk/util': 4.9.1 + axios: 1.20.0 + transitivePeerDependencies: + - debug + - supports-color + + '@sap-cloud-sdk/resilience@4.9.1': + dependencies: + '@sap-cloud-sdk/util': 4.9.1 + async-retry: 1.3.3 + axios: 1.20.0 + opossum: 10.0.0 + transitivePeerDependencies: + - debug + - supports-color + + '@sap-cloud-sdk/util@4.9.1': + dependencies: + axios: 1.20.0 + logform: 2.7.0 + voca: 1.4.1 + winston: 3.19.0 + winston-transport: 4.9.0 + transitivePeerDependencies: + - debug + - supports-color + + '@sap/xsenv@6.2.2': + dependencies: + debug: 4.4.3 + node-cache: 5.1.2 + verror: 1.10.1 + transitivePeerDependencies: + - supports-color + + '@sap/xssec@4.15.0': + dependencies: + debug: 4.4.3 + jwt-decode: 4.0.0 + transitivePeerDependencies: + - supports-color + '@sec-ant/readable-stream@0.4.1': {} '@selderee/plugin-htmlparser2@0.11.0': @@ -11570,6 +12659,8 @@ snapshots: color: 5.0.3 text-hex: 1.0.0 + '@socket.io/component-emitter@3.1.2': {} + '@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6)': dependencies: '@standard-schema/spec': 1.1.0 @@ -11844,6 +12935,85 @@ snapshots: loupe: 3.2.1 tinyrainbow: 2.0.0 + '@voltagent/core@2.11.0(@ai-sdk/provider-utils@4.0.27(zod@4.3.6))(@ai-sdk/provider@3.0.18)(@cfworker/json-schema@4.1.1)(@voltagent/logger@2.0.2(@opentelemetry/api@1.9.1))(ai@6.0.97(zod@4.3.6))(graphql@16.12.0)(ws@8.21.0)(zod@4.3.6)': + dependencies: + '@ai-sdk/amazon-bedrock': 3.0.138(zod@4.3.6) + '@ai-sdk/anthropic': 3.0.127(zod@4.3.6) + '@ai-sdk/azure': 3.0.133(zod@4.3.6) + '@ai-sdk/cerebras': 2.0.87(zod@4.3.6) + '@ai-sdk/cohere': 3.0.67(zod@4.3.6) + '@ai-sdk/deepinfra': 2.0.85(zod@4.3.6) + '@ai-sdk/gateway': 3.0.53(zod@4.3.6) + '@ai-sdk/google': 3.0.130(zod@4.3.6) + '@ai-sdk/google-vertex': 3.0.180(zod@4.3.6) + '@ai-sdk/groq': 3.0.72(zod@4.3.6) + '@ai-sdk/mistral': 3.0.70(zod@4.3.6) + '@ai-sdk/openai': 3.0.37(zod@4.3.6) + '@ai-sdk/openai-compatible': 2.0.81(zod@4.3.6) + '@ai-sdk/perplexity': 3.1.2(zod@4.3.6) + '@ai-sdk/provider-utils': 4.0.27(zod@4.3.6) + '@ai-sdk/togetherai': 2.0.87(zod@4.3.6) + '@ai-sdk/vercel': 2.0.83(zod@4.3.6) + '@ai-sdk/xai': 3.0.139(zod@4.3.6) + '@aihubmix/ai-sdk-provider': 1.0.3(zod@4.3.6) + '@gitlab/gitlab-ai-provider': 3.6.1(@ai-sdk/provider-utils@4.0.27(zod@4.3.6))(@ai-sdk/provider@3.0.18)(graphql@16.12.0)(ws@8.21.0) + '@modelcontextprotocol/sdk': 1.32.0(@cfworker/json-schema@4.1.1)(zod@4.3.6) + '@mymediset/sap-ai-provider': 2.1.0(ai@6.0.97(zod@4.3.6)) + '@opentelemetry/api': 1.9.1 + '@opentelemetry/api-logs': 0.204.0 + '@opentelemetry/context-async-hooks': 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/core': 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/exporter-logs-otlp-http': 0.204.0(@opentelemetry/api@1.9.1) + '@opentelemetry/exporter-trace-otlp-http': 0.203.0(@opentelemetry/api@1.9.1) + '@opentelemetry/otlp-transformer': 0.204.0(@opentelemetry/api@1.9.1) + '@opentelemetry/resources': 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-logs': 0.204.0(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-base': 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-trace-node': 2.7.1(@opentelemetry/api@1.9.1) + '@opentelemetry/semantic-conventions': 1.41.1 + '@voltagent/internal': 1.0.3 + ai: 6.0.97(zod@4.3.6) + fast-glob: 3.3.3 + gray-matter: 4.0.3 + micromatch: 4.0.8 + ollama-ai-provider-v2: 1.5.5(zod@4.3.6) + ts-pattern: 5.9.0 + type-fest: 4.41.0 + uuid: 9.0.1 + workers-ai-provider: 3.3.1(@ai-sdk/anthropic@3.0.127(zod@4.3.6))(@ai-sdk/google@3.0.130(zod@4.3.6))(@ai-sdk/openai@3.0.37(zod@4.3.6))(@ai-sdk/provider@3.0.18)(ai@6.0.97(zod@4.3.6)) + zod: 4.3.6 + zod-from-json-schema: 0.5.2 + zod-from-json-schema-v3: zod-from-json-schema@0.0.5 + optionalDependencies: + '@voltagent/logger': 2.0.2(@opentelemetry/api@1.9.1) + transitivePeerDependencies: + - '@ai-sdk/provider' + - '@cfworker/json-schema' + - bufferutil + - debug + - encoding + - graphql + - supports-color + - utf-8-validate + - ws + + '@voltagent/internal@1.0.3': + dependencies: + type-fest: 4.41.0 + + '@voltagent/logger@2.0.2(@opentelemetry/api@1.9.1)': + dependencies: + '@opentelemetry/api-logs': 0.204.0 + '@opentelemetry/instrumentation': 0.204.0(@opentelemetry/api@1.9.1) + '@opentelemetry/instrumentation-pino': 0.50.1(@opentelemetry/api@1.9.1) + '@opentelemetry/sdk-logs': 0.204.0(@opentelemetry/api@1.9.1) + '@voltagent/internal': 1.0.3 + pino: 9.14.0 + pino-pretty: 13.2.0 + transitivePeerDependencies: + - '@opentelemetry/api' + - supports-color + '@workflow/serde@4.1.0-beta.2': {} '@zilliz/milvus2-sdk-node@2.6.9': @@ -11978,6 +13148,12 @@ snapshots: arrify@2.0.1: {} + asn1@0.2.6: + dependencies: + safer-buffer: 2.1.2 + + assert-plus@1.0.0: {} + assertion-error@2.0.1: {} async-retry@1.3.3: @@ -11990,6 +13166,8 @@ snapshots: atomic-sleep@1.0.0: {} + aws4fetch@1.0.20: {} + axios@1.13.5: dependencies: follow-redirects: 1.15.11 @@ -11998,6 +13176,16 @@ snapshots: transitivePeerDependencies: - debug + axios@1.20.0: + dependencies: + follow-redirects: 1.16.1 + form-data: 4.0.6 + https-proxy-agent: 5.0.1 + proxy-from-env: 2.1.0 + transitivePeerDependencies: + - debug + - supports-color + babel-jest@29.7.0(@babel/core@7.27.1): dependencies: '@babel/core': 7.27.1 @@ -12292,6 +13480,8 @@ snapshots: kind-of: 6.0.3 shallow-clone: 3.0.1 + clone@2.1.2: {} + cluster-key-slot@1.1.2: {} co@4.6.0: {} @@ -12338,6 +13528,8 @@ snapshots: color-convert: 3.1.3 color-string: 2.1.4 + colorette@2.0.20: {} + combined-stream@1.0.8: dependencies: delayed-stream: 1.0.0 @@ -12383,6 +13575,8 @@ snapshots: cookie@0.7.2: {} + core-util-is@1.0.2: {} + cors@2.8.6: dependencies: object-assign: 4.1.1 @@ -12459,6 +13653,8 @@ snapshots: data-uri-to-buffer@4.0.1: {} + dateformat@4.6.3: {} + dayjs@1.11.19: {} debug@4.4.1: @@ -12576,6 +13772,20 @@ snapshots: dependencies: once: 1.4.0 + engine.io-client@6.6.7: + dependencies: + '@socket.io/component-emitter': 3.1.2 + debug: 4.4.3 + engine.io-parser: 5.2.3 + ws: 8.21.0 + xmlhttprequest-ssl: 2.1.2 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + engine.io-parser@5.2.3: {} + entities@4.5.0: {} error-ex@1.3.2: @@ -12751,6 +13961,10 @@ snapshots: extend@3.0.2: {} + extsprintf@1.4.1: {} + + fast-copy@4.1.1: {} + fast-deep-equal@3.1.3: {} fast-glob@3.3.3: @@ -12763,6 +13977,8 @@ snapshots: fast-json-stable-stringify@2.1.0: {} + fast-safe-stringify@2.1.1: {} + fast-uri@3.1.0: {} fast-xml-parser@5.2.5: @@ -12828,6 +14044,8 @@ snapshots: follow-redirects@1.15.11: {} + follow-redirects@1.16.1: {} + foreground-child@3.3.1: dependencies: cross-spawn: 7.0.6 @@ -12861,6 +14079,14 @@ snapshots: hasown: 2.0.2 mime-types: 2.1.35 + form-data@4.0.6: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + es-set-tostringtag: 2.1.0 + hasown: 2.0.4 + mime-types: 2.1.35 + formdata-node@4.4.1: dependencies: node-domexception: 1.0.0 @@ -13122,6 +14348,10 @@ snapshots: dependencies: function-bind: 1.1.2 + hasown@2.0.4: + dependencies: + function-bind: 1.1.2 + header-generator@2.1.80: dependencies: browserslist: 4.24.5 @@ -13129,6 +14359,8 @@ snapshots: ow: 0.28.2 tslib: 2.8.1 + help-me@5.0.0: {} + hono-openapi@1.3.0(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.3.6))(@types/json-schema@7.0.15)(hono@4.12.23)(openapi-types@12.1.3): dependencies: '@standard-community/standard-json': 0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6) @@ -13307,6 +14539,10 @@ snapshots: transitivePeerDependencies: - encoding + isomorphic-ws@5.0.0(ws@8.21.0): + dependencies: + ws: 8.21.0 + istanbul-lib-coverage@3.2.2: {} istanbul-lib-instrument@5.2.1: @@ -13789,12 +15025,20 @@ snapshots: - supports-color - ts-node + jks-js@1.1.7: + dependencies: + node-forge: 1.4.0 + node-int64: 0.4.0 + node-rsa: 1.1.1 + joplin-turndown-plugin-gfm@1.0.12: {} jose@5.10.0: {} jose@6.1.3: {} + joycon@3.1.1: {} + js-tiktoken@1.0.20: dependencies: base64-js: 1.5.1 @@ -13822,6 +15066,11 @@ snapshots: json-parse-even-better-errors@2.3.1: {} + json-schema-to-ts@3.1.1: + dependencies: + '@babel/runtime': 7.28.6 + ts-algebra: 2.0.0 + json-schema-to-zod@2.8.1: {} json-schema-traverse@1.0.0: {} @@ -13836,6 +15085,19 @@ snapshots: jsonrepair@3.13.2: {} + jsonwebtoken@9.0.3: + dependencies: + jws: 4.0.1 + lodash.includes: 4.3.0 + lodash.isboolean: 3.0.3 + lodash.isinteger: 4.0.4 + lodash.isnumber: 3.0.3 + lodash.isplainobject: 4.0.6 + lodash.isstring: 4.0.1 + lodash.once: 4.1.1 + ms: 2.1.3 + semver: 7.7.3 + jwa@2.0.1: dependencies: buffer-equal-constant-time: 1.0.1 @@ -13847,6 +15109,8 @@ snapshots: jwa: 2.0.1 safe-buffer: 5.2.1 + jwt-decode@4.0.0: {} + kind-of@6.0.3: {} kleur@3.0.3: {} @@ -14120,12 +15384,26 @@ snapshots: lodash.clonedeep@4.5.0: {} + lodash.includes@4.3.0: {} + + lodash.isboolean@3.0.3: {} + lodash.isequal@4.5.0: {} + lodash.isinteger@4.0.4: {} + + lodash.isnumber@3.0.3: {} + + lodash.isplainobject@4.0.6: {} + + lodash.isstring@4.0.1: {} + lodash.memoize@4.1.2: {} lodash.merge@4.6.2: {} + lodash.once@4.1.1: {} + lodash@4.17.23: {} logform@2.7.0: @@ -14579,6 +15857,8 @@ snapshots: mylas@2.1.14: {} + nanoevents@7.0.1: {} + nanoid@3.3.11: {} natural-compare@1.4.0: {} @@ -14609,6 +15889,10 @@ snapshots: node-addon-api@8.5.0: {} + node-cache@5.1.2: + dependencies: + clone: 2.1.2 + node-domexception@1.0.0: {} node-fetch@2.7.0: @@ -14621,12 +15905,18 @@ snapshots: fetch-blob: 3.2.0 formdata-polyfill: 4.0.10 + node-forge@1.4.0: {} + node-gyp-build@4.8.4: {} node-int64@0.4.0: {} node-releases@2.0.19: {} + node-rsa@1.1.1: + dependencies: + asn1: 0.2.6 + normalize-path@3.0.0: {} npm-run-path@4.0.1: @@ -14646,6 +15936,12 @@ snapshots: object-inspect@1.13.4: {} + ollama-ai-provider-v2@1.5.5(zod@4.3.6): + dependencies: + '@ai-sdk/provider': 2.0.3 + '@ai-sdk/provider-utils': 3.0.25(zod@4.3.6) + zod: 4.3.6 + ollama-ai-provider-v2@3.3.1(ai@6.0.97(zod@4.3.6))(zod@4.3.6): dependencies: '@ai-sdk/provider': 3.0.8 @@ -14745,6 +16041,11 @@ snapshots: ws: 8.19.0 zod: 4.3.6 + openai@6.22.0(ws@8.21.0)(zod@3.25.76): + optionalDependencies: + ws: 8.21.0 + zod: 3.25.76 + openai@6.22.0(ws@8.21.0)(zod@4.3.6): optionalDependencies: ws: 8.21.0 @@ -14752,6 +16053,8 @@ snapshots: openapi-types@12.1.3: {} + opossum@10.0.0: {} + ow@0.28.2: dependencies: '@sindresorhus/is': 4.6.0 @@ -14902,6 +16205,26 @@ snapshots: dependencies: split2: 4.2.0 + pino-abstract-transport@3.0.0: + dependencies: + split2: 4.2.0 + + pino-pretty@13.2.0: + dependencies: + colorette: 2.0.20 + dateformat: 4.6.3 + fast-copy: 4.1.1 + fast-safe-stringify: 2.1.1 + help-me: 5.0.0 + joycon: 3.1.1 + minimist: 1.2.8 + on-exit-leak-free: 2.1.2 + pino-abstract-transport: 3.0.0 + pump: 3.0.4 + secure-json-parse: 4.1.0 + sonic-boom: 5.0.1 + strip-json-comments: 5.0.3 + pino-std-serializers@7.1.0: {} pino@9.14.0: @@ -15022,6 +16345,13 @@ snapshots: proxy-from-env@1.1.0: {} + proxy-from-env@2.1.0: {} + + pump@3.0.4: + dependencies: + end-of-stream: 1.4.5 + once: 1.4.0 + punycode@2.3.1: {} pure-rand@6.1.0: {} @@ -15263,6 +16593,8 @@ snapshots: secure-json-parse@2.7.0: {} + secure-json-parse@4.1.0: {} + seedrandom@3.0.5: {} selderee@0.11.0: @@ -15356,10 +16688,32 @@ snapshots: slash@3.0.0: {} + socket.io-client@4.8.4: + dependencies: + '@socket.io/component-emitter': 3.1.2 + debug: 4.4.3 + engine.io-client: 6.6.7 + socket.io-parser: 4.2.7 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + + socket.io-parser@4.2.7: + dependencies: + '@socket.io/component-emitter': 3.1.2 + debug: 4.4.3 + transitivePeerDependencies: + - supports-color + sonic-boom@4.2.1: dependencies: atomic-sleep: 1.0.0 + sonic-boom@5.0.1: + dependencies: + atomic-sleep: 1.0.0 + source-map-js@1.2.1: {} source-map-support@0.5.13: @@ -15455,6 +16809,8 @@ snapshots: strip-json-comments@3.1.1: {} + strip-json-comments@5.0.3: {} + strip-literal@3.1.0: dependencies: js-tokens: 9.0.1 @@ -15557,6 +16913,8 @@ snapshots: trough@2.2.0: {} + ts-algebra@2.0.0: {} + ts-debounce@4.0.0: {} ts-error@1.0.6: {} @@ -15639,6 +16997,8 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + ts-pattern@5.9.0: {} + tsc-alias@1.8.16: dependencies: chokidar: 3.6.0 @@ -15699,8 +17059,14 @@ snapshots: undici-types@7.16.0: {} + undici@5.29.0: + dependencies: + '@fastify/busboy': 2.1.1 + undici@6.23.0: {} + undici@6.29.0: {} + unicorn-magic@0.3.0: {} unified@11.0.5: @@ -15764,6 +17130,12 @@ snapshots: vary@1.1.2: {} + verror@1.10.1: + dependencies: + assert-plus: 1.0.0 + core-util-is: 1.0.2 + extsprintf: 1.4.1 + vfile-message@4.0.3: dependencies: '@types/unist': 3.0.3 @@ -15851,6 +17223,10 @@ snapshots: - tsx - yaml + voca@1.4.1: {} + + vscode-jsonrpc@8.2.1: {} + walker@1.0.8: dependencies: makeerror: 1.0.12 @@ -15934,6 +17310,15 @@ snapshots: wordwrapjs@5.1.1: {} + workers-ai-provider@3.3.1(@ai-sdk/anthropic@3.0.127(zod@4.3.6))(@ai-sdk/google@3.0.130(zod@4.3.6))(@ai-sdk/openai@3.0.37(zod@4.3.6))(@ai-sdk/provider@3.0.18)(ai@6.0.97(zod@4.3.6)): + dependencies: + '@ai-sdk/provider': 3.0.18 + ai: 6.0.97(zod@4.3.6) + optionalDependencies: + '@ai-sdk/anthropic': 3.0.127(zod@4.3.6) + '@ai-sdk/google': 3.0.130(zod@4.3.6) + '@ai-sdk/openai': 3.0.37(zod@4.3.6) + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 @@ -15957,6 +17342,8 @@ snapshots: ws@8.21.0: {} + xmlhttprequest-ssl@2.1.2: {} + xtend@4.0.2: {} xxhash-wasm@1.1.0: {} @@ -15969,6 +17356,8 @@ snapshots: yaml@2.8.0: {} + yaml@2.9.1: {} + yargs-parser@20.2.9: {} yargs-parser@21.1.1: {} @@ -16029,4 +17418,6 @@ snapshots: zod@4.3.6: {} + zod@4.6.5: {} + zwitch@2.0.4: {} From 6dcea0718a41669519f5dd381bdf580a8d0dc6f8 Mon Sep 17 00:00:00 2001 From: Nikhil Pareek Date: Sun, 4 Oct 2026 22:28:21 -0700 Subject: [PATCH 02/18] fix(voltagent): keep collector cost-part keys off non-model spans fi-collector promotes cost into its hot cost column on any span from gen_ai.cost.total / llm.cost.total, or, when no total is set, from input + output: gen_ai.cost.input / llm.cost.prompt plus gen_ai.cost.output / llm.cost.completion (fi-collector ca5aeda8e pkg/adapter/adapter.go DeriveHotKeys, costInputKeys / costOutputKeys). isPromotedUsageKey only knew the two total keys, so a cost part on an agent, tool or memory span would have been exported on its promoted key and summed into the trace by Observe. Add the four cost-part keys to the promoted set: on non-model spans they move under voltagent.*, on llm spans they stay. VoltAgent 2.11.0 itself writes none of them (it sets usage.cost from OpenRouter metadata only), so this closes a latent path rather than a live one. Unit test added first (failed on isPromotedUsageKey("gen_ai.cost.input") === false); the contract test's promoted-key list and the README Tokens section now name the same keys. approved: Nikhil 2026-10-03 blanket Refs: TH-8239 --- .../packages/traceai_voltagent/README.md | 7 ++++-- .../contract/test_harness_contract.py | 3 ++- .../src/__tests__/mapping.test.ts | 22 +++++++++++++++++++ .../packages/traceai_voltagent/src/mapping.ts | 6 +++++ 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/typescript/packages/traceai_voltagent/README.md b/typescript/packages/traceai_voltagent/README.md index abfccf8d6..3f29234d3 100644 --- a/typescript/packages/traceai_voltagent/README.md +++ b/typescript/packages/traceai_voltagent/README.md @@ -98,8 +98,11 @@ promoted token keys on spans that are not model calls (moved under `voltagent.`) ### Tokens The Future AGI collector promotes `gen_ai.usage.*`, `llm.usage.*` and `llm.token_count.*` into -token columns on any span, and Observe sums them over the whole trace. So promoted keys appear only -on llm (model-call) spans. The agent span's summed usage is exported as `voltagent.usage.*`. +token columns, and `gen_ai.cost.total` / `llm.cost.total` (or, without a total, the parts +`gen_ai.cost.input` + `.output`, `llm.cost.prompt` + `.completion`) into its cost column, on any +span; Observe sums them over the whole trace. So promoted keys appear only on llm (model-call) +spans; on any other span they are moved under `voltagent.` (for example +`voltagent.gen_ai.cost.total`). The agent span's summed usage is exported as `voltagent.usage.*`. VoltAgent 2.11.0 wraps a whole multi-step AI SDK call (for example: tool call, then answer) in one `llm:` span and records the AI SDK's `usage` on it, which is the **last step only**, diff --git a/typescript/packages/traceai_voltagent/contract/test_harness_contract.py b/typescript/packages/traceai_voltagent/contract/test_harness_contract.py index 0046ff5a9..0c85bf921 100644 --- a/typescript/packages/traceai_voltagent/contract/test_harness_contract.py +++ b/typescript/packages/traceai_voltagent/contract/test_harness_contract.py @@ -56,7 +56,8 @@ CONTENT_KEYS = ("input", "output", "input.value", "output.value", "llm.messages", "agent.instructions", "agent.messages", "agent.messages.ui", "agent.stateSnapshot") PROMOTED_EXACT = {"gen_ai.usage.input_tokens", "gen_ai.usage.output_tokens", "gen_ai.usage.total_tokens", - "gen_ai.cost.total", "llm.cost.total"} + "gen_ai.cost.total", "llm.cost.total", "gen_ai.cost.input", "gen_ai.cost.output", + "llm.cost.prompt", "llm.cost.completion"} PROMOTED_PREFIXES = ("llm.token_count.", "llm.usage.") INPUT_TOKEN_KEYS = ("gen_ai.usage.input_tokens", "llm.usage.prompt_tokens", "llm.token_count.prompt") diff --git a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts index 272b0d134..384bcb633 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts @@ -211,6 +211,28 @@ describe("mapVoltAgentAttributes (AC-02)", () => { expect(attributes["voltagent.llm.usage.prompt_tokens"]).toBe(98); expect(attributes["voltagent.gen_ai.cost.total"]).toBe(0.5); }); + + it("also moves the cost-part keys the collector sums into its cost column", () => { + // fi-collector pkg/adapter/adapter.go DeriveHotKeys: with no cost.total, cost = input + output + // from gen_ai.cost.input / llm.cost.prompt and gen_ai.cost.output / llm.cost.completion. + const costParts = { + "gen_ai.cost.input": 0.1, + "gen_ai.cost.output": 0.2, + "llm.cost.prompt": 0.3, + "llm.cost.completion": 0.4, + }; + for (const key of Object.keys(costParts)) expect(isPromotedUsageKey(key)).toBe(true); + const { attributes } = mapVoltAgentAttributes( + { "span.type": "tool", "tool.name": "t", ...costParts }, + OFF, + ); + for (const [key, value] of Object.entries(costParts)) { + expect(attributes[key]).toBeUndefined(); + expect(attributes[`voltagent.${key}`]).toBe(value); + } + const llm = mapVoltAgentAttributes({ "span.type": "llm", ...costParts }, OFF).attributes; + for (const [key, value] of Object.entries(costParts)) expect(llm[key]).toBe(value); + }); }); describe("content (AC-07)", () => { diff --git a/typescript/packages/traceai_voltagent/src/mapping.ts b/typescript/packages/traceai_voltagent/src/mapping.ts index bb5c5cbf9..22570906c 100644 --- a/typescript/packages/traceai_voltagent/src/mapping.ts +++ b/typescript/packages/traceai_voltagent/src/mapping.ts @@ -21,6 +21,8 @@ export interface MappedAttributes { /** * Token and cost keys the Future AGI collector promotes into hot columns on any span kind. * Observe sums them over every span of a trace, so they may appear only on per-model-call spans. + * The cost-part keys count too: with no cost total, the collector stores input + output + * (fi-collector pkg/adapter/adapter.go DeriveHotKeys, costInputKeys / costOutputKeys). */ const PROMOTED_EXACT = new Set([ "gen_ai.usage.input_tokens", @@ -28,6 +30,10 @@ const PROMOTED_EXACT = new Set([ "gen_ai.usage.total_tokens", "gen_ai.cost.total", "llm.cost.total", + "gen_ai.cost.input", + "gen_ai.cost.output", + "llm.cost.prompt", + "llm.cost.completion", ]); const PROMOTED_PREFIXES = ["llm.token_count.", "llm.usage."]; From 9ef204c8246506b1198b4c3495b6f8bc9b39cabf Mon Sep 17 00:00:00 2001 From: Nikhil Pareek Date: Mon, 5 Oct 2026 01:03:32 -0700 Subject: [PATCH 03/18] fix(voltagent): drop summary, working-memory and PlanAgent text by default With captureContent=false (the default) the Future AGI copy still carried text that @voltagent/core 2.11.0 writes outside the keys the content filter knew: - agent.summary.preview, agent.summary.text: the model-written conversation summary on the span.type=summary span (agent/apply-summarization.ts). - agent.workingMemory.finalContent: the whole working-memory document on the agent root (agent.ts). - planagent.todos: the plan (planagent/planning/index.ts). - planagent.task.description, planagent.task.response_preview: the delegation brief and the subagent's answer (planagent/plan-agent.ts). Their last segments (preview, text, finalContent, todos, description, response_preview) are not content segments, so isContentKey let them through. Add all six to CONTENT_EXACT, list them in the README's dropped keys, and add them to the AC-07 content carrier. A new test checks each is absent with captureContent off and present with it on. Installed-review findings N1 and M2. approved: Nikhil 2026-10-03 blanket Refs: TH-8239 --- .../packages/traceai_voltagent/README.md | 11 ++++++---- .../src/__tests__/mapping.test.ts | 20 +++++++++++++++++++ .../packages/traceai_voltagent/src/mapping.ts | 9 +++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/typescript/packages/traceai_voltagent/README.md b/typescript/packages/traceai_voltagent/README.md index 3f29234d3..3a78fd361 100644 --- a/typescript/packages/traceai_voltagent/README.md +++ b/typescript/packages/traceai_voltagent/README.md @@ -117,13 +117,16 @@ the root total (`voltagent.usage.reconciled = true`) and keeps the last-step val ## Content Off by default. VoltAgent itself has no capture flag: it writes the prompt, the answer, system -instructions, message history, tool arguments and results, and memory payloads onto its spans. The -Future AGI copy drops them unless you pass `captureContent: true`. This is stricter than VoltAgent; -a VoltOps export of the same run still has the originals. +instructions, message history, tool arguments and results, memory payloads, conversation summaries +and plans onto its spans. The Future AGI copy drops them unless you pass `captureContent: true`. +This is stricter than VoltAgent; a VoltOps export of the same run still has the originals. Dropped keys: `input`, `output`, `agent.instructions`, `agent.messages`, `agent.messages.ui`, `agent.context`, `agent.stateSnapshot`, `llm.messages`, `workflow.context`, -`workspace.sandbox.command`, `workspace.sandbox.args`, `suspension.checkpoint`, any key with an +`workspace.sandbox.command`, `workspace.sandbox.args`, `suspension.checkpoint`, +`agent.summary.preview`, `agent.summary.text` (summarization), `agent.workingMemory.finalContent` +(working memory), `planagent.todos`, `planagent.task.description`, +`planagent.task.response_preview` (PlanAgent), any key with an `input` or `output` segment (`middleware.input.original`, `guardrail.output.after`, ...), and string values whose last segment is `messages`, `instructions`, `query`, `context`, `data`, `checkpoint`, `prompt(s)`, `completion`, `content`, `arguments` or `args` (`tool.search.query`, `vector.query`, diff --git a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts index 384bcb633..fc6859bf0 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts @@ -236,6 +236,14 @@ describe("mapVoltAgentAttributes (AC-02)", () => { }); describe("content (AC-07)", () => { + const summaryMemoryPlanContent = { + "agent.summary.preview": "SECRET_SUMMARY_PREVIEW", + "agent.summary.text": "SECRET_SUMMARY_TEXT", + "agent.workingMemory.finalContent": "SECRET_WORKING_MEMORY", + "planagent.todos": '[{"content":"SECRET_TODO"}]', + "planagent.task.description": "SECRET_TASK_BRIEF", + "planagent.task.response_preview": "SECRET_SUBAGENT_ANSWER", + }; const contentCarrier = { ...rootSpanAttributes(), "llm.messages": "SECRET", @@ -249,6 +257,9 @@ describe("content (AC-07)", () => { "workflow.resume.data": "SECRET", "suspension.checkpoint": "SECRET", "workspace.sandbox.command": "SECRET", + // Summarization, working memory and PlanAgent text (VoltAgent 2.11.0 apply-summarization.ts, + // agent.ts working-memory finalization, planagent/planning/index.ts, planagent/plan-agent.ts). + ...summaryMemoryPlanContent, }; it("drops prompts, messages, instructions, tool payloads and queries by default", () => { @@ -258,6 +269,15 @@ describe("content (AC-07)", () => { expect(attributes["output.value"]).toBeUndefined(); }); + it("drops summary, working-memory and plan text by default and keeps it after opt-in", () => { + const off = mapVoltAgentAttributes({ "span.type": "summary", ...summaryMemoryPlanContent }, OFF).attributes; + const on = mapVoltAgentAttributes({ "span.type": "summary", ...summaryMemoryPlanContent }, ON).attributes; + for (const [key, value] of Object.entries(summaryMemoryPlanContent)) { + expect([key, off[key]]).toEqual([key, undefined]); + expect([key, on[key]]).toEqual([key, value]); + } + }); + it("copies input/output to input.value/output.value only after opt-in", () => { const { attributes } = mapVoltAgentAttributes(rootSpanAttributes(), ON); expect(attributes["input.value"]).toBe("SECRET_PROMPT"); diff --git a/typescript/packages/traceai_voltagent/src/mapping.ts b/typescript/packages/traceai_voltagent/src/mapping.ts index 22570906c..332368cb8 100644 --- a/typescript/packages/traceai_voltagent/src/mapping.ts +++ b/typescript/packages/traceai_voltagent/src/mapping.ts @@ -58,6 +58,15 @@ const CONTENT_EXACT = new Set([ "workspace.sandbox.command", "workspace.sandbox.args", "suspension.checkpoint", + // Model-written summary (agent/apply-summarization.ts, span.type=summary). + "agent.summary.preview", + "agent.summary.text", + // The whole working-memory document (agent.ts, on the agent root). + "agent.workingMemory.finalContent", + // PlanAgent: the plan, the delegation brief and the subagent's answer (planagent/). + "planagent.todos", + "planagent.task.description", + "planagent.task.response_preview", // Future AGI / GenAI content keys, in case an upstream span already carries them. "input.value", "output.value", From 6a37c68331b60ea3c26cb3123d974416af868854 Mon Sep 17 00:00:00 2001 From: Nikhil Pareek Date: Mon, 5 Oct 2026 01:06:25 -0700 Subject: [PATCH 04/18] fix(voltagent): drop workflow.stateSnapshot by default @voltagent/core 2.11.0 sets workflow.stateSnapshot on every workflow root span (workflow/core.ts). Besides the step source code it carries the run input: the snapshot's `inputSchema` field is assigned the input value (`inputSchema: input`), not a schema. With captureContent=false the Future AGI copy exported it, so a workflow's input reached the collector. agent.stateSnapshot was already dropped for the same reason. Found while writing the real-workflow test for span events (M1): with event filtering in place, the workflow input still showed up in the exported attributes through this key. Add it to CONTENT_EXACT, to the README's dropped keys and to the AC-07 content carrier. approved: Nikhil 2026-10-03 blanket Refs: TH-8239 --- typescript/packages/traceai_voltagent/README.md | 2 +- .../packages/traceai_voltagent/src/__tests__/mapping.test.ts | 2 ++ typescript/packages/traceai_voltagent/src/mapping.ts | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/typescript/packages/traceai_voltagent/README.md b/typescript/packages/traceai_voltagent/README.md index 3a78fd361..ad2877a9c 100644 --- a/typescript/packages/traceai_voltagent/README.md +++ b/typescript/packages/traceai_voltagent/README.md @@ -123,7 +123,7 @@ This is stricter than VoltAgent; a VoltOps export of the same run still has the Dropped keys: `input`, `output`, `agent.instructions`, `agent.messages`, `agent.messages.ui`, `agent.context`, `agent.stateSnapshot`, `llm.messages`, `workflow.context`, -`workspace.sandbox.command`, `workspace.sandbox.args`, `suspension.checkpoint`, +`workflow.stateSnapshot` (step source and the run input), `workspace.sandbox.command`, `workspace.sandbox.args`, `suspension.checkpoint`, `agent.summary.preview`, `agent.summary.text` (summarization), `agent.workingMemory.finalContent` (working memory), `planagent.todos`, `planagent.task.description`, `planagent.task.response_preview` (PlanAgent), any key with an diff --git a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts index fc6859bf0..6b723a3b0 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts @@ -257,6 +257,8 @@ describe("content (AC-07)", () => { "workflow.resume.data": "SECRET", "suspension.checkpoint": "SECRET", "workspace.sandbox.command": "SECRET", + // The workflow root's snapshot carries the run input (workflow/core.ts: `inputSchema: input`). + "workflow.stateSnapshot": '{"id":"approval","inputSchema":{"question":"SECRET"}}', // Summarization, working memory and PlanAgent text (VoltAgent 2.11.0 apply-summarization.ts, // agent.ts working-memory finalization, planagent/planning/index.ts, planagent/plan-agent.ts). ...summaryMemoryPlanContent, diff --git a/typescript/packages/traceai_voltagent/src/mapping.ts b/typescript/packages/traceai_voltagent/src/mapping.ts index 332368cb8..16466ab25 100644 --- a/typescript/packages/traceai_voltagent/src/mapping.ts +++ b/typescript/packages/traceai_voltagent/src/mapping.ts @@ -55,6 +55,9 @@ const CONTENT_EXACT = new Set([ "agent.stateSnapshot", "llm.messages", "workflow.context", + // The workflow root's snapshot: step source code plus the run input, which workflow/core.ts + // stores under `inputSchema` (`inputSchema: input`). + "workflow.stateSnapshot", "workspace.sandbox.command", "workspace.sandbox.args", "suspension.checkpoint", From 2fcf4c1896143d9d9ac52e7c00df8adf0526407f Mon Sep 17 00:00:00 2001 From: Nikhil Pareek Date: Mon, 5 Oct 2026 01:08:42 -0700 Subject: [PATCH 05/18] fix(voltagent): filter span event attributes like span attributes copySpan forwarded span.events unchanged, so the captureContent=false default did not hold for event attributes. @voltagent/core 2.11.0 puts content there: - guardrail.stream.process, one event per streamed chunk on an output guardrail with a streaming handler, carries the chunk in guardrail.chunk.text (agent/streaming/output-guardrail-stream-runner.ts), so the FI copy carried the streamed answer. - workflow.suspended carries suspension.data and suspension.checkpoint, and workflow.resumed carries resume.data (workflow/open-telemetry/trace-context.ts): user payloads. Add mapSpanEvents: every event's attributes go through the same filter as span attributes. Credential keys are removed always, content keys unless captureContent, and exception.* (type, message, stacktrace) is kept, as the README promises for exception events. Event names and times stay. The processor maps events when the span ends, holds them with deferred llm spans, and passes them to copySpan, which takes an optional events argument (default: the span's own). The span other processors hold is not modified. guardrail.chunk.text, suspension.data and resume.data join CONTENT_EXACT so the value type does not matter. Tests: - jest, synthetic spans: guardrail.stream.process, workflow.suspended, workflow.resumed, an exception event and an event with credential keys; content attributes gone with captureContent off and kept with it on, names/times/exception attributes kept, credentials gone either way, and the original events not mutated. - jest, real VoltAgent: streamText with a pass-through streaming output guardrail plus a workflow that suspends and resumes. A recording processor in the same array sees the content in the events (control); the exported copy does not, unless captureContent is on. - jest: the failing-tool exception event keeps exception.type, .message and .stacktrace. - contract: new `events` journey in run_fixture.mjs (same guardrail and workflow), checked on the wire through the shared harness Receiver, off and on, parametrized over TRACEAI_NODE_MATRIX. Installed-review finding M1. approved: Nikhil 2026-10-03 blanket Refs: TH-8239 --- .../packages/traceai_voltagent/README.md | 25 ++- .../contract/run_fixture.mjs | 58 ++++- .../contract/test_harness_contract.py | 56 +++++ .../src/FIVoltAgentSpanProcessor.ts | 40 ++-- .../src/__tests__/helpers.ts | 61 +++++- .../src/__tests__/mapping.test.ts | 8 + .../src/__tests__/processor.test.ts | 202 ++++++++++++++++++ .../packages/traceai_voltagent/src/index.ts | 2 + .../packages/traceai_voltagent/src/mapping.ts | 37 ++++ 9 files changed, 462 insertions(+), 27 deletions(-) diff --git a/typescript/packages/traceai_voltagent/README.md b/typescript/packages/traceai_voltagent/README.md index ad2877a9c..4ec99ec15 100644 --- a/typescript/packages/traceai_voltagent/README.md +++ b/typescript/packages/traceai_voltagent/README.md @@ -91,7 +91,7 @@ promoted token keys on spans that are not model calls (moved under `voltagent.`) | `gen_ai.usage.reasoning.output_tokens`, `gen_ai.usage.output_tokens.reasoning` | `llm.usage.reasoning_tokens` | llm spans only, when > 0 | | `voltagent.usage.input_tokens`, `.output_tokens`, `.total_tokens`, `.cache_read_tokens`, `.reasoning_tokens` | `usage.prompt_tokens`, ... on the agent span | the operation total; namespaced so it is not counted twice | | `gen_ai.tool.name`, `gen_ai.tool.call.id`, `gen_ai.tool.description` | `tool.name`, `tool.call.id`, `tool.description` | | -| status, `exception` events, `error.*` | passed through | a failing tool is an `ERROR` span | +| status, `exception` events, `error.*` | passed through | a failing tool is an `ERROR` span; `exception` events keep `exception.type`, `.message` and `.stacktrace`. Other event attributes are filtered like span attributes (see Content) | | `input.value`, `output.value` | `input`, `output` (`vector.query` / `embedding.query` as retriever input) | **only with `captureContent: true`** | | cost | not mapped | VoltAgent sets `usage.cost` only from OpenRouter provider metadata; it is passed through unchanged and not promoted | @@ -123,17 +123,28 @@ This is stricter than VoltAgent; a VoltOps export of the same run still has the Dropped keys: `input`, `output`, `agent.instructions`, `agent.messages`, `agent.messages.ui`, `agent.context`, `agent.stateSnapshot`, `llm.messages`, `workflow.context`, -`workflow.stateSnapshot` (step source and the run input), `workspace.sandbox.command`, `workspace.sandbox.args`, `suspension.checkpoint`, -`agent.summary.preview`, `agent.summary.text` (summarization), `agent.workingMemory.finalContent` -(working memory), `planagent.todos`, `planagent.task.description`, -`planagent.task.response_preview` (PlanAgent), any key with an +`workflow.stateSnapshot` (step source and the run input), `workspace.sandbox.command`, +`workspace.sandbox.args`, `suspension.checkpoint`, `agent.summary.preview`, `agent.summary.text` +(summarization), `agent.workingMemory.finalContent` (working memory), `planagent.todos`, +`planagent.task.description`, `planagent.task.response_preview` (PlanAgent), +`guardrail.chunk.text`, `suspension.data`, `resume.data` (span events, below), any key with an `input` or `output` segment (`middleware.input.original`, `guardrail.output.after`, ...), and string values whose last segment is `messages`, `instructions`, `query`, `context`, `data`, `checkpoint`, `prompt(s)`, `completion`, `content`, `arguments` or `args` (`tool.search.query`, `vector.query`, -`resume.data`, ...). Counts such as `llm.messages.count` stay. +`workflow.resume.data`, ...). Counts such as `llm.messages.count` stay. + +Span events are filtered the same way. VoltAgent puts content in event attributes too: an output +guardrail with a streaming handler adds a `guardrail.stream.process` event per answer chunk with +the chunk in `guardrail.chunk.text`, and a workflow adds `workflow.suspended` (`suspension.data`, +`suspension.checkpoint`) and `workflow.resumed` (`resume.data`). Without `captureContent`, those +keys are removed from the exported events; the event names, times and other attributes +(`guardrail.chunk.index`, `suspension.reason`, `resume.step_index`, ...) stay. `exception` events +keep `exception.type`, `exception.message` and `exception.stacktrace`, which contain whatever text +the thrown error carries. Credentials are never exported, whatever `captureContent` says: keys with a segment like -`api_key`, `secret`, `secret_key`, `password`, `authorization`, `cookie` or `header(s)` are dropped. +`api_key`, `secret`, `secret_key`, `password`, `authorization`, `cookie` or `header(s)` are dropped, +from span attributes and from event attributes. ## Flushing, serverless and failures diff --git a/typescript/packages/traceai_voltagent/contract/run_fixture.mjs b/typescript/packages/traceai_voltagent/contract/run_fixture.mjs index f6c18eb8d..0d1f900e1 100644 --- a/typescript/packages/traceai_voltagent/contract/run_fixture.mjs +++ b/typescript/packages/traceai_voltagent/contract/run_fixture.mjs @@ -6,11 +6,20 @@ // exporter posts to FI_BASE_URL + /tracer/v1/traces (the shared harness Receiver in tests). // // Env: FI_BASE_URL, FI_API_KEY, FI_SECRET_KEY, FI_PROJECT_NAME (placeholders in tests), -// JOURNEY = tools | subagent | burst | collector-down, CAPTURE_CONTENT = "true" to opt in. +// JOURNEY = tools | subagent | burst | events, CAPTURE_CONTENT = "true" to opt in. // Prints one line "RESULT_JSON:{...}" on stdout. import { ProjectType, register } from "@traceai/fi-core"; import { FIVoltAgentSpanProcessor } from "@traceai/voltagent"; -import { Agent, VoltAgent, VoltAgentObservability, createTool } from "@voltagent/core"; +import { + Agent, + InMemoryStorageAdapter, + Memory, + VoltAgent, + VoltAgentObservability, + createOutputGuardrail, + createTool, + createWorkflowChain, +} from "@voltagent/core"; import { MockLanguageModelV3, convertArrayToReadableStream } from "ai/test"; import { z } from "zod"; @@ -25,6 +34,8 @@ export const MARKERS = { toolResult: "SECRET_TOOL_RESULT_MARKER", answer: "SECRET_ANSWER_MARKER", subtask: "SECRET_SUBTASK_MARKER", + suspendData: "SECRET_SUSPEND_DATA_MARKER", + resumeData: "SECRET_RESUME_DATA_MARKER", }; const modelCalls = []; @@ -109,7 +120,13 @@ const recorded = []; const recorder = { onStart() {}, onEnd(span) { - recorded.push({ name: span.name, spanId: span.spanContext().spanId, traceId: span.spanContext().traceId }); + recorded.push({ + name: span.name, + spanId: span.spanContext().spanId, + traceId: span.spanContext().traceId, + // Event names and attribute keys as VoltAgent wrote them (the control for event filtering). + events: (span.events ?? []).map((event) => [event.name, Object.keys(event.attributes ?? {})]), + }); }, forceFlush: async () => {}, shutdown: async () => {}, @@ -150,6 +167,41 @@ if (JOURNEY === "subagent") { new VoltAgent({ agents: { supervisor, researcher }, observability, checkDependencies: false }); const out = await supervisor.generateText(MARKERS.prompt, { conversationId: "conv-sub", userId: "user-1", maxSteps: 4 }); result.text = out.text; +} else if (JOURNEY === "events") { + // Span events that carry content in VoltAgent 2.11.0: an output guardrail with a streaming + // handler adds guardrail.stream.process (guardrail.chunk.text) per chunk, and a workflow that + // suspends and resumes adds workflow.suspended (suspension.data, suspension.checkpoint) and + // workflow.resumed (resume.data). The payloads come from the input, not the step source, + // because VoltAgent serializes the step source into workflow.stateSnapshot. + const agent = new Agent({ + name: "assistant", + instructions: MARKERS.instructions, + model: scriptedModel("mockai/mock-model-1", [{ text: MARKERS.answer, input: 3, output: 2 }]), + outputGuardrails: [ + createOutputGuardrail({ name: "pass-through", handler: async () => ({ pass: true }), streamHandler: ({ part }) => part }), + ], + }); + const workflow = createWorkflowChain({ + id: "approval", + name: "approval", + input: z.object({ amount: z.number(), question: z.string() }), + result: z.object({ approved: z.boolean() }), + memory: new Memory({ storage: new InMemoryStorageAdapter() }), + }).andThen({ + id: "ask", + suspendSchema: z.object({ question: z.string() }), + resumeSchema: z.object({ approved: z.boolean(), note: z.string() }), + execute: async ({ data, suspend, resumeData }) => { + if (!resumeData) await suspend("needs approval", { question: data.question }); + return { approved: resumeData?.approved === true }; + }, + }); + new VoltAgent({ agents: { assistant: agent }, workflows: { approval: workflow }, observability, checkDependencies: false }); + const stream = await agent.streamText(MARKERS.prompt, { conversationId: "conv-events", userId: "user-9" }); + result.text = await stream.text; + const suspended = await workflow.run({ amount: 5, question: MARKERS.suspendData }); + const resumed = await suspended.resume({ approved: true, note: MARKERS.resumeData }); + result.workflowStatuses = [suspended.status, resumed.status]; } else { const agent = new Agent({ name: "assistant", diff --git a/typescript/packages/traceai_voltagent/contract/test_harness_contract.py b/typescript/packages/traceai_voltagent/contract/test_harness_contract.py index 0c85bf921..da9edf4b0 100644 --- a/typescript/packages/traceai_voltagent/contract/test_harness_contract.py +++ b/typescript/packages/traceai_voltagent/contract/test_harness_contract.py @@ -52,6 +52,8 @@ "SECRET_TOOL_RESULT_MARKER", "SECRET_ANSWER_MARKER", "SECRET_SUBTASK_MARKER", + "SECRET_SUSPEND_DATA_MARKER", + "SECRET_RESUME_DATA_MARKER", ) CONTENT_KEYS = ("input", "output", "input.value", "output.value", "llm.messages", "agent.instructions", "agent.messages", "agent.messages.ui", "agent.stateSnapshot") @@ -60,6 +62,14 @@ "llm.cost.prompt", "llm.cost.completion"} PROMOTED_PREFIXES = ("llm.token_count.", "llm.usage.") INPUT_TOKEN_KEYS = ("gen_ai.usage.input_tokens", "llm.usage.prompt_tokens", "llm.token_count.prompt") +# (event name, attribute key) pairs VoltAgent 2.11.0 fills with content (output-guardrail-stream-runner.ts, +# workflow/open-telemetry/trace-context.ts). +EVENT_CONTENT = ( + ("guardrail.stream.process", "guardrail.chunk.text"), + ("workflow.suspended", "suspension.data"), + ("workflow.suspended", "suspension.checkpoint"), + ("workflow.resumed", "resume.data"), +) def _check(result: subprocess.CompletedProcess, what: str) -> None: @@ -301,6 +311,52 @@ def test_burst_then_flush_drops_nothing(built_package: Path) -> None: assert _promoted_input_tokens(spans) == sum(call["input"] for call in output["modelCalls"]) == 20 * 24 +def _event_values(spans: List[Dict[str, Any]]) -> Dict[tuple, List[Any]]: + """(event name, attribute key) -> every value exported for it, over the whole trace.""" + values: Dict[tuple, List[Any]] = {} + for span in spans: + for event in span.get("events", []): + for key, value in _attrs(event).items(): + values.setdefault((event["name"], key), []).append(value) + return values + + +@pytest.mark.parametrize("node", NODES) +def test_span_events_carry_no_content_by_default(built_package: Path, node: str) -> None: + """Guardrail stream chunks and workflow suspend/resume payloads in span events (M1).""" + with Receiver() as receiver: + output = _run_fixture(node, receiver.origin, "events") + spans = receiver.spans() + requests = receiver.requests() + assert output["text"] == "SECRET_ANSWER_MARKER" + assert output["workflowStatuses"] == ["suspended", "completed"] + _assert_collector_contract(requests) + assert len(spans) == len(output["recorded"]) + + # Control: VoltAgent wrote the content keys into the events every processor received. + written = {(name, key) for span in output["recorded"] for name, keys in span["events"] for key in keys} + for pair in EVENT_CONTENT: + assert pair in written, pair + exported = _event_values(spans) + for pair in EVENT_CONTENT: + assert pair not in exported, pair + assert "text-delta" in exported[("guardrail.stream.process", "guardrail.chunk.type")] + assert exported[("workflow.suspended", "suspension.step_index")] == [0] + assert exported[("workflow.resumed", "resume.step_index")] == [0] + blob = json.dumps(spans) + for marker in MARKERS: + assert marker not in blob, marker + assert PLACEHOLDER_API_KEY not in blob and PLACEHOLDER_SECRET_KEY not in blob + + with Receiver() as receiver: + _run_fixture(node, receiver.origin, "events", {"CAPTURE_CONTENT": "true"}) + captured = _event_values(receiver.spans()) + assert "SECRET_ANSWER_MARKER" in captured[("guardrail.stream.process", "guardrail.chunk.text")] + assert "SECRET_SUSPEND_DATA_MARKER" in captured[("workflow.suspended", "suspension.data")][0] + assert captured[("workflow.suspended", "suspension.checkpoint")] + assert "SECRET_RESUME_DATA_MARKER" in captured[("workflow.resumed", "resume.data")][0] + + def _closed_port() -> int: with socket.socket() as sock: sock.bind(("127.0.0.1", 0)) diff --git a/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts b/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts index 6af1480ea..6467bc4f7 100644 --- a/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts +++ b/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts @@ -8,9 +8,10 @@ import { type SpanExporter, type SpanProcessor, } from "@opentelemetry/sdk-trace-base"; -import { mapVoltAgentAttributes, reconcileOperationUsage } from "./mapping"; +import { mapSpanEvents, mapVoltAgentAttributes, reconcileOperationUsage } from "./mapping"; type Resource = ReadableSpan["resource"]; +type SpanEvents = ReadableSpan["events"]; /** * Anything shaped like an OpenTelemetry SDK 2.x `BasicTracerProvider`, such as the @@ -40,9 +41,9 @@ export interface FIVoltAgentSpanProcessorOptions { /** BatchSpanProcessor settings (SDK defaults: queue 2048, batch 512, delay 5000 ms). */ batchConfig?: BufferConfig; /** - * Export prompts, messages, instructions, tool arguments/results and retrieval queries. - * Default false. VoltAgent itself has no such flag and always writes them; this processor - * drops them from the Future AGI copy unless you opt in. + * Export prompts, messages, instructions, tool arguments/results and retrieval queries, on span + * attributes and on span event attributes. Default false. VoltAgent itself has no such flag and + * always writes them; this processor drops them from the Future AGI copy unless you opt in. */ captureContent?: boolean; /** @@ -63,6 +64,7 @@ interface PendingLLMSpan { original: ReadableSpan; source: Attributes; attributes: Attributes; + events: SpanEvents; isError: boolean; } @@ -109,13 +111,17 @@ export class FIVoltAgentSpanProcessor implements SpanProcessor { if (this.isShutdown) return; try { const source = span.attributes ?? {}; - const mapped = mapVoltAgentAttributes(source, { captureContent: this.captureContent }); + const options = { captureContent: this.captureContent }; + const mapped = mapVoltAgentAttributes(source, options); + // Event attributes carry content too (guardrail stream chunks, workflow suspend/resume data). + const events = mapSpanEvents(span.events, options); if (mapped.isModelCall && mapped.operationId) { this.hold(mapped.operationId, { original: span, source, attributes: mapped.attributes, + events, isError: span.status?.code === SpanStatusCode.ERROR, }); return; @@ -129,11 +135,11 @@ export class FIVoltAgentSpanProcessor implements SpanProcessor { } catch (error) { diag.warn("@traceai/voltagent: usage reconciliation failed", error); } - for (const held of operation.spans) this.forward(held.original, held.attributes); + for (const held of operation.spans) this.forward(held.original, held.attributes, held.events); } } - this.forward(span, mapped.attributes); + this.forward(span, mapped.attributes, events); } catch (error) { diag.error("@traceai/voltagent: failed to map or export a VoltAgent span", error); } @@ -187,24 +193,32 @@ export class FIVoltAgentSpanProcessor implements SpanProcessor { private release(operationId: string): void { const operation = this.take(operationId); if (!operation) return; - for (const held of operation.spans) this.forward(held.original, held.attributes); + for (const held of operation.spans) this.forward(held.original, held.attributes, held.events); } private releaseAll(): void { for (const operationId of Array.from(this.pending.keys())) this.release(operationId); } - private forward(span: ReadableSpan, attributes: Attributes): void { + private forward(span: ReadableSpan, attributes: Attributes, events: SpanEvents): void { try { - this.delegate.processor.onEnd(copySpan(span, attributes, this.delegate.resource ?? span.resource)); + this.delegate.processor.onEnd(copySpan(span, attributes, this.delegate.resource ?? span.resource, events)); } catch (error) { diag.error("@traceai/voltagent: exporter rejected a span", error); } } } -/** A ReadableSpan with new attributes and resource; every other field reads through. */ -export function copySpan(span: ReadableSpan, attributes: Attributes, resource: Resource): ReadableSpan { +/** + * A ReadableSpan with new attributes, resource and (optionally) events; every other field reads + * through. Pass events filtered with `mapSpanEvents`, or the original events are copied as-is. + */ +export function copySpan( + span: ReadableSpan, + attributes: Attributes, + resource: Resource, + events: SpanEvents = span.events, +): ReadableSpan { const spanContext = span.spanContext(); const copy = { name: span.name, @@ -216,7 +230,7 @@ export function copySpan(span: ReadableSpan, attributes: Attributes, resource: R status: span.status, attributes, links: span.links, - events: span.events, + events, duration: span.duration, ended: span.ended, resource, diff --git a/typescript/packages/traceai_voltagent/src/__tests__/helpers.ts b/typescript/packages/traceai_voltagent/src/__tests__/helpers.ts index bc64a496a..621bbb499 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/helpers.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/helpers.ts @@ -8,7 +8,16 @@ import { SimpleSpanProcessor, type SpanProcessor, } from "@opentelemetry/sdk-trace-base"; -import { Agent, VoltAgent, VoltAgentObservability, createTool } from "@voltagent/core"; +import { + Agent, + InMemoryStorageAdapter, + Memory, + VoltAgent, + VoltAgentObservability, + createOutputGuardrail, + createTool, + createWorkflowChain, +} from "@voltagent/core"; import { MockLanguageModelV3, convertArrayToReadableStream } from "ai/test"; import { z } from "zod"; @@ -19,6 +28,8 @@ export const MARKERS = { toolResult: "SECRET_TOOL_RESULT_MARKER", answer: "SECRET_ANSWER_MARKER", subtask: "SECRET_SUBTASK_MARKER", + suspendData: "SECRET_SUSPEND_DATA_MARKER", + resumeData: "SECRET_RESUME_DATA_MARKER", } as const; export type Step = @@ -160,13 +171,55 @@ export function fiProvider() { return { exporter, provider }; } -/** Wire agents into a fresh VoltAgentObservability whose spanProcessors are `processors`. */ -export function voltagent(agents: Record, processors: SpanProcessor[]) { +/** Wire agents (and workflows) into a fresh VoltAgentObservability whose spanProcessors are `processors`. */ +export function voltagent( + agents: Record, + processors: SpanProcessor[], + workflows?: Record>, +) { const observability = new VoltAgentObservability({ spanProcessors: processors }); - new VoltAgent({ agents, observability, checkDependencies: false }); + new VoltAgent({ agents, workflows, observability, checkDependencies: false }); return observability; } +/** + * An output guardrail with a streaming handler that passes every chunk through. VoltAgent 2.11.0 + * then adds a `guardrail.stream.process` event per chunk carrying the chunk text + * (output-guardrail-stream-runner.ts, `guardrail.chunk.text`). + */ +export function passThroughGuardrail() { + return createOutputGuardrail({ + name: "pass-through", + handler: async () => ({ pass: true }), + streamHandler: ({ part }) => part, + }); +} + +/** + * A one-step workflow that suspends with `question` from its input and completes on resume. + * VoltAgent 2.11.0 adds `workflow.suspended` (suspension.data, suspension.checkpoint) and + * `workflow.resumed` (resume.data) events to the workflow root (workflow/open-telemetry/trace-context.ts). + * The payloads come from the input, never from the step source, because the step source is + * serialized into `workflow.stateSnapshot`. + */ +export function approvalWorkflow() { + return createWorkflowChain({ + id: "approval", + name: "approval", + input: z.object({ amount: z.number(), question: z.string() }), + result: z.object({ approved: z.boolean() }), + memory: new Memory({ storage: new InMemoryStorageAdapter() }), + }).andThen({ + id: "ask", + suspendSchema: z.object({ question: z.string() }), + resumeSchema: z.object({ approved: z.boolean(), note: z.string() }), + execute: async ({ data, suspend, resumeData }) => { + if (!resumeData) await suspend("needs approval", { question: data.question }); + return { approved: resumeData?.approved === true }; + }, + }); +} + /** VoltAgentObservability registers its provider globally; reset between tests. */ export async function resetOtelGlobals(observability?: { shutdown(): Promise }) { if (observability) await observability.shutdown().catch(() => undefined); diff --git a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts index 6b723a3b0..3c49c5d66 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts @@ -304,6 +304,14 @@ describe("content (AC-07)", () => { expect(isContentKey("memory.context_limit", 10)).toBe(false); expect(isContentKey("gen_ai.usage.input_tokens", 3)).toBe(false); expect(isContentKey("tool.name", "x")).toBe(false); + // Span-event content (VoltAgent 2.11.0 guardrail stream and workflow suspend/resume events). + expect(isContentKey("guardrail.chunk.text", "x")).toBe(true); + expect(isContentKey("suspension.data", "x")).toBe(true); + expect(isContentKey("suspension.checkpoint", "x")).toBe(true); + expect(isContentKey("resume.data", "x")).toBe(true); + expect(isContentKey("guardrail.chunk.index", 4)).toBe(false); + expect(isContentKey("suspension.step_index", 0)).toBe(false); + expect(isContentKey("exception.message", "boom")).toBe(false); }); }); diff --git a/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts index c1534c6e3..1d45c397f 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts @@ -8,12 +8,14 @@ import { FI_RESOURCE_ATTRIBUTES, MARKERS, RecordingProcessor, + approvalWorkflow, attrs, byName, explodingTool, fiProvider, one, parentId, + passThroughGuardrail, promotedInputTokens, resetOtelGlobals, scriptedModel, @@ -127,6 +129,11 @@ describe("FIVoltAgentSpanProcessor with a real VoltAgent agent (AC-01)", () => { expect(attrs(span)[key]).toBeUndefined(); } } + // Exception events keep exception.type / .message / .stacktrace (README: passed through). + const exception = one(exported, "tool.execution:explode").events.find((event) => event.name === "exception"); + expect(exception?.attributes?.["exception.message"]).toBe("tool exploded"); + expect(exception?.attributes?.["exception.type"]).toEqual(expect.any(String)); + expect(exception?.attributes?.["exception.stacktrace"]).toEqual(expect.stringContaining("tool exploded")); }); it("exports content only after captureContent: true (control run)", async () => { @@ -344,6 +351,201 @@ describe("batching through the register() provider's exporter", () => { }); }); +/** A finished span as VoltAgent hands it to processors, with the given attributes and events. */ +function fakeSpan( + name: string, + attributes: Record, + events: Array<{ name: string; attributes?: Record }>, +): ReadableSpan { + return { + name, + kind: SpanKind.INTERNAL, + spanContext: () => ({ traceId: "c".repeat(32), spanId: name.length.toString(16).padStart(16, "d"), traceFlags: 1 }), + parentSpanContext: undefined, + startTime: [0, 0], + endTime: [0, 10], + status: { code: SpanStatusCode.OK }, + attributes, + links: [], + events: events.map((event, index) => ({ ...event, time: [0, index + 1] })), + duration: [0, 10], + ended: true, + resource: { attributes: {} }, + instrumentationScope: { name: "@voltagent/core" }, + droppedAttributesCount: 0, + droppedEventsCount: 0, + droppedLinksCount: 0, + } as unknown as ReadableSpan; +} + +describe("span events (M1)", () => { + // Event shapes VoltAgent 2.11.0 writes: output-guardrail-stream-runner.ts (guardrail.stream.*), + // workflow/open-telemetry/trace-context.ts (workflow.suspended / workflow.resumed), and the + // OpenTelemetry SDK's recordException. + const guardrailSpan = () => + fakeSpan("guardrail.output.stream.1", { "span.type": "guardrail", "guardrail.name": "pii" }, [ + { name: "guardrail.stream.start", attributes: { "guardrail.stream.handler": true } }, + { + name: "guardrail.stream.process", + attributes: { + "guardrail.chunk.index": 4, + "guardrail.chunk.type": "text-delta", + "guardrail.chunk.text": "SECRET_CHUNK_TEXT", + "guardrail.chunk.action": "pass", + }, + }, + { + name: "exception", + attributes: { + "exception.type": "Error", + "exception.message": "guardrail failed", + "exception.stacktrace": "Error: guardrail failed\n at handler (guardrail.ts:1:1)", + }, + }, + { + name: "provider.request", + attributes: { "provider.name": "openai", "provider.api_key": "PLACEHOLDER_KEY", "http.request.headers": "PLACEHOLDER_HEADERS" }, + }, + { name: "guardrail.stream.end" }, + ]); + const workflowSpan = () => + fakeSpan("workflow.approval", { "entity.type": "workflow", "entity.id": "approval" }, [ + { + name: "workflow.suspended", + attributes: { + "suspension.step_index": 0, + "suspension.reason": "needs approval", + "suspension.data": '{"question":"SECRET_SUSPEND_DATA"}', + "suspension.checkpoint": '{"stepExecutionState":"SECRET_CHECKPOINT"}', + }, + }, + { name: "workflow.resumed", attributes: { "resume.step_index": 0, "resume.data": '{"note":"SECRET_RESUME_DATA"}' } }, + ]); + + function exportWith(captureContent: boolean) { + const exporter = new InMemorySpanExporter(); + const processor = new FIVoltAgentSpanProcessor({ exporter, batch: false, captureContent }); + const originals = [guardrailSpan(), workflowSpan()]; + const before = JSON.stringify(originals.map((span) => span.events)); + for (const span of originals) processor.onEnd(span); + // The span other processors hold is never modified. + expect(JSON.stringify(originals.map((span) => span.events))).toBe(before); + const exported = exporter.getFinishedSpans(); + const event = (spanName: string, eventName: string) => { + const found = one(exported, spanName).events.filter((e) => e.name === eventName); + expect(found).toHaveLength(1); + return found[0].attributes ?? {}; + }; + return { exported, event }; + } + + it("removes content from event attributes by default; names, times, counts and exceptions stay", () => { + const { exported, event } = exportWith(false); + expect(one(exported, "guardrail.output.stream.1").events.map((e) => [e.name, e.time])).toEqual([ + ["guardrail.stream.start", [0, 1]], + ["guardrail.stream.process", [0, 2]], + ["exception", [0, 3]], + ["provider.request", [0, 4]], + ["guardrail.stream.end", [0, 5]], + ]); + expect(event("guardrail.output.stream.1", "guardrail.stream.process")).toEqual({ + "guardrail.chunk.index": 4, + "guardrail.chunk.type": "text-delta", + "guardrail.chunk.action": "pass", + }); + expect(event("guardrail.output.stream.1", "exception")).toEqual({ + "exception.type": "Error", + "exception.message": "guardrail failed", + "exception.stacktrace": "Error: guardrail failed\n at handler (guardrail.ts:1:1)", + }); + expect(event("workflow.approval", "workflow.suspended")).toEqual({ + "suspension.step_index": 0, + "suspension.reason": "needs approval", + }); + expect(event("workflow.approval", "workflow.resumed")).toEqual({ "resume.step_index": 0 }); + const blob = JSON.stringify(exported.map((span) => span.events)); + expect(blob).not.toContain("SECRET"); + expect(blob).not.toContain("PLACEHOLDER"); + }); + + it("keeps event content after captureContent: true, but never credentials", () => { + const { exported, event } = exportWith(true); + expect(event("guardrail.output.stream.1", "guardrail.stream.process")["guardrail.chunk.text"]).toBe( + "SECRET_CHUNK_TEXT", + ); + const suspended = event("workflow.approval", "workflow.suspended"); + expect(suspended["suspension.data"]).toBe('{"question":"SECRET_SUSPEND_DATA"}'); + expect(suspended["suspension.checkpoint"]).toBe('{"stepExecutionState":"SECRET_CHECKPOINT"}'); + expect(event("workflow.approval", "workflow.resumed")["resume.data"]).toBe('{"note":"SECRET_RESUME_DATA"}'); + expect(event("guardrail.output.stream.1", "provider.request")).toEqual({ "provider.name": "openai" }); + expect(JSON.stringify(exported.map((span) => span.events))).not.toContain("PLACEHOLDER"); + }); +}); + +describe("span events from a real agent and workflow (M1)", () => { + async function runEventJourney(captureContent: boolean) { + const { exporter, provider } = fiProvider(); + const recorder = new RecordingProcessor(); + const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider, captureContent }); + const { model } = scriptedModel("mockai/mock-model-1", [{ kind: "text", text: MARKERS.answer, input: 3, output: 2 }]); + const agent = new Agent({ name: "assistant", instructions: "x", model, outputGuardrails: [passThroughGuardrail()] }); + const workflow = approvalWorkflow(); + observability = voltagent({ assistant: agent }, [recorder, processor], { approval: workflow }); + + const stream = await agent.streamText(MARKERS.prompt, { conversationId: "conv-events" }); + expect(await stream.text).toBe(MARKERS.answer); + const suspended = await workflow.run({ amount: 5, question: MARKERS.suspendData }); + expect(suspended.status).toBe("suspended"); + const resumed = await suspended.resume({ approved: true, note: MARKERS.resumeData }); + expect(resumed.status).toBe("completed"); + await settle(recorder); + await processor.forceFlush(); + + const exported = exporter.getFinishedSpans(); + const events = (spans: ReadableSpan[], name: string) => + spans.flatMap((span) => span.events.filter((event) => event.name === name).map((event) => event.attributes ?? {})); + // Control: VoltAgent really wrote the content into the events the other processors received. + expect(events(recorder.spans, "guardrail.stream.process").map((a) => a["guardrail.chunk.text"])).toContain( + MARKERS.answer, + ); + expect(String(events(recorder.spans, "workflow.suspended")[0]["suspension.data"])).toContain(MARKERS.suspendData); + expect(String(events(recorder.spans, "workflow.resumed")[0]["resume.data"])).toContain(MARKERS.resumeData); + expect(exported).toHaveLength(recorder.spans.length); + return { exported, events: (name: string) => events(exported, name) }; + } + + it("drops streamed guardrail text and workflow suspend/resume payloads from events by default", async () => { + const { exported, events } = await runEventJourney(false); + const processed = events("guardrail.stream.process"); + expect(processed.map((a) => a["guardrail.chunk.type"])).toContain("text-delta"); + for (const a of processed) expect(a["guardrail.chunk.text"]).toBeUndefined(); + expect(events("guardrail.stream.start")).toHaveLength(1); + const [suspended] = events("workflow.suspended"); + expect(suspended).toMatchObject({ "suspension.step_index": 0 }); + expect(suspended["suspension.reason"]).toEqual(expect.any(String)); + expect(suspended["suspension.data"]).toBeUndefined(); + expect(suspended["suspension.checkpoint"]).toBeUndefined(); + const [resumed] = events("workflow.resumed"); + expect(resumed).toEqual({ "resume.step_index": 0 }); + for (const span of exported.filter((s) => s.name === "workflow.approval")) { + expect(attrs(span)["fi.span.kind"]).toBe("CHAIN"); + } + const blob = JSON.stringify(exported.map((span) => [span.name, span.attributes, span.events])); + for (const marker of [MARKERS.answer, MARKERS.prompt, MARKERS.suspendData, MARKERS.resumeData]) { + expect(blob).not.toContain(marker); + } + }); + + it("keeps them after captureContent: true (control run)", async () => { + const { events } = await runEventJourney(true); + expect(events("guardrail.stream.process").map((a) => a["guardrail.chunk.text"])).toContain(MARKERS.answer); + const [suspended] = events("workflow.suspended"); + expect(String(suspended["suspension.data"])).toContain(MARKERS.suspendData); + expect(suspended["suspension.checkpoint"]).toEqual(expect.any(String)); + expect(String(events("workflow.resumed")[0]["resume.data"])).toContain(MARKERS.resumeData); + }); +}); + describe("usage reconciliation window", () => { it("exports a held llm span unreconciled when its root never ends", async () => { const exporter = new InMemorySpanExporter(); diff --git a/typescript/packages/traceai_voltagent/src/index.ts b/typescript/packages/traceai_voltagent/src/index.ts index 33efdea90..bda786c40 100644 --- a/typescript/packages/traceai_voltagent/src/index.ts +++ b/typescript/packages/traceai_voltagent/src/index.ts @@ -6,6 +6,7 @@ export { } from "./FIVoltAgentSpanProcessor"; export { mapVoltAgentAttributes, + mapSpanEvents, reconcileOperationUsage, resolveSpanKind, isContentKey, @@ -13,5 +14,6 @@ export { isSecretKey, type MapOptions, type MappedAttributes, + type SpanEventLike, } from "./mapping"; export { VoltAgentAttributes, FIAttributes, VoltAgentFIAttributes } from "./attributes"; diff --git a/typescript/packages/traceai_voltagent/src/mapping.ts b/typescript/packages/traceai_voltagent/src/mapping.ts index 16466ab25..a268c40c9 100644 --- a/typescript/packages/traceai_voltagent/src/mapping.ts +++ b/typescript/packages/traceai_voltagent/src/mapping.ts @@ -70,6 +70,13 @@ const CONTENT_EXACT = new Set([ "planagent.todos", "planagent.task.description", "planagent.task.response_preview", + // Span-event content: each streamed answer chunk an output guardrail sees + // (agent/streaming/output-guardrail-stream-runner.ts, guardrail.stream.process), and the + // workflow suspend/resume payloads (workflow/open-telemetry/trace-context.ts, + // workflow.suspended / workflow.resumed). Listed here so the value type does not matter. + "guardrail.chunk.text", + "suspension.data", + "resume.data", // Future AGI / GenAI content keys, in case an upstream span already carries them. "input.value", "output.value", @@ -112,6 +119,36 @@ export function isSecretKey(key: string): boolean { return key.split(".").some((segment) => SECRET_SEGMENT.test(segment)); } +/** The OpenTelemetry exception event keys (type, message, stacktrace, escaped). */ +const EXCEPTION_PREFIX = "exception."; + +/** A span event as `ReadableSpan.events` holds it. */ +export interface SpanEventLike { + name: string; + attributes?: Attributes; +} + +/** + * Filter span event attributes the way span attributes are filtered: credential keys are always + * removed, content keys are removed unless captureContent. `exception.*` keys are kept (exception + * events pass through). Event names, times and every other field are kept. Returns new event + * objects; the events of the span other processors hold are never mutated. + */ +export function mapSpanEvents(events: readonly T[] | undefined, options: MapOptions): T[] { + if (!events) return []; + return events.map((event) => { + if (!event.attributes) return { ...event }; + const attributes: Attributes = {}; + for (const [key, value] of Object.entries(event.attributes)) { + if (value === undefined) continue; + if (isSecretKey(key)) continue; + if (!key.startsWith(EXCEPTION_PREFIX) && !options.captureContent && isContentKey(key, value)) continue; + attributes[key] = value; + } + return { ...event, attributes }; + }); +} + const asString = (value: AttributeValue | undefined): string | undefined => typeof value === "string" && value.length > 0 ? value : undefined; const asNumber = (value: AttributeValue | undefined): number | undefined => From 970d2152cc43a96c21cece80f7f75d329a91e8ec Mon Sep 17 00:00:00 2001 From: Nikhil Pareek Date: Mon, 5 Oct 2026 01:10:18 -0700 Subject: [PATCH 06/18] fix(voltagent): roll up only llm spans 2.11.0 emits; document under-counts ROOT_ROLLED_UP_OPERATIONS listed generateObject and streamObject, and the README said reconciliation applies to such llm spans. @voltagent/core 2.11.0 opens an llm span only for generateText, streamText, generateTitle, a model-resolution failure and runInternalGenerateText (agent.ts createLLMSpan call sites); generateObject and streamObject (deprecated) record usage on the agent root only. Narrow the set to generateText and streamText, list the call sites in its comment, and fix the README sentence (M3). README Tokens gets a Limits list: the promoted total can under-count and never double-counts. - generateObject / streamObject: usage only as voltagent.usage.* on the agent span; the collector's token columns show 0 (M3). - Tool routing with a provider tool: executeProviderToolViaCallTool -> runInternalGenerateText opens a second successful llm:generateText span in the same operation, so nothing is reconciled and the main span keeps last-step usage; the internal call is counted once (N2). - A flush or timeout between an llm span's end and its root's end. Tests: - mapping: a generateObject/streamObject-labelled llm span is not reconciled; generateText/streamText still are (fails on the old set). - mapping: main call plus an internal provider-tool generateText span -> no reconciliation, trace total below root + internal (pins the documented under-count; passes before and after). - processor, real agent: generateObject exports no llm span, no promoted tokens, and voltagent.usage.* on the agent span (pins the README statement; passes before and after). Installed-review findings N2 and M3. approved: Nikhil 2026-10-03 blanket Refs: TH-8239 --- .../packages/traceai_voltagent/README.md | 28 +++++++++++++++---- .../src/__tests__/mapping.test.ts | 24 ++++++++++++++++ .../src/__tests__/processor.test.ts | 26 +++++++++++++++++ .../packages/traceai_voltagent/src/mapping.ts | 11 ++++++-- 4 files changed, 82 insertions(+), 7 deletions(-) diff --git a/typescript/packages/traceai_voltagent/README.md b/typescript/packages/traceai_voltagent/README.md index 4ec99ec15..d2ac58b0e 100644 --- a/typescript/packages/traceai_voltagent/README.md +++ b/typescript/packages/traceai_voltagent/README.md @@ -108,11 +108,29 @@ VoltAgent 2.11.0 wraps a whole multi-step AI SDK call (for example: tool call, t `llm:` span and records the AI SDK's `usage` on it, which is the **last step only**, while the agent span gets `totalUsage` across all steps. To keep the trace total equal to the tokens of every model step, the processor holds each llm span until its operation's root span ends. -When the operation has exactly one successful `generateText` / `streamText` / `generateObject` / -`streamObject` llm span and the root total is larger, the exported copy of that llm span carries -the root total (`voltagent.usage.reconciled = true`) and keeps the last-step values under -`voltagent.llm.last_step_usage.*`. Otherwise (several main calls, failed attempts, no root within -`usageReconciliationTimeoutMs`, or a flush in between), the llm span is exported as VoltAgent wrote it. +When the operation has exactly one successful `llm:generateText` or `llm:streamText` span and the +root total is larger, the exported copy of that llm span carries the root total +(`voltagent.usage.reconciled = true`) and keeps the last-step values under +`voltagent.llm.last_step_usage.*`. Otherwise (several main calls, no root within +`usageReconciliationTimeoutMs`, or a flush in between), the llm span is exported as VoltAgent wrote +it. Failed attempts (`ERROR` llm spans) are never reconciled. + +#### Limits + +A trace's promoted token total can be lower than what the model calls used. It is never counted +twice. + +- `generateObject` / `streamObject` (deprecated in 2.11.0) open no llm span. Their usage appears only + as `voltagent.usage.*` on the agent span, so the collector's token columns show 0 for them. +- Tool routing with a provider tool: VoltAgent runs the provider tool through an internal + `generateText` call (`executeProviderToolViaCallTool` → `runInternalGenerateText`), which opens a + second successful `llm:generateText` span in the same operation. With two main calls the + processor does not reconcile, so the main multi-step span keeps its last-step usage and the + earlier steps are missing from the total. The internal call's usage is on its own span, is not + part of the agent span's total, and is counted once. +- A flush between an llm span's end and its root's end (`forceFlush`, a serverless flush on finish, + another request's flush), or a root that does not end within `usageReconciliationTimeoutMs`, + releases the llm span unreconciled: it carries last-step usage only. ## Content diff --git a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts index 3c49c5d66..7c2e98996 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts @@ -372,6 +372,30 @@ describe("reconcileOperationUsage", () => { expect(reconcileOperationUsage(noUsage, [held()])).toBeUndefined(); }); + it("provider tool via tool routing: two main calls, no reconciliation, under-count never double count", () => { + // agent.ts executeProviderToolViaCallTool -> runInternalGenerateText opens a second successful + // llm:generateText span in the same operation. Its usage is not in the root total. + const main = held(); // last step: 13 input tokens; the root total for the main call is 24 + const internal = held({ "llm.usage.prompt_tokens": 6, "llm.usage.completion_tokens": 2, "llm.usage.total_tokens": 8 }); + expect(reconcileOperationUsage(rootSpanAttributes(), [main, internal])).toBeUndefined(); + const traceInput = [main, internal].reduce( + (sum, span) => sum + Number(span.attributes["gen_ai.usage.input_tokens"]), + 0, + ); + expect(traceInput).toBe(13 + 6); + expect(traceInput).toBeLessThan(24 + 6); // every model call's tokens: under-counted, not doubled + }); + + it("rolls up only the llm operations 2.11.0 emits for a main call (generateText, streamText)", () => { + for (const operation of ["generateText", "streamText"]) { + expect(reconcileOperationUsage(rootSpanAttributes(), [held({ "llm.operation": operation })])).toBeDefined(); + } + // generateObject / streamObject create no llm span in 2.11.0; their usage is only on the root. + for (const operation of ["generateObject", "streamObject"]) { + expect(reconcileOperationUsage(rootSpanAttributes(), [held({ "llm.operation": operation })])).toBeUndefined(); + } + }); + it("reconciles the one main call even when a title-generation call is present", () => { const main = held(); const title = held({ "llm.operation": "generateTitle", "llm.usage.prompt_tokens": 4 }); diff --git a/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts index 1d45c397f..34cf76c46 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts @@ -2,6 +2,7 @@ import { SpanKind, SpanStatusCode } from "@opentelemetry/api"; import { ExportResultCode } from "@opentelemetry/core"; import { InMemorySpanExporter, type ReadableSpan, type SpanExporter } from "@opentelemetry/sdk-trace-base"; import { Agent } from "@voltagent/core"; +import { z } from "zod"; import { FIVoltAgentSpanProcessor } from "../FIVoltAgentSpanProcessor"; import { isPromotedUsageKey } from "../mapping"; import { @@ -546,6 +547,31 @@ describe("span events from a real agent and workflow (M1)", () => { }); }); +describe("generateObject (README Tokens)", () => { + it("creates no llm span in 2.11.0: usage is only voltagent.usage.* on the agent span", async () => { + const { exporter, provider } = fiProvider(); + const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider }); + const recorder = new RecordingProcessor(); + const { model, reported } = scriptedModel("mockai/mock-model-1", [ + { kind: "text", text: '{"city":"Paris"}', input: 9, output: 4 }, + ]); + const agent = new Agent({ name: "assistant", instructions: "x", model }); + observability = voltagent({ assistant: agent }, [recorder, processor]); + const result = await agent.generateObject("hi", z.object({ city: z.string() })); + expect(result.object).toEqual({ city: "Paris" }); + await settle(recorder); + await processor.forceFlush(); + const spans = exporter.getFinishedSpans(); + expect(reported).toHaveLength(1); + expect(spans.filter((span) => span.name.startsWith("llm:"))).toHaveLength(0); + expect(spans.filter((span) => attrs(span)["fi.span.kind"] === "LLM")).toHaveLength(0); + expect(promotedInputTokens(spans)).toBe(0); + const root = attrs(one(spans, "assistant")); + expect(root["voltagent.usage.input_tokens"]).toBe(9); + expect(root["voltagent.usage.output_tokens"]).toBe(4); + }); +}); + describe("usage reconciliation window", () => { it("exports a held llm span unreconciled when its root never ends", async () => { const exporter = new InMemorySpanExporter(); diff --git a/typescript/packages/traceai_voltagent/src/mapping.ts b/typescript/packages/traceai_voltagent/src/mapping.ts index a268c40c9..59be369b5 100644 --- a/typescript/packages/traceai_voltagent/src/mapping.ts +++ b/typescript/packages/traceai_voltagent/src/mapping.ts @@ -368,8 +368,15 @@ function looksLikeJson(value: string): boolean { return trimmed.startsWith("{") || trimmed.startsWith("["); } -/** llm.operation values whose usage VoltAgent also rolls up onto the operation root. */ -const ROOT_ROLLED_UP_OPERATIONS = new Set(["generateText", "streamText", "generateObject", "streamObject"]); +/** + * llm.operation values of the main model call, whose usage VoltAgent also rolls up onto the + * operation root. In 2.11.0 the agent opens an llm span (createLLMSpan) only for generateText, + * streamText, generateTitle (conversation title; not rolled up), a model-resolution failure (ERROR) + * and runInternalGenerateText (a provider tool run through tool routing; also `generateText`). + * generateObject / streamObject open no llm span: their usage is only on the root, where it is + * exported as `voltagent.usage.*`. + */ +const ROOT_ROLLED_UP_OPERATIONS = new Set(["generateText", "streamText"]); /** * VoltAgent 2.11.0 wraps a whole multi-step AI SDK call in one `llm:` span and records From b58eef258bc366bf15ac2c3805634895d10eaad9 Mon Sep 17 00:00:00 2001 From: Nikhil Pareek Date: Mon, 5 Oct 2026 01:10:59 -0700 Subject: [PATCH 07/18] docs(voltagent): say which Node versions ran which tests The README listed Node 20.20.2, 22.23.3 and 26.8.1 as tested, and the contract module said TRACEAI_NODE_MATRIX runs every journey. It parametrizes only the tests that take a `node` argument: the tool journey, the span-event journey and the ESM/CJS import check. jest and the other contract tests (content opt-in, subagent, burst, collector down, packed tarball) run on NODE_BINARY / the PATH node, 26.8.1 here. State that in the Tested versions table, the Development command and the contract module docstring. Also update "Not covered": the tests now run one workflow that suspends and resumes (span events, CHAIN kind on the root); step spans are still not asserted. approved: Nikhil 2026-10-03 blanket Refs: TH-8239 --- typescript/packages/traceai_voltagent/README.md | 9 ++++++--- .../traceai_voltagent/contract/test_harness_contract.py | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/typescript/packages/traceai_voltagent/README.md b/typescript/packages/traceai_voltagent/README.md index d2ac58b0e..5cc02b97d 100644 --- a/typescript/packages/traceai_voltagent/README.md +++ b/typescript/packages/traceai_voltagent/README.md @@ -189,7 +189,7 @@ from span attributes and from event attributes. | `@voltagent/core` | 2.11.0 (npm `latest` on 2026-10-04) | | `ai` (mock model, `ai/test` `MockLanguageModelV3`) | 6.0.97 | | `@traceai/fi-core` exporter | workspace (OpenTelemetry SDK 2.0.1, OTLP HTTP exporter 0.202.0) | -| Node.js | 20.20.2, 22.23.3, 26.8.1 | +| Node.js | 26.8.1: jest and every contract test. 20.20.2 and 22.23.3 as well: the contract tool journey, span-event journey and ESM/CJS entry-point check (the tests `TRACEAI_NODE_MATRIX` parametrizes) | `@voltagent/core` 2.11.0 is MIT-licensed (`license` in its `package.json`; the published tarball has no LICENSE file, its README and `docs/community/licence.md` carry the MIT text, "Copyright (c) @@ -197,7 +197,8 @@ has no LICENSE file, its README and `docs/community/licence.md` carry the MIT te ## Not covered -- Workflows (`entity.type=workflow`) map to `CHAIN`; they were not exercised by the fixture. +- Workflows (`entity.type=workflow`) map to `CHAIN`. The tests run one workflow that suspends and + resumes, to check its span events and the root's kind; workflow step spans are not asserted. - Retriever, embedding and vector spans are mapped from source reading; the fixture runs only the agent's memory spans (`memory.read`, `memory.write`, `memory.steps.write`). - VoltAgent logs (`RemoteLogProcessor`) and evals are not exported. @@ -208,7 +209,9 @@ has no LICENSE file, its README and `docs/community/licence.md` carry the MIT te ```bash pnpm --filter @traceai/voltagent run build pnpm --filter @traceai/voltagent test -# Shared-harness contract test (from the repo root): +# Shared-harness contract test (from the repo root). Every test runs on NODE_BINARY (default: node +# on PATH); with TRACEAI_NODE_MATRIX=/path/node20:/path/node22:..., the tool journey, the span-event +# journey and the ESM/CJS import check run on each listed binary instead. PYTHONPATH="python/tests" uv run --no-project --python 3.11 --with pytest --with protobuf \ --with opentelemetry-proto pytest typescript/packages/traceai_voltagent/contract -q \ -p no:cacheprovider --noconftest -o addopts='' diff --git a/typescript/packages/traceai_voltagent/contract/test_harness_contract.py b/typescript/packages/traceai_voltagent/contract/test_harness_contract.py index da9edf4b0..741ab91e8 100644 --- a/typescript/packages/traceai_voltagent/contract/test_harness_contract.py +++ b/typescript/packages/traceai_voltagent/contract/test_harness_contract.py @@ -13,8 +13,10 @@ pytest typescript/packages/traceai_voltagent/contract -q -p no:cacheprovider \ --noconftest -o addopts='' -Set TRACEAI_NODE_MATRIX=/path/to/node20:/path/to/node22 to run every journey on -several Node binaries. +NODE_BINARY (default: node on PATH) runs every test. Set +TRACEAI_NODE_MATRIX=/path/to/node20:/path/to/node22 to run the tests parametrized +over `node` (tool journey, span-event journey, ESM/CJS import check) on each of +those binaries instead; the other tests still use NODE_BINARY. """ from __future__ import annotations From ff4d553c7589b96c68c64187d0344e51994e1fe3 Mon Sep 17 00:00:00 2001 From: Nikhil Pareek Date: Mon, 5 Oct 2026 02:01:08 -0700 Subject: [PATCH 08/18] fix(voltagent): drop eval scorer metadata, eval.expected and guardrail decision metadata by default verify-r2 (t_cee7d90e) V1, P2/AC-07: VoltAgent 2.11.0 finalizeScorerSpan stores combineEvalMetadata(...) under eval.scorer.metadata, which holds the run's verbatim input and output; it was exported with captureContent off. eval.expected (the reference answer) and guardrail.result.metadata (a guardrail decision's payload) are content of the same kind. All three are now dropped unless captureContent; eval.input / eval.output already were. Decision (approved: Nikhil 2026-10-03 blanket): guardrail.message and the guardrail.stream.abort guardrail.reason stay. Built-in guardrails write fixed messages; a custom guardrail's message is exported as written (documented), as are suspension/cancellation reasons and workspace.fs path/pattern/cwd. README: evals ARE exported (was "not exported"); key-based secret filter note for JSON values such as llm.provider_options. RED before the fix: 2 failed / 37 passed in mapping.test.ts (new eval and guardrail test, key classification). GREEN: jest 58 passed, contract 14. approved: Nikhil 2026-10-03 blanket Refs: TH-8239 --- .../packages/traceai_voltagent/README.md | 19 +++++++--- .../src/__tests__/mapping.test.ts | 35 +++++++++++++++++++ .../packages/traceai_voltagent/src/mapping.ts | 8 +++++ 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/typescript/packages/traceai_voltagent/README.md b/typescript/packages/traceai_voltagent/README.md index 5cc02b97d..8b700dc0f 100644 --- a/typescript/packages/traceai_voltagent/README.md +++ b/typescript/packages/traceai_voltagent/README.md @@ -144,8 +144,9 @@ Dropped keys: `input`, `output`, `agent.instructions`, `agent.messages`, `agent. `workflow.stateSnapshot` (step source and the run input), `workspace.sandbox.command`, `workspace.sandbox.args`, `suspension.checkpoint`, `agent.summary.preview`, `agent.summary.text` (summarization), `agent.workingMemory.finalContent` (working memory), `planagent.todos`, -`planagent.task.description`, `planagent.task.response_preview` (PlanAgent), -`guardrail.chunk.text`, `suspension.data`, `resume.data` (span events, below), any key with an +`planagent.task.description`, `planagent.task.response_preview` (PlanAgent), `eval.scorer.metadata` +(evals: holds the run's input and output), `eval.expected` (the eval's reference answer), `guardrail.result.metadata` (a guardrail decision's +payload), `guardrail.chunk.text`, `suspension.data`, `resume.data` (span events, below), any key with an `input` or `output` segment (`middleware.input.original`, `guardrail.output.after`, ...), and string values whose last segment is `messages`, `instructions`, `query`, `context`, `data`, `checkpoint`, `prompt(s)`, `completion`, `content`, `arguments` or `args` (`tool.search.query`, `vector.query`, @@ -162,7 +163,15 @@ the thrown error carries. Credentials are never exported, whatever `captureContent` says: keys with a segment like `api_key`, `secret`, `secret_key`, `password`, `authorization`, `cookie` or `header(s)` are dropped, -from span attributes and from event attributes. +from span attributes and from event attributes. The filter is by key: a JSON value such as +`llm.provider_options` is exported whole, so do not put credentials in provider options. + +Kept in every mode, because they are short strings your code or VoltAgent writes rather than +prompt or answer text: `guardrail.message` and the `guardrail.stream.abort` event's +`guardrail.reason` (the built-in guardrails write fixed messages such as "Output blocked due to +profanity."; a custom guardrail's message is exported as written), `suspension.reason`, +`cancellation.reason`, workflow step reasons, and the workspace tool fields `workspace.fs.path`, +`workspace.fs.pattern` and `workspace.sandbox.cwd`, which can carry model-chosen paths. ## Flushing, serverless and failures @@ -201,7 +210,9 @@ has no LICENSE file, its README and `docs/community/licence.md` carry the MIT te resumes, to check its span events and the root's kind; workflow step spans are not asserted. - Retriever, embedding and vector spans are mapped from source reading; the fixture runs only the agent's memory spans (`memory.read`, `memory.write`, `memory.steps.write`). -- VoltAgent logs (`RemoteLogProcessor`) and evals are not exported. +- VoltAgent logs (`RemoteLogProcessor`) are not exported. Eval scorer spans are exported with + their ids, status, score and threshold; `eval.scorer.metadata`, `eval.expected`, `eval.input` and + `eval.output` are dropped unless `captureContent` is on. `eval.scorer.error_message` is kept. - Only the Node runtime was tested; edge runtimes were not. ## Development diff --git a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts index 7c2e98996..3237ef725 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts @@ -280,6 +280,36 @@ describe("content (AC-07)", () => { } }); + it("drops eval scorer metadata and guardrail decision metadata by default and keeps them after opt-in", () => { + // VoltAgent 2.11.0: finalizeScorerSpan stores combineEvalMetadata(...) under eval.scorer.metadata, + // and that object holds the run's verbatim input and output; eval.expected is the reference + // answer. A guardrail decision's metadata + // (guardrail.result.metadata) is whatever the guardrail returns, often the matched text. + const evalAndGuardrail = { + "eval.scorer.metadata": '{"input":"SECRET_EVAL_INPUT","output":"SECRET_EVAL_OUTPUT"}', + "eval.expected": "SECRET_EVAL_EXPECTED", + "guardrail.result.metadata": '{"matched":"SECRET_GUARDRAIL_MATCH"}', + }; + const kept = { + "eval.scorer.id": "scorer-1", + "eval.scorer.status": "success", + "guardrail.name": "pii", + "guardrail.action": "block", + "guardrail.message": "Output blocked due to profanity.", + "guardrail.metadata": '{"owner":"team-a"}', + }; + const off = mapVoltAgentAttributes({ "span.type": "scorer", ...evalAndGuardrail, ...kept }, OFF).attributes; + const on = mapVoltAgentAttributes({ "span.type": "scorer", ...evalAndGuardrail, ...kept }, ON).attributes; + expect(JSON.stringify(off)).not.toContain("SECRET"); + for (const [key, value] of Object.entries(evalAndGuardrail)) { + expect([key, off[key]]).toEqual([key, undefined]); + expect([key, on[key]]).toEqual([key, value]); + } + for (const [key, value] of Object.entries(kept)) { + expect([key, off[key]]).toEqual([key, value]); + } + }); + it("copies input/output to input.value/output.value only after opt-in", () => { const { attributes } = mapVoltAgentAttributes(rootSpanAttributes(), ON); expect(attributes["input.value"]).toBe("SECRET_PROMPT"); @@ -312,6 +342,11 @@ describe("content (AC-07)", () => { expect(isContentKey("guardrail.chunk.index", 4)).toBe(false); expect(isContentKey("suspension.step_index", 0)).toBe(false); expect(isContentKey("exception.message", "boom")).toBe(false); + expect(isContentKey("eval.scorer.metadata", "{}")).toBe(true); + expect(isContentKey("eval.expected", "x")).toBe(true); + expect(isContentKey("guardrail.result.metadata", "{}")).toBe(true); + expect(isContentKey("guardrail.metadata", "{}")).toBe(false); + expect(isContentKey("guardrail.message", "x")).toBe(false); }); }); diff --git a/typescript/packages/traceai_voltagent/src/mapping.ts b/typescript/packages/traceai_voltagent/src/mapping.ts index 59be369b5..461db9ecc 100644 --- a/typescript/packages/traceai_voltagent/src/mapping.ts +++ b/typescript/packages/traceai_voltagent/src/mapping.ts @@ -70,6 +70,14 @@ const CONTENT_EXACT = new Set([ "planagent.todos", "planagent.task.description", "planagent.task.response_preview", + // Evals: finalizeScorerSpan (eval.ts) stores combineEvalMetadata(...) here, which holds the run's + // verbatim input and output. eval.input / eval.output are caught by the segment rule below. + "eval.scorer.metadata", + // The eval's reference answer (eval.ts scorer attributes). + "eval.expected", + // A guardrail decision's metadata: whatever the guardrail returns, often the matched text. + // (guardrail.metadata is the guardrail's own static config and stays.) + "guardrail.result.metadata", // Span-event content: each streamed answer chunk an output guardrail sees // (agent/streaming/output-guardrail-stream-runner.ts, guardrail.stream.process), and the // workflow suspend/resume payloads (workflow/open-telemetry/trace-context.ts, From 70dc0c1bd9a5f195e316df7e3a90b83798876d01 Mon Sep 17 00:00:00 2001 From: Nikhil Pareek Date: Sun, 11 Oct 2026 19:58:50 -0700 Subject: [PATCH 09/18] fix(voltagent): give llm spans input and output when captureContent is on VoltAgent 2.11.0 writes no `input` / `output` on llm spans: the prompt is only in `llm.messages` (agent.ts buildLLMSpanAttributes), and the response text is never recorded on the llm span (createLLMSpanFinalizer sets usage, finish reason and status only). fi-collector fills a span's input/output columns from input.value / output.value only, so with captureContent: true every LLM span in Observe showed no input or output (live run against claude-haiku-5-5: llm:generateText in=0B out=0B while the agent and tool spans had content). With captureContent on: - llm spans use `llm.messages` as input.value (application/json); - when the operation has exactly one successful llm:generateText / llm:streamText span (the same rule usage reconciliation uses), that span gets the agent span's `output` as output.value. Content off is unchanged. Live re-run: llm:generateText in=201B out=47B, llm:streamText in=220B out=17B; content-off run still exports no prompt, answer, instructions or tool text. Co-Authored-By: Claude Opus 5.5 --- .../packages/traceai_voltagent/README.md | 7 +-- .../src/FIVoltAgentSpanProcessor.ts | 9 +++- .../src/__tests__/mapping.test.ts | 20 ++++++++ .../src/__tests__/processor.test.ts | 12 +++++ .../traceai_voltagent/src/attributes.ts | 2 + .../packages/traceai_voltagent/src/index.ts | 1 + .../packages/traceai_voltagent/src/mapping.ts | 47 +++++++++++++++---- 7 files changed, 84 insertions(+), 14 deletions(-) diff --git a/typescript/packages/traceai_voltagent/README.md b/typescript/packages/traceai_voltagent/README.md index 8b700dc0f..df25fa602 100644 --- a/typescript/packages/traceai_voltagent/README.md +++ b/typescript/packages/traceai_voltagent/README.md @@ -10,8 +10,9 @@ It plugs into VoltAgent's own `ObservabilityConfig.spanProcessors`. It does not it does not change the span VoltAgent hands to its other processors (VoltOps, local storage, websocket): it exports a mapped copy. -Status: alpha. Fixture-validated against `@voltagent/core` 2.11.0 with the AI SDK mock model; no -live model provider was called. +Status: alpha. Fixture-validated against `@voltagent/core` 2.11.0 with the AI SDK mock model, and +run end to end with a live model (an OpenAI-compatible endpoint through +`@ai-sdk/openai-compatible`) into a local Future AGI collector. ## Install @@ -92,7 +93,7 @@ promoted token keys on spans that are not model calls (moved under `voltagent.`) | `voltagent.usage.input_tokens`, `.output_tokens`, `.total_tokens`, `.cache_read_tokens`, `.reasoning_tokens` | `usage.prompt_tokens`, ... on the agent span | the operation total; namespaced so it is not counted twice | | `gen_ai.tool.name`, `gen_ai.tool.call.id`, `gen_ai.tool.description` | `tool.name`, `tool.call.id`, `tool.description` | | | status, `exception` events, `error.*` | passed through | a failing tool is an `ERROR` span; `exception` events keep `exception.type`, `.message` and `.stacktrace`. Other event attributes are filtered like span attributes (see Content) | -| `input.value`, `output.value` | `input`, `output` (`vector.query` / `embedding.query` as retriever input) | **only with `captureContent: true`** | +| `input.value`, `output.value` | `input`, `output` (`vector.query` / `embedding.query` as retriever input). llm spans: `llm.messages` (the last 10 messages VoltAgent sent) as input; as output, the agent span's `output` when the operation has exactly one successful `llm:generateText` / `llm:streamText` span (VoltAgent records no response text on llm spans) | **only with `captureContent: true`** | | cost | not mapped | VoltAgent sets `usage.cost` only from OpenRouter provider metadata; it is passed through unchanged and not promoted | ### Tokens diff --git a/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts b/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts index 6467bc4f7..6b620a3b9 100644 --- a/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts +++ b/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts @@ -8,7 +8,7 @@ import { type SpanExporter, type SpanProcessor, } from "@opentelemetry/sdk-trace-base"; -import { mapSpanEvents, mapVoltAgentAttributes, reconcileOperationUsage } from "./mapping"; +import { copyOperationOutput, mapSpanEvents, mapVoltAgentAttributes, reconcileOperationUsage } from "./mapping"; type Resource = ReadableSpan["resource"]; type SpanEvents = ReadableSpan["events"]; @@ -135,6 +135,13 @@ export class FIVoltAgentSpanProcessor implements SpanProcessor { } catch (error) { diag.warn("@traceai/voltagent: usage reconciliation failed", error); } + if (this.captureContent) { + try { + copyOperationOutput(source, operation.spans); + } catch (error) { + diag.warn("@traceai/voltagent: copying the operation output failed", error); + } + } for (const held of operation.spans) this.forward(held.original, held.attributes, held.events); } } diff --git a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts index 3237ef725..b54afe180 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts @@ -319,6 +319,26 @@ describe("content (AC-07)", () => { expect(attributes["agent.instructions"]).toBe("SECRET_INSTRUCTIONS"); }); + it("uses llm.messages as the llm span's input only after opt-in", () => { + // VoltAgent 2.11.0 writes the prompt on llm spans only as llm.messages (agent.ts + // buildLLMSpanAttributes), and fi-collector fills a span's input column only from input.value. + const llm = { + "span.type": "llm", + "llm.model": "m", + "llm.messages": '[{"role":"user","content":"SECRET_PROMPT"}]', + "llm.messages.count": 1, + }; + const off = mapVoltAgentAttributes(llm, OFF).attributes; + expect(off["input.value"]).toBeUndefined(); + expect(off["llm.messages"]).toBeUndefined(); + const on = mapVoltAgentAttributes(llm, ON).attributes; + expect(on["input.value"]).toBe(llm["llm.messages"]); + expect(on["input.mime_type"]).toBe("application/json"); + // Not on other span kinds. + const agent = mapVoltAgentAttributes({ "entity.type": "agent", "llm.messages": "[]" }, ON).attributes; + expect(agent["input.value"]).toBeUndefined(); + }); + it("uses the vector/embedding query as retriever input only after opt-in", () => { const off = mapVoltAgentAttributes({ "span.type": "vector", "vector.query": "find cats" }, OFF); expect(off.attributes["input.value"]).toBeUndefined(); diff --git a/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts index 34cf76c46..4312c06ab 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts @@ -145,6 +145,18 @@ describe("FIVoltAgentSpanProcessor with a real VoltAgent agent (AC-01)", () => { const weather = attrs(one(exported, "tool.execution:get_weather")); expect(String(weather["input.value"])).toContain(MARKERS.toolArg); expect(String(weather["output.value"])).toContain(MARKERS.toolResult); + // The llm span: its prompt (llm.messages) and, with one main model call, the operation's answer. + const llm = attrs(one(exported, "llm:generateText")); + expect(String(llm["input.value"])).toContain(MARKERS.prompt); + expect(llm["input.mime_type"]).toBe("application/json"); + expect(llm["output.value"]).toBe(MARKERS.answer); + }); + + it("leaves the llm span's output empty when content is off", async () => { + const { exported } = await runToolCallingAgent(); + const llm = attrs(one(exported, "llm:generateText")); + expect(llm["input.value"]).toBeUndefined(); + expect(llm["output.value"]).toBeUndefined(); }); }); diff --git a/typescript/packages/traceai_voltagent/src/attributes.ts b/typescript/packages/traceai_voltagent/src/attributes.ts index a26703136..0b8ceb492 100644 --- a/typescript/packages/traceai_voltagent/src/attributes.ts +++ b/typescript/packages/traceai_voltagent/src/attributes.ts @@ -39,6 +39,8 @@ export const VoltAgentAttributes = { LLM_MAX_OUTPUT_TOKENS: "llm.max_output_tokens", LLM_TOP_P: "llm.top_p", LLM_FINISH_REASON: "llm.finish_reason", + /** The last 10 messages sent to the model, JSON (role + content). The llm span's only prompt key. */ + LLM_MESSAGES: "llm.messages", LLM_MODEL_RESOLUTION_FAILED: "llm.model_resolution_failed", LLM_USAGE_PROMPT_TOKENS: "llm.usage.prompt_tokens", LLM_USAGE_COMPLETION_TOKENS: "llm.usage.completion_tokens", diff --git a/typescript/packages/traceai_voltagent/src/index.ts b/typescript/packages/traceai_voltagent/src/index.ts index bda786c40..c47d840cc 100644 --- a/typescript/packages/traceai_voltagent/src/index.ts +++ b/typescript/packages/traceai_voltagent/src/index.ts @@ -8,6 +8,7 @@ export { mapVoltAgentAttributes, mapSpanEvents, reconcileOperationUsage, + copyOperationOutput, resolveSpanKind, isContentKey, isPromotedUsageKey, diff --git a/typescript/packages/traceai_voltagent/src/mapping.ts b/typescript/packages/traceai_voltagent/src/mapping.ts index 461db9ecc..39cc06111 100644 --- a/typescript/packages/traceai_voltagent/src/mapping.ts +++ b/typescript/packages/traceai_voltagent/src/mapping.ts @@ -353,10 +353,13 @@ export function mapVoltAgentAttributes(source: Attributes, options: MapOptions): // Content, only after opt-in. if (options.captureContent) { + // VoltAgent writes no `input` on llm spans; their prompt is only in `llm.messages`, and + // fi-collector fills a span's input column from input.value only. const input = asString(source[VA.INPUT]) ?? asString(source[VA.VECTOR_QUERY]) ?? - asString(source[VA.EMBEDDING_QUERY]); + asString(source[VA.EMBEDDING_QUERY]) ?? + (isModelCall ? asString(source[VA.LLM_MESSAGES]) : undefined); if (input !== undefined && out[FIAttributes.INPUT_VALUE] === undefined) { out[FIAttributes.INPUT_VALUE] = input; setIfAbsent(out, FIAttributes.INPUT_MIME_TYPE, looksLikeJson(input) ? "application/json" : "text/plain"); @@ -386,6 +389,37 @@ function looksLikeJson(value: string): boolean { */ const ROOT_ROLLED_UP_OPERATIONS = new Set(["generateText", "streamText"]); +/** The one successful main-call llm span of an operation, or undefined when there are none or several. */ +function soleMainCall(llmSpans: T[]): T | undefined { + const candidates = llmSpans.filter( + (span) => + !span.isError && + span.source[VA.LLM_MODEL_RESOLUTION_FAILED] !== true && + ROOT_ROLLED_UP_OPERATIONS.has(String(span.source[VA.LLM_OPERATION])), + ); + return candidates.length === 1 ? candidates[0] : undefined; +} + +/** + * VoltAgent 2.11.0 records no response text on llm spans (agent.ts createLLMSpanFinalizer sets + * usage, finish reason and status only). With exactly one successful main-call llm span, that + * span's final answer is the operation's `output` on the root span, so the exported copy of the + * llm span gets it as output.value. Call only when content capture is on. Returns the updated + * span attributes, if any. + */ +export function copyOperationOutput( + rootSource: Attributes, + llmSpans: Array<{ source: Attributes; attributes: Attributes; isError: boolean }>, +): Attributes | undefined { + const output = asString(rootSource[VA.OUTPUT]); + if (output === undefined) return undefined; + const target = soleMainCall(llmSpans); + if (!target || target.attributes[FIAttributes.OUTPUT_VALUE] !== undefined) return undefined; + target.attributes[FIAttributes.OUTPUT_VALUE] = output; + target.attributes[FIAttributes.OUTPUT_MIME_TYPE] = looksLikeJson(output) ? "application/json" : "text/plain"; + return target.attributes; +} + /** * VoltAgent 2.11.0 wraps a whole multi-step AI SDK call in one `llm:` span and records * `response.usage` on it, which is the LAST step only (agent.ts finalizeLLMSpan), while the @@ -403,15 +437,8 @@ export function reconcileOperationUsage( const rootUsage = readRootUsage(rootSource); if (rootUsage.input === undefined && rootUsage.output === undefined) return undefined; - const candidates = llmSpans.filter( - (span) => - !span.isError && - span.source[VA.LLM_MODEL_RESOLUTION_FAILED] !== true && - ROOT_ROLLED_UP_OPERATIONS.has(String(span.source[VA.LLM_OPERATION])), - ); - if (candidates.length !== 1) return undefined; - - const target = candidates[0]; + const target = soleMainCall(llmSpans); + if (!target) return undefined; const stepUsage = readLLMSpanUsage(target.source); const grows = (total?: number, step?: number) => total !== undefined && (step === undefined || total > step); if (!grows(rootUsage.input, stepUsage.input) && !grows(rootUsage.output, stepUsage.output)) { From 0420c883fc94254f61facb5e21b70aa8c3b99d64 Mon Sep 17 00:00:00 2001 From: Nikhil Pareek Date: Sun, 11 Oct 2026 20:30:18 -0700 Subject: [PATCH 10/18] fix(voltagent): set gen_ai.provider.name from the agent's AI SDK model object VoltAgent records only `modelId` for an AI SDK model object (agent.ts getModelName) and sets llm.provider only from "provider/model" strings, so agents built with openai("..."), anthropic("..."), google("...") etc. exported no provider. When VoltAgent set none, the processor now looks the agent up by the span's entity.id in VoltAgent's agent registry (the AgentRegistry singleton on globalThis.___voltagent_agent_registry, filled by new VoltAgent({ agents })), finds the model object (including fallback lists) whose modelId matches the span, and maps its provider id: openai.* -> openai, anthropic.* -> anthropic, google.generative-ai -> google, google.vertex.* / vertex.* -> vertexai, azure.* -> azure, amazon-bedrock -> aws, mistral.* -> mistralai, groq, xai, deepseek, cohere, cerebras, togetherai -> together, fireworks, ollama, huggingface. Unknown ids (an OpenAI-compatible provider's own name, the gateway) stay unset. VoltAgent's own llm.provider still wins. Live: @ai-sdk/anthropic (claude-haiku-4-5-20251001 via CLIProxy) -> provider anthropic, cost 0.001729; @ai-sdk/google (gemini-3.5-flash) -> provider google, cost 0.0012585 in ClickHouse and the Observe UI. Co-Authored-By: Claude Opus 5.5 --- .../packages/traceai_voltagent/README.md | 2 +- .../src/FIVoltAgentSpanProcessor.ts | 19 +++++++++ .../src/__tests__/helpers.ts | 4 +- .../src/__tests__/mapping.test.ts | 30 ++++++++++++++ .../src/__tests__/processor.test.ts | 35 ++++++++++++++++ .../traceai_voltagent/src/agentModels.ts | 40 +++++++++++++++++++ .../packages/traceai_voltagent/src/index.ts | 2 + .../packages/traceai_voltagent/src/mapping.ts | 34 ++++++++++++++++ 8 files changed, 163 insertions(+), 3 deletions(-) create mode 100644 typescript/packages/traceai_voltagent/src/agentModels.ts diff --git a/typescript/packages/traceai_voltagent/README.md b/typescript/packages/traceai_voltagent/README.md index df25fa602..be9b053a3 100644 --- a/typescript/packages/traceai_voltagent/README.md +++ b/typescript/packages/traceai_voltagent/README.md @@ -84,7 +84,7 @@ promoted token keys on spans that are not model calls (moved under `voltagent.`) | `session.id`, `gen_ai.conversation.id` | `conversation.id` | not overwritten if already set | | `user.id` | `user.id` | already the Future AGI key | | `gen_ai.request.model`, `gen_ai.response.model` | `llm.model` (llm spans), `ai.model.name` (agent span) | the model name VoltAgent resolved | -| `gen_ai.provider.name` | `llm.provider`, `ai.model.provider` | VoltAgent parses it from the model string (text before `/`); it is not a vendor id | +| `gen_ai.provider.name` | `llm.provider`, `ai.model.provider`; else the agent's AI SDK model object's `provider` | VoltAgent parses `llm.provider` from a model string (text before `/`); it is not a vendor id. For a model object VoltAgent records only `modelId`, so the processor looks the agent up by `entity.id` in VoltAgent's agent registry (filled by `new VoltAgent({ agents })`) and maps the object's `provider` id: `openai.*` → `openai`, `anthropic.*` → `anthropic`, `google.generative-ai` → `google`, `google.vertex.*` / `vertex.*` → `vertexai`, `azure.*` → `azure`, `amazon-bedrock` → `aws`, `mistral.*` → `mistralai`, and `groq`, `xai`, `deepseek`, `cohere`, `cerebras`, `togetherai` (→ `together`), `fireworks`, `ollama`, `huggingface`. Other ids (an OpenAI-compatible provider's own name, the AI Gateway) stay unset. Future AGI prices a call from `gen_ai.request.model` and its tokens, not from the provider | | `gen_ai.request.temperature`, `.max_tokens`, `.top_p` | `llm.temperature`, `llm.max_output_tokens`, `llm.top_p`, `ai.model.*` | | | `gen_ai.response.finish_reasons` | `llm.finish_reason`, `ai.response.finish_reason` | | | `gen_ai.usage.input_tokens`, `.output_tokens`, `.total_tokens` | `llm.usage.prompt_tokens`, `.completion_tokens`, `.total_tokens` | **llm spans only** (see Tokens) | diff --git a/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts b/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts index 6b620a3b9..55ab86103 100644 --- a/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts +++ b/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts @@ -8,6 +8,8 @@ import { type SpanExporter, type SpanProcessor, } from "@opentelemetry/sdk-trace-base"; +import { providerForAgentModel } from "./agentModels"; +import { FIAttributes, VoltAgentAttributes as VA } from "./attributes"; import { copyOperationOutput, mapSpanEvents, mapVoltAgentAttributes, reconcileOperationUsage } from "./mapping"; type Resource = ReadableSpan["resource"]; @@ -113,6 +115,9 @@ export class FIVoltAgentSpanProcessor implements SpanProcessor { const source = span.attributes ?? {}; const options = { captureContent: this.captureContent }; const mapped = mapVoltAgentAttributes(source, options); + if (mapped.isModelCall || mapped.isOperationRoot) { + setProviderFromModelObject(source, mapped.attributes, mapped.isModelCall); + } // Event attributes carry content too (guardrail stream chunks, workflow suspend/resume data). const events = mapSpanEvents(span.events, options); @@ -216,6 +221,20 @@ export class FIVoltAgentSpanProcessor implements SpanProcessor { } } +/** Fill gen_ai.provider.name from the agent's AI SDK model object when VoltAgent set none. */ +function setProviderFromModelObject(source: Attributes, attributes: Attributes, isModelCall: boolean): void { + if (attributes[FIAttributes.GEN_AI_PROVIDER_NAME] !== undefined) return; + const agentId = source[VA.ENTITY_ID]; + if (typeof agentId !== "string" || agentId.length === 0) return; + const modelKey = isModelCall ? source[VA.LLM_MODEL] : source[VA.AI_MODEL_NAME]; + try { + const provider = providerForAgentModel(agentId, typeof modelKey === "string" ? modelKey : undefined); + if (provider !== undefined) attributes[FIAttributes.GEN_AI_PROVIDER_NAME] = provider; + } catch (error) { + diag.debug("@traceai/voltagent: provider lookup failed", error); + } +} + /** * A ReadableSpan with new attributes, resource and (optionally) events; every other field reads * through. Pass events filtered with `mapSpanEvents`, or the original events are copied as-is. diff --git a/typescript/packages/traceai_voltagent/src/__tests__/helpers.ts b/typescript/packages/traceai_voltagent/src/__tests__/helpers.ts index 621bbb499..5b35bd94e 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/helpers.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/helpers.ts @@ -41,7 +41,7 @@ export type Step = * An AI SDK V3 mock model that plays `steps` in order (generate or stream) and records the * usage it reported. VoltAgent subagents call streamText, so both paths are scripted. */ -export function scriptedModel(modelId: string, steps: Step[]) { +export function scriptedModel(modelId: string, steps: Step[], provider = "mock-provider") { const reported: Array<{ input: number; output: number }> = []; let index = 0; const next = () => { @@ -56,7 +56,7 @@ export function scriptedModel(modelId: string, steps: Step[]) { return { step, usage }; }; const model = new MockLanguageModelV3({ - provider: "mock-provider", + provider, modelId, doStream: async () => { const { step, usage } = next(); diff --git a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts index b54afe180..32deb14c8 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts @@ -1,3 +1,4 @@ +import { providerFromAiSdk } from "../mapping"; import { FISpanKind } from "@traceai/fi-semantic-conventions"; import { isContentKey, @@ -458,3 +459,32 @@ describe("reconcileOperationUsage", () => { expect(title.attributes["gen_ai.usage.input_tokens"]).toBe(4); }); }); + +describe("provider from an AI SDK model object's provider id", () => { + it.each([ + ["openai.chat", "openai"], + ["openai.responses", "openai"], + ["anthropic.messages", "anthropic"], + ["google.generative-ai", "google"], + ["google.vertex.chat", "vertexai"], + ["vertex.anthropic.messages", "vertexai"], + ["azure.chat", "azure"], + ["amazon-bedrock", "aws"], + ["mistral.chat", "mistralai"], + ["groq.chat", "groq"], + ["xai.chat", "xai"], + ["deepseek.chat", "deepseek"], + ["cohere.chat", "cohere"], + ["cerebras.chat", "cerebras"], + ["togetherai.chat", "together"], + ])("%s -> %s", (id, provider) => { + expect(providerFromAiSdk(id)).toBe(provider); + }); + + it.each(["cliproxy.chat", "openai-compatible", "gateway", "mock-provider", "", " "])( + "leaves %j unset rather than guessing", + (id) => { + expect(providerFromAiSdk(id)).toBeUndefined(); + }, + ); +}); diff --git a/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts index 4312c06ab..2e667ffab 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts @@ -160,6 +160,41 @@ describe("FIVoltAgentSpanProcessor with a real VoltAgent agent (AC-01)", () => { }); }); +describe("provider from the agent's AI SDK model object", () => { + async function runWith(modelId: string, providerId: string) { + const { exporter, provider } = fiProvider(); + const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider }); + const { model } = scriptedModel(modelId, [{ kind: "text", text: "ok", input: 4, output: 2 }], providerId); + const agent = new Agent({ name: "priced", instructions: "x", model }); + observability = voltagent({ priced: agent }, [processor]); + await agent.generateText("hi", { conversationId: "conv-provider" }); + await new Promise((resolve) => setTimeout(resolve, 50)); + await processor.forceFlush(); + const spans = exporter.getFinishedSpans(); + return { llm: attrs(one(spans, "llm:generateText")), root: attrs(one(spans, "priced")) }; + } + + it("sets gen_ai.provider.name from model.provider when the model id names no provider", async () => { + // VoltAgent records only modelId for a model object, so llm.provider is never set for it. + const { llm, root } = await runWith("gpt-4o-mini", "openai.chat"); + expect(llm["llm.provider"]).toBeUndefined(); + expect(llm["gen_ai.provider.name"]).toBe("openai"); + expect(llm["gen_ai.request.model"]).toBe("gpt-4o-mini"); + expect(root["gen_ai.provider.name"]).toBe("openai"); + }); + + it("leaves the provider unset for an unknown AI SDK provider id", async () => { + const { llm, root } = await runWith("claude-haiku-5-5", "cliproxy.chat"); + expect(llm["gen_ai.provider.name"]).toBeUndefined(); + expect(root["gen_ai.provider.name"]).toBeUndefined(); + }); + + it("keeps VoltAgent's own llm.provider when the model id carries one", async () => { + const { llm } = await runWith("mockai/mock-model-1", "openai.chat"); + expect(llm["gen_ai.provider.name"]).toBe("mockai"); + }); +}); + describe("streamText", () => { it("maps the streaming path and reconciles its multi-step usage", async () => { const { exporter, provider } = fiProvider(); diff --git a/typescript/packages/traceai_voltagent/src/agentModels.ts b/typescript/packages/traceai_voltagent/src/agentModels.ts new file mode 100644 index 000000000..38a8f924b --- /dev/null +++ b/typescript/packages/traceai_voltagent/src/agentModels.ts @@ -0,0 +1,40 @@ +import { providerFromAiSdk } from "./mapping"; + +/** + * VoltAgent records only `modelId` for an AI SDK model object (agent.ts getModelName); the + * object's `provider` ("openai.chat", ...) never reaches a span. The agent is looked up by its + * span's `entity.id` in VoltAgent's agent registry, a process-wide singleton kept on + * `globalThis.___voltagent_agent_registry` (@voltagent/core 2.11.0 AgentRegistry.getInstance), + * which `new VoltAgent({ agents })` fills. An agent that was never registered, or a dynamic model, + * yields no provider. + */ +const REGISTRY_KEY = "___voltagent_agent_registry"; + +interface RegistryLike { + getAgent?(id: string): { model?: unknown } | undefined; +} + +interface ModelLike { + provider?: unknown; + modelId?: unknown; +} + +function candidates(model: unknown): ModelLike[] { + if (Array.isArray(model)) { + // Fallback lists: AgentModelConfig[] ({ model, ... }). + return model.map((entry) => (entry && typeof entry === "object" && "model" in entry ? entry.model : entry)); + } + return [model as ModelLike]; +} + +/** gen_ai.provider.name for the AI SDK model object agent `agentId` used for `modelId`, if known. */ +export function providerForAgentModel(agentId: string, modelId: string | undefined): string | undefined { + const registry = (globalThis as Record)[REGISTRY_KEY] as RegistryLike | undefined; + const agent = typeof registry?.getAgent === "function" ? registry.getAgent(agentId) : undefined; + for (const model of candidates(agent?.model)) { + if (!model || typeof model !== "object" || typeof model.provider !== "string") continue; + if (modelId !== undefined && model.modelId !== modelId) continue; + return providerFromAiSdk(model.provider); + } + return undefined; +} diff --git a/typescript/packages/traceai_voltagent/src/index.ts b/typescript/packages/traceai_voltagent/src/index.ts index c47d840cc..a4eb1ad94 100644 --- a/typescript/packages/traceai_voltagent/src/index.ts +++ b/typescript/packages/traceai_voltagent/src/index.ts @@ -9,6 +9,7 @@ export { mapSpanEvents, reconcileOperationUsage, copyOperationOutput, + providerFromAiSdk, resolveSpanKind, isContentKey, isPromotedUsageKey, @@ -18,3 +19,4 @@ export { type SpanEventLike, } from "./mapping"; export { VoltAgentAttributes, FIAttributes, VoltAgentFIAttributes } from "./attributes"; +export { providerForAgentModel } from "./agentModels"; diff --git a/typescript/packages/traceai_voltagent/src/mapping.ts b/typescript/packages/traceai_voltagent/src/mapping.ts index 39cc06111..ee81bfa7b 100644 --- a/typescript/packages/traceai_voltagent/src/mapping.ts +++ b/typescript/packages/traceai_voltagent/src/mapping.ts @@ -157,6 +157,40 @@ export function mapSpanEvents(events: readonly T[] | un }); } +/** + * The first segment of an AI SDK model's `provider` id ("openai.chat", "anthropic.messages", + * "google.generative-ai", "amazon-bedrock", ...) -> gen_ai.provider.name. Ids read from the + * published @ai-sdk/* providers; values are the fi-semantic-conventions LLMProvider values, plus + * "vertexai" (the Future AGI backend's Vertex AI value). Any other id, including an + * OpenAI-compatible provider's own name, is left unset. + */ +const AI_SDK_PROVIDER_PREFIXES: Readonly> = { + openai: "openai", + anthropic: "anthropic", + google: "google", + vertex: "vertexai", + azure: "azure", + "amazon-bedrock": "aws", + bedrock: "aws", + mistral: "mistralai", + groq: "groq", + xai: "xai", + deepseek: "deepseek", + cohere: "cohere", + cerebras: "cerebras", + togetherai: "together", + fireworks: "fireworks", + ollama: "ollama", + huggingface: "huggingface", +}; + +export function providerFromAiSdk(providerId: string): string | undefined { + const id = providerId.trim().toLowerCase(); + // @ai-sdk/google-vertex models report "google.vertex.". + if (id.startsWith("google.vertex")) return "vertexai"; + return AI_SDK_PROVIDER_PREFIXES[id.split(".")[0]]; +} + const asString = (value: AttributeValue | undefined): string | undefined => typeof value === "string" && value.length > 0 ? value : undefined; const asNumber = (value: AttributeValue | undefined): number | undefined => From 1a7b1c9f1e7cf5378ccaaff760ee3d50008754dc Mon Sep 17 00:00:00 2001 From: Nikhil Pareek Date: Sun, 11 Oct 2026 20:45:50 -0700 Subject: [PATCH 11/18] test(voltagent): use a neutral example for an unknown provider id Co-Authored-By: Claude Opus 5.5 --- .../packages/traceai_voltagent/src/__tests__/mapping.test.ts | 2 +- .../packages/traceai_voltagent/src/__tests__/processor.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts index 32deb14c8..a9dba8f04 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts @@ -481,7 +481,7 @@ describe("provider from an AI SDK model object's provider id", () => { expect(providerFromAiSdk(id)).toBe(provider); }); - it.each(["cliproxy.chat", "openai-compatible", "gateway", "mock-provider", "", " "])( + it.each(["acme-proxy.chat", "openai-compatible", "gateway", "mock-provider", "", " "])( "leaves %j unset rather than guessing", (id) => { expect(providerFromAiSdk(id)).toBeUndefined(); diff --git a/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts index 2e667ffab..ffe08914e 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts @@ -184,7 +184,7 @@ describe("provider from the agent's AI SDK model object", () => { }); it("leaves the provider unset for an unknown AI SDK provider id", async () => { - const { llm, root } = await runWith("claude-haiku-5-5", "cliproxy.chat"); + const { llm, root } = await runWith("claude-haiku-5-5", "acme-proxy.chat"); expect(llm["gen_ai.provider.name"]).toBeUndefined(); expect(root["gen_ai.provider.name"]).toBeUndefined(); }); From e2c0fd321a0893bbddd27b78ea9c731a160753b4 Mon Sep 17 00:00:00 2001 From: Nikhil Pareek Date: Sun, 11 Oct 2026 21:21:14 -0700 Subject: [PATCH 12/18] docs: move the README catalog row to the TH-8103 catalog PR The catalog rows for all TH-8103 integrations now live in one PR (docs/th-8103-integration-catalog), so this PR no longer conflicts with its siblings in README.md and can merge in any order. Co-Authored-By: Claude Opus 5.5 --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index c85f8b204..214680868 100644 --- a/README.md +++ b/README.md @@ -329,7 +329,6 @@ var tracer = TraceAI.Register(opts => | [`@traceai/openai-agents`](https://www.npmjs.com/package/@traceai/openai-agents) | OpenAI Agents | [![npm](https://img.shields.io/npm/v/@traceai/openai-agents)](https://www.npmjs.com/package/@traceai/openai-agents) | | [`@traceai/fi-instrumentation-google-adk`](https://www.npmjs.com/package/@traceai/fi-instrumentation-google-adk) | Google ADK | [![npm](https://img.shields.io/npm/v/@traceai/fi-instrumentation-google-adk)](https://www.npmjs.com/package/@traceai/fi-instrumentation-google-adk) | | [`@traceai/mastra`](https://www.npmjs.com/package/@traceai/mastra) | Mastra | [![npm](https://img.shields.io/npm/v/@traceai/mastra)](https://www.npmjs.com/package/@traceai/mastra) | -| [`@traceai/voltagent`](https://www.npmjs.com/package/@traceai/voltagent) | VoltAgent | [![npm](https://img.shields.io/npm/v/@traceai/voltagent)](https://www.npmjs.com/package/@traceai/voltagent) | | [`@traceai/beeai`](https://www.npmjs.com/package/@traceai/beeai) | IBM BeeAI | [![npm](https://img.shields.io/npm/v/@traceai/beeai)](https://www.npmjs.com/package/@traceai/beeai) | | [`@traceai/strands`](https://www.npmjs.com/package/@traceai/strands) | AWS Strands Agents | [![npm](https://img.shields.io/npm/v/@traceai/strands)](https://www.npmjs.com/package/@traceai/strands) | @@ -463,7 +462,6 @@ Available on [NuGet](https://www.nuget.org/packages/fi-instrumentation-otel). | | AWS Strands Agents | ✅ | ✅ | | | | | IBM BeeAI | ✅ | ✅ | | | | | Mastra | | ✅ | | | -| | VoltAgent | | ✅ | | | | | LangChain4j | | | ✅ | | | | Spring AI | | | ✅ | | | | Semantic Kernel | | | ✅ | | From 1403ed952d51e03510d5d2267d222f7e3e04e0f8 Mon Sep 17 00:00:00 2001 From: Nikhil Pareek Date: Fri, 16 Oct 2026 21:21:27 -0700 Subject: [PATCH 13/18] fix(voltagent): TraceConfig privacy default, no stack traces or local paths (TH-8239) Re-verification 2026-10-16 against local Future AGI with the real @voltagent/core 2.11.0 (latest on npm, same as the pin), @traceai/fi-core 1.0.0 from npm and live models (api.openai.com gpt-4.1-nano and an OpenAI-compatible endpoint, both through @ai-sdk/openai). Privacy default (TH-8103 coordinator decision 2026-10-16): follow the traceAI TraceConfig convention instead of the package's own captureContent switch. Content is exported by default (fi-core DEFAULT_HIDE_* = false); FI_HIDE_INPUTS / FI_HIDE_OUTPUTS (and FI_HIDE_INPUT_MESSAGES / _OUTPUT_MESSAGES / _INPUT_TEXT / _OUTPUT_TEXT) or traceConfig hide it, with fi-core's parsing (only "true" hides) and precedence (option > env > default). The env vars apply even when no traceConfig is passed. VoltAgent content keys are classified by side (input, output, both); hideInputText / hideOutputText keep message roles and redact the text. Passing the removed captureContent option logs a diag warning. Never exported, in either mode (the real run had exported all three with Rick's content-off default): - stack traces: error.stack and exception.stacktrace are dropped, and V8 frames / Python tracebacks are cut from every exported string, including stack traces inside JSON (a failed tool's error object in llm.messages / agent.messages); - local paths: new privacy.ts rewrites the cwd to [cwd], the home dir to ~, other absolute local paths, file URLs and Windows paths to [path] in every exported string (JSON-aware, re-serialized only on change); - in error text (status message, error.message, exception.message, eval.scorer.error_message, guardrail/suspension/cancellation reasons): emails and this machine's user and host names. With inputs or outputs hidden that text is dropped and an ERROR status carries the error type. copySpan now takes the filtered events and the exported status explicitly (P3 follow-up: no unfiltered default). copyOperationOutput reads the mapped root, so a hidden output never reaches the llm span. Tests: jest 108 passed on Node 26.8.1 and 20.20.2 (new privacy.test.ts, TraceConfig env/precedence, stack/path/error-text cases); contract 14 passed across Node 20.20.2 / 22.18.0 / 26.8.1. Co-Authored-By: Claude Opus 5.5 --- .../packages/traceai_voltagent/CHANGELOG.md | 3 +- .../packages/traceai_voltagent/README.md | 126 ++++---- .../contract/run_fixture.mjs | 12 +- .../contract/test_harness_contract.py | 52 +++- .../src/FIVoltAgentSpanProcessor.ts | 99 ++++-- .../src/__tests__/mapping.test.ts | 151 +++++++++- .../src/__tests__/privacy.test.ts | 158 ++++++++++ .../src/__tests__/processor.test.ts | 139 ++++++--- .../packages/traceai_voltagent/src/index.ts | 14 + .../packages/traceai_voltagent/src/mapping.ts | 285 ++++++++++++------ .../packages/traceai_voltagent/src/privacy.ts | 258 ++++++++++++++++ 11 files changed, 1056 insertions(+), 241 deletions(-) create mode 100644 typescript/packages/traceai_voltagent/src/__tests__/privacy.test.ts create mode 100644 typescript/packages/traceai_voltagent/src/privacy.ts diff --git a/typescript/packages/traceai_voltagent/CHANGELOG.md b/typescript/packages/traceai_voltagent/CHANGELOG.md index f134df02b..2805f5860 100644 --- a/typescript/packages/traceai_voltagent/CHANGELOG.md +++ b/typescript/packages/traceai_voltagent/CHANGELOG.md @@ -2,4 +2,5 @@ ## 0.1.0 -- Initial release: `FIVoltAgentSpanProcessor` for `ObservabilityConfig.spanProcessors` in `@voltagent/core` 2.x. Maps VoltAgent span kinds, model, usage, session and tool keys onto Future AGI / GenAI keys on an exported copy, keeps promoted token keys on model-call spans only, drops content unless `captureContent: true`, and batches through the `register()` provider's exporter. +- Initial release: `FIVoltAgentSpanProcessor` for `ObservabilityConfig.spanProcessors` in `@voltagent/core` 2.x. Maps VoltAgent span kinds, model, usage, session and tool keys onto Future AGI / GenAI keys on an exported copy, keeps promoted token keys on model-call spans only, and batches through the `register()` provider's exporter. +- Privacy follows the traceAI `TraceConfig` convention: content is exported by default and hidden with `traceConfig` or the `FI_HIDE_INPUTS` / `FI_HIDE_OUTPUTS` / `FI_HIDE_INPUT_MESSAGES` / `FI_HIDE_OUTPUT_MESSAGES` / `FI_HIDE_INPUT_TEXT` / `FI_HIDE_OUTPUT_TEXT` env vars (the earlier `captureContent` option is gone). Credentials, stack traces (`error.stack`, `exception.stacktrace`, frames inside JSON) and local paths are never exported; error text also loses emails and the machine's user and host names, and is dropped when inputs or outputs are hidden. diff --git a/typescript/packages/traceai_voltagent/README.md b/typescript/packages/traceai_voltagent/README.md index be9b053a3..85b987ea2 100644 --- a/typescript/packages/traceai_voltagent/README.md +++ b/typescript/packages/traceai_voltagent/README.md @@ -10,9 +10,9 @@ It plugs into VoltAgent's own `ObservabilityConfig.spanProcessors`. It does not it does not change the span VoltAgent hands to its other processors (VoltOps, local storage, websocket): it exports a mapped copy. -Status: alpha. Fixture-validated against `@voltagent/core` 2.11.0 with the AI SDK mock model, and -run end to end with a live model (an OpenAI-compatible endpoint through -`@ai-sdk/openai-compatible`) into a local Future AGI collector. +Status: alpha. Tested against `@voltagent/core` 2.11.0 (the latest release) with the AI SDK mock +model, and end to end into a local Future AGI collector with live models: `api.openai.com` +(`gpt-4.1-nano`) and an OpenAI-compatible endpoint, both through `@ai-sdk/openai`. ## Install @@ -46,7 +46,7 @@ const tracerProvider = register({ const observability = new VoltAgentObservability({ spanProcessors: [ // ...keep any processors you already have here... - new FIVoltAgentSpanProcessor({ tracerProvider }), // captureContent defaults to false + new FIVoltAgentSpanProcessor({ tracerProvider }), ], }); @@ -67,15 +67,16 @@ remove them. VoltAgent's sampling wrapper only wraps its VoltOps exporter, so a |---|---|---| | `tracerProvider` | | The provider from `register()`. Spans carry its resource (`project_name`, `project_type`) and go out through its OTLP exporter (`/tracer/v1/traces`, `x-api-key` / `x-secret-key`). | | `exporter`, `resource` | | Instead of `tracerProvider`: any `SpanExporter`, and the resource to export with. | -| `captureContent` | `false` | Export prompts, messages, instructions, tool arguments/results and retrieval queries. | +| `traceConfig` | content captured | fi-core `TraceConfigOptions`, the same flags as every traceAI instrumentor: `hideInputs`, `hideOutputs`, `hideInputMessages`, `hideOutputMessages`, `hideInputText`, `hideOutputText`. Each falls back to its `FI_HIDE_*` env var, then to the fi-core default (`false`). See Privacy. | | `batch` | `true` | Batch through a `BatchSpanProcessor` (with `tracerProvider`, it wraps the provider's exporter). `false` exports each span as it ends. | | `batchConfig` | SDK defaults | `BatchSpanProcessor` settings: queue 2048, batch 512, delay 5000 ms. Spans beyond a full queue are dropped by the SDK. | | `usageReconciliationTimeoutMs` | `30000` | How long an llm span waits for its operation's root span (see Tokens). | ## What is mapped -Every original VoltAgent key stays on the exported copy, except content (below), credentials, and -promoted token keys on spans that are not model calls (moved under `voltagent.`). +Every original VoltAgent key stays on the exported copy, except content you hide (see Privacy), +credentials, stack traces, and promoted token keys on spans that are not model calls (moved under +`voltagent.`). Kept strings have local paths rewritten (see Privacy). | Future AGI field | VoltAgent source (2.11.0) | Notes | |---|---|---| @@ -92,8 +93,8 @@ promoted token keys on spans that are not model calls (moved under `voltagent.`) | `gen_ai.usage.reasoning.output_tokens`, `gen_ai.usage.output_tokens.reasoning` | `llm.usage.reasoning_tokens` | llm spans only, when > 0 | | `voltagent.usage.input_tokens`, `.output_tokens`, `.total_tokens`, `.cache_read_tokens`, `.reasoning_tokens` | `usage.prompt_tokens`, ... on the agent span | the operation total; namespaced so it is not counted twice | | `gen_ai.tool.name`, `gen_ai.tool.call.id`, `gen_ai.tool.description` | `tool.name`, `tool.call.id`, `tool.description` | | -| status, `exception` events, `error.*` | passed through | a failing tool is an `ERROR` span; `exception` events keep `exception.type`, `.message` and `.stacktrace`. Other event attributes are filtered like span attributes (see Content) | -| `input.value`, `output.value` | `input`, `output` (`vector.query` / `embedding.query` as retriever input). llm spans: `llm.messages` (the last 10 messages VoltAgent sent) as input; as output, the agent span's `output` when the operation has exactly one successful `llm:generateText` / `llm:streamText` span (VoltAgent records no response text on llm spans) | **only with `captureContent: true`** | +| status, `exception` events, `error.*` | passed through, filtered | a failing tool is an `ERROR` span. `exception` events keep `exception.type` and `exception.message`; `exception.stacktrace` and `error.stack` are never exported. The status message, `error.message` and `exception.message` have local paths, emails and this machine's user and host names removed; with inputs or outputs hidden they are dropped and an `ERROR` status carries the error type (`VoltAgentError`, `AI_APICallError`, ...) | +| `input.value`, `output.value` | `input`, `output` (`vector.query` / `embedding.query` as retriever input). llm spans: `llm.messages` (the last 10 messages VoltAgent sent) as input; as output, the agent span's `output` when the operation has exactly one successful `llm:generateText` / `llm:streamText` span (VoltAgent records no response text on llm spans) | by default; not with `hideInputs` / `hideOutputs` (see Privacy) | | cost | not mapped | VoltAgent sets `usage.cost` only from OpenRouter provider metadata; it is passed through unchanged and not promoted | ### Tokens @@ -133,46 +134,57 @@ twice. another request's flush), or a root that does not end within `usageReconciliationTimeoutMs`, releases the llm span unreconciled: it carries last-step usage only. -## Content - -Off by default. VoltAgent itself has no capture flag: it writes the prompt, the answer, system -instructions, message history, tool arguments and results, memory payloads, conversation summaries -and plans onto its spans. The Future AGI copy drops them unless you pass `captureContent: true`. -This is stricter than VoltAgent; a VoltOps export of the same run still has the originals. - -Dropped keys: `input`, `output`, `agent.instructions`, `agent.messages`, `agent.messages.ui`, -`agent.context`, `agent.stateSnapshot`, `llm.messages`, `workflow.context`, -`workflow.stateSnapshot` (step source and the run input), `workspace.sandbox.command`, -`workspace.sandbox.args`, `suspension.checkpoint`, `agent.summary.preview`, `agent.summary.text` -(summarization), `agent.workingMemory.finalContent` (working memory), `planagent.todos`, -`planagent.task.description`, `planagent.task.response_preview` (PlanAgent), `eval.scorer.metadata` -(evals: holds the run's input and output), `eval.expected` (the eval's reference answer), `guardrail.result.metadata` (a guardrail decision's -payload), `guardrail.chunk.text`, `suspension.data`, `resume.data` (span events, below), any key with an -`input` or `output` segment (`middleware.input.original`, `guardrail.output.after`, ...), and string -values whose last segment is `messages`, `instructions`, `query`, `context`, `data`, `checkpoint`, -`prompt(s)`, `completion`, `content`, `arguments` or `args` (`tool.search.query`, `vector.query`, -`workflow.resume.data`, ...). Counts such as `llm.messages.count` stay. - -Span events are filtered the same way. VoltAgent puts content in event attributes too: an output -guardrail with a streaming handler adds a `guardrail.stream.process` event per answer chunk with -the chunk in `guardrail.chunk.text`, and a workflow adds `workflow.suspended` (`suspension.data`, -`suspension.checkpoint`) and `workflow.resumed` (`resume.data`). Without `captureContent`, those -keys are removed from the exported events; the event names, times and other attributes -(`guardrail.chunk.index`, `suspension.reason`, `resume.step_index`, ...) stay. `exception` events -keep `exception.type`, `exception.message` and `exception.stacktrace`, which contain whatever text -the thrown error carries. - -Credentials are never exported, whatever `captureContent` says: keys with a segment like -`api_key`, `secret`, `secret_key`, `password`, `authorization`, `cookie` or `header(s)` are dropped, -from span attributes and from event attributes. The filter is by key: a JSON value such as -`llm.provider_options` is exported whole, so do not put credentials in provider options. - -Kept in every mode, because they are short strings your code or VoltAgent writes rather than -prompt or answer text: `guardrail.message` and the `guardrail.stream.abort` event's -`guardrail.reason` (the built-in guardrails write fixed messages such as "Output blocked due to -profanity."; a custom guardrail's message is exported as written), `suspension.reason`, -`cancellation.reason`, workflow step reasons, and the workspace tool fields `workspace.fs.path`, -`workspace.fs.pattern` and `workspace.sandbox.cwd`, which can carry model-chosen paths. +## Privacy + +Content follows the traceAI `TraceConfig` convention, like every traceAI instrumentor: it is +**exported by default**, and the standard flags hide it. VoltAgent writes the prompt, the answer, +system instructions, message history, tool arguments and results, memory payloads, conversation +summaries and plans onto its spans; the Future AGI copy carries them unless you hide them. + +```bash +export FI_HIDE_INPUTS=true # prompts, instructions, messages, tool arguments, queries, memory reads +export FI_HIDE_OUTPUTS=true # answers, tool results, summaries, plans, streamed guardrail chunks +``` + +or in code (an option wins over its env var; only the string `true` hides, as in fi-core): + +```typescript +new FIVoltAgentSpanProcessor({ tracerProvider, traceConfig: { hideInputs: true, hideOutputs: true } }); +``` + +| Flag (env var) | What it hides on the exported copy | +|---|---| +| `hideInputs` (`FI_HIDE_INPUTS`) | input-side keys: `input`, `input.value`, `agent.instructions`, `agent.context`, `agent.messages`, `agent.messages.ui`, `llm.messages`, `workflow.context`, `workspace.sandbox.command` / `.args`, `workspace.fs.path` / `.pattern`, `workspace.sandbox.cwd`, `planagent.task.description`, `resume.data`, any key with an `input` segment (`middleware.input.original`, `eval.input`, ...) and string keys ending in `messages`, `instructions`, `query`, `context`, `prompt(s)`, `arguments`, `args` (`tool.search.query`, `vector.query`, ...) | +| `hideOutputs` (`FI_HIDE_OUTPUTS`) | output-side keys: `output`, `output.value`, `agent.summary.preview` / `.text`, `planagent.todos`, `planagent.task.response_preview`, `guardrail.chunk.text`, any key with an `output` segment (`guardrail.output.after`, `eval.output`, ...) and string keys ending in `completion` | +| either of the two | keys that hold both sides: `agent.stateSnapshot`, `workflow.stateSnapshot` (step source and the run input), `suspension.checkpoint`, `suspension.data`, `agent.workingMemory.finalContent`, `eval.scorer.metadata` (the run's input and output), `eval.expected`, `guardrail.result.metadata`, string keys ending in `data`, `checkpoint`, `content`; and run-time free text: the status message, `error.message`, `exception.message`, `eval.scorer.error_message`, `workspace.error`, `guardrail.message`, `guardrail.reason`, `suspension.reason`, `cancellation.reason` and the workflow step reasons | +| `hideInputMessages` / `hideOutputMessages` | the message lists only (`llm.messages`, `agent.messages`, `agent.messages.ui`; `gen_ai.output.messages`) | +| `hideInputText` / `hideOutputText` | keeps the message lists' roles and replaces each message's `content` / `parts` with `__REDACTED__` | + +Span events are filtered the same way: the `guardrail.stream.process` event's `guardrail.chunk.text`, +`workflow.suspended`'s `suspension.data` / `suspension.checkpoint` and `workflow.resumed`'s +`resume.data` follow the flags; event names, times and structural attributes +(`guardrail.chunk.index`, `resume.step_index`, ...) always stay. Counts such as `llm.messages.count` +are never content. + +Never exported, in either mode: + +- **Credentials**: keys with a segment like `api_key`, `secret`, `secret_key`, `password`, + `authorization`, `cookie` or `header(s)`, on span and event attributes. The filter is by key: a + JSON value such as `llm.provider_options` is exported whole, so do not put credentials in + provider options. +- **Stack traces**: `error.stack` and `exception.stacktrace` are dropped, and V8 frames + (` at ...`) and Python tracebacks are cut from every exported string, including stack traces + inside JSON (a failed tool's error object in `llm.messages`). +- **Local paths**: in every exported string (JSON documents included) the working directory becomes + `[cwd]`, the home directory `~`, and other absolute local paths, `file://` URLs and Windows paths + `[path]`. URL paths such as `/v1/chat/completions` are left alone. +- **In error text** (status message, `error.message`, `exception.message` and the other free-text + keys above): emails become `` and this machine's user and host names ``. + Captured message content is exported as the model saw it: an email in a prompt or a tool result + stays unless you hide inputs/outputs. + +VoltAgent itself has no capture flag; a VoltOps export of the same run still has the original keys. +`FI_PII_REDACTION` is not applied by this processor. ## Flushing, serverless and failures @@ -196,10 +208,11 @@ profanity."; a custom guardrail's message is exported as written), `suspension.r | Component | Version | |---|---| -| `@voltagent/core` | 2.11.0 (npm `latest` on 2026-10-04) | -| `ai` (mock model, `ai/test` `MockLanguageModelV3`) | 6.0.97 | -| `@traceai/fi-core` exporter | workspace (OpenTelemetry SDK 2.0.1, OTLP HTTP exporter 0.202.0) | -| Node.js | 26.8.1: jest and every contract test. 20.20.2 and 22.23.3 as well: the contract tool journey, span-event journey and ESM/CJS entry-point check (the tests `TRACEAI_NODE_MATRIX` parametrizes) | +| `@voltagent/core` | 2.11.0 (npm `latest` on 2026-10-04 and still on 2026-10-16; `next` is 3.0.0-next.1, not tested) | +| `ai` | 6.0.97 (mock model, `ai/test` `MockLanguageModelV3`, in the tests); 6.0.309 with `@ai-sdk/openai` 3.0.130 (end to end) | +| `@traceai/fi-core` exporter | workspace build in the tests; 1.0.0 from npm end to end (OpenTelemetry SDK 2.x, OTLP HTTP exporter 0.202.0) | +| Node.js | 20.20.2, 22.18.0 and 26.8.1: jest (20.20.2, 26.8.1) and the contract tool journey, span-event journey and ESM/CJS entry-point check (the tests `TRACEAI_NODE_MATRIX` parametrizes); every other contract test and the end-to-end run on 26.8.1 | +| Models (end to end) | `gpt-4.1-nano` on `api.openai.com`; `gpt-5.6-terra` through an OpenAI-compatible endpoint | `@voltagent/core` 2.11.0 is MIT-licensed (`license` in its `package.json`; the published tarball has no LICENSE file, its README and `docs/community/licence.md` carry the MIT text, "Copyright (c) @@ -212,8 +225,11 @@ has no LICENSE file, its README and `docs/community/licence.md` carry the MIT te - Retriever, embedding and vector spans are mapped from source reading; the fixture runs only the agent's memory spans (`memory.read`, `memory.write`, `memory.steps.write`). - VoltAgent logs (`RemoteLogProcessor`) are not exported. Eval scorer spans are exported with - their ids, status, score and threshold; `eval.scorer.metadata`, `eval.expected`, `eval.input` and - `eval.output` are dropped unless `captureContent` is on. `eval.scorer.error_message` is kept. + their ids, status, score and threshold; `eval.scorer.metadata`, `eval.expected`, `eval.input`, + `eval.output` and `eval.scorer.error_message` follow the hide flags (see Privacy). +- Tokens are on the llm spans, not on the agent root (see Tokens), so the Observe trace list's + Tokens column, which reads the root span, is empty for VoltAgent traces; the trace view shows the + tokens and cost of each model call. - Only the Node runtime was tested; edge runtimes were not. ## Development diff --git a/typescript/packages/traceai_voltagent/contract/run_fixture.mjs b/typescript/packages/traceai_voltagent/contract/run_fixture.mjs index 0d1f900e1..0cec1482d 100644 --- a/typescript/packages/traceai_voltagent/contract/run_fixture.mjs +++ b/typescript/packages/traceai_voltagent/contract/run_fixture.mjs @@ -6,7 +6,8 @@ // exporter posts to FI_BASE_URL + /tracer/v1/traces (the shared harness Receiver in tests). // // Env: FI_BASE_URL, FI_API_KEY, FI_SECRET_KEY, FI_PROJECT_NAME (placeholders in tests), -// JOURNEY = tools | subagent | burst | events, CAPTURE_CONTENT = "true" to opt in. +// JOURNEY = tools | subagent | burst | events. Content follows the traceAI TraceConfig flags +// the processor reads itself: captured by default, FI_HIDE_INPUTS / FI_HIDE_OUTPUTS=true hide it. // Prints one line "RESULT_JSON:{...}" on stdout. import { ProjectType, register } from "@traceai/fi-core"; import { FIVoltAgentSpanProcessor } from "@traceai/voltagent"; @@ -24,7 +25,7 @@ import { MockLanguageModelV3, convertArrayToReadableStream } from "ai/test"; import { z } from "zod"; const JOURNEY = process.env.JOURNEY ?? "tools"; -const CAPTURE = process.env.CAPTURE_CONTENT === "true"; +const HIDDEN = process.env.FI_HIDE_INPUTS === "true" && process.env.FI_HIDE_OUTPUTS === "true"; const BURST = 20; export const MARKERS = { @@ -111,7 +112,8 @@ const explodingTool = createTool({ description: "Always fails", parameters: z.object({ x: z.number() }), execute: async () => { - throw new Error("tool exploded"); + // A local path in the error text, like a real I/O error: never exported as-is. + throw new Error(`tool exploded reading ${process.cwd()}/data.db`); }, }); @@ -139,10 +141,10 @@ const tracerProvider = register({ projectType: ProjectType.OBSERVE, setGlobalTracerProvider: false, }); -const processor = new FIVoltAgentSpanProcessor({ tracerProvider, captureContent: CAPTURE }); +const processor = new FIVoltAgentSpanProcessor({ tracerProvider }); const observability = new VoltAgentObservability({ spanProcessors: [recorder, processor] }); -const result = { journey: JOURNEY, captureContent: CAPTURE }; +const result = { journey: JOURNEY, hidden: HIDDEN, cwd: process.cwd() }; const started = Date.now(); if (JOURNEY === "subagent") { diff --git a/typescript/packages/traceai_voltagent/contract/test_harness_contract.py b/typescript/packages/traceai_voltagent/contract/test_harness_contract.py index 741ab91e8..59eb2b010 100644 --- a/typescript/packages/traceai_voltagent/contract/test_harness_contract.py +++ b/typescript/packages/traceai_voltagent/contract/test_harness_contract.py @@ -86,6 +86,22 @@ def _base_env() -> Dict[str, str]: return {"PATH": os.environ.get("PATH", ""), "HOME": os.environ.get("HOME", ""), "NO_PROXY": "127.0.0.1,localhost"} +# traceAI TraceConfig: content is captured by default; these env vars hide it. +HIDDEN_ENV = {"FI_HIDE_INPUTS": "true", "FI_HIDE_OUTPUTS": "true"} +# Never exported in either mode (stack frames, the local working/home directories). +STACK_MARKERS = (" at ", "\\n at ", "exception.stacktrace", "error.stack") + + +def _assert_no_stack_or_paths(spans: List[Dict[str, Any]], cwd: str) -> None: + blob = json.dumps(spans) + for marker in STACK_MARKERS: + assert marker not in blob, marker + assert cwd not in blob, "working directory exported" + home = os.environ.get("HOME", "") + if len(home) > 1: + assert home not in blob, "home directory exported" + + @pytest.fixture(scope="session") def built_package() -> Path: result = run([PNPM, "--dir", str(PKG_DIR), "run", "build"], env=_base_env(), stdin=None, timeout=300) @@ -175,9 +191,9 @@ def _assert_collector_contract(requests: List[Dict[str, Any]]) -> None: @pytest.mark.parametrize("node", NODES) -def test_tool_journey_reaches_collector_path_mapped_with_content_off(built_package: Path, node: str) -> None: +def test_tool_journey_reaches_collector_path_mapped_with_content_hidden(built_package: Path, node: str) -> None: with Receiver() as receiver: - output = _run_fixture(node, receiver.origin, "tools") + output = _run_fixture(node, receiver.origin, "tools", HIDDEN_ENV) spans = receiver.spans() requests = receiver.requests() @@ -240,14 +256,18 @@ def test_tool_journey_reaches_collector_path_mapped_with_content_off(built_packa assert not [key for key in _attrs(span) if _is_promoted(key)], span["name"] assert r["voltagent.usage.input_tokens"] == 24 and r["usage.prompt_tokens"] == 24 - # Errors. + # Errors: ERROR status carrying the error type only; no message, no stack trace. assert _status(failing) == 2 - assert f["error.message"] == "tool exploded" - assert "exception" in [event["name"] for event in failing.get("events", [])] + assert "error.message" not in f and "error.stack" not in f + assert failing["status"].get("message") == f["error.type"] + exception = [event for event in failing.get("events", []) if event["name"] == "exception"] + assert exception and set(_attrs(exception[0])) == {"exception.type"} assert _status(weather) == 1 and _status(root) == 1 - # No content by default, no credentials anywhere on spans. + # Hidden: no content, no error text, no stack traces or local paths, no credentials anywhere. blob = json.dumps(spans) + assert "tool exploded" not in blob + _assert_no_stack_or_paths(spans, output["cwd"]) for marker in MARKERS: assert marker not in blob, marker for span in spans: @@ -266,12 +286,20 @@ def _hex_span_id(span_id: str) -> str: return binascii.hexlify(base64.b64decode(span_id)).decode() -def test_content_is_exported_only_after_opt_in(built_package: Path) -> None: +def test_content_is_exported_by_default(built_package: Path) -> None: with Receiver() as receiver: - _run_fixture(NODE, receiver.origin, "tools", {"CAPTURE_CONTENT": "true"}) + output = _run_fixture(NODE, receiver.origin, "tools") spans = receiver.spans() root = _attrs(_one(spans, "assistant")) weather = _attrs(_one(spans, "tool.execution:get_weather")) + failing = _one(spans, "tool.execution:explode") + # The error text stays, with the local path rewritten; the stack trace never leaves. + assert _attrs(failing)["error.message"] == "tool exploded reading [cwd]/data.db" + assert failing["status"]["message"] == "tool exploded reading [cwd]/data.db" + exception = [event for event in failing.get("events", []) if event["name"] == "exception"][0] + assert _attrs(exception)["exception.message"] == "tool exploded reading [cwd]/data.db" + assert "exception.stacktrace" not in _attrs(exception) + _assert_no_stack_or_paths(spans, output["cwd"]) assert root["input.value"] == "SECRET_PROMPT_MARKER" assert root["output.value"] == "SECRET_ANSWER_MARKER" assert "SECRET_TOOL_ARG_MARKER" in weather["input.value"] @@ -281,7 +309,7 @@ def test_content_is_exported_only_after_opt_in(built_package: Path) -> None: def test_subagent_is_one_trace_under_the_supervisor(built_package: Path) -> None: with Receiver() as receiver: - output = _run_fixture(NODE, receiver.origin, "subagent") + output = _run_fixture(NODE, receiver.origin, "subagent", HIDDEN_ENV) spans = receiver.spans() requests = receiver.requests() _assert_collector_contract(requests) @@ -324,10 +352,10 @@ def _event_values(spans: List[Dict[str, Any]]) -> Dict[tuple, List[Any]]: @pytest.mark.parametrize("node", NODES) -def test_span_events_carry_no_content_by_default(built_package: Path, node: str) -> None: +def test_span_events_carry_no_content_when_hidden(built_package: Path, node: str) -> None: """Guardrail stream chunks and workflow suspend/resume payloads in span events (M1).""" with Receiver() as receiver: - output = _run_fixture(node, receiver.origin, "events") + output = _run_fixture(node, receiver.origin, "events", HIDDEN_ENV) spans = receiver.spans() requests = receiver.requests() assert output["text"] == "SECRET_ANSWER_MARKER" @@ -351,7 +379,7 @@ def test_span_events_carry_no_content_by_default(built_package: Path, node: str) assert PLACEHOLDER_API_KEY not in blob and PLACEHOLDER_SECRET_KEY not in blob with Receiver() as receiver: - _run_fixture(node, receiver.origin, "events", {"CAPTURE_CONTENT": "true"}) + _run_fixture(node, receiver.origin, "events") captured = _event_values(receiver.spans()) assert "SECRET_ANSWER_MARKER" in captured[("guardrail.stream.process", "guardrail.chunk.text")] assert "SECRET_SUSPEND_DATA_MARKER" in captured[("workflow.suspended", "suspension.data")][0] diff --git a/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts b/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts index 55ab86103..b0a98d461 100644 --- a/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts +++ b/typescript/packages/traceai_voltagent/src/FIVoltAgentSpanProcessor.ts @@ -8,12 +8,21 @@ import { type SpanExporter, type SpanProcessor, } from "@opentelemetry/sdk-trace-base"; +import type { TraceConfigOptions } from "@traceai/fi-core"; import { providerForAgentModel } from "./agentModels"; import { FIAttributes, VoltAgentAttributes as VA } from "./attributes"; -import { copyOperationOutput, mapSpanEvents, mapVoltAgentAttributes, reconcileOperationUsage } from "./mapping"; +import { + type MapOptions, + copyOperationOutput, + mapSpanEvents, + mapVoltAgentAttributes, + reconcileOperationUsage, +} from "./mapping"; +import { type ContentPolicy, defaultScrubContext, hidesFreeText, resolveContentPolicy, scrubErrorText } from "./privacy"; type Resource = ReadableSpan["resource"]; type SpanEvents = ReadableSpan["events"]; +type SpanStatus = ReadableSpan["status"]; /** * Anything shaped like an OpenTelemetry SDK 2.x `BasicTracerProvider`, such as the @@ -43,11 +52,14 @@ export interface FIVoltAgentSpanProcessorOptions { /** BatchSpanProcessor settings (SDK defaults: queue 2048, batch 512, delay 5000 ms). */ batchConfig?: BufferConfig; /** - * Export prompts, messages, instructions, tool arguments/results and retrieval queries, on span - * attributes and on span event attributes. Default false. VoltAgent itself has no such flag and - * always writes them; this processor drops them from the Future AGI copy unless you opt in. + * fi-core trace config, with the same defaults as every traceAI instrumentor: content (prompts, + * messages, instructions, tool arguments/results, retrieval queries, answers) is exported unless + * you hide it. `hideInputs` / `hideOutputs` (or `FI_HIDE_INPUTS=true` / `FI_HIDE_OUTPUTS=true`) + * hide every input-side / output-side value and the run's error text; `hideInputMessages` / + * `hideOutputMessages` hide the message lists; `hideInputText` / `hideOutputText` keep the + * message roles and replace the text with `__REDACTED__`. Option > env var > default. */ - captureContent?: boolean; + traceConfig?: TraceConfigOptions; /** * How long an llm span waits for its operation's root span before it is exported without * usage reconciliation. Default 30000 ms. @@ -67,6 +79,7 @@ interface PendingLLMSpan { source: Attributes; attributes: Attributes; events: SpanEvents; + status: SpanStatus; isError: boolean; } @@ -88,7 +101,8 @@ let globalConflictWarned = false; * (VoltOps, local storage, websocket) is never modified: this processor exports a copy. */ export class FIVoltAgentSpanProcessor implements SpanProcessor { - private readonly captureContent: boolean; + private readonly policy: ContentPolicy; + private readonly mapOptions: MapOptions; private readonly reconciliationTimeoutMs: number; private readonly delegate: Delegate; private readonly pending = new Map(); @@ -98,7 +112,14 @@ export class FIVoltAgentSpanProcessor implements SpanProcessor { if (!options || (!options.tracerProvider && !options.exporter)) { throw new Error("FIVoltAgentSpanProcessor needs a tracerProvider (from register()) or an exporter"); } - this.captureContent = options.captureContent === true; + this.policy = resolveContentPolicy(options.traceConfig); + this.mapOptions = { policy: this.policy, scrub: defaultScrubContext() }; + if ((options as { captureContent?: unknown }).captureContent !== undefined) { + diag.warn( + "@traceai/voltagent: captureContent was removed. Content is exported by default; hide it with " + + "traceConfig ({ hideInputs, hideOutputs, ... }) or FI_HIDE_INPUTS / FI_HIDE_OUTPUTS.", + ); + } this.reconciliationTimeoutMs = options.usageReconciliationTimeoutMs ?? DEFAULT_RECONCILIATION_TIMEOUT_MS; this.delegate = options.tracerProvider ? delegateFromProvider(options.tracerProvider, options) @@ -113,13 +134,15 @@ export class FIVoltAgentSpanProcessor implements SpanProcessor { if (this.isShutdown) return; try { const source = span.attributes ?? {}; - const options = { captureContent: this.captureContent }; + const options = this.mapOptions; const mapped = mapVoltAgentAttributes(source, options); if (mapped.isModelCall || mapped.isOperationRoot) { setProviderFromModelObject(source, mapped.attributes, mapped.isModelCall); } - // Event attributes carry content too (guardrail stream chunks, workflow suspend/resume data). + // Event attributes carry content too (guardrail stream chunks, workflow suspend/resume data) + // and exception events carry stack traces. const events = mapSpanEvents(span.events, options); + const status = this.exportStatus(span, source); if (mapped.isModelCall && mapped.operationId) { this.hold(mapped.operationId, { @@ -127,6 +150,7 @@ export class FIVoltAgentSpanProcessor implements SpanProcessor { source, attributes: mapped.attributes, events, + status, isError: span.status?.code === SpanStatusCode.ERROR, }); return; @@ -140,18 +164,17 @@ export class FIVoltAgentSpanProcessor implements SpanProcessor { } catch (error) { diag.warn("@traceai/voltagent: usage reconciliation failed", error); } - if (this.captureContent) { - try { - copyOperationOutput(source, operation.spans); - } catch (error) { - diag.warn("@traceai/voltagent: copying the operation output failed", error); - } + try { + // Reads the mapped root: no output when outputs are hidden. + copyOperationOutput(mapped.attributes, operation.spans); + } catch (error) { + diag.warn("@traceai/voltagent: copying the operation output failed", error); } - for (const held of operation.spans) this.forward(held.original, held.attributes, held.events); + for (const held of operation.spans) this.forward(held.original, held.attributes, held.events, held.status); } } - this.forward(span, mapped.attributes, events); + this.forward(span, mapped.attributes, events, status); } catch (error) { diag.error("@traceai/voltagent: failed to map or export a VoltAgent span", error); } @@ -205,20 +228,46 @@ export class FIVoltAgentSpanProcessor implements SpanProcessor { private release(operationId: string): void { const operation = this.take(operationId); if (!operation) return; - for (const held of operation.spans) this.forward(held.original, held.attributes, held.events); + for (const held of operation.spans) this.forward(held.original, held.attributes, held.events, held.status); } private releaseAll(): void { for (const operationId of Array.from(this.pending.keys())) this.release(operationId); } - private forward(span: ReadableSpan, attributes: Attributes, events: SpanEvents): void { + private forward(span: ReadableSpan, attributes: Attributes, events: SpanEvents, status: SpanStatus): void { try { - this.delegate.processor.onEnd(copySpan(span, attributes, this.delegate.resource ?? span.resource, events)); + this.delegate.processor.onEnd( + copySpan(span, attributes, this.delegate.resource ?? span.resource, events, status), + ); } catch (error) { diag.error("@traceai/voltagent: exporter rejected a span", error); } } + + /** + * The status message is the thrown error's text (a tool error naming its argument, an API error + * with a local path). Exported with paths, emails and local user/host names removed; when inputs + * or outputs are hidden, an ERROR status carries the error type only. + */ + private exportStatus(span: ReadableSpan, source: Attributes): SpanStatus { + const status = span.status; + if (!status || typeof status.message !== "string" || status.message.length === 0) return status; + if (!hidesFreeText(this.policy)) return { ...status, message: scrubErrorText(status.message, this.mapOptions.scrub) }; + const errorType = status.code === SpanStatusCode.ERROR ? errorTypeOf(span, source) : undefined; + return errorType ? { ...status, message: errorType } : { code: status.code }; + } +} + +/** The error's class name, from VoltAgent's `error.type` or the exception event's `exception.type`. */ +function errorTypeOf(span: ReadableSpan, source: Attributes): string | undefined { + const fromAttribute = source["error.type"]; + if (typeof fromAttribute === "string" && /^[\w.$-]{1,80}$/.test(fromAttribute)) return fromAttribute; + for (const event of span.events ?? []) { + const type = event.attributes?.["exception.type"]; + if (typeof type === "string" && /^[\w.$-]{1,80}$/.test(type)) return type; + } + return undefined; } /** Fill gen_ai.provider.name from the agent's AI SDK model object when VoltAgent set none. */ @@ -236,14 +285,16 @@ function setProviderFromModelObject(source: Attributes, attributes: Attributes, } /** - * A ReadableSpan with new attributes, resource and (optionally) events; every other field reads - * through. Pass events filtered with `mapSpanEvents`, or the original events are copied as-is. + * A ReadableSpan with new attributes, resource, events and status; every other field reads + * through. Pass events filtered with `mapSpanEvents` (the span's own events still carry content + * and `exception.stacktrace`). */ export function copySpan( span: ReadableSpan, attributes: Attributes, resource: Resource, - events: SpanEvents = span.events, + events: SpanEvents, + status: SpanStatus = span.status, ): ReadableSpan { const spanContext = span.spanContext(); const copy = { @@ -253,7 +304,7 @@ export function copySpan( parentSpanContext: span.parentSpanContext, startTime: span.startTime, endTime: span.endTime, - status: span.status, + status, attributes, links: span.links, events, diff --git a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts index a9dba8f04..b30e22031 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/mapping.test.ts @@ -1,16 +1,23 @@ import { providerFromAiSdk } from "../mapping"; import { FISpanKind } from "@traceai/fi-semantic-conventions"; import { + contentSide, isContentKey, + isFreeTextKey, + isStackKey, + mapSpanEvents, isPromotedUsageKey, isSecretKey, mapVoltAgentAttributes, reconcileOperationUsage, resolveSpanKind, } from "../mapping"; +import { SHOW_ALL } from "../privacy"; -const OFF = { captureContent: false }; -const ON = { captureContent: true }; +/** FI_HIDE_INPUTS=true + FI_HIDE_OUTPUTS=true. */ +const OFF = { policy: { ...SHOW_ALL, hideInputs: true, hideOutputs: true } }; +/** traceAI TraceConfig defaults: content captured. */ +const ON = { policy: SHOW_ALL }; /** Keys trace-context.ts (2.11.0) writes on an agent root span. */ function rootSpanAttributes() { @@ -236,7 +243,7 @@ describe("mapVoltAgentAttributes (AC-02)", () => { }); }); -describe("content (AC-07)", () => { +describe("content (AC-07, traceAI TraceConfig: captured by default, FI_HIDE_* hides)", () => { const summaryMemoryPlanContent = { "agent.summary.preview": "SECRET_SUMMARY_PREVIEW", "agent.summary.text": "SECRET_SUMMARY_TEXT", @@ -265,14 +272,14 @@ describe("content (AC-07)", () => { ...summaryMemoryPlanContent, }; - it("drops prompts, messages, instructions, tool payloads and queries by default", () => { + it("drops prompts, messages, instructions, tool payloads and queries with inputs and outputs hidden", () => { const { attributes } = mapVoltAgentAttributes(contentCarrier, OFF); expect(JSON.stringify(attributes)).not.toContain("SECRET"); expect(attributes["input.value"]).toBeUndefined(); expect(attributes["output.value"]).toBeUndefined(); }); - it("drops summary, working-memory and plan text by default and keeps it after opt-in", () => { + it("drops summary, working-memory and plan text when hidden and keeps it by default", () => { const off = mapVoltAgentAttributes({ "span.type": "summary", ...summaryMemoryPlanContent }, OFF).attributes; const on = mapVoltAgentAttributes({ "span.type": "summary", ...summaryMemoryPlanContent }, ON).attributes; for (const [key, value] of Object.entries(summaryMemoryPlanContent)) { @@ -281,7 +288,7 @@ describe("content (AC-07)", () => { } }); - it("drops eval scorer metadata and guardrail decision metadata by default and keeps them after opt-in", () => { + it("drops eval scorer metadata, guardrail decision metadata and guardrail text when hidden; keeps them by default", () => { // VoltAgent 2.11.0: finalizeScorerSpan stores combineEvalMetadata(...) under eval.scorer.metadata, // and that object holds the run's verbatim input and output; eval.expected is the reference // answer. A guardrail decision's metadata @@ -290,13 +297,14 @@ describe("content (AC-07)", () => { "eval.scorer.metadata": '{"input":"SECRET_EVAL_INPUT","output":"SECRET_EVAL_OUTPUT"}', "eval.expected": "SECRET_EVAL_EXPECTED", "guardrail.result.metadata": '{"matched":"SECRET_GUARDRAIL_MATCH"}', + // Free text: a custom guardrail's message can quote what it matched. + "guardrail.message": "Blocked SECRET_GUARDRAIL_TEXT", }; const kept = { "eval.scorer.id": "scorer-1", "eval.scorer.status": "success", "guardrail.name": "pii", "guardrail.action": "block", - "guardrail.message": "Output blocked due to profanity.", "guardrail.metadata": '{"owner":"team-a"}', }; const off = mapVoltAgentAttributes({ "span.type": "scorer", ...evalAndGuardrail, ...kept }, OFF).attributes; @@ -311,7 +319,7 @@ describe("content (AC-07)", () => { } }); - it("copies input/output to input.value/output.value only after opt-in", () => { + it("copies input/output to input.value/output.value by default", () => { const { attributes } = mapVoltAgentAttributes(rootSpanAttributes(), ON); expect(attributes["input.value"]).toBe("SECRET_PROMPT"); expect(attributes["input.mime_type"]).toBe("text/plain"); @@ -320,7 +328,7 @@ describe("content (AC-07)", () => { expect(attributes["agent.instructions"]).toBe("SECRET_INSTRUCTIONS"); }); - it("uses llm.messages as the llm span's input only after opt-in", () => { + it("uses llm.messages as the llm span's input unless inputs are hidden", () => { // VoltAgent 2.11.0 writes the prompt on llm spans only as llm.messages (agent.ts // buildLLMSpanAttributes), and fi-collector fills a span's input column only from input.value. const llm = { @@ -340,7 +348,7 @@ describe("content (AC-07)", () => { expect(agent["input.value"]).toBeUndefined(); }); - it("uses the vector/embedding query as retriever input only after opt-in", () => { + it("uses the vector/embedding query as retriever input unless inputs are hidden", () => { const off = mapVoltAgentAttributes({ "span.type": "vector", "vector.query": "find cats" }, OFF); expect(off.attributes["input.value"]).toBeUndefined(); const on = mapVoltAgentAttributes({ "span.type": "vector", "vector.query": "find cats" }, ON); @@ -368,11 +376,132 @@ describe("content (AC-07)", () => { expect(isContentKey("guardrail.result.metadata", "{}")).toBe(true); expect(isContentKey("guardrail.metadata", "{}")).toBe(false); expect(isContentKey("guardrail.message", "x")).toBe(false); + expect(isFreeTextKey("guardrail.message", "x")).toBe(true); + expect(isFreeTextKey("exception.message", "x")).toBe(true); + expect(isFreeTextKey("error.message", "x")).toBe(true); + expect(isFreeTextKey("workflow.step.skipped_reason", "x")).toBe(true); + expect(isFreeTextKey("llm.finish_reason", "stop")).toBe(false); + expect(isFreeTextKey("ai.response.finish_reason", "stop")).toBe(false); + expect(contentSide("input", "x")).toBe("input"); + expect(contentSide("output", "x")).toBe("output"); + expect(contentSide("eval.scorer.metadata", "{}")).toBe("both"); + expect(contentSide("middleware.input.original", "x")).toBe("input"); + expect(contentSide("guardrail.output.after", "x")).toBe("output"); + expect(contentSide("workflow.resume.data", "x")).toBe("both"); + expect(contentSide("workspace.fs.path", "/x")).toBe("input"); + }); + + it("hides one side at a time (FI_HIDE_INPUTS / FI_HIDE_OUTPUTS)", () => { + const inputsOff = mapVoltAgentAttributes(rootSpanAttributes(), { policy: { ...SHOW_ALL, hideInputs: true } }).attributes; + expect(inputsOff.input).toBeUndefined(); + expect(inputsOff["input.value"]).toBeUndefined(); + expect(inputsOff["agent.instructions"]).toBeUndefined(); + expect(inputsOff["agent.messages"]).toBeUndefined(); + expect(inputsOff["agent.stateSnapshot"]).toBeUndefined(); // holds both sides + expect(inputsOff["output.value"]).toBe("SECRET_ANSWER"); + const outputsOff = mapVoltAgentAttributes(rootSpanAttributes(), { policy: { ...SHOW_ALL, hideOutputs: true } }).attributes; + expect(outputsOff.output).toBeUndefined(); + expect(outputsOff["output.value"]).toBeUndefined(); + expect(outputsOff["agent.stateSnapshot"]).toBeUndefined(); + expect(outputsOff["input.value"]).toBe("SECRET_PROMPT"); + }); + + it("FI_HIDE_INPUT_MESSAGES drops the message lists; FI_HIDE_INPUT_TEXT keeps roles and redacts text", () => { + const llm = { + "span.type": "llm", + "llm.model": "m", + "llm.messages": '[{"role":"system","content":"SECRET_SYS"},{"role":"user","content":[{"type":"text","text":"SECRET_PROMPT"}]}]', + }; + const noMessages = mapVoltAgentAttributes(llm, { policy: { ...SHOW_ALL, hideInputMessages: true } }).attributes; + expect(noMessages["llm.messages"]).toBeUndefined(); + expect(noMessages["input.value"]).toBeUndefined(); + const noText = mapVoltAgentAttributes(llm, { policy: { ...SHOW_ALL, hideInputText: true } }).attributes; + expect(JSON.parse(String(noText["llm.messages"]))).toEqual([ + { role: "system", content: "__REDACTED__" }, + { role: "user", content: "__REDACTED__" }, + ]); + expect(noText["input.value"]).toBe(noText["llm.messages"]); + expect(JSON.stringify(noText)).not.toContain("SECRET"); + // The agent root's own input is not a message list: FI_HIDE_INPUT_TEXT leaves it (fi-core semantics). + const root = mapVoltAgentAttributes(rootSpanAttributes(), { policy: { ...SHOW_ALL, hideInputText: true } }).attributes; + expect(root["input.value"]).toBe("SECRET_PROMPT"); + expect(JSON.parse(String(root["agent.messages"]))).toEqual([{ role: "user", content: "__REDACTED__" }]); + // UI messages carry parts instead of content. + const ui = mapVoltAgentAttributes( + { "entity.type": "agent", "agent.messages.ui": '[{"role":"user","parts":[{"type":"text","text":"SECRET"}]}]' }, + { policy: { ...SHOW_ALL, hideInputText: true } }, + ).attributes; + expect(JSON.parse(String(ui["agent.messages.ui"]))).toEqual([{ role: "user", parts: "__REDACTED__" }]); + }); +}); + +describe("stack traces, local paths and error text (never exported, either mode)", () => { + const scrub = { cwd: "/Users/someone/app", home: "/Users/someone" }; + const failingTool = { + "span.type": "tool", + "tool.name": "read_config", + input: '{"file":"/Users/someone/app/config.json"}', + output: "read /Users/someone/.ssh/known_hosts and /tmp/x.log", + "error.type": "Error", + "error.message": "ENOENT /Users/someone/app/data.db (owner ops@example.com)", + "error.stack": "Error: ENOENT\n at readFile (/Users/someone/app/node_modules/x/index.js:10:5)", + "workspace.fs.path": "/Users/someone/app/src/a.ts", + "eval.scorer.error_message": "judge failed at /home/ci/run", + }; + + it("drops error.stack and rewrites paths in every kept string by default", () => { + const { attributes } = mapVoltAgentAttributes(failingTool, { ...ON, scrub }); + expect(attributes["error.stack"]).toBeUndefined(); + expect(attributes.input).toBe('{"file":"[cwd]/config.json"}'); + expect(attributes["input.value"]).toBe('{"file":"[cwd]/config.json"}'); + expect(attributes.output).toBe("read ~/.ssh/known_hosts and [path]"); + expect(attributes["workspace.fs.path"]).toBe("[cwd]/src/a.ts"); + expect(attributes["error.message"]).toBe("ENOENT [cwd]/data.db (owner )"); + expect(attributes["eval.scorer.error_message"]).toBe("judge failed at [path]"); + expect(attributes["error.type"]).toBe("Error"); + expect(JSON.stringify(attributes)).not.toContain("/Users/"); + expect(JSON.stringify(attributes)).not.toContain(" at "); + }); + + it("drops error text when inputs or outputs are hidden; keeps the error type", () => { + for (const policy of [OFF.policy, { ...SHOW_ALL, hideInputs: true }, { ...SHOW_ALL, hideOutputs: true }]) { + const { attributes } = mapVoltAgentAttributes(failingTool, { policy, scrub }); + expect(attributes["error.message"]).toBeUndefined(); + expect(attributes["eval.scorer.error_message"]).toBeUndefined(); + expect(attributes["error.stack"]).toBeUndefined(); + expect(attributes["error.type"]).toBe("Error"); + } + }); + + it("filters exception events: no stacktrace ever, message scrubbed by default and dropped when hidden", () => { + const events = [ + { + name: "exception", + time: [1, 2] as [number, number], + attributes: { + "exception.type": "TypeError", + "exception.message": "bad value in /Users/someone/app/x.ts for ops@example.com", + "exception.stacktrace": "TypeError: bad\n at f (/Users/someone/app/x.ts:1:1)", + }, + }, + ]; + const shown = mapSpanEvents(events, { ...ON, scrub })[0].attributes ?? {}; + expect(shown).toEqual({ "exception.type": "TypeError", "exception.message": "bad value in [cwd]/x.ts for " }); + const hidden = mapSpanEvents(events, { ...OFF, scrub })[0].attributes ?? {}; + expect(hidden).toEqual({ "exception.type": "TypeError" }); + expect(events[0].attributes["exception.stacktrace"]).toContain(" at "); // the original is untouched + }); + + it("classifies stack keys", () => { + expect(isStackKey("error.stack")).toBe(true); + expect(isStackKey("exception.stacktrace")).toBe(true); + expect(isStackKey("error.stack_trace")).toBe(true); + expect(isStackKey("stack.size")).toBe(false); }); }); describe("credentials", () => { - it("never exports API keys or headers, even with captureContent", () => { + it("never exports API keys or headers, even with content captured", () => { const { attributes } = mapVoltAgentAttributes( { "span.type": "llm", diff --git a/typescript/packages/traceai_voltagent/src/__tests__/privacy.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/privacy.test.ts new file mode 100644 index 000000000..e878c3496 --- /dev/null +++ b/typescript/packages/traceai_voltagent/src/__tests__/privacy.test.ts @@ -0,0 +1,158 @@ +import * as os from "os"; +import { + SHOW_ALL, + defaultScrubContext, + redactMessageText, + resolveContentPolicy, + scrubContent, + scrubErrorText, +} from "../privacy"; + +const ENV_KEYS = [ + "FI_HIDE_INPUTS", + "FI_HIDE_OUTPUTS", + "FI_HIDE_INPUT_MESSAGES", + "FI_HIDE_OUTPUT_MESSAGES", + "FI_HIDE_INPUT_TEXT", + "FI_HIDE_OUTPUT_TEXT", +] as const; + +describe("resolveContentPolicy (traceAI TraceConfig flags)", () => { + const saved: Record = {}; + beforeEach(() => { + for (const key of ENV_KEYS) { + saved[key] = process.env[key]; + delete process.env[key]; + } + }); + afterEach(() => { + for (const key of ENV_KEYS) { + if (saved[key] === undefined) delete process.env[key]; + else process.env[key] = saved[key]; + } + }); + + it("captures content by default, with or without a traceConfig", () => { + expect(resolveContentPolicy()).toEqual(SHOW_ALL); + expect(resolveContentPolicy({})).toEqual(SHOW_ALL); + expect(Object.values(SHOW_ALL).every((value) => value === false)).toBe(true); + }); + + it("reads every FI_HIDE_* env var even when no traceConfig is passed", () => { + for (const key of ENV_KEYS) process.env[key] = "true"; + expect(Object.values(resolveContentPolicy()).every((value) => value === true)).toBe(true); + }); + + it("uses fi-core's env rule: only 'true' (any case) hides", () => { + process.env.FI_HIDE_INPUTS = "TRUE"; + process.env.FI_HIDE_OUTPUTS = "1"; + const policy = resolveContentPolicy(); + expect(policy.hideInputs).toBe(true); + expect(policy.hideOutputs).toBe(false); + }); + + it("gives traceConfig precedence over the env var", () => { + process.env.FI_HIDE_INPUTS = "true"; + process.env.FI_HIDE_OUTPUT_TEXT = "false"; + const policy = resolveContentPolicy({ hideInputs: false, hideOutputText: true }); + expect(policy.hideInputs).toBe(false); + expect(policy.hideOutputText).toBe(true); + }); +}); + +describe("redactMessageText (FI_HIDE_INPUT_TEXT / FI_HIDE_OUTPUT_TEXT)", () => { + it("keeps roles and replaces content and parts", () => { + const value = JSON.stringify([ + { role: "system", content: "s" }, + { role: "user", parts: [{ type: "text", text: "u" }], id: "m1" }, + ]); + expect(JSON.parse(redactMessageText(value) as string)).toEqual([ + { role: "system", content: "__REDACTED__" }, + { role: "user", parts: "__REDACTED__" }, + ]); + }); + + it("drops anything that is not a message list", () => { + expect(redactMessageText("plain text")).toBeUndefined(); + expect(redactMessageText('{"role":"user"}')).toBeUndefined(); + expect(redactMessageText(3)).toBeUndefined(); + }); +}); + +describe("scrubContent (paths and stack traces, either mode)", () => { + const ctx = { cwd: "/Users/someone/app", home: "/Users/someone" }; + + it("rewrites the cwd, the home directory and other local paths", () => { + expect(scrubContent("open /Users/someone/app/src/a.ts", ctx)).toBe("open [cwd]/src/a.ts"); + expect(scrubContent("read /Users/someone/notes.md", ctx)).toBe("read ~/notes.md"); + expect(scrubContent("in /Users/someone/app2/x", ctx)).toBe("in ~/app2/x"); + expect(scrubContent("tmp /tmp/run-1/out.log and /private/var/x", ctx)).toBe("tmp [path] and [path]"); + expect(scrubContent("see file:///etc/hosts", ctx)).toBe("see [path]"); + expect(scrubContent("win C:\\Users\\someone\\a.txt", ctx)).toBe("win [path]"); + }); + + it("leaves URLs, routes and relative paths alone", () => { + const text = "POST http://127.0.0.1:8317/v1/chat/completions then src/a.ts and /v1/messages"; + expect(scrubContent(text, ctx)).toBe(text); + }); + + it("removes V8 stack frames and Python tracebacks", () => { + const js = "Error: boom\n at f (/Users/someone/app/a.js:1:2)\n at g (node:internal/x:3:4)"; + expect(scrubContent(js, ctx)).toBe("Error: boom [stack trace removed]"); + const py = 'oops Traceback (most recent call last):\n File "/home/x/a.py", line 1\nValueError: v'; + expect(scrubContent(py, ctx)).toBe("oops [stack trace removed]"); + }); + + it("scrubs inside JSON (VoltAgent's serialized messages and tool results) and keeps it valid JSON", () => { + const toolError = { error: true, message: "boom", stack: "Error: boom\n at f (/Users/someone/app/a.js:1:2)" }; + const messages = JSON.stringify([ + { role: "tool", content: [{ type: "tool-result", output: { type: "json", value: toolError } }] }, + { role: "user", content: "file /Users/someone/app/README.md" }, + ]); + const out = scrubContent(messages, ctx); + expect(out).not.toContain("/Users/"); + expect(out).not.toContain(" at "); + const parsed = JSON.parse(out); + expect(parsed[0].content[0].output.value.stack).toBe("Error: boom [stack trace removed]"); + expect(parsed[1].content).toBe("file [cwd]/README.md"); + // JSON nested in a JSON string (tool output serialized twice). + const nested = JSON.stringify({ output: JSON.stringify({ path: "/Users/someone/app/x" }) }); + expect(JSON.parse(JSON.parse(scrubContent(nested, ctx)).output).path).toBe("[cwd]/x"); + }); + + it("returns JSON untouched (same formatting) when nothing needs scrubbing", () => { + const text = '{ "a": 1, "b": "plain" }'; + expect(scrubContent(text, ctx)).toBe(text); + }); + + it("handles escaped newlines in text that is not valid JSON", () => { + const broken = '{"stack":"Error: x\\n at f (/Users/someone/app/a.js:1:2)"'; // truncated JSON + const out = scrubContent(broken, ctx); + expect(out).not.toContain(" at "); + expect(out).not.toContain("/Users/"); + }); + + it("defaults to this process's cwd and home directory", () => { + const real = defaultScrubContext(); + expect(real.cwd).toBe(process.cwd()); + expect(real.home).toBe(os.homedir()); + expect(scrubContent(`${process.cwd()}/x`, real)).toBe("[cwd]/x"); + }); +}); + +describe("scrubErrorText", () => { + it("also removes emails and this machine's user and host names", () => { + const user = os.userInfo().username; + const host = os.hostname(); + const out = scrubErrorText(`denied for ops@example.com as ${user} on ${host} at /home/ci/x`, {}); + expect(out).not.toContain("ops@example.com"); + if (user.length >= 3) expect(out).not.toContain(user); + if (host.length >= 3 && host !== "localhost") expect(out).not.toContain(host); + expect(out).toContain(""); + expect(out).toContain("[path]"); + }); + + it("keeps localhost and short words", () => { + expect(scrubErrorText("connect ECONNREFUSED localhost:4318", {})).toBe("connect ECONNREFUSED localhost:4318"); + }); +}); diff --git a/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts index ffe08914e..95327be4d 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts @@ -1,8 +1,9 @@ -import { SpanKind, SpanStatusCode } from "@opentelemetry/api"; +import { DiagLogLevel, SpanKind, SpanStatusCode, diag } from "@opentelemetry/api"; import { ExportResultCode } from "@opentelemetry/core"; import { InMemorySpanExporter, type ReadableSpan, type SpanExporter } from "@opentelemetry/sdk-trace-base"; import { Agent } from "@voltagent/core"; import { z } from "zod"; +import type { TraceConfigOptions } from "@traceai/fi-core"; import { FIVoltAgentSpanProcessor } from "../FIVoltAgentSpanProcessor"; import { isPromotedUsageKey } from "../mapping"; import { @@ -34,7 +35,9 @@ afterEach(async () => { observability = undefined; }); -async function runToolCallingAgent(options: { captureContent?: boolean } = {}) { +const HIDDEN: TraceConfigOptions = { hideInputs: true, hideOutputs: true }; + +async function runToolCallingAgent(options: { traceConfig?: TraceConfigOptions } = {}) { const { exporter, provider } = fiProvider(); const recorder = new RecordingProcessor(); const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider, ...options }); @@ -121,24 +124,89 @@ describe("FIVoltAgentSpanProcessor with a real VoltAgent agent (AC-01)", () => { expect(root["usage.prompt_tokens"]).toBe(modelCallInputTokens); }); - it("exports no content by default", async () => { - const { exported } = await runToolCallingAgent(); - const blob = JSON.stringify(exported.map((span) => [span.name, span.attributes, span.events])); + it("exports no content with hideInputs + hideOutputs (FI_HIDE_INPUTS / FI_HIDE_OUTPUTS)", async () => { + const { exported, recorded } = await runToolCallingAgent({ traceConfig: HIDDEN }); + const blob = JSON.stringify(exported.map((span) => [span.name, span.attributes, span.events, span.status])); for (const marker of Object.values(MARKERS)) expect(blob).not.toContain(marker); for (const span of exported) { for (const key of ["input", "output", "input.value", "output.value", "llm.messages", "agent.instructions"]) { expect(attrs(span)[key]).toBeUndefined(); } } - // Exception events keep exception.type / .message / .stacktrace (README: passed through). - const exception = one(exported, "tool.execution:explode").events.find((event) => event.name === "exception"); + // The error keeps its type only: no message, no stack trace, a status carrying the type. + const failing = one(exported, "tool.execution:explode"); + const exception = failing.events.find((event) => event.name === "exception"); + expect(exception?.attributes?.["exception.type"]).toEqual(expect.any(String)); + expect(exception?.attributes?.["exception.message"]).toBeUndefined(); + expect(exception?.attributes?.["exception.stacktrace"]).toBeUndefined(); + expect(attrs(failing)["error.message"]).toBeUndefined(); + expect(failing.status).toEqual({ code: SpanStatusCode.ERROR, message: attrs(failing)["error.type"] }); + expect(blob).not.toContain("tool exploded"); + // Control: VoltAgent wrote the message and the stack on the span the other processors got. + const original = one(recorded, "tool.execution:explode"); + expect(original.status.message).toBe("tool exploded"); + expect(String(original.events.find((e) => e.name === "exception")?.attributes?.["exception.stacktrace"])).toContain( + " at ", + ); + }); + + it("never exports a stack trace; the error message stays by default", async () => { + const { exported } = await runToolCallingAgent(); + const failing = one(exported, "tool.execution:explode"); + const exception = failing.events.find((event) => event.name === "exception"); expect(exception?.attributes?.["exception.message"]).toBe("tool exploded"); expect(exception?.attributes?.["exception.type"]).toEqual(expect.any(String)); - expect(exception?.attributes?.["exception.stacktrace"]).toEqual(expect.stringContaining("tool exploded")); + expect(exception?.attributes?.["exception.stacktrace"]).toBeUndefined(); + expect(attrs(failing)["error.stack"]).toBeUndefined(); + expect(failing.status).toEqual({ code: SpanStatusCode.ERROR, message: "tool exploded" }); + const blob = JSON.stringify(exported.map((span) => [span.attributes, span.events, span.status])); + expect(blob).not.toContain(" at "); + expect(blob).not.toContain(process.cwd()); + }); + + it("reads FI_HIDE_INPUTS / FI_HIDE_OUTPUTS from the environment; traceConfig wins over env", async () => { + const saved = { inputs: process.env.FI_HIDE_INPUTS, outputs: process.env.FI_HIDE_OUTPUTS }; + process.env.FI_HIDE_INPUTS = "TRUE"; + process.env.FI_HIDE_OUTPUTS = "true"; + try { + const hidden = await runToolCallingAgent(); + const blob = JSON.stringify(hidden.exported.map((span) => [span.attributes, span.events, span.status])); + for (const marker of Object.values(MARKERS)) expect(blob).not.toContain(marker); + await resetOtelGlobals(observability); + const shown = await runToolCallingAgent({ traceConfig: { hideInputs: false, hideOutputs: false } }); + expect(attrs(one(shown.exported, "assistant"))["input.value"]).toBe(MARKERS.prompt); + await resetOtelGlobals(observability); + process.env.FI_HIDE_INPUTS = "1"; // fi-core: only "true" hides + process.env.FI_HIDE_OUTPUTS = "false"; + const notHidden = await runToolCallingAgent(); + expect(attrs(one(notHidden.exported, "assistant"))["input.value"]).toBe(MARKERS.prompt); + } finally { + if (saved.inputs === undefined) delete process.env.FI_HIDE_INPUTS; + else process.env.FI_HIDE_INPUTS = saved.inputs; + if (saved.outputs === undefined) delete process.env.FI_HIDE_OUTPUTS; + else process.env.FI_HIDE_OUTPUTS = saved.outputs; + } + }); + + it("warns that the removed captureContent option does nothing", () => { + const warnings: string[] = []; + diag.setLogger( + { warn: (message: string) => warnings.push(message), error() {}, info() {}, debug() {}, verbose() {} }, + DiagLogLevel.WARN, + ); + try { + new FIVoltAgentSpanProcessor({ + exporter: new InMemorySpanExporter(), + captureContent: false, + } as unknown as ConstructorParameters[0]); + } finally { + diag.disable(); + } + expect(warnings.some((message) => message.includes("captureContent was removed"))).toBe(true); }); - it("exports content only after captureContent: true (control run)", async () => { - const { exported } = await runToolCallingAgent({ captureContent: true }); + it("exports content by default (traceAI TraceConfig defaults)", async () => { + const { exported } = await runToolCallingAgent(); const root = attrs(one(exported, "assistant")); expect(root["input.value"]).toBe(MARKERS.prompt); expect(root["output.value"]).toBe(MARKERS.answer); @@ -152,8 +220,8 @@ describe("FIVoltAgentSpanProcessor with a real VoltAgent agent (AC-01)", () => { expect(llm["output.value"]).toBe(MARKERS.answer); }); - it("leaves the llm span's output empty when content is off", async () => { - const { exported } = await runToolCallingAgent(); + it("leaves the llm span's input and output empty when inputs and outputs are hidden", async () => { + const { exported } = await runToolCallingAgent({ traceConfig: HIDDEN }); const llm = attrs(one(exported, "llm:generateText")); expect(llm["input.value"]).toBeUndefined(); expect(llm["output.value"]).toBeUndefined(); @@ -198,7 +266,7 @@ describe("provider from the agent's AI SDK model object", () => { describe("streamText", () => { it("maps the streaming path and reconciles its multi-step usage", async () => { const { exporter, provider } = fiProvider(); - const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider }); + const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider, traceConfig: HIDDEN }); const { model, reported } = scriptedModel("mockai/mock-model-1", toolCallingSteps()); const agent = new Agent({ name: "assistant", instructions: "x", model, tools: [weatherTool, explodingTool] }); observability = voltagent({ assistant: agent }, [processor]); @@ -212,6 +280,7 @@ describe("streamText", () => { expect(promotedInputTokens(spans)).toBe(reported.reduce((sum, step) => sum + step.input, 0)); expect(llm["fi.span.kind"]).toBe("LLM"); expect(attrs(one(spans, "assistant"))["session.id"]).toBe("conv-stream"); + // Hidden: no prompt anywhere. expect(JSON.stringify(spans.map((span) => span.attributes))).not.toContain(MARKERS.prompt); }); }); @@ -244,7 +313,7 @@ describe("coexistence with other processors in the same array (AC-06)", () => { describe("subagents (AC-04)", () => { it("puts the subagent in the supervisor's trace under the delegate_task tool span", async () => { const { exporter, provider } = fiProvider(); - const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider }); + const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider, traceConfig: HIDDEN }); const child = scriptedModel("mockai/child-model", [{ kind: "text", text: "child answer", input: 5, output: 3 }]); const supervisorModel = scriptedModel("mockai/supervisor-model", [ { @@ -470,9 +539,9 @@ describe("span events (M1)", () => { { name: "workflow.resumed", attributes: { "resume.step_index": 0, "resume.data": '{"note":"SECRET_RESUME_DATA"}' } }, ]); - function exportWith(captureContent: boolean) { + function exportWith(hidden: boolean) { const exporter = new InMemorySpanExporter(); - const processor = new FIVoltAgentSpanProcessor({ exporter, batch: false, captureContent }); + const processor = new FIVoltAgentSpanProcessor({ exporter, batch: false, traceConfig: hidden ? HIDDEN : {} }); const originals = [guardrailSpan(), workflowSpan()]; const before = JSON.stringify(originals.map((span) => span.events)); for (const span of originals) processor.onEnd(span); @@ -487,8 +556,8 @@ describe("span events (M1)", () => { return { exported, event }; } - it("removes content from event attributes by default; names, times, counts and exceptions stay", () => { - const { exported, event } = exportWith(false); + it("removes content and error text from event attributes when hidden; names, times, counts and exception types stay", () => { + const { exported, event } = exportWith(true); expect(one(exported, "guardrail.output.stream.1").events.map((e) => [e.name, e.time])).toEqual([ ["guardrail.stream.start", [0, 1]], ["guardrail.stream.process", [0, 2]], @@ -501,23 +570,21 @@ describe("span events (M1)", () => { "guardrail.chunk.type": "text-delta", "guardrail.chunk.action": "pass", }); - expect(event("guardrail.output.stream.1", "exception")).toEqual({ - "exception.type": "Error", - "exception.message": "guardrail failed", - "exception.stacktrace": "Error: guardrail failed\n at handler (guardrail.ts:1:1)", - }); - expect(event("workflow.approval", "workflow.suspended")).toEqual({ - "suspension.step_index": 0, - "suspension.reason": "needs approval", - }); + expect(event("guardrail.output.stream.1", "exception")).toEqual({ "exception.type": "Error" }); + expect(event("workflow.approval", "workflow.suspended")).toEqual({ "suspension.step_index": 0 }); expect(event("workflow.approval", "workflow.resumed")).toEqual({ "resume.step_index": 0 }); const blob = JSON.stringify(exported.map((span) => span.events)); expect(blob).not.toContain("SECRET"); expect(blob).not.toContain("PLACEHOLDER"); }); - it("keeps event content after captureContent: true, but never credentials", () => { - const { exported, event } = exportWith(true); + it("keeps event content by default, but never credentials or stack traces", () => { + const { exported, event } = exportWith(false); + expect(event("guardrail.output.stream.1", "exception")).toEqual({ + "exception.type": "Error", + "exception.message": "guardrail failed", + }); + expect(event("workflow.approval", "workflow.suspended")["suspension.reason"]).toBe("needs approval"); expect(event("guardrail.output.stream.1", "guardrail.stream.process")["guardrail.chunk.text"]).toBe( "SECRET_CHUNK_TEXT", ); @@ -531,10 +598,10 @@ describe("span events (M1)", () => { }); describe("span events from a real agent and workflow (M1)", () => { - async function runEventJourney(captureContent: boolean) { + async function runEventJourney(hidden: boolean) { const { exporter, provider } = fiProvider(); const recorder = new RecordingProcessor(); - const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider, captureContent }); + const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider, traceConfig: hidden ? HIDDEN : undefined }); const { model } = scriptedModel("mockai/mock-model-1", [{ kind: "text", text: MARKERS.answer, input: 3, output: 2 }]); const agent = new Agent({ name: "assistant", instructions: "x", model, outputGuardrails: [passThroughGuardrail()] }); const workflow = approvalWorkflow(); @@ -562,15 +629,15 @@ describe("span events from a real agent and workflow (M1)", () => { return { exported, events: (name: string) => events(exported, name) }; } - it("drops streamed guardrail text and workflow suspend/resume payloads from events by default", async () => { - const { exported, events } = await runEventJourney(false); + it("drops streamed guardrail text and workflow suspend/resume payloads from events when hidden", async () => { + const { exported, events } = await runEventJourney(true); const processed = events("guardrail.stream.process"); expect(processed.map((a) => a["guardrail.chunk.type"])).toContain("text-delta"); for (const a of processed) expect(a["guardrail.chunk.text"]).toBeUndefined(); expect(events("guardrail.stream.start")).toHaveLength(1); const [suspended] = events("workflow.suspended"); expect(suspended).toMatchObject({ "suspension.step_index": 0 }); - expect(suspended["suspension.reason"]).toEqual(expect.any(String)); + expect(suspended["suspension.reason"]).toBeUndefined(); // free text, hidden with inputs/outputs expect(suspended["suspension.data"]).toBeUndefined(); expect(suspended["suspension.checkpoint"]).toBeUndefined(); const [resumed] = events("workflow.resumed"); @@ -584,8 +651,8 @@ describe("span events from a real agent and workflow (M1)", () => { } }); - it("keeps them after captureContent: true (control run)", async () => { - const { events } = await runEventJourney(true); + it("keeps them by default (control run)", async () => { + const { events } = await runEventJourney(false); expect(events("guardrail.stream.process").map((a) => a["guardrail.chunk.text"])).toContain(MARKERS.answer); const [suspended] = events("workflow.suspended"); expect(String(suspended["suspension.data"])).toContain(MARKERS.suspendData); diff --git a/typescript/packages/traceai_voltagent/src/index.ts b/typescript/packages/traceai_voltagent/src/index.ts index a4eb1ad94..5f1b5c64c 100644 --- a/typescript/packages/traceai_voltagent/src/index.ts +++ b/typescript/packages/traceai_voltagent/src/index.ts @@ -7,16 +7,30 @@ export { export { mapVoltAgentAttributes, mapSpanEvents, + exportValue, reconcileOperationUsage, copyOperationOutput, providerFromAiSdk, resolveSpanKind, + contentSide, isContentKey, + isFreeTextKey, isPromotedUsageKey, isSecretKey, + isStackKey, + type ContentSide, type MapOptions, type MappedAttributes, type SpanEventLike, } from "./mapping"; +export { + resolveContentPolicy, + scrubContent, + scrubErrorText, + defaultScrubContext, + SHOW_ALL, + type ContentPolicy, + type ScrubContext, +} from "./privacy"; export { VoltAgentAttributes, FIAttributes, VoltAgentFIAttributes } from "./attributes"; export { providerForAgentModel } from "./agentModels"; diff --git a/typescript/packages/traceai_voltagent/src/mapping.ts b/typescript/packages/traceai_voltagent/src/mapping.ts index ee81bfa7b..af1deb9a6 100644 --- a/typescript/packages/traceai_voltagent/src/mapping.ts +++ b/typescript/packages/traceai_voltagent/src/mapping.ts @@ -1,10 +1,20 @@ import type { Attributes, AttributeValue } from "@opentelemetry/api"; import { FISpanKind } from "@traceai/fi-semantic-conventions"; import { FIAttributes, VoltAgentAttributes as VA, VoltAgentFIAttributes } from "./attributes"; +import { + type ContentPolicy, + type ScrubContext, + hidesFreeText, + redactMessageText, + scrubContent, + scrubErrorText, +} from "./privacy"; export interface MapOptions { - /** Copy prompts, messages, tool arguments/results and retrieval queries. Default false. */ - captureContent: boolean; + /** The resolved TraceConfig flags (`resolveContentPolicy`). Content is exported unless hidden. */ + policy: ContentPolicy; + /** The working and home directories rewritten to `[cwd]` / `~` in exported strings. */ + scrub?: ScrubContext; } export interface MappedAttributes { @@ -42,93 +52,177 @@ export function isPromotedUsageKey(key: string): boolean { } /** - * Content-bearing keys VoltAgent 2.11.0 writes (prompts, messages, tool args/results, - * system instructions, memory payloads, retrieval queries). Dropped unless captureContent. + * Content-bearing keys VoltAgent 2.11.0 writes, by side. Input-side keys are hidden by + * `hideInputs` (FI_HIDE_INPUTS), output-side keys by `hideOutputs` (FI_HIDE_OUTPUTS), and keys that + * hold both (state snapshots, eval metadata, ...) by either. Exported by default (TraceConfig). */ -const CONTENT_EXACT = new Set([ +const INPUT_EXACT = new Set([ "input", - "output", "agent.instructions", - "agent.messages", - "agent.messages.ui", "agent.context", - "agent.stateSnapshot", - "llm.messages", "workflow.context", - // The workflow root's snapshot: step source code plus the run input, which workflow/core.ts - // stores under `inputSchema` (`inputSchema: input`). - "workflow.stateSnapshot", "workspace.sandbox.command", "workspace.sandbox.args", - "suspension.checkpoint", + // Workspace tool arguments: model-chosen paths and glob patterns (also path-scrubbed when shown). + "workspace.fs.path", + "workspace.fs.pattern", + "workspace.sandbox.cwd", + // PlanAgent: the delegation brief. + "planagent.task.description", + // The workflow resume payload (workflow.resumed event). + "resume.data", + "input.value", + "gen_ai.prompts", + "gen_ai.system_instructions", +]); +/** Message lists sent to the model: hidden by hideInputs or hideInputMessages; text by hideInputText. */ +const INPUT_MESSAGE_KEYS = new Set(["llm.messages", "agent.messages", "agent.messages.ui", "gen_ai.input.messages"]); +const OUTPUT_EXACT = new Set([ + "output", + "output.value", // Model-written summary (agent/apply-summarization.ts, span.type=summary). "agent.summary.preview", "agent.summary.text", - // The whole working-memory document (agent.ts, on the agent root). - "agent.workingMemory.finalContent", - // PlanAgent: the plan, the delegation brief and the subagent's answer (planagent/). + // PlanAgent: the plan and the subagent's answer. "planagent.todos", - "planagent.task.description", "planagent.task.response_preview", - // Evals: finalizeScorerSpan (eval.ts) stores combineEvalMetadata(...) here, which holds the run's - // verbatim input and output. eval.input / eval.output are caught by the segment rule below. + // Each streamed answer chunk an output guardrail sees (guardrail.stream.process event). + "guardrail.chunk.text", +]); +const OUTPUT_MESSAGE_KEYS = new Set(["gen_ai.output.messages"]); +const BOTH_EXACT = new Set([ + "agent.stateSnapshot", + // The workflow root's snapshot: step source code plus the run input (workflow/core.ts). + "workflow.stateSnapshot", + "suspension.checkpoint", + "suspension.data", + // The whole working-memory document (agent.ts, on the agent root). + "agent.workingMemory.finalContent", + // Evals: finalizeScorerSpan stores combineEvalMetadata(...) here, with the run's input and output. "eval.scorer.metadata", - // The eval's reference answer (eval.ts scorer attributes). + // The eval's reference answer. "eval.expected", // A guardrail decision's metadata: whatever the guardrail returns, often the matched text. // (guardrail.metadata is the guardrail's own static config and stays.) "guardrail.result.metadata", - // Span-event content: each streamed answer chunk an output guardrail sees - // (agent/streaming/output-guardrail-stream-runner.ts, guardrail.stream.process), and the - // workflow suspend/resume payloads (workflow/open-telemetry/trace-context.ts, - // workflow.suspended / workflow.resumed). Listed here so the value type does not matter. - "guardrail.chunk.text", - "suspension.data", - "resume.data", - // Future AGI / GenAI content keys, in case an upstream span already carries them. - "input.value", - "output.value", - "gen_ai.input.messages", - "gen_ai.output.messages", - "gen_ai.prompts", - "gen_ai.system_instructions", -]); -/** Any dotted segment equal to one of these marks content (middleware.input.original, ...). */ -const CONTENT_SEGMENTS = new Set(["input", "output"]); -/** A final segment equal to one of these marks content (tool.search.query, resume.data, ...). */ -const CONTENT_LAST_SEGMENTS = new Set([ - "messages", - "instructions", - "query", - "context", - "data", - "checkpoint", - "prompt", - "prompts", - "completion", - "content", - "arguments", - "args", ]); - -export function isContentKey(key: string, value: AttributeValue | undefined): boolean { - if (CONTENT_EXACT.has(key)) return true; +/** A final segment equal to one of these marks input content (tool.search.query, ...). */ +const INPUT_LAST_SEGMENTS = new Set(["messages", "instructions", "query", "context", "prompt", "prompts", "arguments", "args"]); +const OUTPUT_LAST_SEGMENTS = new Set(["completion"]); +const BOTH_LAST_SEGMENTS = new Set(["data", "checkpoint", "content"]); + +export type ContentSide = "input" | "output" | "both"; + +/** Which side of the run a key's value comes from, or undefined when it is not content. */ +export function contentSide(key: string, value: AttributeValue | undefined): ContentSide | undefined { + if (INPUT_EXACT.has(key) || INPUT_MESSAGE_KEYS.has(key)) return "input"; + if (OUTPUT_EXACT.has(key) || OUTPUT_MESSAGE_KEYS.has(key)) return "output"; + if (BOTH_EXACT.has(key)) return "both"; // Counts, flags and sizes are never content. - if (typeof value === "number" || typeof value === "boolean") return false; + if (typeof value === "number" || typeof value === "boolean") return undefined; const segments = key.split("."); - if (segments.some((segment) => CONTENT_SEGMENTS.has(segment))) return true; - return CONTENT_LAST_SEGMENTS.has(segments[segments.length - 1]); + // Any dotted segment input/output marks content (middleware.input.original, eval.output, ...). + const isInput = segments.includes("input"); + const isOutput = segments.includes("output"); + if (isInput && isOutput) return "both"; + if (isInput) return "input"; + if (isOutput) return "output"; + const last = segments[segments.length - 1]; + if (INPUT_LAST_SEGMENTS.has(last)) return "input"; + if (OUTPUT_LAST_SEGMENTS.has(last)) return "output"; + if (BOTH_LAST_SEGMENTS.has(last)) return "both"; + return undefined; +} + +export function isContentKey(key: string, value: AttributeValue | undefined): boolean { + return contentSide(key, value) !== undefined; +} + +/** + * Free text written at run time: error messages and human-readable reasons, which can quote the + * input or output (a tool error naming its argument, a custom guardrail's message). Exported with + * paths, emails and local user/host names removed; hidden when inputs or outputs are hidden. + */ +const FREE_TEXT_EXACT = new Set([ + "error.message", + "exception.message", + "eval.scorer.error_message", + "workspace.error", + "guardrail.message", + "guardrail.reason", + "suspension.reason", + "cancellation.reason", + "workflow.step.skipped_reason", + "workflow.step.suspension_reason", + "workflow.step.cancellation_reason", +]); + +export function isFreeTextKey(key: string, value: AttributeValue | undefined): boolean { + if (FREE_TEXT_EXACT.has(key)) return true; + if (typeof value !== "string") return false; + const last = key.split(".").pop() ?? ""; + if (last === "finish_reason") return false; + return last === "message" || last === "error_message" || last === "reason" || last.endsWith("_reason"); +} + +/** Stack traces carry local paths and source lines: never exported. */ +const STACK_SEGMENT = /^(stack|stacktrace|stack_trace|stacktraces)$/i; + +export function isStackKey(key: string): boolean { + return STACK_SEGMENT.test(key.split(".").pop() ?? ""); } -/** Credentials never belong on a span, whatever captureContent says. */ +/** Credentials never belong on a span, whatever the content settings say. */ const SECRET_SEGMENT = /^(api[_-]?key|apikey|secret|secret[_-]?key|password|passwd|authorization|auth[_-]?token|access[_-]?token|bearer|cookie|set-cookie|x-api-key|x-secret-key|headers?)$/i; export function isSecretKey(key: string): boolean { return key.split(".").some((segment) => SECRET_SEGMENT.test(segment)); } -/** The OpenTelemetry exception event keys (type, message, stacktrace, escaped). */ -const EXCEPTION_PREFIX = "exception."; +function hiddenBySide(side: ContentSide, key: string, policy: ContentPolicy): boolean { + if (side === "both") return policy.hideInputs || policy.hideOutputs; + if (side === "input") { + if (policy.hideInputs) return true; + return INPUT_MESSAGE_KEYS.has(key) && policy.hideInputMessages; + } + if (policy.hideOutputs) return true; + return OUTPUT_MESSAGE_KEYS.has(key) && policy.hideOutputMessages; +} + +/** + * The value one VoltAgent attribute gets on the exported copy, or undefined to drop it. + * Order: credentials and stack traces are always dropped; free text and content follow the + * TraceConfig flags; every string that is kept has its local paths and stack frames removed. + */ +export function exportValue(key: string, value: AttributeValue | undefined, options: MapOptions): AttributeValue | undefined { + if (value === undefined || value === null) return undefined; + if (isSecretKey(key) || isStackKey(key)) return undefined; + const { policy, scrub } = options; + if (isFreeTextKey(key, value)) { + if (hidesFreeText(policy)) return undefined; + return typeof value === "string" ? scrubErrorText(value, scrub) : value; + } + const side = contentSide(key, value); + if (side !== undefined && hiddenBySide(side, key, policy)) return undefined; + let out: AttributeValue = value; + if ( + typeof out === "string" && + ((INPUT_MESSAGE_KEYS.has(key) && policy.hideInputText) || (OUTPUT_MESSAGE_KEYS.has(key) && policy.hideOutputText)) + ) { + const redacted = redactMessageText(out); + if (redacted === undefined) return undefined; + out = redacted; + } + return scrubValue(out, scrub); +} + +function scrubValue(value: AttributeValue, scrub?: ScrubContext): AttributeValue { + if (typeof value === "string") return scrubContent(value, scrub); + if (Array.isArray(value)) { + return value.map((item) => (typeof item === "string" ? scrubContent(item, scrub) : item)) as AttributeValue; + } + return value; +} /** A span event as `ReadableSpan.events` holds it. */ export interface SpanEventLike { @@ -137,10 +231,10 @@ export interface SpanEventLike { } /** - * Filter span event attributes the way span attributes are filtered: credential keys are always - * removed, content keys are removed unless captureContent. `exception.*` keys are kept (exception - * events pass through). Event names, times and every other field are kept. Returns new event - * objects; the events of the span other processors hold are never mutated. + * Filter span event attributes the way span attributes are filtered (`exportValue`): credentials + * and stack traces (`exception.stacktrace`) are always removed, content and error text follow the + * TraceConfig flags, local paths are rewritten. Event names, times and every other field are kept. + * Returns new event objects; the events of the span other processors hold are never mutated. */ export function mapSpanEvents(events: readonly T[] | undefined, options: MapOptions): T[] { if (!events) return []; @@ -148,10 +242,8 @@ export function mapSpanEvents(events: readonly T[] | un if (!event.attributes) return { ...event }; const attributes: Attributes = {}; for (const [key, value] of Object.entries(event.attributes)) { - if (value === undefined) continue; - if (isSecretKey(key)) continue; - if (!key.startsWith(EXCEPTION_PREFIX) && !options.captureContent && isContentKey(key, value)) continue; - attributes[key] = value; + const exported = exportValue(key, value, options); + if (exported !== undefined) attributes[key] = exported; } return { ...event, attributes }; }); @@ -296,9 +388,10 @@ function setIfAbsent(attributes: Attributes, key: string, value: AttributeValue /** * Map one VoltAgent span's attributes onto Future AGI / GenAI keys. * - * Copy, do not delete: VoltAgent's own keys are kept, except content (unless captureContent), - * credentials, and promoted token keys on spans that are not model calls (moved under - * `voltagent.`). The input object is never mutated; the result is a new object. + * Copy, do not delete: VoltAgent's own keys are kept, except content the TraceConfig flags hide, + * credentials, stack traces, and promoted token keys on spans that are not model calls (moved + * under `voltagent.`). Kept strings have local paths and stack frames removed (`exportValue`). + * The input object is never mutated; the result is a new object. */ export function mapVoltAgentAttributes(source: Attributes, options: MapOptions): MappedAttributes { const kind = resolveSpanKind(source); @@ -311,10 +404,9 @@ export function mapVoltAgentAttributes(source: Attributes, options: MapOptions): const operationId = asString(source[VA.OPERATION_ID]); const out: Attributes = {}; - for (const [key, value] of Object.entries(source)) { + for (const [key, raw] of Object.entries(source)) { + const value = exportValue(key, raw, options); if (value === undefined) continue; - if (isSecretKey(key)) continue; - if (!options.captureContent && isContentKey(key, value)) continue; if (!isModelCall && isPromotedUsageKey(key)) { // Summed or derived usage on a non-model span: keep it, but not on a promoted key. out[`voltagent.${key}`] = value; @@ -385,24 +477,22 @@ export function mapVoltAgentAttributes(source: Attributes, options: MapOptions): setIfAbsent(out, FIAttributes.GEN_AI_TOOL_DESCRIPTION, asString(source[VA.TOOL_DESCRIPTION])); } - // Content, only after opt-in. - if (options.captureContent) { - // VoltAgent writes no `input` on llm spans; their prompt is only in `llm.messages`, and - // fi-collector fills a span's input column from input.value only. - const input = - asString(source[VA.INPUT]) ?? - asString(source[VA.VECTOR_QUERY]) ?? - asString(source[VA.EMBEDDING_QUERY]) ?? - (isModelCall ? asString(source[VA.LLM_MESSAGES]) : undefined); - if (input !== undefined && out[FIAttributes.INPUT_VALUE] === undefined) { - out[FIAttributes.INPUT_VALUE] = input; - setIfAbsent(out, FIAttributes.INPUT_MIME_TYPE, looksLikeJson(input) ? "application/json" : "text/plain"); - } - const output = asString(source[VA.OUTPUT]); - if (output !== undefined && out[FIAttributes.OUTPUT_VALUE] === undefined) { - out[FIAttributes.OUTPUT_VALUE] = output; - setIfAbsent(out, FIAttributes.OUTPUT_MIME_TYPE, looksLikeJson(output) ? "application/json" : "text/plain"); - } + // input.value / output.value (the collector's input and output columns), from the values kept + // above: what the TraceConfig flags hide is already gone, and paths are already rewritten. + // VoltAgent writes no `input` on llm spans; their prompt is only in `llm.messages`. + const input = + asString(out[VA.INPUT]) ?? + asString(out[VA.VECTOR_QUERY]) ?? + asString(out[VA.EMBEDDING_QUERY]) ?? + (isModelCall ? asString(out[VA.LLM_MESSAGES]) : undefined); + if (input !== undefined && out[FIAttributes.INPUT_VALUE] === undefined) { + out[FIAttributes.INPUT_VALUE] = input; + setIfAbsent(out, FIAttributes.INPUT_MIME_TYPE, looksLikeJson(input) ? "application/json" : "text/plain"); + } + const output = asString(out[VA.OUTPUT]); + if (output !== undefined && out[FIAttributes.OUTPUT_VALUE] === undefined) { + out[FIAttributes.OUTPUT_VALUE] = output; + setIfAbsent(out, FIAttributes.OUTPUT_MIME_TYPE, looksLikeJson(output) ? "application/json" : "text/plain"); } return { attributes: out, kind, isModelCall, isOperationRoot, operationId }; @@ -438,14 +528,15 @@ function soleMainCall(llmSpa * VoltAgent 2.11.0 records no response text on llm spans (agent.ts createLLMSpanFinalizer sets * usage, finish reason and status only). With exactly one successful main-call llm span, that * span's final answer is the operation's `output` on the root span, so the exported copy of the - * llm span gets it as output.value. Call only when content capture is on. Returns the updated - * span attributes, if any. + * llm span gets it as output.value. Pass the root's MAPPED attributes (`mapVoltAgentAttributes`): + * their `output` is absent when outputs are hidden and already has paths rewritten. Returns the + * updated span attributes, if any. */ export function copyOperationOutput( - rootSource: Attributes, + rootAttributes: Attributes, llmSpans: Array<{ source: Attributes; attributes: Attributes; isError: boolean }>, ): Attributes | undefined { - const output = asString(rootSource[VA.OUTPUT]); + const output = asString(rootAttributes[VA.OUTPUT]); if (output === undefined) return undefined; const target = soleMainCall(llmSpans); if (!target || target.attributes[FIAttributes.OUTPUT_VALUE] !== undefined) return undefined; diff --git a/typescript/packages/traceai_voltagent/src/privacy.ts b/typescript/packages/traceai_voltagent/src/privacy.ts new file mode 100644 index 000000000..0de8562fe --- /dev/null +++ b/typescript/packages/traceai_voltagent/src/privacy.ts @@ -0,0 +1,258 @@ +/** + * Privacy for the exported copy of a VoltAgent span. + * + * Content follows the traceAI `TraceConfig` convention, like every traceAI instrumentor: prompts, + * answers, tool arguments/results and other run content are exported by default, and the standard + * flags hide them (`FI_HIDE_INPUTS`, `FI_HIDE_OUTPUTS`, `FI_HIDE_INPUT_MESSAGES`, + * `FI_HIDE_OUTPUT_MESSAGES`, `FI_HIDE_INPUT_TEXT`, `FI_HIDE_OUTPUT_TEXT`, or the same options on + * `traceConfig`). Precedence and parsing are fi-core's: option > env var > default, and only the + * string "true" (any case) hides. + * + * Never exported, in either mode: credentials, stack traces, and local file paths (rewritten to + * `[cwd]`, `~` or `[path]`); error text additionally loses emails and this machine's user and host + * names. + */ +import * as os from "os"; +import { + DEFAULT_HIDE_INPUTS, + DEFAULT_HIDE_INPUT_MESSAGES, + DEFAULT_HIDE_INPUT_TEXT, + DEFAULT_HIDE_OUTPUTS, + DEFAULT_HIDE_OUTPUT_MESSAGES, + DEFAULT_HIDE_OUTPUT_TEXT, + FI_HIDE_INPUTS, + FI_HIDE_INPUT_MESSAGES, + FI_HIDE_INPUT_TEXT, + FI_HIDE_OUTPUTS, + FI_HIDE_OUTPUT_MESSAGES, + FI_HIDE_OUTPUT_TEXT, + REDACTED_VALUE, + type TraceConfigOptions, +} from "@traceai/fi-core"; + +/** The fi-core TraceConfig flags this package reads, resolved. */ +export interface ContentPolicy { + hideInputs: boolean; + hideOutputs: boolean; + hideInputMessages: boolean; + hideOutputMessages: boolean; + hideInputText: boolean; + hideOutputText: boolean; +} + +/** Content captured, nothing hidden: fi-core's defaults (`DEFAULT_HIDE_* = false`). */ +export const SHOW_ALL: Readonly = Object.freeze({ + hideInputs: DEFAULT_HIDE_INPUTS, + hideOutputs: DEFAULT_HIDE_OUTPUTS, + hideInputMessages: DEFAULT_HIDE_INPUT_MESSAGES, + hideOutputMessages: DEFAULT_HIDE_OUTPUT_MESSAGES, + hideInputText: DEFAULT_HIDE_INPUT_TEXT, + hideOutputText: DEFAULT_HIDE_OUTPUT_TEXT, +}); + +/** + * One fi-core boolean flag: option > env var > default, with fi-core's env rule + * (`value.toLowerCase() === "true"`). Read here because fi-core's `generateTraceConfig` is not + * exported and only reads the env vars when a config object is passed. + */ +function flag(option: boolean | undefined, envKey: string, fallback: boolean): boolean { + if (option !== undefined) return option; + const value = typeof process !== "undefined" ? process.env?.[envKey] : undefined; + if (value !== undefined) return value.toLowerCase() === "true"; + return fallback; +} + +export function resolveContentPolicy(traceConfig?: TraceConfigOptions): ContentPolicy { + return { + hideInputs: flag(traceConfig?.hideInputs, FI_HIDE_INPUTS, DEFAULT_HIDE_INPUTS), + hideOutputs: flag(traceConfig?.hideOutputs, FI_HIDE_OUTPUTS, DEFAULT_HIDE_OUTPUTS), + hideInputMessages: flag(traceConfig?.hideInputMessages, FI_HIDE_INPUT_MESSAGES, DEFAULT_HIDE_INPUT_MESSAGES), + hideOutputMessages: flag(traceConfig?.hideOutputMessages, FI_HIDE_OUTPUT_MESSAGES, DEFAULT_HIDE_OUTPUT_MESSAGES), + hideInputText: flag(traceConfig?.hideInputText, FI_HIDE_INPUT_TEXT, DEFAULT_HIDE_INPUT_TEXT), + hideOutputText: flag(traceConfig?.hideOutputText, FI_HIDE_OUTPUT_TEXT, DEFAULT_HIDE_OUTPUT_TEXT), + }; +} + +/** True when free text written at run time (error text, reasons) must not be exported. */ +export function hidesFreeText(policy: ContentPolicy): boolean { + return policy.hideInputs || policy.hideOutputs; +} + +/** + * Message-list JSON with every message's text replaced by fi-core's `__REDACTED__` (roles kept), + * for FI_HIDE_INPUT_TEXT / FI_HIDE_OUTPUT_TEXT. VoltAgent writes `[{ role, content }]` model + * messages and `[{ role, parts }]` UI messages. Anything else is dropped (undefined). + */ +export function redactMessageText(value: unknown): string | undefined { + if (typeof value !== "string") return undefined; + try { + const messages = JSON.parse(value); + if (!Array.isArray(messages)) return undefined; + return JSON.stringify( + messages.map((message) => { + if (!message || typeof message !== "object") return REDACTED_VALUE; + const copy: Record = {}; + if ("role" in message) copy.role = (message as { role: unknown }).role; + if ("content" in message) copy.content = REDACTED_VALUE; + if ("parts" in message) copy.parts = REDACTED_VALUE; + return copy; + }), + ); + } catch { + return undefined; + } +} + +// --------------------------------------------------------------------------------------------- +// Paths, stack traces and local identity. + +export const PATH_REMOVED = "[path]"; +export const CWD_TOKEN = "[cwd]"; +export const STACK_TRACE_REMOVED = "[stack trace removed]"; + +/** Where the paths to rewrite come from. */ +export interface ScrubContext { + /** The process working directory. */ + cwd?: string; + /** The user's home directory. */ + home?: string; +} + +const PYTHON_TRACEBACK = /Traceback \(most recent call last\):[\s\S]*/g; +/** + * A V8 stack: "\n at fn (file:line:col)" frames, from the first frame on. Also matches frames + * whose newline is JSON-escaped ("\\n at ...") in text that is not valid JSON. + */ +const JS_STACK = /(?:(?:\r?\n|(?:\\+r)?\\+n)[ \t]+at [^\r\n\\"]+)+/g; +const STACK_HINT = /(?:\n|\\n)[ \t]+at /; +const FILE_URL = /file:\/\/[^\s"'`<>]+/g; +const WINDOWS_PATH = /(?|*?]+/g; +const UNC_PATH = /(?|*?\\]+\\[^\s"'`<>|*?]+/g; +/** Absolute paths under the usual local roots; URL paths such as /v1/chat/completions are left alone. */ +const LOCAL_PATH = + /(?|*?,;)\]}]+/g; +const EMAIL = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g; + +function escapeRegExp(text: string): string { + return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); +} + +function replacePrefix(text: string, prefix: string | undefined, token: string): string { + if (!prefix || prefix === "/" || !(prefix.startsWith("/") || /^[A-Za-z]:\\/.test(prefix))) return text; + const trimmed = prefix.replace(/[\\/]+$/, ""); + if (trimmed.length < 2) return text; + // The prefix itself, then a separator, the end, or a non-path character (not /a/proj2 for /a/proj). + return text.replace(new RegExp(`${escapeRegExp(trimmed)}(?=[\\\\/]|$|[^\\w.-])`, "g"), token); +} + +/** process.cwd() and os.homedir(), each only if readable. */ +export function defaultScrubContext(): ScrubContext { + const ctx: ScrubContext = {}; + try { + ctx.cwd = process.cwd(); + } catch { + // no cwd (deleted directory) or no process + } + try { + ctx.home = os.homedir(); + } catch { + // no home directory + } + return ctx; +} + +/** Plain-text pass: stack traces out, local paths rewritten. Never inserts a raw newline. */ +function scrubText(text: string, ctx: ScrubContext): string { + let out = text; + if (out.includes("Traceback (most recent call last)")) out = out.replace(PYTHON_TRACEBACK, STACK_TRACE_REMOVED); + if (STACK_HINT.test(out)) out = out.replace(JS_STACK, ` ${STACK_TRACE_REMOVED}`); + if (!/[/\\]/.test(out)) return out; + out = out.replace(FILE_URL, PATH_REMOVED); + // Longest first: the cwd usually sits under the home directory. + const prefixes: Array<[string | undefined, string]> = [ + [ctx.cwd, CWD_TOKEN], + [ctx.home, "~"], + ]; + prefixes.sort((a, b) => (b[0]?.length ?? 0) - (a[0]?.length ?? 0)); + for (const [prefix, token] of prefixes) out = replacePrefix(out, prefix, token); + out = out.replace(WINDOWS_PATH, PATH_REMOVED); + out = out.replace(UNC_PATH, PATH_REMOVED); + out = out.replace(LOCAL_PATH, PATH_REMOVED); + return out; +} + +const MAX_JSON_DEPTH = 4; + +function looksLikeJson(text: string): boolean { + const start = text.trimStart()[0]; + return start === "{" || start === "["; +} + +/** Scrub every string inside parsed JSON (and JSON nested in those strings). */ +function scrubJsonValue(value: unknown, ctx: ScrubContext, depth: number): unknown { + if (typeof value === "string") return scrubString(value, ctx, depth + 1); + if (Array.isArray(value)) return value.map((item) => scrubJsonValue(item, ctx, depth)); + if (value && typeof value === "object") { + const out: Record = {}; + for (const [key, item] of Object.entries(value)) out[key] = scrubJsonValue(item, ctx, depth); + return out; + } + return value; +} + +function scrubString(text: string, ctx: ScrubContext, depth: number): string { + if (!text) return text; + // VoltAgent serializes messages, tool results and state to JSON, where a stack trace's newlines + // are escaped. Parse, scrub each string, and re-serialize only when something changed. + if (depth < MAX_JSON_DEPTH && looksLikeJson(text)) { + try { + const parsed = JSON.parse(text); + const scrubbed = JSON.stringify(scrubJsonValue(parsed, ctx, depth)); + return scrubbed === JSON.stringify(parsed) ? text : scrubbed; + } catch { + // not JSON after all: fall through to the text pass (escaped newlines are handled there) + } + } + return scrubText(text, ctx); +} + +/** + * Remove stack traces and rewrite local paths: the cwd becomes `[cwd]`, the home directory `~`, + * any other absolute local path, file URL or Windows path `[path]`. Applied to every exported + * string value, including JSON documents (messages, tool results, state snapshots). + */ +export function scrubContent(text: string, ctx: ScrubContext = {}): string { + return scrubString(text, ctx, 0); +} + +let identity: string[] | undefined; + +/** This machine's user name and host names (3+ characters, not "localhost"), longest first. */ +function localIdentity(): string[] { + if (identity) return identity; + const out: string[] = []; + try { + const user = os.userInfo().username; + if (user && user.length >= 3) out.push(user); + } catch { + // no user info (sandboxed runtime) + } + try { + const host = os.hostname(); + for (const name of [host, host?.split(".")[0]]) { + if (name && name.length >= 3 && name.toLowerCase() !== "localhost" && !out.includes(name)) out.push(name); + } + } catch { + // no hostname + } + identity = out.sort((a, b) => b.length - a.length); + return identity; +} + +/** Error text as exported: `scrubContent`, then emails and this machine's user and host names. */ +export function scrubErrorText(text: string, ctx: ScrubContext = {}): string { + let out = scrubContent(text, ctx); + out = out.replace(EMAIL, ""); + for (const value of localIdentity()) out = out.split(value).join(""); + return out; +} From 1b7b712512bf01008c3bf4e92eeda538d7d136d7 Mon Sep 17 00:00:00 2001 From: Nikhil Pareek Date: Fri, 16 Oct 2026 21:31:04 -0700 Subject: [PATCH 14/18] docs(voltagent): end one-off scripts with observability.shutdown() (TH-8239) new VoltAgent() keeps the process running after forceFlush() (it installs signal handlers for a graceful shutdown); a script that only flushes never exits. Observed with @voltagent/core 2.11.0 on Node 26.8.1: shutdown() flushes every processor and the process exits. Co-Authored-By: Claude Opus 5.5 --- typescript/packages/traceai_voltagent/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/typescript/packages/traceai_voltagent/README.md b/typescript/packages/traceai_voltagent/README.md index 85b987ea2..9b33e84b4 100644 --- a/typescript/packages/traceai_voltagent/README.md +++ b/typescript/packages/traceai_voltagent/README.md @@ -188,11 +188,13 @@ VoltAgent itself has no capture flag; a VoltOps export of the same run still has ## Flushing, serverless and failures -- Spans are batched. Flush before a short-lived process or a serverless handler returns: +- Spans are batched. Flush before a serverless handler returns: `await observability.forceFlush()` (VoltAgent flushes every processor) or - `await processor.forceFlush()`. `observability.shutdown()` flushes too. VoltAgent ends some - memory spans in the background just after `generateText` resolves, so flush at the end of the - handler. + `await processor.forceFlush()`. VoltAgent ends some memory spans in the background just after + `generateText` resolves, so flush at the end of the handler. +- A one-off script does not exit after `forceFlush()`: `new VoltAgent()` keeps the process running + (it installs signal handlers for a graceful shutdown). End it with + `await observability.shutdown()`, which flushes every processor too. - On platforms with `waitUntil`, VoltAgent's serverless observability can flush in the background: `setWaitUntil(waitUntil: (promise: Promise) => void)` from `@voltagent/core` (`src/observability/wait-until.ts`). From 23ca042dca00af13976d7b342f41293bb9d16a60 Mon Sep 17 00:00:00 2001 From: Nikhil Pareek Date: Wed, 21 Oct 2026 15:33:33 -0700 Subject: [PATCH 15/18] test(voltagent): neutral loopback port in the URL scrub test Co-Authored-By: Claude Opus 5.5 --- .../packages/traceai_voltagent/src/__tests__/privacy.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/packages/traceai_voltagent/src/__tests__/privacy.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/privacy.test.ts index e878c3496..7dce519d1 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/privacy.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/privacy.test.ts @@ -92,7 +92,7 @@ describe("scrubContent (paths and stack traces, either mode)", () => { }); it("leaves URLs, routes and relative paths alone", () => { - const text = "POST http://127.0.0.1:8317/v1/chat/completions then src/a.ts and /v1/messages"; + const text = "POST http://127.0.0.1:8080/v1/chat/completions then src/a.ts and /v1/messages"; expect(scrubContent(text, ctx)).toBe(text); }); From 7c41eb61decef48cb9cc63ef00ad3efe0d7c714e Mon Sep 17 00:00:00 2001 From: Nikhil Pareek <8347993+nik13@users.noreply.github.com> Date: Tue, 27 Oct 2026 20:50:27 -0700 Subject: [PATCH 16/18] fix(voltagent): isolate known upstream resume interval leak Document the 2.11.0 limitation and full public application shutdown. Keep every resume assertion in a dedicated Jest invocation that propagates its real result before exiting; ordinary suites retain open-handle checks. Limit the contract fixture exit to its resumed-workflow journey. Co-Authored-By: Claude Code --- .github/workflows/voltagent-tests.yml | 4 +- .../packages/traceai_voltagent/README.md | 32 +++++++- .../contract/run_fixture.mjs | 17 ++-- .../packages/traceai_voltagent/jest.config.js | 2 + .../traceai_voltagent/jest.resume.config.cjs | 7 ++ .../packages/traceai_voltagent/package.json | 8 +- .../src/__tests__/helpers.ts | 11 ++- .../src/__tests__/processor.test.ts | 63 --------------- .../src/__tests__/workflow-resume.test.ts | 79 +++++++++++++++++++ .../traceai_voltagent/test/environment.cjs | 3 +- .../traceai_voltagent/test/run-resume.cjs | 24 ++++++ 11 files changed, 167 insertions(+), 83 deletions(-) create mode 100644 typescript/packages/traceai_voltagent/jest.resume.config.cjs create mode 100644 typescript/packages/traceai_voltagent/src/__tests__/workflow-resume.test.ts create mode 100644 typescript/packages/traceai_voltagent/test/run-resume.cjs diff --git a/.github/workflows/voltagent-tests.yml b/.github/workflows/voltagent-tests.yml index 9fb23b99b..de6f77120 100644 --- a/.github/workflows/voltagent-tests.yml +++ b/.github/workflows/voltagent-tests.yml @@ -55,9 +55,9 @@ jobs: run: | pnpm run build:deps pnpm --filter @traceai/voltagent run build - - name: Unit tests and natural process shutdown + - name: Unit tests (natural shutdown) and isolated upstream resume regression working-directory: typescript - run: timeout 180 pnpm --filter @traceai/voltagent test --runInBand + run: timeout 180 pnpm --filter @traceai/voltagent test - name: Real VoltAgent exporter contract (offline model) run: | python -m pip install pytest protobuf opentelemetry-proto jsonschema requests diff --git a/typescript/packages/traceai_voltagent/README.md b/typescript/packages/traceai_voltagent/README.md index 9b33e84b4..d3497532d 100644 --- a/typescript/packages/traceai_voltagent/README.md +++ b/typescript/packages/traceai_voltagent/README.md @@ -51,7 +51,7 @@ const observability = new VoltAgentObservability({ }); const agent = new Agent({ name: "assistant", instructions: "...", model: /* AI SDK model */ }); -new VoltAgent({ agents: { assistant: agent }, observability }); +const app = new VoltAgent({ agents: { assistant: agent }, observability }); ``` The constructor warns (`console.warn`) when the provider you pass is the global one. @@ -192,9 +192,10 @@ VoltAgent itself has no capture flag; a VoltOps export of the same run still has `await observability.forceFlush()` (VoltAgent flushes every processor) or `await processor.forceFlush()`. VoltAgent ends some memory spans in the background just after `generateText` resolves, so flush at the end of the handler. -- A one-off script does not exit after `forceFlush()`: `new VoltAgent()` keeps the process running - (it installs signal handlers for a graceful shutdown). End it with - `await observability.shutdown()`, which flushes every processor too. +- For full application cleanup, keep the `VoltAgent` instance and call `await app.shutdown()` + in a `finally` block; shutting down observability alone does not stop all application resources. + Also call `await tracerProvider.shutdown()` when the script owns that provider. + See the resumed-workflow limitation below. - On platforms with `waitUntil`, VoltAgent's serverless observability can flush in the background: `setWaitUntil(waitUntil: (promise: Promise) => void)` from `@voltagent/core` (`src/observability/wait-until.ts`). @@ -206,6 +207,29 @@ VoltAgent itself has no capture flag; a VoltOps export of the same run still has - A collector that is down or rejects a batch never fails the agent: export errors are logged through the OpenTelemetry diag logger, and `forceFlush()` / `shutdown()` never throw. +## Known upstream issue: resumed workflows in 2.11.0 + +With `@voltagent/core` **2.11.0**, a successfully resumed workflow leaves a referenced +**500 ms polling interval** running after completion, including after +`await app.shutdown()`. A Node process that resumes workflows may therefore not exit +on its own. This also reproduces with VoltAgent alone, without importing traceAI; +the traceAI processor is not the cause. Ordinary, non-resumed workflows are unaffected +by this particular leak. + +Use the documented lifecycle: convert a workflow builder with `.toWorkflow()` once, +register and reuse that instance, then call `await app.shutdown()` for full cleanup. +That does **not** recover the orphaned interval in 2.11.0. There is no supported public +API to dispose of this completed resumed step's interval. In a **short-lived script**, +after awaiting application shutdown and flushing/shutting down exporters you own, +call `process.exit(0)` (or a nonzero status on failure) as a last step. Do not add a +forced exit to a long-running server, and do not manipulate VoltAgent's private timers. + +The resume-event Jest tests retain all assertions and full application teardown in a +separate invocation. Its runner explicitly exits only after Jest returns its actual +pass/fail result, to bound this upstream leak; ordinary tests run separately with +open-handle detection and no forced exit. The contract fixture uses the same exit +only for its resume journey, after flushing output and shutdown. + ## Tested versions | Component | Version | diff --git a/typescript/packages/traceai_voltagent/contract/run_fixture.mjs b/typescript/packages/traceai_voltagent/contract/run_fixture.mjs index 0cec1482d..b011d8e64 100644 --- a/typescript/packages/traceai_voltagent/contract/run_fixture.mjs +++ b/typescript/packages/traceai_voltagent/contract/run_fixture.mjs @@ -146,6 +146,7 @@ const observability = new VoltAgentObservability({ spanProcessors: [recorder, pr const result = { journey: JOURNEY, hidden: HIDDEN, cwd: process.cwd() }; const started = Date.now(); +let app; if (JOURNEY === "subagent") { const researcher = new Agent({ @@ -166,7 +167,7 @@ if (JOURNEY === "subagent") { ]), subAgents: [researcher], }); - new VoltAgent({ agents: { supervisor, researcher }, observability, checkDependencies: false }); + app = new VoltAgent({ agents: { supervisor, researcher }, observability, checkDependencies: false }); const out = await supervisor.generateText(MARKERS.prompt, { conversationId: "conv-sub", userId: "user-1", maxSteps: 4 }); result.text = out.text; } else if (JOURNEY === "events") { @@ -197,8 +198,8 @@ if (JOURNEY === "subagent") { if (!resumeData) await suspend("needs approval", { question: data.question }); return { approved: resumeData?.approved === true }; }, - }); - new VoltAgent({ agents: { assistant: agent }, workflows: { approval: workflow }, observability, checkDependencies: false }); + }).toWorkflow(); + app = new VoltAgent({ agents: { assistant: agent }, workflows: { approval: workflow }, observability, checkDependencies: false }); const stream = await agent.streamText(MARKERS.prompt, { conversationId: "conv-events", userId: "user-9" }); result.text = await stream.text; const suspended = await workflow.run({ amount: 5, question: MARKERS.suspendData }); @@ -211,7 +212,7 @@ if (JOURNEY === "subagent") { model: scriptedModel("mockai/mock-model-1", toolSteps()), tools: [weatherTool, explodingTool], }); - new VoltAgent({ agents: { assistant: agent }, observability, checkDependencies: false }); + app = new VoltAgent({ agents: { assistant: agent }, observability, checkDependencies: false }); const runs = JOURNEY === "burst" ? BURST : 1; const texts = []; for (let i = 0; i < runs; i += 1) { @@ -241,8 +242,12 @@ const storedCounts = []; for (const traceId of traceIds) storedCounts.push((await observability.getTraceFromStorage(traceId)).length); result.storedCount = storedCounts.reduce((sum, count) => sum + count, 0); result.modelCalls = modelCalls; +await app.shutdown(); await processor.shutdown(); await tracerProvider.shutdown().catch(() => undefined); result.totalMs = Date.now() - started; -process.stdout.write(`\nRESULT_JSON:${JSON.stringify(result)}\n`); -process.exit(0); +await new Promise((resolve) => process.stdout.write(`\nRESULT_JSON:${JSON.stringify(result)}\n`, resolve)); +// @voltagent/core 2.11.0 leaks a referenced 500 ms interval after resume, even +// after public app.shutdown(). Only this fixture journey needs the documented +// short-lived-script workaround. All other journeys must exit naturally. +if (JOURNEY === "events") process.exit(0); diff --git a/typescript/packages/traceai_voltagent/jest.config.js b/typescript/packages/traceai_voltagent/jest.config.js index 1612eeb32..74ed55eb2 100644 --- a/typescript/packages/traceai_voltagent/jest.config.js +++ b/typescript/packages/traceai_voltagent/jest.config.js @@ -3,6 +3,8 @@ module.exports = { testEnvironment: 'node', setupFiles: ['/test/environment.cjs'], roots: ['/src'], + // The known upstream resume timer leak is isolated; no forceExit for ordinary tests. + testPathIgnorePatterns: ['workflow-resume\\.test\\.ts$'], testMatch: [ '**/__tests__/**/*.test.ts', '**/?(*.)+(spec|test).ts' diff --git a/typescript/packages/traceai_voltagent/jest.resume.config.cjs b/typescript/packages/traceai_voltagent/jest.resume.config.cjs new file mode 100644 index 000000000..462cfc84a --- /dev/null +++ b/typescript/packages/traceai_voltagent/jest.resume.config.cjs @@ -0,0 +1,7 @@ +const base = require('./jest.config.js'); + +module.exports = { + ...base, + testPathIgnorePatterns: [], + testMatch: ['/src/__tests__/workflow-resume.test.ts'], +}; diff --git a/typescript/packages/traceai_voltagent/package.json b/typescript/packages/traceai_voltagent/package.json index 828dd1509..1e2b5ced5 100644 --- a/typescript/packages/traceai_voltagent/package.json +++ b/typescript/packages/traceai_voltagent/package.json @@ -17,11 +17,13 @@ "prebuild": "rimraf dist", "build": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json && tsc-alias -p tsconfig.esm.json && pnpm run postbuild", "postbuild": "echo '{\"type\": \"module\"}' > ./dist/esm/package.json", - "test": "jest", + "test": "pnpm run test:unit && pnpm run test:resume", "test:watch": "jest --watch", - "test:coverage": "jest --coverage", + "test:coverage": "pnpm run test:unit --coverage && pnpm run test:resume", "lint": "eslint . --ext .ts", - "prepare": "pnpm run build" + "prepare": "pnpm run build", + "test:unit": "jest --runInBand --detectOpenHandles", + "test:resume": "node test/run-resume.cjs" }, "files": [ "dist", diff --git a/typescript/packages/traceai_voltagent/src/__tests__/helpers.ts b/typescript/packages/traceai_voltagent/src/__tests__/helpers.ts index 5b35bd94e..145f69beb 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/helpers.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/helpers.ts @@ -171,15 +171,18 @@ export function fiProvider() { return { exporter, provider }; } -/** Wire agents (and workflows) into a fresh VoltAgentObservability whose spanProcessors are `processors`. */ +/** Wire agents and workflows into a fresh app; callers must run the full public app.shutdown(). */ export function voltagent( agents: Record, processors: SpanProcessor[], workflows?: Record>, ) { const observability = new VoltAgentObservability({ spanProcessors: processors }); - new VoltAgent({ agents, workflows, observability, checkDependencies: false }); - return observability; + const app = new VoltAgent({ agents, workflows, observability, checkDependencies: false }); + return { + shutdown: () => app.shutdown(), + getTraceFromStorage: observability.getTraceFromStorage.bind(observability), + }; } /** @@ -217,7 +220,7 @@ export function approvalWorkflow() { if (!resumeData) await suspend("needs approval", { question: data.question }); return { approved: resumeData?.approved === true }; }, - }); + }).toWorkflow(); } /** VoltAgentObservability registers its provider globally; reset between tests. */ diff --git a/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts index 95327be4d..a3cf1aa58 100644 --- a/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts +++ b/typescript/packages/traceai_voltagent/src/__tests__/processor.test.ts @@ -597,69 +597,6 @@ describe("span events (M1)", () => { }); }); -describe("span events from a real agent and workflow (M1)", () => { - async function runEventJourney(hidden: boolean) { - const { exporter, provider } = fiProvider(); - const recorder = new RecordingProcessor(); - const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider, traceConfig: hidden ? HIDDEN : undefined }); - const { model } = scriptedModel("mockai/mock-model-1", [{ kind: "text", text: MARKERS.answer, input: 3, output: 2 }]); - const agent = new Agent({ name: "assistant", instructions: "x", model, outputGuardrails: [passThroughGuardrail()] }); - const workflow = approvalWorkflow(); - observability = voltagent({ assistant: agent }, [recorder, processor], { approval: workflow }); - - const stream = await agent.streamText(MARKERS.prompt, { conversationId: "conv-events" }); - expect(await stream.text).toBe(MARKERS.answer); - const suspended = await workflow.run({ amount: 5, question: MARKERS.suspendData }); - expect(suspended.status).toBe("suspended"); - const resumed = await suspended.resume({ approved: true, note: MARKERS.resumeData }); - expect(resumed.status).toBe("completed"); - await settle(recorder); - await processor.forceFlush(); - - const exported = exporter.getFinishedSpans(); - const events = (spans: ReadableSpan[], name: string) => - spans.flatMap((span) => span.events.filter((event) => event.name === name).map((event) => event.attributes ?? {})); - // Control: VoltAgent really wrote the content into the events the other processors received. - expect(events(recorder.spans, "guardrail.stream.process").map((a) => a["guardrail.chunk.text"])).toContain( - MARKERS.answer, - ); - expect(String(events(recorder.spans, "workflow.suspended")[0]["suspension.data"])).toContain(MARKERS.suspendData); - expect(String(events(recorder.spans, "workflow.resumed")[0]["resume.data"])).toContain(MARKERS.resumeData); - expect(exported).toHaveLength(recorder.spans.length); - return { exported, events: (name: string) => events(exported, name) }; - } - - it("drops streamed guardrail text and workflow suspend/resume payloads from events when hidden", async () => { - const { exported, events } = await runEventJourney(true); - const processed = events("guardrail.stream.process"); - expect(processed.map((a) => a["guardrail.chunk.type"])).toContain("text-delta"); - for (const a of processed) expect(a["guardrail.chunk.text"]).toBeUndefined(); - expect(events("guardrail.stream.start")).toHaveLength(1); - const [suspended] = events("workflow.suspended"); - expect(suspended).toMatchObject({ "suspension.step_index": 0 }); - expect(suspended["suspension.reason"]).toBeUndefined(); // free text, hidden with inputs/outputs - expect(suspended["suspension.data"]).toBeUndefined(); - expect(suspended["suspension.checkpoint"]).toBeUndefined(); - const [resumed] = events("workflow.resumed"); - expect(resumed).toEqual({ "resume.step_index": 0 }); - for (const span of exported.filter((s) => s.name === "workflow.approval")) { - expect(attrs(span)["fi.span.kind"]).toBe("CHAIN"); - } - const blob = JSON.stringify(exported.map((span) => [span.name, span.attributes, span.events])); - for (const marker of [MARKERS.answer, MARKERS.prompt, MARKERS.suspendData, MARKERS.resumeData]) { - expect(blob).not.toContain(marker); - } - }); - - it("keeps them by default (control run)", async () => { - const { events } = await runEventJourney(false); - expect(events("guardrail.stream.process").map((a) => a["guardrail.chunk.text"])).toContain(MARKERS.answer); - const [suspended] = events("workflow.suspended"); - expect(String(suspended["suspension.data"])).toContain(MARKERS.suspendData); - expect(suspended["suspension.checkpoint"]).toEqual(expect.any(String)); - expect(String(events("workflow.resumed")[0]["resume.data"])).toContain(MARKERS.resumeData); - }); -}); describe("generateObject (README Tokens)", () => { it("creates no llm span in 2.11.0: usage is only voltagent.usage.* on the agent span", async () => { diff --git a/typescript/packages/traceai_voltagent/src/__tests__/workflow-resume.test.ts b/typescript/packages/traceai_voltagent/src/__tests__/workflow-resume.test.ts new file mode 100644 index 000000000..a666e5366 --- /dev/null +++ b/typescript/packages/traceai_voltagent/src/__tests__/workflow-resume.test.ts @@ -0,0 +1,79 @@ +import type { ReadableSpan } from "@opentelemetry/sdk-trace-base"; +import { Agent } from "@voltagent/core"; +import { FIVoltAgentSpanProcessor } from "../FIVoltAgentSpanProcessor"; +import { MARKERS, RecordingProcessor, approvalWorkflow, attrs, fiProvider, + passThroughGuardrail, resetOtelGlobals, scriptedModel, settle, voltagent } from "./helpers"; + +let observability: ReturnType | undefined; +afterEach(async () => { + await resetOtelGlobals(observability); + observability = undefined; +}); +const HIDDEN = { hideInputs: true, hideOutputs: true }; + +// Isolated by jest.resume.config.cjs: upstream @voltagent/core 2.11.0 retains a +// referenced 500 ms interval on completed resumed steps even after app.shutdown(). +// All assertions and teardown still run. Only the dedicated runner exits after Jest. +describe("span events from a real agent and workflow (M1)", () => { + async function runEventJourney(hidden: boolean) { + const { exporter, provider } = fiProvider(); + const recorder = new RecordingProcessor(); + const processor = new FIVoltAgentSpanProcessor({ tracerProvider: provider, traceConfig: hidden ? HIDDEN : undefined }); + const { model } = scriptedModel("mockai/mock-model-1", [{ kind: "text", text: MARKERS.answer, input: 3, output: 2 }]); + const agent = new Agent({ name: "assistant", instructions: "x", model, outputGuardrails: [passThroughGuardrail()] }); + const workflow = approvalWorkflow(); + observability = voltagent({ assistant: agent }, [recorder, processor], { approval: workflow }); + + const stream = await agent.streamText(MARKERS.prompt, { conversationId: "conv-events" }); + expect(await stream.text).toBe(MARKERS.answer); + const suspended = await workflow.run({ amount: 5, question: MARKERS.suspendData }); + expect(suspended.status).toBe("suspended"); + const resumed = await suspended.resume({ approved: true, note: MARKERS.resumeData }); + expect(resumed.status).toBe("completed"); + await settle(recorder); + await processor.forceFlush(); + + const exported = exporter.getFinishedSpans(); + const events = (spans: ReadableSpan[], name: string) => + spans.flatMap((span) => span.events.filter((event) => event.name === name).map((event) => event.attributes ?? {})); + // Control: VoltAgent really wrote the content into the events the other processors received. + expect(events(recorder.spans, "guardrail.stream.process").map((a) => a["guardrail.chunk.text"])).toContain( + MARKERS.answer, + ); + expect(String(events(recorder.spans, "workflow.suspended")[0]["suspension.data"])).toContain(MARKERS.suspendData); + expect(String(events(recorder.spans, "workflow.resumed")[0]["resume.data"])).toContain(MARKERS.resumeData); + expect(exported).toHaveLength(recorder.spans.length); + return { exported, events: (name: string) => events(exported, name) }; + } + + it("drops streamed guardrail text and workflow suspend/resume payloads from events when hidden", async () => { + const { exported, events } = await runEventJourney(true); + const processed = events("guardrail.stream.process"); + expect(processed.map((a) => a["guardrail.chunk.type"])).toContain("text-delta"); + for (const a of processed) expect(a["guardrail.chunk.text"]).toBeUndefined(); + expect(events("guardrail.stream.start")).toHaveLength(1); + const [suspended] = events("workflow.suspended"); + expect(suspended).toMatchObject({ "suspension.step_index": 0 }); + expect(suspended["suspension.reason"]).toBeUndefined(); // free text, hidden with inputs/outputs + expect(suspended["suspension.data"]).toBeUndefined(); + expect(suspended["suspension.checkpoint"]).toBeUndefined(); + const [resumed] = events("workflow.resumed"); + expect(resumed).toEqual({ "resume.step_index": 0 }); + for (const span of exported.filter((s) => s.name === "workflow.approval")) { + expect(attrs(span)["fi.span.kind"]).toBe("CHAIN"); + } + const blob = JSON.stringify(exported.map((span) => [span.name, span.attributes, span.events])); + for (const marker of [MARKERS.answer, MARKERS.prompt, MARKERS.suspendData, MARKERS.resumeData]) { + expect(blob).not.toContain(marker); + } + }); + + it("keeps them by default (control run)", async () => { + const { events } = await runEventJourney(false); + expect(events("guardrail.stream.process").map((a) => a["guardrail.chunk.text"])).toContain(MARKERS.answer); + const [suspended] = events("workflow.suspended"); + expect(String(suspended["suspension.data"])).toContain(MARKERS.suspendData); + expect(suspended["suspension.checkpoint"]).toEqual(expect.any(String)); + expect(String(events("workflow.resumed")[0]["resume.data"])).toContain(MARKERS.resumeData); + }); +}); diff --git a/typescript/packages/traceai_voltagent/test/environment.cjs b/typescript/packages/traceai_voltagent/test/environment.cjs index ca49404f3..3214d008d 100644 --- a/typescript/packages/traceai_voltagent/test/environment.cjs +++ b/typescript/packages/traceai_voltagent/test/environment.cjs @@ -1,5 +1,6 @@ // VoltAgent 2.11 starts an optional models.dev registry refresh outside production. // Offline unit tests use its shipped static registry, like a production app. -// Set this BEFORE imports; do not forceExit or mock the processor/lifecycle. +// Set this BEFORE imports; do not mock the processor or lifecycle. +// Only the separately isolated resume runner has the documented test-scoped exit. // Real agents, streams, tools, exporters, forceFlush and shutdown still execute. process.env.NODE_ENV = 'production'; diff --git a/typescript/packages/traceai_voltagent/test/run-resume.cjs b/typescript/packages/traceai_voltagent/test/run-resume.cjs new file mode 100644 index 000000000..52c6c9c2e --- /dev/null +++ b/typescript/packages/traceai_voltagent/test/run-resume.cjs @@ -0,0 +1,24 @@ +const path = require('node:path'); +const { runCLI } = require('jest'); + +// Test-scoped workaround, NOT a clean-lifecycle assertion. @voltagent/core 2.11.0 +// leaves referenced 500 ms polling intervals after completed resumed workflows, +// even after full public app.shutdown(). Upstream-only reproductions do the same. +// Run only the resume regression in this process; ordinary tests run first in +// their own invocation, with open-handle detection and no forced exit. +// Await all assertions AND teardown, propagate Jest's real status, then exit to +// bound that known upstream leak. Never use Jest's suite-wide --forceExit. +(async () => { + const root = path.resolve(__dirname, '..'); + const { results } = await runCLI({ + config: path.join(root, 'jest.resume.config.cjs'), + runInBand: true, + watch: false, + }, [root]); + const isolated = results.testResults.length === 1 && results.numTotalTests === 2; + const code = results.success && isolated ? 0 : 1; + const message = '\nIsolated resume suite finished; exiting for the documented VoltAgent 2.11.0 upstream interval leak.\n'; + process.stderr.write(message, () => process.exit(code)); +})().catch(() => { + process.stderr.write('Isolated resume runner failed.\n', () => process.exit(1)); +}); From de343b0b9a5899dae7d669b27735559bfcbdb1d1 Mon Sep 17 00:00:00 2001 From: Nikhil Pareek <8347993+nik13@users.noreply.github.com> Date: Tue, 27 Oct 2026 20:56:52 -0700 Subject: [PATCH 17/18] ci(voltagent): resolve contract pnpm from pinned workspace Co-Authored-By: Claude Code --- .github/workflows/voltagent-tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/voltagent-tests.yml b/.github/workflows/voltagent-tests.yml index de6f77120..78238cc52 100644 --- a/.github/workflows/voltagent-tests.yml +++ b/.github/workflows/voltagent-tests.yml @@ -59,9 +59,12 @@ jobs: working-directory: typescript run: timeout 180 pnpm --filter @traceai/voltagent test - name: Real VoltAgent exporter contract (offline model) + # Corepack resolves packageManager from cwd before pnpm reads --dir. + # Keep nested contract builds inside the pinned TypeScript workspace. + working-directory: typescript run: | python -m pip install pytest protobuf opentelemetry-proto jsonschema requests - PYTHONPATH=python/tests python -m pytest typescript/packages/traceai_voltagent/contract -q --noconftest -p no:cacheprovider -o addopts='' + PYTHONPATH=../python/tests python -m pytest packages/traceai_voltagent/contract -q --noconftest -p no:cacheprovider -o addopts='' - name: Build installable tarball without changing lockfile working-directory: typescript/packages/traceai_voltagent run: | From d0c92e232fe6311fdf07240abcea079a298edf65 Mon Sep 17 00:00:00 2001 From: Nikhil Pareek <8347993+nik13@users.noreply.github.com> Date: Tue, 27 Oct 2026 21:36:12 -0700 Subject: [PATCH 18/18] fix(voltagent): preserve dev dependency resolutions in lock merge Mechanically union the held VoltAgent package closure with dev, then normalize using pnpm 10.30.1 and verify frozen installation. Preserve every existing dev importer, package and snapshot value unchanged. Co-Authored-By: Claude Code --- typescript/pnpm-lock.yaml | 1185 +++++++++++++++++++++++++++---------- 1 file changed, 870 insertions(+), 315 deletions(-) diff --git a/typescript/pnpm-lock.yaml b/typescript/pnpm-lock.yaml index 283240104..be0f04bdc 100644 --- a/typescript/pnpm-lock.yaml +++ b/typescript/pnpm-lock.yaml @@ -370,7 +370,7 @@ importers: version: link:../fi-semantic-conventions beeai-framework: specifier: ^0.1.0 - version: 0.1.27(@a2a-js/sdk@0.3.13(@bufbuild/protobuf@2.11.0)(@grpc/grpc-js@1.14.3)(express@5.2.1))(@ai-sdk/anthropic@3.0.127(zod@4.6.5))(@ai-sdk/azure@3.0.133(zod@4.6.5))(@ai-sdk/groq@3.0.72(zod@4.6.5))(@ai-sdk/openai@3.0.124(zod@4.6.5))(@aws-sdk/client-bedrock-runtime@3.975.0)(@langchain/core@0.2.36(openai@7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5)))(@modelcontextprotocol/sdk@1.32.0(@cfworker/json-schema@4.1.1)(zod@4.6.5))(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@zilliz/milvus2-sdk-node@2.6.9)(express@5.2.1)(ollama-ai-provider-v2@3.3.1(ai@6.0.97(zod@4.6.5))(zod@4.6.5))(yaml@2.9.1)(zod@4.6.5) + version: 0.1.27(@a2a-js/sdk@0.3.13(@bufbuild/protobuf@2.11.0)(@grpc/grpc-js@1.14.3)(express@5.2.1))(@ai-sdk/openai@3.0.37(zod@4.3.6))(@aws-sdk/client-bedrock-runtime@3.975.0)(@langchain/core@0.2.36(openai@7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6)))(@modelcontextprotocol/sdk@1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@zilliz/milvus2-sdk-node@2.6.9)(express@5.2.1)(ollama-ai-provider-v2@3.3.1(ai@6.0.97(zod@4.3.6))(zod@4.3.6))(yaml@2.8.0)(zod@4.3.6) devDependencies: '@opentelemetry/sdk-trace-base': specifier: ^1.30.0 @@ -500,10 +500,10 @@ importers: devDependencies: '@anthropic-ai/claude-agent-sdk': specifier: 0.3.289 - version: 0.3.289(@anthropic-ai/sdk@0.131.0(zod@4.6.5))(@modelcontextprotocol/sdk@1.32.0(@cfworker/json-schema@4.1.1)(zod@4.6.5))(zod@4.6.5) + version: 0.3.289(@anthropic-ai/sdk@0.131.0(zod@4.3.6))(@modelcontextprotocol/sdk@1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(zod@4.3.6) '@anthropic-ai/sdk': specifier: ^0.131.0 - version: 0.131.0(zod@4.6.5) + version: 0.131.0(zod@4.3.6) '@opentelemetry/sdk-trace-base': specifier: ^2.0.1 version: 2.7.1(@opentelemetry/api@1.9.1) @@ -760,7 +760,7 @@ importers: dependencies: '@google/adk': specifier: '>=0.1.0' - version: 0.3.0(900cbfeb5b2bd48dc2871a3158424dee) + version: 0.3.0(e60519ede9712f800b601f30df69e9e3) '@opentelemetry/api': specifier: ^1.7.0 version: 1.9.0 @@ -990,7 +990,7 @@ importers: dependencies: '@instructor-ai/instructor': specifier: ^1.0.0 - version: 1.7.0(zod@4.6.5) + version: 1.7.0(zod@4.3.6) '@opentelemetry/api': specifier: ^1.9.0 version: 1.9.0 @@ -1119,13 +1119,13 @@ importers: version: 29.7.0(@types/node@22.15.33)(ts-node@10.9.2(@types/node@22.15.33)(typescript@5.8.3)) langchain: specifier: ^0.3.3 - version: 0.3.26(@langchain/core@0.3.56(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(axios@1.20.0)(handlebars@4.7.8)(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(ws@8.22.0) + version: 0.3.26(@langchain/core@0.3.56(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(axios@1.13.5)(handlebars@4.7.8)(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(ws@8.22.0) langchainV0.1: specifier: npm:langchain@^0.1.0 - version: langchain@0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.975.0)(@aws-sdk/credential-provider-node@3.972.1)(@google-cloud/storage@7.19.0)(@huggingface/inference@2.8.1)(@pinecone-database/pinecone@4.1.0)(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@smithy/util-utf8@2.3.0)(@zilliz/milvus2-sdk-node@2.6.9)(axios@1.20.0)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(cohere-ai@7.20.0)(duck-duck-scrape@2.2.7)(fast-xml-parser@5.3.7)(handlebars@4.7.8)(html-to-text@9.0.5)(ignore@5.3.2)(jsonwebtoken@9.0.3)(lodash@4.17.23)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(pg@8.17.2)(redis@4.7.1)(ws@8.22.0) + version: langchain@0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.975.0)(@aws-sdk/credential-provider-node@3.972.1)(@google-cloud/storage@7.19.0)(@huggingface/inference@2.8.1)(@pinecone-database/pinecone@4.1.0)(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@smithy/util-utf8@2.3.0)(@zilliz/milvus2-sdk-node@2.6.9)(axios@1.13.5)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(cohere-ai@7.20.0)(duck-duck-scrape@2.2.7)(fast-xml-parser@5.3.7)(handlebars@4.7.8)(html-to-text@9.0.5)(ignore@5.3.2)(lodash@4.17.23)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(pg@8.17.2)(redis@4.7.1)(ws@8.22.0) langchainV0.2: specifier: npm:langchain@^0.2.0 - version: langchain@0.2.20(@aws-sdk/credential-provider-node@3.972.1)(@pinecone-database/pinecone@4.1.0)(axios@1.20.0)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(fast-xml-parser@5.3.7)(handlebars@4.7.8)(html-to-text@9.0.5)(ignore@5.3.2)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(redis@4.7.1)(ws@8.22.0) + version: langchain@0.2.20(@aws-sdk/credential-provider-node@3.972.1)(@pinecone-database/pinecone@4.1.0)(axios@1.13.5)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(fast-xml-parser@5.3.7)(handlebars@4.7.8)(html-to-text@9.0.5)(ignore@5.3.2)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(redis@4.7.1)(ws@8.22.0) openai: specifier: ^4.52.7 version: 4.98.0(ws@8.22.0)(zod@3.24.4) @@ -1223,7 +1223,7 @@ importers: version: 29.7.0(@types/node@22.15.33)(ts-node@10.9.2(@types/node@22.15.33)(typescript@5.8.3)) llamaindex: specifier: '>=0.1.0' - version: 0.12.1(@modelcontextprotocol/sdk@1.32.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(hono@4.12.23)(rxjs@7.8.2)(tree-sitter@0.22.4)(web-tree-sitter@0.24.7)(zod@4.3.6) + version: 0.12.1(@modelcontextprotocol/sdk@1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(hono@4.12.23)(rxjs@7.8.2)(tree-sitter@0.22.4)(web-tree-sitter@0.24.7)(zod@4.3.6) rimraf: specifier: ^6.0.1 version: 6.1.2 @@ -1266,16 +1266,16 @@ importers: devDependencies: '@mastra/core': specifier: ^1.16.0 - version: 1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.6.5))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.6.5) + version: 1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.3.6))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.3.6) '@mastra/observability': specifier: ^1.14.0 - version: 1.14.0(@mastra/core@1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.6.5))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.6.5))(zod@4.6.5) + version: 1.14.0(@mastra/core@1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.3.6))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.3.6))(zod@4.3.6) '@mastra/otel-exporter': specifier: ^1.2.0 - version: 1.2.0(@mastra/core@1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.6.5))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.6.5))(zod@4.6.5) + version: 1.2.0(@mastra/core@1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.3.6))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.3.6))(zod@4.3.6) vitest: specifier: ^3.1.3 - version: 3.2.4(@types/debug@4.1.13)(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.9.1) + version: 3.2.4(@types/debug@4.1.13)(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.8.0) packages/traceai_mcp: dependencies: @@ -1561,7 +1561,7 @@ importers: devDependencies: '@openai/agents': specifier: 0.21.0 - version: 0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5) + version: 0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6) '@opentelemetry/sdk-trace-base': specifier: ^1.30.0 version: 1.30.1(@opentelemetry/api@1.9.0) @@ -1973,7 +1973,7 @@ importers: devDependencies: '@ai-sdk/openai': specifier: ^3.0.0 - version: 3.0.37(zod@4.6.5) + version: 3.0.37(zod@4.3.6) '@opentelemetry/api': specifier: '>=1.7.0 <2.0.0' version: 1.9.0 @@ -1985,7 +1985,7 @@ importers: version: 29.5.14 ai: specifier: ^6.0.0 - version: 6.0.97(zod@4.6.5) + version: 6.0.97(zod@4.3.6) jest: specifier: ^29.7.0 version: 29.7.0(@types/node@22.15.33)(ts-node@10.9.2(@types/node@22.15.33)(typescript@5.8.3)) @@ -2111,7 +2111,7 @@ importers: version: 22.15.33 '@voltagent/core': specifier: 2.11.0 - version: 2.11.0(@ai-sdk/provider-utils@4.0.27(zod@4.3.6))(@ai-sdk/provider@3.0.18)(@cfworker/json-schema@4.1.1)(@voltagent/logger@2.0.2(@opentelemetry/api@1.9.1))(ai@6.0.97(zod@4.3.6))(graphql@16.12.0)(ws@8.22.0)(zod@4.3.6) + version: 2.11.0(@ai-sdk/provider-utils@4.0.27(zod@4.3.6))(@ai-sdk/provider@3.0.18)(@cfworker/json-schema@4.1.1)(@voltagent/logger@2.0.2(@opentelemetry/api@1.9.1))(ai@6.0.97(zod@4.3.6))(graphql@16.12.0)(ws@8.21.0)(zod@4.3.6) '@voltagent/logger': specifier: 2.0.2 version: 2.0.2(@opentelemetry/api@1.9.1) @@ -3974,6 +3974,16 @@ packages: '@cfworker/json-schema': optional: true + '@modelcontextprotocol/sdk@1.26.0': + resolution: {integrity: sha512-Y5RmPncpiDtTXDbLKswIJzTqu2hyBKxTNsgKqKclDbhIgg1wgtf1fRuvxgTnRfcnxtvvgbIEcqUOzZrJ6iSReg==} + engines: {node: '>=18'} + peerDependencies: + '@cfworker/json-schema': ^4.1.1 + zod: ^3.25 || ^4.0 + peerDependenciesMeta: + '@cfworker/json-schema': + optional: true + '@modelcontextprotocol/sdk@1.29.0': resolution: {integrity: sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ==} engines: {node: '>=18'} @@ -4023,21 +4033,44 @@ packages: zod: optional: true + '@openai/agents-core@0.4.15': + resolution: {integrity: sha512-LDCg7GnKLgAj2Zt5f3Wi40gedez9Oh1zoLA8UgoBGKs2cLwShIMLYoeh8DTE6fHKupzdnRHScAroT3EVTV8JOw==} + peerDependencies: + zod: ^4.0.0 + peerDependenciesMeta: + zod: + optional: true + '@openai/agents-openai@0.21.0': resolution: {integrity: sha512-Y1u1ek6FwKx8j+T7gRYcm4kKyN0irqsyZm0XUDZ+g+8s15tu4EhNwNJ92zOHGx7Vjkr2RugWBxTeNspHjw/lQw==} peerDependencies: zod: ^4.0.0 + '@openai/agents-openai@0.4.15': + resolution: {integrity: sha512-JCcHyi3IAv3VdUUmnUyQI5EYiAMf9DRsuH3rgxkROdkaHQ2OBVpvwqpRFNMPOKHuLIyZuSPuP/Lf1HcfeXU2zA==} + peerDependencies: + zod: ^4.0.0 + '@openai/agents-realtime@0.21.0': resolution: {integrity: sha512-nI0jGkSdivlXzS7HXAB1EVplaeSyoAvfM2ofHheJDJdshs3UQl3x405nmTflKWye+wQrqemK4uxL06NIhgvjHg==} peerDependencies: zod: ^4.0.0 + '@openai/agents-realtime@0.4.15': + resolution: {integrity: sha512-i3eUVCjXFu9AhuhMDZynl+NBaGfpyGRgZ9CYPEvKRlZhxSYnQabtpdDyat7Dv+iljPR1+fzXJcMgci7mQLQFFg==} + peerDependencies: + zod: ^4.0.0 + '@openai/agents@0.21.0': resolution: {integrity: sha512-NpJ74/dGbpYZiRYF474pCaBpxqh4A8+WHbZmaEZVQpRqieZAVH+MV4fesR9MtRGUZfpW5B91zuHzIilQp2iSxQ==} peerDependencies: zod: ^4.0.0 + '@openai/agents@0.4.15': + resolution: {integrity: sha512-O3CJf8BIA2FoYtUy4cHmFqNcPNi2mjFIcKOySfV8m5BTkZJXElzs6zRWI6TNcEpp4nuJNB/xnKrJz3hSwQI+pw==} + peerDependencies: + zod: ^4.0.0 + '@openai/codex-sdk@0.162.1': resolution: {integrity: sha512-oG3u4y8Zq9t5QvlABcGo0cby/E2d6nrYZq71F/JBy2VOsOoqhhaMlbA7/35SWsykYGouL+T+3RgRT2X/xE+Y1g==} engines: {node: '>=18'} @@ -4754,7 +4787,6 @@ packages: '@opentelemetry/propagator-jaeger@1.25.1': resolution: {integrity: sha512-nBprRf0+jlgxks78G/xq72PipVK+4or9Ypntw0gVZYNTCSK8rg5SeaGV19tV920CMqBD/9UIOiFr23Li/Q8tiA==} engines: {node: '>=14'} - deprecated: Package no longer supported. See https://github.com/open-telemetry/opentelemetry-js/pull/7077 peerDependencies: '@opentelemetry/api': '>=1.0.0 <1.10.0' @@ -4946,7 +4978,6 @@ packages: '@opentelemetry/sdk-trace-base@1.25.1': resolution: {integrity: sha512-C8k4hnEbc5FamuZQ92nTOp8X/diCY56XUTnMiv9UTuJitCzaNNHAVsdm5+HLCdI8SLQsLWIrG38tddMxLVoftw==} engines: {node: '>=14'} - deprecated: Use @opentelemetry/sdk-trace package peerDependencies: '@opentelemetry/api': '>=1.0.0 <1.10.0' @@ -4978,7 +5009,6 @@ packages: '@opentelemetry/sdk-trace-node@1.25.1': resolution: {integrity: sha512-nMcjFIKxnFqoez4gUmihdBrbpsEnAX/Xj16sGvZm+guceYE0NE00vLhpDVK6f3q8Q4VFI5xG8JjlXKMB/SkTTQ==} engines: {node: '>=14'} - deprecated: Use @opentelemetry/sdk-trace package peerDependencies: '@opentelemetry/api': '>=1.0.0 <1.10.0' @@ -5810,6 +5840,9 @@ packages: '@types/whatwg-url@11.0.5': resolution: {integrity: sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==} + '@types/ws@8.18.1': + resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} + '@types/ws@8.18.2': resolution: {integrity: sha512-67MQl+fpWKVTT1NYdnmo3U4sc/xPo/zQBncVnI74qmQa0z/b+1g6iYqNmGCPbxO+zz2aklb08a0oHfegiVd0/w==} @@ -7194,6 +7227,10 @@ packages: hono: optional: true + hono@4.11.5: + resolution: {integrity: sha512-WemPi9/WfyMwZs+ZUXdiwcCh9Y+m7L+8vki9MzDw3jJ+W9Lc+12HGsd368Qc1vZi1xwW8BWMMsnK5efYKPdt4g==} + engines: {node: '>=16.9.0'} + hono@4.12.23: resolution: {integrity: sha512-eIaZ9qDgu7XV0pxOCrg7/WhnQ6Ivm22UcxhXx/A3dcbqbbYgBEkc6e/J/s7j2tS96zoB0S9VBdLwQNCWwUo4LA==} engines: {node: '>=16.9.0'} @@ -9954,9 +9991,6 @@ packages: workers-ai-provider@3.3.1: resolution: {integrity: sha512-vArwnmiAxQQF1clsXJd9ADn1xK9YUZVxE4umaMhrdsxM2kucxP430LfaoH4rn0AfoqtnuH3bfRhW1ak0r1x/8A==} - deprecated: |- - Deprecated. Use createAI from agents/models/ai-sdk, or - ai-search-provider for AI Search: https://developers.cloudflare.com/agents/models/ai-sdk/ peerDependencies: '@ai-sdk/anthropic': ^3.0.0 '@ai-sdk/google': ^3.0.0 @@ -10152,13 +10186,6 @@ snapshots: '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) zod: 4.3.6 - '@ai-sdk/anthropic@3.0.127(zod@4.6.5)': - dependencies: - '@ai-sdk/provider': 3.0.18 - '@ai-sdk/provider-utils': 4.0.57(zod@4.6.5) - zod: 4.6.5 - optional: true - '@ai-sdk/azure@3.0.133(zod@4.3.6)': dependencies: '@ai-sdk/deepseek': 2.0.71(zod@4.3.6) @@ -10167,15 +10194,6 @@ snapshots: '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) zod: 4.3.6 - '@ai-sdk/azure@3.0.133(zod@4.6.5)': - dependencies: - '@ai-sdk/deepseek': 2.0.71(zod@4.6.5) - '@ai-sdk/openai': 3.0.124(zod@4.6.5) - '@ai-sdk/provider': 3.0.18 - '@ai-sdk/provider-utils': 4.0.57(zod@4.6.5) - zod: 4.6.5 - optional: true - '@ai-sdk/cerebras@2.0.87(zod@4.3.6)': dependencies: '@ai-sdk/openai-compatible': 2.0.81(zod@4.3.6) @@ -10202,13 +10220,6 @@ snapshots: '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) zod: 4.3.6 - '@ai-sdk/deepseek@2.0.71(zod@4.6.5)': - dependencies: - '@ai-sdk/provider': 3.0.18 - '@ai-sdk/provider-utils': 4.0.57(zod@4.6.5) - zod: 4.6.5 - optional: true - '@ai-sdk/gateway@3.0.53(zod@4.3.6)': dependencies: '@ai-sdk/provider': 3.0.8 @@ -10216,13 +10227,6 @@ snapshots: '@vercel/oidc': 3.1.0 zod: 4.3.6 - '@ai-sdk/gateway@3.0.53(zod@4.6.5)': - dependencies: - '@ai-sdk/provider': 3.0.8 - '@ai-sdk/provider-utils': 4.0.15(zod@4.6.5) - '@vercel/oidc': 3.1.0 - zod: 4.6.5 - '@ai-sdk/google-vertex@3.0.180(zod@4.3.6)': dependencies: '@ai-sdk/anthropic': 2.0.108(zod@4.3.6) @@ -10253,13 +10257,6 @@ snapshots: '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) zod: 4.3.6 - '@ai-sdk/groq@3.0.72(zod@4.6.5)': - dependencies: - '@ai-sdk/provider': 3.0.18 - '@ai-sdk/provider-utils': 4.0.57(zod@4.6.5) - zod: 4.6.5 - optional: true - '@ai-sdk/mistral@3.0.70(zod@4.3.6)': dependencies: '@ai-sdk/provider': 3.0.18 @@ -10284,44 +10281,31 @@ snapshots: '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) zod: 4.3.6 - '@ai-sdk/openai@3.0.124(zod@4.6.5)': - dependencies: - '@ai-sdk/provider': 3.0.18 - '@ai-sdk/provider-utils': 4.0.57(zod@4.6.5) - zod: 4.6.5 - optional: true - '@ai-sdk/openai@3.0.37(zod@4.3.6)': dependencies: '@ai-sdk/provider': 3.0.8 '@ai-sdk/provider-utils': 4.0.16(zod@4.3.6) zod: 4.3.6 - '@ai-sdk/openai@3.0.37(zod@4.6.5)': - dependencies: - '@ai-sdk/provider': 3.0.8 - '@ai-sdk/provider-utils': 4.0.16(zod@4.6.5) - zod: 4.6.5 - '@ai-sdk/perplexity@3.1.2(zod@4.3.6)': dependencies: '@ai-sdk/provider': 3.0.18 '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) zod: 4.3.6 - '@ai-sdk/provider-utils@2.2.8(zod@4.6.5)': + '@ai-sdk/provider-utils@2.2.8(zod@4.3.6)': dependencies: '@ai-sdk/provider': 1.1.3 nanoid: 3.3.11 secure-json-parse: 2.7.0 - zod: 4.6.5 + zod: 4.3.6 - '@ai-sdk/provider-utils@3.0.25(zod@4.6.5)': + '@ai-sdk/provider-utils@3.0.25(zod@4.3.6)': dependencies: '@ai-sdk/provider': 2.0.3 '@standard-schema/spec': 1.1.0 eventsource-parser: 3.1.0 - zod: 4.6.5 + zod: 4.3.6 '@ai-sdk/provider-utils@3.0.41(zod@4.3.6)': dependencies: @@ -10338,13 +10322,6 @@ snapshots: eventsource-parser: 3.1.0 zod: 4.3.6 - '@ai-sdk/provider-utils@4.0.15(zod@4.6.5)': - dependencies: - '@ai-sdk/provider': 3.0.8 - '@standard-schema/spec': 1.1.0 - eventsource-parser: 3.1.0 - zod: 4.6.5 - '@ai-sdk/provider-utils@4.0.16(zod@4.3.6)': dependencies: '@ai-sdk/provider': 3.0.8 @@ -10352,13 +10329,6 @@ snapshots: eventsource-parser: 3.0.6 zod: 4.3.6 - '@ai-sdk/provider-utils@4.0.16(zod@4.6.5)': - dependencies: - '@ai-sdk/provider': 3.0.8 - '@standard-schema/spec': 1.1.0 - eventsource-parser: 3.0.6 - zod: 4.6.5 - '@ai-sdk/provider-utils@4.0.27(zod@4.3.6)': dependencies: '@ai-sdk/provider': 3.0.10 @@ -10366,13 +10336,6 @@ snapshots: eventsource-parser: 3.1.0 zod: 4.3.6 - '@ai-sdk/provider-utils@4.0.27(zod@4.6.5)': - dependencies: - '@ai-sdk/provider': 3.0.10 - '@standard-schema/spec': 1.1.0 - eventsource-parser: 3.1.0 - zod: 4.6.5 - '@ai-sdk/provider-utils@4.0.57(zod@4.3.6)': dependencies: '@ai-sdk/provider': 3.0.18 @@ -10381,14 +10344,6 @@ snapshots: undici: 6.29.0 zod: 4.3.6 - '@ai-sdk/provider-utils@4.0.57(zod@4.6.5)': - dependencies: - '@ai-sdk/provider': 3.0.18 - '@standard-schema/spec': 1.1.0 - eventsource-parser: 3.1.0 - undici: 6.29.0 - zod: 4.6.5 - '@ai-sdk/provider@1.1.3': dependencies: json-schema: 0.4.0 @@ -10420,12 +10375,12 @@ snapshots: '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) zod: 4.3.6 - '@ai-sdk/ui-utils@1.2.11(zod@4.6.5)': + '@ai-sdk/ui-utils@1.2.11(zod@4.3.6)': dependencies: '@ai-sdk/provider': 1.1.3 - '@ai-sdk/provider-utils': 2.2.8(zod@4.6.5) - zod: 4.6.5 - zod-to-json-schema: 3.25.1(zod@4.6.5) + '@ai-sdk/provider-utils': 2.2.8(zod@4.3.6) + zod: 4.3.6 + zod-to-json-schema: 3.25.1(zod@4.3.6) '@ai-sdk/vercel@2.0.83(zod@4.3.6)': dependencies: @@ -10452,8 +10407,8 @@ snapshots: '@ai-sdk/anthropic': 3.0.127(zod@4.3.6) '@ai-sdk/google': 3.0.130(zod@4.3.6) '@ai-sdk/openai': 3.0.37(zod@4.3.6) - '@ai-sdk/provider': 3.0.18 - '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + '@ai-sdk/provider': 3.0.10 + '@ai-sdk/provider-utils': 4.0.27(zod@4.3.6) zod: 4.3.6 '@ampproject/remapping@2.3.0': @@ -10485,11 +10440,11 @@ snapshots: '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.289': optional: true - '@anthropic-ai/claude-agent-sdk@0.3.289(@anthropic-ai/sdk@0.131.0(zod@4.6.5))(@modelcontextprotocol/sdk@1.32.0(@cfworker/json-schema@4.1.1)(zod@4.6.5))(zod@4.6.5)': + '@anthropic-ai/claude-agent-sdk@0.3.289(@anthropic-ai/sdk@0.131.0(zod@4.3.6))(@modelcontextprotocol/sdk@1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(zod@4.3.6)': dependencies: - '@anthropic-ai/sdk': 0.131.0(zod@4.6.5) - '@modelcontextprotocol/sdk': 1.32.0(@cfworker/json-schema@4.1.1)(zod@4.6.5) - zod: 4.6.5 + '@anthropic-ai/sdk': 0.131.0(zod@4.3.6) + '@modelcontextprotocol/sdk': 1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6) + zod: 4.3.6 optionalDependencies: '@anthropic-ai/claude-agent-sdk-darwin-arm64': 0.3.289 '@anthropic-ai/claude-agent-sdk-darwin-x64': 0.3.289 @@ -10500,12 +10455,12 @@ snapshots: '@anthropic-ai/claude-agent-sdk-win32-arm64': 0.3.289 '@anthropic-ai/claude-agent-sdk-win32-x64': 0.3.289 - '@anthropic-ai/sdk@0.131.0(zod@4.6.5)': + '@anthropic-ai/sdk@0.131.0(zod@4.3.6)': dependencies: json-schema-to-ts: 3.1.1 standardwebhooks: 1.1.1 optionalDependencies: - zod: 4.6.5 + zod: 4.3.6 '@anthropic-ai/sdk@0.27.3': dependencies: @@ -11650,15 +11605,15 @@ snapshots: - supports-color optional: true - '@gitlab/gitlab-ai-provider@3.6.1(@ai-sdk/provider-utils@4.0.27(zod@4.3.6))(@ai-sdk/provider@3.0.18)(graphql@16.12.0)(ws@8.22.0)': + '@gitlab/gitlab-ai-provider@3.6.1(@ai-sdk/provider-utils@4.0.27(zod@4.3.6))(@ai-sdk/provider@3.0.18)(graphql@16.12.0)(ws@8.21.0)': dependencies: '@ai-sdk/provider': 3.0.18 '@ai-sdk/provider-utils': 4.0.27(zod@4.3.6) '@anthropic-ai/sdk': 0.71.2(zod@3.25.76) '@anycable/core': 0.9.2 graphql-request: 6.1.0(graphql@16.12.0) - isomorphic-ws: 5.0.0(ws@8.22.0) - openai: 6.22.0(ws@8.22.0)(zod@3.25.76) + isomorphic-ws: 5.0.0(ws@8.21.0) + openai: 6.22.0(ws@8.21.0)(zod@3.25.76) socket.io-client: 4.8.4 vscode-jsonrpc: 8.2.1 zod: 3.25.76 @@ -11848,7 +11803,6 @@ snapshots: dependencies: arrify: 2.0.1 extend: 3.0.2 - optional: true '@google-cloud/paginator@7.1.0': dependencies: @@ -11856,13 +11810,11 @@ snapshots: '@google-cloud/precise-date@4.0.0': {} - '@google-cloud/projectify@4.0.0': - optional: true + '@google-cloud/projectify@4.0.0': {} '@google-cloud/projectify@6.1.0': {} - '@google-cloud/promisify@4.0.0': - optional: true + '@google-cloud/promisify@4.0.0': {} '@google-cloud/promisify@6.1.0': {} @@ -11886,7 +11838,6 @@ snapshots: transitivePeerDependencies: - encoding - supports-color - optional: true '@google-cloud/storage@8.2.0': dependencies: @@ -11915,11 +11866,11 @@ snapshots: - encoding - supports-color - '@google/adk@0.3.0(900cbfeb5b2bd48dc2871a3158424dee)': + '@google/adk@0.3.0(e60519ede9712f800b601f30df69e9e3)': dependencies: '@google-cloud/opentelemetry-cloud-monitoring-exporter': 0.21.0(@opentelemetry/api@1.9.0)(@opentelemetry/core@2.7.1(@opentelemetry/api@1.9.0))(@opentelemetry/resources@2.7.1(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-metrics@2.7.1(@opentelemetry/api@1.9.0)) '@google-cloud/opentelemetry-cloud-trace-exporter': 3.0.0(@opentelemetry/api@1.9.0)(@opentelemetry/core@2.7.1(@opentelemetry/api@1.9.0))(@opentelemetry/resources@2.7.1(@opentelemetry/api@1.9.0))(@opentelemetry/sdk-trace-base@1.30.1(@opentelemetry/api@1.9.0)) - '@google-cloud/storage': 8.2.0 + '@google-cloud/storage': 7.19.0 '@google/genai': 1.42.0(@modelcontextprotocol/sdk@1.25.3(@cfworker/json-schema@4.1.1)(zod@4.3.6)) '@modelcontextprotocol/sdk': 1.25.3(@cfworker/json-schema@4.1.1)(zod@4.3.6) '@opentelemetry/api': 1.9.0 @@ -11987,6 +11938,13 @@ snapshots: protobufjs: 7.5.4 yargs: 17.7.2 + '@guardrails-ai/core@0.1.1(ws@8.21.0)': + dependencies: + lodash.clonedeep: 4.5.0 + pythonia: 1.2.6(ws@8.21.0) + transitivePeerDependencies: + - ws + '@guardrails-ai/core@0.1.1(ws@8.22.0)': dependencies: lodash.clonedeep: 4.5.0 @@ -11994,6 +11952,13 @@ snapshots: transitivePeerDependencies: - ws + '@hono/node-server@1.19.9': {} + + '@hono/node-server@1.19.9(hono@4.11.5)': + dependencies: + hono: 4.11.5 + optional: true + '@hono/node-server@1.19.9(hono@4.12.23)': dependencies: hono: 4.12.23 @@ -12004,11 +11969,11 @@ snapshots: '@huggingface/tasks@0.12.30': {} - '@instructor-ai/instructor@1.7.0(zod@4.6.5)': + '@instructor-ai/instructor@1.7.0(zod@4.3.6)': dependencies: - zod: 4.6.5 - zod-stream: 3.0.0(zod@4.6.5) - zod-validation-error: 3.5.4(zod@4.6.5) + zod: 4.3.6 + zod-stream: 3.0.0(zod@4.3.6) + zod-validation-error: 3.5.4(zod@4.3.6) '@isaacs/balanced-match@4.0.1': {} @@ -12240,6 +12205,21 @@ snapshots: '@lancedb/lancedb-win32-x64-msvc@0.4.20': optional: true + '@lancedb/lancedb@0.4.20(ws@8.21.0)(zod@3.25.76)': + dependencies: + apache-arrow: 15.0.2 + openai: 4.98.0(ws@8.21.0)(zod@3.25.76) + optionalDependencies: + '@lancedb/lancedb-darwin-arm64': 0.4.20 + '@lancedb/lancedb-darwin-x64': 0.4.20 + '@lancedb/lancedb-linux-arm64-gnu': 0.4.20 + '@lancedb/lancedb-linux-x64-gnu': 0.4.20 + '@lancedb/lancedb-win32-x64-msvc': 0.4.20 + transitivePeerDependencies: + - encoding + - ws + - zod + '@lancedb/lancedb@0.4.20(ws@8.22.0)(zod@3.25.76)': dependencies: apache-arrow: 15.0.2 @@ -12255,7 +12235,39 @@ snapshots: - ws - zod - '@langchain/community@0.0.57(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.975.0)(@aws-sdk/credential-provider-node@3.972.1)(@huggingface/inference@2.8.1)(@pinecone-database/pinecone@4.1.0)(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@smithy/util-utf8@2.3.0)(@zilliz/milvus2-sdk-node@2.6.9)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(cohere-ai@7.20.0)(duck-duck-scrape@2.2.7)(html-to-text@9.0.5)(jsonwebtoken@9.0.3)(lodash@4.17.23)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(pg@8.17.2)(redis@4.7.1)(ws@8.22.0)': + '@langchain/community@0.0.57(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.975.0)(@aws-sdk/credential-provider-node@3.972.1)(@huggingface/inference@2.8.1)(@pinecone-database/pinecone@4.1.0)(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@smithy/util-utf8@2.3.0)(@zilliz/milvus2-sdk-node@2.6.9)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.21.0)(zod@3.24.4)))(cohere-ai@7.20.0)(duck-duck-scrape@2.2.7)(html-to-text@9.0.5)(lodash@4.17.23)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.21.0)(zod@3.24.4))(pg@8.17.2)(redis@4.7.1)(ws@8.21.0)': + dependencies: + '@langchain/core': 0.1.63(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + '@langchain/openai': 0.0.34(ws@8.21.0) + expr-eval: 2.0.2 + flat: 5.0.2 + langsmith: 0.1.68(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + uuid: 9.0.1 + zod: 3.25.76 + zod-to-json-schema: 3.25.1(zod@3.25.76) + optionalDependencies: + '@aws-crypto/sha256-js': 5.2.0 + '@aws-sdk/client-bedrock-runtime': 3.975.0 + '@aws-sdk/credential-provider-node': 3.972.1 + '@huggingface/inference': 2.8.1 + '@pinecone-database/pinecone': 4.1.0 + '@qdrant/js-client-rest': 1.16.2(typescript@5.8.3) + '@smithy/util-utf8': 2.3.0 + '@zilliz/milvus2-sdk-node': 2.6.9 + chromadb: 1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + cohere-ai: 7.20.0 + duck-duck-scrape: 2.2.7 + html-to-text: 9.0.5 + lodash: 4.17.23 + mongodb: 6.21.0(@aws-sdk/credential-providers@3.975.0) + pg: 8.17.2 + redis: 4.7.1 + ws: 8.21.0 + transitivePeerDependencies: + - encoding + - openai + + '@langchain/community@0.0.57(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.975.0)(@aws-sdk/credential-provider-node@3.972.1)(@huggingface/inference@2.8.1)(@pinecone-database/pinecone@4.1.0)(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@smithy/util-utf8@2.3.0)(@zilliz/milvus2-sdk-node@2.6.9)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(cohere-ai@7.20.0)(duck-duck-scrape@2.2.7)(html-to-text@9.0.5)(lodash@4.17.23)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(pg@8.17.2)(redis@4.7.1)(ws@8.22.0)': dependencies: '@langchain/core': 0.1.63(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) '@langchain/openai': 0.0.34(ws@8.22.0) @@ -12278,7 +12290,6 @@ snapshots: cohere-ai: 7.20.0 duck-duck-scrape: 2.2.7 html-to-text: 9.0.5 - jsonwebtoken: 9.0.3 lodash: 4.17.23 mongodb: 6.21.0(@aws-sdk/credential-providers@3.975.0) pg: 8.17.2 @@ -12288,6 +12299,23 @@ snapshots: - encoding - openai + '@langchain/core@0.1.63(openai@4.98.0(ws@8.21.0)(zod@3.24.4))': + dependencies: + ansi-styles: 5.2.0 + camelcase: 6.3.0 + decamelize: 1.2.0 + js-tiktoken: 1.0.20 + langsmith: 0.1.68(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + ml-distance: 4.0.1 + mustache: 4.2.0 + p-queue: 6.6.2 + p-retry: 4.6.2 + uuid: 9.0.1 + zod: 3.25.76 + zod-to-json-schema: 3.25.1(zod@3.25.76) + transitivePeerDependencies: + - openai + '@langchain/core@0.1.63(openai@4.98.0(ws@8.22.0)(zod@3.24.4))': dependencies: ansi-styles: 5.2.0 @@ -12305,6 +12333,22 @@ snapshots: transitivePeerDependencies: - openai + '@langchain/core@0.2.36(openai@4.104.0(ws@8.21.0)(zod@3.25.76))': + dependencies: + ansi-styles: 5.2.0 + camelcase: 6.3.0 + decamelize: 1.2.0 + js-tiktoken: 1.0.20 + langsmith: 0.1.68(openai@4.104.0(ws@8.21.0)(zod@3.25.76)) + mustache: 4.2.0 + p-queue: 6.6.2 + p-retry: 4.6.2 + uuid: 10.0.0 + zod: 3.25.76 + zod-to-json-schema: 3.25.1(zod@3.25.76) + transitivePeerDependencies: + - openai + '@langchain/core@0.2.36(openai@4.104.0(ws@8.22.0)(zod@3.25.76))': dependencies: ansi-styles: 5.2.0 @@ -12321,6 +12365,22 @@ snapshots: transitivePeerDependencies: - openai + '@langchain/core@0.2.36(openai@4.98.0(ws@8.21.0)(zod@3.24.4))': + dependencies: + ansi-styles: 5.2.0 + camelcase: 6.3.0 + decamelize: 1.2.0 + js-tiktoken: 1.0.20 + langsmith: 0.1.68(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + mustache: 4.2.0 + p-queue: 6.6.2 + p-retry: 4.6.2 + uuid: 10.0.0 + zod: 3.25.76 + zod-to-json-schema: 3.25.1(zod@3.25.76) + transitivePeerDependencies: + - openai + '@langchain/core@0.2.36(openai@4.98.0(ws@8.22.0)(zod@3.24.4))': dependencies: ansi-styles: 5.2.0 @@ -12337,13 +12397,30 @@ snapshots: transitivePeerDependencies: - openai - '@langchain/core@0.2.36(openai@7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5))': + '@langchain/core@0.2.36(openai@6.22.0(ws@8.21.0)(zod@4.3.6))': + dependencies: + ansi-styles: 5.2.0 + camelcase: 6.3.0 + decamelize: 1.2.0 + js-tiktoken: 1.0.20 + langsmith: 0.1.68(openai@6.22.0(ws@8.21.0)(zod@4.3.6)) + mustache: 4.2.0 + p-queue: 6.6.2 + p-retry: 4.6.2 + uuid: 10.0.0 + zod: 3.25.76 + zod-to-json-schema: 3.25.1(zod@3.25.76) + transitivePeerDependencies: + - openai + optional: true + + '@langchain/core@0.2.36(openai@7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6))': dependencies: ansi-styles: 5.2.0 camelcase: 6.3.0 decamelize: 1.2.0 js-tiktoken: 1.0.20 - langsmith: 0.1.68(openai@7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5)) + langsmith: 0.1.68(openai@7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6)) mustache: 4.2.0 p-queue: 6.6.2 p-retry: 4.6.2 @@ -12354,6 +12431,23 @@ snapshots: - openai optional: true + '@langchain/core@0.3.56(openai@4.98.0(ws@8.21.0)(zod@3.24.4))': + dependencies: + '@cfworker/json-schema': 4.1.1 + ansi-styles: 5.2.0 + camelcase: 6.3.0 + decamelize: 1.2.0 + js-tiktoken: 1.0.20 + langsmith: 0.3.29(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + mustache: 4.2.0 + p-queue: 6.6.2 + p-retry: 4.6.2 + uuid: 10.0.0 + zod: 3.24.4 + zod-to-json-schema: 3.24.5(zod@3.24.4) + transitivePeerDependencies: + - openai + '@langchain/core@0.3.56(openai@4.98.0(ws@8.22.0)(zod@3.24.4))': dependencies: '@cfworker/json-schema': 4.1.1 @@ -12371,18 +12465,18 @@ snapshots: transitivePeerDependencies: - openai - '@langchain/openai@0.0.34(ws@8.22.0)': + '@langchain/openai@0.0.34(ws@8.21.0)': dependencies: - '@langchain/core': 0.2.36(openai@4.104.0(ws@8.22.0)(zod@3.25.76)) + '@langchain/core': 0.2.36(openai@4.104.0(ws@8.21.0)(zod@3.25.76)) js-tiktoken: 1.0.20 - openai: 4.104.0(ws@8.22.0)(zod@3.25.76) + openai: 4.104.0(ws@8.21.0)(zod@3.25.76) zod: 3.25.76 zod-to-json-schema: 3.25.1(zod@3.25.76) transitivePeerDependencies: - encoding - ws - '@langchain/openai@0.2.11(ws@8.22.0)': + '@langchain/openai@0.0.34(ws@8.22.0)': dependencies: '@langchain/core': 0.2.36(openai@4.104.0(ws@8.22.0)(zod@3.25.76)) js-tiktoken: 1.0.20 @@ -12393,27 +12487,72 @@ snapshots: - encoding - ws - '@langchain/openai@0.3.16(@langchain/core@0.3.56(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(ws@8.22.0)': + '@langchain/openai@0.2.11(ws@8.21.0)': dependencies: - '@langchain/core': 0.3.56(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) + '@langchain/core': 0.2.36(openai@4.104.0(ws@8.21.0)(zod@3.25.76)) js-tiktoken: 1.0.20 - openai: 4.104.0(ws@8.22.0)(zod@3.25.76) + openai: 4.104.0(ws@8.21.0)(zod@3.25.76) zod: 3.25.76 zod-to-json-schema: 3.25.1(zod@3.25.76) transitivePeerDependencies: - encoding - ws - '@langchain/textsplitters@0.0.3(openai@4.98.0(ws@8.22.0)(zod@3.24.4))': + '@langchain/openai@0.2.11(ws@8.22.0)': dependencies: - '@langchain/core': 0.2.36(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) + '@langchain/core': 0.2.36(openai@4.104.0(ws@8.22.0)(zod@3.25.76)) js-tiktoken: 1.0.20 + openai: 4.104.0(ws@8.22.0)(zod@3.25.76) + zod: 3.25.76 + zod-to-json-schema: 3.25.1(zod@3.25.76) transitivePeerDependencies: - - openai + - encoding + - ws - '@langchain/textsplitters@0.1.0(@langchain/core@0.3.56(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))': + '@langchain/openai@0.3.16(@langchain/core@0.3.56(openai@4.98.0(ws@8.21.0)(zod@3.24.4)))(ws@8.21.0)': dependencies: - '@langchain/core': 0.3.56(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) + '@langchain/core': 0.3.56(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + js-tiktoken: 1.0.20 + openai: 4.104.0(ws@8.21.0)(zod@3.25.76) + zod: 3.25.76 + zod-to-json-schema: 3.25.1(zod@3.25.76) + transitivePeerDependencies: + - encoding + - ws + + '@langchain/openai@0.3.16(@langchain/core@0.3.56(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(ws@8.22.0)': + dependencies: + '@langchain/core': 0.3.56(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) + js-tiktoken: 1.0.20 + openai: 4.104.0(ws@8.22.0)(zod@3.25.76) + zod: 3.25.76 + zod-to-json-schema: 3.25.1(zod@3.25.76) + transitivePeerDependencies: + - encoding + - ws + + '@langchain/textsplitters@0.0.3(openai@4.98.0(ws@8.21.0)(zod@3.24.4))': + dependencies: + '@langchain/core': 0.2.36(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + js-tiktoken: 1.0.20 + transitivePeerDependencies: + - openai + + '@langchain/textsplitters@0.0.3(openai@4.98.0(ws@8.22.0)(zod@3.24.4))': + dependencies: + '@langchain/core': 0.2.36(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) + js-tiktoken: 1.0.20 + transitivePeerDependencies: + - openai + + '@langchain/textsplitters@0.1.0(@langchain/core@0.3.56(openai@4.98.0(ws@8.21.0)(zod@3.24.4)))': + dependencies: + '@langchain/core': 0.3.56(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + js-tiktoken: 1.0.20 + + '@langchain/textsplitters@0.1.0(@langchain/core@0.3.56(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))': + dependencies: + '@langchain/core': 0.3.56(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) js-tiktoken: 1.0.20 '@livekit/mutex@1.1.1': {} @@ -12473,6 +12612,15 @@ snapshots: tree-sitter: 0.22.4 web-tree-sitter: 0.24.7 + '@llamaindex/openai@0.4.22(@llamaindex/core@0.6.22)(@llamaindex/env@0.1.30)(ws@8.21.0)(zod@4.3.6)': + dependencies: + '@llamaindex/core': 0.6.22 + '@llamaindex/env': 0.1.30 + openai: 5.23.2(ws@8.21.0)(zod@4.3.6) + transitivePeerDependencies: + - ws + - zod + '@llamaindex/openai@0.4.22(@llamaindex/core@0.6.22)(@llamaindex/env@0.1.30)(ws@8.22.0)(zod@4.3.6)': dependencies: '@llamaindex/core': 0.6.22 @@ -12482,18 +12630,18 @@ snapshots: - ws - zod - '@llamaindex/workflow-core@1.3.3(@modelcontextprotocol/sdk@1.32.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(hono@4.12.23)(rxjs@7.8.2)(zod@4.3.6)': + '@llamaindex/workflow-core@1.3.3(@modelcontextprotocol/sdk@1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(hono@4.12.23)(rxjs@7.8.2)(zod@4.3.6)': optionalDependencies: - '@modelcontextprotocol/sdk': 1.32.0(@cfworker/json-schema@4.1.1)(zod@4.3.6) + '@modelcontextprotocol/sdk': 1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6) hono: 4.12.23 rxjs: 7.8.2 zod: 4.3.6 - '@llamaindex/workflow@1.1.24(@llamaindex/core@0.6.22)(@llamaindex/env@0.1.30)(@modelcontextprotocol/sdk@1.32.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(hono@4.12.23)(rxjs@7.8.2)(zod@4.3.6)': + '@llamaindex/workflow@1.1.24(@llamaindex/core@0.6.22)(@llamaindex/env@0.1.30)(@modelcontextprotocol/sdk@1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(hono@4.12.23)(rxjs@7.8.2)(zod@4.3.6)': dependencies: '@llamaindex/core': 0.6.22 '@llamaindex/env': 0.1.30 - '@llamaindex/workflow-core': 1.3.3(@modelcontextprotocol/sdk@1.32.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(hono@4.12.23)(rxjs@7.8.2)(zod@4.3.6) + '@llamaindex/workflow-core': 1.3.3(@modelcontextprotocol/sdk@1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(hono@4.12.23)(rxjs@7.8.2)(zod@4.3.6) transitivePeerDependencies: - '@modelcontextprotocol/sdk' - hono @@ -12508,29 +12656,29 @@ snapshots: dependencies: '@lukeed/csprng': 1.1.0 - '@mastra/core@1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.6.5))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.6.5)': + '@mastra/core@1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.3.6))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.3.6)': dependencies: '@a2a-js/sdk': 0.3.13(@bufbuild/protobuf@2.11.0)(@grpc/grpc-js@1.14.3)(express@5.2.1) - '@ai-sdk/provider-utils-v5': '@ai-sdk/provider-utils@3.0.25(zod@4.6.5)' - '@ai-sdk/provider-utils-v6': '@ai-sdk/provider-utils@4.0.27(zod@4.6.5)' + '@ai-sdk/provider-utils-v5': '@ai-sdk/provider-utils@3.0.25(zod@4.3.6)' + '@ai-sdk/provider-utils-v6': '@ai-sdk/provider-utils@4.0.27(zod@4.3.6)' '@ai-sdk/provider-v5': '@ai-sdk/provider@2.0.3' '@ai-sdk/provider-v6': '@ai-sdk/provider@3.0.10' - '@ai-sdk/ui-utils-v5': '@ai-sdk/ui-utils@1.2.11(zod@4.6.5)' + '@ai-sdk/ui-utils-v5': '@ai-sdk/ui-utils@1.2.11(zod@4.3.6)' '@isaacs/ttlcache': 2.1.5 '@lukeed/uuid': 2.0.1 - '@mastra/schema-compat': 1.2.10(zod@4.6.5) - '@modelcontextprotocol/sdk': 1.29.0(@cfworker/json-schema@4.1.1)(zod@4.6.5) + '@mastra/schema-compat': 1.2.10(zod@4.3.6) + '@modelcontextprotocol/sdk': 1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6) '@sindresorhus/slugify': 2.2.1 '@standard-schema/spec': 1.1.0 ajv: 8.20.0 - chat: 4.30.0(zod@4.6.5) + chat: 4.30.0(zod@4.3.6) croner: 10.0.1 dotenv: 17.4.2 execa: 9.6.1 fastq: 1.20.1 gray-matter: 4.0.3 hono: 4.12.23 - hono-openapi: 1.3.0(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.6.5))(@types/json-schema@7.0.15)(hono@4.12.23)(openapi-types@12.1.3) + hono-openapi: 1.3.0(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.3.6))(@types/json-schema@7.0.15)(hono@4.12.23)(openapi-types@12.1.3) ignore: 7.0.5 json-schema: 0.4.0 lru-cache: 11.5.1 @@ -12541,7 +12689,7 @@ snapshots: tokenx: 1.3.0 ws: 8.21.0 xxhash-wasm: 1.1.0 - zod: 4.6.5 + zod: 4.3.6 transitivePeerDependencies: - '@bufbuild/protobuf' - '@cfworker/json-schema' @@ -12558,15 +12706,15 @@ snapshots: - supports-color - utf-8-validate - '@mastra/observability@1.14.0(@mastra/core@1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.6.5))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.6.5))(zod@4.6.5)': + '@mastra/observability@1.14.0(@mastra/core@1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.3.6))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.3.6))(zod@4.3.6)': dependencies: - '@mastra/core': 1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.6.5))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.6.5) - zod: 4.6.5 + '@mastra/core': 1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.3.6))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.3.6) + zod: 4.3.6 - '@mastra/otel-exporter@1.2.0(@mastra/core@1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.6.5))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.6.5))(zod@4.6.5)': + '@mastra/otel-exporter@1.2.0(@mastra/core@1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.3.6))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.3.6))(zod@4.3.6)': dependencies: - '@mastra/core': 1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.6.5))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.6.5) - '@mastra/observability': 1.14.0(@mastra/core@1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.6.5))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.6.5))(zod@4.6.5) + '@mastra/core': 1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.3.6))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.3.6) + '@mastra/observability': 1.14.0(@mastra/core@1.37.1(@bufbuild/protobuf@2.11.0)(@cfworker/json-schema@4.1.1)(@grpc/grpc-js@1.14.3)(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.3.6))(@types/json-schema@7.0.15)(express@5.2.1)(openapi-types@12.1.3)(rxjs@7.8.2)(zod@4.3.6))(zod@4.3.6) '@opentelemetry/api': 1.9.1 '@opentelemetry/api-logs': 0.218.0 '@opentelemetry/core': 2.7.1(@opentelemetry/api@1.9.1) @@ -12587,13 +12735,13 @@ snapshots: transitivePeerDependencies: - zod - '@mastra/schema-compat@1.2.10(zod@4.6.5)': + '@mastra/schema-compat@1.2.10(zod@4.3.6)': dependencies: json-schema-to-zod: 2.8.1 - zod: 4.6.5 + zod: 4.3.6 zod-from-json-schema: 0.5.2 zod-from-json-schema-v3: zod-from-json-schema@0.0.5 - zod-to-json-schema: 3.25.1(zod@4.6.5) + zod-to-json-schema: 3.25.1(zod@4.3.6) '@mistralai/mistralai@1.13.0': dependencies: @@ -12666,11 +12814,11 @@ snapshots: - hono - supports-color - '@modelcontextprotocol/sdk@1.29.0(@cfworker/json-schema@4.1.1)(zod@4.6.5)': + '@modelcontextprotocol/sdk@1.26.0(@cfworker/json-schema@4.1.1)(zod@4.3.6)': dependencies: - '@hono/node-server': 1.19.9(hono@4.12.23) - ajv: 8.20.0 - ajv-formats: 3.0.1(ajv@8.20.0) + '@hono/node-server': 1.19.9(hono@4.11.5) + ajv: 8.17.1 + ajv-formats: 3.0.1(ajv@8.17.1) content-type: 1.0.5 cors: 2.8.6 cross-spawn: 7.0.6 @@ -12678,19 +12826,20 @@ snapshots: eventsource-parser: 3.0.6 express: 5.2.1 express-rate-limit: 8.2.1(express@5.2.1) - hono: 4.12.23 + hono: 4.11.5 jose: 6.1.3 json-schema-typed: 8.0.2 pkce-challenge: 5.0.1 raw-body: 3.0.2 - zod: 4.6.5 - zod-to-json-schema: 3.25.1(zod@4.6.5) + zod: 4.3.6 + zod-to-json-schema: 3.25.1(zod@4.3.6) optionalDependencies: '@cfworker/json-schema': 4.1.1 transitivePeerDependencies: - supports-color + optional: true - '@modelcontextprotocol/sdk@1.32.0(@cfworker/json-schema@4.1.1)(zod@4.3.6)': + '@modelcontextprotocol/sdk@1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6)': dependencies: '@hono/node-server': 1.19.9(hono@4.12.23) ajv: 8.20.0 @@ -12699,7 +12848,7 @@ snapshots: cors: 2.8.6 cross-spawn: 7.0.6 eventsource: 3.0.7 - eventsource-parser: 3.1.0 + eventsource-parser: 3.0.6 express: 5.2.1 express-rate-limit: 8.2.1(express@5.2.1) hono: 4.12.23 @@ -12714,7 +12863,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@modelcontextprotocol/sdk@1.32.0(@cfworker/json-schema@4.1.1)(zod@4.6.5)': + '@modelcontextprotocol/sdk@1.32.0(@cfworker/json-schema@4.1.1)(zod@4.3.6)': dependencies: '@hono/node-server': 1.19.9(hono@4.12.23) ajv: 8.20.0 @@ -12731,8 +12880,8 @@ snapshots: json-schema-typed: 8.0.2 pkce-challenge: 5.0.1 raw-body: 3.0.2 - zod: 4.6.5 - zod-to-json-schema: 3.25.1(zod@4.6.5) + zod: 4.3.6 + zod-to-json-schema: 3.25.1(zod@4.3.6) optionalDependencies: '@cfworker/json-schema': 4.1.1 transitivePeerDependencies: @@ -12744,8 +12893,8 @@ snapshots: '@mymediset/sap-ai-provider@2.1.0(ai@6.0.97(zod@4.3.6))': dependencies: - '@ai-sdk/provider': 3.0.18 - '@ai-sdk/provider-utils': 4.0.57(zod@4.3.6) + '@ai-sdk/provider': 3.0.10 + '@ai-sdk/provider-utils': 4.0.27(zod@4.3.6) '@sap-ai-sdk/orchestration': 2.16.0 ai: 6.0.97(zod@4.3.6) zod: 4.3.6 @@ -12766,14 +12915,14 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.20.1 - '@openai/agents-core@0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5)': + '@openai/agents-core@0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6)': dependencies: '@standard-schema/spec': 1.1.0 debug: 4.4.3 - openai: 7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5) + openai: 7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6) optionalDependencies: '@modelcontextprotocol/client': 2.3.1 - zod: 4.6.5 + zod: 4.3.6 transitivePeerDependencies: - '@aws-sdk/credential-provider-node' - '@smithy/hash-node' @@ -12783,11 +12932,35 @@ snapshots: - undici - ws - '@openai/agents-openai@0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5)': + '@openai/agents-core@0.4.15(@cfworker/json-schema@4.1.1)(ws@8.19.0)(zod@4.3.6)': dependencies: - '@openai/agents-core': 0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5) - openai: 7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5) - zod: 4.6.5 + debug: 4.4.3 + openai: 6.22.0(ws@8.19.0)(zod@4.3.6) + optionalDependencies: + '@modelcontextprotocol/sdk': 1.26.0(@cfworker/json-schema@4.1.1)(zod@4.3.6) + zod: 4.3.6 + transitivePeerDependencies: + - '@cfworker/json-schema' + - supports-color + - ws + + '@openai/agents-core@0.4.15(@cfworker/json-schema@4.1.1)(ws@8.21.0)(zod@4.3.6)': + dependencies: + debug: 4.4.3 + openai: 6.22.0(ws@8.21.0)(zod@4.3.6) + optionalDependencies: + '@modelcontextprotocol/sdk': 1.26.0(@cfworker/json-schema@4.1.1)(zod@4.3.6) + zod: 4.3.6 + transitivePeerDependencies: + - '@cfworker/json-schema' + - supports-color + - ws + + '@openai/agents-openai@0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6)': + dependencies: + '@openai/agents-core': 0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6) + openai: 7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6) + zod: 4.3.6 transitivePeerDependencies: - '@aws-sdk/credential-provider-node' - '@smithy/hash-node' @@ -12797,12 +12970,23 @@ snapshots: - undici - ws - '@openai/agents-realtime@0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(zod@4.6.5)': + '@openai/agents-openai@0.4.15(@cfworker/json-schema@4.1.1)(ws@8.21.0)(zod@4.3.6)': + dependencies: + '@openai/agents-core': 0.4.15(@cfworker/json-schema@4.1.1)(ws@8.21.0)(zod@4.3.6) + debug: 4.4.3 + openai: 6.22.0(ws@8.21.0)(zod@4.3.6) + zod: 4.3.6 + transitivePeerDependencies: + - '@cfworker/json-schema' + - supports-color + - ws + + '@openai/agents-realtime@0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(zod@4.3.6)': dependencies: - '@openai/agents-core': 0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5) + '@openai/agents-core': 0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6) '@types/ws': 8.18.2 ws: 8.22.0 - zod: 4.6.5 + zod: 4.3.6 transitivePeerDependencies: - '@aws-sdk/credential-provider-node' - '@smithy/hash-node' @@ -12813,13 +12997,26 @@ snapshots: - undici - utf-8-validate - '@openai/agents@0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5)': + '@openai/agents-realtime@0.4.15(@cfworker/json-schema@4.1.1)(zod@4.3.6)': dependencies: - '@openai/agents-core': 0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5) - '@openai/agents-openai': 0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5) - '@openai/agents-realtime': 0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(zod@4.6.5) - openai: 7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5) - zod: 4.6.5 + '@openai/agents-core': 0.4.15(@cfworker/json-schema@4.1.1)(ws@8.19.0)(zod@4.3.6) + '@types/ws': 8.18.1 + debug: 4.4.3 + ws: 8.19.0 + zod: 4.3.6 + transitivePeerDependencies: + - '@cfworker/json-schema' + - bufferutil + - supports-color + - utf-8-validate + + '@openai/agents@0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6)': + dependencies: + '@openai/agents-core': 0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6) + '@openai/agents-openai': 0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6) + '@openai/agents-realtime': 0.21.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(zod@4.3.6) + openai: 7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6) + zod: 4.3.6 transitivePeerDependencies: - '@aws-sdk/credential-provider-node' - '@smithy/hash-node' @@ -12831,6 +13028,21 @@ snapshots: - utf-8-validate - ws + '@openai/agents@0.4.15(@cfworker/json-schema@4.1.1)(ws@8.21.0)(zod@4.3.6)': + dependencies: + '@openai/agents-core': 0.4.15(@cfworker/json-schema@4.1.1)(ws@8.21.0)(zod@4.3.6) + '@openai/agents-openai': 0.4.15(@cfworker/json-schema@4.1.1)(ws@8.21.0)(zod@4.3.6) + '@openai/agents-realtime': 0.4.15(@cfworker/json-schema@4.1.1)(zod@4.3.6) + debug: 4.4.3 + openai: 6.22.0(ws@8.21.0)(zod@4.3.6) + zod: 4.3.6 + transitivePeerDependencies: + - '@cfworker/json-schema' + - bufferutil + - supports-color + - utf-8-validate + - ws + '@openai/codex-sdk@0.162.1': dependencies: '@openai/codex': 0.162.1 @@ -14946,25 +15158,39 @@ snapshots: '@stablelib/base64@1.0.1': {} - '@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5)': + '@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6)': dependencies: '@standard-schema/spec': 1.1.0 '@types/json-schema': 7.0.15 quansync: 0.2.11 optionalDependencies: - zod: 4.6.5 - zod-to-json-schema: 3.25.1(zod@4.6.5) + zod: 4.3.6 + zod-to-json-schema: 3.25.1(zod@4.3.6) - '@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.6.5)': + '@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.3.6)': dependencies: - '@standard-community/standard-json': 0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5) + '@standard-community/standard-json': 0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6) '@standard-schema/spec': 1.1.0 openapi-types: 12.1.3 optionalDependencies: - zod: 4.6.5 + zod: 4.3.6 '@standard-schema/spec@1.1.0': {} + '@strands-agents/sdk@0.1.6(@cfworker/json-schema@4.1.1)(ws@8.21.0)': + dependencies: + '@aws-sdk/client-bedrock-runtime': 3.975.0 + '@modelcontextprotocol/sdk': 1.25.3(@cfworker/json-schema@4.1.1)(zod@4.3.6) + zod: 4.3.6 + optionalDependencies: + openai: 6.22.0(ws@8.21.0)(zod@4.3.6) + transitivePeerDependencies: + - '@cfworker/json-schema' + - aws-crt + - hono + - supports-color + - ws + '@strands-agents/sdk@0.1.6(@cfworker/json-schema@4.1.1)(ws@8.22.0)': dependencies: '@aws-sdk/client-bedrock-runtime': 3.975.0 @@ -14985,8 +15211,7 @@ snapshots: dependencies: tslib: 2.8.1 - '@tootallnate/once@2.0.0': - optional: true + '@tootallnate/once@2.0.0': {} '@tsconfig/node10@1.0.11': {} @@ -15030,8 +15255,7 @@ snapshots: '@types/node': 22.15.33 optional: true - '@types/caseless@0.12.5': - optional: true + '@types/caseless@0.12.5': {} '@types/chai@5.2.3': dependencies: @@ -15175,7 +15399,6 @@ snapshots: '@types/node': 22.15.33 '@types/tough-cookie': 4.0.5 form-data: 2.5.5 - optional: true '@types/retry@0.12.0': {} @@ -15197,8 +15420,7 @@ snapshots: '@types/node': 22.15.33 optional: true - '@types/tough-cookie@4.0.5': - optional: true + '@types/tough-cookie@4.0.5': {} '@types/triple-beam@1.3.5': {} @@ -15212,6 +15434,10 @@ snapshots: dependencies: '@types/webidl-conversions': 7.0.3 + '@types/ws@8.18.1': + dependencies: + '@types/node': 22.15.33 + '@types/ws@8.18.2': dependencies: '@types/node': 22.15.33 @@ -15239,13 +15465,13 @@ snapshots: chai: 5.3.3 tinyrainbow: 2.0.0 - '@vitest/mocker@3.2.4(vite@7.3.1(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.9.1))': + '@vitest/mocker@3.2.4(vite@7.3.1(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.8.0))': dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 7.3.1(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.9.1) + vite: 7.3.1(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.8.0) '@vitest/pretty-format@3.2.4': dependencies: @@ -15273,7 +15499,7 @@ snapshots: loupe: 3.2.1 tinyrainbow: 2.0.0 - '@voltagent/core@2.11.0(@ai-sdk/provider-utils@4.0.27(zod@4.3.6))(@ai-sdk/provider@3.0.18)(@cfworker/json-schema@4.1.1)(@voltagent/logger@2.0.2(@opentelemetry/api@1.9.1))(ai@6.0.97(zod@4.3.6))(graphql@16.12.0)(ws@8.22.0)(zod@4.3.6)': + '@voltagent/core@2.11.0(@ai-sdk/provider-utils@4.0.27(zod@4.3.6))(@ai-sdk/provider@3.0.18)(@cfworker/json-schema@4.1.1)(@voltagent/logger@2.0.2(@opentelemetry/api@1.9.1))(ai@6.0.97(zod@4.3.6))(graphql@16.12.0)(ws@8.21.0)(zod@4.3.6)': dependencies: '@ai-sdk/amazon-bedrock': 3.0.138(zod@4.3.6) '@ai-sdk/anthropic': 3.0.127(zod@4.3.6) @@ -15294,7 +15520,7 @@ snapshots: '@ai-sdk/vercel': 2.0.83(zod@4.3.6) '@ai-sdk/xai': 3.0.139(zod@4.3.6) '@aihubmix/ai-sdk-provider': 1.0.3(zod@4.3.6) - '@gitlab/gitlab-ai-provider': 3.6.1(@ai-sdk/provider-utils@4.0.27(zod@4.3.6))(@ai-sdk/provider@3.0.18)(graphql@16.12.0)(ws@8.22.0) + '@gitlab/gitlab-ai-provider': 3.6.1(@ai-sdk/provider-utils@4.0.27(zod@4.3.6))(@ai-sdk/provider@3.0.18)(graphql@16.12.0)(ws@8.21.0) '@modelcontextprotocol/sdk': 1.32.0(@cfworker/json-schema@4.1.1)(zod@4.3.6) '@mymediset/sap-ai-provider': 2.1.0(ai@6.0.97(zod@4.3.6)) '@opentelemetry/api': 1.9.1 @@ -15420,14 +15646,6 @@ snapshots: '@opentelemetry/api': 1.9.0 zod: 4.3.6 - ai@6.0.97(zod@4.6.5): - dependencies: - '@ai-sdk/gateway': 3.0.53(zod@4.6.5) - '@ai-sdk/provider': 3.0.8 - '@ai-sdk/provider-utils': 4.0.15(zod@4.6.5) - '@opentelemetry/api': 1.9.0 - zod: 4.6.5 - ajv-formats@3.0.1(ajv@8.17.1): optionalDependencies: ajv: 8.17.1 @@ -15499,8 +15717,7 @@ snapshots: array-union@2.1.0: {} - arrify@2.0.1: - optional: true + arrify@2.0.1: {} asn1@0.2.6: dependencies: @@ -15607,12 +15824,12 @@ snapshots: base64-js@1.5.1: {} - beeai-framework@0.1.27(@a2a-js/sdk@0.3.13(@bufbuild/protobuf@2.11.0)(@grpc/grpc-js@1.14.3)(express@5.2.1))(@ai-sdk/anthropic@3.0.127(zod@4.6.5))(@ai-sdk/azure@3.0.133(zod@4.6.5))(@ai-sdk/groq@3.0.72(zod@4.6.5))(@ai-sdk/openai@3.0.124(zod@4.6.5))(@aws-sdk/client-bedrock-runtime@3.975.0)(@langchain/core@0.2.36(openai@7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5)))(@modelcontextprotocol/sdk@1.32.0(@cfworker/json-schema@4.1.1)(zod@4.6.5))(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@zilliz/milvus2-sdk-node@2.6.9)(express@5.2.1)(ollama-ai-provider-v2@3.3.1(ai@6.0.97(zod@4.6.5))(zod@4.6.5))(yaml@2.9.1)(zod@4.6.5): + beeai-framework@0.1.27(@a2a-js/sdk@0.3.13(@bufbuild/protobuf@2.11.0)(@grpc/grpc-js@1.14.3)(express@5.2.1))(@ai-sdk/openai@3.0.37(zod@4.3.6))(@aws-sdk/client-bedrock-runtime@3.975.0)(@langchain/core@0.2.36(openai@6.22.0(ws@8.21.0)(zod@4.3.6)))(@modelcontextprotocol/sdk@1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@zilliz/milvus2-sdk-node@2.6.9)(express@5.2.1)(ollama-ai-provider-v2@3.3.1(ai@6.0.97(zod@4.3.6))(zod@4.3.6))(yaml@2.8.0)(zod@4.3.6): dependencies: '@ai-zen/node-fetch-event-source': 2.1.4 '@aws-sdk/client-bedrock-runtime': 3.975.0 '@streamparser/json': 0.0.22 - ai: 6.0.97(zod@4.6.5) + ai: 6.0.97(zod@4.3.6) ajv: 8.17.1 ajv-formats: 3.0.1(ajv@8.17.1) axios: 1.13.5 @@ -15624,7 +15841,7 @@ snapshots: mathjs: 15.1.1 mustache: 4.2.0 object-hash: 3.0.0 - ollama-ai-provider-v2: 3.3.1(ai@6.0.97(zod@4.6.5))(zod@4.6.5) + ollama-ai-provider-v2: 3.3.1(ai@6.0.97(zod@4.3.6))(zod@4.3.6) p-queue-compat: 1.0.234 p-throttle: 8.1.0 pino: 9.14.0 @@ -15635,19 +15852,59 @@ snapshots: string-strip-html: 13.5.3 turndown: 7.2.2 wikipedia: 2.4.2 - zod-to-json-schema: 3.25.1(zod@4.6.5) + zod-to-json-schema: 3.25.1(zod@4.3.6) optionalDependencies: '@a2a-js/sdk': 0.3.13(@bufbuild/protobuf@2.11.0)(@grpc/grpc-js@1.14.3)(express@5.2.1) - '@ai-sdk/anthropic': 3.0.127(zod@4.6.5) - '@ai-sdk/azure': 3.0.133(zod@4.6.5) - '@ai-sdk/groq': 3.0.72(zod@4.6.5) - '@ai-sdk/openai': 3.0.124(zod@4.6.5) - '@langchain/core': 0.2.36(openai@7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5)) - '@modelcontextprotocol/sdk': 1.32.0(@cfworker/json-schema@4.1.1)(zod@4.6.5) + '@ai-sdk/openai': 3.0.37(zod@4.3.6) + '@langchain/core': 0.2.36(openai@6.22.0(ws@8.21.0)(zod@4.3.6)) + '@modelcontextprotocol/sdk': 1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6) '@qdrant/js-client-rest': 1.16.2(typescript@5.8.3) '@zilliz/milvus2-sdk-node': 2.6.9 express: 5.2.1 - yaml: 2.9.1 + yaml: 2.8.0 + transitivePeerDependencies: + - debug + - encoding + - zod + + beeai-framework@0.1.27(@a2a-js/sdk@0.3.13(@bufbuild/protobuf@2.11.0)(@grpc/grpc-js@1.14.3)(express@5.2.1))(@ai-sdk/openai@3.0.37(zod@4.3.6))(@aws-sdk/client-bedrock-runtime@3.975.0)(@langchain/core@0.2.36(openai@7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6)))(@modelcontextprotocol/sdk@1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@zilliz/milvus2-sdk-node@2.6.9)(express@5.2.1)(ollama-ai-provider-v2@3.3.1(ai@6.0.97(zod@4.3.6))(zod@4.3.6))(yaml@2.8.0)(zod@4.3.6): + dependencies: + '@ai-zen/node-fetch-event-source': 2.1.4 + '@aws-sdk/client-bedrock-runtime': 3.975.0 + '@streamparser/json': 0.0.22 + ai: 6.0.97(zod@4.3.6) + ajv: 8.17.1 + ajv-formats: 3.0.1(ajv@8.17.1) + axios: 1.13.5 + duck-duck-scrape: 2.2.7 + fast-xml-parser: 5.3.7 + header-generator: 2.1.80 + joplin-turndown-plugin-gfm: 1.0.12 + jsonrepair: 3.13.2 + mathjs: 15.1.1 + mustache: 4.2.0 + object-hash: 3.0.0 + ollama-ai-provider-v2: 3.3.1(ai@6.0.97(zod@4.3.6))(zod@4.3.6) + p-queue-compat: 1.0.234 + p-throttle: 8.1.0 + pino: 9.14.0 + promise-based-task: 3.1.1 + remeda: 2.33.6 + serialize-error-cjs: 0.2.0 + string-comparison: 1.3.0 + string-strip-html: 13.5.3 + turndown: 7.2.2 + wikipedia: 2.4.2 + zod-to-json-schema: 3.25.1(zod@4.3.6) + optionalDependencies: + '@a2a-js/sdk': 0.3.13(@bufbuild/protobuf@2.11.0)(@grpc/grpc-js@1.14.3)(express@5.2.1) + '@ai-sdk/openai': 3.0.37(zod@4.3.6) + '@langchain/core': 0.2.36(openai@7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6)) + '@modelcontextprotocol/sdk': 1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6) + '@qdrant/js-client-rest': 1.16.2(typescript@5.8.3) + '@zilliz/milvus2-sdk-node': 2.6.9 + express: 5.2.1 + yaml: 2.8.0 transitivePeerDependencies: - debug - encoding @@ -15791,7 +16048,7 @@ snapshots: charenc@0.0.2: {} - chat@4.30.0(zod@4.6.5): + chat@4.30.0(zod@4.3.6): dependencies: '@workflow/serde': 4.1.0-beta.2 mdast-util-to-string: 4.0.0 @@ -15801,7 +16058,7 @@ snapshots: remend: 1.3.0 unified: 11.0.5 optionalDependencies: - zod: 4.6.5 + zod: 4.3.6 transitivePeerDependencies: - supports-color @@ -15819,6 +16076,17 @@ snapshots: optionalDependencies: fsevents: 2.3.3 + chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.104.0(ws@8.21.0)(zod@3.25.76)): + dependencies: + cliui: 8.0.1 + isomorphic-fetch: 3.0.0 + optionalDependencies: + cohere-ai: 7.20.0 + ollama: 0.5.18 + openai: 4.104.0(ws@8.21.0)(zod@3.25.76) + transitivePeerDependencies: + - encoding + chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.104.0(ws@8.22.0)(zod@3.25.76)): dependencies: cliui: 8.0.1 @@ -15830,6 +16098,18 @@ snapshots: transitivePeerDependencies: - encoding + chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.21.0)(zod@3.24.4)): + dependencies: + cliui: 8.0.1 + isomorphic-fetch: 3.0.0 + optionalDependencies: + cohere-ai: 7.20.0 + ollama: 0.5.18 + openai: 4.98.0(ws@8.21.0)(zod@3.24.4) + transitivePeerDependencies: + - encoding + optional: true + chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)): dependencies: cliui: 8.0.1 @@ -16532,7 +16812,6 @@ snapshots: hasown: 2.0.2 mime-types: 2.1.35 safe-buffer: 5.2.1 - optional: true form-data@4.0.2: dependencies: @@ -16950,15 +17229,18 @@ snapshots: help-me@5.0.0: {} - hono-openapi@1.3.0(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.6.5))(@types/json-schema@7.0.15)(hono@4.12.23)(openapi-types@12.1.3): + hono-openapi@1.3.0(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-community/standard-openapi@0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.3.6))(@types/json-schema@7.0.15)(hono@4.12.23)(openapi-types@12.1.3): dependencies: - '@standard-community/standard-json': 0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5) - '@standard-community/standard-openapi': 0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.6.5))(zod@4.6.5))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.6.5) + '@standard-community/standard-json': 0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6) + '@standard-community/standard-openapi': 0.2.9(@standard-community/standard-json@0.3.5(@standard-schema/spec@1.1.0)(@types/json-schema@7.0.15)(quansync@0.2.11)(zod-to-json-schema@3.25.1(zod@4.3.6))(zod@4.3.6))(@standard-schema/spec@1.1.0)(openapi-types@12.1.3)(zod@4.3.6) '@types/json-schema': 7.0.15 openapi-types: 12.1.3 optionalDependencies: hono: 4.12.23 + hono@4.11.5: + optional: true + hono@4.12.23: {} html-entities@2.6.0: {} @@ -16998,7 +17280,6 @@ snapshots: debug: 4.4.3 transitivePeerDependencies: - supports-color - optional: true http-proxy-agent@7.0.2: dependencies: @@ -17140,9 +17421,9 @@ snapshots: transitivePeerDependencies: - encoding - isomorphic-ws@5.0.0(ws@8.22.0): + isomorphic-ws@5.0.0(ws@8.21.0): dependencies: - ws: 8.22.0 + ws: 8.21.0 istanbul-lib-coverage@3.2.2: {} @@ -17698,6 +17979,7 @@ snapshots: lodash.once: 4.1.1 ms: 2.1.3 semver: 7.7.3 + optional: true jwa@2.0.1: dependencies: @@ -17730,19 +18012,19 @@ snapshots: kuler@2.0.0: {} - langchain@0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.975.0)(@aws-sdk/credential-provider-node@3.972.1)(@google-cloud/storage@7.19.0)(@huggingface/inference@2.8.1)(@pinecone-database/pinecone@4.1.0)(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@smithy/util-utf8@2.3.0)(@zilliz/milvus2-sdk-node@2.6.9)(axios@1.20.0)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(cohere-ai@7.20.0)(duck-duck-scrape@2.2.7)(fast-xml-parser@5.3.7)(handlebars@4.7.8)(html-to-text@9.0.5)(ignore@5.3.2)(jsonwebtoken@9.0.3)(lodash@4.17.23)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(pg@8.17.2)(redis@4.7.1)(ws@8.22.0): + langchain@0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.975.0)(@aws-sdk/credential-provider-node@3.972.1)(@google-cloud/storage@7.19.0)(@huggingface/inference@2.8.1)(@pinecone-database/pinecone@4.1.0)(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@smithy/util-utf8@2.3.0)(@zilliz/milvus2-sdk-node@2.6.9)(axios@1.13.5)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.21.0)(zod@3.24.4)))(cohere-ai@7.20.0)(duck-duck-scrape@2.2.7)(fast-xml-parser@5.3.7)(handlebars@4.7.8)(html-to-text@9.0.5)(ignore@5.3.2)(lodash@4.17.23)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.21.0)(zod@3.24.4))(pg@8.17.2)(redis@4.7.1)(ws@8.21.0): dependencies: '@anthropic-ai/sdk': 0.9.1 - '@langchain/community': 0.0.57(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.975.0)(@aws-sdk/credential-provider-node@3.972.1)(@huggingface/inference@2.8.1)(@pinecone-database/pinecone@4.1.0)(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@smithy/util-utf8@2.3.0)(@zilliz/milvus2-sdk-node@2.6.9)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(cohere-ai@7.20.0)(duck-duck-scrape@2.2.7)(html-to-text@9.0.5)(jsonwebtoken@9.0.3)(lodash@4.17.23)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(pg@8.17.2)(redis@4.7.1)(ws@8.22.0) - '@langchain/core': 0.1.63(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) - '@langchain/openai': 0.0.34(ws@8.22.0) - '@langchain/textsplitters': 0.0.3(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) + '@langchain/community': 0.0.57(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.975.0)(@aws-sdk/credential-provider-node@3.972.1)(@huggingface/inference@2.8.1)(@pinecone-database/pinecone@4.1.0)(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@smithy/util-utf8@2.3.0)(@zilliz/milvus2-sdk-node@2.6.9)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.21.0)(zod@3.24.4)))(cohere-ai@7.20.0)(duck-duck-scrape@2.2.7)(html-to-text@9.0.5)(lodash@4.17.23)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.21.0)(zod@3.24.4))(pg@8.17.2)(redis@4.7.1)(ws@8.21.0) + '@langchain/core': 0.1.63(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + '@langchain/openai': 0.0.34(ws@8.21.0) + '@langchain/textsplitters': 0.0.3(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) binary-extensions: 2.3.0 js-tiktoken: 1.0.20 js-yaml: 4.1.0 jsonpointer: 5.0.1 langchainhub: 0.0.11 - langsmith: 0.1.68(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) + langsmith: 0.1.68(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) ml-distance: 4.0.1 openapi-types: 12.1.3 p-retry: 4.6.2 @@ -17754,15 +18036,15 @@ snapshots: '@aws-sdk/credential-provider-node': 3.972.1 '@google-cloud/storage': 7.19.0 '@pinecone-database/pinecone': 4.1.0 - axios: 1.20.0 - chromadb: 1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) + axios: 1.13.5 + chromadb: 1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) fast-xml-parser: 5.3.7 handlebars: 4.7.8 html-to-text: 9.0.5 ignore: 5.3.2 mongodb: 6.21.0(@aws-sdk/credential-providers@3.975.0) redis: 4.7.1 - ws: 8.22.0 + ws: 8.21.0 transitivePeerDependencies: - '@aws-crypto/sha256-js' - '@aws-sdk/client-bedrock-agent-runtime' @@ -17835,26 +18117,31 @@ snapshots: - vectordb - voy-search - langchain@0.2.20(@aws-sdk/credential-provider-node@3.972.1)(@pinecone-database/pinecone@4.1.0)(axios@1.20.0)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(fast-xml-parser@5.3.7)(handlebars@4.7.8)(html-to-text@9.0.5)(ignore@5.3.2)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(redis@4.7.1)(ws@8.22.0): + langchain@0.1.37(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.975.0)(@aws-sdk/credential-provider-node@3.972.1)(@google-cloud/storage@7.19.0)(@huggingface/inference@2.8.1)(@pinecone-database/pinecone@4.1.0)(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@smithy/util-utf8@2.3.0)(@zilliz/milvus2-sdk-node@2.6.9)(axios@1.13.5)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(cohere-ai@7.20.0)(duck-duck-scrape@2.2.7)(fast-xml-parser@5.3.7)(handlebars@4.7.8)(html-to-text@9.0.5)(ignore@5.3.2)(lodash@4.17.23)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(pg@8.17.2)(redis@4.7.1)(ws@8.22.0): dependencies: - '@langchain/core': 0.2.36(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) - '@langchain/openai': 0.2.11(ws@8.22.0) + '@anthropic-ai/sdk': 0.9.1 + '@langchain/community': 0.0.57(@aws-crypto/sha256-js@5.2.0)(@aws-sdk/client-bedrock-runtime@3.975.0)(@aws-sdk/credential-provider-node@3.972.1)(@huggingface/inference@2.8.1)(@pinecone-database/pinecone@4.1.0)(@qdrant/js-client-rest@1.16.2(typescript@5.8.3))(@smithy/util-utf8@2.3.0)(@zilliz/milvus2-sdk-node@2.6.9)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(cohere-ai@7.20.0)(duck-duck-scrape@2.2.7)(html-to-text@9.0.5)(lodash@4.17.23)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(pg@8.17.2)(redis@4.7.1)(ws@8.22.0) + '@langchain/core': 0.1.63(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) + '@langchain/openai': 0.0.34(ws@8.22.0) '@langchain/textsplitters': 0.0.3(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) binary-extensions: 2.3.0 js-tiktoken: 1.0.20 js-yaml: 4.1.0 jsonpointer: 5.0.1 + langchainhub: 0.0.11 langsmith: 0.1.68(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) + ml-distance: 4.0.1 openapi-types: 12.1.3 p-retry: 4.6.2 - uuid: 10.0.0 + uuid: 9.0.1 yaml: 2.8.0 zod: 3.24.4 zod-to-json-schema: 3.24.5(zod@3.24.4) optionalDependencies: '@aws-sdk/credential-provider-node': 3.972.1 + '@google-cloud/storage': 7.19.0 '@pinecone-database/pinecone': 4.1.0 - axios: 1.20.0 + axios: 1.13.5 chromadb: 1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) fast-xml-parser: 5.3.7 handlebars: 4.7.8 @@ -17864,10 +18151,165 @@ snapshots: redis: 4.7.1 ws: 8.22.0 transitivePeerDependencies: - - encoding - - openai - - langchain@0.3.26(@langchain/core@0.3.56(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(axios@1.20.0)(handlebars@4.7.8)(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(ws@8.22.0): + - '@aws-crypto/sha256-js' + - '@aws-sdk/client-bedrock-agent-runtime' + - '@aws-sdk/client-bedrock-runtime' + - '@aws-sdk/client-dynamodb' + - '@aws-sdk/client-kendra' + - '@aws-sdk/client-lambda' + - '@azure/search-documents' + - '@clickhouse/client' + - '@cloudflare/ai' + - '@datastax/astra-db-ts' + - '@elastic/elasticsearch' + - '@getmetal/metal-sdk' + - '@getzep/zep-js' + - '@gradientai/nodejs-sdk' + - '@huggingface/inference' + - '@mlc-ai/web-llm' + - '@mozilla/readability' + - '@neondatabase/serverless' + - '@opensearch-project/opensearch' + - '@planetscale/database' + - '@premai/prem-sdk' + - '@qdrant/js-client-rest' + - '@raycast/api' + - '@rockset/client' + - '@smithy/eventstream-codec' + - '@smithy/protocol-http' + - '@smithy/signature-v4' + - '@smithy/util-utf8' + - '@supabase/postgrest-js' + - '@tensorflow-models/universal-sentence-encoder' + - '@tensorflow/tfjs-converter' + - '@tensorflow/tfjs-core' + - '@upstash/redis' + - '@upstash/vector' + - '@vercel/postgres' + - '@writerai/writer-sdk' + - '@xenova/transformers' + - '@zilliz/milvus2-sdk-node' + - better-sqlite3 + - cassandra-driver + - cborg + - closevector-common + - closevector-node + - closevector-web + - cohere-ai + - discord.js + - dria + - duck-duck-scrape + - encoding + - firebase-admin + - googleapis + - hnswlib-node + - interface-datastore + - it-all + - jsonwebtoken + - llmonitor + - lodash + - lunary + - mysql2 + - neo4j-driver + - openai + - pg + - pg-copy-streams + - pickleparser + - portkey-ai + - replicate + - typesense + - usearch + - vectordb + - voy-search + + langchain@0.2.20(@aws-sdk/credential-provider-node@3.972.1)(@pinecone-database/pinecone@4.1.0)(axios@1.13.5)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.21.0)(zod@3.24.4)))(fast-xml-parser@5.3.7)(handlebars@4.7.8)(html-to-text@9.0.5)(ignore@5.3.2)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.21.0)(zod@3.24.4))(redis@4.7.1)(ws@8.21.0): + dependencies: + '@langchain/core': 0.2.36(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + '@langchain/openai': 0.2.11(ws@8.21.0) + '@langchain/textsplitters': 0.0.3(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + binary-extensions: 2.3.0 + js-tiktoken: 1.0.20 + js-yaml: 4.1.0 + jsonpointer: 5.0.1 + langsmith: 0.1.68(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + openapi-types: 12.1.3 + p-retry: 4.6.2 + uuid: 10.0.0 + yaml: 2.8.0 + zod: 3.24.4 + zod-to-json-schema: 3.24.5(zod@3.24.4) + optionalDependencies: + '@aws-sdk/credential-provider-node': 3.972.1 + '@pinecone-database/pinecone': 4.1.0 + axios: 1.13.5 + chromadb: 1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + fast-xml-parser: 5.3.7 + handlebars: 4.7.8 + html-to-text: 9.0.5 + ignore: 5.3.2 + mongodb: 6.21.0(@aws-sdk/credential-providers@3.975.0) + redis: 4.7.1 + ws: 8.21.0 + transitivePeerDependencies: + - encoding + - openai + + langchain@0.2.20(@aws-sdk/credential-provider-node@3.972.1)(@pinecone-database/pinecone@4.1.0)(axios@1.13.5)(chromadb@1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(fast-xml-parser@5.3.7)(handlebars@4.7.8)(html-to-text@9.0.5)(ignore@5.3.2)(mongodb@6.21.0(@aws-sdk/credential-providers@3.975.0))(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(redis@4.7.1)(ws@8.22.0): + dependencies: + '@langchain/core': 0.2.36(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) + '@langchain/openai': 0.2.11(ws@8.22.0) + '@langchain/textsplitters': 0.0.3(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) + binary-extensions: 2.3.0 + js-tiktoken: 1.0.20 + js-yaml: 4.1.0 + jsonpointer: 5.0.1 + langsmith: 0.1.68(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) + openapi-types: 12.1.3 + p-retry: 4.6.2 + uuid: 10.0.0 + yaml: 2.8.0 + zod: 3.24.4 + zod-to-json-schema: 3.24.5(zod@3.24.4) + optionalDependencies: + '@aws-sdk/credential-provider-node': 3.972.1 + '@pinecone-database/pinecone': 4.1.0 + axios: 1.13.5 + chromadb: 1.10.5(cohere-ai@7.20.0)(ollama@0.5.18)(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) + fast-xml-parser: 5.3.7 + handlebars: 4.7.8 + html-to-text: 9.0.5 + ignore: 5.3.2 + mongodb: 6.21.0(@aws-sdk/credential-providers@3.975.0) + redis: 4.7.1 + ws: 8.22.0 + transitivePeerDependencies: + - encoding + - openai + + langchain@0.3.26(@langchain/core@0.3.56(openai@4.98.0(ws@8.21.0)(zod@3.24.4)))(axios@1.13.5)(handlebars@4.7.8)(openai@4.98.0(ws@8.21.0)(zod@3.24.4))(ws@8.21.0): + dependencies: + '@langchain/core': 0.3.56(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + '@langchain/openai': 0.3.16(@langchain/core@0.3.56(openai@4.98.0(ws@8.21.0)(zod@3.24.4)))(ws@8.21.0) + '@langchain/textsplitters': 0.1.0(@langchain/core@0.3.56(openai@4.98.0(ws@8.21.0)(zod@3.24.4))) + js-tiktoken: 1.0.20 + js-yaml: 4.1.0 + jsonpointer: 5.0.1 + langsmith: 0.3.29(openai@4.98.0(ws@8.21.0)(zod@3.24.4)) + openapi-types: 12.1.3 + p-retry: 4.6.2 + uuid: 10.0.0 + yaml: 2.8.0 + zod: 3.24.4 + zod-to-json-schema: 3.24.5(zod@3.24.4) + optionalDependencies: + axios: 1.13.5 + handlebars: 4.7.8 + transitivePeerDependencies: + - encoding + - openai + - ws + + langchain@0.3.26(@langchain/core@0.3.56(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(axios@1.13.5)(handlebars@4.7.8)(openai@4.98.0(ws@8.22.0)(zod@3.24.4))(ws@8.22.0): dependencies: '@langchain/core': 0.3.56(openai@4.98.0(ws@8.22.0)(zod@3.24.4)) '@langchain/openai': 0.3.16(@langchain/core@0.3.56(openai@4.98.0(ws@8.22.0)(zod@3.24.4)))(ws@8.22.0) @@ -17883,7 +18325,7 @@ snapshots: zod: 3.24.4 zod-to-json-schema: 3.24.5(zod@3.24.4) optionalDependencies: - axios: 1.20.0 + axios: 1.13.5 handlebars: 4.7.8 transitivePeerDependencies: - encoding @@ -17892,6 +18334,17 @@ snapshots: langchainhub@0.0.11: {} + langsmith@0.1.68(openai@4.104.0(ws@8.21.0)(zod@3.25.76)): + dependencies: + '@types/uuid': 10.0.0 + commander: 10.0.1 + p-queue: 6.6.2 + p-retry: 4.6.2 + semver: 7.7.3 + uuid: 10.0.0 + optionalDependencies: + openai: 4.104.0(ws@8.21.0)(zod@3.25.76) + langsmith@0.1.68(openai@4.104.0(ws@8.22.0)(zod@3.25.76)): dependencies: '@types/uuid': 10.0.0 @@ -17903,6 +18356,17 @@ snapshots: optionalDependencies: openai: 4.104.0(ws@8.22.0)(zod@3.25.76) + langsmith@0.1.68(openai@4.98.0(ws@8.21.0)(zod@3.24.4)): + dependencies: + '@types/uuid': 10.0.0 + commander: 10.0.1 + p-queue: 6.6.2 + p-retry: 4.6.2 + semver: 7.7.3 + uuid: 10.0.0 + optionalDependencies: + openai: 4.98.0(ws@8.21.0)(zod@3.24.4) + langsmith@0.1.68(openai@4.98.0(ws@8.22.0)(zod@3.24.4)): dependencies: '@types/uuid': 10.0.0 @@ -17914,7 +18378,7 @@ snapshots: optionalDependencies: openai: 4.98.0(ws@8.22.0)(zod@3.24.4) - langsmith@0.1.68(openai@7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5)): + langsmith@0.1.68(openai@6.22.0(ws@8.21.0)(zod@4.3.6)): dependencies: '@types/uuid': 10.0.0 commander: 10.0.1 @@ -17923,9 +18387,33 @@ snapshots: semver: 7.7.3 uuid: 10.0.0 optionalDependencies: - openai: 7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5) + openai: 6.22.0(ws@8.21.0)(zod@4.3.6) optional: true + langsmith@0.1.68(openai@7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6)): + dependencies: + '@types/uuid': 10.0.0 + commander: 10.0.1 + p-queue: 6.6.2 + p-retry: 4.6.2 + semver: 7.7.3 + uuid: 10.0.0 + optionalDependencies: + openai: 7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6) + optional: true + + langsmith@0.3.29(openai@4.98.0(ws@8.21.0)(zod@3.24.4)): + dependencies: + '@types/uuid': 10.0.0 + chalk: 4.1.2 + console-table-printer: 2.12.1 + p-queue: 6.6.2 + p-retry: 4.6.2 + semver: 7.7.3 + uuid: 10.0.0 + optionalDependencies: + openai: 4.98.0(ws@8.21.0)(zod@3.24.4) + langsmith@0.3.29(openai@4.98.0(ws@8.22.0)(zod@3.24.4)): dependencies: '@types/uuid': 10.0.0 @@ -17968,12 +18456,12 @@ snapshots: camelcase-keys: 9.1.3 jose: 5.10.0 - llamaindex@0.12.1(@modelcontextprotocol/sdk@1.32.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(hono@4.12.23)(rxjs@7.8.2)(tree-sitter@0.22.4)(web-tree-sitter@0.24.7)(zod@4.3.6): + llamaindex@0.12.1(@modelcontextprotocol/sdk@1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(hono@4.12.23)(rxjs@7.8.2)(tree-sitter@0.22.4)(web-tree-sitter@0.24.7)(zod@4.3.6): dependencies: '@llamaindex/core': 0.6.22 '@llamaindex/env': 0.1.30 '@llamaindex/node-parser': 2.0.22(@llamaindex/core@0.6.22)(@llamaindex/env@0.1.30)(tree-sitter@0.22.4)(web-tree-sitter@0.24.7) - '@llamaindex/workflow': 1.1.24(@llamaindex/core@0.6.22)(@llamaindex/env@0.1.30)(@modelcontextprotocol/sdk@1.32.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(hono@4.12.23)(rxjs@7.8.2)(zod@4.3.6) + '@llamaindex/workflow': 1.1.24(@llamaindex/core@0.6.22)(@llamaindex/env@0.1.30)(@modelcontextprotocol/sdk@1.29.0(@cfworker/json-schema@4.1.1)(zod@4.3.6))(hono@4.12.23)(rxjs@7.8.2)(zod@4.3.6) '@types/lodash': 4.17.23 '@types/node': 24.10.9 lodash: 4.17.23 @@ -18000,19 +18488,25 @@ snapshots: lodash.clonedeep@4.5.0: {} - lodash.includes@4.3.0: {} + lodash.includes@4.3.0: + optional: true - lodash.isboolean@3.0.3: {} + lodash.isboolean@3.0.3: + optional: true lodash.isequal@4.5.0: {} - lodash.isinteger@4.0.4: {} + lodash.isinteger@4.0.4: + optional: true - lodash.isnumber@3.0.3: {} + lodash.isnumber@3.0.3: + optional: true - lodash.isplainobject@4.0.6: {} + lodash.isplainobject@4.0.6: + optional: true - lodash.isstring@4.0.1: {} + lodash.isstring@4.0.1: + optional: true lodash.mapvalues@4.6.0: optional: true @@ -18021,7 +18515,8 @@ snapshots: lodash.merge@4.6.2: {} - lodash.once@4.1.1: {} + lodash.once@4.1.1: + optional: true lodash@4.17.23: {} @@ -18575,16 +19070,16 @@ snapshots: ollama-ai-provider-v2@1.5.5(zod@4.3.6): dependencies: - '@ai-sdk/provider': 2.0.5 - '@ai-sdk/provider-utils': 3.0.41(zod@4.3.6) + '@ai-sdk/provider': 2.0.3 + '@ai-sdk/provider-utils': 3.0.25(zod@4.3.6) zod: 4.3.6 - ollama-ai-provider-v2@3.3.1(ai@6.0.97(zod@4.6.5))(zod@4.6.5): + ollama-ai-provider-v2@3.3.1(ai@6.0.97(zod@4.3.6))(zod@4.3.6): dependencies: - '@ai-sdk/provider': 3.0.18 - '@ai-sdk/provider-utils': 4.0.57(zod@4.6.5) - ai: 6.0.97(zod@4.6.5) - zod: 4.6.5 + '@ai-sdk/provider': 3.0.10 + '@ai-sdk/provider-utils': 4.0.27(zod@4.3.6) + ai: 6.0.97(zod@4.3.6) + zod: 4.3.6 ollama@0.5.18: dependencies: @@ -18623,6 +19118,21 @@ snapshots: transitivePeerDependencies: - encoding + openai@4.104.0(ws@8.21.0)(zod@3.25.76): + dependencies: + '@types/node': 18.19.100 + '@types/node-fetch': 2.6.12 + abort-controller: 3.0.0 + agentkeepalive: 4.6.0 + form-data-encoder: 1.7.2 + formdata-node: 4.4.1 + node-fetch: 2.7.0 + optionalDependencies: + ws: 8.21.0 + zod: 3.25.76 + transitivePeerDependencies: + - encoding + openai@4.104.0(ws@8.22.0)(zod@3.25.76): dependencies: '@types/node': 18.19.100 @@ -18638,6 +19148,36 @@ snapshots: transitivePeerDependencies: - encoding + openai@4.98.0(ws@8.21.0)(zod@3.24.4): + dependencies: + '@types/node': 18.19.100 + '@types/node-fetch': 2.6.12 + abort-controller: 3.0.0 + agentkeepalive: 4.6.0 + form-data-encoder: 1.7.2 + formdata-node: 4.4.1 + node-fetch: 2.7.0 + optionalDependencies: + ws: 8.21.0 + zod: 3.24.4 + transitivePeerDependencies: + - encoding + + openai@4.98.0(ws@8.21.0)(zod@3.25.76): + dependencies: + '@types/node': 18.19.100 + '@types/node-fetch': 2.6.12 + abort-controller: 3.0.0 + agentkeepalive: 4.6.0 + form-data-encoder: 1.7.2 + formdata-node: 4.4.1 + node-fetch: 2.7.0 + optionalDependencies: + ws: 8.21.0 + zod: 3.25.76 + transitivePeerDependencies: + - encoding + openai@4.98.0(ws@8.22.0)(zod@3.24.4): dependencies: '@types/node': 18.19.100 @@ -18668,29 +19208,44 @@ snapshots: transitivePeerDependencies: - encoding + openai@5.23.2(ws@8.21.0)(zod@4.3.6): + optionalDependencies: + ws: 8.21.0 + zod: 4.3.6 + openai@5.23.2(ws@8.22.0)(zod@4.3.6): optionalDependencies: ws: 8.22.0 zod: 4.3.6 - openai@6.22.0(ws@8.22.0)(zod@3.25.76): + openai@6.22.0(ws@8.19.0)(zod@4.3.6): optionalDependencies: - ws: 8.22.0 + ws: 8.19.0 + zod: 4.3.6 + + openai@6.22.0(ws@8.21.0)(zod@3.25.76): + optionalDependencies: + ws: 8.21.0 zod: 3.25.76 + openai@6.22.0(ws@8.21.0)(zod@4.3.6): + optionalDependencies: + ws: 8.21.0 + zod: 4.3.6 + openai@6.22.0(ws@8.22.0)(zod@4.3.6): optionalDependencies: ws: 8.22.0 zod: 4.3.6 optional: true - openai@7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.9.1)(undici@6.29.0)(ws@8.22.0)(zod@4.6.5): + openai@7.42.0(@aws-sdk/credential-provider-node@3.972.1)(google-auth-library@10.5.0)(undici@6.23.0)(ws@8.22.0)(zod@4.3.6): optionalDependencies: '@aws-sdk/credential-provider-node': 3.972.1 - google-auth-library: 10.9.1 - undici: 6.29.0 + google-auth-library: 10.5.0 + undici: 6.23.0 ws: 8.22.0 - zod: 4.6.5 + zod: 4.3.6 openapi-types@12.1.3: {} @@ -19011,6 +19566,7 @@ snapshots: dependencies: end-of-stream: 1.4.5 once: 1.4.0 + optional: true pumpify@2.0.1: dependencies: @@ -19023,6 +19579,12 @@ snapshots: pure-rand@6.1.0: {} + pythonia@1.2.6(ws@8.21.0): + dependencies: + caller: 1.1.0 + chalk: 4.1.2 + ws: 8.21.0 + pythonia@1.2.6(ws@8.22.0): dependencies: caller: 1.1.0 @@ -19182,7 +19744,6 @@ snapshots: transitivePeerDependencies: - encoding - supports-color - optional: true retry-request@8.0.4: dependencies: @@ -19272,10 +19833,10 @@ snapshots: sax@1.4.4: {} - schema-stream@3.2.2(zod@4.6.5): + schema-stream@3.2.2(zod@4.3.6): dependencies: ramda: 0.29.1 - zod: 4.6.5 + zod: 4.3.6 sdp-transform@2.15.0: {} @@ -19603,7 +20164,6 @@ snapshots: transitivePeerDependencies: - encoding - supports-color - optional: true test-exclude@6.0.0: dependencies: @@ -19883,8 +20443,7 @@ snapshots: uuid@11.1.0: {} - uuid@8.3.2: - optional: true + uuid@8.3.2: {} uuid@9.0.1: {} @@ -19916,13 +20475,13 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.3 - vite-node@3.2.4(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.9.1): + vite-node@3.2.4(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.8.0): dependencies: cac: 6.7.14 debug: 4.4.1 es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 7.3.1(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.9.1) + vite: 7.3.1(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.8.0) transitivePeerDependencies: - '@types/node' - jiti @@ -19937,7 +20496,7 @@ snapshots: - tsx - yaml - vite@7.3.1(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.9.1): + vite@7.3.1(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.8.0): dependencies: esbuild: 0.27.2 fdir: 6.5.0(picomatch@4.0.3) @@ -19949,13 +20508,13 @@ snapshots: '@types/node': 24.10.9 fsevents: 2.3.3 tsx: 4.21.0 - yaml: 2.9.1 + yaml: 2.8.0 - vitest@3.2.4(@types/debug@4.1.13)(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.9.1): + vitest@3.2.4(@types/debug@4.1.13)(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.8.0): dependencies: '@types/chai': 5.2.3 '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4(vite@7.3.1(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.9.1)) + '@vitest/mocker': 3.2.4(vite@7.3.1(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.8.0)) '@vitest/pretty-format': 3.2.4 '@vitest/runner': 3.2.4 '@vitest/snapshot': 3.2.4 @@ -19973,8 +20532,8 @@ snapshots: tinyglobby: 0.2.15 tinypool: 1.1.1 tinyrainbow: 2.0.0 - vite: 7.3.1(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.9.1) - vite-node: 3.2.4(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.9.1) + vite: 7.3.1(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.8.0) + vite-node: 3.2.4(@types/node@24.10.9)(tsx@4.21.0)(yaml@2.8.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/debug': 4.1.13 @@ -20168,11 +20727,11 @@ snapshots: dependencies: zod: 4.3.6 - zod-stream@3.0.0(zod@4.6.5): + zod-stream@3.0.0(zod@4.3.6): dependencies: - schema-stream: 3.2.2(zod@4.6.5) - zod: 4.6.5 - zod-to-json-schema: 3.25.1(zod@4.6.5) + schema-stream: 3.2.2(zod@4.3.6) + zod: 4.3.6 + zod-to-json-schema: 3.25.1(zod@4.3.6) zod-to-json-schema@3.24.5(zod@3.24.4): dependencies: @@ -20190,13 +20749,9 @@ snapshots: dependencies: zod: 4.3.6 - zod-to-json-schema@3.25.1(zod@4.6.5): + zod-validation-error@3.5.4(zod@4.3.6): dependencies: - zod: 4.6.5 - - zod-validation-error@3.5.4(zod@4.6.5): - dependencies: - zod: 4.6.5 + zod: 4.3.6 zod@3.24.4: {}