@dexto/server 1.6.20 → 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 -4531
- 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 +158 -32
- package/dist/hono/routes/a2a-tasks.d.ts +1 -502
- package/dist/hono/routes/a2a-tasks.d.ts.map +1 -1
- package/dist/hono/routes/a2a-tasks.js +162 -32
- 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 +16043 -68
- package/dist/hono/routes/agents.d.ts.map +1 -1
- package/dist/hono/routes/agents.js +418 -330
- package/dist/hono/routes/approvals.cjs +102 -88
- package/dist/hono/routes/approvals.d.ts +2089 -142
- package/dist/hono/routes/approvals.d.ts.map +1 -1
- package/dist/hono/routes/approvals.js +108 -89
- 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 +12136 -86
- package/dist/hono/routes/llm.d.ts.map +1 -1
- package/dist/hono/routes/llm.js +385 -348
- package/dist/hono/routes/mcp.cjs +257 -226
- package/dist/hono/routes/mcp.d.ts +6605 -309
- package/dist/hono/routes/mcp.d.ts.map +1 -1
- package/dist/hono/routes/mcp.js +263 -225
- 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 +147 -139
- package/dist/hono/routes/messages.d.ts +3900 -11
- package/dist/hono/routes/messages.d.ts.map +1 -1
- package/dist/hono/routes/messages.js +150 -139
- 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 +136 -109
- package/dist/hono/routes/prompts.d.ts +2818 -10
- package/dist/hono/routes/prompts.d.ts.map +1 -1
- package/dist/hono/routes/prompts.js +138 -109
- package/dist/hono/routes/queue.cjs +133 -120
- package/dist/hono/routes/queue.d.ts +5144 -9
- package/dist/hono/routes/queue.d.ts.map +1 -1
- package/dist/hono/routes/queue.js +136 -120
- package/dist/hono/routes/resources.cjs +65 -46
- package/dist/hono/routes/resources.d.ts +1982 -4
- 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 +4198 -22
- 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 +2835 -12
- package/dist/hono/routes/search.d.ts.map +1 -1
- package/dist/hono/routes/search.js +40 -31
- package/dist/hono/routes/sessions.cjs +403 -396
- package/dist/hono/routes/sessions.d.ts +16582 -27
- package/dist/hono/routes/sessions.d.ts.map +1 -1
- package/dist/hono/routes/sessions.js +407 -397
- 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 +1755 -6
- package/dist/hono/routes/tools.d.ts.map +1 -1
- package/dist/hono/routes/tools.js +33 -33
- package/dist/hono/routes/webhooks.cjs +115 -123
- package/dist/hono/routes/webhooks.d.ts +2501 -11
- package/dist/hono/routes/webhooks.d.ts.map +1 -1
- package/dist/hono/routes/webhooks.js +120 -124
- 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 +406 -259
- package/dist/hono/schemas/responses.d.ts +1246 -123
- package/dist/hono/schemas/responses.d.ts.map +1 -1
- package/dist/hono/schemas/responses.js +144 -10
- 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":"memory.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAe,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,
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AAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;CAAE,CACpD,CAAC;AACF,KAAK,eAAe,GAAG,kBAAkB,CACrC,OAAO,SAAS,EAChB;IAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;CAAE,CACrD,CAAC;AACF,KAAK,cAAc,GAAG,kBAAkB,CAAC,OAAO,QAAQ,EAAE,kBAAkB,CAAC,CAAC;AAC9E,KAAK,iBAAiB,GAAG,kBAAkB,CACvC,OAAO,WAAW,EAClB,kBAAkB,GAAG;IAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;CAAE,CACzE,CAAC;AACF,KAAK,iBAAiB,GAAG,kBAAkB,CAAC,OAAO,WAAW,EAAE,kBAAkB,CAAC,CAAC;AAEpF,MAAM,MAAM,kBAAkB,GACxB,uBAAuB,GACvB,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,iBAAiB,CAAC"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
|
|
2
2
|
import { CreateMemoryInputSchema, UpdateMemoryInputSchema } from "@dexto/core";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
BadRequestErrorResponse,
|
|
5
|
+
InternalErrorResponse,
|
|
6
|
+
MemorySchema,
|
|
7
|
+
NotFoundErrorResponse
|
|
8
|
+
} from "../schemas/responses.js";
|
|
4
9
|
const MemoryIdParamSchema = z.object({
|
|
5
10
|
id: z.string().min(1, "Memory ID is required").describe("Memory unique identifier")
|
|
6
11
|
}).describe("Path parameters for memory endpoints");
|
|
@@ -23,99 +28,112 @@ const MemoryDeleteResponseSchema = z.object({
|
|
|
23
28
|
ok: z.literal(true).describe("Indicates successful response"),
|
|
24
29
|
message: z.string().describe("Deletion confirmation message")
|
|
25
30
|
}).strict().describe("Memory deletion response");
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"application/json": {
|
|
38
|
-
schema: CreateMemoryInputSchema
|
|
39
|
-
}
|
|
31
|
+
const createMemoryRoute = createRoute({
|
|
32
|
+
method: "post",
|
|
33
|
+
path: "/memory",
|
|
34
|
+
summary: "Create Memory",
|
|
35
|
+
description: "Creates a new memory",
|
|
36
|
+
tags: ["memory"],
|
|
37
|
+
request: {
|
|
38
|
+
body: {
|
|
39
|
+
content: {
|
|
40
|
+
"application/json": {
|
|
41
|
+
schema: CreateMemoryInputSchema
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
|
-
},
|
|
43
|
-
responses: {
|
|
44
|
-
201: {
|
|
45
|
-
description: "Memory created",
|
|
46
|
-
content: { "application/json": { schema: MemoryResponseSchema } }
|
|
47
|
-
}
|
|
48
44
|
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
description: "Retrieves a list of all memories with optional filtering",
|
|
55
|
-
tags: ["memory"],
|
|
56
|
-
request: { query: ListMemoriesQuerySchema },
|
|
57
|
-
responses: {
|
|
58
|
-
200: {
|
|
59
|
-
description: "List memories",
|
|
60
|
-
content: { "application/json": { schema: MemoriesListResponseSchema } }
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
const getRoute = createRoute({
|
|
65
|
-
method: "get",
|
|
66
|
-
path: "/memory/{id}",
|
|
67
|
-
summary: "Get Memory by ID",
|
|
68
|
-
description: "Retrieves a specific memory by its unique identifier",
|
|
69
|
-
tags: ["memory"],
|
|
70
|
-
request: {
|
|
71
|
-
params: MemoryIdParamSchema
|
|
45
|
+
},
|
|
46
|
+
responses: {
|
|
47
|
+
201: {
|
|
48
|
+
description: "Memory created",
|
|
49
|
+
content: { "application/json": { schema: MemoryResponseSchema } }
|
|
72
50
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
body: {
|
|
89
|
-
content: {
|
|
90
|
-
"application/json": {
|
|
91
|
-
schema: UpdateMemoryInputSchema
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
51
|
+
400: BadRequestErrorResponse,
|
|
52
|
+
500: InternalErrorResponse
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
const listRoute = createRoute({
|
|
56
|
+
method: "get",
|
|
57
|
+
path: "/memory",
|
|
58
|
+
summary: "List Memories",
|
|
59
|
+
description: "Retrieves a list of all memories with optional filtering",
|
|
60
|
+
tags: ["memory"],
|
|
61
|
+
request: { query: ListMemoriesQuerySchema },
|
|
62
|
+
responses: {
|
|
63
|
+
200: {
|
|
64
|
+
description: "List memories",
|
|
65
|
+
content: { "application/json": { schema: MemoriesListResponseSchema } }
|
|
95
66
|
},
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
67
|
+
400: BadRequestErrorResponse,
|
|
68
|
+
500: InternalErrorResponse
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const getRoute = createRoute({
|
|
72
|
+
method: "get",
|
|
73
|
+
path: "/memory/{id}",
|
|
74
|
+
summary: "Get Memory by ID",
|
|
75
|
+
description: "Retrieves a specific memory by its unique identifier",
|
|
76
|
+
tags: ["memory"],
|
|
77
|
+
request: {
|
|
78
|
+
params: MemoryIdParamSchema
|
|
79
|
+
},
|
|
80
|
+
responses: {
|
|
81
|
+
200: {
|
|
82
|
+
description: "Memory details",
|
|
83
|
+
content: { "application/json": { schema: MemoryResponseSchema } }
|
|
111
84
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
85
|
+
400: BadRequestErrorResponse,
|
|
86
|
+
404: NotFoundErrorResponse,
|
|
87
|
+
500: InternalErrorResponse
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
const updateRoute = createRoute({
|
|
91
|
+
method: "put",
|
|
92
|
+
path: "/memory/{id}",
|
|
93
|
+
summary: "Update Memory",
|
|
94
|
+
description: "Updates an existing memory. Only provided fields will be updated",
|
|
95
|
+
tags: ["memory"],
|
|
96
|
+
request: {
|
|
97
|
+
params: MemoryIdParamSchema,
|
|
98
|
+
body: {
|
|
99
|
+
content: {
|
|
100
|
+
"application/json": {
|
|
101
|
+
schema: UpdateMemoryInputSchema
|
|
102
|
+
}
|
|
116
103
|
}
|
|
117
104
|
}
|
|
118
|
-
}
|
|
105
|
+
},
|
|
106
|
+
responses: {
|
|
107
|
+
200: {
|
|
108
|
+
description: "Memory updated",
|
|
109
|
+
content: { "application/json": { schema: MemoryResponseSchema } }
|
|
110
|
+
},
|
|
111
|
+
400: BadRequestErrorResponse,
|
|
112
|
+
404: NotFoundErrorResponse,
|
|
113
|
+
500: InternalErrorResponse
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
const deleteRoute = createRoute({
|
|
117
|
+
method: "delete",
|
|
118
|
+
path: "/memory/{id}",
|
|
119
|
+
summary: "Delete Memory",
|
|
120
|
+
description: "Permanently deletes a memory. This action cannot be undone",
|
|
121
|
+
tags: ["memory"],
|
|
122
|
+
request: {
|
|
123
|
+
params: MemoryIdParamSchema
|
|
124
|
+
},
|
|
125
|
+
responses: {
|
|
126
|
+
200: {
|
|
127
|
+
description: "Memory deleted",
|
|
128
|
+
content: { "application/json": { schema: MemoryDeleteResponseSchema } }
|
|
129
|
+
},
|
|
130
|
+
400: BadRequestErrorResponse,
|
|
131
|
+
404: NotFoundErrorResponse,
|
|
132
|
+
500: InternalErrorResponse
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
function createMemoryRouter(getAgent) {
|
|
136
|
+
const app = new OpenAPIHono();
|
|
119
137
|
return app.openapi(createMemoryRoute, async (ctx) => {
|
|
120
138
|
const input = ctx.req.valid("json");
|
|
121
139
|
const createInput = {
|
|
@@ -140,12 +158,12 @@ function createMemoryRouter(getAgent) {
|
|
|
140
158
|
if (query.offset !== void 0) options.offset = query.offset;
|
|
141
159
|
const agent = await getAgent(ctx);
|
|
142
160
|
const memories = await agent.memoryManager.list(options);
|
|
143
|
-
return ctx.json({ ok: true, memories });
|
|
161
|
+
return ctx.json({ ok: true, memories }, 200);
|
|
144
162
|
}).openapi(getRoute, async (ctx) => {
|
|
145
163
|
const { id } = ctx.req.valid("param");
|
|
146
164
|
const agent = await getAgent(ctx);
|
|
147
165
|
const memory = await agent.memoryManager.get(id);
|
|
148
|
-
return ctx.json({ ok: true, memory });
|
|
166
|
+
return ctx.json({ ok: true, memory }, 200);
|
|
149
167
|
}).openapi(updateRoute, async (ctx) => {
|
|
150
168
|
const { id } = ctx.req.valid("param");
|
|
151
169
|
const updatesRaw = ctx.req.valid("json");
|
|
@@ -155,12 +173,12 @@ function createMemoryRouter(getAgent) {
|
|
|
155
173
|
if (updatesRaw.tags !== void 0) updates.tags = updatesRaw.tags;
|
|
156
174
|
const agent = await getAgent(ctx);
|
|
157
175
|
const memory = await agent.memoryManager.update(id, updates);
|
|
158
|
-
return ctx.json({ ok: true, memory });
|
|
176
|
+
return ctx.json({ ok: true, memory }, 200);
|
|
159
177
|
}).openapi(deleteRoute, async (ctx) => {
|
|
160
178
|
const { id } = ctx.req.valid("param");
|
|
161
179
|
const agent = await getAgent(ctx);
|
|
162
180
|
await agent.memoryManager.delete(id);
|
|
163
|
-
return ctx.json({ ok: true, message: "Memory deleted successfully" });
|
|
181
|
+
return ctx.json({ ok: true, message: "Memory deleted successfully" }, 200);
|
|
164
182
|
});
|
|
165
183
|
}
|
|
166
184
|
export {
|
|
@@ -32,158 +32,166 @@ const MessageBodySchema = import_zod_openapi.z.object({
|
|
|
32
32
|
const ResetBodySchema = import_zod_openapi.z.object({
|
|
33
33
|
sessionId: import_zod_openapi.z.string().min(1, "Session ID is required").describe("The ID of the session to reset")
|
|
34
34
|
}).describe("Request body for resetting a conversation");
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
35
|
+
const MessageAcceptedResponseSchema = import_zod_openapi.z.object({
|
|
36
|
+
accepted: import_zod_openapi.z.literal(true).describe("Indicates request was accepted"),
|
|
37
|
+
sessionId: import_zod_openapi.z.string().describe("Session ID used for this message")
|
|
38
|
+
}).strict().describe("Asynchronous message acceptance response");
|
|
39
|
+
const MessageSyncResponseSchema = import_zod_openapi.z.object({
|
|
40
|
+
response: import_zod_openapi.z.string().describe("Agent response text"),
|
|
41
|
+
sessionId: import_zod_openapi.z.string().describe("Session ID used for this message"),
|
|
42
|
+
tokenUsage: import_responses.TokenUsageSchema.optional().describe("Token usage statistics"),
|
|
43
|
+
messageId: import_zod_openapi.z.string().uuid().optional().describe("Assistant message ID for this response"),
|
|
44
|
+
usageScopeId: import_zod_openapi.z.string().optional().describe("Optional usage scope identifier for runtime-scoped metering"),
|
|
45
|
+
estimatedCost: import_zod_openapi.z.number().nonnegative().optional().describe("Estimated cost in USD for this response"),
|
|
46
|
+
pricingStatus: import_responses.PricingStatusSchema.optional().describe(
|
|
47
|
+
"Whether pricing was resolved for this response"
|
|
48
|
+
),
|
|
49
|
+
reasoning: import_zod_openapi.z.string().optional().describe("Extended thinking content from reasoning models"),
|
|
50
|
+
model: import_zod_openapi.z.string().optional().describe("Model used for this response"),
|
|
51
|
+
provider: import_zod_openapi.z.enum(import_core.LLM_PROVIDERS).optional().describe("LLM provider")
|
|
52
|
+
}).strict().describe("Synchronous message response");
|
|
53
|
+
const ResetResponseSchema = import_zod_openapi.z.object({
|
|
54
|
+
status: import_zod_openapi.z.string().describe("Status message indicating reset was initiated"),
|
|
55
|
+
sessionId: import_zod_openapi.z.string().describe("Session ID that was reset")
|
|
56
|
+
}).strict().describe("Session reset response");
|
|
57
|
+
const MessageStreamBusyResponseSchema = import_zod_openapi.z.object({
|
|
58
|
+
busy: import_zod_openapi.z.literal(true).describe("Indicates session is busy"),
|
|
59
|
+
sessionId: import_zod_openapi.z.string().describe("The session ID"),
|
|
60
|
+
queueLength: import_zod_openapi.z.number().describe("Current number of messages in queue"),
|
|
61
|
+
hint: import_zod_openapi.z.string().describe("Instructions for the client")
|
|
62
|
+
}).strict().describe("Busy response for streaming requests");
|
|
63
|
+
const messageRoute = (0, import_zod_openapi.createRoute)({
|
|
64
|
+
method: "post",
|
|
65
|
+
path: "/message",
|
|
66
|
+
summary: "Send Message (async)",
|
|
67
|
+
description: "Sends a message and returns immediately. The full response will be sent over SSE",
|
|
68
|
+
tags: ["messages"],
|
|
69
|
+
request: {
|
|
70
|
+
body: {
|
|
71
|
+
content: { "application/json": { schema: MessageBodySchema } }
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
responses: {
|
|
75
|
+
202: {
|
|
76
|
+
description: "Message accepted for async processing; subscribe to SSE for results",
|
|
77
|
+
content: {
|
|
78
|
+
"application/json": {
|
|
79
|
+
schema: MessageAcceptedResponseSchema
|
|
58
80
|
}
|
|
59
|
-
},
|
|
60
|
-
400: {
|
|
61
|
-
description: "Validation error",
|
|
62
|
-
content: { "application/json": { schema: import_responses.ApiErrorResponseSchema } }
|
|
63
81
|
}
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
const messageSyncRoute = (0, import_zod_openapi.createRoute)({
|
|
67
|
-
method: "post",
|
|
68
|
-
path: "/message-sync",
|
|
69
|
-
summary: "Send Message (sync)",
|
|
70
|
-
description: "Sends a message and waits for the full response",
|
|
71
|
-
tags: ["messages"],
|
|
72
|
-
request: {
|
|
73
|
-
body: { content: { "application/json": { schema: MessageBodySchema } } }
|
|
74
82
|
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
83
|
+
400: {
|
|
84
|
+
description: "Validation error",
|
|
85
|
+
content: { "application/json": { schema: import_responses.ApiErrorResponseSchema } }
|
|
86
|
+
},
|
|
87
|
+
500: import_responses.InternalErrorResponse
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
const messageSyncRoute = (0, import_zod_openapi.createRoute)({
|
|
91
|
+
method: "post",
|
|
92
|
+
path: "/message-sync",
|
|
93
|
+
summary: "Send Message (sync)",
|
|
94
|
+
description: "Sends a message and waits for the full response",
|
|
95
|
+
tags: ["messages"],
|
|
96
|
+
request: {
|
|
97
|
+
body: { content: { "application/json": { schema: MessageBodySchema } } }
|
|
98
|
+
},
|
|
99
|
+
responses: {
|
|
100
|
+
200: {
|
|
101
|
+
description: "Synchronous response",
|
|
102
|
+
content: {
|
|
103
|
+
"application/json": {
|
|
104
|
+
schema: MessageSyncResponseSchema
|
|
97
105
|
}
|
|
98
|
-
},
|
|
99
|
-
400: {
|
|
100
|
-
description: "Validation error",
|
|
101
|
-
content: { "application/json": { schema: import_responses.ApiErrorResponseSchema } }
|
|
102
106
|
}
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
const resetRoute = (0, import_zod_openapi.createRoute)({
|
|
106
|
-
method: "post",
|
|
107
|
-
path: "/reset",
|
|
108
|
-
summary: "Reset Conversation",
|
|
109
|
-
description: "Resets the conversation history for a given session",
|
|
110
|
-
tags: ["messages"],
|
|
111
|
-
request: {
|
|
112
|
-
body: { content: { "application/json": { schema: ResetBodySchema } } }
|
|
113
107
|
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
108
|
+
400: {
|
|
109
|
+
description: "Validation error",
|
|
110
|
+
content: { "application/json": { schema: import_responses.ApiErrorResponseSchema } }
|
|
111
|
+
},
|
|
112
|
+
500: import_responses.InternalErrorResponse
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
const resetRoute = (0, import_zod_openapi.createRoute)({
|
|
116
|
+
method: "post",
|
|
117
|
+
path: "/reset",
|
|
118
|
+
summary: "Reset Conversation",
|
|
119
|
+
description: "Resets the conversation history for a given session",
|
|
120
|
+
tags: ["messages"],
|
|
121
|
+
request: {
|
|
122
|
+
body: { content: { "application/json": { schema: ResetBodySchema } } }
|
|
123
|
+
},
|
|
124
|
+
responses: {
|
|
125
|
+
200: {
|
|
126
|
+
description: "Reset initiated",
|
|
127
|
+
content: {
|
|
128
|
+
"application/json": {
|
|
129
|
+
schema: ResetResponseSchema
|
|
124
130
|
}
|
|
125
131
|
}
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
const messageStreamRoute = (0, import_zod_openapi.createRoute)({
|
|
129
|
-
method: "post",
|
|
130
|
-
path: "/message-stream",
|
|
131
|
-
summary: "Stream message response",
|
|
132
|
-
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.",
|
|
133
|
-
tags: ["messages"],
|
|
134
|
-
request: {
|
|
135
|
-
body: {
|
|
136
|
-
content: { "application/json": { schema: MessageBodySchema } }
|
|
137
|
-
}
|
|
138
132
|
},
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
133
|
+
400: import_responses.BadRequestErrorResponse,
|
|
134
|
+
404: import_responses.NotFoundErrorResponse,
|
|
135
|
+
500: import_responses.InternalErrorResponse
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
const messageStreamRoute = (0, import_zod_openapi.createRoute)({
|
|
139
|
+
method: "post",
|
|
140
|
+
path: "/message-stream",
|
|
141
|
+
summary: "Stream message response",
|
|
142
|
+
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.",
|
|
143
|
+
tags: ["messages"],
|
|
144
|
+
request: {
|
|
145
|
+
body: {
|
|
146
|
+
content: { "application/json": { schema: MessageBodySchema } }
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
responses: {
|
|
150
|
+
200: {
|
|
151
|
+
description: "SSE stream of agent events. Standard SSE format with event type and JSON data.",
|
|
152
|
+
headers: {
|
|
153
|
+
"Content-Type": {
|
|
154
|
+
description: "SSE content type",
|
|
155
|
+
schema: { type: "string", example: "text/event-stream" }
|
|
159
156
|
},
|
|
160
|
-
|
|
161
|
-
"
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
157
|
+
"Cache-Control": {
|
|
158
|
+
description: "Disable caching for stream",
|
|
159
|
+
schema: { type: "string", example: "no-cache" }
|
|
160
|
+
},
|
|
161
|
+
Connection: {
|
|
162
|
+
description: "Keep connection alive for streaming",
|
|
163
|
+
schema: { type: "string", example: "keep-alive" }
|
|
164
|
+
},
|
|
165
|
+
"X-Accel-Buffering": {
|
|
166
|
+
description: "Disable nginx buffering",
|
|
167
|
+
schema: { type: "string", example: "no" }
|
|
166
168
|
}
|
|
167
169
|
},
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
busy: import_zod_openapi.z.literal(true).describe("Indicates session is busy"),
|
|
174
|
-
sessionId: import_zod_openapi.z.string().describe("The session ID"),
|
|
175
|
-
queueLength: import_zod_openapi.z.number().describe("Current number of messages in queue"),
|
|
176
|
-
hint: import_zod_openapi.z.string().describe("Instructions for the client")
|
|
177
|
-
}).strict()
|
|
178
|
-
}
|
|
170
|
+
content: {
|
|
171
|
+
"text/event-stream": {
|
|
172
|
+
schema: import_zod_openapi.z.string().describe(
|
|
173
|
+
"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."
|
|
174
|
+
)
|
|
179
175
|
}
|
|
180
|
-
},
|
|
181
|
-
400: {
|
|
182
|
-
description: "Validation error",
|
|
183
|
-
content: { "application/json": { schema: import_responses.ApiErrorResponseSchema } }
|
|
184
176
|
}
|
|
185
|
-
}
|
|
186
|
-
|
|
177
|
+
},
|
|
178
|
+
202: {
|
|
179
|
+
description: "Session is busy processing another message. Use the queue endpoints to manage pending messages.",
|
|
180
|
+
content: {
|
|
181
|
+
"application/json": {
|
|
182
|
+
schema: MessageStreamBusyResponseSchema
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
400: {
|
|
187
|
+
description: "Validation error",
|
|
188
|
+
content: { "application/json": { schema: import_responses.ApiErrorResponseSchema } }
|
|
189
|
+
},
|
|
190
|
+
500: import_responses.InternalErrorResponse
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
function createMessagesRouter(getAgent, approvalCoordinator) {
|
|
194
|
+
const app = new import_zod_openapi.OpenAPIHono();
|
|
187
195
|
return app.openapi(messageRoute, async (ctx) => {
|
|
188
196
|
const agent = await getAgent(ctx);
|
|
189
197
|
agent.logger.info("Received message via POST /api/message");
|
|
@@ -223,7 +231,7 @@ function createMessagesRouter(getAgent, approvalCoordinator) {
|
|
|
223
231
|
agent.logger.info("Received request via POST /api/reset");
|
|
224
232
|
const { sessionId } = ctx.req.valid("json");
|
|
225
233
|
await agent.resetConversation(sessionId);
|
|
226
|
-
return ctx.json({ status: "reset initiated", sessionId });
|
|
234
|
+
return ctx.json({ status: "reset initiated", sessionId }, 200);
|
|
227
235
|
}).openapi(messageStreamRoute, async (ctx) => {
|
|
228
236
|
const agent = await getAgent(ctx);
|
|
229
237
|
const { content: rawContent, sessionId } = ctx.req.valid("json");
|