@dexto/server 1.7.2 → 1.8.1
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/events/usage-event-subscriber.cjs +3 -2
- package/dist/events/usage-event-subscriber.d.ts.map +1 -1
- package/dist/events/usage-event-subscriber.js +1 -2
- package/dist/events/usage-event-types.d.ts +1 -1
- package/dist/events/usage-event-types.d.ts.map +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/agents.d.ts.map +1 -1
- 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/key.cjs +5 -5
- package/dist/hono/routes/key.js +1 -1
- package/dist/hono/routes/llm.cjs +29 -29
- package/dist/hono/routes/llm.d.ts.map +1 -1
- package/dist/hono/routes/llm.js +11 -6
- package/dist/hono/routes/messages.cjs +23 -13
- package/dist/hono/routes/messages.d.ts.map +1 -1
- package/dist/hono/routes/messages.js +23 -13
- 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 +18 -17
- 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 +13 -17
- package/package.json +8 -7
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var skills_exports = {};
|
|
20
|
+
__export(skills_exports, {
|
|
21
|
+
createSkillsRouter: () => createSkillsRouter
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(skills_exports);
|
|
24
|
+
var import_zod_openapi = require("@hono/zod-openapi");
|
|
25
|
+
var import_responses = require("../schemas/responses.js");
|
|
26
|
+
const SkillIdParamSchema = import_zod_openapi.z.object({
|
|
27
|
+
id: import_zod_openapi.z.string().min(1, "Skill id is required").describe("The skill identifier")
|
|
28
|
+
}).describe("Path parameters for skill endpoints");
|
|
29
|
+
const ListSkillsResponseSchema = import_zod_openapi.z.object({
|
|
30
|
+
skills: import_zod_openapi.z.array(import_responses.SkillSummarySchema).describe("Array of available skills")
|
|
31
|
+
}).strict().describe("Skills list response");
|
|
32
|
+
const GetSkillResponseSchema = import_zod_openapi.z.object({
|
|
33
|
+
skill: import_responses.SkillDocumentSchema.describe("Skill document")
|
|
34
|
+
}).strict().describe("Get skill response");
|
|
35
|
+
function serializeSkillSummary(skill) {
|
|
36
|
+
const { id, displayName, description } = skill;
|
|
37
|
+
return import_responses.SkillSummarySchema.parse({ id, displayName, description });
|
|
38
|
+
}
|
|
39
|
+
function serializeSkillDocument(skill) {
|
|
40
|
+
const { id, displayName, description, instructions } = skill;
|
|
41
|
+
return import_responses.SkillDocumentSchema.parse({ id, displayName, description, instructions });
|
|
42
|
+
}
|
|
43
|
+
const listRoute = (0, import_zod_openapi.createRoute)({
|
|
44
|
+
method: "get",
|
|
45
|
+
path: "/skills",
|
|
46
|
+
summary: "List Skills",
|
|
47
|
+
description: "Retrieves available skills from the active agent skill catalog",
|
|
48
|
+
tags: ["skills"],
|
|
49
|
+
responses: {
|
|
50
|
+
200: {
|
|
51
|
+
description: "List all skills",
|
|
52
|
+
content: {
|
|
53
|
+
"application/json": {
|
|
54
|
+
schema: ListSkillsResponseSchema
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
500: import_responses.InternalErrorResponse
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const getSkillRoute = (0, import_zod_openapi.createRoute)({
|
|
62
|
+
method: "get",
|
|
63
|
+
path: "/skills/{id}",
|
|
64
|
+
summary: "Get Skill",
|
|
65
|
+
description: "Fetches the full document for a specific skill",
|
|
66
|
+
tags: ["skills"],
|
|
67
|
+
request: {
|
|
68
|
+
params: SkillIdParamSchema
|
|
69
|
+
},
|
|
70
|
+
responses: {
|
|
71
|
+
200: {
|
|
72
|
+
description: "Skill document",
|
|
73
|
+
content: {
|
|
74
|
+
"application/json": {
|
|
75
|
+
schema: GetSkillResponseSchema
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
404: {
|
|
80
|
+
description: "Skill not found",
|
|
81
|
+
content: { "application/json": { schema: import_responses.ApiErrorResponseSchema } }
|
|
82
|
+
},
|
|
83
|
+
500: import_responses.InternalErrorResponse
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
function createSkillsRouter(getAgent) {
|
|
87
|
+
const app = new import_zod_openapi.OpenAPIHono();
|
|
88
|
+
return app.openapi(listRoute, async (ctx) => {
|
|
89
|
+
const agent = await getAgent(ctx);
|
|
90
|
+
const skills = await agent.skillManager.list();
|
|
91
|
+
const list = skills.map(serializeSkillSummary);
|
|
92
|
+
return ctx.json(ListSkillsResponseSchema.parse({ skills: list }), 200);
|
|
93
|
+
}).openapi(getSkillRoute, async (ctx) => {
|
|
94
|
+
const agent = await getAgent(ctx);
|
|
95
|
+
const { id } = ctx.req.valid("param");
|
|
96
|
+
const skill = await agent.skillManager.get(id);
|
|
97
|
+
if (!skill) {
|
|
98
|
+
return ctx.json(
|
|
99
|
+
import_responses.ApiErrorResponseSchema.parse({
|
|
100
|
+
message: `Skill not found: ${id}`,
|
|
101
|
+
endpoint: ctx.req.path,
|
|
102
|
+
method: ctx.req.method
|
|
103
|
+
}),
|
|
104
|
+
404
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
return ctx.json(
|
|
108
|
+
GetSkillResponseSchema.parse({ skill: serializeSkillDocument(skill) }),
|
|
109
|
+
200
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
114
|
+
0 && (module.exports = {
|
|
115
|
+
createSkillsRouter
|
|
116
|
+
});
|