@dexto/server 1.6.19 → 1.6.20
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/hono/index.d.ts +161 -133
- package/dist/hono/index.d.ts.map +1 -1
- package/dist/hono/routes/a2a-tasks.cjs +17 -4
- package/dist/hono/routes/a2a-tasks.d.ts +39 -35
- package/dist/hono/routes/a2a-tasks.d.ts.map +1 -1
- package/dist/hono/routes/a2a-tasks.js +17 -4
- package/dist/hono/routes/agents.d.ts +8 -8
- package/dist/hono/routes/approvals.cjs +19 -8
- package/dist/hono/routes/approvals.d.ts +39 -8
- package/dist/hono/routes/approvals.d.ts.map +1 -1
- package/dist/hono/routes/approvals.js +19 -8
- package/dist/hono/routes/llm.d.ts +1 -1
- package/dist/hono/routes/mcp.cjs +56 -26
- package/dist/hono/routes/mcp.d.ts +22 -29
- package/dist/hono/routes/mcp.d.ts.map +1 -1
- package/dist/hono/routes/mcp.js +64 -28
- package/dist/hono/routes/messages.cjs +34 -35
- package/dist/hono/routes/messages.d.ts +12 -12
- package/dist/hono/routes/messages.d.ts.map +1 -1
- package/dist/hono/routes/messages.js +41 -36
- package/dist/hono/routes/prompts.cjs +10 -4
- package/dist/hono/routes/prompts.d.ts +4 -4
- package/dist/hono/routes/prompts.d.ts.map +1 -1
- package/dist/hono/routes/prompts.js +15 -5
- package/dist/hono/routes/queue.cjs +42 -29
- package/dist/hono/routes/queue.d.ts +9 -9
- package/dist/hono/routes/queue.d.ts.map +1 -1
- package/dist/hono/routes/queue.js +49 -30
- package/dist/hono/routes/resources.d.ts +1 -1
- package/dist/hono/routes/schedules.d.ts +4 -4
- package/dist/hono/routes/search.d.ts +4 -4
- package/dist/hono/routes/sessions.cjs +7 -2
- package/dist/hono/routes/sessions.d.ts +12 -12
- package/dist/hono/routes/sessions.d.ts.map +1 -1
- package/dist/hono/routes/sessions.js +7 -2
- package/dist/hono/routes/tools.d.ts +1 -1
- package/dist/hono/routes/webhooks.cjs +59 -24
- package/dist/hono/routes/webhooks.d.ts +7 -7
- package/dist/hono/routes/webhooks.d.ts.map +1 -1
- package/dist/hono/routes/webhooks.js +59 -24
- package/dist/hono/schemas/responses.cjs +112 -2
- package/dist/hono/schemas/responses.d.ts +246 -54
- package/dist/hono/schemas/responses.d.ts.map +1 -1
- package/dist/hono/schemas/responses.js +105 -1
- package/package.json +7 -7
|
@@ -20,6 +20,7 @@ var responses_exports = {};
|
|
|
20
20
|
__export(responses_exports, {
|
|
21
21
|
AgentCardSchema: () => import_core4.AgentCardSchema,
|
|
22
22
|
AgentRegistryEntrySchema: () => AgentRegistryEntrySchema,
|
|
23
|
+
ApiErrorResponseSchema: () => ApiErrorResponseSchema,
|
|
23
24
|
CatalogModelInfoSchema: () => CatalogModelInfoSchema,
|
|
24
25
|
ContentPartSchema: () => ContentPartSchema,
|
|
25
26
|
DeleteResponseSchema: () => DeleteResponseSchema,
|
|
@@ -29,6 +30,7 @@ __export(responses_exports, {
|
|
|
29
30
|
HttpServerConfigSchema: () => import_core5.HttpServerConfigSchema,
|
|
30
31
|
ImagePartSchema: () => ImagePartSchema,
|
|
31
32
|
InternalMessageSchema: () => InternalMessageSchema,
|
|
33
|
+
IssueSchema: () => IssueSchema,
|
|
32
34
|
LLMConfigBaseSchema: () => import_core3.LLMConfigBaseSchema,
|
|
33
35
|
LLMConfigResponseSchema: () => LLMConfigResponseSchema,
|
|
34
36
|
LLMConfigSchema: () => LLMConfigSchema,
|
|
@@ -45,6 +47,8 @@ __export(responses_exports, {
|
|
|
45
47
|
PromptInfoSchema: () => PromptInfoSchema,
|
|
46
48
|
PromptSchema: () => PromptSchema,
|
|
47
49
|
ProviderCatalogSchema: () => ProviderCatalogSchema,
|
|
50
|
+
RequestContentPartSchema: () => RequestContentPartSchema,
|
|
51
|
+
RequestContentSchema: () => RequestContentSchema,
|
|
48
52
|
ResourceConfigSchema: () => import_core7.ResourceConfigSchema,
|
|
49
53
|
ResourceSchema: () => ResourceSchema,
|
|
50
54
|
ScheduleSchema: () => ScheduleSchema,
|
|
@@ -67,7 +71,9 @@ __export(responses_exports, {
|
|
|
67
71
|
UIResourcePartSchema: () => UIResourcePartSchema,
|
|
68
72
|
UsageSummarySchema: () => UsageSummarySchema,
|
|
69
73
|
WebhookSchema: () => WebhookSchema,
|
|
70
|
-
WorkspaceSchema: () => WorkspaceSchema
|
|
74
|
+
WorkspaceSchema: () => WorkspaceSchema,
|
|
75
|
+
toApiContentPart: () => toApiContentPart,
|
|
76
|
+
toContentInput: () => toContentInput
|
|
71
77
|
});
|
|
72
78
|
module.exports = __toCommonJS(responses_exports);
|
|
73
79
|
var import_zod = require("zod");
|
|
@@ -78,6 +84,32 @@ var import_core4 = require("@dexto/core");
|
|
|
78
84
|
var import_core5 = require("@dexto/core");
|
|
79
85
|
var import_core6 = require("@dexto/core");
|
|
80
86
|
var import_core7 = require("@dexto/core");
|
|
87
|
+
const IssueSchema = import_zod.z.object({
|
|
88
|
+
code: import_zod.z.string().describe("Machine-readable issue code"),
|
|
89
|
+
message: import_zod.z.string().describe("Human-readable issue message"),
|
|
90
|
+
scope: import_zod.z.string().describe("Domain that produced the issue"),
|
|
91
|
+
type: import_zod.z.string().describe("Error type used for HTTP status mapping"),
|
|
92
|
+
severity: import_zod.z.enum(["error", "warning"]).describe("Issue severity"),
|
|
93
|
+
path: import_zod.z.array(import_zod.z.union([import_zod.z.string(), import_zod.z.number()])).optional().describe("Optional location for the issue"),
|
|
94
|
+
context: import_zod.z.unknown().optional().describe("Optional structured issue context")
|
|
95
|
+
}).strict().describe("Structured validation or runtime issue");
|
|
96
|
+
const ApiErrorResponseSchema = import_zod.z.object({
|
|
97
|
+
name: import_zod.z.string().optional().describe("Optional error class name"),
|
|
98
|
+
message: import_zod.z.string().describe("Human-readable error message"),
|
|
99
|
+
code: import_zod.z.string().optional().describe("Machine-readable error code"),
|
|
100
|
+
scope: import_zod.z.string().optional().describe("Domain that produced the error"),
|
|
101
|
+
type: import_zod.z.string().optional().describe("Error type used for HTTP status mapping"),
|
|
102
|
+
severity: import_zod.z.enum(["error", "warning"]).optional().describe("Optional error severity for lightweight failures"),
|
|
103
|
+
endpoint: import_zod.z.string().describe("Request path that failed"),
|
|
104
|
+
method: import_zod.z.string().describe("HTTP method for the failed request"),
|
|
105
|
+
traceId: import_zod.z.string().optional().describe("Optional trace identifier"),
|
|
106
|
+
recovery: import_zod.z.union([import_zod.z.string(), import_zod.z.array(import_zod.z.string())]).optional().describe("Optional recovery guidance"),
|
|
107
|
+
context: import_zod.z.unknown().optional().describe("Optional structured error context"),
|
|
108
|
+
issues: import_zod.z.array(IssueSchema).optional().describe("Validation issues when present"),
|
|
109
|
+
errorCount: import_zod.z.number().int().nonnegative().optional().describe("Number of errors"),
|
|
110
|
+
warningCount: import_zod.z.number().int().nonnegative().optional().describe("Number of warnings"),
|
|
111
|
+
stack: import_zod.z.string().optional().describe("Development-only stack trace")
|
|
112
|
+
}).strict().describe("Standard API error response");
|
|
81
113
|
const TextPartSchema = import_zod.z.object({
|
|
82
114
|
type: import_zod.z.literal("text").describe("Part type: text"),
|
|
83
115
|
text: import_zod.z.string().describe("Text content")
|
|
@@ -113,6 +145,78 @@ const ContentPartSchema = import_zod.z.discriminatedUnion("type", [
|
|
|
113
145
|
FilePartSchema,
|
|
114
146
|
UIResourcePartSchema
|
|
115
147
|
]).describe("Message content part (text, image, file, or UI resource)");
|
|
148
|
+
const RequestContentPartSchema = import_zod.z.discriminatedUnion("type", [TextPartSchema, ImagePartSchema, FilePartSchema]).describe("Request message content part (text, image, or file)");
|
|
149
|
+
const RequestContentSchema = import_zod.z.union([import_zod.z.string(), import_zod.z.array(RequestContentPartSchema)]).describe("Message content - string for text, or ContentPart[] for multimodal");
|
|
150
|
+
function serializeBinaryValue(value) {
|
|
151
|
+
if (typeof value === "string") {
|
|
152
|
+
return value;
|
|
153
|
+
}
|
|
154
|
+
if (value instanceof URL) {
|
|
155
|
+
return value.toString();
|
|
156
|
+
}
|
|
157
|
+
if (value instanceof ArrayBuffer) {
|
|
158
|
+
return Buffer.from(new Uint8Array(value)).toString("base64");
|
|
159
|
+
}
|
|
160
|
+
return Buffer.from(value).toString("base64");
|
|
161
|
+
}
|
|
162
|
+
function toContentInput(rawContent) {
|
|
163
|
+
if (typeof rawContent === "string") {
|
|
164
|
+
return [{ type: "text", text: rawContent }];
|
|
165
|
+
}
|
|
166
|
+
return rawContent.map((part) => {
|
|
167
|
+
switch (part.type) {
|
|
168
|
+
case "text":
|
|
169
|
+
return {
|
|
170
|
+
type: "text",
|
|
171
|
+
text: part.text
|
|
172
|
+
};
|
|
173
|
+
case "image":
|
|
174
|
+
return {
|
|
175
|
+
type: "image",
|
|
176
|
+
image: part.image,
|
|
177
|
+
...part.mimeType !== void 0 ? { mimeType: part.mimeType } : {}
|
|
178
|
+
};
|
|
179
|
+
case "file":
|
|
180
|
+
return {
|
|
181
|
+
type: "file",
|
|
182
|
+
data: part.data,
|
|
183
|
+
mimeType: part.mimeType,
|
|
184
|
+
...part.filename !== void 0 ? { filename: part.filename } : {}
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function toApiContentPart(part) {
|
|
190
|
+
switch (part.type) {
|
|
191
|
+
case "text":
|
|
192
|
+
return {
|
|
193
|
+
type: "text",
|
|
194
|
+
text: part.text
|
|
195
|
+
};
|
|
196
|
+
case "image":
|
|
197
|
+
return {
|
|
198
|
+
type: "image",
|
|
199
|
+
image: serializeBinaryValue(part.image),
|
|
200
|
+
...part.mimeType !== void 0 ? { mimeType: part.mimeType } : {}
|
|
201
|
+
};
|
|
202
|
+
case "file":
|
|
203
|
+
return {
|
|
204
|
+
type: "file",
|
|
205
|
+
data: serializeBinaryValue(part.data),
|
|
206
|
+
mimeType: part.mimeType,
|
|
207
|
+
...part.filename !== void 0 ? { filename: part.filename } : {}
|
|
208
|
+
};
|
|
209
|
+
case "ui-resource":
|
|
210
|
+
return {
|
|
211
|
+
type: "ui-resource",
|
|
212
|
+
uri: part.uri,
|
|
213
|
+
mimeType: part.mimeType,
|
|
214
|
+
...part.content !== void 0 ? { content: part.content } : {},
|
|
215
|
+
...part.blob !== void 0 ? { blob: part.blob } : {},
|
|
216
|
+
...part.metadata !== void 0 ? { metadata: part.metadata } : {}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
}
|
|
116
220
|
const ToolCallSchema = import_zod.z.object({
|
|
117
221
|
id: import_zod.z.string().describe("Unique identifier for this tool call"),
|
|
118
222
|
type: import_zod.z.literal("function").describe("Tool call type (currently only function is supported)"),
|
|
@@ -396,6 +500,7 @@ const DeleteResponseSchema = import_zod.z.object({
|
|
|
396
500
|
0 && (module.exports = {
|
|
397
501
|
AgentCardSchema,
|
|
398
502
|
AgentRegistryEntrySchema,
|
|
503
|
+
ApiErrorResponseSchema,
|
|
399
504
|
CatalogModelInfoSchema,
|
|
400
505
|
ContentPartSchema,
|
|
401
506
|
DeleteResponseSchema,
|
|
@@ -405,6 +510,7 @@ const DeleteResponseSchema = import_zod.z.object({
|
|
|
405
510
|
HttpServerConfigSchema,
|
|
406
511
|
ImagePartSchema,
|
|
407
512
|
InternalMessageSchema,
|
|
513
|
+
IssueSchema,
|
|
408
514
|
LLMConfigBaseSchema,
|
|
409
515
|
LLMConfigResponseSchema,
|
|
410
516
|
LLMConfigSchema,
|
|
@@ -421,6 +527,8 @@ const DeleteResponseSchema = import_zod.z.object({
|
|
|
421
527
|
PromptInfoSchema,
|
|
422
528
|
PromptSchema,
|
|
423
529
|
ProviderCatalogSchema,
|
|
530
|
+
RequestContentPartSchema,
|
|
531
|
+
RequestContentSchema,
|
|
424
532
|
ResourceConfigSchema,
|
|
425
533
|
ResourceSchema,
|
|
426
534
|
ScheduleSchema,
|
|
@@ -443,5 +551,7 @@ const DeleteResponseSchema = import_zod.z.object({
|
|
|
443
551
|
UIResourcePartSchema,
|
|
444
552
|
UsageSummarySchema,
|
|
445
553
|
WebhookSchema,
|
|
446
|
-
WorkspaceSchema
|
|
554
|
+
WorkspaceSchema,
|
|
555
|
+
toApiContentPart,
|
|
556
|
+
toContentInput
|
|
447
557
|
});
|