@dexto/server 1.3.0 → 1.4.0

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 (52) hide show
  1. package/dist/approval/manual-approval-handler.cjs +23 -15
  2. package/dist/approval/manual-approval-handler.d.ts.map +1 -1
  3. package/dist/approval/manual-approval-handler.js +23 -15
  4. package/dist/events/webhook-subscriber.cjs +1 -1
  5. package/dist/events/webhook-subscriber.d.ts.map +1 -1
  6. package/dist/events/webhook-subscriber.js +1 -1
  7. package/dist/hono/__tests__/test-fixtures.cjs +2 -2
  8. package/dist/hono/__tests__/test-fixtures.d.ts.map +1 -1
  9. package/dist/hono/__tests__/test-fixtures.js +2 -2
  10. package/dist/hono/index.cjs +6 -1
  11. package/dist/hono/index.d.ts +433 -88
  12. package/dist/hono/index.d.ts.map +1 -1
  13. package/dist/hono/index.js +6 -1
  14. package/dist/hono/middleware/error.d.ts.map +1 -1
  15. package/dist/hono/routes/agents.cjs +8 -10
  16. package/dist/hono/routes/agents.d.ts +15 -8
  17. package/dist/hono/routes/agents.d.ts.map +1 -1
  18. package/dist/hono/routes/agents.js +10 -10
  19. package/dist/hono/routes/approvals.cjs +52 -1
  20. package/dist/hono/routes/approvals.d.ts +25 -0
  21. package/dist/hono/routes/approvals.d.ts.map +1 -1
  22. package/dist/hono/routes/approvals.js +52 -1
  23. package/dist/hono/routes/llm.cjs +110 -31
  24. package/dist/hono/routes/llm.d.ts +72 -20
  25. package/dist/hono/routes/llm.d.ts.map +1 -1
  26. package/dist/hono/routes/llm.js +108 -25
  27. package/dist/hono/routes/mcp.cjs +8 -4
  28. package/dist/hono/routes/mcp.d.ts +4 -1
  29. package/dist/hono/routes/mcp.d.ts.map +1 -1
  30. package/dist/hono/routes/mcp.js +9 -5
  31. package/dist/hono/routes/memory.d.ts +1 -1
  32. package/dist/hono/routes/messages.cjs +54 -62
  33. package/dist/hono/routes/messages.d.ts +87 -43
  34. package/dist/hono/routes/messages.d.ts.map +1 -1
  35. package/dist/hono/routes/messages.js +55 -63
  36. package/dist/hono/routes/prompts.d.ts +6 -6
  37. package/dist/hono/routes/queue.cjs +202 -0
  38. package/dist/hono/routes/queue.d.ts +171 -0
  39. package/dist/hono/routes/queue.d.ts.map +1 -0
  40. package/dist/hono/routes/queue.js +178 -0
  41. package/dist/hono/routes/resources.d.ts +1 -1
  42. package/dist/hono/routes/search.d.ts +33 -7
  43. package/dist/hono/routes/search.d.ts.map +1 -1
  44. package/dist/hono/routes/sessions.cjs +65 -11
  45. package/dist/hono/routes/sessions.d.ts +22 -1
  46. package/dist/hono/routes/sessions.d.ts.map +1 -1
  47. package/dist/hono/routes/sessions.js +65 -11
  48. package/dist/hono/schemas/responses.cjs +24 -5
  49. package/dist/hono/schemas/responses.d.ts +799 -81
  50. package/dist/hono/schemas/responses.d.ts.map +1 -1
  51. package/dist/hono/schemas/responses.js +24 -10
  52. package/package.json +3 -3
@@ -9,6 +9,7 @@ export declare function createMcpRouter(getAgent: () => DextoAgent): OpenAPIHono
9
9
  type: "stdio";
10
10
  command: string;
11
11
  timeout?: number | undefined;
12
+ enabled?: boolean | undefined;
12
13
  args?: string[] | undefined;
13
14
  env?: Record<string, string> | undefined;
14
15
  connectionMode?: "strict" | "lenient" | undefined;
@@ -16,12 +17,14 @@ export declare function createMcpRouter(getAgent: () => DextoAgent): OpenAPIHono
16
17
  type: "sse";
17
18
  url: string;
18
19
  timeout?: number | undefined;
