@inkeep/agents-core 0.32.1 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -10,9 +10,9 @@ var findUp = require('find-up');
10
10
  var pino = require('pino');
11
11
  var pinoPretty = require('pino-pretty');
12
12
  var zodOpenapi = require('@hono/zod-openapi');
13
- var drizzleZod = require('drizzle-zod');
14
13
  var drizzleOrm = require('drizzle-orm');
15
14
  var pgCore = require('drizzle-orm/pg-core');
15
+ var drizzleZod = require('drizzle-zod');
16
16
  var jmespath = require('jmespath');
17
17
  var nodePostgres = require('drizzle-orm/node-postgres');
18
18
  var pg = require('pg');
@@ -214607,6 +214607,151 @@ var CredentialStoreType = {
214607
214607
  keychain: "keychain",
214608
214608
  nango: "nango"
214609
214609
  };
214610
+ var MIN_ID_LENGTH = 1;
214611
+ var MAX_ID_LENGTH = 255;
214612
+ var URL_SAFE_ID_PATTERN = /^[a-zA-Z0-9\-_.]+$/;
214613
+ var resourceIdSchema = zodOpenapi.z.string().min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).describe("Resource identifier").regex(URL_SAFE_ID_PATTERN, {
214614
+ message: "ID must contain only letters, numbers, hyphens, underscores, and dots"
214615
+ }).openapi({
214616
+ description: "Resource identifier",
214617
+ example: "resource_789"
214618
+ });
214619
+ resourceIdSchema.meta({
214620
+ description: "Resource identifier"
214621
+ });
214622
+ var FIELD_MODIFIERS = {
214623
+ id: (schema) => {
214624
+ const modified = schema.min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).describe("Resource identifier").regex(URL_SAFE_ID_PATTERN, {
214625
+ message: "ID must contain only letters, numbers, hyphens, underscores, and dots"
214626
+ }).openapi({
214627
+ description: "Resource identifier",
214628
+ example: "resource_789"
214629
+ });
214630
+ modified.meta({
214631
+ description: "Resource identifier"
214632
+ });
214633
+ return modified;
214634
+ },
214635
+ name: (_schema) => {
214636
+ const modified = zodOpenapi.z.string().describe("Name");
214637
+ modified.meta({ description: "Name" });
214638
+ return modified;
214639
+ },
214640
+ description: (_schema) => {
214641
+ const modified = zodOpenapi.z.string().describe("Description");
214642
+ modified.meta({ description: "Description" });
214643
+ return modified;
214644
+ },
214645
+ tenantId: (schema) => {
214646
+ const modified = schema.describe("Tenant identifier");
214647
+ modified.meta({ description: "Tenant identifier" });
214648
+ return modified;
214649
+ },
214650
+ projectId: (schema) => {
214651
+ const modified = schema.describe("Project identifier");
214652
+ modified.meta({ description: "Project identifier" });
214653
+ return modified;
214654
+ },
214655
+ agentId: (schema) => {
214656
+ const modified = schema.describe("Agent identifier");
214657
+ modified.meta({ description: "Agent identifier" });
214658
+ return modified;
214659
+ },
214660
+ subAgentId: (schema) => {
214661
+ const modified = schema.describe("Sub-agent identifier");
214662
+ modified.meta({ description: "Sub-agent identifier" });
214663
+ return modified;
214664
+ },
214665
+ createdAt: (schema) => {
214666
+ const modified = schema.describe("Creation timestamp");
214667
+ modified.meta({ description: "Creation timestamp" });
214668
+ return modified;
214669
+ },
214670
+ updatedAt: (schema) => {
214671
+ const modified = schema.describe("Last update timestamp");
214672
+ modified.meta({ description: "Last update timestamp" });
214673
+ return modified;
214674
+ }
214675
+ };
214676
+ function createSelectSchemaWithModifiers(table, overrides) {
214677
+ const tableColumns = table._?.columns;
214678
+ if (!tableColumns) {
214679
+ return drizzleZod.createSelectSchema(table, overrides);
214680
+ }
214681
+ const tableFieldNames = Object.keys(tableColumns);
214682
+ const modifiers = {};
214683
+ for (const fieldName of tableFieldNames) {
214684
+ const fieldNameStr = String(fieldName);
214685
+ if (fieldNameStr in FIELD_MODIFIERS) {
214686
+ modifiers[fieldNameStr] = FIELD_MODIFIERS[fieldNameStr];
214687
+ }
214688
+ }
214689
+ const mergedModifiers = { ...modifiers, ...overrides };
214690
+ return drizzleZod.createSelectSchema(table, mergedModifiers);
214691
+ }
214692
+ function createInsertSchemaWithModifiers(table, overrides) {
214693
+ const tableColumns = table._?.columns;
214694
+ if (!tableColumns) {
214695
+ return drizzleZod.createInsertSchema(table, overrides);
214696
+ }
214697
+ const tableFieldNames = Object.keys(tableColumns);
214698
+ const modifiers = {};
214699
+ for (const fieldName of tableFieldNames) {
214700
+ const fieldNameStr = String(fieldName);
214701
+ if (fieldNameStr in FIELD_MODIFIERS) {
214702
+ modifiers[fieldNameStr] = FIELD_MODIFIERS[fieldNameStr];
214703
+ }
214704
+ }
214705
+ const mergedModifiers = { ...modifiers, ...overrides };
214706
+ return drizzleZod.createInsertSchema(table, mergedModifiers);
214707
+ }
214708
+ var createSelectSchema = createSelectSchemaWithModifiers;
214709
+ var createInsertSchema = createInsertSchemaWithModifiers;
214710
+ function registerFieldSchemas(schema) {
214711
+ if (!(schema instanceof zodOpenapi.z.ZodObject)) {
214712
+ return schema;
214713
+ }
214714
+ const shape = schema.shape;
214715
+ const fieldMetadata = {
214716
+ id: { description: "Resource identifier" },
214717
+ name: { description: "Name" },
214718
+ description: { description: "Description" },
214719
+ tenantId: { description: "Tenant identifier" },
214720
+ projectId: { description: "Project identifier" },
214721
+ agentId: { description: "Agent identifier" },
214722
+ subAgentId: { description: "Sub-agent identifier" },
214723
+ createdAt: { description: "Creation timestamp" },
214724
+ updatedAt: { description: "Last update timestamp" }
214725
+ };
214726
+ for (const [fieldName, fieldSchema] of Object.entries(shape)) {
214727
+ if (fieldName in fieldMetadata && fieldSchema) {
214728
+ let zodFieldSchema = fieldSchema;
214729
+ let innerSchema = null;
214730
+ if (zodFieldSchema instanceof zodOpenapi.z.ZodOptional) {
214731
+ innerSchema = zodFieldSchema._def.innerType;
214732
+ zodFieldSchema = innerSchema;
214733
+ }
214734
+ zodFieldSchema.meta(fieldMetadata[fieldName]);
214735
+ if (fieldName === "id" && zodFieldSchema instanceof zodOpenapi.z.ZodString) {
214736
+ zodFieldSchema.openapi({
214737
+ description: "Resource identifier",
214738
+ minLength: MIN_ID_LENGTH,
214739
+ maxLength: MAX_ID_LENGTH,
214740
+ pattern: URL_SAFE_ID_PATTERN.source,
214741
+ example: "resource_789"
214742
+ });
214743
+ } else if (zodFieldSchema instanceof zodOpenapi.z.ZodString) {
214744
+ zodFieldSchema.openapi({
214745
+ description: fieldMetadata[fieldName].description
214746
+ });
214747
+ }
214748
+ if (innerSchema && fieldSchema instanceof zodOpenapi.z.ZodOptional) {
214749
+ fieldSchema.meta(fieldMetadata[fieldName]);
214750
+ }
214751
+ }
214752
+ }
214753
+ return schema;
214754
+ }
214610
214755
 
