@visibe.ai/node 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  import { AsyncLocalStorage } from 'node:async_hooks';
2
2
  import type { Visibe } from '../client';
3
3
  export declare const activeLangChainStorage: AsyncLocalStorage<LangChainCallback>;
4
+ export declare const LANGGRAPH_INTERNAL_NODES: Set<string>;
4
5
  export declare class LangChainCallback {
5
6
  readonly name = "visibe-langchain-callback";
6
7
  readonly awaitHandlers = true;
@@ -9,7 +10,11 @@ export declare class LangChainCallback {
9
10
  protected readonly traceId: string;
10
11
  protected readonly agentName: string;
11
12
  protected runIdToSpanId: Map<string, string>;
12
- protected pendingLLMCalls: Map<string, number>;
13
+ protected pendingLLMCalls: Map<string, {
14
+ startMs: number;
15
+ model?: string;
16
+ inputText?: string;
17
+ }>;
13
18
  protected pendingToolCalls: Map<string, {
14
19
  startMs: number;
15
20
  inputText: string;
@@ -17,22 +22,23 @@ export declare class LangChainCallback {
17
22
  }>;
18
23
  protected stepCounter: number;
19
24
  protected nextSpanId(): string;
20
- protected seenAgents: Set<string>;
21
25
  totalInputTokens: number;
22
26
  totalOutputTokens: number;
27
+ totalCost: number;
23
28
  llmCallCount: number;
24
29
  constructor(options: {
25
30
  visibe: Visibe;
26
31
  traceId: string;
27
32
  agentName: string;
28
33
  });
29
- handleLLMStart(_llm: any, _messages: any[], runId: string): Promise<void>;
34
+ handleLLMStart(llm: any, prompts: any[], runId: string): Promise<void>;
35
+ handleChatModelStart(llm: any, messages: any[][], runId: string): Promise<void>;
30
36
  handleLLMEnd(output: any, runId: string, parentRunId?: string): Promise<void>;
31
37
  handleLLMError(err: Error, runId: string): Promise<void>;
32
38
  handleToolStart(tool: any, input: string, runId: string): Promise<void>;
33
39
  handleToolEnd(output: string, runId: string, parentRunId?: string): Promise<void>;
34
40
  handleToolError(err: Error, runId: string): Promise<void>;
35
- handleChainStart(chain: any, _inputs: any, runId: string, parentRunId?: string): Promise<void>;
41
+ handleChainStart(_chain: any, _inputs: any, runId: string, _parentRunId?: string, _tags?: string[], _metadata?: any, _runType?: string, _name?: string): Promise<void>;
36
42
  handleChainEnd(_outputs: any, _runId: string): Promise<void>;
37
43
  handleChainError(err: Error, _runId: string): Promise<void>;
38
44
  _onLLMSpan?: (inputTokens: number, outputTokens: number, cost: number) => void;
@@ -8,6 +8,6 @@ export declare class LangGraphCallback extends LangChainCallback {
8
8
  agentName: string;
9
9
  nodeNames?: string[];
10
10
  });
11
- handleChainStart(chain: any, inputs: any, runId: string, parentRunId?: string): Promise<void>;
11
+ handleChainStart(chain: any, inputs: any, runId: string, parentRunId?: string, tags?: string[], metadata?: any, runType?: string, name?: string): Promise<void>;
12
12
  }
13
13
  export declare function patchCompiledStateGraph(lgModule: any, visibe: Visibe): () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visibe.ai/node",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "AI Agent Observability — Track OpenAI, LangChain, LangGraph, Bedrock, Vercel AI, Anthropic",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",