20
+ enabled?: boolean | undefined;
19
21
  connectionMode?: "strict" | "lenient" | undefined;
20
22
  headers?: Record<string, string> | undefined;
21
23
  } | {
22
24
  type: "http";
23
25
  url: string;
24
26
  timeout?: number | undefined;
27
+ enabled?: boolean | undefined;
25
28
  connectionMode?: "strict" | "lenient" | undefined;
26
29
  headers?: Record<string, string> | undefined;
27
30
  };
@@ -200,10 +203,10 @@ export declare function createMcpRouter(getAgent: () => DextoAgent): OpenAPIHono
200
203
  source: "mcp" | "internal";
201
204
  description?: string | undefined;
202
205
  mimeType?: string | undefined;
203
- name?: string | undefined;
204
206
  metadata?: {
205
207
  [x: string]: import("hono/utils/types").JSONValue;
206
208
  } | undefined;
209
+ name?: string | undefined;
207
210
  serverName?: string | undefined;
208
211
  size?: number | undefined;
209
212
  lastModified?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA0I9C,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA4SzD"}
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA0I9C,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAkTzD"}
@@ -1,5 +1,5 @@
1
1
  import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
2
- import { logger, McpServerConfigSchema } from "@dexto/core";
2
+ import { logger, McpServerConfigSchema, MCP_CONNECTION_STATUSES } from "@dexto/core";
3
3
  import { updateAgentConfigFile } from "@dexto/agent-management";
4
4
  import { ResourceSchema } from "../schemas/responses.js";
