@dexto/server 1.7.2 → 1.8.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.
- package/dist/approval/manual-approval-handler.d.ts +1 -1
- package/dist/hono/index.cjs +13 -3
- package/dist/hono/index.d.ts +2 -1
- package/dist/hono/index.d.ts.map +1 -1
- package/dist/hono/index.js +13 -3
- package/dist/hono/routes/approvals.cjs +1 -1
- package/dist/hono/routes/approvals.js +1 -1
- package/dist/hono/routes/discovery.cjs +18 -22
- package/dist/hono/routes/discovery.d.ts +8 -33
- package/dist/hono/routes/discovery.d.ts.map +1 -1
- package/dist/hono/routes/discovery.js +18 -22
- package/dist/hono/routes/messages.cjs +21 -12
- package/dist/hono/routes/messages.d.ts.map +1 -1
- package/dist/hono/routes/messages.js +21 -12
- package/dist/hono/routes/prompts.d.ts +0 -45
- package/dist/hono/routes/prompts.d.ts.map +1 -1
- package/dist/hono/routes/queue.cjs +193 -82
- package/dist/hono/routes/queue.d.ts +2456 -21
- package/dist/hono/routes/queue.d.ts.map +1 -1
- package/dist/hono/routes/queue.js +193 -82
- package/dist/hono/routes/sessions.cjs +13 -14
- package/dist/hono/routes/sessions.d.ts.map +1 -1
- package/dist/hono/routes/sessions.js +13 -14
- package/dist/hono/routes/skills.cjs +116 -0
- package/dist/hono/routes/skills.d.ts +602 -0
- package/dist/hono/routes/skills.d.ts.map +1 -0
- package/dist/hono/routes/skills.js +97 -0
- package/dist/hono/routes/static.cjs +6 -1
- package/dist/hono/routes/static.d.ts +1 -1
- package/dist/hono/routes/static.d.ts.map +1 -1
- package/dist/hono/routes/static.js +6 -1
- package/dist/hono/schemas/responses.cjs +13 -13
- package/dist/hono/schemas/responses.d.ts +13 -18
- package/dist/hono/schemas/responses.d.ts.map +1 -1
- package/dist/hono/schemas/responses.js +11 -13
- package/package.json +7 -7
|
@@ -13,7 +13,7 @@ import type { ApprovalCoordinator } from './approval-coordinator.js';
|
|
|
13
13
|
* for managing pending approval requests.
|
|
14
14
|
*
|
|
15
15
|
* Timeouts are handled per-request using the timeout value from ApprovalRequest, which
|
|
16
|
-
* is set by ApprovalManager based on the request type (tool
|
|
16
|
+
* is set by ApprovalManager based on the request type (tool approval vs elicitation).
|
|
17
17
|
*
|
|
18
18
|
* @param coordinator The approval coordinator for request/response communication
|
|
19
19
|
* @returns ApprovalHandler with cancellation support
|
package/dist/hono/index.cjs
CHANGED
|
@@ -40,6 +40,7 @@ var import_resources = require("./routes/resources.js");
|
|
|
40
40
|
var import_memory = require("./routes/memory.js");
|
|
41
41
|
var import_workspaces = require("./routes/workspaces.js");
|
|
42
42
|
var import_schedules = require("./routes/schedules.js");
|
|
43
|
+
var import_skills = require("./routes/skills.js");
|
|
43
44
|
var import_agents = require("./routes/agents.js");
|
|
44
45
|
var import_approvals = require("./routes/approvals.js");
|
|
45
46
|
var import_queue = require("./routes/queue.js");
|
|
@@ -156,6 +157,7 @@ function createDextoApp(options) {
|
|
|
156
157
|
[routePrefix, (0, import_memory.createMemoryRouter)(getAgent)],
|
|
157
158
|
[routePrefix, (0, import_workspaces.createWorkspacesRouter)(getAgent)],
|
|
158
159
|
[routePrefix, (0, import_schedules.createSchedulesRouter)(getAgent)],
|
|
160
|
+
[routePrefix, (0, import_skills.createSkillsRouter)(getAgent)],
|
|
159
161
|
[routePrefix, (0, import_approvals.createApprovalsRouter)(getAgent, approvalCoordinator)],
|
|
160
162
|
[
|
|
161
163
|
routePrefix,
|
|
@@ -245,6 +247,10 @@ function createDextoApp(options) {
|
|
|
245
247
|
name: "prompts",
|
|
246
248
|
description: "Manage custom prompts and templates"
|
|
247
249
|
},
|
|
250
|
+
{
|
|
251
|
+
name: "skills",
|
|
252
|
+
description: "List and read available agent skills"
|
|
253
|
+
},
|
|
248
254
|
{
|
|
249
255
|
name: "resources",
|
|
250
256
|
description: "Access and manage resources from MCP servers and internal providers"
|
|
@@ -258,8 +264,12 @@ function createDextoApp(options) {
|
|
|
258
264
|
description: "Install, switch, and manage agent configurations"
|
|
259
265
|
},
|
|
260
266
|
{
|
|
261
|
-
name: "
|
|
262
|
-
description: "Manage
|
|
267
|
+
name: "steer",
|
|
268
|
+
description: "Manage active-turn steer messages for busy sessions"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
name: "follow-up",
|
|
272
|
+
description: "Manage follow-up messages that run after the active turn"
|
|
263
273
|
},
|
|
264
274
|
{
|
|
265
275
|
name: "openrouter",
|
|
@@ -285,7 +295,7 @@ function createDextoApp(options) {
|
|
|
285
295
|
});
|
|
286
296
|
if (webRoot) {
|
|
287
297
|
fullApp.route("/", (0, import_static.createStaticRouter)(webRoot));
|
|
288
|
-
fullApp.notFound((0, import_static.createSpaFallbackHandler)(webRoot, webUIConfig));
|
|
298
|
+
fullApp.notFound((0, import_static.createSpaFallbackHandler)(webRoot, webUIConfig, normalizedPrefix));
|
|
289
299
|
}
|
|
290
300
|
Object.assign(fullApp, { webhookSubscriber });
|
|
291
301
|
return fullApp;
|
package/dist/hono/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { type ResourcesRouterSchema } from './routes/resources.js';
|
|
|
16
16
|
import { type MemoryRouterSchema } from './routes/memory.js';
|
|
17
17
|
import { type WorkspacesRouterSchema } from './routes/workspaces.js';
|
|
18
18
|
import { type SchedulesRouterSchema } from './routes/schedules.js';
|
|
19
|
+
import { type SkillsRouterSchema } from './routes/skills.js';
|
|
19
20
|
import { type AgentsRouterContext, type AgentsRouterSchema } from './routes/agents.js';
|
|
20
21
|
import { type ApprovalsRouterSchema } from './routes/approvals.js';
|
|
21
22
|
import { type QueueRouterSchema } from './routes/queue.js';
|
|
@@ -63,7 +64,7 @@ type HealthSchema = MergeSchemaPath<ExtractSchema<ReturnType<typeof createHealth
|
|
|
63
64
|
type DiscoverySchema = MergeSchemaPath<ExtractSchema<ReturnType<typeof createA2aRouter>>, '/'>;
|
|
64
65
|
type JsonRpcSchema = MergeSchemaPath<ExtractSchema<ReturnType<typeof createA2AJsonRpcRouter>>, '/'>;
|
|
65
66
|
type ConversationRouterSchema = GreetingRouterSchema | MessagesRouterSchema | LlmRouterSchema | SessionsRouterSchema | SearchRouterSchema;
|
|
66
|
-
type IntegrationRouterSchema = McpRouterSchema | WebhooksRouterSchema | PromptsRouterSchema | ResourcesRouterSchema | MemoryRouterSchema | WorkspacesRouterSchema | SchedulesRouterSchema;
|
|
67
|
+
type IntegrationRouterSchema = McpRouterSchema | WebhooksRouterSchema | PromptsRouterSchema | ResourcesRouterSchema | MemoryRouterSchema | WorkspacesRouterSchema | SchedulesRouterSchema | SkillsRouterSchema;
|
|
67
68
|
type ManagementRouterSchema = ApprovalsRouterSchema | AgentsRouterSchema | QueueRouterSchema;
|
|
68
69
|
type SystemRouterSchema = OpenRouterRouterSchema | KeyRouterSchema | ToolsRouterSchema | DiscoveryRouterSchema | ModelsRouterSchema | SystemPromptRouterSchema | DextoAuthRouterSchema;
|
|
69
70
|
type DefaultApiRouterSchema = ConversationRouterSchema | IntegrationRouterSchema | ManagementRouterSchema | SystemRouterSchema;
|
package/dist/hono/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hono/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAwB,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAwB,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACvF,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAwB,KAAK,oBAAoB,EAAE,M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AAiB,CAAC;AAE7F,KAAK,kBAAkB,GACjB,sBAAsB,GACtB,eAAe,GACf,iBAAiB,GACjB,qBAAqB,GACrB,kBAAkB,GAClB,wBAAwB,GACxB,qBAAqB,CAAC;AAE5B,KAAK,sBAAsB,GACrB,wBAAwB,GACxB,uBAAuB,GACvB,sBAAsB,GACtB,kBAAkB,CAAC;AAEzB,KAAK,gBAAgB,GAAG,eAAe,CAAC,sBAAsB,EAAE,OAAO,kBAAkB,CAAC,CAAC;AAM3F,KAAK,eAAe,GAAG,YAAY,GAAG,eAAe,GAAG,aAAa,CAAC;AACtE,KAAK,SAAS,GAAG,eAAe,GAAG,gBAAgB,CAAC;AAEpD,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,QAAQ,CA6OvE;AAED,MAAM,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;AAGrD,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/hono/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import { createResourcesRouter } from "./routes/resources.js";
|
|
|
17
17
|
import { createMemoryRouter } from "./routes/memory.js";
|
|
18
18
|
import { createWorkspacesRouter } from "./routes/workspaces.js";
|
|
19
19
|
import { createSchedulesRouter } from "./routes/schedules.js";
|
|
20
|
+
import { createSkillsRouter } from "./routes/skills.js";
|
|
20
21
|
import {
|
|
21
22
|
createAgentsRouter
|
|
22
23
|
} from "./routes/agents.js";
|
|
@@ -137,6 +138,7 @@ function createDextoApp(options) {
|
|
|
137
138
|
[routePrefix, createMemoryRouter(getAgent)],
|
|
138
139
|
[routePrefix, createWorkspacesRouter(getAgent)],
|
|
139
140
|
[routePrefix, createSchedulesRouter(getAgent)],
|
|
141
|
+
[routePrefix, createSkillsRouter(getAgent)],
|
|
140
142
|
[routePrefix, createApprovalsRouter(getAgent, approvalCoordinator)],
|
|
141
143
|
[
|
|
142
144
|
routePrefix,
|
|
@@ -226,6 +228,10 @@ function createDextoApp(options) {
|
|
|
226
228
|
name: "prompts",
|
|
227
229
|
description: "Manage custom prompts and templates"
|
|
228
230
|
},
|
|
231
|
+
{
|
|
232
|
+
name: "skills",
|
|
233
|
+
description: "List and read available agent skills"
|
|
234
|
+
},
|
|
229
235
|
{
|
|
230
236
|
name: "resources",
|
|
231
237
|
description: "Access and manage resources from MCP servers and internal providers"
|
|
@@ -239,8 +245,12 @@ function createDextoApp(options) {
|
|
|
239
245
|
description: "Install, switch, and manage agent configurations"
|
|
240
246
|
},
|
|
241
247
|
{
|
|
242
|
-
name: "
|
|
243
|
-
description: "Manage
|
|
248
|
+
name: "steer",
|
|
249
|
+
description: "Manage active-turn steer messages for busy sessions"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
name: "follow-up",
|
|
253
|
+
description: "Manage follow-up messages that run after the active turn"
|
|
244
254
|
},
|
|
245
255
|
{
|
|
246
256
|
name: "openrouter",
|
|
@@ -266,7 +276,7 @@ function createDextoApp(options) {
|
|
|
266
276
|
});
|
|
267
277
|
if (webRoot) {
|
|
268
278
|
fullApp.route("/", createStaticRouter(webRoot));
|
|
269
|
-
fullApp.notFound(createSpaFallbackHandler(webRoot, webUIConfig));
|
|
279
|
+
fullApp.notFound(createSpaFallbackHandler(webRoot, webUIConfig, normalizedPrefix));
|
|
270
280
|
}
|
|
271
281
|
Object.assign(fullApp, { webhookSubscriber });
|
|
272
282
|
return fullApp;
|
|
@@ -109,7 +109,7 @@ const ApprovalResponseSchema = import_zod_openapi.z.object({
|
|
|
109
109
|
}).describe("Response after processing approval");
|
|
110
110
|
const PendingApprovalSchema = import_zod_openapi.z.object({
|
|
111
111
|
approvalId: import_zod_openapi.z.string().describe("The unique ID of the approval request"),
|
|
112
|
-
type: import_zod_openapi.z.string().describe("The type of approval (
|
|
112
|
+
type: import_zod_openapi.z.string().describe("The type of approval (tool_approval, elicitation, etc.)"),
|
|
113
113
|
sessionId: import_zod_openapi.z.string().optional().describe("The session ID if applicable"),
|
|
114
114
|
timeout: import_zod_openapi.z.number().optional().describe("Timeout in milliseconds"),
|
|
115
115
|
timestamp: import_zod_openapi.z.string().describe("ISO timestamp when the request was created"),
|
|
@@ -91,7 +91,7 @@ const ApprovalResponseSchema = z.object({
|
|
|
91
91
|
}).describe("Response after processing approval");
|
|
92
92
|
const PendingApprovalSchema = z.object({
|
|
93
93
|
approvalId: z.string().describe("The unique ID of the approval request"),
|
|
94
|
-
type: z.string().describe("The type of approval (
|
|
94
|
+
type: z.string().describe("The type of approval (tool_approval, elicitation, etc.)"),
|
|
95
95
|
sessionId: z.string().optional().describe("The session ID if applicable"),
|
|
96
96
|
timeout: z.number().optional().describe("Timeout in milliseconds"),
|
|
97
97
|
timestamp: z.string().describe("ISO timestamp when the request was created"),
|
|
@@ -37,24 +37,23 @@ var import_agent_config = require("@dexto/agent-config");
|
|
|
37
37
|
var import_agent_management = require("@dexto/agent-management");
|
|
38
38
|
var import_image_local = __toESM(require("@dexto/image-local"), 1);
|
|
39
39
|
const DiscoveredFactorySchema = import_zod_openapi.z.object({
|
|
40
|
-
type: import_zod_openapi.z.string().describe("
|
|
41
|
-
category: import_zod_openapi.z.enum(["
|
|
40
|
+
type: import_zod_openapi.z.string().describe("Extension type identifier"),
|
|
41
|
+
category: import_zod_openapi.z.enum(["storage", "compaction", "tools"]).describe("Factory category"),
|
|
42
42
|
metadata: import_zod_openapi.z.object({
|
|
43
43
|
displayName: import_zod_openapi.z.string().optional().describe("Human-readable display name"),
|
|
44
|
-
description: import_zod_openapi.z.string().optional().describe("
|
|
45
|
-
}).passthrough().optional().describe("Optional metadata about the
|
|
46
|
-
}).describe("Information about a registered
|
|
44
|
+
description: import_zod_openapi.z.string().optional().describe("Extension description")
|
|
45
|
+
}).passthrough().optional().describe("Optional metadata about the extension")
|
|
46
|
+
}).describe("Information about a registered extension");
|
|
47
47
|
const ToolSchema = import_zod_openapi.z.object({
|
|
48
48
|
name: import_zod_openapi.z.string().describe('Built-in tool name identifier (e.g., "search_history", "ask_user")'),
|
|
49
49
|
description: import_zod_openapi.z.string().describe("Human-readable description of what the tool does")
|
|
50
50
|
}).describe("Information about a built-in tool");
|
|
51
51
|
const DiscoveryResponseSchema = import_zod_openapi.z.object({
|
|
52
|
-
|
|
53
|
-
database: import_zod_openapi.z.array(DiscoveredFactorySchema).describe("Database factories"),
|
|
52
|
+
storage: import_zod_openapi.z.array(DiscoveredFactorySchema).describe("Storage store provider"),
|
|
54
53
|
compaction: import_zod_openapi.z.array(DiscoveredFactorySchema).describe("Compaction strategy factories"),
|
|
55
54
|
toolFactories: import_zod_openapi.z.array(DiscoveredFactorySchema).describe("Tool factories"),
|
|
56
55
|
builtinTools: import_zod_openapi.z.array(ToolSchema).describe("Built-in tools available for configuration")
|
|
57
|
-
}).describe("Discovery response with
|
|
56
|
+
}).describe("Discovery response with image extensions grouped by category");
|
|
58
57
|
function toMetadata(metadata) {
|
|
59
58
|
if (!metadata || typeof metadata !== "object" || Array.isArray(metadata)) {
|
|
60
59
|
return void 0;
|
|
@@ -93,16 +92,13 @@ async function resolveImage(options) {
|
|
|
93
92
|
}
|
|
94
93
|
async function listDiscoveryFactories(options) {
|
|
95
94
|
const image = await resolveImage(options);
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
category: "database",
|
|
104
|
-
metadata: toMetadata(factory.metadata)
|
|
105
|
-
}));
|
|
95
|
+
const storage = [
|
|
96
|
+
{
|
|
97
|
+
type: "stores",
|
|
98
|
+
category: "storage",
|
|
99
|
+
metadata: toMetadata(image.storage.metadata)
|
|
100
|
+
}
|
|
101
|
+
];
|
|
106
102
|
const compaction = Object.entries(image.compaction).map(([type, factory]) => ({
|
|
107
103
|
type,
|
|
108
104
|
category: "compaction",
|
|
@@ -119,17 +115,17 @@ async function listDiscoveryFactories(options) {
|
|
|
119
115
|
category: "tools",
|
|
120
116
|
metadata: toMetadata(factory.metadata)
|
|
121
117
|
}));
|
|
122
|
-
return {
|
|
118
|
+
return { storage, compaction, toolFactories: toolFactoriesList, builtinTools };
|
|
123
119
|
}
|
|
124
120
|
const discoveryRoute = (0, import_zod_openapi.createRoute)({
|
|
125
121
|
method: "get",
|
|
126
122
|
path: "/discovery",
|
|
127
|
-
summary: "Discover Available
|
|
128
|
-
description: "Returns
|
|
123
|
+
summary: "Discover Available Image Extensions and Tools",
|
|
124
|
+
description: "Returns available storage, compaction, and tool extensions for the currently active image.",
|
|
129
125
|
tags: ["discovery"],
|
|
130
126
|
responses: {
|
|
131
127
|
200: {
|
|
132
|
-
description: "Available
|
|
128
|
+
description: "Available image extensions grouped by category",
|
|
133
129
|
content: { "application/json": { schema: DiscoveryResponseSchema } }
|
|
134
130
|
},
|
|
135
131
|
500: import_responses.InternalErrorResponse
|
|
@@ -14,26 +14,12 @@ declare const discoveryRoute: {
|
|
|
14
14
|
content: {
|
|
15
15
|
'application/json': {
|
|
16
16
|
schema: z.ZodObject<{
|
|
17
|
-
|
|
17
|
+
storage: z.ZodArray<z.ZodObject<{
|
|
18
18
|
type: z.ZodString;
|
|
19
19
|
category: z.ZodEnum<{
|
|
20
|
-
blob: "blob";
|
|
21
20
|
tools: "tools";
|
|
21
|
+
storage: "storage";
|
|
22
22
|
compaction: "compaction";
|
|
23
|
-
database: "database";
|
|
24
|
-
}>;
|
|
25
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
26
|
-
displayName: z.ZodOptional<z.ZodString>;
|
|
27
|
-
description: z.ZodOptional<z.ZodString>;
|
|
28
|
-
}, z.core.$loose>>;
|
|
29
|
-
}, z.core.$strip>>;
|
|
30
|
-
database: z.ZodArray<z.ZodObject<{
|
|
31
|
-
type: z.ZodString;
|
|
32
|
-
category: z.ZodEnum<{
|
|
33
|
-
blob: "blob";
|
|
34
|
-
tools: "tools";
|
|
35
|
-
compaction: "compaction";
|
|
36
|
-
database: "database";
|
|
37
23
|
}>;
|
|
38
24
|
metadata: z.ZodOptional<z.ZodObject<{
|
|
39
25
|
displayName: z.ZodOptional<z.ZodString>;
|
|
@@ -43,10 +29,9 @@ declare const discoveryRoute: {
|
|
|
43
29
|
compaction: z.ZodArray<z.ZodObject<{
|
|
44
30
|
type: z.ZodString;
|
|
45
31
|
category: z.ZodEnum<{
|
|
46
|
-
blob: "blob";
|
|
47
32
|
tools: "tools";
|
|
33
|
+
storage: "storage";
|
|
48
34
|
compaction: "compaction";
|
|
49
|
-
database: "database";
|
|
50
35
|
}>;
|
|
51
36
|
metadata: z.ZodOptional<z.ZodObject<{
|
|
52
37
|
displayName: z.ZodOptional<z.ZodString>;
|
|
@@ -56,10 +41,9 @@ declare const discoveryRoute: {
|
|
|
56
41
|
toolFactories: z.ZodArray<z.ZodObject<{
|
|
57
42
|
type: z.ZodString;
|
|
58
43
|
category: z.ZodEnum<{
|
|
59
|
-
blob: "blob";
|
|
60
44
|
tools: "tools";
|
|
45
|
+
storage: "storage";
|
|
61
46
|
compaction: "compaction";
|
|
62
|
-
database: "database";
|
|
63
47
|
}>;
|
|
64
48
|
metadata: z.ZodOptional<z.ZodObject<{
|
|
65
49
|
displayName: z.ZodOptional<z.ZodString>;
|
|
@@ -246,18 +230,9 @@ export declare function createDiscoveryRouter(getAgentConfigPath: GetAgentConfig
|
|
|
246
230
|
} | {
|
|
247
231
|
input: {};
|
|
248
232
|
output: {
|
|
249
|
-
|
|
250
|
-
type: string;
|
|
251
|
-
category: "blob" | "tools" | "compaction" | "database";
|
|
252
|
-
metadata?: {
|
|
253
|
-
[x: string]: import("hono/utils/types").JSONValue;
|
|
254
|
-
displayName?: string | undefined;
|
|
255
|
-
description?: string | undefined;
|
|
256
|
-
} | undefined;
|
|
257
|
-
}[];
|
|
258
|
-
database: {
|
|
233
|
+
storage: {
|
|
259
234
|
type: string;
|
|
260
|
-
category: "
|
|
235
|
+
category: "tools" | "storage" | "compaction";
|
|
261
236
|
metadata?: {
|
|
262
237
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
263
238
|
displayName?: string | undefined;
|
|
@@ -266,7 +241,7 @@ export declare function createDiscoveryRouter(getAgentConfigPath: GetAgentConfig
|
|
|
266
241
|
}[];
|
|
267
242
|
compaction: {
|
|
268
243
|
type: string;
|
|
269
|
-
category: "
|
|
244
|
+
category: "tools" | "storage" | "compaction";
|
|
270
245
|
metadata?: {
|
|
271
246
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
272
247
|
displayName?: string | undefined;
|
|
@@ -275,7 +250,7 @@ export declare function createDiscoveryRouter(getAgentConfigPath: GetAgentConfig
|
|
|
275
250
|
}[];
|
|
276
251
|
toolFactories: {
|
|
277
252
|
type: string;
|
|
278
|
-
category: "
|
|
253
|
+
category: "tools" | "storage" | "compaction";
|
|
279
254
|
metadata?: {
|
|
280
255
|
[x: string]: import("hono/utils/types").JSONValue;
|
|
281
256
|
displayName?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAe,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAKpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,MAAM,oBAAoB,GAAG,CAC/B,GAAG,EAAE,OAAO,KACX,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAe,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAKpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,MAAM,oBAAoB,GAAG,CAC/B,GAAG,EAAE,OAAO,KACX,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AA2ItD,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAclB,CAAC;AAEH,wBAAgB,qBAAqB,CAAC,kBAAkB,EAAE,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAM7E;AAED,KAAK,oBAAoB,GAAG,kBAAkB,CAAC,OAAO,cAAc,EAAE,EAAE,CAAC,CAAC;AAE1E,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,CAAC"}
|
|
@@ -4,24 +4,23 @@ import { loadImage } from "@dexto/agent-config";
|
|
|
4
4
|
import { loadAgentConfig } from "@dexto/agent-management";
|
|
5
5
|
import imageLocal from "@dexto/image-local";
|
|
6
6
|
const DiscoveredFactorySchema = z.object({
|
|
7
|
-
type: z.string().describe("
|
|
8
|
-
category: z.enum(["
|
|
7
|
+
type: z.string().describe("Extension type identifier"),
|
|
8
|
+
category: z.enum(["storage", "compaction", "tools"]).describe("Factory category"),
|
|
9
9
|
metadata: z.object({
|
|
10
10
|
displayName: z.string().optional().describe("Human-readable display name"),
|
|
11
|
-
description: z.string().optional().describe("
|
|
12
|
-
}).passthrough().optional().describe("Optional metadata about the
|
|
13
|
-
}).describe("Information about a registered
|
|
11
|
+
description: z.string().optional().describe("Extension description")
|
|
12
|
+
}).passthrough().optional().describe("Optional metadata about the extension")
|
|
13
|
+
}).describe("Information about a registered extension");
|
|
14
14
|
const ToolSchema = z.object({
|
|
15
15
|
name: z.string().describe('Built-in tool name identifier (e.g., "search_history", "ask_user")'),
|
|
16
16
|
description: z.string().describe("Human-readable description of what the tool does")
|
|
17
17
|
}).describe("Information about a built-in tool");
|
|
18
18
|
const DiscoveryResponseSchema = z.object({
|
|
19
|
-
|
|
20
|
-
database: z.array(DiscoveredFactorySchema).describe("Database factories"),
|
|
19
|
+
storage: z.array(DiscoveredFactorySchema).describe("Storage store provider"),
|
|
21
20
|
compaction: z.array(DiscoveredFactorySchema).describe("Compaction strategy factories"),
|
|
22
21
|
toolFactories: z.array(DiscoveredFactorySchema).describe("Tool factories"),
|
|
23
22
|
builtinTools: z.array(ToolSchema).describe("Built-in tools available for configuration")
|
|
24
|
-
}).describe("Discovery response with
|
|
23
|
+
}).describe("Discovery response with image extensions grouped by category");
|
|
25
24
|
function toMetadata(metadata) {
|
|
26
25
|
if (!metadata || typeof metadata !== "object" || Array.isArray(metadata)) {
|
|
27
26
|
return void 0;
|
|
@@ -60,16 +59,13 @@ async function resolveImage(options) {
|
|
|
60
59
|
}
|
|
61
60
|
async function listDiscoveryFactories(options) {
|
|
62
61
|
const image = await resolveImage(options);
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
category: "database",
|
|
71
|
-
metadata: toMetadata(factory.metadata)
|
|
72
|
-
}));
|
|
62
|
+
const storage = [
|
|
63
|
+
{
|
|
64
|
+
type: "stores",
|
|
65
|
+
category: "storage",
|
|
66
|
+
metadata: toMetadata(image.storage.metadata)
|
|
67
|
+
}
|
|
68
|
+
];
|
|
73
69
|
const compaction = Object.entries(image.compaction).map(([type, factory]) => ({
|
|
74
70
|
type,
|
|
75
71
|
category: "compaction",
|
|
@@ -86,17 +82,17 @@ async function listDiscoveryFactories(options) {
|
|
|
86
82
|
category: "tools",
|
|
87
83
|
metadata: toMetadata(factory.metadata)
|
|
88
84
|
}));
|
|
89
|
-
return {
|
|
85
|
+
return { storage, compaction, toolFactories: toolFactoriesList, builtinTools };
|
|
90
86
|
}
|
|
91
87
|
const discoveryRoute = createRoute({
|
|
92
88
|
method: "get",
|
|
93
89
|
path: "/discovery",
|
|
94
|
-
summary: "Discover Available
|
|
95
|
-
description: "Returns
|
|
90
|
+
summary: "Discover Available Image Extensions and Tools",
|
|
91
|
+
description: "Returns available storage, compaction, and tool extensions for the currently active image.",
|
|
96
92
|
tags: ["discovery"],
|
|
97
93
|
responses: {
|
|
98
94
|
200: {
|
|
99
|
-
description: "Available
|
|
95
|
+
description: "Available image extensions grouped by category",
|
|
100
96
|
content: { "application/json": { schema: DiscoveryResponseSchema } }
|
|
101
97
|
},
|
|
102
98
|
500: InternalErrorResponse
|
|
@@ -60,7 +60,7 @@ const ResetResponseSchema = import_zod_openapi.z.object({
|
|
|
60
60
|
const MessageStreamBusyResponseSchema = import_zod_openapi.z.object({
|
|
61
61
|
busy: import_zod_openapi.z.literal(true).describe("Indicates session is busy"),
|
|
62
62
|
sessionId: import_zod_openapi.z.string().describe("The session ID"),
|
|
63
|
-
queueLength: import_zod_openapi.z.number().describe("Current number of
|
|
63
|
+
queueLength: import_zod_openapi.z.number().describe("Current number of queued follow-up messages"),
|
|
64
64
|
hint: import_zod_openapi.z.string().describe("Instructions for the client")
|
|
65
65
|
}).strict().describe("Busy response for streaming requests");
|
|
66
66
|
const messageRoute = (0, import_zod_openapi.createRoute)({
|
|
@@ -179,7 +179,7 @@ const messageStreamRoute = (0, import_zod_openapi.createRoute)({
|
|
|
179
179
|
}
|
|
180
180
|
},
|
|
181
181
|
202: {
|
|
182
|
-
description: "Session is busy processing another message. Use the
|
|
182
|
+
description: "Session is busy processing another message. Use the follow-up endpoint to queue input for the next turn.",
|
|
183
183
|
content: {
|
|
184
184
|
"application/json": {
|
|
185
185
|
schema: MessageStreamBusyResponseSchema
|
|
@@ -242,13 +242,13 @@ function createMessagesRouter(getAgent, _approvalCoordinator) {
|
|
|
242
242
|
const content = (0, import_responses.toContentInput)(rawContent);
|
|
243
243
|
const isBusy = await agent.isSessionBusy(sessionId);
|
|
244
244
|
if (isBusy) {
|
|
245
|
-
const
|
|
245
|
+
const followUpMessages = await agent.getFollowUpMessages(sessionId);
|
|
246
246
|
return ctx.json(
|
|
247
247
|
{
|
|
248
248
|
busy: true,
|
|
249
249
|
sessionId,
|
|
250
|
-
queueLength:
|
|
251
|
-
hint: "Use POST /api/
|
|
250
|
+
queueLength: followUpMessages.length,
|
|
251
|
+
hint: "Use POST /api/follow-up/{sessionId} to queue a follow-up message, or wait for the current request to complete."
|
|
252
252
|
},
|
|
253
253
|
202
|
|
254
254
|
);
|
|
@@ -290,8 +290,15 @@ function createMessagesRouter(getAgent, _approvalCoordinator) {
|
|
|
290
290
|
});
|
|
291
291
|
return writeChain;
|
|
292
292
|
};
|
|
293
|
+
let sawFatalStreamError = false;
|
|
293
294
|
try {
|
|
294
295
|
for await (const event of iterator) {
|
|
296
|
+
if (event.name === "llm:error" && event.recoverable !== true) {
|
|
297
|
+
sawFatalStreamError = true;
|
|
298
|
+
}
|
|
299
|
+
if (event.name === "run:complete" && event.finishReason === "error") {
|
|
300
|
+
sawFatalStreamError = true;
|
|
301
|
+
}
|
|
295
302
|
const eventData = event.name === "llm:error" && event.error instanceof Error ? {
|
|
296
303
|
...event,
|
|
297
304
|
error: {
|
|
@@ -303,13 +310,15 @@ function createMessagesRouter(getAgent, _approvalCoordinator) {
|
|
|
303
310
|
await enqueueSSEWrite(event.name, eventData);
|
|
304
311
|
}
|
|
305
312
|
} catch (error) {
|
|
306
|
-
|
|
307
|
-
error
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
+
if (!sawFatalStreamError) {
|
|
314
|
+
await enqueueSSEWrite("llm:error", {
|
|
315
|
+
error: {
|
|
316
|
+
message: error instanceof Error ? error.message : String(error)
|
|
317
|
+
},
|
|
318
|
+
recoverable: false,
|
|
319
|
+
sessionId
|
|
320
|
+
});
|
|
321
|
+
}
|
|
313
322
|
} finally {
|
|
314
323
|
requestDisconnectSignal.removeEventListener("abort", abortOnDisconnect);
|
|
315
324
|
abortController.abort();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAe,KAAK,0BAA0B,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEjG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAY3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;iBAQyC,CAAC;AAEjE,QAAA,MAAM,eAAe;;iBAOqC,CAAC;AA2D3D,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BhB,CAAC;AAEH,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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9B,MAAM,EACN,UAAU,EACV;IAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;CAAE,EAC3C,0BAA0B,CAAC,OAAO,YAAY,CAAC,CAClD,CAAC;AAEF,KAAK,sBAAsB,GAAG,QAAQ,CAClC,MAAM,EACN,eAAe,EACf;IAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;CAAE,EAC3C,0BAA0B,CAAC,OAAO,gBAAgB,CAAC,CACtD,CAAC;AAEF,KAAK,gBAAgB,GAAG,QAAQ,CAC5B,MAAM,EACN,QAAQ,EACR;IAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;CAAE,EACzC,0BAA0B,CAAC,OAAO,UAAU,CAAC,CAChD,CAAC;AAEF,KAAK,wBAAwB,GAAG,QAAQ,CACpC,MAAM,EACN,iBAAiB,EACjB;IAAE,IAAI,EAAE,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"}
|
|
@@ -46,7 +46,7 @@ const ResetResponseSchema = z.object({
|
|
|
46
46
|
const MessageStreamBusyResponseSchema = z.object({
|
|
47
47
|
busy: z.literal(true).describe("Indicates session is busy"),
|
|
48
48
|
sessionId: z.string().describe("The session ID"),
|
|
49
|
-
queueLength: z.number().describe("Current number of
|
|
49
|
+
queueLength: z.number().describe("Current number of queued follow-up messages"),
|
|
50
50
|
hint: z.string().describe("Instructions for the client")
|
|
51
51
|
}).strict().describe("Busy response for streaming requests");
|
|
52
52
|
const messageRoute = createRoute({
|
|
@@ -165,7 +165,7 @@ const messageStreamRoute = createRoute({
|
|
|
165
165
|
}
|
|
166
166
|
},
|
|
167
167
|
202: {
|
|
168
|
-
description: "Session is busy processing another message. Use the
|
|
168
|
+
description: "Session is busy processing another message. Use the follow-up endpoint to queue input for the next turn.",
|
|
169
169
|
content: {
|
|
170
170
|
"application/json": {
|
|
171
171
|
schema: MessageStreamBusyResponseSchema
|
|
@@ -228,13 +228,13 @@ function createMessagesRouter(getAgent, _approvalCoordinator) {
|
|
|
228
228
|
const content = toContentInput(rawContent);
|
|
229
229
|
const isBusy = await agent.isSessionBusy(sessionId);
|
|
230
230
|
if (isBusy) {
|
|
231
|
-
const
|
|
231
|
+
const followUpMessages = await agent.getFollowUpMessages(sessionId);
|
|
232
232
|
return ctx.json(
|
|
233
233
|
{
|
|
234
234
|
busy: true,
|
|
235
235
|
sessionId,
|
|
236
|
-
queueLength:
|
|
237
|
-
hint: "Use POST /api/
|
|
236
|
+
queueLength: followUpMessages.length,
|
|
237
|
+
hint: "Use POST /api/follow-up/{sessionId} to queue a follow-up message, or wait for the current request to complete."
|
|
238
238
|
},
|
|
239
239
|
202
|
|
240
240
|
);
|
|
@@ -276,8 +276,15 @@ function createMessagesRouter(getAgent, _approvalCoordinator) {
|
|
|
276
276
|
});
|
|
277
277
|
return writeChain;
|
|
278
278
|
};
|
|
279
|
+
let sawFatalStreamError = false;
|
|
279
280
|
try {
|
|
280
281
|
for await (const event of iterator) {
|
|
282
|
+
if (event.name === "llm:error" && event.recoverable !== true) {
|
|
283
|
+
sawFatalStreamError = true;
|
|
284
|
+
}
|
|
285
|
+
if (event.name === "run:complete" && event.finishReason === "error") {
|
|
286
|
+
sawFatalStreamError = true;
|
|
287
|
+
}
|
|
281
288
|
const eventData = event.name === "llm:error" && event.error instanceof Error ? {
|
|
282
289
|
...event,
|
|
283
290
|
error: {
|
|
@@ -289,13 +296,15 @@ function createMessagesRouter(getAgent, _approvalCoordinator) {
|
|
|
289
296
|
await enqueueSSEWrite(event.name, eventData);
|
|
290
297
|
}
|
|
291
298
|
} catch (error) {
|
|
292
|
-
|
|
293
|
-
error
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
+
if (!sawFatalStreamError) {
|
|
300
|
+
await enqueueSSEWrite("llm:error", {
|
|
301
|
+
error: {
|
|
302
|
+
message: error instanceof Error ? error.message : String(error)
|
|
303
|
+
},
|
|
304
|
+
recoverable: false,
|
|
305
|
+
sessionId
|
|
306
|
+
});
|
|
307
|
+
}
|
|
299
308
|
} finally {
|
|
300
309
|
requestDisconnectSignal.removeEventListener("abort", abortOnDisconnect);
|
|
301
310
|
abortController.abort();
|