@dexto/server 1.6.19 → 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.
Files changed (111) hide show
  1. package/dist/a2a/jsonrpc/methods.cjs +1 -1
  2. package/dist/a2a/jsonrpc/methods.d.ts +14 -4
  3. package/dist/a2a/jsonrpc/methods.d.ts.map +1 -1
  4. package/dist/a2a/jsonrpc/methods.js +1 -1
  5. package/dist/hono/index.cjs +39 -8
  6. package/dist/hono/index.d.ts +43 -4503
  7. package/dist/hono/index.d.ts.map +1 -1
  8. package/dist/hono/index.js +42 -9
  9. package/dist/hono/routes/a2a-jsonrpc.d.ts.map +1 -1
  10. package/dist/hono/routes/a2a-tasks.cjs +173 -34
  11. package/dist/hono/routes/a2a-tasks.d.ts +1 -498
  12. package/dist/hono/routes/a2a-tasks.d.ts.map +1 -1
  13. package/dist/hono/routes/a2a-tasks.js +177 -34
  14. package/dist/hono/routes/a2a.d.ts.map +1 -1
  15. package/dist/hono/routes/agents.cjs +410 -329
  16. package/dist/hono/routes/agents.d.ts +16048 -73
  17. package/dist/hono/routes/agents.d.ts.map +1 -1
  18. package/dist/hono/routes/agents.js +418 -330
  19. package/dist/hono/routes/approvals.cjs +103 -78
  20. package/dist/hono/routes/approvals.d.ts +2090 -112
  21. package/dist/hono/routes/approvals.d.ts.map +1 -1
  22. package/dist/hono/routes/approvals.js +108 -78
  23. package/dist/hono/routes/dexto-auth.cjs +40 -33
  24. package/dist/hono/routes/dexto-auth.d.ts +401 -2
  25. package/dist/hono/routes/dexto-auth.d.ts.map +1 -1
  26. package/dist/hono/routes/dexto-auth.js +40 -33
  27. package/dist/hono/routes/discovery.cjs +16 -14
  28. package/dist/hono/routes/discovery.d.ts +586 -1
  29. package/dist/hono/routes/discovery.d.ts.map +1 -1
  30. package/dist/hono/routes/discovery.js +16 -14
  31. package/dist/hono/routes/greeting.cjs +26 -22
  32. package/dist/hono/routes/greeting.d.ts +787 -3
  33. package/dist/hono/routes/greeting.d.ts.map +1 -1
  34. package/dist/hono/routes/greeting.js +26 -22
  35. package/dist/hono/routes/health.d.ts +1 -1
  36. package/dist/hono/routes/key.cjs +60 -52
  37. package/dist/hono/routes/key.d.ts +1597 -1
  38. package/dist/hono/routes/key.d.ts.map +1 -1
  39. package/dist/hono/routes/key.js +60 -52
  40. package/dist/hono/routes/llm.cjs +381 -348
  41. package/dist/hono/routes/llm.d.ts +12137 -87
  42. package/dist/hono/routes/llm.d.ts.map +1 -1
  43. package/dist/hono/routes/llm.js +385 -348
  44. package/dist/hono/routes/mcp.cjs +273 -212
  45. package/dist/hono/routes/mcp.d.ts +6605 -316
  46. package/dist/hono/routes/mcp.d.ts.map +1 -1
  47. package/dist/hono/routes/mcp.js +287 -213
  48. package/dist/hono/routes/memory.cjs +102 -89
  49. package/dist/hono/routes/memory.d.ts +5368 -4
  50. package/dist/hono/routes/memory.d.ts.map +1 -1
  51. package/dist/hono/routes/memory.js +108 -90
  52. package/dist/hono/routes/messages.cjs +171 -164
  53. package/dist/hono/routes/messages.d.ts +3899 -10
  54. package/dist/hono/routes/messages.d.ts.map +1 -1
  55. package/dist/hono/routes/messages.js +181 -165
  56. package/dist/hono/routes/models.cjs +106 -64
  57. package/dist/hono/routes/models.d.ts +2874 -1
  58. package/dist/hono/routes/models.d.ts.map +1 -1
  59. package/dist/hono/routes/models.js +108 -64
  60. package/dist/hono/routes/openrouter.cjs +79 -65
  61. package/dist/hono/routes/openrouter.d.ts +854 -1
  62. package/dist/hono/routes/openrouter.d.ts.map +1 -1
  63. package/dist/hono/routes/openrouter.js +79 -65
  64. package/dist/hono/routes/prompts.cjs +137 -104
  65. package/dist/hono/routes/prompts.d.ts +2820 -12
  66. package/dist/hono/routes/prompts.d.ts.map +1 -1
  67. package/dist/hono/routes/prompts.js +144 -105
  68. package/dist/hono/routes/queue.cjs +158 -132
  69. package/dist/hono/routes/queue.d.ts +5148 -13
  70. package/dist/hono/routes/queue.d.ts.map +1 -1
  71. package/dist/hono/routes/queue.js +168 -133
  72. package/dist/hono/routes/resources.cjs +65 -46
  73. package/dist/hono/routes/resources.d.ts +1983 -5
  74. package/dist/hono/routes/resources.d.ts.map +1 -1
  75. package/dist/hono/routes/resources.js +72 -47
  76. package/dist/hono/routes/schedules.cjs +233 -226
  77. package/dist/hono/routes/schedules.d.ts +4202 -26
  78. package/dist/hono/routes/schedules.d.ts.map +1 -1
  79. package/dist/hono/routes/schedules.js +233 -226
  80. package/dist/hono/routes/search.cjs +34 -30
  81. package/dist/hono/routes/search.d.ts +2837 -14
  82. package/dist/hono/routes/search.d.ts.map +1 -1
  83. package/dist/hono/routes/search.js +40 -31
  84. package/dist/hono/routes/sessions.cjs +404 -392
  85. package/dist/hono/routes/sessions.d.ts +16585 -30
  86. package/dist/hono/routes/sessions.d.ts.map +1 -1
  87. package/dist/hono/routes/sessions.js +408 -393
  88. package/dist/hono/routes/static.d.ts.map +1 -1
  89. package/dist/hono/routes/system-prompt.cjs +57 -61
  90. package/dist/hono/routes/system-prompt.d.ts +1228 -2
  91. package/dist/hono/routes/system-prompt.d.ts.map +1 -1
  92. package/dist/hono/routes/system-prompt.js +58 -62
  93. package/dist/hono/routes/tools.cjs +29 -34
  94. package/dist/hono/routes/tools.d.ts +1756 -7
  95. package/dist/hono/routes/tools.d.ts.map +1 -1
  96. package/dist/hono/routes/tools.js +33 -33
  97. package/dist/hono/routes/webhooks.cjs +159 -132
  98. package/dist/hono/routes/webhooks.d.ts +2504 -14
  99. package/dist/hono/routes/webhooks.d.ts.map +1 -1
  100. package/dist/hono/routes/webhooks.js +163 -132
  101. package/dist/hono/routes/workspaces.cjs +84 -79
  102. package/dist/hono/routes/workspaces.d.ts +2093 -2
  103. package/dist/hono/routes/workspaces.d.ts.map +1 -1
  104. package/dist/hono/routes/workspaces.js +89 -80
  105. package/dist/hono/schemas/responses.cjs +492 -235
  106. package/dist/hono/schemas/responses.d.ts +1461 -146
  107. package/dist/hono/schemas/responses.d.ts.map +1 -1
  108. package/dist/hono/schemas/responses.js +247 -9
  109. package/dist/hono/types.d.ts +11 -0
  110. package/dist/hono/types.d.ts.map +1 -1
  111. package/package.json +7 -7