5
5
  const McpServerRequestSchema = z.object({
@@ -17,7 +17,7 @@ const ServerStatusResponseSchema = z.object({
17
17
  const ServerInfoSchema = z.object({
18
18
  id: z.string().describe("Server identifier"),
19
19
  name: z.string().describe("Server name"),
20
- status: z.enum(["connected", "error", "disconnected"]).describe("Server status")
20
+ status: z.enum(MCP_CONNECTION_STATUSES).describe("Server status")
21
21
  }).strict().describe("MCP server information");
22
22
  const ServersListResponseSchema = z.object({
23
23
  servers: z.array(ServerInfoSchema).describe("Array of server information")
@@ -207,8 +207,11 @@ function createMcpRouter(getAgent) {
207
207
  return app.openapi(addServerRoute, async (ctx) => {
208
208
  const agent = getAgent();
209
209
  const { name, config, persistToAgent } = ctx.req.valid("json");
210
- await agent.connectMcpServer(name, config);
211
- logger.info(`Successfully connected to new server '${name}' via API request.`);
210
+ await agent.addMcpServer(name, config);
211
+ const isConnected = config.enabled !== false;
212
+ logger.info(
213
+ isConnected ? `Successfully connected to new server '${name}' via API request.` : `Registered server '${name}' (disabled) via API request.`
214
+ );
212
215
  if (persistToAgent === true) {
213
216
  try {
214
217
  const currentConfig = agent.getEffectiveConfig();
@@ -239,7 +242,8 @@ function createMcpRouter(getAgent) {
239
242
  );
240
243
  }
241
244
  }
242
- return ctx.json({ status: "connected", name }, 200);
245
+ const status = isConnected ? "connected" : "registered";
246
+ return ctx.json({ status, name }, 200);
243
247
  }).openapi(listServersRoute, async (ctx) => {
244
248
  const agent = getAgent();
245
249
  const clientsMap = agent.getMcpClients();
@@ -99,11 +99,11 @@ export declare function createMemoryRouter(getAgent: () => DextoAgent): OpenAPIH
99
99
  };
100
100
  } & {
101
101
  json: {
102
+ content?: string | undefined;
102
103
  metadata?: z.objectInputType<{
103
104
  source: z.ZodOptional<z.ZodEnum<["user", "system"]>>;
104
105
  pinned: z.ZodOptional<z.ZodBoolean>;
105
106
  }, z.ZodTypeAny, "passthrough"> | undefined;
106
- content?: string | undefined;
107
107
  tags?: string[] | undefined;
108
108
  };
109
109
  };
@@ -25,25 +25,26 @@ var import_zod_openapi = require("@hono/zod-openapi");
25
25
  var import_streaming = require("hono/streaming");
26
26
  var import_core = require("@dexto/core");
27
27
  var import_responses = require("../schemas/responses.js");
28
+ const TextPartSchema = import_zod_openapi.z.object({
29
+ type: import_zod_openapi.z.literal("text").describe("Content type identifier"),
30
+ text: import_zod_openapi.z.string().describe("Text content")
31
+ }).describe("Text content part");
32
+ const ImagePartSchema = import_zod_openapi.z.object({
33
+ type: import_zod_openapi.z.literal("image").describe("Content type identifier"),
34
+ image: import_zod_openapi.z.string().describe("Base64-encoded image data or URL"),
35
+ mimeType: import_zod_openapi.z.string().optional().describe("MIME type (e.g., image/png)")
36
+ }).describe("Image content part");
37
+ const FilePartSchema = import_zod_openapi.z.object({
38
+ type: import_zod_openapi.z.literal("file").describe("Content type identifier"),
39
+ data: import_zod_openapi.z.string().describe("Base64-encoded file data or URL"),
40
+ mimeType: import_zod_openapi.z.string().describe("MIME type (e.g., application/pdf)"),
41
+ filename: import_zod_openapi.z.string().optional().describe("Optional filename")
42
+ }).describe("File content part");
43
+ const ContentPartSchema = import_zod_openapi.z.discriminatedUnion("type", [TextPartSchema, ImagePartSchema, FilePartSchema]).describe("Content part - text, image, or file");
28
44
  const MessageBodySchema = import_zod_openapi.z.object({
29
- message: import_zod_openapi.z.string().optional().describe("The user message text"),
30
- sessionId: import_zod_openapi.z.string().min(1, "Session ID is required").describe("The session to use for this message"),
31
- imageData: import_zod_openapi.z.object({
32
- image: import_zod_openapi.z.string().describe("Base64-encoded image data"),
33
- mimeType: import_zod_openapi.z.string().describe("The MIME type of the image (e.g., image/png)")
34
- }).optional().describe("Optional image data to include with the message"),
35
- fileData: import_zod_openapi.z.object({
36
- data: import_zod_openapi.z.string().describe("Base64-encoded file data"),
37
- mimeType: import_zod_openapi.z.string().describe("The MIME type of the file (e.g., application/pdf)"),
38
- filename: import_zod_openapi.z.string().optional().describe("The filename")
39
- }).optional().describe("Optional file data to include with the message")
40
- }).refine(
41
- (data) => {
42
- const msg = (data.message ?? "").trim();
43
- return msg.length > 0 || !!data.imageData || !!data.fileData;
44
- },
45
- { message: "Must provide either message text, image data, or file data" }
46
- ).describe("Request body for sending a message to the agent");
45
+ content: import_zod_openapi.z.union([import_zod_openapi.z.string(), import_zod_openapi.z.array(ContentPartSchema)]).describe("Message content - string for text, or ContentPart[] for multimodal"),
46
+ sessionId: import_zod_openapi.z.string().min(1, "Session ID is required").describe("The session to use for this message")
47
+ }).describe("Request body for sending a message to the agent");
47
48
  const ResetBodySchema = import_zod_openapi.z.object({
48
49
  sessionId: import_zod_openapi.z.string().min(1, "Session ID is required").describe("The ID of the session to reset")
49
50
  }).describe("Request body for resetting a conversation");
@@ -95,8 +96,7 @@ function createMessagesRouter(getAgent, approvalCoordinator) {
95
96
  tokenUsage: import_responses.TokenUsageSchema.optional().describe("Token usage statistics"),
96
97
  reasoning: import_zod_openapi.z.string().optional().describe("Extended thinking content from reasoning models"),
97
98
  model: import_zod_openapi.z.string().optional().describe("Model used for this response"),
98
- provider: import_zod_openapi.z.enum(import_core.LLM_PROVIDERS).optional().describe("LLM provider"),
99
- router: import_zod_openapi.z.enum(import_core.LLM_ROUTERS).optional().describe("Router used (e.g., vercel)")
99
+ provider: import_zod_openapi.z.enum(import_core.LLM_PROVIDERS).optional().describe("LLM provider")
100
100
  }).strict()
101
101
  }
102
102
  }
@@ -131,7 +131,7 @@ function createMessagesRouter(getAgent, approvalCoordinator) {
131
131
  method: "post",
132
132
  path: "/message-stream",
133
133
  summary: "Stream message response",
134
- description: "Sends a message and streams the response via Server-Sent Events (SSE). Returns SSE stream directly in response. Events include llm:thinking, llm:chunk, llm:tool-call, llm:tool-result, llm:response, and llm:error.",
134
+ description: "Sends a message and streams the response via Server-Sent Events (SSE). Returns SSE stream directly in response. Events include llm:thinking, llm:chunk, llm:tool-call, llm:tool-result, llm:response, and llm:error. If the session is busy processing another message, returns 202 with queue information.",
135
135
  tags: ["messages"],
136
136
  request: {
137
137
  body: {
@@ -167,23 +167,28 @@ function createMessagesRouter(getAgent, approvalCoordinator) {
167
167
  }
168
168
  }
169
169
  },
170
+ 202: {
171
+ description: "Session is busy processing another message. Use the queue endpoints to manage pending messages.",
172
+ content: {
173
+ "application/json": {
174
+ schema: import_zod_openapi.z.object({
175
+ busy: import_zod_openapi.z.literal(true).describe("Indicates session is busy"),
176
+ sessionId: import_zod_openapi.z.string().describe("The session ID"),
177
+ queueLength: import_zod_openapi.z.number().describe("Current number of messages in queue"),
178
+ hint: import_zod_openapi.z.string().describe("Instructions for the client")
179
+ }).strict()
180
+ }
181
+ }
182
+ },
170
183
  400: { description: "Validation error" }
171
184
  }
172
185
  });
