@dexto/server 1.2.5

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 (174) hide show
  1. package/LICENSE +44 -0
  2. package/dist/a2a/adapters/index.cjs +42 -0
  3. package/dist/a2a/adapters/index.d.ts +10 -0
  4. package/dist/a2a/adapters/index.d.ts.map +1 -0
  5. package/dist/a2a/adapters/index.js +12 -0
  6. package/dist/a2a/adapters/message.cjs +193 -0
  7. package/dist/a2a/adapters/message.d.ts +50 -0
  8. package/dist/a2a/adapters/message.d.ts.map +1 -0
  9. package/dist/a2a/adapters/message.js +167 -0
  10. package/dist/a2a/adapters/state.cjs +57 -0
  11. package/dist/a2a/adapters/state.d.ts +36 -0
  12. package/dist/a2a/adapters/state.d.ts.map +1 -0
  13. package/dist/a2a/adapters/state.js +32 -0
  14. package/dist/a2a/adapters/task-view.cjs +85 -0
  15. package/dist/a2a/adapters/task-view.d.ts +58 -0
  16. package/dist/a2a/adapters/task-view.d.ts.map +1 -0
  17. package/dist/a2a/adapters/task-view.js +60 -0
  18. package/dist/a2a/index.cjs +51 -0
  19. package/dist/a2a/index.d.ts +15 -0
  20. package/dist/a2a/index.d.ts.map +1 -0
  21. package/dist/a2a/index.js +30 -0
  22. package/dist/a2a/jsonrpc/index.cjs +38 -0
  23. package/dist/a2a/jsonrpc/index.d.ts +11 -0
  24. package/dist/a2a/jsonrpc/index.d.ts.map +1 -0
  25. package/dist/a2a/jsonrpc/index.js +10 -0
  26. package/dist/a2a/jsonrpc/methods.cjs +183 -0
  27. package/dist/a2a/jsonrpc/methods.d.ts +110 -0
  28. package/dist/a2a/jsonrpc/methods.d.ts.map +1 -0
  29. package/dist/a2a/jsonrpc/methods.js +159 -0
  30. package/dist/a2a/jsonrpc/server.cjs +199 -0
  31. package/dist/a2a/jsonrpc/server.d.ts +100 -0
  32. package/dist/a2a/jsonrpc/server.d.ts.map +1 -0
  33. package/dist/a2a/jsonrpc/server.js +175 -0
  34. package/dist/a2a/jsonrpc/types.cjs +47 -0
  35. package/dist/a2a/jsonrpc/types.d.ts +91 -0
  36. package/dist/a2a/jsonrpc/types.d.ts.map +1 -0
  37. package/dist/a2a/jsonrpc/types.js +21 -0
  38. package/dist/a2a/types.cjs +16 -0
  39. package/dist/a2a/types.d.ts +250 -0
  40. package/dist/a2a/types.d.ts.map +1 -0
  41. package/dist/a2a/types.js +0 -0
  42. package/dist/approval/approval-coordinator.cjs +87 -0
  43. package/dist/approval/approval-coordinator.d.ts +52 -0
  44. package/dist/approval/approval-coordinator.d.ts.map +1 -0
  45. package/dist/approval/approval-coordinator.js +63 -0
  46. package/dist/approval/manual-approval-handler.cjs +100 -0
  47. package/dist/approval/manual-approval-handler.d.ts +32 -0
  48. package/dist/approval/manual-approval-handler.d.ts.map +1 -0
  49. package/dist/approval/manual-approval-handler.js +76 -0
  50. package/dist/events/a2a-sse-subscriber.cjs +271 -0
  51. package/dist/events/a2a-sse-subscriber.d.ts +94 -0
  52. package/dist/events/a2a-sse-subscriber.d.ts.map +1 -0
  53. package/dist/events/a2a-sse-subscriber.js +247 -0
  54. package/dist/events/types.cjs +16 -0
  55. package/dist/events/types.d.ts +15 -0
  56. package/dist/events/types.d.ts.map +1 -0
  57. package/dist/events/types.js +0 -0
  58. package/dist/events/webhook-subscriber.cjs +301 -0
  59. package/dist/events/webhook-subscriber.d.ts +64 -0
  60. package/dist/events/webhook-subscriber.d.ts.map +1 -0
  61. package/dist/events/webhook-subscriber.js +269 -0
  62. package/dist/events/webhook-types.cjs +16 -0
  63. package/dist/events/webhook-types.d.ts +91 -0
  64. package/dist/events/webhook-types.d.ts.map +1 -0
  65. package/dist/events/webhook-types.js +0 -0
  66. package/dist/hono/__tests__/test-fixtures.cjs +236 -0
  67. package/dist/hono/__tests__/test-fixtures.d.ts +65 -0
  68. package/dist/hono/__tests__/test-fixtures.d.ts.map +1 -0
  69. package/dist/hono/__tests__/test-fixtures.js +197 -0
  70. package/dist/hono/index.cjs +166 -0
  71. package/dist/hono/index.d.ts +2783 -0
  72. package/dist/hono/index.d.ts.map +1 -0
  73. package/dist/hono/index.js +141 -0
  74. package/dist/hono/middleware/auth.cjs +75 -0
  75. package/dist/hono/middleware/auth.d.ts +3 -0
  76. package/dist/hono/middleware/auth.d.ts.map +1 -0
  77. package/dist/hono/middleware/auth.js +51 -0
  78. package/dist/hono/middleware/cors.cjs +57 -0
  79. package/dist/hono/middleware/cors.d.ts +9 -0
  80. package/dist/hono/middleware/cors.d.ts.map +1 -0
  81. package/dist/hono/middleware/cors.js +33 -0
  82. package/dist/hono/middleware/error.cjs +131 -0
  83. package/dist/hono/middleware/error.d.ts +5 -0
  84. package/dist/hono/middleware/error.d.ts.map +1 -0
  85. package/dist/hono/middleware/error.js +105 -0
  86. package/dist/hono/middleware/redaction.cjs +45 -0
  87. package/dist/hono/middleware/redaction.d.ts +4 -0
  88. package/dist/hono/middleware/redaction.d.ts.map +1 -0
  89. package/dist/hono/middleware/redaction.js +20 -0
  90. package/dist/hono/node/index.cjs +139 -0
  91. package/dist/hono/node/index.d.ts +19 -0
  92. package/dist/hono/node/index.d.ts.map +1 -0
  93. package/dist/hono/node/index.js +115 -0
  94. package/dist/hono/routes/a2a-jsonrpc.cjs +119 -0
  95. package/dist/hono/routes/a2a-jsonrpc.d.ts +46 -0
  96. package/dist/hono/routes/a2a-jsonrpc.d.ts.map +1 -0
  97. package/dist/hono/routes/a2a-jsonrpc.js +95 -0
  98. package/dist/hono/routes/a2a-tasks.cjs +315 -0
  99. package/dist/hono/routes/a2a-tasks.d.ts +530 -0
  100. package/dist/hono/routes/a2a-tasks.d.ts.map +1 -0
  101. package/dist/hono/routes/a2a-tasks.js +291 -0
  102. package/dist/hono/routes/a2a.cjs +36 -0
  103. package/dist/hono/routes/a2a.d.ts +4 -0
  104. package/dist/hono/routes/a2a.d.ts.map +1 -0
  105. package/dist/hono/routes/a2a.js +12 -0
  106. package/dist/hono/routes/agents.cjs +735 -0
  107. package/dist/hono/routes/agents.d.ts +650 -0
  108. package/dist/hono/routes/agents.d.ts.map +1 -0
  109. package/dist/hono/routes/agents.js +711 -0
  110. package/dist/hono/routes/approvals.cjs +125 -0
  111. package/dist/hono/routes/approvals.d.ts +89 -0
  112. package/dist/hono/routes/approvals.d.ts.map +1 -0
  113. package/dist/hono/routes/approvals.js +101 -0
  114. package/dist/hono/routes/greeting.cjs +60 -0
  115. package/dist/hono/routes/greeting.d.ts +19 -0
  116. package/dist/hono/routes/greeting.d.ts.map +1 -0
  117. package/dist/hono/routes/greeting.js +36 -0
  118. package/dist/hono/routes/health.cjs +45 -0
  119. package/dist/hono/routes/health.d.ts +17 -0
  120. package/dist/hono/routes/health.d.ts.map +1 -0
  121. package/dist/hono/routes/health.js +21 -0
  122. package/dist/hono/routes/llm.cjs +298 -0
  123. package/dist/hono/routes/llm.d.ts +294 -0
  124. package/dist/hono/routes/llm.d.ts.map +1 -0
  125. package/dist/hono/routes/llm.js +287 -0
  126. package/dist/hono/routes/mcp.cjs +356 -0
  127. package/dist/hono/routes/mcp.d.ts +246 -0
  128. package/dist/hono/routes/mcp.d.ts.map +1 -0
  129. package/dist/hono/routes/mcp.js +332 -0
  130. package/dist/hono/routes/memory.cjs +192 -0
  131. package/dist/hono/routes/memory.d.ts +146 -0
  132. package/dist/hono/routes/memory.d.ts.map +1 -0
  133. package/dist/hono/routes/memory.js +168 -0
  134. package/dist/hono/routes/messages.cjs +320 -0
  135. package/dist/hono/routes/messages.d.ts +163 -0
  136. package/dist/hono/routes/messages.d.ts.map +1 -0
  137. package/dist/hono/routes/messages.js +296 -0
  138. package/dist/hono/routes/prompts.cjs +228 -0
  139. package/dist/hono/routes/prompts.d.ts +150 -0
  140. package/dist/hono/routes/prompts.d.ts.map +1 -0
  141. package/dist/hono/routes/prompts.js +204 -0
  142. package/dist/hono/routes/resources.cjs +110 -0
  143. package/dist/hono/routes/resources.d.ts +76 -0
  144. package/dist/hono/routes/resources.d.ts.map +1 -0
  145. package/dist/hono/routes/resources.js +86 -0
  146. package/dist/hono/routes/search.cjs +109 -0
  147. package/dist/hono/routes/search.d.ts +137 -0
  148. package/dist/hono/routes/search.d.ts.map +1 -0
  149. package/dist/hono/routes/search.js +85 -0
  150. package/dist/hono/routes/sessions.cjs +366 -0
  151. package/dist/hono/routes/sessions.d.ts +229 -0
  152. package/dist/hono/routes/sessions.d.ts.map +1 -0
  153. package/dist/hono/routes/sessions.js +342 -0
  154. package/dist/hono/routes/webhooks.cjs +228 -0
  155. package/dist/hono/routes/webhooks.d.ts +127 -0
  156. package/dist/hono/routes/webhooks.d.ts.map +1 -0
  157. package/dist/hono/routes/webhooks.js +204 -0
  158. package/dist/hono/schemas/responses.cjs +276 -0
  159. package/dist/hono/schemas/responses.d.ts +1418 -0
  160. package/dist/hono/schemas/responses.d.ts.map +1 -0
  161. package/dist/hono/schemas/responses.js +227 -0
  162. package/dist/hono/types.cjs +16 -0
  163. package/dist/hono/types.d.ts +6 -0
  164. package/dist/hono/types.d.ts.map +1 -0
  165. package/dist/hono/types.js +0 -0
  166. package/dist/index.cjs +38 -0
  167. package/dist/index.d.ts +11 -0
  168. package/dist/index.d.ts.map +1 -0
  169. package/dist/index.js +9 -0
  170. package/dist/mcp/mcp-handler.cjs +145 -0
  171. package/dist/mcp/mcp-handler.d.ts +14 -0
  172. package/dist/mcp/mcp-handler.d.ts.map +1 -0
  173. package/dist/mcp/mcp-handler.js +118 -0
  174. package/package.json +59 -0