@@ -20,15 +20,24 @@ var responses_exports = {};
20
20
  __export(responses_exports, {
21
21
  AgentCardSchema: () => import_core4.AgentCardSchema,
22
22
  AgentRegistryEntrySchema: () => AgentRegistryEntrySchema,
23
+ ApiErrorResponseSchema: () => ApiErrorResponseSchema,
24
+ BadRequestErrorResponse: () => BadRequestErrorResponse,
23
25
  CatalogModelInfoSchema: () => CatalogModelInfoSchema,
26
+ ConflictErrorResponse: () => ConflictErrorResponse,
24
27
  ContentPartSchema: () => ContentPartSchema,
25
28
  DeleteResponseSchema: () => DeleteResponseSchema,
26
29
  ErrorResponseSchema: () => ErrorResponseSchema,
27
30
  ExecutionLogSchema: () => ExecutionLogSchema,
28
31
  FilePartSchema: () => FilePartSchema,
32
+ ForbiddenErrorResponse: () => ForbiddenErrorResponse,
29
33
  HttpServerConfigSchema: () => import_core5.HttpServerConfigSchema,
30
34
  ImagePartSchema: () => ImagePartSchema,
35
+ InternalErrorResponse: () => InternalErrorResponse,
31
36
  InternalMessageSchema: () => InternalMessageSchema,
37
+ IssueSchema: () => IssueSchema,
38
+ JsonObjectSchema: () => JsonObjectSchema,
39
+ JsonSchemaPropertySchema: () => JsonSchemaPropertySchema,
40
+ JsonValueSchema: () => JsonValueSchema,
32
41
  LLMConfigBaseSchema: () => import_core3.LLMConfigBaseSchema,
33
42
  LLMConfigResponseSchema: () => LLMConfigResponseSchema,
34
43
  LLMConfigSchema: () => LLMConfigSchema,
@@ -37,7 +46,9 @@ __export(responses_exports, {
37
46
  MessageSearchResponseSchema: () => MessageSearchResponseSchema,
38
47
  ModelFlatSchema: () => ModelFlatSchema,
39
48
  ModelStatisticsSchema: () => ModelStatisticsSchema,
49
+ NotFoundErrorResponse: () => NotFoundErrorResponse,
40
50
  OkResponseSchema: () => OkResponseSchema,
51
+ PaymentRequiredErrorResponse: () => PaymentRequiredErrorResponse,
41
52
  PermissionsConfigSchema: () => import_core6.PermissionsConfigSchema,
42
53
  PricingStatusSchema: () => PricingStatusSchema,
43
54
  PromptArgumentSchema: () => PromptArgumentSchema,
@@ -45,6 +56,9 @@ __export(responses_exports, {
45
56
  PromptInfoSchema: () => PromptInfoSchema,
46
57
  PromptSchema: () => PromptSchema,
47
58
  ProviderCatalogSchema: () => ProviderCatalogSchema,
59
+ RateLimitErrorResponse: () => RateLimitErrorResponse,
60
+ RequestContentPartSchema: () => RequestContentPartSchema,
61
+ RequestContentSchema: () => RequestContentSchema,
48
62
  ResourceConfigSchema: () => import_core7.ResourceConfigSchema,
49
63
  ResourceSchema: () => ResourceSchema,
50
64
  ScheduleSchema: () => ScheduleSchema,
@@ -61,16 +75,21 @@ __export(responses_exports, {
61
75
  StatusResponseSchema: () => StatusResponseSchema,
62
76
  StdioServerConfigSchema: () => import_core5.StdioServerConfigSchema,
63
77
  TextPartSchema: () => TextPartSchema,
78
+ TimeoutErrorResponse: () => TimeoutErrorResponse,
64
79
  TokenUsageSchema: () => TokenUsageSchema,
65
80
  ToolCallSchema: () => ToolCallSchema,
81
+ ToolInputSchema: () => ToolInputSchema,
66
82
  ToolSchema: () => ToolSchema,
67
83
  UIResourcePartSchema: () => UIResourcePartSchema,
84
+ UpstreamErrorResponse: () => UpstreamErrorResponse,
68
85
  UsageSummarySchema: () => UsageSummarySchema,
69
86
  WebhookSchema: () => WebhookSchema,
70
- WorkspaceSchema: () => WorkspaceSchema
87
+ WorkspaceSchema: () => WorkspaceSchema,
88
+ toApiContentPart: () => toApiContentPart,
89
+ toContentInput: () => toContentInput
71
90
  });
72
91
  module.exports = __toCommonJS(responses_exports);
73
- var import_zod = require("zod");
92
+ var import_zod_openapi = require("@hono/zod-openapi");
74
93
  var import_core = require("@dexto/core");
75
94
  var import_core2 = require("@dexto/core");
76
95
  var import_core3 = require("@dexto/core");
@@ -78,333 +97,561 @@ var import_core4 = require("@dexto/core");
78
97
  var import_core5 = require("@dexto/core");
79
98
  var import_core6 = require("@dexto/core");
80
99
  var import_core7 = require("@dexto/core");
81
- const TextPartSchema = import_zod.z.object({
82
- type: import_zod.z.literal("text").describe("Part type: text"),
83
- text: import_zod.z.string().describe("Text content")
100
+ const JsonValueOpenApiPlaceholder = {
101
+ type: "object",
102
+ additionalProperties: true,
103
+ description: "Any JSON-serializable value"
104
+ };
105
+ const JsonValueSchema = import_zod_openapi.z.lazy(
106
+ () => import_zod_openapi.z.union([
107
+ import_zod_openapi.z.string(),
108
+ import_zod_openapi.z.number(),
109
+ import_zod_openapi.z.boolean(),
110
+ import_zod_openapi.z.null(),
111
+ import_zod_openapi.z.array(JsonValueSchema),
112
+ import_zod_openapi.z.record(import_zod_openapi.z.string(), JsonValueSchema)
113
+ ])
114
+ ).openapi("JsonValue", JsonValueOpenApiPlaceholder).describe("Any JSON-serializable value");
115
+ const JsonObjectSchema = import_zod_openapi.z.record(import_zod_openapi.z.string(), JsonValueSchema).openapi("JsonObject", {
116
+ type: "object",
117
+ additionalProperties: true
118
+ }).describe("JSON object with arbitrary serializable values");
119
+ const JsonSchemaPrimitiveTypeSchema = import_zod_openapi.z.enum(["string", "number", "integer", "boolean", "object", "array"]).describe("JSON Schema primitive type");
120
+ const JsonSchemaEnumValueSchema = import_zod_openapi.z.union([import_zod_openapi.z.string(), import_zod_openapi.z.number(), import_zod_openapi.z.boolean(), import_zod_openapi.z.null()]).describe("Allowed JSON Schema enum value");
121
+ const JsonSchemaPropertySchema = import_zod_openapi.z.object({
122
+ type: JsonSchemaPrimitiveTypeSchema.optional().describe("Property type"),
123
+ description: import_zod_openapi.z.string().optional().describe("Property description"),
124
+ enum: import_zod_openapi.z.array(JsonSchemaEnumValueSchema).optional().describe("Enum values"),
125
+ default: JsonValueSchema.optional().describe("Default value"),
126
+ format: import_zod_openapi.z.string().optional().describe("JSON Schema format hint")
127
+ }).passthrough().describe("JSON Schema property definition");
128
+ const ToolInputSchema = import_zod_openapi.z.object({
129
+ type: import_zod_openapi.z.literal("object").optional().describe('Schema type, always "object" when present'),
130
+ properties: import_zod_openapi.z.record(import_zod_openapi.z.string(), JsonSchemaPropertySchema).optional().describe("Property definitions"),
131
+ required: import_zod_openapi.z.array(import_zod_openapi.z.string()).optional().describe("Required property names")
132
+ }).passthrough().describe("JSON Schema for tool input parameters");
133
+ const IssueSchema = import_zod_openapi.z.object({
134
+ code: import_zod_openapi.z.string().describe("Machine-readable issue code"),
135
+ message: import_zod_openapi.z.string().describe("Human-readable issue message"),
136
+ scope: import_zod_openapi.z.string().describe("Domain that produced the issue"),
137
+ type: import_zod_openapi.z.string().describe("Error type used for HTTP status mapping"),
138
+ severity: import_zod_openapi.z.enum(["error", "warning"]).describe("Issue severity"),
139
+ path: import_zod_openapi.z.array(import_zod_openapi.z.union([import_zod_openapi.z.string(), import_zod_openapi.z.number()])).optional().describe("Optional location for the issue"),
140
+ context: JsonValueSchema.optional().describe("Optional structured issue context")
141
+ }).strict().describe("Structured validation or runtime issue");
142
+ const ApiErrorResponseSchema = import_zod_openapi.z.object({
143
+ name: import_zod_openapi.z.string().optional().describe("Optional error class name"),
144
+ message: import_zod_openapi.z.string().describe("Human-readable error message"),
145
+ code: import_zod_openapi.z.string().optional().describe("Machine-readable error code"),
146
+ scope: import_zod_openapi.z.string().optional().describe("Domain that produced the error"),
147
+ type: import_zod_openapi.z.string().optional().describe("Error type used for HTTP status mapping"),
148
+ severity: import_zod_openapi.z.enum(["error", "warning"]).optional().describe("Optional error severity for lightweight failures"),
149
+ endpoint: import_zod_openapi.z.string().describe("Request path that failed"),
150
+ method: import_zod_openapi.z.string().describe("HTTP method for the failed request"),
151
+ traceId: import_zod_openapi.z.string().optional().describe("Optional trace identifier"),
152
+ recovery: import_zod_openapi.z.union([import_zod_openapi.z.string(), import_zod_openapi.z.array(import_zod_openapi.z.string())]).optional().describe("Optional recovery guidance"),
153
+ context: JsonValueSchema.optional().describe("Optional structured error context"),
154
+ issues: import_zod_openapi.z.array(IssueSchema).optional().describe("Validation issues when present"),
155
+ errorCount: import_zod_openapi.z.number().int().nonnegative().optional().describe("Number of errors"),
156
+ warningCount: import_zod_openapi.z.number().int().nonnegative().optional().describe("Number of warnings"),
157
+ stack: import_zod_openapi.z.string().optional().describe("Development-only stack trace")
158
+ }).strict().describe("Standard API error response");
159
+ const BadRequestErrorResponse = {
160
+ description: "Validation or request error",
161
+ content: {
162
+ "application/json": {
163
+ schema: ApiErrorResponseSchema
164
+ }
165
+ }
166
+ };
167
+ const PaymentRequiredErrorResponse = {
168
+ description: "Payment required",
169
+ content: {
170
+ "application/json": {
171
+ schema: ApiErrorResponseSchema
172
+ }
173
+ }
174
+ };
175
+ const ForbiddenErrorResponse = {
176
+ description: "Forbidden",
177
+ content: {
178
+ "application/json": {
179
+ schema: ApiErrorResponseSchema
180
+ }
181
+ }
182
+ };
183
+ const NotFoundErrorResponse = {
184
+ description: "Resource not found",
185
+ content: {
186
+ "application/json": {
187
+ schema: ApiErrorResponseSchema
188
+ }
189
+ }
190
+ };
191
+ const TimeoutErrorResponse = {
192
+ description: "Request timed out",
193
+ content: {
194
+ "application/json": {
195
+ schema: ApiErrorResponseSchema
196
+ }
197
+ }
198
+ };
199
+ const ConflictErrorResponse = {
200
+ description: "Conflict",
201
+ content: {
202
+ "application/json": {
203
+ schema: ApiErrorResponseSchema
204
+ }
205
+ }
206
+ };
207
+ const RateLimitErrorResponse = {
208
+ description: "Rate limited",
209
+ content: {
210
+ "application/json": {
211
+ schema: ApiErrorResponseSchema
212
+ }
213
+ }
214
+ };
215
+ const InternalErrorResponse = {
216
+ description: "Internal server error",
217
+ content: {
218
+ "application/json": {
219
+ schema: ApiErrorResponseSchema
220
+ }
221
+ }
222
+ };
223
+ const UpstreamErrorResponse = {
224
+ description: "Upstream service failure",
225
+ content: {
226
+ "application/json": {
227
+ schema: ApiErrorResponseSchema
228
+ }
229
+ }
230
+ };
231
+ const TextPartSchema = import_zod_openapi.z.object({
232
+ type: import_zod_openapi.z.literal("text").describe("Part type: text"),
233
+ text: import_zod_openapi.z.string().describe("Text content")
84
234
  }).strict().describe("Text content part");
85
- const ImagePartSchema = import_zod.z.object({
86
- type: import_zod.z.literal("image").describe("Part type: image"),
87
- image: import_zod.z.string().describe("Base64-encoded image data"),
88
- mimeType: import_zod.z.string().optional().describe("MIME type of the image")
235
+ const ImagePartSchema = import_zod_openapi.z.object({
236
+ type: import_zod_openapi.z.literal("image").describe("Part type: image"),
237
+ image: import_zod_openapi.z.string().describe("Base64-encoded image data"),
238
+ mimeType: import_zod_openapi.z.string().optional().describe("MIME type of the image")
89
239
  }).strict().describe("Image content part");
90
- const FilePartSchema = import_zod.z.object({
91
- type: import_zod.z.literal("file").describe("Part type: file"),
92
- data: import_zod.z.string().describe("Base64-encoded file data"),
93
- mimeType: import_zod.z.string().describe("MIME type of the file"),
94
- filename: import_zod.z.string().optional().describe("Optional filename")
240
+ const FilePartSchema = import_zod_openapi.z.object({
241
+ type: import_zod_openapi.z.literal("file").describe("Part type: file"),
242
+ data: import_zod_openapi.z.string().describe("Base64-encoded file data"),
243
+ mimeType: import_zod_openapi.z.string().describe("MIME type of the file"),
244
+ filename: import_zod_openapi.z.string().optional().describe("Optional filename")
95
245
  }).strict().describe("File content part");
96
- const UIResourcePartSchema = import_zod.z.object({
97
- type: import_zod.z.literal("ui-resource").describe("Part type: ui-resource"),
98
- uri: import_zod.z.string().describe("URI identifying the UI resource (must start with ui://)"),
99
- mimeType: import_zod.z.string().describe("MIME type: text/html, text/uri-list, or application/vnd.mcp-ui.remote-dom"),
100
- content: import_zod.z.string().optional().describe("Inline HTML content or URL"),
101
- blob: import_zod.z.string().optional().describe("Base64-encoded content (alternative to content)"),
102
- metadata: import_zod.z.object({
103
- title: import_zod.z.string().optional().describe("Display title for the UI resource"),
104
- preferredSize: import_zod.z.object({
105
- width: import_zod.z.number().describe("Preferred width in pixels"),
106
- height: import_zod.z.number().describe("Preferred height in pixels")
246
+ const UIResourcePartSchema = import_zod_openapi.z.object({
247
+ type: import_zod_openapi.z.literal("ui-resource").describe("Part type: ui-resource"),
248
+ uri: import_zod_openapi.z.string().describe("URI identifying the UI resource (must start with ui://)"),
249
+ mimeType: import_zod_openapi.z.string().describe("MIME type: text/html, text/uri-list, or application/vnd.mcp-ui.remote-dom"),
250
+ content: import_zod_openapi.z.string().optional().describe("Inline HTML content or URL"),
251
+ blob: import_zod_openapi.z.string().optional().describe("Base64-encoded content (alternative to content)"),
252
+ metadata: import_zod_openapi.z.object({
253
+ title: import_zod_openapi.z.string().optional().describe("Display title for the UI resource"),
254
+ preferredSize: import_zod_openapi.z.object({
255
+ width: import_zod_openapi.z.number().describe("Preferred width in pixels"),
256
+ height: import_zod_openapi.z.number().describe("Preferred height in pixels")
107
257
  }).strict().optional().describe("Preferred rendering size")
108
258
  }).strict().optional().describe("Optional metadata for the UI resource")
109
259
  }).strict().describe("UI Resource content part for MCP-UI interactive components");
110
- const ContentPartSchema = import_zod.z.discriminatedUnion("type", [
260
+ const ContentPartSchema = import_zod_openapi.z.discriminatedUnion("type", [
111
261
  TextPartSchema,
112
262
  ImagePartSchema,
113
263
  FilePartSchema,
114
264
  UIResourcePartSchema
115
265
  ]).describe("Message content part (text, image, file, or UI resource)");
116
- const ToolCallSchema = import_zod.z.object({
117
- id: import_zod.z.string().describe("Unique identifier for this tool call"),
118
- type: import_zod.z.literal("function").describe("Tool call type (currently only function is supported)"),
119
- function: import_zod.z.object({
120
- name: import_zod.z.string().describe("Name of the function to call"),
121
- arguments: import_zod.z.string().describe("Arguments for the function in JSON string format")
266
+ const RequestContentPartSchema = import_zod_openapi.z.discriminatedUnion("type", [TextPartSchema, ImagePartSchema, FilePartSchema]).describe("Request message content part (text, image, or file)");
267
+ const RequestContentSchema = import_zod_openapi.z.union([import_zod_openapi.z.string(), import_zod_openapi.z.array(RequestContentPartSchema)]).describe("Message content - string for text, or ContentPart[] for multimodal");
268
+ function serializeBinaryValue(value) {
269
+ if (typeof value === "string") {
270
+ return value;
271
+ }
272
+ if (value instanceof URL) {
273
+ return value.toString();
274
+ }
275
+ if (value instanceof ArrayBuffer) {
276
+ return Buffer.from(new Uint8Array(value)).toString("base64");
277
+ }
278
+ return Buffer.from(value).toString("base64");
279
+ }
280
+ function toContentInput(rawContent) {
281
+ if (typeof rawContent === "string") {
282
+ return [{ type: "text", text: rawContent }];
283
+ }
284
+ return rawContent.map((part) => {
285
+ switch (part.type) {
286
+ case "text":
287
+ return {
288
+ type: "text",
289
+ text: part.text
290
+ };
291
+ case "image":
292
+ return {
293
+ type: "image",
294
+ image: part.image,
295
+ ...part.mimeType !== void 0 ? { mimeType: part.mimeType } : {}
296
+ };
297
+ case "file":
298
+ return {
299
+ type: "file",
300
+ data: part.data,
301
+ mimeType: part.mimeType,
302
+ ...part.filename !== void 0 ? { filename: part.filename } : {}
303
+ };
304
+ }
305
+ });
306
+ }
307
+ function toApiContentPart(part) {
308
+ switch (part.type) {
309
+ case "text":
310
+ return {
311
+ type: "text",
312
+ text: part.text
313
+ };
314
+ case "image":
315
+ return {
316
+ type: "image",
317
+ image: serializeBinaryValue(part.image),
318
+ ...part.mimeType !== void 0 ? { mimeType: part.mimeType } : {}
319
+ };
320
+ case "file":
321
+ return {
322
+ type: "file",
323
+ data: serializeBinaryValue(part.data),
324
+ mimeType: part.mimeType,
325
+ ...part.filename !== void 0 ? { filename: part.filename } : {}
326
+ };
327
+ case "ui-resource":
328
+ return {
329
+ type: "ui-resource",
330
+ uri: part.uri,
331
+ mimeType: part.mimeType,
332
+ ...part.content !== void 0 ? { content: part.content } : {},
333
+ ...part.blob !== void 0 ? { blob: part.blob } : {},
334
+ ...part.metadata !== void 0 ? { metadata: part.metadata } : {}
335
+ };
336
+ }
337
+ }
338
+ const ToolCallSchema = import_zod_openapi.z.object({
339
+ id: import_zod_openapi.z.string().describe("Unique identifier for this tool call"),
340
+ type: import_zod_openapi.z.literal("function").describe("Tool call type (currently only function is supported)"),
341
+ function: import_zod_openapi.z.object({
342
+ name: import_zod_openapi.z.string().describe("Name of the function to call"),
343
+ arguments: import_zod_openapi.z.string().describe("Arguments for the function in JSON string format")
122
344
  }).strict().describe("Function call details")
123
345
  }).strict().describe("Tool call made by the assistant");
124
- const TokenUsageSchema = import_zod.z.object({
125
- inputTokens: import_zod.z.number().int().nonnegative().optional().describe("Number of input tokens"),
126
- outputTokens: import_zod.z.number().int().nonnegative().optional().describe("Number of output tokens"),
127
- reasoningTokens: import_zod.z.number().int().nonnegative().optional().describe("Number of reasoning tokens"),
128
- cacheReadTokens: import_zod.z.number().int().nonnegative().optional().describe("Number of cache read tokens"),
129
- cacheWriteTokens: import_zod.z.number().int().nonnegative().optional().describe("Number of cache write tokens"),
130
- totalTokens: import_zod.z.number().int().nonnegative().optional().describe("Total tokens used")
346
+ const TokenUsageSchema = import_zod_openapi.z.object({
347
+ inputTokens: import_zod_openapi.z.number().int().nonnegative().optional().describe("Number of input tokens"),
348
+ outputTokens: import_zod_openapi.z.number().int().nonnegative().optional().describe("Number of output tokens"),
349
+ reasoningTokens: import_zod_openapi.z.number().int().nonnegative().optional().describe("Number of reasoning tokens"),
350
+ cacheReadTokens: import_zod_openapi.z.number().int().nonnegative().optional().describe("Number of cache read tokens"),
351
+ cacheWriteTokens: import_zod_openapi.z.number().int().nonnegative().optional().describe("Number of cache write tokens"),
352
+ totalTokens: import_zod_openapi.z.number().int().nonnegative().optional().describe("Total tokens used")
131
353
  }).strict().describe("Token usage accounting");
132
- const PricingStatusSchema = import_zod.z.enum(import_core.LLM_PRICING_STATUSES).describe("Whether pricing was resolved for this response");
133
- const InternalMessageSchema = import_zod.z.object({
134
- id: import_zod.z.string().uuid().optional().describe("Unique message identifier (UUID)"),
135
- role: import_zod.z.enum(["system", "user", "assistant", "tool"]).describe("Role of the message sender"),
136
- timestamp: import_zod.z.number().int().positive().optional().describe("Creation timestamp (Unix ms)"),
137
- content: import_zod.z.union([import_zod.z.string(), import_zod.z.null(), import_zod.z.array(ContentPartSchema)]).describe("Message content (string, null, or array of parts)"),
138
- reasoning: import_zod.z.string().optional().describe("Optional model reasoning text"),
354
+ const PricingStatusSchema = import_zod_openapi.z.enum(import_core.LLM_PRICING_STATUSES).describe("Whether pricing was resolved for this response");
355
+ const InternalMessageSchema = import_zod_openapi.z.object({
356
+ id: import_zod_openapi.z.string().uuid().optional().describe("Unique message identifier (UUID)"),
357
+ role: import_zod_openapi.z.enum(["system", "user", "assistant", "tool"]).describe("Role of the message sender"),
358
+ timestamp: import_zod_openapi.z.number().int().positive().optional().describe("Creation timestamp (Unix ms)"),
359
+ content: import_zod_openapi.z.union([import_zod_openapi.z.string(), import_zod_openapi.z.null(), import_zod_openapi.z.array(ContentPartSchema)]).describe("Message content (string, null, or array of parts)"),
360
+ reasoning: import_zod_openapi.z.string().optional().describe("Optional model reasoning text"),
139
361
  tokenUsage: TokenUsageSchema.optional().describe("Optional token usage accounting"),
140
- estimatedCost: import_zod.z.number().nonnegative().optional().describe("Estimated cost in USD for this response"),
362
+ estimatedCost: import_zod_openapi.z.number().nonnegative().optional().describe("Estimated cost in USD for this response"),
141
363
  pricingStatus: PricingStatusSchema.optional().describe(
142
364
  "Whether pricing was resolved for this response"
143
365
  ),
144
- usageScopeId: import_zod.z.string().optional().describe("Optional usage scope identifier for runtime-scoped metering"),
145
- model: import_zod.z.string().optional().describe("Model identifier for assistant messages"),
146
- provider: import_zod.z.enum(import_core.LLM_PROVIDERS).optional().describe("Provider identifier for assistant messages"),
147
- toolCalls: import_zod.z.array(ToolCallSchema).optional().describe("Tool calls made by the assistant"),
148
- toolCallId: import_zod.z.string().optional().describe("ID of the tool call this message responds to"),
149
- name: import_zod.z.string().optional().describe("Name of the tool that produced this result"),
150
- success: import_zod.z.boolean().optional().describe("Whether tool execution succeeded (present for role=tool messages)")
366
+ usageScopeId: import_zod_openapi.z.string().optional().describe("Optional usage scope identifier for runtime-scoped metering"),
367
+ model: import_zod_openapi.z.string().optional().describe("Model identifier for assistant messages"),
368
+ provider: import_zod_openapi.z.enum(import_core.LLM_PROVIDERS).optional().describe("Provider identifier for assistant messages"),
369
+ toolCalls: import_zod_openapi.z.array(ToolCallSchema).optional().describe("Tool calls made by the assistant"),
370
+ toolCallId: import_zod_openapi.z.string().optional().describe("ID of the tool call this message responds to"),
371
+ name: import_zod_openapi.z.string().optional().describe("Name of the tool that produced this result"),
372
+ success: import_zod_openapi.z.boolean().optional().describe("Whether tool execution succeeded (present for role=tool messages)")
151
373
  }).strict().describe("Internal message representation");
152
374
  const LLMConfigResponseSchema = import_core.LLMConfigBaseSchema.omit({ apiKey: true }).extend({
153
- hasApiKey: import_zod.z.boolean().optional().describe("Whether an API key is configured")
375
+ hasApiKey: import_zod_openapi.z.boolean().optional().describe("Whether an API key is configured")
154
376
  }).describe("LLM configuration (apiKey omitted for security)");
155
377
  const LLMConfigSchema = import_core.LLMConfigBaseSchema.describe("LLM configuration with API key");
156
378
  const SessionTokenUsageSchema = TokenUsageSchema.required().describe(
157
379
  "Session-level token usage (all fields required for cumulative totals)"
158
380
  );
159
- const SessionUsageTrackingSchema = import_zod.z.object({
160
- hasUntrackedChatGPTLoginUsage: import_zod.z.boolean().optional().describe("Whether this session includes known untracked ChatGPT Login usage")
381
+ const SessionUsageTrackingSchema = import_zod_openapi.z.object({
382
+ hasUntrackedChatGPTLoginUsage: import_zod_openapi.z.boolean().optional().describe("Whether this session includes known untracked ChatGPT Login usage")
161
383
  }).strict().describe("Usage tracking caveats for a session");
162
- const ModelStatisticsSchema = import_zod.z.object({
163
- provider: import_zod.z.string().describe("LLM provider identifier"),
164
- model: import_zod.z.string().describe("Model identifier"),
165
- messageCount: import_zod.z.number().int().nonnegative().describe("Number of messages using this model"),
384
+ const ModelStatisticsSchema = import_zod_openapi.z.object({
385
+ provider: import_zod_openapi.z.string().describe("LLM provider identifier"),
386
+ model: import_zod_openapi.z.string().describe("Model identifier"),
387
+ messageCount: import_zod_openapi.z.number().int().nonnegative().describe("Number of messages using this model"),
166
388
  tokenUsage: SessionTokenUsageSchema.describe("Token usage for this model"),
167
- estimatedCost: import_zod.z.number().nonnegative().describe("Estimated cost in USD for this model"),
168
- firstUsedAt: import_zod.z.number().int().positive().describe("First use timestamp (Unix ms)"),
169
- lastUsedAt: import_zod.z.number().int().positive().describe("Last use timestamp (Unix ms)")
389
+ estimatedCost: import_zod_openapi.z.number().nonnegative().describe("Estimated cost in USD for this model"),
390
+ firstUsedAt: import_zod_openapi.z.number().int().positive().describe("First use timestamp (Unix ms)"),
391
+ lastUsedAt: import_zod_openapi.z.number().int().positive().describe("Last use timestamp (Unix ms)")
170
392
  }).strict().describe("Per-model statistics within a session");
171
- const UsageSummarySchema = import_zod.z.object({
393
+ const UsageSummarySchema = import_zod_openapi.z.object({
172
394
  tokenUsage: SessionTokenUsageSchema.describe(
173
395
  "Aggregate token usage for the selected scope"
174
396
  ),
175
- estimatedCost: import_zod.z.number().nonnegative().describe("Total estimated cost in USD for the selected scope"),
176
- hasUnpricedResponses: import_zod.z.boolean().describe(
397
+ estimatedCost: import_zod_openapi.z.number().nonnegative().describe("Total estimated cost in USD for the selected scope"),
398
+ hasUnpricedResponses: import_zod_openapi.z.boolean().describe(
177
399
  "Whether any response in the selected scope has usage but no resolved pricing"
178
400
  ),
179
- modelStats: import_zod.z.array(
180
- import_zod.z.object({
181
- provider: import_zod.z.string().describe("LLM provider identifier"),
182
- model: import_zod.z.string().describe("Model identifier"),
183
- messageCount: import_zod.z.number().int().nonnegative().describe("Number of responses using this model in the selected scope"),
401
+ modelStats: import_zod_openapi.z.array(
402
+ import_zod_openapi.z.object({
403
+ provider: import_zod_openapi.z.string().describe("LLM provider identifier"),
404
+ model: import_zod_openapi.z.string().describe("Model identifier"),
405
+ messageCount: import_zod_openapi.z.number().int().nonnegative().describe("Number of responses using this model in the selected scope"),
184
406
  tokenUsage: SessionTokenUsageSchema.describe(
185
407
  "Token usage for this model in the selected scope"
186
408
  ),
187
- estimatedCost: import_zod.z.number().nonnegative().describe("Estimated cost in USD for this model in the selected scope")
409
+ estimatedCost: import_zod_openapi.z.number().nonnegative().describe("Estimated cost in USD for this model in the selected scope")
188
410
  }).strict()
189
411
  ).optional().describe("Per-model usage statistics within the selected scope")
190
412
  }).strict().describe("Usage summary for a session or session scope");
191
413
  const ScopedUsageSummarySchema = UsageSummarySchema.extend({
192
- scopeId: import_zod.z.string().describe("Usage scope identifier")
414
+ scopeId: import_zod_openapi.z.string().describe("Usage scope identifier")
193
415
  }).strict().describe("Usage summary for a specific scope within a session");
194
- const SessionMetadataSchema = import_zod.z.object({
195
- id: import_zod.z.string().describe("Unique session identifier"),
196
- createdAt: import_zod.z.number().int().positive().nullable().describe("Creation timestamp (Unix ms, null if unavailable)"),
197
- lastActivity: import_zod.z.number().int().positive().nullable().describe("Last activity timestamp (Unix ms, null if unavailable)"),
198
- messageCount: import_zod.z.number().int().nonnegative().describe("Total number of messages in session"),
199
- title: import_zod.z.string().optional().nullable().describe("Optional session title"),
416
+ const SessionMetadataSchema = import_zod_openapi.z.object({
417
+ id: import_zod_openapi.z.string().describe("Unique session identifier"),
418
+ createdAt: import_zod_openapi.z.number().int().positive().nullable().describe("Creation timestamp (Unix ms, null if unavailable)"),
419
+ lastActivity: import_zod_openapi.z.number().int().positive().nullable().describe("Last activity timestamp (Unix ms, null if unavailable)"),
420
+ messageCount: import_zod_openapi.z.number().int().nonnegative().describe("Total number of messages in session"),
421
+ title: import_zod_openapi.z.string().optional().nullable().describe("Optional session title"),
200
422
  tokenUsage: SessionTokenUsageSchema.optional().describe(
201
423
  "Aggregate token usage across all models"
202
424
  ),
203
- estimatedCost: import_zod.z.number().nonnegative().optional().describe("Total estimated cost in USD across all models"),
204
- modelStats: import_zod.z.array(ModelStatisticsSchema).optional().describe("Per-model usage statistics (for multi-model sessions)"),
425
+ estimatedCost: import_zod_openapi.z.number().nonnegative().optional().describe("Total estimated cost in USD across all models"),
426
+ modelStats: import_zod_openapi.z.array(ModelStatisticsSchema).optional().describe("Per-model usage statistics (for multi-model sessions)"),
205
427
  usageTracking: SessionUsageTrackingSchema.optional().describe(
206
428
  "Known caveats or gaps in usage tracking for this session"
207
429
  ),
208
- workspaceId: import_zod.z.string().optional().nullable().describe("Associated workspace ID, if any"),
209
- parentSessionId: import_zod.z.string().optional().nullable().describe("Parent session ID if this session was forked, otherwise null")
430
+ workspaceId: import_zod_openapi.z.string().optional().nullable().describe("Associated workspace ID, if any"),
431
+ parentSessionId: import_zod_openapi.z.string().optional().nullable().describe("Parent session ID if this session was forked, otherwise null")
210
432
  }).strict().describe("Session metadata");
211
- const WorkspaceSchema = import_zod.z.object({
212
- id: import_zod.z.string().describe("Workspace identifier"),
213
- path: import_zod.z.string().describe("Workspace root path"),
214
- name: import_zod.z.string().optional().nullable().describe("Optional workspace display name"),
215
- createdAt: import_zod.z.number().int().positive().describe("Creation timestamp (Unix ms)"),
216
- lastActiveAt: import_zod.z.number().int().positive().describe("Last active timestamp (Unix ms)")
433
+ const WorkspaceSchema = import_zod_openapi.z.object({
434
+ id: import_zod_openapi.z.string().describe("Workspace identifier"),
435
+ path: import_zod_openapi.z.string().describe("Workspace root path"),
436
+ name: import_zod_openapi.z.string().optional().nullable().describe("Optional workspace display name"),
437
+ createdAt: import_zod_openapi.z.number().int().positive().describe("Creation timestamp (Unix ms)"),
438
+ lastActiveAt: import_zod_openapi.z.number().int().positive().describe("Last active timestamp (Unix ms)")
217
439
  }).strict().describe("Workspace metadata");
218
- const ScheduleTaskSchema = import_zod.z.object({
219
- instruction: import_zod.z.string().describe("Instruction to execute"),
220
- metadata: import_zod.z.record(import_zod.z.unknown()).optional().describe("Optional task metadata")
440
+ const ScheduleTaskSchema = import_zod_openapi.z.object({
441
+ instruction: import_zod_openapi.z.string().describe("Instruction to execute"),
442
+ metadata: JsonObjectSchema.optional().describe("Optional task metadata")
221
443
  }).strict().describe("Schedule task definition");
222
- const ScheduleSchema = import_zod.z.object({
223
- id: import_zod.z.string().describe("Schedule ID"),
224
- name: import_zod.z.string().describe("Schedule name"),
225
- cronExpression: import_zod.z.string().describe("Cron expression"),
226
- timezone: import_zod.z.string().describe("Timezone for schedule"),
227
- enabled: import_zod.z.boolean().describe("Whether the schedule is enabled"),
444
+ const ScheduleSchema = import_zod_openapi.z.object({
445
+ id: import_zod_openapi.z.string().describe("Schedule ID"),
446
+ name: import_zod_openapi.z.string().describe("Schedule name"),
447
+ cronExpression: import_zod_openapi.z.string().describe("Cron expression"),
448
+ timezone: import_zod_openapi.z.string().describe("Timezone for schedule"),
449
+ enabled: import_zod_openapi.z.boolean().describe("Whether the schedule is enabled"),
228
450
  task: ScheduleTaskSchema.describe("Schedule task configuration"),
229
- sessionMode: import_zod.z.enum(["ephemeral", "dedicated", "inherit", "fixed"]).describe("Session context mode"),
230
- sessionId: import_zod.z.string().optional().describe("Session ID when using fixed/inherit mode"),
231
- workspacePath: import_zod.z.string().optional().describe("Workspace path override"),
232
- createdAt: import_zod.z.number().int().positive().describe("Creation timestamp (Unix ms)"),
233
- updatedAt: import_zod.z.number().int().positive().describe("Last update timestamp (Unix ms)"),
234
- lastRunAt: import_zod.z.number().int().positive().optional().describe("Last run timestamp (Unix ms)"),
235
- nextRunAt: import_zod.z.number().int().positive().optional().describe("Next run timestamp (Unix ms)"),
236
- runCount: import_zod.z.number().int().nonnegative().describe("Total executions"),
237
- successCount: import_zod.z.number().int().nonnegative().describe("Successful executions"),
238
- failureCount: import_zod.z.number().int().nonnegative().describe("Failed executions"),
239
- lastError: import_zod.z.string().optional().describe("Last execution error, if any")
451
+ sessionMode: import_zod_openapi.z.enum(["ephemeral", "dedicated", "inherit", "fixed"]).describe("Session context mode"),
452
+ sessionId: import_zod_openapi.z.string().optional().describe("Session ID when using fixed/inherit mode"),
453
+ workspacePath: import_zod_openapi.z.string().optional().describe("Workspace path override"),
454
+ createdAt: import_zod_openapi.z.number().int().positive().describe("Creation timestamp (Unix ms)"),
455
+ updatedAt: import_zod_openapi.z.number().int().positive().describe("Last update timestamp (Unix ms)"),
456
+ lastRunAt: import_zod_openapi.z.number().int().positive().optional().describe("Last run timestamp (Unix ms)"),
457
+ nextRunAt: import_zod_openapi.z.number().int().positive().optional().describe("Next run timestamp (Unix ms)"),
458
+ runCount: import_zod_openapi.z.number().int().nonnegative().describe("Total executions"),
459
+ successCount: import_zod_openapi.z.number().int().nonnegative().describe("Successful executions"),
460
+ failureCount: import_zod_openapi.z.number().int().nonnegative().describe("Failed executions"),
461
+ lastError: import_zod_openapi.z.string().optional().describe("Last execution error, if any")
240
462
  }).strict().describe("Automation schedule");
241
- const ExecutionLogSchema = import_zod.z.object({
242
- id: import_zod.z.string().describe("Execution log ID"),
243
- scheduleId: import_zod.z.string().describe("Schedule ID"),
244
- triggeredAt: import_zod.z.number().int().positive().describe("Trigger timestamp (Unix ms)"),
245
- completedAt: import_zod.z.number().int().positive().optional().describe("Completion timestamp (Unix ms)"),
246
- status: import_zod.z.enum(["pending", "success", "failed", "timeout"]).describe("Execution status"),
247
- duration: import_zod.z.number().int().nonnegative().optional().describe("Execution duration in ms"),
248
- error: import_zod.z.string().optional().describe("Execution error, if any"),
249
- result: import_zod.z.string().optional().describe("Execution result, if any")
463
+ const ExecutionLogSchema = import_zod_openapi.z.object({
464
+ id: import_zod_openapi.z.string().describe("Execution log ID"),
465
+ scheduleId: import_zod_openapi.z.string().describe("Schedule ID"),
466
+ triggeredAt: import_zod_openapi.z.number().int().positive().describe("Trigger timestamp (Unix ms)"),
467
+ completedAt: import_zod_openapi.z.number().int().positive().optional().describe("Completion timestamp (Unix ms)"),
468
+ status: import_zod_openapi.z.enum(["pending", "success", "failed", "timeout"]).describe("Execution status"),
469
+ duration: import_zod_openapi.z.number().int().nonnegative().optional().describe("Execution duration in ms"),
470
+ error: import_zod_openapi.z.string().optional().describe("Execution error, if any"),
471
+ result: import_zod_openapi.z.string().optional().describe("Execution result, if any")
250
472
  }).strict().describe("Schedule execution log");
251
- const SearchResultSchema = import_zod.z.object({
252
- sessionId: import_zod.z.string().describe("Session ID where the message was found"),
473
+ const SearchResultSchema = import_zod_openapi.z.object({
474
+ sessionId: import_zod_openapi.z.string().describe("Session ID where the message was found"),
253
475
  message: InternalMessageSchema.describe("The message that matched the search"),
254
- matchedText: import_zod.z.string().describe("The specific text that matched the search query"),
255
- context: import_zod.z.string().describe("Context around the match for preview"),
256
- messageIndex: import_zod.z.number().int().nonnegative().describe("Index of the message within the session")
476
+ matchedText: import_zod_openapi.z.string().describe("The specific text that matched the search query"),
477
+ context: import_zod_openapi.z.string().describe("Context around the match for preview"),
478
+ messageIndex: import_zod_openapi.z.number().int().nonnegative().describe("Index of the message within the session")
257
479
  }).strict().describe("Result of a message search");
258
- const SessionSearchResultSchema = import_zod.z.object({
259
- sessionId: import_zod.z.string().describe("Session ID"),
260
- matchCount: import_zod.z.number().int().nonnegative().describe("Number of messages that matched in this session"),
480
+ const SessionSearchResultSchema = import_zod_openapi.z.object({
481
+ sessionId: import_zod_openapi.z.string().describe("Session ID"),
482
+ matchCount: import_zod_openapi.z.number().int().nonnegative().describe("Number of messages that matched in this session"),
261
483
  firstMatch: SearchResultSchema.describe("Preview of the first matching message"),
262
- metadata: import_zod.z.object({
263
- createdAt: import_zod.z.number().int().positive().describe("Session creation timestamp"),
264
- lastActivity: import_zod.z.number().int().positive().describe("Last activity timestamp"),
265
- messageCount: import_zod.z.number().int().nonnegative().describe("Total messages in session")
484
+ metadata: import_zod_openapi.z.object({
485
+ createdAt: import_zod_openapi.z.number().int().positive().describe("Session creation timestamp"),
486
+ lastActivity: import_zod_openapi.z.number().int().positive().describe("Last activity timestamp"),
487
+ messageCount: import_zod_openapi.z.number().int().nonnegative().describe("Total messages in session")
266
488
  }).strict().describe("Session metadata")
267
489
  }).strict().describe("Result of a session search");
268
- const MessageSearchResponseSchema = import_zod.z.object({
269
- results: import_zod.z.array(SearchResultSchema).describe("Array of search results"),
270
- total: import_zod.z.number().int().nonnegative().describe("Total number of results available"),
271
- hasMore: import_zod.z.boolean().describe("Whether there are more results beyond the current page"),
272
- query: import_zod.z.string().describe("Query that was searched")
490
+ const MessageSearchResponseSchema = import_zod_openapi.z.object({
491
+ results: import_zod_openapi.z.array(SearchResultSchema).describe("Array of search results"),
492
+ total: import_zod_openapi.z.number().int().nonnegative().describe("Total number of results available"),
493
+ hasMore: import_zod_openapi.z.boolean().describe("Whether there are more results beyond the current page"),
494
+ query: import_zod_openapi.z.string().describe("Query that was searched")
273
495
  }).strict().describe("Message search response");
274
- const SessionSearchResponseSchema = import_zod.z.object({
275
- results: import_zod.z.array(SessionSearchResultSchema).describe("Array of session search results"),
276
- total: import_zod.z.number().int().nonnegative().describe("Total number of sessions with matches"),
277
- hasMore: import_zod.z.boolean().describe(
496
+ const SessionSearchResponseSchema = import_zod_openapi.z.object({
497
+ results: import_zod_openapi.z.array(SessionSearchResultSchema).describe("Array of session search results"),
498
+ total: import_zod_openapi.z.number().int().nonnegative().describe("Total number of sessions with matches"),
499
+ hasMore: import_zod_openapi.z.boolean().describe(
278
500
  "Always false - session search returns all matching sessions without pagination"
279
501
  ),
280
- query: import_zod.z.string().describe("Query that was searched")
502
+ query: import_zod_openapi.z.string().describe("Query that was searched")
281
503
  }).strict().describe("Session search response");
282
- const WebhookSchema = import_zod.z.object({
283
- id: import_zod.z.string().describe("Unique webhook identifier"),
284
- url: import_zod.z.string().url().describe("Webhook URL to send events to"),
285
- events: import_zod.z.array(import_zod.z.string()).describe("Array of event types this webhook subscribes to"),
286
- createdAt: import_zod.z.number().int().positive().describe("Creation timestamp (Unix ms)")
504
+ const WebhookSchema = import_zod_openapi.z.object({
505
+ id: import_zod_openapi.z.string().describe("Unique webhook identifier"),
506
+ url: import_zod_openapi.z.string().url().describe("Webhook URL to send events to"),
507
+ events: import_zod_openapi.z.array(import_zod_openapi.z.string()).describe("Array of event types this webhook subscribes to"),
508
+ createdAt: import_zod_openapi.z.number().int().positive().describe("Creation timestamp (Unix ms)")
287
509
  }).strict().describe("Webhook subscription");
288
- const CatalogModelInfoSchema = import_zod.z.object({
289
- name: import_zod.z.string().describe("Model name identifier"),
290
- maxInputTokens: import_zod.z.number().int().positive().describe("Maximum input tokens"),
291
- default: import_zod.z.boolean().optional().describe("Whether this is a default model"),
292
- supportedFileTypes: import_zod.z.array(import_zod.z.enum(["audio", "pdf", "image"])).describe("File types this model supports"),
293
- displayName: import_zod.z.string().optional().describe("Human-readable display name"),
294
- pricing: import_zod.z.object({
295
- inputPerM: import_zod.z.number().describe("Input cost per million tokens (USD)"),
296
- outputPerM: import_zod.z.number().describe("Output cost per million tokens (USD)"),
297
- cacheReadPerM: import_zod.z.number().optional().describe("Cache read cost per million tokens"),
298
- cacheWritePerM: import_zod.z.number().optional().describe("Cache write cost per million tokens"),
299
- currency: import_zod.z.literal("USD").optional().describe("Currency"),
300
- unit: import_zod.z.literal("per_million_tokens").optional().describe("Unit")
510
+ const CatalogModelInfoSchema = import_zod_openapi.z.object({
511
+ name: import_zod_openapi.z.string().describe("Model name identifier"),
512
+ maxInputTokens: import_zod_openapi.z.number().int().positive().describe("Maximum input tokens"),
513
+ default: import_zod_openapi.z.boolean().optional().describe("Whether this is a default model"),
514
+ supportedFileTypes: import_zod_openapi.z.array(import_zod_openapi.z.enum(["audio", "pdf", "image"])).describe("File types this model supports"),
515
+ displayName: import_zod_openapi.z.string().optional().describe("Human-readable display name"),
516
+ pricing: import_zod_openapi.z.object({
517
+ inputPerM: import_zod_openapi.z.number().describe("Input cost per million tokens (USD)"),
518
+ outputPerM: import_zod_openapi.z.number().describe("Output cost per million tokens (USD)"),
519
+ cacheReadPerM: import_zod_openapi.z.number().optional().describe("Cache read cost per million tokens"),
520
+ cacheWritePerM: import_zod_openapi.z.number().optional().describe("Cache write cost per million tokens"),
521
+ currency: import_zod_openapi.z.literal("USD").optional().describe("Currency"),
522
+ unit: import_zod_openapi.z.literal("per_million_tokens").optional().describe("Unit")
301
523
  }).optional().describe("Pricing information in USD per million tokens")
302
524
  }).strict().describe("Model information from LLM registry");
303
- const ProviderCatalogSchema = import_zod.z.object({
304
- name: import_zod.z.string().describe("Provider display name"),
305
- hasApiKey: import_zod.z.boolean().describe("Whether API key is configured"),
306
- primaryEnvVar: import_zod.z.string().describe("Primary environment variable for API key"),
307
- supportsBaseURL: import_zod.z.boolean().describe("Whether custom base URLs are supported"),
308
- models: import_zod.z.array(CatalogModelInfoSchema).describe("Models available from this provider"),
309
- supportedFileTypes: import_zod.z.array(import_zod.z.enum(["audio", "pdf", "image"])).describe("Provider-level file type support")
525
+ const ProviderCatalogSchema = import_zod_openapi.z.object({
526
+ name: import_zod_openapi.z.string().describe("Provider display name"),
527
+ hasApiKey: import_zod_openapi.z.boolean().describe("Whether API key is configured"),
528
+ primaryEnvVar: import_zod_openapi.z.string().describe("Primary environment variable for API key"),
529
+ supportsBaseURL: import_zod_openapi.z.boolean().describe("Whether custom base URLs are supported"),
530
+ models: import_zod_openapi.z.array(CatalogModelInfoSchema).describe("Models available from this provider"),
531
+ supportedFileTypes: import_zod_openapi.z.array(import_zod_openapi.z.enum(["audio", "pdf", "image"])).describe("Provider-level file type support")
310
532
  }).strict().describe("Provider catalog entry with models and capabilities");
311
533
  const ModelFlatSchema = CatalogModelInfoSchema.extend({
312
- provider: import_zod.z.string().describe("Provider identifier for this model")
534
+ provider: import_zod_openapi.z.string().describe("Provider identifier for this model")
313
535
  }).describe("Flattened model entry with provider information");
314
- const AgentRegistryEntrySchema = import_zod.z.object({
315
- id: import_zod.z.string().describe("Unique agent identifier"),
316
- name: import_zod.z.string().describe("Agent name"),
317
- description: import_zod.z.string().describe("Agent description"),
318
- author: import_zod.z.string().optional().describe("Agent author"),
319
- tags: import_zod.z.array(import_zod.z.string()).optional().describe("Agent tags"),
320
- type: import_zod.z.enum(["builtin", "custom"]).describe("Agent type")
536
+ const AgentRegistryEntrySchema = import_zod_openapi.z.object({
537
+ id: import_zod_openapi.z.string().describe("Unique agent identifier"),
538
+ name: import_zod_openapi.z.string().describe("Agent name"),
539
+ description: import_zod_openapi.z.string().describe("Agent description"),
540
+ author: import_zod_openapi.z.string().optional().describe("Agent author"),
541
+ tags: import_zod_openapi.z.array(import_zod_openapi.z.string()).optional().describe("Agent tags"),
542
+ type: import_zod_openapi.z.enum(["builtin", "custom"]).describe("Agent type")
321
543
  }).strict().describe("Agent registry entry");
322
- const ResourceSchema = import_zod.z.object({
323
- uri: import_zod.z.string().describe("Resource URI"),
324
- name: import_zod.z.string().optional().describe("Resource name"),
325
- description: import_zod.z.string().optional().describe("Resource description"),
326
- mimeType: import_zod.z.string().optional().describe("MIME type of the resource"),
327
- source: import_zod.z.enum(["mcp", "internal"]).describe("Source system that provides this resource"),
328
- serverName: import_zod.z.string().optional().describe("Original server/provider name (for MCP resources)"),
329
- size: import_zod.z.number().optional().describe("Size of the resource in bytes (if known)"),
330
- lastModified: import_zod.z.string().datetime().optional().describe("Last modified timestamp (ISO 8601 string)"),
331
- metadata: import_zod.z.record(import_zod.z.unknown()).optional().describe("Additional metadata specific to the resource type")
544
+ const ResourceSchema = import_zod_openapi.z.object({
545
+ uri: import_zod_openapi.z.string().describe("Resource URI"),
546
+ name: import_zod_openapi.z.string().optional().describe("Resource name"),
547
+ description: import_zod_openapi.z.string().optional().describe("Resource description"),
548
+ mimeType: import_zod_openapi.z.string().optional().describe("MIME type of the resource"),
549
+ source: import_zod_openapi.z.enum(["mcp", "internal"]).describe("Source system that provides this resource"),
550
+ serverName: import_zod_openapi.z.string().optional().describe("Original server/provider name (for MCP resources)"),
551
+ size: import_zod_openapi.z.number().optional().describe("Size of the resource in bytes (if known)"),
552
+ lastModified: import_zod_openapi.z.string().datetime().optional().describe("Last modified timestamp (ISO 8601 string)"),
553
+ metadata: import_zod_openapi.z.record(import_zod_openapi.z.string(), JsonValueSchema).optional().describe("Additional metadata specific to the resource type")
332
554
  }).strict().describe("Resource metadata");
333
- const ToolSchema = import_zod.z.object({
334
- name: import_zod.z.string().describe("Tool name"),
335
- description: import_zod.z.string().describe("Tool description"),
336
- inputSchema: import_zod.z.record(import_zod.z.unknown()).describe("JSON Schema for tool input parameters")
555
+ const ToolSchema = import_zod_openapi.z.object({
556
+ name: import_zod_openapi.z.string().describe("Tool name"),
557
+ description: import_zod_openapi.z.string().describe("Tool description"),
558
+ inputSchema: ToolInputSchema.describe("JSON Schema for tool input parameters")
337
559
  }).strict().describe("Tool metadata");
338
- const PromptArgumentSchema = import_zod.z.object({
339
- name: import_zod.z.string().describe("Argument name"),
340
- description: import_zod.z.string().optional().describe("Argument description"),
341
- required: import_zod.z.boolean().optional().describe("Whether the argument is required")
560
+ const PromptArgumentSchema = import_zod_openapi.z.object({
561
+ name: import_zod_openapi.z.string().describe("Argument name"),
562
+ description: import_zod_openapi.z.string().optional().describe("Argument description"),
563
+ required: import_zod_openapi.z.boolean().optional().describe("Whether the argument is required")
342
564
  }).strict().describe("Prompt argument definition");
343
- const PromptDefinitionSchema = import_zod.z.object({
344
- name: import_zod.z.string().describe("Prompt name"),
345
- title: import_zod.z.string().optional().describe("Prompt title"),
346
- description: import_zod.z.string().optional().describe("Prompt description"),
347
- arguments: import_zod.z.array(PromptArgumentSchema).optional().describe("Array of argument definitions")
565
+ const PromptDefinitionSchema = import_zod_openapi.z.object({
566
+ name: import_zod_openapi.z.string().describe("Prompt name"),
567
+ title: import_zod_openapi.z.string().optional().describe("Prompt title"),
568
+ description: import_zod_openapi.z.string().optional().describe("Prompt description"),
569
+ arguments: import_zod_openapi.z.array(PromptArgumentSchema).optional().describe("Array of argument definitions"),
570
+ disableModelInvocation: import_zod_openapi.z.boolean().optional().describe("Exclude from auto-invocation list in system prompt"),
571
+ userInvocable: import_zod_openapi.z.boolean().optional().describe("Whether to show in slash command menu"),
572
+ allowedTools: import_zod_openapi.z.array(import_zod_openapi.z.string()).optional().describe("Tools to auto-approve when this prompt is active"),
573
+ toolkits: import_zod_openapi.z.array(import_zod_openapi.z.string()).optional().describe("Toolkits to load when invoked"),
574
+ model: import_zod_openapi.z.string().optional().describe("Model to use when this prompt is invoked"),
575
+ context: import_zod_openapi.z.enum(["inline", "fork"]).optional().describe("Execution context for this prompt"),
576
+ agent: import_zod_openapi.z.string().optional().describe("Agent ID to use for fork execution")
348
577
  }).strict().describe("Prompt definition (MCP-compliant)");
349
- const PromptInfoSchema = import_zod.z.object({
350
- name: import_zod.z.string().describe("Prompt name"),
351
- title: import_zod.z.string().optional().describe("Prompt title"),
352
- description: import_zod.z.string().optional().describe("Prompt description"),
353
- arguments: import_zod.z.array(PromptArgumentSchema).optional().describe("Array of argument definitions"),
354
- source: import_zod.z.enum(["mcp", "config", "custom"]).describe("Source of the prompt"),
355
- metadata: import_zod.z.record(import_zod.z.unknown()).optional().describe("Additional metadata")
578
+ const PromptInfoSchema = import_zod_openapi.z.object({
579
+ name: import_zod_openapi.z.string().describe("Prompt name"),
580
+ title: import_zod_openapi.z.string().optional().describe("Prompt title"),
581
+ description: import_zod_openapi.z.string().optional().describe("Prompt description"),
582
+ arguments: import_zod_openapi.z.array(PromptArgumentSchema).optional().describe("Array of argument definitions"),
583
+ disableModelInvocation: import_zod_openapi.z.boolean().optional().describe("Exclude from auto-invocation list in system prompt"),
584
+ userInvocable: import_zod_openapi.z.boolean().optional().describe("Whether to show in slash command menu"),
585
+ allowedTools: import_zod_openapi.z.array(import_zod_openapi.z.string()).optional().describe("Tools to auto-approve when this prompt is active"),
586
+ toolkits: import_zod_openapi.z.array(import_zod_openapi.z.string()).optional().describe("Toolkits to load when invoked"),
587
+ model: import_zod_openapi.z.string().optional().describe("Model to use when this prompt is invoked"),
588
+ context: import_zod_openapi.z.enum(["inline", "fork"]).optional().describe("Execution context for this prompt"),
589
+ agent: import_zod_openapi.z.string().optional().describe("Agent ID to use for fork execution"),
590
+ source: import_zod_openapi.z.enum(["mcp", "config", "custom"]).describe("Source of the prompt"),
591
+ displayName: import_zod_openapi.z.string().optional().describe("Base display name set by provider"),
592
+ commandName: import_zod_openapi.z.string().optional().describe("Collision-resolved slash command name"),
593
+ metadata: JsonObjectSchema.optional().describe("Additional metadata")
356
594
  }).strict().describe("Enhanced prompt information");
357
- const PromptSchema = import_zod.z.object({
358
- id: import_zod.z.string().describe("Unique prompt identifier"),
359
- name: import_zod.z.string().describe("Prompt name"),
360
- description: import_zod.z.string().optional().describe("Prompt description"),
361
- content: import_zod.z.string().describe("Prompt template content"),
362
- variables: import_zod.z.array(import_zod.z.string()).optional().describe("List of variable placeholders in the prompt")
595
+ const PromptSchema = import_zod_openapi.z.object({
596
+ id: import_zod_openapi.z.string().describe("Unique prompt identifier"),
597
+ name: import_zod_openapi.z.string().describe("Prompt name"),
598
+ description: import_zod_openapi.z.string().optional().describe("Prompt description"),
599
+ content: import_zod_openapi.z.string().describe("Prompt template content"),
600
+ variables: import_zod_openapi.z.array(import_zod_openapi.z.string()).optional().describe("List of variable placeholders in the prompt")
363
601
  }).strict().describe("Prompt template");
364
- const OkResponseSchema = (dataSchema) => import_zod.z.object({
365
- ok: import_zod.z.literal(true).describe("Indicates successful response"),
602
+ const OkResponseSchema = (dataSchema) => import_zod_openapi.z.object({
603
+ ok: import_zod_openapi.z.literal(true).describe("Indicates successful response"),
366
604
  data: dataSchema.describe("Response data")
367
605
  }).strict().describe("Successful API response");
368
- const ErrorResponseSchema = import_zod.z.object({
369
- ok: import_zod.z.literal(false).describe("Indicates failed response"),
370
- error: import_zod.z.object({
371
- message: import_zod.z.string().describe("Error message"),
372
- code: import_zod.z.string().optional().describe("Error code"),
373
- details: import_zod.z.unknown().optional().describe("Additional error details")
606
+ const ErrorResponseSchema = import_zod_openapi.z.object({
607
+ ok: import_zod_openapi.z.literal(false).describe("Indicates failed response"),
608
+ error: import_zod_openapi.z.object({
609
+ message: import_zod_openapi.z.string().describe("Error message"),
610
+ code: import_zod_openapi.z.string().optional().describe("Error code"),
611
+ details: JsonValueSchema.optional().describe("Additional error details")
374
612
  }).strict().describe("Error details")
375
613
  }).strict().describe("Error API response");
376
- const StandardErrorEnvelopeSchema = import_zod.z.object({
377
- code: import_zod.z.string().describe("Error code"),
378
- message: import_zod.z.string().describe("Error message"),
379
- scope: import_zod.z.string().describe("Error scope"),
380
- type: import_zod.z.string().describe("Error type"),
381
- context: import_zod.z.unknown().optional().describe("Error context"),
382
- recovery: import_zod.z.union([import_zod.z.string(), import_zod.z.array(import_zod.z.string())]).optional().describe("Recovery guidance"),
383
- traceId: import_zod.z.string().describe("Trace identifier"),
384
- endpoint: import_zod.z.string().describe("Request endpoint"),
385
- method: import_zod.z.string().describe("HTTP method")
614
+ const StandardErrorEnvelopeSchema = import_zod_openapi.z.object({
615
+ code: import_zod_openapi.z.string().describe("Error code"),
616
+ message: import_zod_openapi.z.string().describe("Error message"),
617
+ scope: import_zod_openapi.z.string().describe("Error scope"),
618
+ type: import_zod_openapi.z.string().describe("Error type"),
619
+ context: JsonValueSchema.optional().describe("Error context"),
620
+ recovery: import_zod_openapi.z.union([import_zod_openapi.z.string(), import_zod_openapi.z.array(import_zod_openapi.z.string())]).optional().describe("Recovery guidance"),
621
+ traceId: import_zod_openapi.z.string().describe("Trace identifier"),
622
+ endpoint: import_zod_openapi.z.string().describe("Request endpoint"),
623
+ method: import_zod_openapi.z.string().describe("HTTP method")
386
624
  }).strict().describe("Standard API error envelope");
387
- const StatusResponseSchema = import_zod.z.object({
388
- status: import_zod.z.string().describe("Operation status"),
389
- message: import_zod.z.string().optional().describe("Optional status message")
625
+ const StatusResponseSchema = import_zod_openapi.z.object({
626
+ status: import_zod_openapi.z.string().describe("Operation status"),
627
+ message: import_zod_openapi.z.string().optional().describe("Optional status message")
390
628
  }).strict().describe("Status response");
391
- const DeleteResponseSchema = import_zod.z.object({
392
- status: import_zod.z.literal("deleted").describe("Indicates successful deletion"),
393
- id: import_zod.z.string().optional().describe("ID of the deleted resource")
629
+ const DeleteResponseSchema = import_zod_openapi.z.object({
630
+ status: import_zod_openapi.z.literal("deleted").describe("Indicates successful deletion"),
631
+ id: import_zod_openapi.z.string().optional().describe("ID of the deleted resource")
394
632
  }).strict().describe("Delete operation response");
395
633
  // Annotate the CommonJS export names for ESM import in node:
396
634
  0 && (module.exports = {
397
635
  AgentCardSchema,
398
636
  AgentRegistryEntrySchema,
637
+ ApiErrorResponseSchema,
638
+ BadRequestErrorResponse,
399
639
  CatalogModelInfoSchema,
640
+ ConflictErrorResponse,
400
641
  ContentPartSchema,
401
642
  DeleteResponseSchema,
402
643
  ErrorResponseSchema,
403
644
  ExecutionLogSchema,
404
645
  FilePartSchema,
646
+ ForbiddenErrorResponse,
405
647
  HttpServerConfigSchema,
406
648
  ImagePartSchema,
649
+ InternalErrorResponse,
407
650
  InternalMessageSchema,
651
+ IssueSchema,
652
+ JsonObjectSchema,
653
+ JsonSchemaPropertySchema,
654
+ JsonValueSchema,
408
655
  LLMConfigBaseSchema,
409
656
  LLMConfigResponseSchema,
410
657
  LLMConfigSchema,
@@ -413,7 +660,9 @@ const DeleteResponseSchema = import_zod.z.object({
413
660
  MessageSearchResponseSchema,
414
661
  ModelFlatSchema,
415
662
  ModelStatisticsSchema,
663
+ NotFoundErrorResponse,
416
664
  OkResponseSchema,
665
+ PaymentRequiredErrorResponse,
417
666
  PermissionsConfigSchema,
418
667
  PricingStatusSchema,
419
668
  PromptArgumentSchema,
@@ -421,6 +670,9 @@ const DeleteResponseSchema = import_zod.z.object({
421
670
  PromptInfoSchema,
422
671
  PromptSchema,
423
672
  ProviderCatalogSchema,
673
+ RateLimitErrorResponse,
674
+ RequestContentPartSchema,
675
+ RequestContentSchema,
424
676
  ResourceConfigSchema,
425
677
  ResourceSchema,
426
678
  ScheduleSchema,
@@ -437,11 +689,16 @@ const DeleteResponseSchema = import_zod.z.object({
437
689
  StatusResponseSchema,
438
690
  StdioServerConfigSchema,
439
691
  TextPartSchema,
692
+ TimeoutErrorResponse,
440
693
  TokenUsageSchema,
441
694
  ToolCallSchema,
695
+ ToolInputSchema,
442
696
  ToolSchema,
443
697
  UIResourcePartSchema,
698
+ UpstreamErrorResponse,
444
699
  UsageSummarySchema,
445
700
  WebhookSchema,
446
- WorkspaceSchema
701
+ WorkspaceSchema,
702
+ toApiContentPart,
703
+ toContentInput
447
704
  });