173
186
  return app.openapi(messageRoute, async (ctx) => {
174
187
  const agent = getAgent();
175
188
  agent.logger.info("Received message via POST /api/message");
176
- const { message, sessionId, imageData, fileData } = ctx.req.valid("json");
177
- const imageDataInput = imageData ? { image: imageData.image, mimeType: imageData.mimeType } : void 0;
178
- const fileDataInput = fileData ? {
179
- data: fileData.data,
180
- mimeType: fileData.mimeType,
181
- ...fileData.filename && { filename: fileData.filename }
182
- } : void 0;
183
- if (imageDataInput) agent.logger.info("Image data included in message.");
184
- if (fileDataInput) agent.logger.info("File data included in message.");
189
+ const { content, sessionId } = ctx.req.valid("json");
185
190
  agent.logger.info(`Message for session: ${sessionId}`);
186
- agent.run(message || "", imageDataInput, fileDataInput, sessionId, false).catch((error) => {
191
+ agent.generate(content, sessionId).catch((error) => {
187
192
  agent.logger.error(
188
193
  `Error in async message processing: ${error instanceof Error ? error.message : String(error)}`
189
194
  );
@@ -192,21 +197,9 @@ function createMessagesRouter(getAgent, approvalCoordinator) {
192
197
  }).openapi(messageSyncRoute, async (ctx) => {
193
198
  const agent = getAgent();
194
199
  agent.logger.info("Received message via POST /api/message-sync");
195
- const { message, sessionId, imageData, fileData } = ctx.req.valid("json");
196
- const imageDataInput = imageData ? { image: imageData.image, mimeType: imageData.mimeType } : void 0;
197
- const fileDataInput = fileData ? {
198
- data: fileData.data,
199
- mimeType: fileData.mimeType,
200
- ...fileData.filename && { filename: fileData.filename }
201
- } : void 0;
202
- if (imageDataInput) agent.logger.info("Image data included in message.");
203
- if (fileDataInput) agent.logger.info("File data included in message.");
200
+ const { content, sessionId } = ctx.req.valid("json");
204
201
  agent.logger.info(`Message for session: ${sessionId}`);
205
- const result = await agent.generate(message || "", {
206
- sessionId,
207
- imageData: imageDataInput,
208
- fileData: fileDataInput
209
- });
202
+ const result = await agent.generate(content, sessionId);
210
203
  const llmConfig = agent.stateManager.getLLMConfig(sessionId);
211
204
  return ctx.json({
212
205
  response: result.content,
@@ -214,9 +207,7 @@ function createMessagesRouter(getAgent, approvalCoordinator) {
214
207
  tokenUsage: result.usage,
215
208
  reasoning: result.reasoning,
216
209
  model: llmConfig.model,
217
- provider: llmConfig.provider,
218
- router: "vercel"
219
- // Hardcoded for now since we only use Vercel AI SDK
210
+ provider: llmConfig.provider
220
211
  });
221
212
  }).openapi(resetRoute, async (ctx) => {
222
213
  const agent = getAgent();
@@ -226,22 +217,23 @@ function createMessagesRouter(getAgent, approvalCoordinator) {
226
217
  return ctx.json({ status: "reset initiated", sessionId });
227
218
  }).openapi(messageStreamRoute, async (ctx) => {
228
219
  const agent = getAgent();
229
- const body = ctx.req.valid("json");
230
- const { message = "", sessionId, imageData, fileData } = body;
231
- const imageDataInput = imageData ? { image: imageData.image, mimeType: imageData.mimeType } : void 0;
232
- const fileDataInput = fileData ? {
233
- data: fileData.data,
234
- mimeType: fileData.mimeType,
235
- ...fileData.filename && { filename: fileData.filename }
236
- } : void 0;
220
+ const { content, sessionId } = ctx.req.valid("json");
221
+ const isBusy = await agent.isSessionBusy(sessionId);
222
+ if (isBusy) {
223
+ const queuedMessages = await agent.getQueuedMessages(sessionId);
224
+ return ctx.json(
225
+ {
226
+ busy: true,
227
+ sessionId,
228
+ queueLength: queuedMessages.length,
229
+ hint: "Use POST /api/queue/{sessionId} to queue this message, or wait for the current request to complete."
230
+ },
231
+ 202
232
+ );
233
+ }
237
234
  const abortController = new AbortController();
238
235
  const { signal } = abortController;
239
- const iterator = await agent.stream(message, {
240
- sessionId,
241
- imageData: imageDataInput,
242
- fileData: fileDataInput,
243
- signal
244
- });
236
+ const iterator = await agent.stream(content, sessionId, { signal });
245
237
  return (0, import_streaming.streamSSE)(ctx, async (stream) => {
246
238
  const pendingApprovalEvents = [];
247
239
  if (approvalCoordinator) {
@@ -6,17 +6,20 @@ export declare function createMessagesRouter(getAgent: () => DextoAgent, approva
6
6
  $post: {
7
7
  input: {
8
8
  json: {
9
- sessionId: string;
10
- message?: string | undefined;
11
- imageData?: {
9
+ content: string | ({
10
+ type: "text";
11
+ text: string;
12
+ } | {
13
+ type: "image";
12
14
  image: string;
13
- mimeType: string;
14
- } | undefined;
15
- fileData?: {
15
+ mimeType?: string | undefined;
16
+ } | {
17
+ type: "file";
16
18
  mimeType: string;
17
19
  data: string;
18
20
  filename?: string | undefined;
19
- } | undefined;
21
+ })[];
22
+ sessionId: string;
20
23
  };
21
24
  };
22
25
  output: {
@@ -28,17 +31,20 @@ export declare function createMessagesRouter(getAgent: () => DextoAgent, approva
28
31
  } | {
29
32
  input: {
30
33
  json: {
31
- sessionId: string;
32
- message?: string | undefined;
33
- imageData?: {
34
+ content: string | ({
35
+ type: "text";
36
+ text: string;
37
+ } | {
38
+ type: "image";
34
39
  image: string;
35
- mimeType: string;
36
- } | undefined;
37
- fileData?: {
40
+ mimeType?: string | undefined;
41
+ } | {
42
+ type: "file";
38
43
  mimeType: string;
39
44
  data: string;
40
45
  filename?: string | undefined;
41
- } | undefined;
46
+ })[];
47
+ sessionId: string;
42
48
  };
43
49
  };
44
50
  output: {};
@@ -51,17 +57,20 @@ export declare function createMessagesRouter(getAgent: () => DextoAgent, approva
51
57
  $post: {
52
58
  input: {
53
59
  json: {
54
- sessionId: string;
55
- message?: string | undefined;
56
- imageData?: {
60
+ content: string | ({
61
+ type: "text";
62
+ text: string;
63
+ } | {
64
+ type: "image";
57
65
  image: string;
58
- mimeType: string;
59
- } | undefined;
60
- fileData?: {
66
+ mimeType?: string | undefined;
67
+ } | {
68
+ type: "file";
61
69
  mimeType: string;
62
70
  data: string;
63
71
  filename?: string | undefined;
64
- } | undefined;
72
+ })[];
73
+ sessionId: string;
65
74
  };
66
75
  };
67
76
  output: {};
@@ -70,17 +79,20 @@ export declare function createMessagesRouter(getAgent: () => DextoAgent, approva
70
79
  } | {
71
80
  input: {
72
81
  json: {
73
- sessionId: string;
74
- message?: string | undefined;
75
- imageData?: {
82
+ content: string | ({
83
+ type: "text";
84
+ text: string;
85
+ } | {
86
+ type: "image";
76
87
  image: string;
77
- mimeType: string;
78
- } | undefined;
79
- fileData?: {
88
+ mimeType?: string | undefined;
89
+ } | {
90
+ type: "file";
80
91
  mimeType: string;
81
92
  data: string;
82
93
  filename?: string | undefined;
83
- } | undefined;
94
+ })[];
95
+ sessionId: string;
84
96
  };
85
97
  };
86
98
  output: {
@@ -95,7 +107,6 @@ export declare function createMessagesRouter(getAgent: () => DextoAgent, approva
95
107
  } | undefined;
96
108
  model?: string | undefined;
97
109
  provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
98
- router?: "vercel" | "in-built" | undefined;
99
110
  };
100
111
  outputFormat: "json";
101
112
  status: 200;
@@ -122,17 +133,20 @@ export declare function createMessagesRouter(getAgent: () => DextoAgent, approva
122
133
  $post: {
123
134
  input: {
124
135
  json: {
125
- sessionId: string;
126
- message?: string | undefined;
127
- imageData?: {
136
+ content: string | ({
137
+ type: "text";
138
+ text: string;
139
+ } | {
140
+ type: "image";
128
141
  image: string;
129
- mimeType: string;
130
- } | undefined;
131
- fileData?: {
142
+ mimeType?: string | undefined;
143
+ } | {
144
+ type: "file";
132
145
  mimeType: string;
133
146
  data: string;
134
147
  filename?: string | undefined;
135
- } | undefined;
148
+ })[];
149
+ sessionId: string;
136
150
  };
137
151
  };
138
152
  output: Response;
@@ -141,22 +155,52 @@ export declare function createMessagesRouter(getAgent: () => DextoAgent, approva
141
155
  } | {
142
156
  input: {
143
157
  json: {
144
- sessionId: string;
145
- message?: string | undefined;
146
- imageData?: {
158
+ content: string | ({
159
+ type: "text";
160
+ text: string;
161
+ } | {
162
+ type: "image";
147
163
  image: string;
148
- mimeType: string;
149
- } | undefined;
150
- fileData?: {
164
+ mimeType?: string | undefined;
165
+ } | {
166
+ type: "file";
151
167
  mimeType: string;
152
168
  data: string;
153
169
  filename?: string | undefined;
154
- } | undefined;
170
+ })[];
171
+ sessionId: string;
155
172
  };
156
173
  };
157
174
  output: {};
158
175
  outputFormat: string;
159
176
  status: 400;
177
+ } | {
178
+ input: {
179
+ json: {
180
+ content: string | ({
181
+ type: "text";
182
+ text: string;
183
+ } | {
184
+ type: "image";
185
+ image: string;
186
+ mimeType?: string | undefined;
187
+ } | {
188
+ type: "file";
189
+ mimeType: string;
190
+ data: string;
191
+ filename?: string | undefined;
192
+ })[];
193
+ sessionId: string;
194
+ };
195
+ };
196
+ output: {
197
+ sessionId: string;
198
+ busy: true;
199
+ queueLength: number;
200
+ hint: string;
201
+ };
202
+ outputFormat: "json";
203
+ status: 202;
160
204
  };
161
205
  };
162
206
  }, "/">;
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AAEhE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AA4ClF,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,MAAM,UAAU,EAC1B,mBAAmB,CAAC,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAoW5C"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AAEhE,OAAO,KAAK,EAAE,UAAU,EAAgB,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AA2DlF,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,MAAM,UAAU,EAC1B,mBAAmB,CAAC,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA0U5C"}