@@ -0,0 +1,291 @@
1
+ import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
2
+ import { A2AMethodHandlers } from "../../a2a/jsonrpc/methods.js";
3
+ import { logger } from "@dexto/core";
4
+ import { a2aToInternalMessage } from "../../a2a/adapters/message.js";
5
+ const PartSchema = z.discriminatedUnion("kind", [
6
+ z.object({
7
+ kind: z.literal("text").describe("Part type discriminator"),
8
+ text: z.string().describe("Text content"),
9
+ metadata: z.record(z.any()).optional().describe("Extension metadata")
10
+ }),
11
+ z.object({
12
+ kind: z.literal("file").describe("Part type discriminator"),
13
+ file: z.union([
14
+ z.object({
15
+ bytes: z.string().describe("Base64-encoded file data"),
16
+ name: z.string().optional().describe("File name"),
17
+ mimeType: z.string().optional().describe("MIME type")
18
+ }),
19
+ z.object({
20
+ uri: z.string().describe("File URI"),
21
+ name: z.string().optional().describe("File name"),
22
+ mimeType: z.string().optional().describe("MIME type")
23
+ })
24
+ ]).describe("File data (bytes or URI)"),
25
+ metadata: z.record(z.any()).optional().describe("Extension metadata")
26
+ }),
27
+ z.object({
28
+ kind: z.literal("data").describe("Part type discriminator"),
29
+ data: z.record(z.any()).describe("Structured JSON data"),
30
+ metadata: z.record(z.any()).optional().describe("Extension metadata")
31
+ })
32
+ ]).describe("Message part (text, file, or data)");
33
+ const MessageSchema = z.object({
34
+ role: z.enum(["user", "agent"]).describe("Message role"),
35
+ parts: z.array(PartSchema).describe("Message parts"),
36
+ messageId: z.string().describe("Unique message identifier"),
37
+ taskId: z.string().optional().describe("Associated task ID"),
38
+ contextId: z.string().optional().describe("Context identifier"),
39
+ metadata: z.record(z.any()).optional().describe("Extension metadata"),
40
+ extensions: z.array(z.string()).optional().describe("Extension identifiers"),
41
+ referenceTaskIds: z.array(z.string()).optional().describe("Referenced task IDs"),
42
+ kind: z.literal("message").describe("Object type discriminator")
43
+ }).describe("A2A Protocol message");
44
+ const TaskStatusSchema = z.object({
45
+ state: z.enum([
46
+ "submitted",
47
+ "working",
48
+ "input-required",
49
+ "completed",
50
+ "canceled",
51
+ "failed",
52
+ "rejected",
53
+ "auth-required",
54
+ "unknown"
55
+ ]).describe("Current task state"),
56
+ message: MessageSchema.optional().describe("Status message"),
57
+ timestamp: z.string().optional().describe("ISO 8601 timestamp")
58
+ }).describe("Task status");
59
+ const TaskSchema = z.object({
60
+ id: z.string().describe("Unique task identifier"),
61
+ contextId: z.string().describe("Context identifier across related tasks"),
62
+ status: TaskStatusSchema.describe("Current task status"),
63
+ history: z.array(MessageSchema).optional().describe("Conversation history"),
64
+ artifacts: z.array(z.any()).optional().describe("Task artifacts"),
65
+ metadata: z.record(z.any()).optional().describe("Extension metadata"),
66
+ kind: z.literal("task").describe("Object type discriminator")
67
+ }).describe("A2A Protocol task");
68
+ const MessageSendRequestSchema = z.object({
69
+ message: MessageSchema.describe("Message to send to the agent"),
70
+ configuration: z.object({
71
+ acceptedOutputModes: z.array(z.string()).optional().describe("Accepted output MIME types"),
72
+ historyLength: z.number().optional().describe("Limit conversation history length"),
73
+ pushNotificationConfig: z.object({
74
+ url: z.string().describe("Push notification webhook URL"),
75
+ headers: z.record(z.string()).optional().describe("HTTP headers for webhook")
76
+ }).optional().describe("Push notification configuration"),
77
+ blocking: z.boolean().optional().describe("Wait for task completion")
78
+ }).optional().describe("Optional configuration"),
79
+ metadata: z.record(z.any()).optional().describe("Optional metadata")
80
+ }).describe("Request body for message/send");
81
+ const TaskListQuerySchema = z.object({
82
+ contextId: z.string().optional().describe("Filter by context ID"),
83
+ status: z.enum([
84
+ "submitted",
85
+ "working",
86
+ "input-required",
87
+ "completed",
88
+ "canceled",
89
+ "failed",
90
+ "rejected",
91
+ "auth-required",
92
+ "unknown"
93
+ ]).optional().describe("Filter by task state"),
94
+ pageSize: z.string().optional().transform((v) => {
95
+ if (!v) return void 0;
96
+ const n = Number.parseInt(v, 10);
97
+ if (Number.isNaN(n) || n < 1 || n > 100) return void 0;
98
+ return n;
99
+ }).describe("Number of results (1-100, default 50)"),
100
+ pageToken: z.string().optional().describe("Pagination token (not yet implemented - reserved for future use)"),
101
+ historyLength: z.string().optional().transform((v) => {
102
+ if (!v) return void 0;
103
+ const n = Number.parseInt(v, 10);
104
+ return Number.isNaN(n) ? void 0 : n;
105
+ }).describe("Limit history items (not yet implemented - reserved for future use)"),
106
+ lastUpdatedAfter: z.string().optional().transform((v) => {
107
+ if (!v) return void 0;
108
+ const n = Number.parseInt(v, 10);
109
+ return Number.isNaN(n) ? void 0 : n;
110
+ }).describe("Unix timestamp filter (not yet implemented - reserved for future use)"),
111
+ includeArtifacts: z.string().optional().transform((v) => v === "true").describe(
112
+ "Include artifacts in response (not yet implemented - reserved for future use)"
113
+ )
114
+ }).describe("Query parameters for tasks/list");
115
+ function createA2ATasksRouter(getAgent, sseSubscriber) {
116
+ const app = new OpenAPIHono();
117
+ const messageSendRoute = createRoute({
118
+ method: "post",
119
+ path: "/v1/message:send",
120
+ summary: "Send Message",
121
+ description: "Send a message to the agent (A2A message/send)",
122
+ tags: ["a2a"],
123
+ request: {
124
+ body: {
125
+ content: {
126
+ "application/json": {
127
+ schema: MessageSendRequestSchema
128
+ }
129
+ }
130
+ }
131
+ },
132
+ responses: {
133
+ 200: {
134
+ description: "Task with agent response",
135
+ content: {
136
+ "application/json": {
137
+ schema: TaskSchema
138
+ }
139
+ }
140
+ }
141
+ }
142
+ });
143
+ const listTasksRoute = createRoute({
144
+ method: "get",
145
+ path: "/v1/tasks",
146
+ summary: "List Tasks",
147
+ description: "List all A2A tasks with optional filtering (A2A tasks/list)",
148
+ tags: ["a2a"],
149
+ request: {
150
+ query: TaskListQuerySchema
151
+ },
152
+ responses: {
153
+ 200: {
154
+ description: "Task list",
155
+ content: {
156
+ "application/json": {
157
+ schema: z.object({
158
+ tasks: z.array(TaskSchema).describe("Array of tasks"),
159
+ totalSize: z.number().describe("Total number of tasks"),
160
+ pageSize: z.number().describe("Number of tasks in this page"),
161
+ nextPageToken: z.string().describe("Token for next page")
162
+ }).describe("Response body for tasks/list")
163
+ }
164
+ }
165
+ }
166
+ }
167
+ });
168
+ const getTaskRoute = createRoute({
169
+ method: "get",
170
+ path: "/v1/tasks/{id}",
171
+ summary: "Get Task",
172
+ description: "Retrieve a specific task by ID (A2A tasks/get)",
173
+ tags: ["a2a"],
174
+ request: {
175
+ params: z.object({
176
+ id: z.string().describe("Task ID")
177
+ })
178
+ },
179
+ responses: {
180
+ 200: {
181
+ description: "Task details",
182
+ content: {
183
+ "application/json": {
184
+ schema: TaskSchema
185
+ }
186
+ }
187
+ },
188
+ 404: {
189
+ description: "Task not found"
190
+ }
191
+ }
192
+ });
193
+ const cancelTaskRoute = createRoute({
194
+ method: "post",
195
+ path: "/v1/tasks/{id}:cancel",
196
+ summary: "Cancel Task",
197
+ description: "Cancel a running task (A2A tasks/cancel)",
198
+ tags: ["a2a"],
199
+ request: {
200
+ params: z.object({
201
+ id: z.string().describe("Task ID")
202
+ })
203
+ },
204
+ responses: {
205
+ 200: {
206
+ description: "Task cancelled",
207
+ content: {
208
+ "application/json": {
209
+ schema: TaskSchema
210
+ }
211
+ }
212
+ },
213
+ 404: {
214
+ description: "Task not found"
215
+ }
216
+ }
217
+ });
218
+ app.post("/v1/message:stream", async (ctx) => {
219
+ try {
220
+ const body = await ctx.req.json();
221
+ const parseResult = MessageSendRequestSchema.safeParse(body);
222
+ if (!parseResult.success) {
223
+ return ctx.json(
224
+ {
225
+ error: "Invalid request body",
226
+ details: parseResult.error.issues
227
+ },
228
+ 400
229
+ );
230
+ }
231
+ const validatedBody = parseResult.data;
232
+ logger.info("REST: message/stream", { hasMessage: !!validatedBody.message });
233
+ const taskId = validatedBody.message.taskId;
234
+ const agent = getAgent();
235
+ const session = await agent.createSession(taskId);
236
+ const stream = sseSubscriber.createStream(session.id);
237
+ const { text, image, file } = a2aToInternalMessage(validatedBody.message);
238
+ agent.run(text, image, file, session.id).catch((error) => {
239
+ logger.error(`Error in streaming task ${session.id}: ${error}`);
240
+ });
241
+ logger.info(`REST SSE stream opened for task ${session.id}`);
242
+ return new Response(stream, {
243
+ headers: {
244
+ "Content-Type": "text/event-stream",
245
+ "Cache-Control": "no-cache",
246
+ Connection: "keep-alive",
247
+ "X-Accel-Buffering": "no"
248
+ }
249
+ });
250
+ } catch (error) {
251
+ logger.error(`Failed to handle message:stream: ${error}`);
252
+ return ctx.json({ error: "Failed to initiate streaming" }, 500);
253
+ }
254
+ });
255
+ return app.openapi(messageSendRoute, async (ctx) => {
256
+ const handlers = new A2AMethodHandlers(getAgent());
257
+ const body = ctx.req.valid("json");
258
+ logger.info("REST: message/send", { hasMessage: !!body.message });
259
+ const result = await handlers.messageSend(body);
260
+ return ctx.json(result);
261
+ }).openapi(listTasksRoute, async (ctx) => {
262
+ const handlers = new A2AMethodHandlers(getAgent());
263
+ const query = ctx.req.valid("query");
264
+ const result = await handlers.tasksList(query);
265
+ return ctx.json(result);
266
+ }).openapi(getTaskRoute, async (ctx) => {
267
+ const handlers = new A2AMethodHandlers(getAgent());
268
+ const { id } = ctx.req.valid("param");
269
+ try {
270
+ const task = await handlers.tasksGet({ id });
271
+ return ctx.json(task);
272
+ } catch (error) {
273
+ logger.warn(`Task ${id} not found: ${error}`);
274
+ return ctx.json({ error: "Task not found" }, 404);
275
+ }
276
+ }).openapi(cancelTaskRoute, async (ctx) => {
277
+ const handlers = new A2AMethodHandlers(getAgent());
278
+ const { id } = ctx.req.valid("param");
279
+ logger.info(`REST: tasks/cancel ${id}`);
280
+ try {
281
+ const task = await handlers.tasksCancel({ id });
282
+ return ctx.json(task);
283
+ } catch (error) {
284
+ logger.error(`Failed to cancel task ${id}: ${error}`);
285
+ return ctx.json({ error: "Task not found" }, 404);
286
+ }
287
+ });
288
+ }
289
+ export {
290
+ createA2ATasksRouter
291
+ };
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var a2a_exports = {};
20
+ __export(a2a_exports, {
21
+ createA2aRouter: () => createA2aRouter
22
+ });
23
+ module.exports = __toCommonJS(a2a_exports);
24
+ var import_hono = require("hono");
25
+ function createA2aRouter(getAgentCard) {
26
+ const app = new import_hono.Hono();
27
+ app.get("/.well-known/agent-card.json", (ctx) => {
28
+ const agentCard = getAgentCard();
29
+ return ctx.json(agentCard, 200);
30
+ });
31
+ return app;
32
+ }
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ createA2aRouter
36
+ });
@@ -0,0 +1,4 @@
1
+ import { Hono } from 'hono';
2
+ import type { AgentCard } from '@dexto/core';
3
+ export declare function createA2aRouter(getAgentCard: () => AgentCard): Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
4
+ //# sourceMappingURL=a2a.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a2a.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/a2a.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,SAAS,8EAO5D"}
@@ -0,0 +1,12 @@
1
+ import { Hono } from "hono";
2
+ function createA2aRouter(getAgentCard) {
3
+ const app = new Hono();
4
+ app.get("/.well-known/agent-card.json", (ctx) => {
5
+ const agentCard = getAgentCard();
6
+ return ctx.json(agentCard, 200);
7
+ });
8
+ return app;
9
+ }
10
+ export {
11
+ createA2aRouter
12
+ };