@dexto/server 1.6.20 → 1.6.22
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/approval/wire-approval-events.cjs +44 -0
- package/dist/approval/wire-approval-events.d.ts +4 -0
- package/dist/approval/wire-approval-events.d.ts.map +1 -0
- package/dist/approval/wire-approval-events.js +20 -0
- package/dist/events/session-sse-subscriber.cjs +167 -0
- package/dist/events/session-sse-subscriber.d.ts +13 -0
- package/dist/events/session-sse-subscriber.d.ts.map +1 -0
- package/dist/events/session-sse-subscriber.js +143 -0
- package/dist/hono/__tests__/test-fixtures.cjs +8 -0
- package/dist/hono/__tests__/test-fixtures.d.ts +1 -0
- package/dist/hono/__tests__/test-fixtures.d.ts.map +1 -1
- package/dist/hono/__tests__/test-fixtures.js +8 -0
- package/dist/hono/index.cjs +40 -8
- package/dist/hono/index.d.ts +45 -4531
- package/dist/hono/index.d.ts.map +1 -1
- package/dist/hono/index.js +43 -9
- package/dist/hono/node/index.cjs +51 -6
- package/dist/hono/node/index.d.ts.map +1 -1
- package/dist/hono/node/index.js +51 -6
- 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 +382 -349
- package/dist/hono/routes/llm.d.ts +12148 -98
- package/dist/hono/routes/llm.d.ts.map +1 -1
- package/dist/hono/routes/llm.js +386 -349
- 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 +189 -191
- package/dist/hono/routes/messages.d.ts +3900 -12
- package/dist/hono/routes/messages.d.ts.map +1 -1
- package/dist/hono/routes/messages.js +192 -191
- package/dist/hono/routes/models.cjs +106 -64
- package/dist/hono/routes/models.d.ts +2875 -2
- 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 +5240 -11
- 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 +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 +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 +3094 -17
- package/dist/hono/routes/search.d.ts.map +1 -1
- package/dist/hono/routes/search.js +40 -31
- package/dist/hono/routes/sessions.cjs +491 -393
- package/dist/hono/routes/sessions.d.ts +18263 -65
- package/dist/hono/routes/sessions.d.ts.map +1 -1
- package/dist/hono/routes/sessions.js +497 -395
- 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 +463 -260
- package/dist/hono/schemas/responses.d.ts +1893 -209
- package/dist/hono/schemas/responses.d.ts.map +1 -1
- package/dist/hono/schemas/responses.js +203 -14
- package/dist/hono/start-server.cjs +9 -0
- package/dist/hono/start-server.d.ts.map +1 -1
- package/dist/hono/start-server.js +9 -0
- package/dist/hono/types.d.ts +11 -0
- package/dist/hono/types.d.ts.map +1 -1
- package/dist/index.cjs +5 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/schedules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"schedules.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/schedules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAe,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAclE,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;EAc2B,CAAC;AAEtD,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;EAE2B,CAAC;AA0CtD,QAAA,MAAM,qBAAqB;;;;;;EAKgB,CAAC;AAgC5C,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,MAAM,MAAM,qBAAqB,GAC3B,eAAe,GACf,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,kBAAkB,CAAC"}
|
|
@@ -19,6 +19,27 @@ const CreateScheduleSchema = z.object({
|
|
|
19
19
|
workspacePath: z.string().optional().nullable().describe("Optional workspace path for scheduled runs")
|
|
20
20
|
}).strict().describe("Request body for creating a schedule");
|
|
21
21
|
const UpdateScheduleSchema = CreateScheduleSchema.partial().strict().describe("Request body for updating a schedule");
|
|
22
|
+
const ListSchedulesResponseSchema = z.object({
|
|
23
|
+
schedules: z.array(ScheduleSchema).describe("Schedule list")
|
|
24
|
+
}).strict().describe("List schedules response");
|
|
25
|
+
const CreateScheduleResponseSchema = z.object({
|
|
26
|
+
schedule: ScheduleSchema
|
|
27
|
+
}).strict().describe("Create schedule response");
|
|
28
|
+
const UpdateScheduleResponseSchema = z.object({
|
|
29
|
+
schedule: ScheduleSchema
|
|
30
|
+
}).strict().describe("Update schedule response");
|
|
31
|
+
const DeleteScheduleResponseSchema = z.object({
|
|
32
|
+
deleted: z.boolean().describe("Whether the schedule was deleted")
|
|
33
|
+
}).strict().describe("Delete schedule response");
|
|
34
|
+
const TriggerScheduleResponseSchema = z.object({
|
|
35
|
+
scheduled: z.boolean().describe("Whether the schedule was queued. Execution is omitted when false."),
|
|
36
|
+
execution: ExecutionLogSchema.optional().describe(
|
|
37
|
+
"Execution log (present when scheduled is true)"
|
|
38
|
+
)
|
|
39
|
+
}).strict().describe("Trigger schedule response");
|
|
40
|
+
const ScheduleIdParamSchema = z.object({
|
|
41
|
+
scheduleId: z.string().min(1).describe("Schedule ID")
|
|
42
|
+
}).strict().describe("Schedule identifier params");
|
|
22
43
|
const isScheduleNotFoundError = (error) => error instanceof DextoRuntimeError && error.type === ErrorType.NOT_FOUND && error.code === SchedulerErrorCode.SCHEDULE_NOT_FOUND;
|
|
23
44
|
const logSchedulerError = (agent, message, error) => {
|
|
24
45
|
if (!agent?.logger) {
|
|
@@ -37,258 +58,241 @@ const toErrorResponse = (message, code) => ({
|
|
|
37
58
|
...code ? { code } : {}
|
|
38
59
|
}
|
|
39
60
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
method: "get",
|
|
53
|
-
path: "/schedules",
|
|
54
|
-
summary: "List Schedules",
|
|
55
|
-
description: "Retrieves all automation schedules",
|
|
56
|
-
tags: ["schedules"],
|
|
57
|
-
responses: {
|
|
58
|
-
200: {
|
|
59
|
-
description: "List of schedules",
|
|
60
|
-
content: {
|
|
61
|
-
"application/json": {
|
|
62
|
-
schema: z.object({
|
|
63
|
-
schedules: z.array(ScheduleSchema).describe("Schedule list")
|
|
64
|
-
}).strict()
|
|
65
|
-
}
|
|
61
|
+
const listRoute = createRoute({
|
|
62
|
+
method: "get",
|
|
63
|
+
path: "/schedules",
|
|
64
|
+
summary: "List Schedules",
|
|
65
|
+
description: "Retrieves all automation schedules",
|
|
66
|
+
tags: ["schedules"],
|
|
67
|
+
responses: {
|
|
68
|
+
200: {
|
|
69
|
+
description: "List of schedules",
|
|
70
|
+
content: {
|
|
71
|
+
"application/json": {
|
|
72
|
+
schema: ListSchedulesResponseSchema
|
|
66
73
|
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
500: {
|
|
77
|
+
description: "Failed to list schedules",
|
|
78
|
+
content: {
|
|
79
|
+
"application/json": {
|
|
80
|
+
schema: ErrorResponseSchema
|
|
74
81
|
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
503: {
|
|
85
|
+
description: "Scheduler tools are not enabled",
|
|
86
|
+
content: {
|
|
87
|
+
"application/json": {
|
|
88
|
+
schema: ErrorResponseSchema
|
|
82
89
|
}
|
|
83
90
|
}
|
|
84
91
|
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
const createRouteDef = createRoute({
|
|
95
|
+
method: "post",
|
|
96
|
+
path: "/schedules",
|
|
97
|
+
summary: "Create Schedule",
|
|
98
|
+
description: "Creates a new automation schedule",
|
|
99
|
+
tags: ["schedules"],
|
|
100
|
+
request: { body: { content: { "application/json": { schema: CreateScheduleSchema } } } },
|
|
101
|
+
responses: {
|
|
102
|
+
201: {
|
|
103
|
+
description: "Created schedule",
|
|
104
|
+
content: {
|
|
105
|
+
"application/json": {
|
|
106
|
+
schema: CreateScheduleResponseSchema
|
|
100
107
|
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
400: {
|
|
111
|
+
description: "Validation error",
|
|
112
|
+
content: {
|
|
113
|
+
"application/json": {
|
|
114
|
+
schema: ErrorResponseSchema
|
|
108
115
|
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
429: {
|
|
119
|
+
description: "Schedule limit reached",
|
|
120
|
+
content: {
|
|
121
|
+
"application/json": {
|
|
122
|
+
schema: ErrorResponseSchema
|
|
116
123
|
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
500: {
|
|
127
|
+
description: "Failed to create schedule",
|
|
128
|
+
content: {
|
|
129
|
+
"application/json": {
|
|
130
|
+
schema: ErrorResponseSchema
|
|
124
131
|
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
503: {
|
|
135
|
+
description: "Scheduler tools are not enabled",
|
|
136
|
+
content: {
|
|
137
|
+
"application/json": {
|
|
138
|
+
schema: ErrorResponseSchema
|
|
132
139
|
}
|
|
133
140
|
}
|
|
134
141
|
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
schema: z.object({ schedule: ScheduleSchema }).strict()
|
|
154
|
-
}
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
const updateRoute = createRoute({
|
|
145
|
+
method: "patch",
|
|
146
|
+
path: "/schedules/{scheduleId}",
|
|
147
|
+
summary: "Update Schedule",
|
|
148
|
+
description: "Updates an existing schedule",
|
|
149
|
+
tags: ["schedules"],
|
|
150
|
+
request: {
|
|
151
|
+
params: ScheduleIdParamSchema,
|
|
152
|
+
body: { content: { "application/json": { schema: UpdateScheduleSchema } } }
|
|
153
|
+
},
|
|
154
|
+
responses: {
|
|
155
|
+
200: {
|
|
156
|
+
description: "Updated schedule",
|
|
157
|
+
content: {
|
|
158
|
+
"application/json": {
|
|
159
|
+
schema: UpdateScheduleResponseSchema
|
|
155
160
|
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
400: {
|
|
164
|
+
description: "Validation error",
|
|
165
|
+
content: {
|
|
166
|
+
"application/json": {
|
|
167
|
+
schema: ErrorResponseSchema
|
|
163
168
|
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
404: {
|
|
172
|
+
description: "Schedule not found",
|
|
173
|
+
content: {
|
|
174
|
+
"application/json": {
|
|
175
|
+
schema: ErrorResponseSchema
|
|
171
176
|
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
500: {
|
|
180
|
+
description: "Failed to update schedule",
|
|
181
|
+
content: {
|
|
182
|
+
"application/json": {
|
|
183
|
+
schema: ErrorResponseSchema
|
|
179
184
|
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
503: {
|
|
188
|
+
description: "Scheduler tools are not enabled",
|
|
189
|
+
content: {
|
|
190
|
+
"application/json": {
|
|
191
|
+
schema: ErrorResponseSchema
|
|
187
192
|
}
|
|
188
193
|
}
|
|
189
194
|
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
schema: z.object({
|
|
208
|
-
deleted: z.boolean().describe("Whether the schedule was deleted")
|
|
209
|
-
}).strict().describe("Delete schedule response")
|
|
210
|
-
}
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
const deleteRoute = createRoute({
|
|
198
|
+
method: "delete",
|
|
199
|
+
path: "/schedules/{scheduleId}",
|
|
200
|
+
summary: "Delete Schedule",
|
|
201
|
+
description: "Deletes an automation schedule",
|
|
202
|
+
tags: ["schedules"],
|
|
203
|
+
request: {
|
|
204
|
+
params: ScheduleIdParamSchema
|
|
205
|
+
},
|
|
206
|
+
responses: {
|
|
207
|
+
200: {
|
|
208
|
+
description: "Schedule deleted",
|
|
209
|
+
content: {
|
|
210
|
+
"application/json": {
|
|
211
|
+
schema: DeleteScheduleResponseSchema
|
|
211
212
|
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
404: {
|
|
216
|
+
description: "Schedule not found",
|
|
217
|
+
content: {
|
|
218
|
+
"application/json": {
|
|
219
|
+
schema: ErrorResponseSchema
|
|
219
220
|
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
500: {
|
|
224
|
+
description: "Failed to delete schedule",
|
|
225
|
+
content: {
|
|
226
|
+
"application/json": {
|
|
227
|
+
schema: ErrorResponseSchema
|
|
227
228
|
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
503: {
|
|
232
|
+
description: "Scheduler tools are not enabled",
|
|
233
|
+
content: {
|
|
234
|
+
"application/json": {
|
|
235
|
+
schema: ErrorResponseSchema
|
|
235
236
|
}
|
|
236
237
|
}
|
|
237
238
|
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
schema: z.object({
|
|
256
|
-
scheduled: z.boolean().describe(
|
|
257
|
-
"Whether the schedule was queued. Execution is omitted when false."
|
|
258
|
-
),
|
|
259
|
-
execution: ExecutionLogSchema.optional().describe(
|
|
260
|
-
"Execution log (present when scheduled is true)"
|
|
261
|
-
)
|
|
262
|
-
}).strict().describe("Trigger schedule response")
|
|
263
|
-
}
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
const triggerRoute = createRoute({
|
|
242
|
+
method: "post",
|
|
243
|
+
path: "/schedules/{scheduleId}/trigger",
|
|
244
|
+
summary: "Trigger Schedule",
|
|
245
|
+
description: "Runs a schedule immediately and waits for execution to complete (bounded by executionTimeout, default 5 minutes). Clients should set timeouts accordingly.",
|
|
246
|
+
tags: ["schedules"],
|
|
247
|
+
request: {
|
|
248
|
+
params: ScheduleIdParamSchema
|
|
249
|
+
},
|
|
250
|
+
responses: {
|
|
251
|
+
200: {
|
|
252
|
+
description: "Schedule triggered",
|
|
253
|
+
content: {
|
|
254
|
+
"application/json": {
|
|
255
|
+
schema: TriggerScheduleResponseSchema
|
|
264
256
|
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
404: {
|
|
260
|
+
description: "Schedule not found",
|
|
261
|
+
content: {
|
|
262
|
+
"application/json": {
|
|
263
|
+
schema: ErrorResponseSchema
|
|
272
264
|
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
500: {
|
|
268
|
+
description: "Failed to trigger schedule",
|
|
269
|
+
content: {
|
|
270
|
+
"application/json": {
|
|
271
|
+
schema: ErrorResponseSchema
|
|
280
272
|
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
503: {
|
|
276
|
+
description: "Scheduler tools are not enabled",
|
|
277
|
+
content: {
|
|
278
|
+
"application/json": {
|
|
279
|
+
schema: ErrorResponseSchema
|
|
288
280
|
}
|
|
289
281
|
}
|
|
290
282
|
}
|
|
291
|
-
}
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
function createSchedulesRouter(getAgent) {
|
|
286
|
+
const app = new OpenAPIHono();
|
|
287
|
+
const resolveScheduler = async (ctx) => {
|
|
288
|
+
const agent = await getAgent(ctx);
|
|
289
|
+
const agentId = agent.config?.agentId ?? "default";
|
|
290
|
+
let scheduler = getSchedulerManager(agentId) ?? null;
|
|
291
|
+
if (!scheduler) {
|
|
292
|
+
scheduler = await ensureSchedulerManagerForAgent(agent);
|
|
293
|
+
}
|
|
294
|
+
return { scheduler, agent };
|
|
295
|
+
};
|
|
292
296
|
return app.openapi(listRoute, async (ctx) => {
|
|
293
297
|
const { scheduler, agent } = await resolveScheduler(ctx);
|
|
294
298
|
if (!scheduler) {
|
|
@@ -299,7 +303,7 @@ function createSchedulesRouter(getAgent) {
|
|
|
299
303
|
}
|
|
300
304
|
try {
|
|
301
305
|
const schedules = await scheduler.listSchedules();
|
|
302
|
-
return ctx.json({ schedules }, 200);
|
|
306
|
+
return ctx.json(ListSchedulesResponseSchema.parse({ schedules }), 200);
|
|
303
307
|
} catch (error) {
|
|
304
308
|
const message = error instanceof Error ? error.message : String(error ?? "Unknown error");
|
|
305
309
|
logSchedulerError(agent, "Failed to list schedules", error);
|
|
@@ -328,7 +332,7 @@ function createSchedulesRouter(getAgent) {
|
|
|
328
332
|
};
|
|
329
333
|
try {
|
|
330
334
|
const schedule = await scheduler.createSchedule(createPayload);
|
|
331
|
-
return ctx.json({ schedule }, 201);
|
|
335
|
+
return ctx.json(CreateScheduleResponseSchema.parse({ schedule }), 201);
|
|
332
336
|
} catch (error) {
|
|
333
337
|
if (error instanceof DextoRuntimeError && error.code === SchedulerErrorCode.SCHEDULE_INVALID_CRON) {
|
|
334
338
|
return ctx.json(toErrorResponse(error.message, String(error.code)), 400);
|
|
@@ -362,7 +366,7 @@ function createSchedulesRouter(getAgent) {
|
|
|
362
366
|
};
|
|
363
367
|
try {
|
|
364
368
|
const schedule = await scheduler.updateSchedule(scheduleId, updatePayload);
|
|
365
|
-
return ctx.json({ schedule }, 200);
|
|
369
|
+
return ctx.json(UpdateScheduleResponseSchema.parse({ schedule }), 200);
|
|
366
370
|
} catch (error) {
|
|
367
371
|
if (isScheduleNotFoundError(error)) {
|
|
368
372
|
return ctx.json(
|
|
@@ -393,7 +397,7 @@ function createSchedulesRouter(getAgent) {
|
|
|
393
397
|
const { scheduleId } = ctx.req.valid("param");
|
|
394
398
|
try {
|
|
395
399
|
await scheduler.deleteSchedule(scheduleId);
|
|
396
|
-
return ctx.json({ deleted: true }, 200);
|
|
400
|
+
return ctx.json(DeleteScheduleResponseSchema.parse({ deleted: true }), 200);
|
|
397
401
|
} catch (error) {
|
|
398
402
|
if (isScheduleNotFoundError(error)) {
|
|
399
403
|
return ctx.json(
|
|
@@ -418,7 +422,10 @@ function createSchedulesRouter(getAgent) {
|
|
|
418
422
|
const { scheduleId } = ctx.req.valid("param");
|
|
419
423
|
try {
|
|
420
424
|
const execution = await scheduler.triggerScheduleNow(scheduleId);
|
|
421
|
-
return ctx.json(
|
|
425
|
+
return ctx.json(
|
|
426
|
+
TriggerScheduleResponseSchema.parse({ scheduled: true, execution }),
|
|
427
|
+
200
|
|
428
|
+
);
|
|
422
429
|
} catch (error) {
|
|
423
430
|
if (isScheduleNotFoundError(error)) {
|
|
424
431
|
return ctx.json(
|
|
@@ -33,36 +33,40 @@ const MessageSearchQuery = import_zod_openapi.z.object({
|
|
|
33
33
|
const SessionSearchQuery = import_zod_openapi.z.object({
|
|
34
34
|
q: import_zod_openapi.z.string().min(1, "Search query is required").describe("Search query string")
|
|
35
35
|
});
|
|
36
|
+
const messagesRoute = (0, import_zod_openapi.createRoute)({
|
|
37
|
+
method: "get",
|
|
38
|
+
path: "/search/messages",
|
|
39
|
+
summary: "Search Messages",
|
|
40
|
+
description: "Searches for messages across all sessions or within a specific session",
|
|
41
|
+
tags: ["search"],
|
|
42
|
+
request: { query: MessageSearchQuery },
|
|
43
|
+
responses: {
|
|
44
|
+
200: {
|
|
45
|
+
description: "Message search results",
|
|
46
|
+
content: { "application/json": { schema: import_responses.MessageSearchResponseSchema } }
|
|
47
|
+
},
|
|
48
|
+
400: import_responses.BadRequestErrorResponse,
|
|
49
|
+
500: import_responses.InternalErrorResponse
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const sessionsRoute = (0, import_zod_openapi.createRoute)({
|
|
53
|
+
method: "get",
|
|
54
|
+
path: "/search/sessions",
|
|
55
|
+
summary: "Search Sessions",
|
|
56
|
+
description: "Searches for sessions that contain the specified query",
|
|
57
|
+
tags: ["search"],
|
|
58
|
+
request: { query: SessionSearchQuery },
|
|
59
|
+
responses: {
|
|
60
|
+
200: {
|
|
61
|
+
description: "Session search results",
|
|
62
|
+
content: { "application/json": { schema: import_responses.SessionSearchResponseSchema } }
|
|
63
|
+
},
|
|
64
|
+
400: import_responses.BadRequestErrorResponse,
|
|
65
|
+
500: import_responses.InternalErrorResponse
|
|
66
|
+
}
|
|
67
|
+
});
|
|
36
68
|
function createSearchRouter(getAgent) {
|
|
37
69
|
const app = new import_zod_openapi.OpenAPIHono();
|
|
38
|
-
const messagesRoute = (0, import_zod_openapi.createRoute)({
|
|
39
|
-
method: "get",
|
|
40
|
-
path: "/search/messages",
|
|
41
|
-
summary: "Search Messages",
|
|
42
|
-
description: "Searches for messages across all sessions or within a specific session",
|
|
43
|
-
tags: ["search"],
|
|
44
|
-
request: { query: MessageSearchQuery },
|
|
45
|
-
responses: {
|
|
46
|
-
200: {
|
|
47
|
-
description: "Message search results",
|
|
48
|
-
content: { "application/json": { schema: import_responses.MessageSearchResponseSchema } }
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
const sessionsRoute = (0, import_zod_openapi.createRoute)({
|
|
53
|
-
method: "get",
|
|
54
|
-
path: "/search/sessions",
|
|
55
|
-
summary: "Search Sessions",
|
|
56
|
-
description: "Searches for sessions that contain the specified query",
|
|
57
|
-
tags: ["search"],
|
|
58
|
-
request: { query: SessionSearchQuery },
|
|
59
|
-
responses: {
|
|
60
|
-
200: {
|
|
61
|
-
description: "Session search results",
|
|
62
|
-
content: { "application/json": { schema: import_responses.SessionSearchResponseSchema } }
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
70
|
return app.openapi(messagesRoute, async (ctx) => {
|
|
67
71
|
const agent = await getAgent(ctx);
|
|
68
72
|
const { q, limit, offset, sessionId, role } = ctx.req.valid("query");
|
|
@@ -73,12 +77,12 @@ function createSearchRouter(getAgent) {
|
|
|
73
77
|
...role && { role }
|
|
74
78
|
};
|
|
75
79
|
const searchResults = await agent.searchMessages(q, options);
|
|
76
|
-
return ctx.json(searchResults);
|
|
80
|
+
return ctx.json(searchResults, 200);
|
|
77
81
|
}).openapi(sessionsRoute, async (ctx) => {
|
|
78
82
|
const agent = await getAgent(ctx);
|
|
79
83
|
const { q } = ctx.req.valid("query");
|
|
80
84
|
const searchResults = await agent.searchSessions(q);
|
|
81
|
-
return ctx.json(searchResults);
|
|
85
|
+
return ctx.json(searchResults, 200);
|
|
82
86
|
});
|
|
83
87
|
}
|
|
84
88
|
// Annotate the CommonJS export names for ESM import in node:
|