@voltagent/server-core 1.0.0-next.1 → 1.0.0-next.2
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/dist/index.d.mts +522 -23
- package/dist/index.d.ts +522 -23
- package/dist/index.js +877 -243
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +857 -237
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AgentHistoryEntry, WorkflowHistoryEntry, ServerProviderDeps, IServerProvider } from '@voltagent/core';
|
|
2
1
|
import { LogFilter, Logger, LogLevel, LogEntry } from '@voltagent/internal';
|
|
3
2
|
import { z } from 'zod';
|
|
3
|
+
import { ServerProviderDeps, IServerProvider } from '@voltagent/core';
|
|
4
4
|
import jwt from 'jsonwebtoken';
|
|
5
5
|
import { IncomingMessage, Server } from 'node:http';
|
|
6
6
|
import { Socket } from 'node:net';
|
|
@@ -96,14 +96,7 @@ interface LogStreamClient {
|
|
|
96
96
|
/**
|
|
97
97
|
* WebSocket event handlers
|
|
98
98
|
*/
|
|
99
|
-
|
|
100
|
-
onAgentHistoryUpdate?: (agentId: string, historyEntry: AgentHistoryEntry & {
|
|
101
|
-
_sequenceNumber?: number;
|
|
102
|
-
}) => void;
|
|
103
|
-
onAgentHistoryCreated?: (agentId: string, historyEntry: AgentHistoryEntry) => void;
|
|
104
|
-
onWorkflowHistoryCreated?: (historyEntry: WorkflowHistoryEntry) => void;
|
|
105
|
-
onWorkflowHistoryUpdate?: (executionId: string, historyEntry: WorkflowHistoryEntry) => void;
|
|
106
|
-
}
|
|
99
|
+
type WebSocketEventHandlers = Record<string, never>;
|
|
107
100
|
|
|
108
101
|
/**
|
|
109
102
|
* Framework-agnostic route definitions
|
|
@@ -205,13 +198,13 @@ declare const AGENT_ROUTES: {
|
|
|
205
198
|
readonly streamText: {
|
|
206
199
|
readonly method: "post";
|
|
207
200
|
readonly path: "/agents/:id/stream";
|
|
208
|
-
readonly summary: "Stream text response";
|
|
209
|
-
readonly description: "Generate a text response from an agent and stream
|
|
201
|
+
readonly summary: "Stream raw text response";
|
|
202
|
+
readonly description: "Generate a text response from an agent and stream the raw fullStream data via Server-Sent Events (SSE). This endpoint provides direct access to all stream events including text deltas, tool calls, and tool results. Use this for advanced applications that need full control over stream processing.";
|
|
210
203
|
readonly tags: readonly ["Agent Generation"];
|
|
211
204
|
readonly operationId: "streamText";
|
|
212
205
|
readonly responses: {
|
|
213
206
|
readonly 200: {
|
|
214
|
-
readonly description: "Successfully established SSE stream for text generation";
|
|
207
|
+
readonly description: "Successfully established SSE stream for raw text generation";
|
|
215
208
|
readonly contentType: "text/event-stream";
|
|
216
209
|
};
|
|
217
210
|
readonly 400: {
|
|
@@ -228,6 +221,32 @@ declare const AGENT_ROUTES: {
|
|
|
228
221
|
};
|
|
229
222
|
};
|
|
230
223
|
};
|
|
224
|
+
readonly chatStream: {
|
|
225
|
+
readonly method: "post";
|
|
226
|
+
readonly path: "/agents/:id/chat";
|
|
227
|
+
readonly summary: "Stream chat messages";
|
|
228
|
+
readonly description: "Generate a text response from an agent and stream it as UI messages via Server-Sent Events (SSE). This endpoint is optimized for chat interfaces and works seamlessly with the AI SDK's useChat hook. It provides a high-level stream format with automatic handling of messages, tool calls, and metadata.";
|
|
229
|
+
readonly tags: readonly ["Agent Generation"];
|
|
230
|
+
readonly operationId: "chatStream";
|
|
231
|
+
readonly responses: {
|
|
232
|
+
readonly 200: {
|
|
233
|
+
readonly description: "Successfully established SSE stream for chat generation";
|
|
234
|
+
readonly contentType: "text/event-stream";
|
|
235
|
+
};
|
|
236
|
+
readonly 400: {
|
|
237
|
+
readonly description: "Invalid request parameters or message format";
|
|
238
|
+
readonly contentType: "application/json";
|
|
239
|
+
};
|
|
240
|
+
readonly 404: {
|
|
241
|
+
readonly description: "Agent not found";
|
|
242
|
+
readonly contentType: "application/json";
|
|
243
|
+
};
|
|
244
|
+
readonly 500: {
|
|
245
|
+
readonly description: "Failed to stream chat due to server error";
|
|
246
|
+
readonly contentType: "application/json";
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
};
|
|
231
250
|
readonly generateObject: {
|
|
232
251
|
readonly method: "post";
|
|
233
252
|
readonly path: "/agents/:id/object";
|
|
@@ -451,6 +470,28 @@ declare const WORKFLOW_ROUTES: {
|
|
|
451
470
|
};
|
|
452
471
|
};
|
|
453
472
|
};
|
|
473
|
+
readonly getWorkflowState: {
|
|
474
|
+
readonly method: "get";
|
|
475
|
+
readonly path: "/workflows/:id/executions/:executionId/state";
|
|
476
|
+
readonly summary: "Get workflow execution state";
|
|
477
|
+
readonly description: "Retrieve the workflow execution state including input data, suspension information, context, and current status. This is essential for understanding the current state of a workflow execution, especially for suspended workflows that need to be resumed with the correct context.";
|
|
478
|
+
readonly tags: readonly ["Workflow Management"];
|
|
479
|
+
readonly operationId: "getWorkflowState";
|
|
480
|
+
readonly responses: {
|
|
481
|
+
readonly 200: {
|
|
482
|
+
readonly description: "Successfully retrieved workflow execution state";
|
|
483
|
+
readonly contentType: "application/json";
|
|
484
|
+
};
|
|
485
|
+
readonly 404: {
|
|
486
|
+
readonly description: "Workflow or execution not found";
|
|
487
|
+
readonly contentType: "application/json";
|
|
488
|
+
};
|
|
489
|
+
readonly 500: {
|
|
490
|
+
readonly description: "Failed to retrieve workflow state due to server error";
|
|
491
|
+
readonly contentType: "application/json";
|
|
492
|
+
};
|
|
493
|
+
};
|
|
494
|
+
};
|
|
454
495
|
};
|
|
455
496
|
/**
|
|
456
497
|
* Log route definitions
|
|
@@ -524,10 +565,351 @@ declare const UPDATE_ROUTES: {
|
|
|
524
565
|
};
|
|
525
566
|
};
|
|
526
567
|
};
|
|
568
|
+
/**
|
|
569
|
+
* Observability route definitions
|
|
570
|
+
*/
|
|
571
|
+
declare const OBSERVABILITY_ROUTES: {
|
|
572
|
+
readonly setupObservability: {
|
|
573
|
+
readonly method: "post";
|
|
574
|
+
readonly path: "/setup-observability";
|
|
575
|
+
readonly summary: "Configure observability settings";
|
|
576
|
+
readonly description: "Updates the .env file with VoltAgent public and secret keys to enable observability features. This allows automatic tracing and monitoring of agent operations.";
|
|
577
|
+
readonly tags: readonly ["Observability"];
|
|
578
|
+
readonly operationId: "setupObservability";
|
|
579
|
+
readonly responses: {
|
|
580
|
+
readonly 200: {
|
|
581
|
+
readonly description: "Successfully configured observability settings";
|
|
582
|
+
readonly contentType: "application/json";
|
|
583
|
+
};
|
|
584
|
+
readonly 400: {
|
|
585
|
+
readonly description: "Invalid request - missing publicKey or secretKey";
|
|
586
|
+
readonly contentType: "application/json";
|
|
587
|
+
};
|
|
588
|
+
readonly 500: {
|
|
589
|
+
readonly description: "Failed to update .env file";
|
|
590
|
+
readonly contentType: "application/json";
|
|
591
|
+
};
|
|
592
|
+
};
|
|
593
|
+
};
|
|
594
|
+
readonly getTraces: {
|
|
595
|
+
readonly method: "get";
|
|
596
|
+
readonly path: "/observability/traces";
|
|
597
|
+
readonly summary: "List all traces";
|
|
598
|
+
readonly description: "Retrieve all OpenTelemetry traces from the observability store. Each trace represents a complete operation with its spans showing the execution flow.";
|
|
599
|
+
readonly tags: readonly ["Observability"];
|
|
600
|
+
readonly operationId: "getTraces";
|
|
601
|
+
readonly responses: {
|
|
602
|
+
readonly 200: {
|
|
603
|
+
readonly description: "Successfully retrieved traces";
|
|
604
|
+
readonly contentType: "application/json";
|
|
605
|
+
};
|
|
606
|
+
readonly 500: {
|
|
607
|
+
readonly description: "Failed to retrieve traces due to server error";
|
|
608
|
+
readonly contentType: "application/json";
|
|
609
|
+
};
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
readonly getTraceById: {
|
|
613
|
+
readonly method: "get";
|
|
614
|
+
readonly path: "/observability/traces/:traceId";
|
|
615
|
+
readonly summary: "Get trace by ID";
|
|
616
|
+
readonly description: "Retrieve a specific trace and all its spans by trace ID.";
|
|
617
|
+
readonly tags: readonly ["Observability"];
|
|
618
|
+
readonly operationId: "getTraceById";
|
|
619
|
+
readonly responses: {
|
|
620
|
+
readonly 200: {
|
|
621
|
+
readonly description: "Successfully retrieved trace";
|
|
622
|
+
readonly contentType: "application/json";
|
|
623
|
+
};
|
|
624
|
+
readonly 404: {
|
|
625
|
+
readonly description: "Trace not found";
|
|
626
|
+
readonly contentType: "application/json";
|
|
627
|
+
};
|
|
628
|
+
readonly 500: {
|
|
629
|
+
readonly description: "Failed to retrieve trace due to server error";
|
|
630
|
+
readonly contentType: "application/json";
|
|
631
|
+
};
|
|
632
|
+
};
|
|
633
|
+
};
|
|
634
|
+
readonly getSpanById: {
|
|
635
|
+
readonly method: "get";
|
|
636
|
+
readonly path: "/observability/spans/:spanId";
|
|
637
|
+
readonly summary: "Get span by ID";
|
|
638
|
+
readonly description: "Retrieve a specific span by its ID.";
|
|
639
|
+
readonly tags: readonly ["Observability"];
|
|
640
|
+
readonly operationId: "getSpanById";
|
|
641
|
+
readonly responses: {
|
|
642
|
+
readonly 200: {
|
|
643
|
+
readonly description: "Successfully retrieved span";
|
|
644
|
+
readonly contentType: "application/json";
|
|
645
|
+
};
|
|
646
|
+
readonly 404: {
|
|
647
|
+
readonly description: "Span not found";
|
|
648
|
+
readonly contentType: "application/json";
|
|
649
|
+
};
|
|
650
|
+
readonly 500: {
|
|
651
|
+
readonly description: "Failed to retrieve span due to server error";
|
|
652
|
+
readonly contentType: "application/json";
|
|
653
|
+
};
|
|
654
|
+
};
|
|
655
|
+
};
|
|
656
|
+
readonly getObservabilityStatus: {
|
|
657
|
+
readonly method: "get";
|
|
658
|
+
readonly path: "/observability/status";
|
|
659
|
+
readonly summary: "Get observability status";
|
|
660
|
+
readonly description: "Check the status and configuration of the observability system.";
|
|
661
|
+
readonly tags: readonly ["Observability"];
|
|
662
|
+
readonly operationId: "getObservabilityStatus";
|
|
663
|
+
readonly responses: {
|
|
664
|
+
readonly 200: {
|
|
665
|
+
readonly description: "Successfully retrieved observability status";
|
|
666
|
+
readonly contentType: "application/json";
|
|
667
|
+
};
|
|
668
|
+
readonly 500: {
|
|
669
|
+
readonly description: "Failed to retrieve status due to server error";
|
|
670
|
+
readonly contentType: "application/json";
|
|
671
|
+
};
|
|
672
|
+
};
|
|
673
|
+
};
|
|
674
|
+
readonly getLogsByTraceId: {
|
|
675
|
+
readonly method: "get";
|
|
676
|
+
readonly path: "/observability/traces/:traceId/logs";
|
|
677
|
+
readonly summary: "Get logs by trace ID";
|
|
678
|
+
readonly description: "Retrieve all logs associated with a specific trace ID.";
|
|
679
|
+
readonly tags: readonly ["Observability"];
|
|
680
|
+
readonly operationId: "getLogsByTraceId";
|
|
681
|
+
readonly responses: {
|
|
682
|
+
readonly 200: {
|
|
683
|
+
readonly description: "Successfully retrieved logs";
|
|
684
|
+
readonly contentType: "application/json";
|
|
685
|
+
};
|
|
686
|
+
readonly 404: {
|
|
687
|
+
readonly description: "No logs found for the trace";
|
|
688
|
+
readonly contentType: "application/json";
|
|
689
|
+
};
|
|
690
|
+
readonly 500: {
|
|
691
|
+
readonly description: "Failed to retrieve logs due to server error";
|
|
692
|
+
readonly contentType: "application/json";
|
|
693
|
+
};
|
|
694
|
+
};
|
|
695
|
+
};
|
|
696
|
+
readonly getLogsBySpanId: {
|
|
697
|
+
readonly method: "get";
|
|
698
|
+
readonly path: "/observability/spans/:spanId/logs";
|
|
699
|
+
readonly summary: "Get logs by span ID";
|
|
700
|
+
readonly description: "Retrieve all logs associated with a specific span ID.";
|
|
701
|
+
readonly tags: readonly ["Observability"];
|
|
702
|
+
readonly operationId: "getLogsBySpanId";
|
|
703
|
+
readonly responses: {
|
|
704
|
+
readonly 200: {
|
|
705
|
+
readonly description: "Successfully retrieved logs";
|
|
706
|
+
readonly contentType: "application/json";
|
|
707
|
+
};
|
|
708
|
+
readonly 404: {
|
|
709
|
+
readonly description: "No logs found for the span";
|
|
710
|
+
readonly contentType: "application/json";
|
|
711
|
+
};
|
|
712
|
+
readonly 500: {
|
|
713
|
+
readonly description: "Failed to retrieve logs due to server error";
|
|
714
|
+
readonly contentType: "application/json";
|
|
715
|
+
};
|
|
716
|
+
};
|
|
717
|
+
};
|
|
718
|
+
readonly queryLogs: {
|
|
719
|
+
readonly method: "get";
|
|
720
|
+
readonly path: "/observability/logs";
|
|
721
|
+
readonly summary: "Query logs";
|
|
722
|
+
readonly description: "Query logs with filters such as severity, time range, trace ID, etc.";
|
|
723
|
+
readonly tags: readonly ["Observability"];
|
|
724
|
+
readonly operationId: "queryLogs";
|
|
725
|
+
readonly responses: {
|
|
726
|
+
readonly 200: {
|
|
727
|
+
readonly description: "Successfully retrieved logs";
|
|
728
|
+
readonly contentType: "application/json";
|
|
729
|
+
};
|
|
730
|
+
readonly 400: {
|
|
731
|
+
readonly description: "Invalid query parameters";
|
|
732
|
+
readonly contentType: "application/json";
|
|
733
|
+
};
|
|
734
|
+
readonly 500: {
|
|
735
|
+
readonly description: "Failed to query logs due to server error";
|
|
736
|
+
readonly contentType: "application/json";
|
|
737
|
+
};
|
|
738
|
+
};
|
|
739
|
+
};
|
|
740
|
+
};
|
|
527
741
|
/**
|
|
528
742
|
* All route definitions combined
|
|
529
743
|
*/
|
|
530
744
|
declare const ALL_ROUTES: {
|
|
745
|
+
readonly setupObservability: {
|
|
746
|
+
readonly method: "post";
|
|
747
|
+
readonly path: "/setup-observability";
|
|
748
|
+
readonly summary: "Configure observability settings";
|
|
749
|
+
readonly description: "Updates the .env file with VoltAgent public and secret keys to enable observability features. This allows automatic tracing and monitoring of agent operations.";
|
|
750
|
+
readonly tags: readonly ["Observability"];
|
|
751
|
+
readonly operationId: "setupObservability";
|
|
752
|
+
readonly responses: {
|
|
753
|
+
readonly 200: {
|
|
754
|
+
readonly description: "Successfully configured observability settings";
|
|
755
|
+
readonly contentType: "application/json";
|
|
756
|
+
};
|
|
757
|
+
readonly 400: {
|
|
758
|
+
readonly description: "Invalid request - missing publicKey or secretKey";
|
|
759
|
+
readonly contentType: "application/json";
|
|
760
|
+
};
|
|
761
|
+
readonly 500: {
|
|
762
|
+
readonly description: "Failed to update .env file";
|
|
763
|
+
readonly contentType: "application/json";
|
|
764
|
+
};
|
|
765
|
+
};
|
|
766
|
+
};
|
|
767
|
+
readonly getTraces: {
|
|
768
|
+
readonly method: "get";
|
|
769
|
+
readonly path: "/observability/traces";
|
|
770
|
+
readonly summary: "List all traces";
|
|
771
|
+
readonly description: "Retrieve all OpenTelemetry traces from the observability store. Each trace represents a complete operation with its spans showing the execution flow.";
|
|
772
|
+
readonly tags: readonly ["Observability"];
|
|
773
|
+
readonly operationId: "getTraces";
|
|
774
|
+
readonly responses: {
|
|
775
|
+
readonly 200: {
|
|
776
|
+
readonly description: "Successfully retrieved traces";
|
|
777
|
+
readonly contentType: "application/json";
|
|
778
|
+
};
|
|
779
|
+
readonly 500: {
|
|
780
|
+
readonly description: "Failed to retrieve traces due to server error";
|
|
781
|
+
readonly contentType: "application/json";
|
|
782
|
+
};
|
|
783
|
+
};
|
|
784
|
+
};
|
|
785
|
+
readonly getTraceById: {
|
|
786
|
+
readonly method: "get";
|
|
787
|
+
readonly path: "/observability/traces/:traceId";
|
|
788
|
+
readonly summary: "Get trace by ID";
|
|
789
|
+
readonly description: "Retrieve a specific trace and all its spans by trace ID.";
|
|
790
|
+
readonly tags: readonly ["Observability"];
|
|
791
|
+
readonly operationId: "getTraceById";
|
|
792
|
+
readonly responses: {
|
|
793
|
+
readonly 200: {
|
|
794
|
+
readonly description: "Successfully retrieved trace";
|
|
795
|
+
readonly contentType: "application/json";
|
|
796
|
+
};
|
|
797
|
+
readonly 404: {
|
|
798
|
+
readonly description: "Trace not found";
|
|
799
|
+
readonly contentType: "application/json";
|
|
800
|
+
};
|
|
801
|
+
readonly 500: {
|
|
802
|
+
readonly description: "Failed to retrieve trace due to server error";
|
|
803
|
+
readonly contentType: "application/json";
|
|
804
|
+
};
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
readonly getSpanById: {
|
|
808
|
+
readonly method: "get";
|
|
809
|
+
readonly path: "/observability/spans/:spanId";
|
|
810
|
+
readonly summary: "Get span by ID";
|
|
811
|
+
readonly description: "Retrieve a specific span by its ID.";
|
|
812
|
+
readonly tags: readonly ["Observability"];
|
|
813
|
+
readonly operationId: "getSpanById";
|
|
814
|
+
readonly responses: {
|
|
815
|
+
readonly 200: {
|
|
816
|
+
readonly description: "Successfully retrieved span";
|
|
817
|
+
readonly contentType: "application/json";
|
|
818
|
+
};
|
|
819
|
+
readonly 404: {
|
|
820
|
+
readonly description: "Span not found";
|
|
821
|
+
readonly contentType: "application/json";
|
|
822
|
+
};
|
|
823
|
+
readonly 500: {
|
|
824
|
+
readonly description: "Failed to retrieve span due to server error";
|
|
825
|
+
readonly contentType: "application/json";
|
|
826
|
+
};
|
|
827
|
+
};
|
|
828
|
+
};
|
|
829
|
+
readonly getObservabilityStatus: {
|
|
830
|
+
readonly method: "get";
|
|
831
|
+
readonly path: "/observability/status";
|
|
832
|
+
readonly summary: "Get observability status";
|
|
833
|
+
readonly description: "Check the status and configuration of the observability system.";
|
|
834
|
+
readonly tags: readonly ["Observability"];
|
|
835
|
+
readonly operationId: "getObservabilityStatus";
|
|
836
|
+
readonly responses: {
|
|
837
|
+
readonly 200: {
|
|
838
|
+
readonly description: "Successfully retrieved observability status";
|
|
839
|
+
readonly contentType: "application/json";
|
|
840
|
+
};
|
|
841
|
+
readonly 500: {
|
|
842
|
+
readonly description: "Failed to retrieve status due to server error";
|
|
843
|
+
readonly contentType: "application/json";
|
|
844
|
+
};
|
|
845
|
+
};
|
|
846
|
+
};
|
|
847
|
+
readonly getLogsByTraceId: {
|
|
848
|
+
readonly method: "get";
|
|
849
|
+
readonly path: "/observability/traces/:traceId/logs";
|
|
850
|
+
readonly summary: "Get logs by trace ID";
|
|
851
|
+
readonly description: "Retrieve all logs associated with a specific trace ID.";
|
|
852
|
+
readonly tags: readonly ["Observability"];
|
|
853
|
+
readonly operationId: "getLogsByTraceId";
|
|
854
|
+
readonly responses: {
|
|
855
|
+
readonly 200: {
|
|
856
|
+
readonly description: "Successfully retrieved logs";
|
|
857
|
+
readonly contentType: "application/json";
|
|
858
|
+
};
|
|
859
|
+
readonly 404: {
|
|
860
|
+
readonly description: "No logs found for the trace";
|
|
861
|
+
readonly contentType: "application/json";
|
|
862
|
+
};
|
|
863
|
+
readonly 500: {
|
|
864
|
+
readonly description: "Failed to retrieve logs due to server error";
|
|
865
|
+
readonly contentType: "application/json";
|
|
866
|
+
};
|
|
867
|
+
};
|
|
868
|
+
};
|
|
869
|
+
readonly getLogsBySpanId: {
|
|
870
|
+
readonly method: "get";
|
|
871
|
+
readonly path: "/observability/spans/:spanId/logs";
|
|
872
|
+
readonly summary: "Get logs by span ID";
|
|
873
|
+
readonly description: "Retrieve all logs associated with a specific span ID.";
|
|
874
|
+
readonly tags: readonly ["Observability"];
|
|
875
|
+
readonly operationId: "getLogsBySpanId";
|
|
876
|
+
readonly responses: {
|
|
877
|
+
readonly 200: {
|
|
878
|
+
readonly description: "Successfully retrieved logs";
|
|
879
|
+
readonly contentType: "application/json";
|
|
880
|
+
};
|
|
881
|
+
readonly 404: {
|
|
882
|
+
readonly description: "No logs found for the span";
|
|
883
|
+
readonly contentType: "application/json";
|
|
884
|
+
};
|
|
885
|
+
readonly 500: {
|
|
886
|
+
readonly description: "Failed to retrieve logs due to server error";
|
|
887
|
+
readonly contentType: "application/json";
|
|
888
|
+
};
|
|
889
|
+
};
|
|
890
|
+
};
|
|
891
|
+
readonly queryLogs: {
|
|
892
|
+
readonly method: "get";
|
|
893
|
+
readonly path: "/observability/logs";
|
|
894
|
+
readonly summary: "Query logs";
|
|
895
|
+
readonly description: "Query logs with filters such as severity, time range, trace ID, etc.";
|
|
896
|
+
readonly tags: readonly ["Observability"];
|
|
897
|
+
readonly operationId: "queryLogs";
|
|
898
|
+
readonly responses: {
|
|
899
|
+
readonly 200: {
|
|
900
|
+
readonly description: "Successfully retrieved logs";
|
|
901
|
+
readonly contentType: "application/json";
|
|
902
|
+
};
|
|
903
|
+
readonly 400: {
|
|
904
|
+
readonly description: "Invalid query parameters";
|
|
905
|
+
readonly contentType: "application/json";
|
|
906
|
+
};
|
|
907
|
+
readonly 500: {
|
|
908
|
+
readonly description: "Failed to query logs due to server error";
|
|
909
|
+
readonly contentType: "application/json";
|
|
910
|
+
};
|
|
911
|
+
};
|
|
912
|
+
};
|
|
531
913
|
readonly checkUpdates: {
|
|
532
914
|
readonly method: "get";
|
|
533
915
|
readonly path: "/updates";
|
|
@@ -734,6 +1116,28 @@ declare const ALL_ROUTES: {
|
|
|
734
1116
|
};
|
|
735
1117
|
};
|
|
736
1118
|
};
|
|
1119
|
+
readonly getWorkflowState: {
|
|
1120
|
+
readonly method: "get";
|
|
1121
|
+
readonly path: "/workflows/:id/executions/:executionId/state";
|
|
1122
|
+
readonly summary: "Get workflow execution state";
|
|
1123
|
+
readonly description: "Retrieve the workflow execution state including input data, suspension information, context, and current status. This is essential for understanding the current state of a workflow execution, especially for suspended workflows that need to be resumed with the correct context.";
|
|
1124
|
+
readonly tags: readonly ["Workflow Management"];
|
|
1125
|
+
readonly operationId: "getWorkflowState";
|
|
1126
|
+
readonly responses: {
|
|
1127
|
+
readonly 200: {
|
|
1128
|
+
readonly description: "Successfully retrieved workflow execution state";
|
|
1129
|
+
readonly contentType: "application/json";
|
|
1130
|
+
};
|
|
1131
|
+
readonly 404: {
|
|
1132
|
+
readonly description: "Workflow or execution not found";
|
|
1133
|
+
readonly contentType: "application/json";
|
|
1134
|
+
};
|
|
1135
|
+
readonly 500: {
|
|
1136
|
+
readonly description: "Failed to retrieve workflow state due to server error";
|
|
1137
|
+
readonly contentType: "application/json";
|
|
1138
|
+
};
|
|
1139
|
+
};
|
|
1140
|
+
};
|
|
737
1141
|
readonly listAgents: {
|
|
738
1142
|
readonly method: "get";
|
|
739
1143
|
readonly path: "/agents";
|
|
@@ -803,13 +1207,13 @@ declare const ALL_ROUTES: {
|
|
|
803
1207
|
readonly streamText: {
|
|
804
1208
|
readonly method: "post";
|
|
805
1209
|
readonly path: "/agents/:id/stream";
|
|
806
|
-
readonly summary: "Stream text response";
|
|
807
|
-
readonly description: "Generate a text response from an agent and stream
|
|
1210
|
+
readonly summary: "Stream raw text response";
|
|
1211
|
+
readonly description: "Generate a text response from an agent and stream the raw fullStream data via Server-Sent Events (SSE). This endpoint provides direct access to all stream events including text deltas, tool calls, and tool results. Use this for advanced applications that need full control over stream processing.";
|
|
808
1212
|
readonly tags: readonly ["Agent Generation"];
|
|
809
1213
|
readonly operationId: "streamText";
|
|
810
1214
|
readonly responses: {
|
|
811
1215
|
readonly 200: {
|
|
812
|
-
readonly description: "Successfully established SSE stream for text generation";
|
|
1216
|
+
readonly description: "Successfully established SSE stream for raw text generation";
|
|
813
1217
|
readonly contentType: "text/event-stream";
|
|
814
1218
|
};
|
|
815
1219
|
readonly 400: {
|
|
@@ -826,6 +1230,32 @@ declare const ALL_ROUTES: {
|
|
|
826
1230
|
};
|
|
827
1231
|
};
|
|
828
1232
|
};
|
|
1233
|
+
readonly chatStream: {
|
|
1234
|
+
readonly method: "post";
|
|
1235
|
+
readonly path: "/agents/:id/chat";
|
|
1236
|
+
readonly summary: "Stream chat messages";
|
|
1237
|
+
readonly description: "Generate a text response from an agent and stream it as UI messages via Server-Sent Events (SSE). This endpoint is optimized for chat interfaces and works seamlessly with the AI SDK's useChat hook. It provides a high-level stream format with automatic handling of messages, tool calls, and metadata.";
|
|
1238
|
+
readonly tags: readonly ["Agent Generation"];
|
|
1239
|
+
readonly operationId: "chatStream";
|
|
1240
|
+
readonly responses: {
|
|
1241
|
+
readonly 200: {
|
|
1242
|
+
readonly description: "Successfully established SSE stream for chat generation";
|
|
1243
|
+
readonly contentType: "text/event-stream";
|
|
1244
|
+
};
|
|
1245
|
+
readonly 400: {
|
|
1246
|
+
readonly description: "Invalid request parameters or message format";
|
|
1247
|
+
readonly contentType: "application/json";
|
|
1248
|
+
};
|
|
1249
|
+
readonly 404: {
|
|
1250
|
+
readonly description: "Agent not found";
|
|
1251
|
+
readonly contentType: "application/json";
|
|
1252
|
+
};
|
|
1253
|
+
readonly 500: {
|
|
1254
|
+
readonly description: "Failed to stream chat due to server error";
|
|
1255
|
+
readonly contentType: "application/json";
|
|
1256
|
+
};
|
|
1257
|
+
};
|
|
1258
|
+
};
|
|
829
1259
|
readonly generateObject: {
|
|
830
1260
|
readonly method: "post";
|
|
831
1261
|
readonly path: "/agents/:id/object";
|
|
@@ -1916,22 +2346,27 @@ declare function handleGetAgents(deps: ServerProviderDeps, logger: Logger): Prom
|
|
|
1916
2346
|
* Handler for generating text
|
|
1917
2347
|
* Returns generated text data
|
|
1918
2348
|
*/
|
|
1919
|
-
declare function handleGenerateText(agentId: string, body: any, deps: ServerProviderDeps, logger: Logger): Promise<ApiResponse>;
|
|
2349
|
+
declare function handleGenerateText(agentId: string, body: any, deps: ServerProviderDeps, logger: Logger, signal?: AbortSignal): Promise<ApiResponse>;
|
|
1920
2350
|
/**
|
|
1921
|
-
* Handler for streaming text generation
|
|
1922
|
-
* Returns
|
|
2351
|
+
* Handler for streaming text generation with raw fullStream
|
|
2352
|
+
* Returns raw stream data via SSE
|
|
2353
|
+
*/
|
|
2354
|
+
declare function handleStreamText(agentId: string, body: any, deps: ServerProviderDeps, logger: Logger, signal?: AbortSignal): Promise<Response>;
|
|
2355
|
+
/**
|
|
2356
|
+
* Handler for streaming chat messages
|
|
2357
|
+
* Returns AI SDK UI Message Stream Response
|
|
1923
2358
|
*/
|
|
1924
|
-
declare function
|
|
2359
|
+
declare function handleChatStream(agentId: string, body: any, deps: ServerProviderDeps, logger: Logger, signal?: AbortSignal): Promise<Response>;
|
|
1925
2360
|
/**
|
|
1926
2361
|
* Handler for generating objects
|
|
1927
2362
|
* Returns generated object data
|
|
1928
2363
|
*/
|
|
1929
|
-
declare function handleGenerateObject(agentId: string, body: any, deps: ServerProviderDeps, logger: Logger): Promise<ApiResponse>;
|
|
2364
|
+
declare function handleGenerateObject(agentId: string, body: any, deps: ServerProviderDeps, logger: Logger, signal?: AbortSignal): Promise<ApiResponse>;
|
|
1930
2365
|
/**
|
|
1931
2366
|
* Handler for streaming object generation
|
|
1932
2367
|
* Returns AI SDK Response or error
|
|
1933
2368
|
*/
|
|
1934
|
-
declare function handleStreamObject(agentId: string, body: any, deps: ServerProviderDeps, logger: Logger): Promise<Response>;
|
|
2369
|
+
declare function handleStreamObject(agentId: string, body: any, deps: ServerProviderDeps, logger: Logger, signal?: AbortSignal): Promise<Response>;
|
|
1935
2370
|
|
|
1936
2371
|
/**
|
|
1937
2372
|
* Handler for getting a single agent by ID
|
|
@@ -1974,6 +2409,11 @@ declare function handleSuspendWorkflow(executionId: string, body: any, deps: Ser
|
|
|
1974
2409
|
* Returns resume result
|
|
1975
2410
|
*/
|
|
1976
2411
|
declare function handleResumeWorkflow(workflowId: string, executionId: string, body: any, deps: ServerProviderDeps, logger: Logger): Promise<ApiResponse>;
|
|
2412
|
+
/**
|
|
2413
|
+
* Handler for getting workflow execution state
|
|
2414
|
+
* Returns workflow state from Memory V2
|
|
2415
|
+
*/
|
|
2416
|
+
declare function handleGetWorkflowState(workflowId: string, executionId: string, deps: ServerProviderDeps, logger: Logger): Promise<ApiResponse>;
|
|
1977
2417
|
|
|
1978
2418
|
/**
|
|
1979
2419
|
* Log filter options for querying logs
|
|
@@ -2010,6 +2450,47 @@ declare function handleCheckUpdates(_deps: ServerProviderDeps, logger: Logger):
|
|
|
2010
2450
|
*/
|
|
2011
2451
|
declare function handleInstallUpdates(packageName: string | undefined, _deps: ServerProviderDeps, logger: Logger): Promise<ApiResponse>;
|
|
2012
2452
|
|
|
2453
|
+
/**
|
|
2454
|
+
* Observability API handlers
|
|
2455
|
+
* Provides access to OpenTelemetry traces and spans
|
|
2456
|
+
*/
|
|
2457
|
+
|
|
2458
|
+
/**
|
|
2459
|
+
* Get all traces from the observability store with optional agent filtering
|
|
2460
|
+
*/
|
|
2461
|
+
declare function getTracesHandler(deps: ServerProviderDeps, query?: Record<string, string>): Promise<any>;
|
|
2462
|
+
/**
|
|
2463
|
+
* Get a specific trace by ID
|
|
2464
|
+
*/
|
|
2465
|
+
declare function getTraceByIdHandler(traceId: string, deps: ServerProviderDeps): Promise<any>;
|
|
2466
|
+
/**
|
|
2467
|
+
* Get a specific span by ID
|
|
2468
|
+
*/
|
|
2469
|
+
declare function getSpanByIdHandler(spanId: string, deps: ServerProviderDeps): Promise<any>;
|
|
2470
|
+
/**
|
|
2471
|
+
* Get observability status
|
|
2472
|
+
*/
|
|
2473
|
+
declare function getObservabilityStatusHandler(deps: ServerProviderDeps): Promise<any>;
|
|
2474
|
+
/**
|
|
2475
|
+
* Get logs by trace ID
|
|
2476
|
+
*/
|
|
2477
|
+
declare function getLogsByTraceIdHandler(traceId: string, deps: ServerProviderDeps): Promise<any>;
|
|
2478
|
+
/**
|
|
2479
|
+
* Get logs by span ID
|
|
2480
|
+
*/
|
|
2481
|
+
declare function getLogsBySpanIdHandler(spanId: string, deps: ServerProviderDeps): Promise<any>;
|
|
2482
|
+
/**
|
|
2483
|
+
* Query logs with filters
|
|
2484
|
+
*/
|
|
2485
|
+
declare function queryLogsHandler(query: any, deps: ServerProviderDeps): Promise<any>;
|
|
2486
|
+
/**
|
|
2487
|
+
* Setup observability by updating .env file with VoltAgent keys
|
|
2488
|
+
*/
|
|
2489
|
+
declare function setupObservabilityHandler(body: {
|
|
2490
|
+
publicKey?: string;
|
|
2491
|
+
secretKey?: string;
|
|
2492
|
+
}, deps: ServerProviderDeps): Promise<any>;
|
|
2493
|
+
|
|
2013
2494
|
/**
|
|
2014
2495
|
* Authentication provider interface for VoltAgent server
|
|
2015
2496
|
* Framework-agnostic auth types
|
|
@@ -2232,7 +2713,7 @@ interface ProcessedAgentOptions {
|
|
|
2232
2713
|
seed?: number;
|
|
2233
2714
|
stopSequences?: string[];
|
|
2234
2715
|
maxRetries?: number;
|
|
2235
|
-
|
|
2716
|
+
abortSignal?: AbortSignal;
|
|
2236
2717
|
onFinish?: (result: unknown) => Promise<void>;
|
|
2237
2718
|
[key: string]: any;
|
|
2238
2719
|
}
|
|
@@ -2531,6 +3012,24 @@ declare function createWebSocketServer(deps: ServerProviderDeps, logger: Logger)
|
|
|
2531
3012
|
*/
|
|
2532
3013
|
declare function setupWebSocketUpgrade(server: any, wss: WebSocketServer, pathPrefix?: string): void;
|
|
2533
3014
|
|
|
3015
|
+
/**
|
|
3016
|
+
* WebSocket handler for Observability events
|
|
3017
|
+
* Bridges OpenTelemetry span events to the Console UI
|
|
3018
|
+
*/
|
|
3019
|
+
|
|
3020
|
+
/**
|
|
3021
|
+
* Setup observability event listeners
|
|
3022
|
+
*/
|
|
3023
|
+
declare function setupObservabilityListeners(): void;
|
|
3024
|
+
/**
|
|
3025
|
+
* Handle new WebSocket connection for observability
|
|
3026
|
+
*/
|
|
3027
|
+
declare function handleObservabilityConnection(ws: IWebSocket, request: any, _deps: ServerProviderDeps): void;
|
|
3028
|
+
/**
|
|
3029
|
+
* Close all observability WebSocket connections
|
|
3030
|
+
*/
|
|
3031
|
+
declare function closeAllObservabilityConnections(): void;
|
|
3032
|
+
|
|
2534
3033
|
/**
|
|
2535
3034
|
* Base server provider class
|
|
2536
3035
|
* Framework-agnostic server implementation base
|
|
@@ -2685,4 +3184,4 @@ declare const DEFAULT_CORS_OPTIONS: {
|
|
|
2685
3184
|
credentials: boolean;
|
|
2686
3185
|
};
|
|
2687
3186
|
|
|
2688
|
-
export { AGENT_ROUTES, ALL_ROUTES, AgentListSchema, AgentParamsSchema, AgentResponseSchema, type ApiResponse, type AppSetupConfig, type AuthFrameworkAdapter, type AuthProvider, type BaseCustomEndpointDefinition, type BaseServerConfig, BaseServerProvider, BasicJsonSchema, CustomEndpointError, type CustomEndpointHandler, DEFAULT_CORS_OPTIONS, DEFAULT_PUBLIC_ROUTES, type ErrorResponse, ErrorSchema, GenerateOptionsSchema, type HttpMethod, type IWebSocket, type JWTAuthOptions, LOG_ROUTES, type LogFilterOptions, type LogHandlerResponse, type LogStreamClient, LogStreamManager, ObjectRequestSchema, ObjectResponseSchema, type OpenApiInfo, PROTECTED_ROUTES, ParamsSchema, type PortConfig, type ProcessedAgentOptions, type ResponseDefinition, type RouteDefinition, type ServerProviderConfig, type ServerStartupOptions, StreamObjectEventSchema, type StreamResponse, StreamTextEventSchema, SubAgentResponseSchema, type SuccessResponse, TextRequestSchema, TextResponseSchema, UPDATE_ROUTES, WORKFLOW_ROUTES, type WebSocketAdapter, type WebSocketConnectionHandler, type WebSocketConnectionInfo, type WebSocketEventHandlers, type WebSocketMessage, WebSocketRouter, WorkflowExecutionParamsSchema, WorkflowExecutionRequestSchema, WorkflowExecutionResponseSchema, WorkflowListSchema, WorkflowParamsSchema, WorkflowResponseSchema, WorkflowResumeRequestSchema, WorkflowResumeResponseSchema, WorkflowStreamEventSchema, WorkflowSuspendRequestSchema, WorkflowSuspendResponseSchema, cleanupWebSockets, colors, createAuthErrorResponse, createAuthMiddlewareFactory, createJWT, createSSEHeaders, createSSEResponse, createSSEStream, createUserContext, createWebSocketRouter, createWebSocketServer, extractBearerToken, extractToken, formatSSE, getAllRoutesArray, getLandingPageHTML, getOpenApiDoc, getOrCreateLogger, getPortsToTry, getResponseStatus, getRoutesByTag, handleCheckUpdates, handleExecuteWorkflow, handleGenerateObject, handleGenerateText, handleGetAgent, handleGetAgentHistory, handleGetAgents, handleGetLogs, handleGetWorkflow, handleGetWorkflows, handleInstallUpdates, handleResumeWorkflow, handleStreamObject, handleStreamText, handleStreamWorkflow, handleSuspendWorkflow, handleWebSocketConnection, injectUserIntoBody, isErrorResponse, isSuccessResponse, jwtAuth, mapHandlerResponse, mapLogResponse, pathMatches, portManager, preferredPorts, printServerStartup, processAgentOptions, processWorkflowOptions, requiresAuth, setupWebSocketUpgrade, shouldEnableSwaggerUI, transformToSSE, validateBaseCustomEndpoint, validateEndpointMethod, validateEndpointPath };
|
|
3187
|
+
export { AGENT_ROUTES, ALL_ROUTES, AgentListSchema, AgentParamsSchema, AgentResponseSchema, type ApiResponse, type AppSetupConfig, type AuthFrameworkAdapter, type AuthProvider, type BaseCustomEndpointDefinition, type BaseServerConfig, BaseServerProvider, BasicJsonSchema, CustomEndpointError, type CustomEndpointHandler, DEFAULT_CORS_OPTIONS, DEFAULT_PUBLIC_ROUTES, type ErrorResponse, ErrorSchema, GenerateOptionsSchema, type HttpMethod, type IWebSocket, type JWTAuthOptions, LOG_ROUTES, type LogFilterOptions, type LogHandlerResponse, type LogStreamClient, LogStreamManager, OBSERVABILITY_ROUTES, ObjectRequestSchema, ObjectResponseSchema, type OpenApiInfo, PROTECTED_ROUTES, ParamsSchema, type PortConfig, type ProcessedAgentOptions, type ResponseDefinition, type RouteDefinition, type ServerProviderConfig, type ServerStartupOptions, StreamObjectEventSchema, type StreamResponse, StreamTextEventSchema, SubAgentResponseSchema, type SuccessResponse, TextRequestSchema, TextResponseSchema, UPDATE_ROUTES, WORKFLOW_ROUTES, type WebSocketAdapter, type WebSocketConnectionHandler, type WebSocketConnectionInfo, type WebSocketEventHandlers, type WebSocketMessage, WebSocketRouter, WorkflowExecutionParamsSchema, WorkflowExecutionRequestSchema, WorkflowExecutionResponseSchema, WorkflowListSchema, WorkflowParamsSchema, WorkflowResponseSchema, WorkflowResumeRequestSchema, WorkflowResumeResponseSchema, WorkflowStreamEventSchema, WorkflowSuspendRequestSchema, WorkflowSuspendResponseSchema, cleanupWebSockets, closeAllObservabilityConnections, colors, createAuthErrorResponse, createAuthMiddlewareFactory, createJWT, createSSEHeaders, createSSEResponse, createSSEStream, createUserContext, createWebSocketRouter, createWebSocketServer, extractBearerToken, extractToken, formatSSE, getAllRoutesArray, getLandingPageHTML, getLogsBySpanIdHandler, getLogsByTraceIdHandler, getObservabilityStatusHandler, getOpenApiDoc, getOrCreateLogger, getPortsToTry, getResponseStatus, getRoutesByTag, getSpanByIdHandler, getTraceByIdHandler, getTracesHandler, handleChatStream, handleCheckUpdates, handleExecuteWorkflow, handleGenerateObject, handleGenerateText, handleGetAgent, handleGetAgentHistory, handleGetAgents, handleGetLogs, handleGetWorkflow, handleGetWorkflowState, handleGetWorkflows, handleInstallUpdates, handleObservabilityConnection, handleResumeWorkflow, handleStreamObject, handleStreamText, handleStreamWorkflow, handleSuspendWorkflow, handleWebSocketConnection, injectUserIntoBody, isErrorResponse, isSuccessResponse, jwtAuth, mapHandlerResponse, mapLogResponse, pathMatches, portManager, preferredPorts, printServerStartup, processAgentOptions, processWorkflowOptions, queryLogsHandler, requiresAuth, setupObservabilityHandler, setupObservabilityListeners, setupWebSocketUpgrade, shouldEnableSwaggerUI, transformToSSE, validateBaseCustomEndpoint, validateEndpointMethod, validateEndpointPath };
|