@agentionai/agents 0.3.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +517 -0
- package/dist/agents/Agent.d.ts +29 -0
- package/dist/agents/Agent.js +28 -0
- package/dist/agents/AgentConfig.d.ts +118 -0
- package/dist/agents/AgentConfig.js +3 -0
- package/dist/agents/AgentEvent.d.ts +18 -0
- package/dist/agents/AgentEvent.js +26 -0
- package/dist/agents/BaseAgent.d.ts +82 -0
- package/dist/agents/BaseAgent.js +121 -0
- package/dist/agents/anthropic/ClaudeAgent.d.ts +46 -0
- package/dist/agents/anthropic/ClaudeAgent.js +262 -0
- package/dist/agents/errors/AgentError.d.ts +47 -0
- package/dist/agents/errors/AgentError.js +74 -0
- package/dist/agents/google/GeminiAgent.d.ts +63 -0
- package/dist/agents/google/GeminiAgent.js +395 -0
- package/dist/agents/mistral/MistralAgent.d.ts +47 -0
- package/dist/agents/mistral/MistralAgent.js +313 -0
- package/dist/agents/model-types.d.ts +30 -0
- package/dist/agents/model-types.js +8 -0
- package/dist/agents/openai/OpenAiAgent.d.ts +48 -0
- package/dist/agents/openai/OpenAiAgent.js +338 -0
- package/dist/chunkers/Chunker.d.ts +53 -0
- package/dist/chunkers/Chunker.js +174 -0
- package/dist/chunkers/RecursiveChunker.d.ts +52 -0
- package/dist/chunkers/RecursiveChunker.js +166 -0
- package/dist/chunkers/TextChunker.d.ts +27 -0
- package/dist/chunkers/TextChunker.js +50 -0
- package/dist/chunkers/TokenChunker.d.ts +60 -0
- package/dist/chunkers/TokenChunker.js +176 -0
- package/dist/chunkers/index.d.ts +6 -0
- package/dist/chunkers/index.js +14 -0
- package/dist/chunkers/types.d.ts +95 -0
- package/dist/chunkers/types.js +3 -0
- package/dist/graph/AgentGraph.d.ts +99 -0
- package/dist/graph/AgentGraph.js +115 -0
- package/dist/graph/BaseExecutor.d.ts +86 -0
- package/dist/graph/BaseExecutor.js +61 -0
- package/dist/graph/GraphMetrics.d.ts +143 -0
- package/dist/graph/GraphMetrics.js +264 -0
- package/dist/graph/MapExecutor.d.ts +39 -0
- package/dist/graph/MapExecutor.js +123 -0
- package/dist/graph/ParallelExecutor.d.ts +51 -0
- package/dist/graph/ParallelExecutor.js +103 -0
- package/dist/graph/Pipeline.d.ts +44 -0
- package/dist/graph/Pipeline.js +109 -0
- package/dist/graph/RouterExecutor.d.ts +89 -0
- package/dist/graph/RouterExecutor.js +209 -0
- package/dist/graph/SequentialExecutor.d.ts +44 -0
- package/dist/graph/SequentialExecutor.js +115 -0
- package/dist/graph/VotingSystem.d.ts +54 -0
- package/dist/graph/VotingSystem.js +106 -0
- package/dist/history/History.d.ts +107 -0
- package/dist/history/History.js +166 -0
- package/dist/history/RedisHistory.d.ts +27 -0
- package/dist/history/RedisHistory.js +55 -0
- package/dist/history/transformers.d.ts +102 -0
- package/dist/history/transformers.js +415 -0
- package/dist/history/types.d.ts +130 -0
- package/dist/history/types.js +55 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +48 -0
- package/dist/ingestion/IngestionPipeline.d.ts +86 -0
- package/dist/ingestion/IngestionPipeline.js +266 -0
- package/dist/ingestion/index.d.ts +3 -0
- package/dist/ingestion/index.js +7 -0
- package/dist/ingestion/types.d.ts +74 -0
- package/dist/ingestion/types.js +3 -0
- package/dist/team/Team.d.ts +46 -0
- package/dist/team/Team.js +104 -0
- package/dist/tools/Tool.d.ts +75 -0
- package/dist/tools/Tool.js +137 -0
- package/dist/vectorstore/Embeddings.d.ts +67 -0
- package/dist/vectorstore/Embeddings.js +54 -0
- package/dist/vectorstore/LanceDBVectorStore.d.ts +149 -0
- package/dist/vectorstore/LanceDBVectorStore.js +338 -0
- package/dist/vectorstore/OpenAIEmbeddings.d.ts +45 -0
- package/dist/vectorstore/OpenAIEmbeddings.js +109 -0
- package/dist/vectorstore/VectorStore.d.ts +255 -0
- package/dist/vectorstore/VectorStore.js +216 -0
- package/dist/vectorstore/index.d.ts +28 -0
- package/dist/vectorstore/index.js +35 -0
- package/dist/viz/VizConfig.d.ts +54 -0
- package/dist/viz/VizConfig.js +100 -0
- package/dist/viz/VizReporter.d.ts +127 -0
- package/dist/viz/VizReporter.js +595 -0
- package/dist/viz/index.d.ts +31 -0
- package/dist/viz/index.js +51 -0
- package/dist/viz/types.d.ts +105 -0
- package/dist/viz/types.js +7 -0
- package/package.json +109 -0
- package/readme.md +1 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VizReporter - Singleton for sending visualization events to @agention/viz.
|
|
3
|
+
*
|
|
4
|
+
* This class manages WebSocket connections and event reporting for agent monitoring.
|
|
5
|
+
* Events are queued when disconnected and flushed on reconnection.
|
|
6
|
+
*/
|
|
7
|
+
import { EventEmitter } from "events";
|
|
8
|
+
import { VizSource, VizVendor, VizTokenUsage, VizStopReason, VizPipelineStructure, VizExecutorType } from "./types";
|
|
9
|
+
export declare class VizReporter extends EventEmitter {
|
|
10
|
+
private static instance;
|
|
11
|
+
private ws;
|
|
12
|
+
private queue;
|
|
13
|
+
private currentSessionId;
|
|
14
|
+
private currentPipelineId;
|
|
15
|
+
private eventStack;
|
|
16
|
+
private eventTimings;
|
|
17
|
+
private connecting;
|
|
18
|
+
private reconnectTimer;
|
|
19
|
+
private constructor();
|
|
20
|
+
/**
|
|
21
|
+
* Get the singleton instance
|
|
22
|
+
*/
|
|
23
|
+
static getInstance(): VizReporter;
|
|
24
|
+
/**
|
|
25
|
+
* Reset the singleton (for testing)
|
|
26
|
+
*/
|
|
27
|
+
static resetInstance(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Initialize WebSocket connection
|
|
30
|
+
*/
|
|
31
|
+
private initWebSocket;
|
|
32
|
+
/**
|
|
33
|
+
* Attempt to connect to the visualization server
|
|
34
|
+
*/
|
|
35
|
+
private tryConnect;
|
|
36
|
+
/**
|
|
37
|
+
* Schedule a reconnection attempt
|
|
38
|
+
*/
|
|
39
|
+
private scheduleReconnect;
|
|
40
|
+
/**
|
|
41
|
+
* Flush queued events
|
|
42
|
+
*/
|
|
43
|
+
private flushQueue;
|
|
44
|
+
/**
|
|
45
|
+
* Disconnect from the visualization server
|
|
46
|
+
*/
|
|
47
|
+
disconnect(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Check if connected to the visualization server
|
|
50
|
+
*/
|
|
51
|
+
isConnected(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Send an event to the visualization server
|
|
54
|
+
*/
|
|
55
|
+
private send;
|
|
56
|
+
/**
|
|
57
|
+
* Start a new session
|
|
58
|
+
*/
|
|
59
|
+
startSession(name?: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* End the current session
|
|
62
|
+
*/
|
|
63
|
+
endSession(reason?: "completed" | "error" | "timeout"): void;
|
|
64
|
+
/**
|
|
65
|
+
* Get or create a session ID
|
|
66
|
+
*/
|
|
67
|
+
getSessionId(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Set the current session ID (for external session management)
|
|
70
|
+
*/
|
|
71
|
+
setSessionId(sessionId: string): void;
|
|
72
|
+
/**
|
|
73
|
+
* Start a pipeline execution
|
|
74
|
+
*/
|
|
75
|
+
pipelineStart(name: string, structure: VizPipelineStructure, input: string, source: VizSource): string;
|
|
76
|
+
/**
|
|
77
|
+
* End a pipeline execution
|
|
78
|
+
*/
|
|
79
|
+
pipelineEnd(eventId: string, success: boolean, totalTokens: VizTokenUsage, nodeCount: number, output?: string, error?: string): void;
|
|
80
|
+
/**
|
|
81
|
+
* Start an executor (sequential, parallel, map, voting, router)
|
|
82
|
+
*/
|
|
83
|
+
executorStart(name: string, type: VizExecutorType, childCount: number, input: string, source: VizSource): string;
|
|
84
|
+
/**
|
|
85
|
+
* End an executor
|
|
86
|
+
*/
|
|
87
|
+
executorEnd(eventId: string, success: boolean, totalTokens: VizTokenUsage, output?: string, error?: string): void;
|
|
88
|
+
/**
|
|
89
|
+
* Report agent execution start
|
|
90
|
+
*/
|
|
91
|
+
agentStart(agentId: string, agentName: string, model: string, vendor: VizVendor, input: string): string;
|
|
92
|
+
/**
|
|
93
|
+
* Report agent execution complete
|
|
94
|
+
*/
|
|
95
|
+
agentComplete(eventId: string, tokens: VizTokenUsage, stopReason: VizStopReason, hasToolCalls: boolean, toolCallCount: number, output: string): void;
|
|
96
|
+
/**
|
|
97
|
+
* Report agent execution error
|
|
98
|
+
*/
|
|
99
|
+
agentError(eventId: string, errorType: string, errorMessage: string, retryable?: boolean): void;
|
|
100
|
+
/**
|
|
101
|
+
* Report tool execution start
|
|
102
|
+
*/
|
|
103
|
+
toolStart(toolName: string, toolId: string, input: unknown, agentSource: VizSource): string;
|
|
104
|
+
/**
|
|
105
|
+
* Report tool execution complete
|
|
106
|
+
*/
|
|
107
|
+
toolComplete(eventId: string, toolName: string, toolId: string, success: boolean, result: unknown): void;
|
|
108
|
+
/**
|
|
109
|
+
* Report tool execution error
|
|
110
|
+
*/
|
|
111
|
+
toolError(eventId: string, toolName: string, toolId: string, errorMessage: string): void;
|
|
112
|
+
/**
|
|
113
|
+
* Pop an event from the stack
|
|
114
|
+
*/
|
|
115
|
+
private popEventStack;
|
|
116
|
+
/**
|
|
117
|
+
* Get current event stack depth
|
|
118
|
+
*/
|
|
119
|
+
getStackDepth(): number;
|
|
120
|
+
/**
|
|
121
|
+
* Get queued event count
|
|
122
|
+
*/
|
|
123
|
+
getQueueSize(): number;
|
|
124
|
+
}
|
|
125
|
+
/** Global VizReporter instance */
|
|
126
|
+
export declare const vizReporter: VizReporter;
|
|
127
|
+
//# sourceMappingURL=VizReporter.d.ts.map
|