214611
214756
  // src/validation/schemas.ts
214612
214757
  var {
@@ -214630,14 +214775,8 @@ var AgentStopWhenSchema = StopWhenSchema.pick({ transferCountIs: true }).openapi
214630
214775
  var SubAgentStopWhenSchema = StopWhenSchema.pick({ stepCountIs: true }).openapi(
214631
214776
  "SubAgentStopWhen"
214632
214777
  );
214633
- var MIN_ID_LENGTH = 1;
214634
- var MAX_ID_LENGTH = 255;
214635
- var URL_SAFE_ID_PATTERN = /^[a-zA-Z0-9\-_.]+$/;
214636
- var resourceIdSchema = zodOpenapi.z.string().min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).describe("Resource identifier").regex(URL_SAFE_ID_PATTERN, {
214637
- message: "ID must contain only letters, numbers, hyphens, underscores, and dots"
214638
- }).openapi({
214639
- example: "resource_789"
214640
- });
214778
+ var pageNumber = zodOpenapi.z.coerce.number().min(1).default(1).openapi("PaginationPageQueryParam");
214779
+ var limitNumber = zodOpenapi.z.coerce.number().min(1).max(100).default(10).openapi("PaginationLimitQueryParam");
214641
214780
  var ModelSettingsSchema = zodOpenapi.z.object({
214642
214781
  model: zodOpenapi.z.string().optional().describe("The model to use for the project."),
214643
214782
  providerOptions: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.any()).optional().describe("The provider options to use for the project.")
@@ -214665,8 +214804,8 @@ var createApiUpdateSchema = (schema) => schema.omit({ tenantId: true, projectId:
214665
214804
  var createAgentScopedApiSchema = (schema) => schema.omit({ tenantId: true, projectId: true, agentId: true });
214666
214805
  var createAgentScopedApiInsertSchema = (schema) => schema.omit({ tenantId: true, projectId: true, agentId: true });
214667
214806
  var createAgentScopedApiUpdateSchema = (schema) => schema.omit({ tenantId: true, projectId: true, agentId: true }).partial();
214668
- var SubAgentSelectSchema = drizzleZod.createSelectSchema(subAgents);
214669
- var SubAgentInsertSchema = drizzleZod.createInsertSchema(subAgents).extend({
214807
+ var SubAgentSelectSchema = createSelectSchema(subAgents);
214808
+ var SubAgentInsertSchema = createInsertSchema(subAgents).extend({
214670
214809
  id: resourceIdSchema,
214671
214810
  models: ModelSchema.optional()
214672
214811
  });
@@ -214674,8 +214813,8 @@ var SubAgentUpdateSchema = SubAgentInsertSchema.partial();
214674
214813
  var SubAgentApiSelectSchema = createAgentScopedApiSchema(SubAgentSelectSchema).openapi("SubAgent");
214675
214814
  var SubAgentApiInsertSchema = createAgentScopedApiInsertSchema(SubAgentInsertSchema).openapi("SubAgentCreate");
214676
214815
  var SubAgentApiUpdateSchema = createAgentScopedApiUpdateSchema(SubAgentUpdateSchema).openapi("SubAgentUpdate");
214677
- var SubAgentRelationSelectSchema = drizzleZod.createSelectSchema(subAgentRelations);
214678
- var SubAgentRelationInsertSchema = drizzleZod.createInsertSchema(subAgentRelations).extend({
214816
+ var SubAgentRelationSelectSchema = createSelectSchema(subAgentRelations);
214817
+ var SubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend({
214679
214818
  id: resourceIdSchema,
214680
214819
  agentId: resourceIdSchema,
214681
214820
  sourceSubAgentId: resourceIdSchema,
@@ -214730,7 +214869,7 @@ var SubAgentRelationQuerySchema = zodOpenapi.z.object({
214730
214869
  externalSubAgentId: zodOpenapi.z.string().optional(),
214731
214870
  teamSubAgentId: zodOpenapi.z.string().optional()
214732
214871
  });
214733
- var ExternalSubAgentRelationInsertSchema = drizzleZod.createInsertSchema(subAgentRelations).extend({
214872
+ var ExternalSubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend({
214734
214873
  id: resourceIdSchema,
214735
214874
  agentId: resourceIdSchema,
214736
214875
  sourceSubAgentId: resourceIdSchema,
@@ -214739,8 +214878,8 @@ var ExternalSubAgentRelationInsertSchema = drizzleZod.createInsertSchema(subAgen
214739
214878
  var ExternalSubAgentRelationApiInsertSchema = createApiInsertSchema(
214740
214879
  ExternalSubAgentRelationInsertSchema
214741
214880
  );
214742
- var AgentSelectSchema = drizzleZod.createSelectSchema(agents);
214743
- var AgentInsertSchema = drizzleZod.createInsertSchema(agents).extend({
214881
+ var AgentSelectSchema = createSelectSchema(agents);
214882
+ var AgentInsertSchema = createInsertSchema(agents).extend({
214744
214883
  id: resourceIdSchema,
214745
214884
  name: zodOpenapi.z.string().trim().nonempty()
214746
214885
  });
@@ -214750,8 +214889,8 @@ var AgentApiInsertSchema = createApiInsertSchema(AgentInsertSchema).extend({
214750
214889
  id: resourceIdSchema
214751
214890
  }).openapi("AgentCreate");
214752
214891
  var AgentApiUpdateSchema = createApiUpdateSchema(AgentUpdateSchema).openapi("AgentUpdate");
214753
- var TaskSelectSchema = drizzleZod.createSelectSchema(tasks);
214754
- var TaskInsertSchema = drizzleZod.createInsertSchema(tasks).extend({
214892
+ var TaskSelectSchema = createSelectSchema(tasks);
214893
+ var TaskInsertSchema = createInsertSchema(tasks).extend({
214755
214894
  id: resourceIdSchema,
214756
214895
  conversationId: resourceIdSchema.optional()
214757
214896
  });
@@ -214759,8 +214898,8 @@ var TaskUpdateSchema = TaskInsertSchema.partial();
214759
214898
  var TaskApiSelectSchema = createApiSchema(TaskSelectSchema);
214760
214899
  var TaskApiInsertSchema = createApiInsertSchema(TaskInsertSchema);
214761
214900
  var TaskApiUpdateSchema = createApiUpdateSchema(TaskUpdateSchema);
214762
- var TaskRelationSelectSchema = drizzleZod.createSelectSchema(taskRelations);
214763
- var TaskRelationInsertSchema = drizzleZod.createInsertSchema(taskRelations).extend({
214901
+ var TaskRelationSelectSchema = createSelectSchema(taskRelations);
214902
+ var TaskRelationInsertSchema = createInsertSchema(taskRelations).extend({
214764
214903
  id: resourceIdSchema,
214765
214904
  parentTaskId: resourceIdSchema,
214766
214905
  childTaskId: resourceIdSchema
@@ -214804,8 +214943,8 @@ var McpToolDefinitionSchema = zodOpenapi.z.object({
214804
214943
  description: zodOpenapi.z.string().optional(),
214805
214944
  inputSchema: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).optional()
214806
214945
  });
214807
- var ToolSelectSchema = drizzleZod.createSelectSchema(tools);
214808
- var ToolInsertSchema = drizzleZod.createInsertSchema(tools).extend({
214946
+ var ToolSelectSchema = createSelectSchema(tools);
214947
+ var ToolInsertSchema = createInsertSchema(tools).extend({
214809
214948
  id: resourceIdSchema,
214810
214949
  imageUrl: imageUrlSchema,
214811
214950
  config: zodOpenapi.z.object({
@@ -214828,8 +214967,8 @@ var ToolInsertSchema = drizzleZod.createInsertSchema(tools).extend({
214828
214967
  })
214829
214968
  })
214830
214969
  });
214831
- var ConversationSelectSchema = drizzleZod.createSelectSchema(conversations);
214832
- var ConversationInsertSchema = drizzleZod.createInsertSchema(conversations).extend({
214970
+ var ConversationSelectSchema = createSelectSchema(conversations);
214971
+ var ConversationInsertSchema = createInsertSchema(conversations).extend({
214833
214972
  id: resourceIdSchema,
214834
214973
  contextConfigId: resourceIdSchema.optional()
214835
214974
  });
@@ -214837,8 +214976,8 @@ var ConversationUpdateSchema = ConversationInsertSchema.partial();
214837
214976
  var ConversationApiSelectSchema = createApiSchema(ConversationSelectSchema).openapi("Conversation");
214838
214977
  var ConversationApiInsertSchema = createApiInsertSchema(ConversationInsertSchema).openapi("ConversationCreate");
214839
214978
  var ConversationApiUpdateSchema = createApiUpdateSchema(ConversationUpdateSchema).openapi("ConversationUpdate");
214840
- var MessageSelectSchema = drizzleZod.createSelectSchema(messages);
214841
- var MessageInsertSchema = drizzleZod.createInsertSchema(messages).extend({
214979
+ var MessageSelectSchema = createSelectSchema(messages);
214980
+ var MessageInsertSchema = createInsertSchema(messages).extend({
214842
214981
  id: resourceIdSchema,
214843
214982
  conversationId: resourceIdSchema,
214844
214983
  taskId: resourceIdSchema.optional()
@@ -214847,14 +214986,14 @@ var MessageUpdateSchema = MessageInsertSchema.partial();
214847
214986
  var MessageApiSelectSchema = createApiSchema(MessageSelectSchema).openapi("Message");
214848
214987
  var MessageApiInsertSchema = createApiInsertSchema(MessageInsertSchema).openapi("MessageCreate");
214849
214988
  var MessageApiUpdateSchema = createApiUpdateSchema(MessageUpdateSchema).openapi("MessageUpdate");
214850
- var ContextCacheSelectSchema = drizzleZod.createSelectSchema(contextCache);
214851
- var ContextCacheInsertSchema = drizzleZod.createInsertSchema(contextCache);
214989
+ var ContextCacheSelectSchema = createSelectSchema(contextCache);
214990
+ var ContextCacheInsertSchema = createInsertSchema(contextCache);
214852
214991
  var ContextCacheUpdateSchema = ContextCacheInsertSchema.partial();
214853
214992
  var ContextCacheApiSelectSchema = createApiSchema(ContextCacheSelectSchema);
214854
214993
  var ContextCacheApiInsertSchema = createApiInsertSchema(ContextCacheInsertSchema);
214855
214994
  var ContextCacheApiUpdateSchema = createApiUpdateSchema(ContextCacheUpdateSchema);
214856
- var DataComponentSelectSchema = drizzleZod.createSelectSchema(dataComponents);
214857
- var DataComponentInsertSchema = drizzleZod.createInsertSchema(dataComponents).extend({
214995
+ var DataComponentSelectSchema = createSelectSchema(dataComponents);
214996
+ var DataComponentInsertSchema = createInsertSchema(dataComponents).extend({
214858
214997
  id: resourceIdSchema
214859
214998
  });
214860
214999
  var DataComponentBaseSchema = DataComponentInsertSchema.omit({
@@ -214865,8 +215004,8 @@ var DataComponentUpdateSchema = DataComponentInsertSchema.partial();
214865
215004
  var DataComponentApiSelectSchema = createApiSchema(DataComponentSelectSchema).openapi("DataComponent");
214866
215005
  var DataComponentApiInsertSchema = createApiInsertSchema(DataComponentInsertSchema).openapi("DataComponentCreate");
214867
215006
  var DataComponentApiUpdateSchema = createApiUpdateSchema(DataComponentUpdateSchema).openapi("DataComponentUpdate");
214868
- var SubAgentDataComponentSelectSchema = drizzleZod.createSelectSchema(subAgentDataComponents);
214869
- var SubAgentDataComponentInsertSchema = drizzleZod.createInsertSchema(subAgentDataComponents);
215007
+ var SubAgentDataComponentSelectSchema = createSelectSchema(subAgentDataComponents);
215008
+ var SubAgentDataComponentInsertSchema = createInsertSchema(subAgentDataComponents);
214870
215009
  var SubAgentDataComponentUpdateSchema = SubAgentDataComponentInsertSchema.partial();
214871
215010
  var SubAgentDataComponentApiSelectSchema = createAgentScopedApiSchema(
214872
215011
  SubAgentDataComponentSelectSchema
@@ -214880,8 +215019,8 @@ var SubAgentDataComponentApiInsertSchema = SubAgentDataComponentInsertSchema.omi
214880
215019
  var SubAgentDataComponentApiUpdateSchema = createAgentScopedApiUpdateSchema(
214881
215020
  SubAgentDataComponentUpdateSchema
214882
215021
  );
214883
- var ArtifactComponentSelectSchema = drizzleZod.createSelectSchema(artifactComponents);
214884
- var ArtifactComponentInsertSchema = drizzleZod.createInsertSchema(artifactComponents).extend({
215022
+ var ArtifactComponentSelectSchema = createSelectSchema(artifactComponents);
215023
+ var ArtifactComponentInsertSchema = createInsertSchema(artifactComponents).extend({
214885
215024
  id: resourceIdSchema
214886
215025
  });
214887
215026
  var ArtifactComponentUpdateSchema = ArtifactComponentInsertSchema.partial();
@@ -214897,8 +215036,8 @@ var ArtifactComponentApiInsertSchema = ArtifactComponentInsertSchema.omit({
214897
215036
  var ArtifactComponentApiUpdateSchema = createApiUpdateSchema(
214898
215037
  ArtifactComponentUpdateSchema
214899
215038
  ).openapi("ArtifactComponentUpdate");
214900
- var SubAgentArtifactComponentSelectSchema = drizzleZod.createSelectSchema(subAgentArtifactComponents);
214901
- var SubAgentArtifactComponentInsertSchema = drizzleZod.createInsertSchema(
215039
+ var SubAgentArtifactComponentSelectSchema = createSelectSchema(subAgentArtifactComponents);
215040
+ var SubAgentArtifactComponentInsertSchema = createInsertSchema(
214902
215041
  subAgentArtifactComponents
214903
215042
  ).extend({
214904
215043
  id: resourceIdSchema,
@@ -214918,10 +215057,10 @@ var SubAgentArtifactComponentApiInsertSchema = SubAgentArtifactComponentInsertSc
214918
215057
  var SubAgentArtifactComponentApiUpdateSchema = createAgentScopedApiUpdateSchema(
214919
215058
  SubAgentArtifactComponentUpdateSchema
214920
215059
  );
214921
- var ExternalAgentSelectSchema = drizzleZod.createSelectSchema(externalAgents).extend({
215060
+ var ExternalAgentSelectSchema = createSelectSchema(externalAgents).extend({
214922
215061
  credentialReferenceId: zodOpenapi.z.string().nullable().optional()
214923
215062
  });
214924
- var ExternalAgentInsertSchema = drizzleZod.createInsertSchema(externalAgents).extend({
215063
+ var ExternalAgentInsertSchema = createInsertSchema(externalAgents).extend({
214925
215064
  id: resourceIdSchema
214926
215065
  });
214927
215066
  var ExternalAgentUpdateSchema = ExternalAgentInsertSchema.partial();
@@ -214932,8 +215071,8 @@ var AllAgentSchema = zodOpenapi.z.discriminatedUnion("type", [
214932
215071
  SubAgentApiSelectSchema.extend({ type: zodOpenapi.z.literal("internal") }),
214933
215072
  ExternalAgentApiSelectSchema.extend({ type: zodOpenapi.z.literal("external") })
214934
215073
  ]);
214935
- var ApiKeySelectSchema = drizzleZod.createSelectSchema(apiKeys);
214936
- var ApiKeyInsertSchema = drizzleZod.createInsertSchema(apiKeys).extend({
215074
+ var ApiKeySelectSchema = createSelectSchema(apiKeys);
215075
+ var ApiKeyInsertSchema = createInsertSchema(apiKeys).extend({
214937
215076
  id: resourceIdSchema,
214938
215077
  agentId: resourceIdSchema
214939
215078
  });
@@ -214984,7 +215123,7 @@ var CredentialReferenceSelectSchema = zodOpenapi.z.object({
214984
215123
  createdAt: zodOpenapi.z.string(),
214985
215124
  updatedAt: zodOpenapi.z.string()
214986
215125
  });
214987
- var CredentialReferenceInsertSchema = drizzleZod.createInsertSchema(credentialReferences).extend({
215126
+ var CredentialReferenceInsertSchema = createInsertSchema(credentialReferences).extend({
214988
215127
  id: resourceIdSchema,
214989
215128
  type: zodOpenapi.z.string(),
214990
215129
  credentialStoreId: resourceIdSchema,
@@ -215055,7 +215194,7 @@ var McpToolSchema = ToolInsertSchema.extend({
215055
215194
  createdAt: zodOpenapi.z.date(),
215056
215195
  updatedAt: zodOpenapi.z.date(),
215057
215196
  expiresAt: zodOpenapi.z.date().optional()
215058
- });
215197
+ }).openapi("McpTool");
215059
215198
  var MCPToolConfigSchema = McpToolSchema.omit({
215060
215199
  config: true,
215061
215200
  tenantId: true,
@@ -215079,16 +215218,16 @@ var ToolUpdateSchema = ToolInsertSchema.partial();
215079
215218
  var ToolApiSelectSchema = createApiSchema(ToolSelectSchema).openapi("Tool");
215080
215219
  var ToolApiInsertSchema = createApiInsertSchema(ToolInsertSchema).openapi("ToolCreate");
215081
215220
  var ToolApiUpdateSchema = createApiUpdateSchema(ToolUpdateSchema).openapi("ToolUpdate");
215082
- var FunctionToolSelectSchema = drizzleZod.createSelectSchema(functionTools);
215083
- var FunctionToolInsertSchema = drizzleZod.createInsertSchema(functionTools).extend({
215221
+ var FunctionToolSelectSchema = createSelectSchema(functionTools);
215222
+ var FunctionToolInsertSchema = createInsertSchema(functionTools).extend({
215084
215223
  id: resourceIdSchema
215085
215224
  });
215086
215225
  var FunctionToolUpdateSchema = FunctionToolInsertSchema.partial();
215087
215226
  var FunctionToolApiSelectSchema = createApiSchema(FunctionToolSelectSchema).openapi("FunctionTool");
215088
215227
  var FunctionToolApiInsertSchema = createAgentScopedApiInsertSchema(FunctionToolInsertSchema).openapi("FunctionToolCreate");
215089
215228
  var FunctionToolApiUpdateSchema = createApiUpdateSchema(FunctionToolUpdateSchema).openapi("FunctionToolUpdate");
215090
- var FunctionSelectSchema = drizzleZod.createSelectSchema(functions);
215091
- var FunctionInsertSchema = drizzleZod.createInsertSchema(functions).extend({
215229
+ var FunctionSelectSchema = createSelectSchema(functions);
215230
+ var FunctionInsertSchema = createInsertSchema(functions).extend({
215092
215231
  id: resourceIdSchema
215093
215232
  });
215094
215233
  var FunctionUpdateSchema = FunctionInsertSchema.partial();
@@ -215116,13 +215255,13 @@ var FetchDefinitionSchema = zodOpenapi.z.object({
215116
215255
  }),
215117
215256
  credential: CredentialReferenceApiInsertSchema.optional()
215118
215257
  }).openapi("FetchDefinition");
215119
- var ContextConfigSelectSchema = drizzleZod.createSelectSchema(contextConfigs).extend({
215258
+ var ContextConfigSelectSchema = createSelectSchema(contextConfigs).extend({
215120
215259
  headersSchema: zodOpenapi.z.any().optional().openapi({
215121
215260
  type: "object",
215122
215261
  description: "JSON Schema for validating request headers"
215123
215262
  })
215124
215263
  });
215125
- var ContextConfigInsertSchema = drizzleZod.createInsertSchema(contextConfigs).extend({
215264
+ var ContextConfigInsertSchema = createInsertSchema(contextConfigs).extend({
215126
215265
  id: resourceIdSchema.optional(),
215127
215266
  headersSchema: zodOpenapi.z.any().nullable().optional().openapi({
215128
215267
  type: "object",
@@ -215146,8 +215285,8 @@ var ContextConfigApiInsertSchema = createApiInsertSchema(ContextConfigInsertSche
215146
215285
  var ContextConfigApiUpdateSchema = createApiUpdateSchema(ContextConfigUpdateSchema).omit({
215147
215286
  agentId: true
215148
215287
  }).openapi("ContextConfigUpdate");
215149
- var SubAgentToolRelationSelectSchema = drizzleZod.createSelectSchema(subAgentToolRelations);
215150
- var SubAgentToolRelationInsertSchema = drizzleZod.createInsertSchema(subAgentToolRelations).extend({
215288
+ var SubAgentToolRelationSelectSchema = createSelectSchema(subAgentToolRelations);
215289
+ var SubAgentToolRelationInsertSchema = createInsertSchema(subAgentToolRelations).extend({
215151
215290
  id: resourceIdSchema,
215152
215291
  subAgentId: resourceIdSchema,
215153
215292
  toolId: resourceIdSchema,
@@ -215164,10 +215303,10 @@ var SubAgentToolRelationApiInsertSchema = createAgentScopedApiInsertSchema(
215164
215303
  var SubAgentToolRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
215165
215304
  SubAgentToolRelationUpdateSchema
215166
215305
  ).openapi("SubAgentToolRelationUpdate");
215167
- var SubAgentExternalAgentRelationSelectSchema = drizzleZod.createSelectSchema(
215306
+ var SubAgentExternalAgentRelationSelectSchema = createSelectSchema(
215168
215307
  subAgentExternalAgentRelations
215169
215308
  );
215170
- var SubAgentExternalAgentRelationInsertSchema = drizzleZod.createInsertSchema(
215309
+ var SubAgentExternalAgentRelationInsertSchema = createInsertSchema(
215171
215310
  subAgentExternalAgentRelations
215172
215311
  ).extend({
215173
215312
  id: resourceIdSchema,
@@ -215185,8 +215324,8 @@ var SubAgentExternalAgentRelationApiInsertSchema = createAgentScopedApiInsertSch
215185
215324
  var SubAgentExternalAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
215186
215325
  SubAgentExternalAgentRelationUpdateSchema
215187
215326
  ).openapi("SubAgentExternalAgentRelationUpdate");
215188
- var SubAgentTeamAgentRelationSelectSchema = drizzleZod.createSelectSchema(subAgentTeamAgentRelations);
215189
- var SubAgentTeamAgentRelationInsertSchema = drizzleZod.createInsertSchema(
215327
+ var SubAgentTeamAgentRelationSelectSchema = createSelectSchema(subAgentTeamAgentRelations);
215328
+ var SubAgentTeamAgentRelationInsertSchema = createInsertSchema(
215190
215329
  subAgentTeamAgentRelations
215191
215330
  ).extend({
215192
215331
  id: resourceIdSchema,
@@ -215204,8 +215343,8 @@ var SubAgentTeamAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(
215204
215343
  var SubAgentTeamAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
215205
215344
  SubAgentTeamAgentRelationUpdateSchema
215206
215345
  ).openapi("SubAgentTeamAgentRelationUpdate");
215207
- var LedgerArtifactSelectSchema = drizzleZod.createSelectSchema(ledgerArtifacts);
215208
- var LedgerArtifactInsertSchema = drizzleZod.createInsertSchema(ledgerArtifacts);
215346
+ var LedgerArtifactSelectSchema = createSelectSchema(ledgerArtifacts);
215347
+ var LedgerArtifactInsertSchema = createInsertSchema(ledgerArtifacts);
215209
215348
  var LedgerArtifactUpdateSchema = LedgerArtifactInsertSchema.partial();
215210
215349
  var LedgerArtifactApiSelectSchema = createApiSchema(LedgerArtifactSelectSchema);
215211
215350
  var LedgerArtifactApiInsertSchema = createApiInsertSchema(LedgerArtifactInsertSchema);
@@ -215239,17 +215378,17 @@ var canDelegateToExternalAgentSchema = zodOpenapi.z.object({
215239
215378
  externalAgentId: zodOpenapi.z.string(),
215240
215379
  subAgentExternalAgentRelationId: zodOpenapi.z.string().optional(),
215241
215380
  headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).nullish()
215242
- });
215381
+ }).openapi("CanDelegateToExternalAgent");
215243
215382
  var canDelegateToTeamAgentSchema = zodOpenapi.z.object({
215244
215383
  agentId: zodOpenapi.z.string(),
215245
215384
  subAgentTeamAgentRelationId: zodOpenapi.z.string().optional(),
215246
215385
  headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).nullish()
215247
- });
215386
+ }).openapi("CanDelegateToTeamAgent");
215248
215387
  var TeamAgentSchema = zodOpenapi.z.object({
215249
215388
  id: zodOpenapi.z.string(),
215250
215389
  name: zodOpenapi.z.string(),
215251
215390
  description: zodOpenapi.z.string()
215252
- });
215391
+ }).openapi("TeamAgent");
215253
215392
  var FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
215254
215393
  type: zodOpenapi.z.literal("internal"),
215255
215394
  canUse: zodOpenapi.z.array(CanUseItemSchema),
@@ -215268,7 +215407,7 @@ var FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
215268
215407
  // Team agent with headers
215269
215408
  ])
215270
215409
  ).optional()
215271
- });
215410
+ }).openapi("FullAgentAgentInsert");
215272
215411
  var AgentWithinContextOfProjectSchema = AgentApiInsertSchema.extend({
215273
215412
  subAgents: zodOpenapi.z.record(zodOpenapi.z.string(), FullAgentAgentInsertSchema),
215274
215413
  // Lookup maps for UI to resolve canUse items
@@ -215290,10 +215429,10 @@ var AgentWithinContextOfProjectSchema = AgentApiInsertSchema.extend({
215290
215429
  VALIDATION_AGENT_PROMPT_MAX_CHARS2,
215291
215430
  `Agent prompt cannot exceed ${VALIDATION_AGENT_PROMPT_MAX_CHARS2} characters`
215292
215431
  ).optional()
215293
- });
215432
+ }).openapi("AgentWithinContextOfProject");
215294
215433
  var PaginationSchema = zodOpenapi.z.object({
215295
- page: zodOpenapi.z.coerce.number().min(1).default(1),
215296
- limit: zodOpenapi.z.coerce.number().min(1).max(100).default(10),
215434
+ page: pageNumber,
215435
+ limit: limitNumber,
215297
215436
  total: zodOpenapi.z.number(),
215298
215437
  pages: zodOpenapi.z.number()
215299
215438
  }).openapi("Pagination");
@@ -215318,24 +215457,30 @@ var RemovedResponseSchema = zodOpenapi.z.object({
215318
215457
  message: zodOpenapi.z.string(),
215319
215458
  removed: zodOpenapi.z.boolean()
215320
215459
  }).openapi("RemovedResponse");
215321
- var ProjectSelectSchema = drizzleZod.createSelectSchema(projects);
215322
- var ProjectInsertSchema = drizzleZod.createInsertSchema(projects).extend({
215460
+ var ProjectSelectSchema = registerFieldSchemas(
215461
+ createSelectSchema(projects).extend({
215462
+ models: ProjectModelSchema.nullable(),
215463
+ stopWhen: StopWhenSchema.nullable()
215464
+ })
215465
+ );
215466
+ var ProjectInsertSchema = createInsertSchema(projects).extend({
215323
215467
  models: ProjectModelSchema,
215324
215468
  stopWhen: StopWhenSchema.optional()
215325
215469
  }).omit({
215326
215470
  createdAt: true,
215327
215471
  updatedAt: true
215328
215472
  });
215329
- var ProjectUpdateSchema = ProjectInsertSchema.partial();
215473
+ var ProjectUpdateSchema = ProjectInsertSchema.partial().omit({
215474
+ id: true,
215475
+ tenantId: true
215476
+ });
215330
215477
  var ProjectApiSelectSchema = ProjectSelectSchema.omit({ tenantId: true }).openapi(
215331
215478
  "Project"
215332
215479
  );
215333
215480
  var ProjectApiInsertSchema = ProjectInsertSchema.omit({ tenantId: true }).openapi(
215334
215481
  "ProjectCreate"
215335
215482
  );
215336
- var ProjectApiUpdateSchema = ProjectUpdateSchema.omit({ tenantId: true }).openapi(
215337
- "ProjectUpdate"
215338
- );
215483
+ var ProjectApiUpdateSchema = ProjectUpdateSchema.openapi("ProjectUpdate");
215339
215484
  var FullProjectDefinitionSchema = ProjectApiInsertSchema.extend({
215340
215485
  agents: zodOpenapi.z.record(zodOpenapi.z.string(), AgentWithinContextOfProjectSchema),
215341
215486
  tools: zodOpenapi.z.record(zodOpenapi.z.string(), ToolApiInsertSchema),
@@ -215348,7 +215493,7 @@ var FullProjectDefinitionSchema = ProjectApiInsertSchema.extend({
215348
215493
  credentialReferences: zodOpenapi.z.record(zodOpenapi.z.string(), CredentialReferenceApiInsertSchema).optional(),
215349
215494
  createdAt: zodOpenapi.z.string().optional(),
215350
215495
  updatedAt: zodOpenapi.z.string().optional()
215351
- });
215496
+ }).openapi("FullProjectDefinition");
215352
215497
  var ProjectResponse = zodOpenapi.z.object({ data: ProjectApiSelectSchema }).openapi("ProjectResponse");
215353
215498
  var SubAgentResponse = zodOpenapi.z.object({ data: SubAgentApiSelectSchema }).openapi("SubAgentResponse");
215354
215499
  var AgentResponse = zodOpenapi.z.object({ data: AgentApiSelectSchema }).openapi("AgentResponse");
@@ -215439,6 +215584,30 @@ var SubAgentArtifactComponentListResponse = zodOpenapi.z.object({
215439
215584
  data: zodOpenapi.z.array(SubAgentArtifactComponentApiSelectSchema),
215440
215585
  pagination: PaginationSchema
215441
215586
  }).openapi("SubAgentArtifactComponentListResponse");
215587
+ var FullProjectDefinitionResponse = zodOpenapi.z.object({ data: FullProjectDefinitionSchema }).openapi("FullProjectDefinitionResponse");
215588
+ var AgentWithinContextOfProjectResponse = zodOpenapi.z.object({ data: AgentWithinContextOfProjectSchema }).openapi("AgentWithinContextOfProjectResponse");
215589
+ var RelatedAgentInfoListResponse = zodOpenapi.z.object({
215590
+ data: zodOpenapi.z.array(RelatedAgentInfoSchema),
215591
+ pagination: PaginationSchema
215592
+ }).openapi("RelatedAgentInfoListResponse");
215593
+ var ComponentAssociationListResponse = zodOpenapi.z.object({ data: zodOpenapi.z.array(ComponentAssociationSchema) }).openapi("ComponentAssociationListResponse");
215594
+ var McpToolResponse = zodOpenapi.z.object({ data: McpToolSchema }).openapi("McpToolResponse");
215595
+ var McpToolListResponse = zodOpenapi.z.object({
215596
+ data: zodOpenapi.z.array(McpToolSchema),
215597
+ pagination: PaginationSchema
215598
+ }).openapi("McpToolListResponse");
215599
+ var SubAgentTeamAgentRelationResponse = zodOpenapi.z.object({ data: SubAgentTeamAgentRelationApiSelectSchema }).openapi("SubAgentTeamAgentRelationResponse");
215600
+ var SubAgentTeamAgentRelationListResponse = zodOpenapi.z.object({
215601
+ data: zodOpenapi.z.array(SubAgentTeamAgentRelationApiSelectSchema),
215602
+ pagination: PaginationSchema
215603
+ }).openapi("SubAgentTeamAgentRelationListResponse");
215604
+ var SubAgentExternalAgentRelationResponse = zodOpenapi.z.object({ data: SubAgentExternalAgentRelationApiSelectSchema }).openapi("SubAgentExternalAgentRelationResponse");
215605
+ var SubAgentExternalAgentRelationListResponse = zodOpenapi.z.object({
215606
+ data: zodOpenapi.z.array(SubAgentExternalAgentRelationApiSelectSchema),
215607
+ pagination: PaginationSchema
215608
+ }).openapi("SubAgentExternalAgentRelationListResponse");
215609
+ var DataComponentArrayResponse = zodOpenapi.z.object({ data: zodOpenapi.z.array(DataComponentApiSelectSchema) }).openapi("DataComponentArrayResponse");
215610
+ var ArtifactComponentArrayResponse = zodOpenapi.z.object({ data: zodOpenapi.z.array(ArtifactComponentApiSelectSchema) }).openapi("ArtifactComponentArrayResponse");
215442
215611
  var HeadersScopeSchema = zodOpenapi.z.object({
215443
215612
  "x-inkeep-tenant-id": zodOpenapi.z.string().optional().openapi({
215444
215613
  description: "Tenant identifier",
@@ -215453,50 +215622,66 @@ var HeadersScopeSchema = zodOpenapi.z.object({
215453
215622
  example: "agent_789"
215454
215623
  })
215455
215624
  });
215456
- var TenantId = zodOpenapi.z.string().openapi({
215625
+ var TenantId = zodOpenapi.z.string().openapi("TenantIdPathParam", {
215626
+ param: {
215627
+ name: "tenantId",
215628
+ in: "path"
215629
+ },
215457
215630
  description: "Tenant identifier",
215458
215631
  example: "tenant_123"
215459
215632
  });
215460
- var ProjectId = zodOpenapi.z.string().openapi({
215633
+ var ProjectId = zodOpenapi.z.string().openapi("ProjectIdPathParam", {
215634
+ param: {
215635
+ name: "projectId",
215636
+ in: "path"
215637
+ },
215461
215638
  description: "Project identifier",
215462
215639
  example: "project_456"
215463
215640
  });
215464
- var AgentId = zodOpenapi.z.string().openapi({
215641
+ var AgentId = zodOpenapi.z.string().openapi("AgentIdPathParam", {
215642
+ param: {
215643
+ name: "agentId",
215644
+ in: "path"
215645
+ },
215465
215646
  description: "Agent identifier",
215466
215647
  example: "agent_789"
215467
215648
  });
215468
- var SubAgentId = zodOpenapi.z.string().openapi({
215649
+ var SubAgentId = zodOpenapi.z.string().openapi("SubAgentIdPathParam", {
215650
+ param: {
215651
+ name: "subAgentId",
215652
+ in: "path"
215653
+ },
215469
215654
  description: "Sub-agent identifier",
215470
215655
  example: "sub_agent_123"
215471
215656
  });
215472
215657
  var TenantParamsSchema = zodOpenapi.z.object({
215473
215658
  tenantId: TenantId
215474
- }).openapi("TenantParams");
215659
+ });
215475
215660
  var TenantIdParamsSchema = TenantParamsSchema.extend({
215476
215661
  id: resourceIdSchema
215477
- }).openapi("TenantIdParams");
215662
+ });
215478
215663
  var TenantProjectParamsSchema = TenantParamsSchema.extend({
215479
215664
  projectId: ProjectId
215480
- }).openapi("TenantProjectParams");
215665
+ });
215481
215666
  var TenantProjectIdParamsSchema = TenantProjectParamsSchema.extend({
215482
215667
  id: resourceIdSchema
215483
- }).openapi("TenantProjectIdParams");
215668
+ });
215484
215669
  var TenantProjectAgentParamsSchema = TenantProjectParamsSchema.extend({
215485
215670
  agentId: AgentId
215486
- }).openapi("TenantProjectAgentParams");
215671
+ });
215487
215672
  var TenantProjectAgentIdParamsSchema = TenantProjectAgentParamsSchema.extend({
215488
215673
  id: resourceIdSchema
215489
- }).openapi("TenantProjectAgentIdParams");
215674
+ });
215490
215675
  var TenantProjectAgentSubAgentParamsSchema = TenantProjectAgentParamsSchema.extend({
215491
215676
  subAgentId: SubAgentId
215492
- }).openapi("TenantProjectAgentSubAgentParams");
215677
+ });
215493
215678
  var TenantProjectAgentSubAgentIdParamsSchema = TenantProjectAgentSubAgentParamsSchema.extend({
215494
215679
  id: resourceIdSchema
215495
- }).openapi("TenantProjectAgentSubAgentIdParams");
215496
- var PaginationQueryParamsSchema = zodOpenapi.z.object({
215497
- page: zodOpenapi.z.coerce.number().min(1).default(1),
215498
- limit: zodOpenapi.z.coerce.number().min(1).max(100).default(10)
215499
215680
  });
215681
+ var PaginationQueryParamsSchema = zodOpenapi.z.object({
215682
+ page: pageNumber,
215683
+ limit: limitNumber
215684
+ }).openapi("PaginationQueryParams");
215500
215685
 
215501
215686
  // src/context/ContextConfig.ts
215502
215687
  var logger2 = getLogger("context-config");
@@ -216139,7 +216324,7 @@ var CredentialStuffer = class {
216139
216324
  credentialStoreHeaders = await this.getCredentials(context, storeReference, mcpType);
216140
216325
  }
216141
216326
  if (!credentialStoreHeaders) {
216142
- return credentialsFromHeaders ? credentialsFromHeaders.headers : {};
216327
+ return credentialsFromHeaders ? credentialsFromHeaders.headers : { ...headers2 };
216143
216328
  }
216144
216329
  const combinedHeaders = {
216145
216330
  ...credentialStoreHeaders.headers,
@@ -216170,8 +216355,8 @@ var CredentialStuffer = class {
216170
216355
  };
216171
216356
  }
216172
216357
  };
216173
- var __filename2 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
216174
- path.dirname(__filename2);
216358
+ var FILENAME = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
216359
+ path.dirname(FILENAME);
216175
216360
  function createTestDatabaseClientNoMigrations() {
216176
216361
  const client = new pglite.PGlite();
216177
216362
  const db = pglite$1.drizzle(client, { schema: schema_exports });
@@ -216632,9 +216817,8 @@ var upsertExternalAgent = (db) => async (params) => {
216632
216817
  throw new Error("Failed to update external agent - no rows affected");
216633
216818
  }
216634
216819
  return updated;
216635
- } else {
216636
- return await createExternalAgent(db)(params.data);
216637
216820
  }
216821
+ return await createExternalAgent(db)(params.data);
216638
216822
  };
216639
216823
  var deleteExternalAgent = (db) => async (params) => {
216640
216824
  try {
@@ -216895,12 +217079,11 @@ var upsertFunctionTool = (db) => async (params) => {
216895
217079
  functionId: params.data.functionId
216896
217080
  }
216897
217081
  });
216898
- } else {
216899
- return await createFunctionTool(db)({
216900
- data: params.data,
216901
- scopes
216902
- });
216903
217082
  }
217083
+ return await createFunctionTool(db)({
217084
+ data: params.data,
217085
+ scopes
217086
+ });
216904
217087
  };
216905
217088
  var getFunctionToolsForSubAgent = (db) => {
216906
217089
  return async (params) => {
@@ -217879,9 +218062,8 @@ var upsertSubAgent = (db) => async (params) => {
217879
218062
  throw new Error("Failed to update agent - no rows affected");
217880
218063
  }
217881
218064
  return updated;
217882
- } else {
217883
- return await createSubAgent(db)(params.data);
217884
218065
  }
218066
+ return await createSubAgent(db)(params.data);
217885
218067
  };
217886
218068
  var deleteSubAgent = (db) => async (params) => {
217887
218069
  await db.delete(subAgents).where(
@@ -218813,13 +218995,13 @@ var McpClient = class {
218813
218995
  }
218814
218996
  if (selectedTools === void 0) {
218815
218997
  return availableTools;
218816
- } else if (selectedTools.length === 0) {
218998
+ }
218999
+ if (selectedTools.length === 0) {
218817
219000
  return [];
218818
- } else {
218819
- const toolNames = availableTools.map((tool2) => tool2.name);
218820
- this.validateSelectedTools(toolNames, selectedTools);
218821
- return availableTools.filter((tool2) => selectedTools.includes(tool2.name));
218822
219001
  }
219002
+ const toolNames = availableTools.map((tool2) => tool2.name);
219003
+ this.validateSelectedTools(toolNames, selectedTools);
219004
+ return availableTools.filter((tool2) => selectedTools.includes(tool2.name));
218823
219005
  }
218824
219006
  async tools() {
218825
219007
  const tools2 = await this.selectTools();
@@ -219234,9 +219416,8 @@ var upsertCredentialReference = (db) => async (params) => {
219234
219416
  throw new Error("Failed to update credential reference - no rows affected");
219235
219417
  }
219236
219418
  return updated;
219237
- } else {
219238
- return await createCredentialReference(db)(params.data);
219239
219419
  }
219420
+ return await createCredentialReference(db)(params.data);
219240
219421
  };
219241
219422
 
219242
219423
  // src/data-access/tools.ts
@@ -219556,9 +219737,8 @@ var upsertTool = (db) => async (params) => {
219556
219737
  headers: params.data.headers
219557
219738
  }
219558
219739
  });
219559
- } else {
219560
- return await createTool(db)(params.data);
219561
219740
  }
219741
+ return await createTool(db)(params.data);
219562
219742
  };
219563
219743
 
219564
219744
  // src/data-access/agents.ts
@@ -220495,9 +220675,8 @@ var upsertArtifactComponent = (db) => async (params) => {
220495
220675
  props: params.data.props
220496
220676
  }
220497
220677
  });
220498
- } else {
220499
- return await createArtifactComponent(db)(params.data);
220500
220678
  }
220679
+ return await createArtifactComponent(db)(params.data);
220501
220680
  };
220502
220681
 
220503
220682
  // src/validation/render-validation.ts
@@ -220827,9 +221006,8 @@ var upsertDataComponent = (db) => async (params) => {
220827
221006
  props: params.data.props
220828
221007
  }
220829
221008
  });
220830
- } else {
220831
- return await createDataComponent(db)(params.data);
220832
221009
  }
221010
+ return await createDataComponent(db)(params.data);
220833
221011
  };
220834
221012
 
220835
221013
  // src/data-access/agentFull.ts
@@ -225104,7 +225282,8 @@ function filterContextToSchemaKeys(validatedContext, headersSchema) {
225104
225282
  if (filteredHeaders !== null && filteredHeaders !== void 0) {
225105
225283
  if (typeof filteredHeaders === "object" && Object.keys(filteredHeaders).length > 0) {
225106
225284
  return filteredHeaders;
225107
- } else if (typeof filteredHeaders !== "object") {
225285
+ }
225286
+ if (typeof filteredHeaders !== "object") {
225108
225287
  return filteredHeaders;
225109
225288
  }
225110
225289
  }
@@ -226771,6 +226950,7 @@ exports.AgentResponse = AgentResponse;
226771
226950
  exports.AgentSelectSchema = AgentSelectSchema;
226772
226951
  exports.AgentStopWhenSchema = AgentStopWhenSchema;
226773
226952
  exports.AgentUpdateSchema = AgentUpdateSchema;
226953
+ exports.AgentWithinContextOfProjectResponse = AgentWithinContextOfProjectResponse;
226774
226954
  exports.AgentWithinContextOfProjectSchema = AgentWithinContextOfProjectSchema;
226775
226955
  exports.AllAgentSchema = AllAgentSchema;
226776
226956
  exports.ApiKeyApiCreationResponseSchema = ApiKeyApiCreationResponseSchema;
@@ -226785,6 +226965,7 @@ exports.ApiKeyUpdateSchema = ApiKeyUpdateSchema;
226785
226965
  exports.ArtifactComponentApiInsertSchema = ArtifactComponentApiInsertSchema;
226786
226966
  exports.ArtifactComponentApiSelectSchema = ArtifactComponentApiSelectSchema;
226787
226967
  exports.ArtifactComponentApiUpdateSchema = ArtifactComponentApiUpdateSchema;
226968
+ exports.ArtifactComponentArrayResponse = ArtifactComponentArrayResponse;
226788
226969
  exports.ArtifactComponentInsertSchema = ArtifactComponentInsertSchema;
226789
226970
  exports.ArtifactComponentListResponse = ArtifactComponentListResponse;
226790
226971
  exports.ArtifactComponentResponse = ArtifactComponentResponse;
@@ -226794,6 +226975,7 @@ exports.CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT = CONTEXT_FETCHER_HTTP_TIMEOUT_M
226794
226975
  exports.CONVERSATION_HISTORY_DEFAULT_LIMIT = CONVERSATION_HISTORY_DEFAULT_LIMIT;
226795
226976
  exports.CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT = CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT;
226796
226977
  exports.CanUseItemSchema = CanUseItemSchema;
226978
+ exports.ComponentAssociationListResponse = ComponentAssociationListResponse;
226797
226979
  exports.ComponentAssociationSchema = ComponentAssociationSchema;
226798
226980
  exports.ContextCache = ContextCache;
226799
226981
  exports.ContextCacheApiInsertSchema = ContextCacheApiInsertSchema;
@@ -226844,6 +227026,7 @@ exports.DELEGATION_TO_SUB_AGENT_ID = DELEGATION_TO_SUB_AGENT_ID;
226844
227026
  exports.DataComponentApiInsertSchema = DataComponentApiInsertSchema;
226845
227027
  exports.DataComponentApiSelectSchema = DataComponentApiSelectSchema;
226846
227028
  exports.DataComponentApiUpdateSchema = DataComponentApiUpdateSchema;
227029
+ exports.DataComponentArrayResponse = DataComponentArrayResponse;
226847
227030
  exports.DataComponentBaseSchema = DataComponentBaseSchema;
226848
227031
  exports.DataComponentInsertSchema = DataComponentInsertSchema;
226849
227032
  exports.DataComponentListResponse = DataComponentListResponse;
@@ -226875,6 +227058,7 @@ exports.FIELD_TYPES = FIELD_TYPES;
226875
227058
  exports.FetchConfigSchema = FetchConfigSchema;
226876
227059
  exports.FetchDefinitionSchema = FetchDefinitionSchema;
226877
227060
  exports.FullAgentAgentInsertSchema = FullAgentAgentInsertSchema;
227061
+ exports.FullProjectDefinitionResponse = FullProjectDefinitionResponse;
226878
227062
  exports.FullProjectDefinitionSchema = FullProjectDefinitionSchema;
226879
227063
  exports.FunctionApiInsertSchema = FunctionApiInsertSchema;
226880
227064
  exports.FunctionApiSelectSchema = FunctionApiSelectSchema;
@@ -226917,6 +227101,8 @@ exports.MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR = MCP_TOOL_RECONNECTION_DELAY_
226917
227101
  exports.MIN_ID_LENGTH = MIN_ID_LENGTH;
226918
227102
  exports.McpClient = McpClient;
226919
227103
  exports.McpToolDefinitionSchema = McpToolDefinitionSchema;
227104
+ exports.McpToolListResponse = McpToolListResponse;
227105
+ exports.McpToolResponse = McpToolResponse;
226920
227106
  exports.McpToolSchema = McpToolSchema;
226921
227107
  exports.McpTransportConfigSchema = McpTransportConfigSchema;
226922
227108
  exports.MessageApiInsertSchema = MessageApiInsertSchema;
@@ -226953,6 +227139,7 @@ exports.QUERY_EXPRESSIONS = QUERY_EXPRESSIONS;
226953
227139
  exports.QUERY_FIELD_CONFIGS = QUERY_FIELD_CONFIGS;
226954
227140
  exports.QUERY_TYPES = QUERY_TYPES;
226955
227141
  exports.REDUCE_OPERATIONS = REDUCE_OPERATIONS;
227142
+ exports.RelatedAgentInfoListResponse = RelatedAgentInfoListResponse;
226956
227143
  exports.RelatedAgentInfoSchema = RelatedAgentInfoSchema;
226957
227144
  exports.RemovedResponseSchema = RemovedResponseSchema;
226958
227145
  exports.SPAN_KEYS = SPAN_KEYS;
@@ -226992,6 +227179,8 @@ exports.SubAgentExternalAgentRelationApiInsertSchema = SubAgentExternalAgentRela
226992
227179
  exports.SubAgentExternalAgentRelationApiSelectSchema = SubAgentExternalAgentRelationApiSelectSchema;
226993
227180
  exports.SubAgentExternalAgentRelationApiUpdateSchema = SubAgentExternalAgentRelationApiUpdateSchema;
226994
227181
  exports.SubAgentExternalAgentRelationInsertSchema = SubAgentExternalAgentRelationInsertSchema;
227182
+ exports.SubAgentExternalAgentRelationListResponse = SubAgentExternalAgentRelationListResponse;
227183
+ exports.SubAgentExternalAgentRelationResponse = SubAgentExternalAgentRelationResponse;
226995
227184
  exports.SubAgentExternalAgentRelationSelectSchema = SubAgentExternalAgentRelationSelectSchema;
226996
227185
  exports.SubAgentExternalAgentRelationUpdateSchema = SubAgentExternalAgentRelationUpdateSchema;
226997
227186
  exports.SubAgentInsertSchema = SubAgentInsertSchema;
@@ -227012,6 +227201,8 @@ exports.SubAgentTeamAgentRelationApiInsertSchema = SubAgentTeamAgentRelationApiI
227012
227201
  exports.SubAgentTeamAgentRelationApiSelectSchema = SubAgentTeamAgentRelationApiSelectSchema;
227013
227202
  exports.SubAgentTeamAgentRelationApiUpdateSchema = SubAgentTeamAgentRelationApiUpdateSchema;
227014
227203
  exports.SubAgentTeamAgentRelationInsertSchema = SubAgentTeamAgentRelationInsertSchema;
227204
+ exports.SubAgentTeamAgentRelationListResponse = SubAgentTeamAgentRelationListResponse;
227205
+ exports.SubAgentTeamAgentRelationResponse = SubAgentTeamAgentRelationResponse;
227015
227206
  exports.SubAgentTeamAgentRelationSelectSchema = SubAgentTeamAgentRelationSelectSchema;
227016
227207
  exports.SubAgentTeamAgentRelationUpdateSchema = SubAgentTeamAgentRelationUpdateSchema;
227017
227208
  exports.SubAgentToolRelationApiInsertSchema = SubAgentToolRelationApiInsertSchema;