@radaros/transport 0.3.5 → 0.3.6
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.ts +116 -0
- package/dist/index.js +1127 -0
- package/package.json +7 -3
- package/src/a2a/a2a-server.ts +0 -391
- package/src/a2a/agent-card.ts +0 -95
- package/src/a2a/types.ts +0 -11
- package/src/express/file-upload.ts +0 -88
- package/src/express/middleware.ts +0 -15
- package/src/express/router-factory.ts +0 -208
- package/src/express/swagger.ts +0 -476
- package/src/express/types.ts +0 -32
- package/src/index.ts +0 -14
- package/src/socketio/gateway.ts +0 -75
- package/src/socketio/handlers.ts +0 -1
- package/src/socketio/types.ts +0 -9
- package/tsconfig.json +0 -11
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Agent, Team, Workflow, A2AAgentCard } from '@radaros/core';
|
|
2
|
+
|
|
3
|
+
interface FileUploadOptions {
|
|
4
|
+
maxFileSize?: number;
|
|
5
|
+
maxFiles?: number;
|
|
6
|
+
allowedMimeTypes?: string[];
|
|
7
|
+
}
|
|
8
|
+
declare function createFileUploadMiddleware(opts?: FileUploadOptions): any;
|
|
9
|
+
declare function buildMultiModalInput(body: any, files?: any[]): string | any[];
|
|
10
|
+
|
|
11
|
+
interface SwaggerOptions {
|
|
12
|
+
/** Enable Swagger UI at /docs. Default: false */
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
/** API title shown in Swagger UI */
|
|
15
|
+
title?: string;
|
|
16
|
+
/** API description shown in Swagger UI */
|
|
17
|
+
description?: string;
|
|
18
|
+
/** API version string */
|
|
19
|
+
version?: string;
|
|
20
|
+
/** Route prefix used in path generation (e.g. "/api") */
|
|
21
|
+
routePrefix?: string;
|
|
22
|
+
/** Server URLs for the spec */
|
|
23
|
+
servers?: Array<{
|
|
24
|
+
url: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
}>;
|
|
27
|
+
/** Path to serve Swagger UI. Default: "/docs" */
|
|
28
|
+
docsPath?: string;
|
|
29
|
+
/** Path to serve the raw OpenAPI JSON spec. Default: "/docs/spec.json" */
|
|
30
|
+
specPath?: string;
|
|
31
|
+
}
|
|
32
|
+
interface RouterOptions {
|
|
33
|
+
agents?: Record<string, Agent>;
|
|
34
|
+
teams?: Record<string, Team>;
|
|
35
|
+
workflows?: Record<string, Workflow<any>>;
|
|
36
|
+
middleware?: any[];
|
|
37
|
+
/** Swagger / OpenAPI configuration */
|
|
38
|
+
swagger?: SwaggerOptions;
|
|
39
|
+
/** File upload configuration for multi-modal inputs */
|
|
40
|
+
fileUpload?: boolean | FileUploadOptions;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare function createAgentRouter(opts: RouterOptions): any;
|
|
44
|
+
|
|
45
|
+
declare function errorHandler(): (err: any, _req: any, res: any, _next: any) => void;
|
|
46
|
+
declare function requestLogger(): (req: any, _res: any, next: any) => void;
|
|
47
|
+
|
|
48
|
+
interface OpenAPISpec {
|
|
49
|
+
openapi: string;
|
|
50
|
+
info: {
|
|
51
|
+
title: string;
|
|
52
|
+
description: string;
|
|
53
|
+
version: string;
|
|
54
|
+
};
|
|
55
|
+
servers?: Array<{
|
|
56
|
+
url: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
}>;
|
|
59
|
+
paths: Record<string, Record<string, unknown>>;
|
|
60
|
+
components: {
|
|
61
|
+
schemas: Record<string, unknown>;
|
|
62
|
+
securitySchemes?: Record<string, unknown>;
|
|
63
|
+
};
|
|
64
|
+
security?: Array<Record<string, string[]>>;
|
|
65
|
+
tags: Array<{
|
|
66
|
+
name: string;
|
|
67
|
+
description: string;
|
|
68
|
+
}>;
|
|
69
|
+
}
|
|
70
|
+
declare function generateOpenAPISpec(routerOpts: RouterOptions, swaggerOpts?: SwaggerOptions): OpenAPISpec;
|
|
71
|
+
|
|
72
|
+
interface GatewayOptions {
|
|
73
|
+
agents?: Record<string, Agent>;
|
|
74
|
+
teams?: Record<string, Team>;
|
|
75
|
+
io: any;
|
|
76
|
+
namespace?: string;
|
|
77
|
+
authMiddleware?: (socket: any, next: (err?: Error) => void) => void;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
declare function createAgentGateway(opts: GatewayOptions): void;
|
|
81
|
+
|
|
82
|
+
interface A2AServerOptions {
|
|
83
|
+
agents: Record<string, Agent>;
|
|
84
|
+
basePath?: string;
|
|
85
|
+
provider?: {
|
|
86
|
+
organization: string;
|
|
87
|
+
url?: string;
|
|
88
|
+
};
|
|
89
|
+
version?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Mount an A2A-compliant server on an Express app.
|
|
94
|
+
*
|
|
95
|
+
* - Serves `/.well-known/agent.json` with the Agent Card
|
|
96
|
+
* - Handles JSON-RPC 2.0 requests at the basePath for message/send, message/stream, tasks/get, tasks/cancel
|
|
97
|
+
*/
|
|
98
|
+
declare function createA2AServer(app: any, opts: A2AServerOptions): void;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Generate an A2A Agent Card from a RadarOS Agent.
|
|
102
|
+
* The card is served at /.well-known/agent.json per the A2A spec.
|
|
103
|
+
*/
|
|
104
|
+
declare function generateAgentCard(agent: Agent, serverUrl: string, provider?: {
|
|
105
|
+
organization: string;
|
|
106
|
+
url?: string;
|
|
107
|
+
}, version?: string): A2AAgentCard;
|
|
108
|
+
/**
|
|
109
|
+
* Generate a combined Agent Card that lists multiple agents as skills.
|
|
110
|
+
*/
|
|
111
|
+
declare function generateMultiAgentCard(agents: Record<string, Agent>, serverUrl: string, provider?: {
|
|
112
|
+
organization: string;
|
|
113
|
+
url?: string;
|
|
114
|
+
}, version?: string): A2AAgentCard;
|
|
115
|
+
|
|
116
|
+
export { type A2AServerOptions, type FileUploadOptions, type GatewayOptions, type RouterOptions, type SwaggerOptions, buildMultiModalInput, createA2AServer, createAgentGateway, createAgentRouter, createFileUploadMiddleware, errorHandler, generateAgentCard, generateMultiAgentCard, generateOpenAPISpec, requestLogger };
|