@inkeep/agents-core 0.0.0-dev-20251124234228 → 0.0.0-dev-20251125020527

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.
@@ -1,6 +1,6 @@
1
1
  import { user, session, account, organization, member, invitation, verification } from '../chunk-NOPEANIU.js';
2
- import { external_exports } from '../chunk-OUXC23J7.js';
3
2
  import { createSelectSchema, createInsertSchema } from 'drizzle-zod';
3
+ import { z } from 'zod';
4
4
 
5
5
  var UserSelectSchema = createSelectSchema(user);
6
6
  var UserInsertSchema = createInsertSchema(user);
@@ -16,24 +16,24 @@ var InvitationSelectSchema = createSelectSchema(invitation);
16
16
  var InvitationInsertSchema = createInsertSchema(invitation);
17
17
  var VerificationSelectSchema = createSelectSchema(verification);
18
18
  var VerificationInsertSchema = createInsertSchema(verification);
19
- var UserOrganizationSchema = external_exports.object({
20
- id: external_exports.string(),
21
- userId: external_exports.string(),
22
- organizationId: external_exports.string(),
23
- role: external_exports.string(),
24
- createdAt: external_exports.union([external_exports.string(), external_exports.date()]).transform((val) => val instanceof Date ? val.toISOString() : val),
25
- organizationName: external_exports.string().nullable(),
26
- organizationSlug: external_exports.string().nullable()
19
+ var UserOrganizationSchema = z.object({
20
+ id: z.string(),
21
+ userId: z.string(),
22
+ organizationId: z.string(),
23
+ role: z.string(),
24
+ createdAt: z.union([z.string(), z.date()]).transform((val) => val instanceof Date ? val.toISOString() : val),
25
+ organizationName: z.string().nullable(),
26
+ organizationSlug: z.string().nullable()
27
27
  });
28
- var UserOrganizationsResponseSchema = external_exports.array(UserOrganizationSchema);
29
- var AddUserToOrganizationRequestSchema = external_exports.object({
30
- organizationId: external_exports.string(),
31
- role: external_exports.string().default("member")
28
+ var UserOrganizationsResponseSchema = z.array(UserOrganizationSchema);
29
+ var AddUserToOrganizationRequestSchema = z.object({
30
+ organizationId: z.string(),
31
+ role: z.string().default("member")
32
32
  });
33
- var AddUserToOrganizationResponseSchema = external_exports.object({
34
- organizationId: external_exports.string(),
35
- role: external_exports.string(),
36
- createdAt: external_exports.string()
33
+ var AddUserToOrganizationResponseSchema = z.object({
34
+ organizationId: z.string(),
35
+ role: z.string(),
36
+ createdAt: z.string()
37
37
  });
38
38
 
39
39
  export { AccountInsertSchema, AccountSelectSchema, AddUserToOrganizationRequestSchema, AddUserToOrganizationResponseSchema, InvitationInsertSchema, InvitationSelectSchema, MemberInsertSchema, MemberSelectSchema, OrganizationInsertSchema, OrganizationSelectSchema, SessionInsertSchema, SessionSelectSchema, UserInsertSchema, UserOrganizationSchema, UserOrganizationsResponseSchema, UserSelectSchema, VerificationInsertSchema, VerificationSelectSchema };
package/dist/auth/auth.js CHANGED
@@ -1,5 +1,5 @@
1
- import { generateId } from '../chunk-K3UNCRSA.js';
2
- import { env } from '../chunk-NMBNWFIZ.js';
1
+ import { generateId } from '../chunk-ZGL6KM2G.js';
2
+ import { env } from '../chunk-LL6F3EAR.js';
3
3
  import { ssoProvider } from '../chunk-NOPEANIU.js';
4
4
  import { ownerRole, adminRole, memberRole, ac } from '../chunk-VMSYBWFH.js';
5
5
  import { sso } from '@better-auth/sso';
@@ -1,11 +1,10 @@
1
1
  import { getLogger } from './chunk-DN4B564Y.js';
2
- import { external_exports } from './chunk-OUXC23J7.js';
2
+ import { z } from 'zod';
3
3
 
4
- // src/utils/schema-conversion.ts
5
4
  var logger = getLogger("schema-conversion");
6
5
  function convertZodToJsonSchema(zodSchema) {
7
6
  try {
8
- const jsonSchema = external_exports.toJSONSchema(zodSchema);
7
+ const jsonSchema = z.toJSONSchema(zodSchema);
9
8
  if (jsonSchema.$schema) {
10
9
  delete jsonSchema.$schema;
11
10
  }
@@ -27,7 +26,7 @@ var preview = (schema) => {
27
26
  };
28
27
  function convertZodToJsonSchemaWithPreview(zodSchema) {
29
28
  const jsonSchema = convertZodToJsonSchema(zodSchema);
30
- if (zodSchema instanceof external_exports.ZodObject && jsonSchema.properties) {
29
+ if (zodSchema instanceof z.ZodObject && jsonSchema.properties) {
31
30
  const shape = zodSchema.shape;
32
31
  for (const [key, fieldSchema] of Object.entries(shape)) {
33
32
  if (fieldSchema?._def?.inPreview === true) {
@@ -42,7 +41,7 @@ function isZodSchema(value) {
42
41
  }
43
42
  function extractPreviewFields(schema) {
44
43
  const previewFields = [];
45
- if (schema instanceof external_exports.ZodObject) {
44
+ if (schema instanceof z.ZodObject) {
46
45
  const shape = schema.shape;
47
46
  for (const [key, fieldSchema] of Object.entries(shape)) {
48
47
  if (fieldSchema?._def?.inPreview === true) {
@@ -1,7 +1,7 @@
1
1
  import { getLogger } from './chunk-DN4B564Y.js';
2
2
  import { CredentialStoreType } from './chunk-YFHT5M2R.js';
3
- import { external_exports } from './chunk-OUXC23J7.js';
4
3
  import { Nango } from '@nangohq/node';
4
+ import { z } from 'zod';
5
5
 
6
6
  // src/credential-stores/CredentialStoreRegistry.ts
7
7
  var CredentialStoreRegistry = class {
@@ -349,10 +349,10 @@ var InMemoryCredentialStore = class {
349
349
  }
350
350
  };
351
351
  var logger = getLogger("nango-credential-store");
352
- var CredentialKeySchema = external_exports.object({
353
- connectionId: external_exports.string().min(1, "connectionId must be a non-empty string"),
354
- providerConfigKey: external_exports.string().min(1, "providerConfigKey must be a non-empty string"),
355
- integrationDisplayName: external_exports.string().nullish()
352
+ var CredentialKeySchema = z.object({
353
+ connectionId: z.string().min(1, "connectionId must be a non-empty string"),
354
+ providerConfigKey: z.string().min(1, "providerConfigKey must be a non-empty string"),
355
+ integrationDisplayName: z.string().nullish()
356
356
  });
357
357
  function parseCredentialKey(key) {
358
358
  try {
@@ -1,5 +1,5 @@
1
- import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-N7TIJHWC.js';
2
- import { external_exports } from './chunk-OUXC23J7.js';
1
+ import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-ZQU7AEXC.js';
2
+ import { z } from 'zod';
3
3
 
4
4
  // src/validation/cycleDetection.ts
5
5
  function detectDelegationCycles(agentData) {
@@ -181,44 +181,42 @@ function validateAgentStructure(agentData, projectResources) {
181
181
  }
182
182
  validateAgentRelationships(agentData);
183
183
  }
184
-
185
- // src/validation/event-schemas.ts
186
- var TransferDataSchema = external_exports.object({
187
- fromSubAgent: external_exports.string().describe("ID of the sub-agent transferring control"),
188
- targetSubAgent: external_exports.string().describe("ID of the sub-agent receiving control"),
189
- reason: external_exports.string().optional().describe("Reason for the transfer"),
190
- context: external_exports.any().optional().describe("Additional context data")
184
+ var TransferDataSchema = z.object({
185
+ fromSubAgent: z.string().describe("ID of the sub-agent transferring control"),
186
+ targetSubAgent: z.string().describe("ID of the sub-agent receiving control"),
187
+ reason: z.string().optional().describe("Reason for the transfer"),
188
+ context: z.any().optional().describe("Additional context data")
191
189
  });
192
- var DelegationSentDataSchema = external_exports.object({
193
- delegationId: external_exports.string().describe("Unique identifier for this delegation"),
194
- fromSubAgent: external_exports.string().describe("ID of the delegating sub-agent"),
195
- targetSubAgent: external_exports.string().describe("ID of the sub-agent receiving the delegation"),
196
- taskDescription: external_exports.string().describe("Description of the delegated task"),
197
- context: external_exports.any().optional().describe("Additional context data")
190
+ var DelegationSentDataSchema = z.object({
191
+ delegationId: z.string().describe("Unique identifier for this delegation"),
192
+ fromSubAgent: z.string().describe("ID of the delegating sub-agent"),
193
+ targetSubAgent: z.string().describe("ID of the sub-agent receiving the delegation"),
194
+ taskDescription: z.string().describe("Description of the delegated task"),
195
+ context: z.any().optional().describe("Additional context data")
198
196
  });
199
- var DelegationReturnedDataSchema = external_exports.object({
200
- delegationId: external_exports.string().describe("Unique identifier matching the original delegation"),
201
- fromSubAgent: external_exports.string().describe("ID of the sub-agent that completed the task"),
202
- targetSubAgent: external_exports.string().describe("ID of the sub-agent receiving the result"),
203
- result: external_exports.any().optional().describe("Result data from the delegated task")
197
+ var DelegationReturnedDataSchema = z.object({
198
+ delegationId: z.string().describe("Unique identifier matching the original delegation"),
199
+ fromSubAgent: z.string().describe("ID of the sub-agent that completed the task"),
200
+ targetSubAgent: z.string().describe("ID of the sub-agent receiving the result"),
201
+ result: z.any().optional().describe("Result data from the delegated task")
204
202
  });
205
- var DataOperationDetailsSchema = external_exports.object({
206
- timestamp: external_exports.number().describe("Unix timestamp in milliseconds"),
207
- subAgentId: external_exports.string().describe("ID of the sub-agent that generated this data"),
208
- data: external_exports.any().describe("The actual data payload")
203
+ var DataOperationDetailsSchema = z.object({
204
+ timestamp: z.number().describe("Unix timestamp in milliseconds"),
205
+ subAgentId: z.string().describe("ID of the sub-agent that generated this data"),
206
+ data: z.any().describe("The actual data payload")
209
207
  });
210
- var DataOperationEventSchema = external_exports.object({
211
- type: external_exports.string().describe("Event type identifier"),
212
- label: external_exports.string().describe("Human-readable label for the event"),
208
+ var DataOperationEventSchema = z.object({
209
+ type: z.string().describe("Event type identifier"),
210
+ label: z.string().describe("Human-readable label for the event"),
213
211
  details: DataOperationDetailsSchema
214
212
  });
215
- var A2AMessageMetadataSchema = external_exports.object({
216
- fromSubAgentId: external_exports.string().optional().describe("ID of the sending sub-agent"),
217
- toSubAgentId: external_exports.string().optional().describe("ID of the receiving sub-agent"),
218
- fromExternalAgentId: external_exports.string().optional().describe("ID of the sending external agent"),
219
- toExternalAgentId: external_exports.string().optional().describe("ID of the receiving external agent"),
220
- taskId: external_exports.string().optional().describe("Associated task ID"),
221
- a2aTaskId: external_exports.string().optional().describe("A2A-specific task ID")
213
+ var A2AMessageMetadataSchema = z.object({
214
+ fromSubAgentId: z.string().optional().describe("ID of the sending sub-agent"),
215
+ toSubAgentId: z.string().optional().describe("ID of the receiving sub-agent"),
216
+ fromExternalAgentId: z.string().optional().describe("ID of the sending external agent"),
217
+ toExternalAgentId: z.string().optional().describe("ID of the receiving external agent"),
218
+ taskId: z.string().optional().describe("Associated task ID"),
219
+ a2aTaskId: z.string().optional().describe("A2A-specific task ID")
222
220
  });
223
221
 
224
222
  // src/validation/id-validation.ts
@@ -341,50 +339,48 @@ function validateRender(render) {
341
339
  errors
342
340
  };
343
341
  }
344
-
345
- // src/validation/stream-event-schemas.ts
346
- var TextStartEventSchema = external_exports.object({
347
- type: external_exports.literal("text-start"),
348
- id: external_exports.string()
342
+ var TextStartEventSchema = z.object({
343
+ type: z.literal("text-start"),
344
+ id: z.string()
349
345
  });
350
- var TextDeltaEventSchema = external_exports.object({
351
- type: external_exports.literal("text-delta"),
352
- id: external_exports.string(),
353
- delta: external_exports.string()
346
+ var TextDeltaEventSchema = z.object({
347
+ type: z.literal("text-delta"),
348
+ id: z.string(),
349
+ delta: z.string()
354
350
  });
355
- var TextEndEventSchema = external_exports.object({
356
- type: external_exports.literal("text-end"),
357
- id: external_exports.string()
351
+ var TextEndEventSchema = z.object({
352
+ type: z.literal("text-end"),
353
+ id: z.string()
358
354
  });
359
- var DataComponentStreamEventSchema = external_exports.object({
360
- type: external_exports.literal("data-component"),
361
- id: external_exports.string(),
362
- data: external_exports.any()
355
+ var DataComponentStreamEventSchema = z.object({
356
+ type: z.literal("data-component"),
357
+ id: z.string(),
358
+ data: z.any()
363
359
  });
364
- var DataOperationStreamEventSchema = external_exports.object({
365
- type: external_exports.literal("data-operation"),
366
- data: external_exports.any()
360
+ var DataOperationStreamEventSchema = z.object({
361
+ type: z.literal("data-operation"),
362
+ data: z.any()
367
363
  // Contains OperationEvent types (AgentInitializingEvent, CompletionEvent, etc.)
368
364
  });
369
- var DataSummaryStreamEventSchema = external_exports.object({
370
- type: external_exports.literal("data-summary"),
371
- data: external_exports.any()
365
+ var DataSummaryStreamEventSchema = z.object({
366
+ type: z.literal("data-summary"),
367
+ data: z.any()
372
368
  // Contains SummaryEvent from entities.ts
373
369
  });
374
- var StreamErrorEventSchema = external_exports.object({
375
- type: external_exports.literal("error"),
376
- error: external_exports.string()
370
+ var StreamErrorEventSchema = z.object({
371
+ type: z.literal("error"),
372
+ error: z.string()
377
373
  });
378
- var StreamFinishEventSchema = external_exports.object({
379
- type: external_exports.literal("finish"),
380
- finishReason: external_exports.string().optional(),
381
- usage: external_exports.object({
382
- promptTokens: external_exports.number().optional(),
383
- completionTokens: external_exports.number().optional(),
384
- totalTokens: external_exports.number().optional()
374
+ var StreamFinishEventSchema = z.object({
375
+ type: z.literal("finish"),
376
+ finishReason: z.string().optional(),
377
+ usage: z.object({
378
+ promptTokens: z.number().optional(),
379
+ completionTokens: z.number().optional(),
380
+ totalTokens: z.number().optional()
385
381
  }).optional()
386
382
  });
387
- var StreamEventSchema = external_exports.discriminatedUnion("type", [
383
+ var StreamEventSchema = z.discriminatedUnion("type", [
388
384
  TextStartEventSchema,
389
385
  TextDeltaEventSchema,
390
386
  TextEndEventSchema,
@@ -1,11 +1,12 @@
1
- import { external_exports } from './chunk-OUXC23J7.js';
2
1
  import fs from 'fs';
3
2
  import os from 'os';
4
3
  import path from 'path';
5
4
  import dotenv from 'dotenv';
6
5
  import { expand } from 'dotenv-expand';
7
6
  import { findUpSync } from 'find-up';
7
+ import { z } from 'zod';
8
8
 
9
+ // src/env.ts
9
10
  var loadEnvironmentFiles = () => {
10
11
  const environmentFiles = [];
11
12
  const currentEnv = path.resolve(process.cwd(), ".env");
@@ -32,21 +33,21 @@ var loadEnvironmentFiles = () => {
32
33
  }
33
34
  };
34
35
  loadEnvironmentFiles();
35
- var envSchema = external_exports.object({
36
- ENVIRONMENT: external_exports.enum(["development", "production", "pentest", "test"]).optional(),
37
- DATABASE_URL: external_exports.string().optional(),
38
- POSTGRES_POOL_SIZE: external_exports.string().optional(),
39
- INKEEP_AGENTS_JWT_SIGNING_SECRET: external_exports.string().min(32, "INKEEP_AGENTS_JWT_SIGNING_SECRET must be at least 32 characters").optional(),
40
- INKEEP_AGENTS_MANAGE_UI_URL: external_exports.string().optional(),
41
- INKEEP_AGENTS_MANAGE_API_URL: external_exports.string().optional(),
42
- BETTER_AUTH_SECRET: external_exports.string().optional()
36
+ var envSchema = z.object({
37
+ ENVIRONMENT: z.enum(["development", "production", "pentest", "test"]).optional(),
38
+ DATABASE_URL: z.string().optional(),
39
+ POSTGRES_POOL_SIZE: z.string().optional(),
40
+ INKEEP_AGENTS_JWT_SIGNING_SECRET: z.string().min(32, "INKEEP_AGENTS_JWT_SIGNING_SECRET must be at least 32 characters").optional(),
41
+ INKEEP_AGENTS_MANAGE_UI_URL: z.string().optional(),
42
+ INKEEP_AGENTS_MANAGE_API_URL: z.string().optional(),
43
+ BETTER_AUTH_SECRET: z.string().optional()
43
44
  });
44
45
  var parseEnv = () => {
45
46
  try {
46
47
  const parsedEnv = envSchema.parse(process.env);
47
48
  return parsedEnv;
48
49
  } catch (error) {
49
- if (error instanceof external_exports.ZodError) {
50
+ if (error instanceof z.ZodError) {
50
51
  const missingVars = error.issues.map((issue) => issue.path.join("."));
51
52
  throw new Error(
52
53
  `\u274C Invalid environment variables: ${missingVars.join(", ")}
@@ -1,14 +1,13 @@
1
1
  import { schemaValidationDefaults } from './chunk-Z64UK4CA.js';
2
- import { loadEnvironmentFiles } from './chunk-NMBNWFIZ.js';
3
- import { external_exports } from './chunk-OUXC23J7.js';
2
+ import { loadEnvironmentFiles } from './chunk-LL6F3EAR.js';
3
+ import { z } from 'zod';
4
4
 
5
- // src/constants/schema-validation/index.ts
6
5
  loadEnvironmentFiles();
7
- var constantsSchema = external_exports.object(
6
+ var constantsSchema = z.object(
8
7
  Object.fromEntries(
9
8
  Object.keys(schemaValidationDefaults).map((key) => [
10
9
  `AGENTS_${key}`,
11
- external_exports.coerce.number().optional()
10
+ z.coerce.number().optional()
12
11
  ])
13
12
  )
14
13
  );
@@ -1,10 +1,11 @@
1
- import { loadEnvironmentFiles, env } from './chunk-NMBNWFIZ.js';
1
+ import { loadEnvironmentFiles, env } from './chunk-LL6F3EAR.js';
2
2
  import { getLogger } from './chunk-DN4B564Y.js';
3
3
  import { CredentialStoreType, MCPTransportType } from './chunk-YFHT5M2R.js';
4
- import { external_exports } from './chunk-OUXC23J7.js';
4
+ import { z } from 'zod';
5
5
  import { customAlphabet } from 'nanoid';
6
6
  import { scrypt, randomBytes, timingSafeEqual } from 'crypto';
7
7
  import { promisify } from 'util';
8
+ import { z as z$1 } from '@hono/zod-openapi';
8
9
  import { HTTPException } from 'hono/http-exception';
9
10
  import { Client } from '@modelcontextprotocol/sdk/client/index.js';
10
11
  import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
@@ -53,14 +54,12 @@ var executionLimitsSharedDefaults = {
53
54
  // Increased from 4,000 to 8,000 to accommodate tool results in conversation history.
54
55
  CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT: 8e3
55
56
  };
56
-
57
- // src/constants/execution-limits-shared/index.ts
58
57
  loadEnvironmentFiles();
59
- var constantsSchema = external_exports.object(
58
+ var constantsSchema = z.object(
60
59
  Object.fromEntries(
61
60
  Object.keys(executionLimitsSharedDefaults).map((key) => [
62
61
  `AGENTS_${key}`,
63
- external_exports.coerce.number().optional()
62
+ z.coerce.number().optional()
64
63
  ])
65
64
  )
66
65
  );
@@ -196,7 +195,7 @@ function toISODateString(dateValue) {
196
195
  }
197
196
  return dateValue.toISOString();
198
197
  }
199
- var ErrorCode = external_exports.enum([
198
+ var ErrorCode = z$1.enum([
200
199
  "bad_request",
201
200
  "unauthorized",
202
201
  "forbidden",
@@ -215,28 +214,28 @@ var errorCodeToHttpStatus = {
215
214
  internal_server_error: 500
216
215
  };
217
216
  var ERROR_DOCS_BASE_URL = "https://docs.inkeep.com/agents-api/errors";
218
- var problemDetailsSchema = external_exports.object({
217
+ var problemDetailsSchema = z$1.object({
219
218
  // type: z.string().url().openapi({
220
219
  // description: "A URI reference that identifies the problem type.",
221
220
  // example: `${ERROR_DOCS_BASE_URL}#not-found`,
222
221
  // }),
223
- title: external_exports.string().openapi({
222
+ title: z$1.string().openapi({
224
223
  description: "A short, human-readable summary of the problem type.",
225
224
  example: "Resource Not Found"
226
225
  }),
227
- status: external_exports.number().int().openapi({
226
+ status: z$1.number().int().openapi({
228
227
  description: "The HTTP status code.",
229
228
  example: 404
230
229
  }),
231
- detail: external_exports.string().openapi({
230
+ detail: z$1.string().openapi({
232
231
  description: "A human-readable explanation specific to this occurrence of the problem.",
233
232
  example: "The requested resource was not found."
234
233
  }),
235
- instance: external_exports.string().optional().openapi({
234
+ instance: z$1.string().optional().openapi({
236
235
  description: "A URI reference that identifies the specific occurrence of the problem.",
237
236
  example: "/conversations/123"
238
237
  }),
239
- requestId: external_exports.string().optional().openapi({
238
+ requestId: z$1.string().optional().openapi({
240
239
  description: "A unique identifier for the request, useful for troubleshooting.",
241
240
  example: "req_1234567890"
242
241
  }),
@@ -245,13 +244,13 @@ var problemDetailsSchema = external_exports.object({
245
244
  example: "not_found"
246
245
  })
247
246
  }).openapi("ProblemDetails");
248
- var errorResponseSchema = external_exports.object({
249
- error: external_exports.object({
247
+ var errorResponseSchema = z$1.object({
248
+ error: z$1.object({
250
249
  code: ErrorCode.openapi({
251
250
  description: "A short code indicating the error code returned.",
252
251
  example: "not_found"
253
252
  }),
254
- message: external_exports.string().openapi({
253
+ message: z$1.string().openapi({
255
254
  description: "A human readable error message.",
256
255
  example: "The requested resource was not found."
257
256
  })
@@ -389,15 +388,15 @@ var errorSchemaFactory = (code, description) => ({
389
388
  content: {
390
389
  "application/problem+json": {
391
390
  schema: problemDetailsSchema.extend({
392
- code: external_exports.literal(code).openapi({
391
+ code: z$1.literal(code).openapi({
393
392
  description: "A short code indicating the error code returned.",
394
393
  example: code
395
394
  }),
396
- detail: external_exports.string().openapi({
395
+ detail: z$1.string().openapi({
397
396
  description: "A detailed explanation specific to this occurrence of the problem, providing context and specifics about what went wrong.",
398
397
  example: description
399
398
  }),
400
- title: external_exports.string().openapi({
399
+ title: z$1.string().openapi({
401
400
  description: "A short, human-readable summary of the problem type.",
402
401
  example: getTitleFromCode(code)
403
402
  }),
@@ -405,16 +404,16 @@ var errorSchemaFactory = (code, description) => ({
405
404
  // description: "A URI reference that identifies the problem type.",
406
405
  // example: `${ERROR_DOCS_BASE_URL}#${code}`,
407
406
  // }),
408
- status: external_exports.number().int().openapi({
407
+ status: z$1.number().int().openapi({
409
408
  description: "The HTTP status code.",
410
409
  example: errorCodeToHttpStatus[code]
411
410
  }),
412
- error: external_exports.object({
413
- code: external_exports.literal(code).openapi({
411
+ error: z$1.object({
412
+ code: z$1.literal(code).openapi({
414
413
  description: "A short code indicating the error code returned.",
415
414
  example: code
416
415
  }),
417
- message: external_exports.string().openapi({
416
+ message: z$1.string().openapi({
418
417
  description: "A concise error message suitable for display to end users. May be truncated if the full detail is long.",
419
418
  example: description.length > 100 ? `${description.substring(0, 97)}...` : description
420
419
  })
@@ -614,7 +613,7 @@ var McpClient = class {
614
613
  try {
615
614
  const createZodSchema = (inputSchema) => {
616
615
  if (!inputSchema || !inputSchema.properties) {
617
- return external_exports.object({});
616
+ return z.object({});
618
617
  }
619
618
  const zodProperties = {};
620
619
  for (const [key, prop] of Object.entries(inputSchema.properties)) {
@@ -622,22 +621,22 @@ var McpClient = class {
622
621
  let zodType;
623
622
  switch (propDef.type) {
624
623
  case "string":
625
- zodType = external_exports.string();
624
+ zodType = z.string();
626
625
  break;
627
626
  case "number":
628
- zodType = external_exports.number();
627
+ zodType = z.number();
629
628
  break;
630
629
  case "boolean":
631
- zodType = external_exports.boolean();
630
+ zodType = z.boolean();
632
631
  break;
633
632
  case "array":
634
- zodType = external_exports.array(external_exports.any());
633
+ zodType = z.array(z.any());
635
634
  break;
636
635
  case "object":
637
636
  zodType = createZodSchema(propDef);
638
637
  break;
639
638
  default:
640
- zodType = external_exports.any();
639
+ zodType = z.any();
641
640
  }
642
641
  if (propDef.description) {
643
642
  zodType = zodType.describe(propDef.description);
@@ -648,7 +647,7 @@ var McpClient = class {
648
647
  }
649
648
  zodProperties[key] = zodType;
650
649
  }
651
- return external_exports.object(zodProperties);
650
+ return z.object(zodProperties);
652
651
  };
653
652
  const schema = createZodSchema(def.inputSchema);
654
653
  const createdTool = tool({