@dexto/server 1.6.19 → 1.6.21
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/a2a/jsonrpc/methods.cjs +1 -1
- package/dist/a2a/jsonrpc/methods.d.ts +14 -4
- package/dist/a2a/jsonrpc/methods.d.ts.map +1 -1
- package/dist/a2a/jsonrpc/methods.js +1 -1
- package/dist/hono/index.cjs +39 -8
- package/dist/hono/index.d.ts +43 -4503
- package/dist/hono/index.d.ts.map +1 -1
- package/dist/hono/index.js +42 -9
- package/dist/hono/routes/a2a-jsonrpc.d.ts.map +1 -1
- package/dist/hono/routes/a2a-tasks.cjs +173 -34
- package/dist/hono/routes/a2a-tasks.d.ts +1 -498
- package/dist/hono/routes/a2a-tasks.d.ts.map +1 -1
- package/dist/hono/routes/a2a-tasks.js +177 -34
- package/dist/hono/routes/a2a.d.ts.map +1 -1
- package/dist/hono/routes/agents.cjs +410 -329
- package/dist/hono/routes/agents.d.ts +16048 -73
- package/dist/hono/routes/agents.d.ts.map +1 -1
- package/dist/hono/routes/agents.js +418 -330
- package/dist/hono/routes/approvals.cjs +103 -78
- package/dist/hono/routes/approvals.d.ts +2090 -112
- package/dist/hono/routes/approvals.d.ts.map +1 -1
- package/dist/hono/routes/approvals.js +108 -78
- package/dist/hono/routes/dexto-auth.cjs +40 -33
- package/dist/hono/routes/dexto-auth.d.ts +401 -2
- package/dist/hono/routes/dexto-auth.d.ts.map +1 -1
- package/dist/hono/routes/dexto-auth.js +40 -33
- package/dist/hono/routes/discovery.cjs +16 -14
- package/dist/hono/routes/discovery.d.ts +586 -1
- package/dist/hono/routes/discovery.d.ts.map +1 -1
- package/dist/hono/routes/discovery.js +16 -14
- package/dist/hono/routes/greeting.cjs +26 -22
- package/dist/hono/routes/greeting.d.ts +787 -3
- package/dist/hono/routes/greeting.d.ts.map +1 -1
- package/dist/hono/routes/greeting.js +26 -22
- package/dist/hono/routes/health.d.ts +1 -1
- package/dist/hono/routes/key.cjs +60 -52
- package/dist/hono/routes/key.d.ts +1597 -1
- package/dist/hono/routes/key.d.ts.map +1 -1
- package/dist/hono/routes/key.js +60 -52
- package/dist/hono/routes/llm.cjs +381 -348
- package/dist/hono/routes/llm.d.ts +12137 -87
- package/dist/hono/routes/llm.d.ts.map +1 -1
- package/dist/hono/routes/llm.js +385 -348
- package/dist/hono/routes/mcp.cjs +273 -212
- package/dist/hono/routes/mcp.d.ts +6605 -316
- package/dist/hono/routes/mcp.d.ts.map +1 -1
- package/dist/hono/routes/mcp.js +287 -213
- package/dist/hono/routes/memory.cjs +102 -89
- package/dist/hono/routes/memory.d.ts +5368 -4
- package/dist/hono/routes/memory.d.ts.map +1 -1
- package/dist/hono/routes/memory.js +108 -90
- package/dist/hono/routes/messages.cjs +171 -164
- package/dist/hono/routes/messages.d.ts +3899 -10
- package/dist/hono/routes/messages.d.ts.map +1 -1
- package/dist/hono/routes/messages.js +181 -165
- package/dist/hono/routes/models.cjs +106 -64
- package/dist/hono/routes/models.d.ts +2874 -1
- package/dist/hono/routes/models.d.ts.map +1 -1
- package/dist/hono/routes/models.js +108 -64
- package/dist/hono/routes/openrouter.cjs +79 -65
- package/dist/hono/routes/openrouter.d.ts +854 -1
- package/dist/hono/routes/openrouter.d.ts.map +1 -1
- package/dist/hono/routes/openrouter.js +79 -65
- package/dist/hono/routes/prompts.cjs +137 -104
- package/dist/hono/routes/prompts.d.ts +2820 -12
- package/dist/hono/routes/prompts.d.ts.map +1 -1
- package/dist/hono/routes/prompts.js +144 -105
- package/dist/hono/routes/queue.cjs +158 -132
- package/dist/hono/routes/queue.d.ts +5148 -13
- package/dist/hono/routes/queue.d.ts.map +1 -1
- package/dist/hono/routes/queue.js +168 -133
- package/dist/hono/routes/resources.cjs +65 -46
- package/dist/hono/routes/resources.d.ts +1983 -5
- package/dist/hono/routes/resources.d.ts.map +1 -1
- package/dist/hono/routes/resources.js +72 -47
- package/dist/hono/routes/schedules.cjs +233 -226
- package/dist/hono/routes/schedules.d.ts +4202 -26
- package/dist/hono/routes/schedules.d.ts.map +1 -1
- package/dist/hono/routes/schedules.js +233 -226
- package/dist/hono/routes/search.cjs +34 -30
- package/dist/hono/routes/search.d.ts +2837 -14
- package/dist/hono/routes/search.d.ts.map +1 -1
- package/dist/hono/routes/search.js +40 -31
- package/dist/hono/routes/sessions.cjs +404 -392
- package/dist/hono/routes/sessions.d.ts +16585 -30
- package/dist/hono/routes/sessions.d.ts.map +1 -1
- package/dist/hono/routes/sessions.js +408 -393
- package/dist/hono/routes/static.d.ts.map +1 -1
- package/dist/hono/routes/system-prompt.cjs +57 -61
- package/dist/hono/routes/system-prompt.d.ts +1228 -2
- package/dist/hono/routes/system-prompt.d.ts.map +1 -1
- package/dist/hono/routes/system-prompt.js +58 -62
- package/dist/hono/routes/tools.cjs +29 -34
- package/dist/hono/routes/tools.d.ts +1756 -7
- package/dist/hono/routes/tools.d.ts.map +1 -1
- package/dist/hono/routes/tools.js +33 -33
- package/dist/hono/routes/webhooks.cjs +159 -132
- package/dist/hono/routes/webhooks.d.ts +2504 -14
- package/dist/hono/routes/webhooks.d.ts.map +1 -1
- package/dist/hono/routes/webhooks.js +163 -132
- package/dist/hono/routes/workspaces.cjs +84 -79
- package/dist/hono/routes/workspaces.d.ts +2093 -2
- package/dist/hono/routes/workspaces.d.ts.map +1 -1
- package/dist/hono/routes/workspaces.js +89 -80
- package/dist/hono/schemas/responses.cjs +492 -235
- package/dist/hono/schemas/responses.d.ts +1461 -146
- package/dist/hono/schemas/responses.d.ts.map +1 -1
- package/dist/hono/schemas/responses.js +247 -9
- package/dist/hono/types.d.ts +11 -0
- package/dist/hono/types.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../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E,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;CAAE,EAC3C,0BAA0B,CAAC,OAAO,kBAAkB,CAAC,CACxD,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC1B,kBAAkB,GAClB,sBAAsB,GACtB,gBAAgB,GAChB,wBAAwB,CAAC"}
|
|
@@ -1,177 +1,188 @@
|
|
|
1
1
|
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
|
|
2
2
|
import { streamSSE } from "hono/streaming";
|
|
3
3
|
import { LLM_PROVIDERS } from "@dexto/core";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
const FilePartSchema = z.object({
|
|
15
|
-
type: z.literal("file").describe("Content type identifier"),
|
|
16
|
-
data: z.string().describe("Base64-encoded file data or URL"),
|
|
17
|
-
mimeType: z.string().describe("MIME type (e.g., application/pdf)"),
|
|
18
|
-
filename: z.string().optional().describe("Optional filename")
|
|
19
|
-
}).describe("File content part");
|
|
20
|
-
const ContentPartSchema = z.discriminatedUnion("type", [TextPartSchema, ImagePartSchema, FilePartSchema]).describe("Content part - text, image, or file");
|
|
4
|
+
import {
|
|
5
|
+
ApiErrorResponseSchema,
|
|
6
|
+
BadRequestErrorResponse,
|
|
7
|
+
InternalErrorResponse,
|
|
8
|
+
NotFoundErrorResponse,
|
|
9
|
+
PricingStatusSchema,
|
|
10
|
+
RequestContentSchema,
|
|
11
|
+
TokenUsageSchema,
|
|
12
|
+
toContentInput
|
|
13
|
+
} from "../schemas/responses.js";
|
|
21
14
|
const MessageBodySchema = z.object({
|
|
22
|
-
content:
|
|
15
|
+
content: RequestContentSchema,
|
|
23
16
|
sessionId: z.string().min(1, "Session ID is required").describe("The session to use for this message")
|
|
24
17
|
}).describe("Request body for sending a message to the agent");
|
|
25
18
|
const ResetBodySchema = z.object({
|
|
26
19
|
sessionId: z.string().min(1, "Session ID is required").describe("The ID of the session to reset")
|
|
27
20
|
}).describe("Request body for resetting a conversation");
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
21
|
+
const MessageAcceptedResponseSchema = z.object({
|
|
22
|
+
accepted: z.literal(true).describe("Indicates request was accepted"),
|
|
23
|
+
sessionId: z.string().describe("Session ID used for this message")
|
|
24
|
+
}).strict().describe("Asynchronous message acceptance response");
|
|
25
|
+
const MessageSyncResponseSchema = z.object({
|
|
26
|
+
response: z.string().describe("Agent response text"),
|
|
27
|
+
sessionId: z.string().describe("Session ID used for this message"),
|
|
28
|
+
tokenUsage: TokenUsageSchema.optional().describe("Token usage statistics"),
|
|
29
|
+
messageId: z.string().uuid().optional().describe("Assistant message ID for this response"),
|
|
30
|
+
usageScopeId: z.string().optional().describe("Optional usage scope identifier for runtime-scoped metering"),
|
|
31
|
+
estimatedCost: z.number().nonnegative().optional().describe("Estimated cost in USD for this response"),
|
|
32
|
+
pricingStatus: PricingStatusSchema.optional().describe(
|
|
33
|
+
"Whether pricing was resolved for this response"
|
|
34
|
+
),
|
|
35
|
+
reasoning: z.string().optional().describe("Extended thinking content from reasoning models"),
|
|
36
|
+
model: z.string().optional().describe("Model used for this response"),
|
|
37
|
+
provider: z.enum(LLM_PROVIDERS).optional().describe("LLM provider")
|
|
38
|
+
}).strict().describe("Synchronous message response");
|
|
39
|
+
const ResetResponseSchema = z.object({
|
|
40
|
+
status: z.string().describe("Status message indicating reset was initiated"),
|
|
41
|
+
sessionId: z.string().describe("Session ID that was reset")
|
|
42
|
+
}).strict().describe("Session reset response");
|
|
43
|
+
const MessageStreamBusyResponseSchema = z.object({
|
|
44
|
+
busy: z.literal(true).describe("Indicates session is busy"),
|
|
45
|
+
sessionId: z.string().describe("The session ID"),
|
|
46
|
+
queueLength: z.number().describe("Current number of messages in queue"),
|
|
47
|
+
hint: z.string().describe("Instructions for the client")
|
|
48
|
+
}).strict().describe("Busy response for streaming requests");
|
|
49
|
+
const messageRoute = createRoute({
|
|
50
|
+
method: "post",
|
|
51
|
+
path: "/message",
|
|
52
|
+
summary: "Send Message (async)",
|
|
53
|
+
description: "Sends a message and returns immediately. The full response will be sent over SSE",
|
|
54
|
+
tags: ["messages"],
|
|
55
|
+
request: {
|
|
56
|
+
body: {
|
|
57
|
+
content: { "application/json": { schema: MessageBodySchema } }
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
responses: {
|
|
61
|
+
202: {
|
|
62
|
+
description: "Message accepted for async processing; subscribe to SSE for results",
|
|
63
|
+
content: {
|
|
64
|
+
"application/json": {
|
|
65
|
+
schema: MessageAcceptedResponseSchema
|
|
66
|
+
}
|
|
39
67
|
}
|
|
40
68
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
content: {
|
|
45
|
-
"application/json": {
|
|
46
|
-
schema: z.object({
|
|
47
|
-
accepted: z.literal(true).describe("Indicates request was accepted"),
|
|
48
|
-
sessionId: z.string().describe("Session ID used for this message")
|
|
49
|
-
}).strict()
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
400: { description: "Validation error" }
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
const messageSyncRoute = createRoute({
|
|
57
|
-
method: "post",
|
|
58
|
-
path: "/message-sync",
|
|
59
|
-
summary: "Send Message (sync)",
|
|
60
|
-
description: "Sends a message and waits for the full response",
|
|
61
|
-
tags: ["messages"],
|
|
62
|
-
request: {
|
|
63
|
-
body: { content: { "application/json": { schema: MessageBodySchema } } }
|
|
69
|
+
400: {
|
|
70
|
+
description: "Validation error",
|
|
71
|
+
content: { "application/json": { schema: ApiErrorResponseSchema } }
|
|
64
72
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
model: z.string().optional().describe("Model used for this response"),
|
|
84
|
-
provider: z.enum(LLM_PROVIDERS).optional().describe("LLM provider")
|
|
85
|
-
}).strict()
|
|
86
|
-
}
|
|
73
|
+
500: InternalErrorResponse
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
const messageSyncRoute = createRoute({
|
|
77
|
+
method: "post",
|
|
78
|
+
path: "/message-sync",
|
|
79
|
+
summary: "Send Message (sync)",
|
|
80
|
+
description: "Sends a message and waits for the full response",
|
|
81
|
+
tags: ["messages"],
|
|
82
|
+
request: {
|
|
83
|
+
body: { content: { "application/json": { schema: MessageBodySchema } } }
|
|
84
|
+
},
|
|
85
|
+
responses: {
|
|
86
|
+
200: {
|
|
87
|
+
description: "Synchronous response",
|
|
88
|
+
content: {
|
|
89
|
+
"application/json": {
|
|
90
|
+
schema: MessageSyncResponseSchema
|
|
87
91
|
}
|
|
88
|
-
}
|
|
89
|
-
400: { description: "Validation error" }
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
const resetRoute = createRoute({
|
|
93
|
-
method: "post",
|
|
94
|
-
path: "/reset",
|
|
95
|
-
summary: "Reset Conversation",
|
|
96
|
-
description: "Resets the conversation history for a given session",
|
|
97
|
-
tags: ["messages"],
|
|
98
|
-
request: {
|
|
99
|
-
body: { content: { "application/json": { schema: ResetBodySchema } } }
|
|
92
|
+
}
|
|
100
93
|
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
94
|
+
400: {
|
|
95
|
+
description: "Validation error",
|
|
96
|
+
content: { "application/json": { schema: ApiErrorResponseSchema } }
|
|
97
|
+
},
|
|
98
|
+
500: InternalErrorResponse
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
const resetRoute = createRoute({
|
|
102
|
+
method: "post",
|
|
103
|
+
path: "/reset",
|
|
104
|
+
summary: "Reset Conversation",
|
|
105
|
+
description: "Resets the conversation history for a given session",
|
|
106
|
+
tags: ["messages"],
|
|
107
|
+
request: {
|
|
108
|
+
body: { content: { "application/json": { schema: ResetBodySchema } } }
|
|
109
|
+
},
|
|
110
|
+
responses: {
|
|
111
|
+
200: {
|
|
112
|
+
description: "Reset initiated",
|
|
113
|
+
content: {
|
|
114
|
+
"application/json": {
|
|
115
|
+
schema: ResetResponseSchema
|
|
111
116
|
}
|
|
112
117
|
}
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
const messageStreamRoute = createRoute({
|
|
116
|
-
method: "post",
|
|
117
|
-
path: "/message-stream",
|
|
118
|
-
summary: "Stream message response",
|
|
119
|
-
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. Final llm:response events include token usage, assistant message ID, and pricing metadata when available. If the session is busy processing another message, returns 202 with queue information.",
|
|
120
|
-
tags: ["messages"],
|
|
121
|
-
request: {
|
|
122
|
-
body: {
|
|
123
|
-
content: { "application/json": { schema: MessageBodySchema } }
|
|
124
|
-
}
|
|
125
118
|
},
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
119
|
+
400: BadRequestErrorResponse,
|
|
120
|
+
404: NotFoundErrorResponse,
|
|
121
|
+
500: InternalErrorResponse
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
const messageStreamRoute = createRoute({
|
|
125
|
+
method: "post",
|
|
126
|
+
path: "/message-stream",
|
|
127
|
+
summary: "Stream message response",
|
|
128
|
+
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. Final llm:response events include token usage, assistant message ID, and pricing metadata when available. If the session is busy processing another message, returns 202 with queue information.",
|
|
129
|
+
tags: ["messages"],
|
|
130
|
+
request: {
|
|
131
|
+
body: {
|
|
132
|
+
content: { "application/json": { schema: MessageBodySchema } }
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
responses: {
|
|
136
|
+
200: {
|
|
137
|
+
description: "SSE stream of agent events. Standard SSE format with event type and JSON data.",
|
|
138
|
+
headers: {
|
|
139
|
+
"Content-Type": {
|
|
140
|
+
description: "SSE content type",
|
|
141
|
+
schema: { type: "string", example: "text/event-stream" }
|
|
146
142
|
},
|
|
147
|
-
|
|
148
|
-
"
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
143
|
+
"Cache-Control": {
|
|
144
|
+
description: "Disable caching for stream",
|
|
145
|
+
schema: { type: "string", example: "no-cache" }
|
|
146
|
+
},
|
|
147
|
+
Connection: {
|
|
148
|
+
description: "Keep connection alive for streaming",
|
|
149
|
+
schema: { type: "string", example: "keep-alive" }
|
|
150
|
+
},
|
|
151
|
+
"X-Accel-Buffering": {
|
|
152
|
+
description: "Disable nginx buffering",
|
|
153
|
+
schema: { type: "string", example: "no" }
|
|
153
154
|
}
|
|
154
155
|
},
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
busy: z.literal(true).describe("Indicates session is busy"),
|
|
161
|
-
sessionId: z.string().describe("The session ID"),
|
|
162
|
-
queueLength: z.number().describe("Current number of messages in queue"),
|
|
163
|
-
hint: z.string().describe("Instructions for the client")
|
|
164
|
-
}).strict()
|
|
165
|
-
}
|
|
156
|
+
content: {
|
|
157
|
+
"text/event-stream": {
|
|
158
|
+
schema: z.string().describe(
|
|
159
|
+
"Server-Sent Events stream. Events: llm:thinking (start), llm:chunk (text fragments), llm:tool-call (tool execution), llm:tool-result (tool output), llm:response (final), llm:error (errors). Final llm:response payloads include token usage, assistant message ID, and pricing metadata when available."
|
|
160
|
+
)
|
|
166
161
|
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
202: {
|
|
165
|
+
description: "Session is busy processing another message. Use the queue endpoints to manage pending messages.",
|
|
166
|
+
content: {
|
|
167
|
+
"application/json": {
|
|
168
|
+
schema: MessageStreamBusyResponseSchema
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
400: {
|
|
173
|
+
description: "Validation error",
|
|
174
|
+
content: { "application/json": { schema: ApiErrorResponseSchema } }
|
|
175
|
+
},
|
|
176
|
+
500: InternalErrorResponse
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
function createMessagesRouter(getAgent, approvalCoordinator) {
|
|
180
|
+
const app = new OpenAPIHono();
|
|
171
181
|
return app.openapi(messageRoute, async (ctx) => {
|
|
172
182
|
const agent = await getAgent(ctx);
|
|
173
183
|
agent.logger.info("Received message via POST /api/message");
|
|
174
|
-
const { content, sessionId } = ctx.req.valid("json");
|
|
184
|
+
const { content: rawContent, sessionId } = ctx.req.valid("json");
|
|
185
|
+
const content = toContentInput(rawContent);
|
|
175
186
|
agent.logger.info(`Message for session: ${sessionId}`);
|
|
176
187
|
agent.generate(content, sessionId).catch((error) => {
|
|
177
188
|
agent.logger.error(
|
|
@@ -182,30 +193,35 @@ function createMessagesRouter(getAgent, approvalCoordinator) {
|
|
|
182
193
|
}).openapi(messageSyncRoute, async (ctx) => {
|
|
183
194
|
const agent = await getAgent(ctx);
|
|
184
195
|
agent.logger.info("Received message via POST /api/message-sync");
|
|
185
|
-
const { content, sessionId } = ctx.req.valid("json");
|
|
196
|
+
const { content: rawContent, sessionId } = ctx.req.valid("json");
|
|
197
|
+
const content = toContentInput(rawContent);
|
|
186
198
|
agent.logger.info(`Message for session: ${sessionId}`);
|
|
187
199
|
const result = await agent.generate(content, sessionId);
|
|
188
|
-
return ctx.json(
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
+
return ctx.json(
|
|
201
|
+
{
|
|
202
|
+
response: result.content,
|
|
203
|
+
sessionId: result.sessionId,
|
|
204
|
+
tokenUsage: result.usage,
|
|
205
|
+
messageId: result.messageId,
|
|
206
|
+
usageScopeId: result.usageScopeId,
|
|
207
|
+
estimatedCost: result.estimatedCost,
|
|
208
|
+
pricingStatus: result.pricingStatus,
|
|
209
|
+
reasoning: result.reasoning,
|
|
210
|
+
model: result.model,
|
|
211
|
+
provider: result.provider
|
|
212
|
+
},
|
|
213
|
+
200
|
|
214
|
+
);
|
|
200
215
|
}).openapi(resetRoute, async (ctx) => {
|
|
201
216
|
const agent = await getAgent(ctx);
|
|
202
217
|
agent.logger.info("Received request via POST /api/reset");
|
|
203
218
|
const { sessionId } = ctx.req.valid("json");
|
|
204
219
|
await agent.resetConversation(sessionId);
|
|
205
|
-
return ctx.json({ status: "reset initiated", sessionId });
|
|
220
|
+
return ctx.json({ status: "reset initiated", sessionId }, 200);
|
|
206
221
|
}).openapi(messageStreamRoute, async (ctx) => {
|
|
207
222
|
const agent = await getAgent(ctx);
|
|
208
|
-
const { content, sessionId } = ctx.req.valid("json");
|
|
223
|
+
const { content: rawContent, sessionId } = ctx.req.valid("json");
|
|
224
|
+
const content = toContentInput(rawContent);
|
|
209
225
|
const isBusy = await agent.isSessionBusy(sessionId);
|
|
210
226
|
if (isBusy) {
|
|
211
227
|
const queuedMessages = await agent.getQueuedMessages(sessionId);
|
|
@@ -25,6 +25,7 @@ var import_zod_openapi = require("@hono/zod-openapi");
|
|
|
25
25
|
var import_fs = require("fs");
|
|
26
26
|
var import_core = require("@dexto/core");
|
|
27
27
|
var import_agent_management = require("@dexto/agent-management");
|
|
28
|
+
var import_responses = require("../schemas/responses.js");
|
|
28
29
|
const LocalModelSchema = import_zod_openapi.z.object({
|
|
29
30
|
id: import_zod_openapi.z.string().describe("Model identifier"),
|
|
30
31
|
displayName: import_zod_openapi.z.string().describe("Human-readable model name"),
|
|
@@ -63,7 +64,8 @@ const listLocalModelsRoute = (0, import_zod_openapi.createRoute)({
|
|
|
63
64
|
})
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
|
-
}
|
|
67
|
+
},
|
|
68
|
+
500: import_responses.InternalErrorResponse
|
|
67
69
|
}
|
|
68
70
|
});
|
|
69
71
|
const listOllamaModelsRoute = (0, import_zod_openapi.createRoute)({
|
|
@@ -90,7 +92,9 @@ const listOllamaModelsRoute = (0, import_zod_openapi.createRoute)({
|
|
|
90
92
|
})
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
|
-
}
|
|
95
|
+
},
|
|
96
|
+
400: import_responses.BadRequestErrorResponse,
|
|
97
|
+
500: import_responses.InternalErrorResponse
|
|
94
98
|
}
|
|
95
99
|
});
|
|
96
100
|
const validateLocalFileRoute = (0, import_zod_openapi.createRoute)({
|
|
@@ -116,7 +120,9 @@ const validateLocalFileRoute = (0, import_zod_openapi.createRoute)({
|
|
|
116
120
|
schema: ValidateFileResponseSchema
|
|
117
121
|
}
|
|
118
122
|
}
|
|
119
|
-
}
|
|
123
|
+
},
|
|
124
|
+
400: import_responses.BadRequestErrorResponse,
|
|
125
|
+
500: import_responses.InternalErrorResponse
|
|
120
126
|
}
|
|
121
127
|
});
|
|
122
128
|
const DeleteModelRequestSchema = import_zod_openapi.z.object({
|
|
@@ -163,7 +169,9 @@ const deleteLocalModelRoute = (0, import_zod_openapi.createRoute)({
|
|
|
163
169
|
schema: DeleteModelResponseSchema
|
|
164
170
|
}
|
|
165
171
|
}
|
|
166
|
-
}
|
|
172
|
+
},
|
|
173
|
+
400: import_responses.BadRequestErrorResponse,
|
|
174
|
+
500: import_responses.InternalErrorResponse
|
|
167
175
|
}
|
|
168
176
|
});
|
|
169
177
|
function createModelsRouter() {
|
|
@@ -181,82 +189,112 @@ function createModelsRouter() {
|
|
|
181
189
|
source: model.source
|
|
182
190
|
};
|
|
183
191
|
});
|
|
184
|
-
return ctx.json({ models });
|
|
192
|
+
return ctx.json({ models }, 200);
|
|
185
193
|
}).openapi(listOllamaModelsRoute, async (ctx) => {
|
|
186
194
|
const { baseURL } = ctx.req.valid("query");
|
|
187
195
|
const ollamaURL = baseURL || import_core.DEFAULT_OLLAMA_URL;
|
|
188
196
|
try {
|
|
189
197
|
const status = await (0, import_core.checkOllamaStatus)(ollamaURL);
|
|
190
198
|
if (!status.running) {
|
|
191
|
-
return ctx.json(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
199
|
+
return ctx.json(
|
|
200
|
+
{
|
|
201
|
+
available: false,
|
|
202
|
+
models: [],
|
|
203
|
+
error: "Ollama server is not running"
|
|
204
|
+
},
|
|
205
|
+
200
|
|
206
|
+
);
|
|
196
207
|
}
|
|
197
208
|
const ollamaModels = await (0, import_core.listOllamaModels)(ollamaURL);
|
|
198
|
-
return ctx.json(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
209
|
+
return ctx.json(
|
|
210
|
+
{
|
|
211
|
+
available: true,
|
|
212
|
+
version: status.version,
|
|
213
|
+
models: ollamaModels.map((m) => ({
|
|
214
|
+
name: m.name,
|
|
215
|
+
size: m.size,
|
|
216
|
+
digest: m.digest,
|
|
217
|
+
modifiedAt: m.modifiedAt
|
|
218
|
+
}))
|
|
219
|
+
},
|
|
220
|
+
200
|
|
221
|
+
);
|
|
208
222
|
} catch (error) {
|
|
209
|
-
return ctx.json(
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
223
|
+
return ctx.json(
|
|
224
|
+
{
|
|
225
|
+
available: false,
|
|
226
|
+
models: [],
|
|
227
|
+
error: error instanceof Error ? error.message : "Failed to connect to Ollama server"
|
|
228
|
+
},
|
|
229
|
+
200
|
|
230
|
+
);
|
|
214
231
|
}
|
|
215
232
|
}).openapi(validateLocalFileRoute, async (ctx) => {
|
|
216
233
|
const { filePath } = ctx.req.valid("json");
|
|
217
234
|
if (!filePath.startsWith("/")) {
|
|
218
|
-
return ctx.json(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
235
|
+
return ctx.json(
|
|
236
|
+
{
|
|
237
|
+
valid: false,
|
|
238
|
+
error: "File path must be absolute (start with /)"
|
|
239
|
+
},
|
|
240
|
+
200
|
|
241
|
+
);
|
|
222
242
|
}
|
|
223
243
|
if (!filePath.endsWith(".gguf")) {
|
|
224
|
-
return ctx.json(
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
244
|
+
return ctx.json(
|
|
245
|
+
{
|
|
246
|
+
valid: false,
|
|
247
|
+
error: "File must have .gguf extension"
|
|
248
|
+
},
|
|
249
|
+
200
|
|
250
|
+
);
|
|
228
251
|
}
|
|
229
252
|
try {
|
|
230
253
|
const stats = await import_fs.promises.stat(filePath);
|
|
231
254
|
if (!stats.isFile()) {
|
|
232
|
-
return ctx.json(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
255
|
+
return ctx.json(
|
|
256
|
+
{
|
|
257
|
+
valid: false,
|
|
258
|
+
error: "Path is not a file"
|
|
259
|
+
},
|
|
260
|
+
200
|
|
261
|
+
);
|
|
236
262
|
}
|
|
237
263
|
await import_fs.promises.access(filePath, import_fs.promises.constants.R_OK);
|
|
238
|
-
return ctx.json(
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
264
|
+
return ctx.json(
|
|
265
|
+
{
|
|
266
|
+
valid: true,
|
|
267
|
+
sizeBytes: stats.size
|
|
268
|
+
},
|
|
269
|
+
200
|
|
270
|
+
);
|
|
242
271
|
} catch (error) {
|
|
243
272
|
const nodeError = error;
|
|
244
273
|
if (nodeError.code === "ENOENT") {
|
|
245
|
-
return ctx.json(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
274
|
+
return ctx.json(
|
|
275
|
+
{
|
|
276
|
+
valid: false,
|
|
277
|
+
error: "File not found"
|
|
278
|
+
},
|
|
279
|
+
200
|
|
280
|
+
);
|
|
249
281
|
}
|
|
250
282
|
if (nodeError.code === "EACCES") {
|
|
251
|
-
return ctx.json(
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
283
|
+
return ctx.json(
|
|
284
|
+
{
|
|
285
|
+
valid: false,
|
|
286
|
+
error: "File is not readable (permission denied)"
|
|
287
|
+
},
|
|
288
|
+
200
|
|
289
|
+
);
|
|
255
290
|
}
|
|
256
|
-
return ctx.json(
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
291
|
+
return ctx.json(
|
|
292
|
+
{
|
|
293
|
+
valid: false,
|
|
294
|
+
error: error instanceof Error ? error.message : "Failed to access file"
|
|
295
|
+
},
|
|
296
|
+
200
|
|
297
|
+
);
|
|
260
298
|
}
|
|
261
299
|
}).openapi(deleteLocalModelRoute, async (ctx) => {
|
|
262
300
|
const { modelId } = ctx.req.valid("param");
|
|
@@ -299,18 +337,22 @@ function createModelsRouter() {
|
|
|
299
337
|
}
|
|
300
338
|
const removed = await (0, import_agent_management.removeInstalledModel)(modelId);
|
|
301
339
|
if (!removed) {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
340
|
+
throw new import_core.DextoRuntimeError(
|
|
341
|
+
"model_state_remove_failed",
|
|
342
|
+
"model",
|
|
343
|
+
import_core.ErrorType.SYSTEM,
|
|
344
|
+
"Failed to remove model from state",
|
|
345
|
+
{ modelId, fileDeleted }
|
|
346
|
+
);
|
|
308
347
|
}
|
|
309
|
-
return ctx.json(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
348
|
+
return ctx.json(
|
|
349
|
+
{
|
|
350
|
+
success: true,
|
|
351
|
+
modelId,
|
|
352
|
+
fileDeleted
|
|
353
|
+
},
|
|
354
|
+
200
|
|
355
|
+
);
|
|
314
356
|
});
|
|
315
357
|
}
|
|
316
358
|
// Annotate the CommonJS export names for ESM import in node:
|