@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.
Files changed (91) hide show
  1. package/README.md +517 -0
  2. package/dist/agents/Agent.d.ts +29 -0
  3. package/dist/agents/Agent.js +28 -0
  4. package/dist/agents/AgentConfig.d.ts +118 -0
  5. package/dist/agents/AgentConfig.js +3 -0
  6. package/dist/agents/AgentEvent.d.ts +18 -0
  7. package/dist/agents/AgentEvent.js +26 -0
  8. package/dist/agents/BaseAgent.d.ts +82 -0
  9. package/dist/agents/BaseAgent.js +121 -0
  10. package/dist/agents/anthropic/ClaudeAgent.d.ts +46 -0
  11. package/dist/agents/anthropic/ClaudeAgent.js +262 -0
  12. package/dist/agents/errors/AgentError.d.ts +47 -0
  13. package/dist/agents/errors/AgentError.js +74 -0
  14. package/dist/agents/google/GeminiAgent.d.ts +63 -0
  15. package/dist/agents/google/GeminiAgent.js +395 -0
  16. package/dist/agents/mistral/MistralAgent.d.ts +47 -0
  17. package/dist/agents/mistral/MistralAgent.js +313 -0
  18. package/dist/agents/model-types.d.ts +30 -0
  19. package/dist/agents/model-types.js +8 -0
  20. package/dist/agents/openai/OpenAiAgent.d.ts +48 -0
  21. package/dist/agents/openai/OpenAiAgent.js +338 -0
  22. package/dist/chunkers/Chunker.d.ts +53 -0
  23. package/dist/chunkers/Chunker.js +174 -0
  24. package/dist/chunkers/RecursiveChunker.d.ts +52 -0
  25. package/dist/chunkers/RecursiveChunker.js +166 -0
  26. package/dist/chunkers/TextChunker.d.ts +27 -0
  27. package/dist/chunkers/TextChunker.js +50 -0
  28. package/dist/chunkers/TokenChunker.d.ts +60 -0
  29. package/dist/chunkers/TokenChunker.js +176 -0
  30. package/dist/chunkers/index.d.ts +6 -0
  31. package/dist/chunkers/index.js +14 -0
  32. package/dist/chunkers/types.d.ts +95 -0
  33. package/dist/chunkers/types.js +3 -0
  34. package/dist/graph/AgentGraph.d.ts +99 -0
  35. package/dist/graph/AgentGraph.js +115 -0
  36. package/dist/graph/BaseExecutor.d.ts +86 -0
  37. package/dist/graph/BaseExecutor.js +61 -0
  38. package/dist/graph/GraphMetrics.d.ts +143 -0
  39. package/dist/graph/GraphMetrics.js +264 -0
  40. package/dist/graph/MapExecutor.d.ts +39 -0
  41. package/dist/graph/MapExecutor.js +123 -0
  42. package/dist/graph/ParallelExecutor.d.ts +51 -0
  43. package/dist/graph/ParallelExecutor.js +103 -0
  44. package/dist/graph/Pipeline.d.ts +44 -0
  45. package/dist/graph/Pipeline.js +109 -0
  46. package/dist/graph/RouterExecutor.d.ts +89 -0
  47. package/dist/graph/RouterExecutor.js +209 -0
  48. package/dist/graph/SequentialExecutor.d.ts +44 -0
  49. package/dist/graph/SequentialExecutor.js +115 -0
  50. package/dist/graph/VotingSystem.d.ts +54 -0
  51. package/dist/graph/VotingSystem.js +106 -0
  52. package/dist/history/History.d.ts +107 -0
  53. package/dist/history/History.js +166 -0
  54. package/dist/history/RedisHistory.d.ts +27 -0
  55. package/dist/history/RedisHistory.js +55 -0
  56. package/dist/history/transformers.d.ts +102 -0
  57. package/dist/history/transformers.js +415 -0
  58. package/dist/history/types.d.ts +130 -0
  59. package/dist/history/types.js +55 -0
  60. package/dist/index.d.ts +16 -0
  61. package/dist/index.js +48 -0
  62. package/dist/ingestion/IngestionPipeline.d.ts +86 -0
  63. package/dist/ingestion/IngestionPipeline.js +266 -0
  64. package/dist/ingestion/index.d.ts +3 -0
  65. package/dist/ingestion/index.js +7 -0
  66. package/dist/ingestion/types.d.ts +74 -0
  67. package/dist/ingestion/types.js +3 -0
  68. package/dist/team/Team.d.ts +46 -0
  69. package/dist/team/Team.js +104 -0
  70. package/dist/tools/Tool.d.ts +75 -0
  71. package/dist/tools/Tool.js +137 -0
  72. package/dist/vectorstore/Embeddings.d.ts +67 -0
  73. package/dist/vectorstore/Embeddings.js +54 -0
  74. package/dist/vectorstore/LanceDBVectorStore.d.ts +149 -0
  75. package/dist/vectorstore/LanceDBVectorStore.js +338 -0
  76. package/dist/vectorstore/OpenAIEmbeddings.d.ts +45 -0
  77. package/dist/vectorstore/OpenAIEmbeddings.js +109 -0
  78. package/dist/vectorstore/VectorStore.d.ts +255 -0
  79. package/dist/vectorstore/VectorStore.js +216 -0
  80. package/dist/vectorstore/index.d.ts +28 -0
  81. package/dist/vectorstore/index.js +35 -0
  82. package/dist/viz/VizConfig.d.ts +54 -0
  83. package/dist/viz/VizConfig.js +100 -0
  84. package/dist/viz/VizReporter.d.ts +127 -0
  85. package/dist/viz/VizReporter.js +595 -0
  86. package/dist/viz/index.d.ts +31 -0
  87. package/dist/viz/index.js +51 -0
  88. package/dist/viz/types.d.ts +105 -0
  89. package/dist/viz/types.js +7 -0
  90. package/package.json +109 -0
  91. 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