@inkeep/agents-core 0.26.2 → 0.28.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.
@@ -1,4 +1,4 @@
1
- import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-NXC2HZQL.js';
1
+ import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-OYTJILYZ.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  // src/validation/agentFull.ts
@@ -188,7 +188,7 @@ function generateIdFromName(name) {
188
188
  return truncatedId;
189
189
  }
190
190
 
191
- // src/validation/preview-validation.ts
191
+ // src/validation/render-validation.ts
192
192
  var MAX_CODE_SIZE = 5e4;
193
193
  var MAX_DATA_SIZE = 1e4;
194
194
  var DANGEROUS_PATTERNS = [
@@ -226,75 +226,69 @@ var DANGEROUS_PATTERNS = [
226
226
  }
227
227
  ];
228
228
  var ALLOWED_IMPORTS = ["lucide-react"];
229
- function validatePreview(preview) {
229
+ function validateRender(render) {
230
230
  const errors = [];
231
- if (!preview.code || typeof preview.code !== "string") {
231
+ if (!render.component || typeof render.component !== "string") {
232
232
  return {
233
233
  isValid: false,
234
- errors: [{ field: "preview.code", message: "Code must be a non-empty string" }]
234
+ errors: [{ field: "render.component", message: "Component must be a non-empty string" }]
235
235
  };
236
236
  }
237
- if (!preview.data || typeof preview.data !== "object") {
237
+ if (!render.mockData || typeof render.mockData !== "object") {
238
238
  return {
239
239
  isValid: false,
240
- errors: [{ field: "preview.data", message: "Data must be an object" }]
240
+ errors: [{ field: "render.mockData", message: "MockData must be an object" }]
241
241
  };
242
242
  }
243
- if (preview.code.length > MAX_CODE_SIZE) {
243
+ if (render.component.length > MAX_CODE_SIZE) {
244
244
  errors.push({
245
- field: "preview.code",
246
- message: `Code size exceeds maximum allowed (${MAX_CODE_SIZE} characters)`
245
+ field: "render.component",
246
+ message: `Component size exceeds maximum allowed (${MAX_CODE_SIZE} characters)`
247
247
  });
248
248
  }
249
- const dataString = JSON.stringify(preview.data);
249
+ const dataString = JSON.stringify(render.mockData);
250
250
  if (dataString.length > MAX_DATA_SIZE) {
251
251
  errors.push({
252
- field: "preview.data",
253
- message: `Data size exceeds maximum allowed (${MAX_DATA_SIZE} characters)`
252
+ field: "render.mockData",
253
+ message: `MockData size exceeds maximum allowed (${MAX_DATA_SIZE} characters)`
254
254
  });
255
255
  }
256
256
  for (const { pattern, message } of DANGEROUS_PATTERNS) {
257
- if (pattern.test(preview.code)) {
257
+ if (pattern.test(render.component)) {
258
258
  errors.push({
259
- field: "preview.code",
260
- message: `Code contains potentially dangerous pattern: ${message}`
259
+ field: "render.component",
260
+ message: `Component contains potentially dangerous pattern: ${message}`
261
261
  });
262
262
  }
263
263
  }
264
- const importMatches = preview.code.matchAll(/import\s+.*?\s+from\s+['"]([^'"]+)['"]/g);
264
+ const importMatches = render.component.matchAll(/import\s+.*?\s+from\s+['"]([^'"]+)['"]/g);
265
265
  for (const match of importMatches) {
266
266
  const importPath = match[1];
267
- if (!ALLOWED_IMPORTS.includes(importPath)) {
267
+ if (!ALLOWED_IMPORTS.includes(importPath) && !importPath.startsWith(".")) {
268
268
  errors.push({
269
- field: "preview.code",
269
+ field: "render.component",
270
270
  message: `Import from "${importPath}" is not allowed. Only imports from ${ALLOWED_IMPORTS.join(", ")} are permitted`
271
271
  });
272
272
  }
273
273
  }
274
- const hasFunctionDeclaration = /function\s+\w+\s*\(/.test(preview.code);
274
+ const hasFunctionDeclaration = /function\s+\w+\s*\(/.test(render.component);
275
275
  if (!hasFunctionDeclaration) {
276
276
  errors.push({
277
- field: "preview.code",
278
- message: "Code must contain a function declaration"
277
+ field: "render.component",
278
+ message: "Component must contain a function declaration"
279
279
  });
280
280
  }
281
- const hasReturn = /return\s*\(?\s*</.test(preview.code);
281
+ const hasReturn = /return\s*\(?\s*</.test(render.component);
282
282
  if (!hasReturn) {
283
283
  errors.push({
284
- field: "preview.code",
284
+ field: "render.component",
285
285
  message: "Component function must have a return statement with JSX"
286
286
  });
287
287
  }
288
- if (/\bexport\s+(default\s+)?/i.test(preview.code)) {
289
- errors.push({
290
- field: "preview.code",
291
- message: "Code should not contain export statements"
292
- });
293
- }
294
288
  return {
295
289
  isValid: errors.length === 0,
296
290
  errors
297
291
  };
298
292
  }
299
293
 
300
- export { A2AMessageMetadataSchema, DataOperationDetailsSchema, DataOperationEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, TransferDataSchema, generateIdFromName, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validatePreview, validateSubAgentExternalAgentRelations, validateToolReferences };
294
+ export { A2AMessageMetadataSchema, DataOperationDetailsSchema, DataOperationEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, TransferDataSchema, generateIdFromName, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateRender, validateSubAgentExternalAgentRelations, validateToolReferences };
@@ -44,6 +44,8 @@ __export(schema_exports, {
44
44
  subAgentFunctionToolRelationsRelations: () => subAgentFunctionToolRelationsRelations,
45
45
  subAgentRelations: () => subAgentRelations,
46
46
  subAgentRelationsRelations: () => subAgentRelationsRelations,
47
+ subAgentTeamAgentRelations: () => subAgentTeamAgentRelations,
48
+ subAgentTeamAgentRelationsRelations: () => subAgentTeamAgentRelationsRelations,
47
49
  subAgentToolRelations: () => subAgentToolRelations,
48
50
  subAgents: () => subAgents,
49
51
  subAgentsRelations: () => subAgentsRelations,
@@ -266,7 +268,7 @@ var dataComponents = sqliteTable(
266
268
  ...projectScoped,
267
269
  ...uiProperties,
268
270
  props: blob("props", { mode: "json" }).$type(),
269
- preview: blob("preview", { mode: "json" }).$type(),
271
+ render: blob("render", { mode: "json" }).$type(),
270
272
  ...timestamps
271
273
  },
272
274
  (table) => [
@@ -452,6 +454,28 @@ var subAgentExternalAgentRelations = sqliteTable(
452
454
  }).onDelete("cascade")
453
455
  ]
454
456
  );
457
+ var subAgentTeamAgentRelations = sqliteTable(
458
+ "sub_agent_team_agent_relations",
459
+ {
460
+ ...subAgentScoped,
461
+ targetAgentId: text("target_agent_id").notNull(),
462
+ headers: blob("headers", { mode: "json" }).$type(),
463
+ ...timestamps
464
+ },
465
+ (table) => [
466
+ primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
467
+ foreignKey({
468
+ columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
469
+ foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
470
+ name: "sub_agent_team_agent_relations_sub_agent_fk"
471
+ }).onDelete("cascade"),
472
+ foreignKey({
473
+ columns: [table.tenantId, table.projectId, table.targetAgentId],
474
+ foreignColumns: [agents.tenantId, agents.projectId, agents.id],
475
+ name: "sub_agent_team_agent_relations_target_agent_fk"
476
+ }).onDelete("cascade")
477
+ ]
478
+ );
455
479
  var subAgentFunctionToolRelations = sqliteTable(
456
480
  "sub_agent_function_tool_relations",
457
481
  {
@@ -508,6 +532,8 @@ var messages = sqliteTable(
508
532
  toSubAgentId: text("to_sub_agent_id"),
509
533
  fromExternalAgentId: text("from_external_sub_agent_id"),
510
534
  toExternalAgentId: text("to_external_sub_agent_id"),
535
+ fromTeamAgentId: text("from_team_agent_id"),
536
+ toTeamAgentId: text("to_team_agent_id"),
511
537
  content: blob("content", { mode: "json" }).$type().notNull(),
512
538
  visibility: text("visibility").notNull().default("user-facing"),
513
539
  messageType: text("message_type").notNull().default("chat"),
@@ -784,6 +810,16 @@ var messagesRelations = relations(messages, ({ one, many }) => ({
784
810
  references: [subAgents.id],
785
811
  relationName: "receivedMessages"
786
812
  }),
813
+ fromTeamAgent: one(agents, {
814
+ fields: [messages.fromTeamAgentId],
815
+ references: [agents.id],
816
+ relationName: "receivedTeamMessages"
817
+ }),
818
+ toTeamAgent: one(agents, {
819
+ fields: [messages.toTeamAgentId],
820
+ references: [agents.id],
821
+ relationName: "sentTeamMessages"
822
+ }),
787
823
  fromExternalAgent: one(externalAgents, {
788
824
  fields: [messages.tenantId, messages.projectId, messages.fromExternalAgentId],
789
825
  references: [externalAgents.tenantId, externalAgents.projectId, externalAgents.id],
@@ -927,5 +963,27 @@ var subAgentExternalAgentRelationsRelations = relations(
927
963
  })
928
964
  })
929
965
  );
966
+ var subAgentTeamAgentRelationsRelations = relations(
967
+ subAgentTeamAgentRelations,
968
+ ({ one }) => ({
969
+ subAgent: one(subAgents, {
970
+ fields: [
971
+ subAgentTeamAgentRelations.tenantId,
972
+ subAgentTeamAgentRelations.projectId,
973
+ subAgentTeamAgentRelations.agentId,
974
+ subAgentTeamAgentRelations.subAgentId
975
+ ],
976
+ references: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id]
977
+ }),
978
+ targetAgent: one(agents, {
979
+ fields: [
980
+ subAgentTeamAgentRelations.tenantId,
981
+ subAgentTeamAgentRelations.projectId,
982
+ subAgentTeamAgentRelations.targetAgentId
983
+ ],
984
+ references: [agents.tenantId, agents.projectId, agents.id]
985
+ })
986
+ })
987
+ );
930
988
 
931
- export { agentRelations, agentToolRelationsRelations, agents, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, functionTools, functionToolsRelations, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, schema_exports, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentExternalAgentRelations, subAgentExternalAgentRelationsRelations, subAgentFunctionToolRelations, subAgentFunctionToolRelationsRelations, subAgentRelations, subAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations };
989
+ export { agentRelations, agentToolRelationsRelations, agents, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, functionTools, functionToolsRelations, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, schema_exports, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentExternalAgentRelations, subAgentExternalAgentRelationsRelations, subAgentFunctionToolRelations, subAgentFunctionToolRelationsRelations, subAgentRelations, subAgentRelationsRelations, subAgentTeamAgentRelations, subAgentTeamAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations };
@@ -1,4 +1,4 @@
1
- import { subAgents, subAgentRelations, agents, tasks, taskRelations, tools, conversations, messages, contextCache, dataComponents, subAgentDataComponents, artifactComponents, subAgentArtifactComponents, externalAgents, apiKeys, credentialReferences, functionTools, functions, contextConfigs, subAgentToolRelations, subAgentExternalAgentRelations, ledgerArtifacts, projects } from './chunk-ALZI4IXB.js';
1
+ import { subAgents, subAgentRelations, agents, tasks, taskRelations, tools, conversations, messages, contextCache, dataComponents, subAgentDataComponents, artifactComponents, subAgentArtifactComponents, externalAgents, apiKeys, credentialReferences, functionTools, functions, contextConfigs, subAgentToolRelations, subAgentExternalAgentRelations, subAgentTeamAgentRelations, ledgerArtifacts, projects } from './chunk-FDR5SA4O.js';
2
2
  import { VALID_RELATION_TYPES, MCPTransportType, TOOL_STATUS_VALUES, CredentialStoreType, MCPServerType } from './chunk-YFHT5M2R.js';
3
3
  import { z } from '@hono/zod-openapi';
4
4
  import { createSelectSchema, createInsertSchema } from 'drizzle-zod';
@@ -65,7 +65,8 @@ var SubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend(
65
65
  agentId: resourceIdSchema,
66
66
  sourceSubAgentId: resourceIdSchema,
67
67
  targetSubAgentId: resourceIdSchema.optional(),
68
- externalSubAgentId: resourceIdSchema.optional()
68
+ externalSubAgentId: resourceIdSchema.optional(),
69
+ teamSubAgentId: resourceIdSchema.optional()
69
70
  });
70
71
  var SubAgentRelationUpdateSchema = SubAgentRelationInsertSchema.partial();
71
72
  var SubAgentRelationApiSelectSchema = createAgentScopedApiSchema(
@@ -79,11 +80,13 @@ var SubAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(
79
80
  (data) => {
80
81
  const hasTarget = data.targetSubAgentId != null;
81
82
  const hasExternal = data.externalSubAgentId != null;
82
- return hasTarget !== hasExternal;
83
+ const hasTeam = data.teamSubAgentId != null;
84
+ const count = [hasTarget, hasExternal, hasTeam].filter(Boolean).length;
85
+ return count === 1;
83
86
  },
84
87
  {
85
- message: "Must specify exactly one of targetSubAgentId or externalSubAgentId",
86
- path: ["targetSubAgentId", "externalSubAgentId"]
88
+ message: "Must specify exactly one of targetSubAgentId, externalSubAgentId, or teamSubAgentId",
89
+ path: ["targetSubAgentId", "externalSubAgentId", "teamSubAgentId"]
87
90
  }
88
91
  ).openapi("SubAgentRelationCreate");
89
92
  var SubAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
@@ -94,20 +97,23 @@ var SubAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
94
97
  (data) => {
95
98
  const hasTarget = data.targetSubAgentId != null;
96
99
  const hasExternal = data.externalSubAgentId != null;
97
- if (!hasTarget && !hasExternal) {
100
+ const hasTeam = data.teamSubAgentId != null;
101
+ const count = [hasTarget, hasExternal, hasTeam].filter(Boolean).length;
102
+ if (count === 0) {
98
103
  return true;
99
104
  }
100
- return hasTarget !== hasExternal;
105
+ return count === 1;
101
106
  },
102
107
  {
103
- message: "Must specify exactly one of targetSubAgentId or externalSubAgentId when updating sub-agent relationships",
104
- path: ["targetSubAgentId", "externalSubAgentId"]
108
+ message: "Must specify exactly one of targetSubAgentId, externalSubAgentId, or teamSubAgentId when updating sub-agent relationships",
109
+ path: ["targetSubAgentId", "externalSubAgentId", "teamSubAgentId"]
105
110
  }
106
111
  ).openapi("SubAgentRelationUpdate");
107
112
  var SubAgentRelationQuerySchema = z.object({
108
113
  sourceSubAgentId: z.string().optional(),
109
114
  targetSubAgentId: z.string().optional(),
110
- externalSubAgentId: z.string().optional()
115
+ externalSubAgentId: z.string().optional(),
116
+ teamSubAgentId: z.string().optional()
111
117
  });
112
118
  var ExternalSubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend({
113
119
  id: resourceIdSchema,
@@ -521,6 +527,25 @@ var SubAgentExternalAgentRelationApiInsertSchema = createAgentScopedApiInsertSch
521
527
  var SubAgentExternalAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
522
528
  SubAgentExternalAgentRelationUpdateSchema
523
529
  ).openapi("SubAgentExternalAgentRelationUpdate");
530
+ var SubAgentTeamAgentRelationSelectSchema = createSelectSchema(subAgentTeamAgentRelations);
531
+ var SubAgentTeamAgentRelationInsertSchema = createInsertSchema(
532
+ subAgentTeamAgentRelations
533
+ ).extend({
534
+ id: resourceIdSchema,
535
+ subAgentId: resourceIdSchema,
536
+ targetAgentId: resourceIdSchema,
537
+ headers: z.record(z.string(), z.string()).nullish()
538
+ });
539
+ var SubAgentTeamAgentRelationUpdateSchema = SubAgentTeamAgentRelationInsertSchema.partial();
540
+ var SubAgentTeamAgentRelationApiSelectSchema = createAgentScopedApiSchema(
541
+ SubAgentTeamAgentRelationSelectSchema
542
+ ).openapi("SubAgentTeamAgentRelation");
543
+ var SubAgentTeamAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(
544
+ SubAgentTeamAgentRelationInsertSchema
545
+ ).omit({ id: true, subAgentId: true }).openapi("SubAgentTeamAgentRelationCreate");
546
+ var SubAgentTeamAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
547
+ SubAgentTeamAgentRelationUpdateSchema
548
+ ).openapi("SubAgentTeamAgentRelationUpdate");
524
549
  var LedgerArtifactSelectSchema = createSelectSchema(ledgerArtifacts);
525
550
  var LedgerArtifactInsertSchema = createInsertSchema(ledgerArtifacts);
526
551
  var LedgerArtifactUpdateSchema = LedgerArtifactInsertSchema.partial();
@@ -554,6 +579,16 @@ var canDelegateToExternalAgentSchema = z.object({
554
579
  subAgentExternalAgentRelationId: z.string().optional(),
555
580
  headers: z.record(z.string(), z.string()).nullish()
556
581
  });
582
+ var canDelegateToTeamAgentSchema = z.object({
583
+ agentId: z.string(),
584
+ subAgentTeamAgentRelationId: z.string().optional(),
585
+ headers: z.record(z.string(), z.string()).nullish()
586
+ });
587
+ var TeamAgentSchema = z.object({
588
+ id: z.string(),
589
+ name: z.string(),
590
+ description: z.string()
591
+ });
557
592
  var FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
558
593
  type: z.literal("internal"),
559
594
  canUse: z.array(CanUseItemSchema),
@@ -565,8 +600,10 @@ var FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
565
600
  z.union([
566
601
  z.string(),
567
602
  // Internal subAgent ID
568
- canDelegateToExternalAgentSchema
603
+ canDelegateToExternalAgentSchema,
569
604
  // External agent with headers
605
+ canDelegateToTeamAgentSchema
606
+ // Team agent with headers
570
607
  ])
571
608
  ).optional()
572
609
  });
@@ -577,6 +614,8 @@ var AgentWithinContextOfProjectSchema = AgentApiInsertSchema.extend({
577
614
  // MCP tools (project-scoped)
578
615
  externalAgents: z.record(z.string(), ExternalAgentApiInsertSchema).optional(),
579
616
  // External agents (project-scoped)
617
+ teamAgents: z.record(z.string(), TeamAgentSchema).optional(),
618
+ // Team agents contain basic metadata for the agent to be delegated to
580
619
  functionTools: z.record(z.string(), FunctionToolApiInsertSchema).optional(),
581
620
  // Function tools (agent-scoped)
582
621
  functions: z.record(z.string(), FunctionApiInsertSchema).optional(),
@@ -895,4 +934,4 @@ function validatePropsAsJsonSchema(props) {
895
934
  }
896
935
  }
897
936
 
898
- export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, canDelegateToExternalAgentSchema, resourceIdSchema, validatePropsAsJsonSchema };
937
+ export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TeamAgentSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, canDelegateToExternalAgentSchema, canDelegateToTeamAgentSchema, resourceIdSchema, validatePropsAsJsonSchema };
@@ -242,7 +242,7 @@ var dataComponents = sqliteCore.sqliteTable(
242
242
  ...projectScoped,
243
243
  ...uiProperties,
244
244
  props: sqliteCore.blob("props", { mode: "json" }).$type(),
245
- preview: sqliteCore.blob("preview", { mode: "json" }).$type(),
245
+ render: sqliteCore.blob("render", { mode: "json" }).$type(),
246
246
  ...timestamps
247
247
  },
248
248
  (table) => [
@@ -428,6 +428,28 @@ var subAgentExternalAgentRelations = sqliteCore.sqliteTable(
428
428
  }).onDelete("cascade")
429
429
  ]
430
430
  );
431
+ var subAgentTeamAgentRelations = sqliteCore.sqliteTable(
432
+ "sub_agent_team_agent_relations",
433
+ {
434
+ ...subAgentScoped,
435
+ targetAgentId: sqliteCore.text("target_agent_id").notNull(),
436
+ headers: sqliteCore.blob("headers", { mode: "json" }).$type(),
437
+ ...timestamps
438
+ },
439
+ (table) => [
440
+ sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
441
+ sqliteCore.foreignKey({
442
+ columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
443
+ foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
444
+ name: "sub_agent_team_agent_relations_sub_agent_fk"
445
+ }).onDelete("cascade"),
446
+ sqliteCore.foreignKey({
447
+ columns: [table.tenantId, table.projectId, table.targetAgentId],
448
+ foreignColumns: [agents.tenantId, agents.projectId, agents.id],
449
+ name: "sub_agent_team_agent_relations_target_agent_fk"
450
+ }).onDelete("cascade")
451
+ ]
452
+ );
431
453
  var subAgentFunctionToolRelations = sqliteCore.sqliteTable(
432
454
  "sub_agent_function_tool_relations",
433
455
  {
@@ -484,6 +506,8 @@ var messages = sqliteCore.sqliteTable(
484
506
  toSubAgentId: sqliteCore.text("to_sub_agent_id"),
485
507
  fromExternalAgentId: sqliteCore.text("from_external_sub_agent_id"),
486
508
  toExternalAgentId: sqliteCore.text("to_external_sub_agent_id"),
509
+ fromTeamAgentId: sqliteCore.text("from_team_agent_id"),
510
+ toTeamAgentId: sqliteCore.text("to_team_agent_id"),
487
511
  content: sqliteCore.blob("content", { mode: "json" }).$type().notNull(),
488
512
  visibility: sqliteCore.text("visibility").notNull().default("user-facing"),
489
513
  messageType: sqliteCore.text("message_type").notNull().default("chat"),
@@ -760,6 +784,16 @@ drizzleOrm.relations(messages, ({ one, many }) => ({
760
784
  references: [subAgents.id],
761
785
  relationName: "receivedMessages"
762
786
  }),
787
+ fromTeamAgent: one(agents, {
788
+ fields: [messages.fromTeamAgentId],
789
+ references: [agents.id],
790
+ relationName: "receivedTeamMessages"
791
+ }),
792
+ toTeamAgent: one(agents, {
793
+ fields: [messages.toTeamAgentId],
794
+ references: [agents.id],
795
+ relationName: "sentTeamMessages"
796
+ }),
763
797
  fromExternalAgent: one(externalAgents, {
764
798
  fields: [messages.tenantId, messages.projectId, messages.fromExternalAgentId],
765
799
  references: [externalAgents.tenantId, externalAgents.projectId, externalAgents.id],
@@ -903,6 +937,28 @@ drizzleOrm.relations(
903
937
  })
904
938
  })
905
939
  );
940
+ drizzleOrm.relations(
941
+ subAgentTeamAgentRelations,
942
+ ({ one }) => ({
943
+ subAgent: one(subAgents, {
944
+ fields: [
945
+ subAgentTeamAgentRelations.tenantId,
946
+ subAgentTeamAgentRelations.projectId,
947
+ subAgentTeamAgentRelations.agentId,
948
+ subAgentTeamAgentRelations.subAgentId
949
+ ],
950
+ references: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id]
951
+ }),
952
+ targetAgent: one(agents, {
953
+ fields: [
954
+ subAgentTeamAgentRelations.tenantId,
955
+ subAgentTeamAgentRelations.projectId,
956
+ subAgentTeamAgentRelations.targetAgentId
957
+ ],
958
+ references: [agents.tenantId, agents.projectId, agents.id]
959
+ })
960
+ })
961
+ );
906
962
 
907
963
  // src/validation/schemas.ts
908
964
  var StopWhenSchema = zodOpenapi.z.object({
@@ -966,7 +1022,8 @@ var SubAgentRelationInsertSchema = drizzleZod.createInsertSchema(subAgentRelatio
966
1022
  agentId: resourceIdSchema,
967
1023
  sourceSubAgentId: resourceIdSchema,
968
1024
  targetSubAgentId: resourceIdSchema.optional(),
969
- externalSubAgentId: resourceIdSchema.optional()
1025
+ externalSubAgentId: resourceIdSchema.optional(),
1026
+ teamSubAgentId: resourceIdSchema.optional()
970
1027
  });
971
1028
  var SubAgentRelationUpdateSchema = SubAgentRelationInsertSchema.partial();
972
1029
  var SubAgentRelationApiSelectSchema = createAgentScopedApiSchema(
@@ -980,11 +1037,13 @@ createAgentScopedApiInsertSchema(
980
1037
  (data) => {
981
1038
  const hasTarget = data.targetSubAgentId != null;
982
1039
  const hasExternal = data.externalSubAgentId != null;
983
- return hasTarget !== hasExternal;
1040
+ const hasTeam = data.teamSubAgentId != null;
1041
+ const count = [hasTarget, hasExternal, hasTeam].filter(Boolean).length;
1042
+ return count === 1;
984
1043
  },
985
1044
  {
986
- message: "Must specify exactly one of targetSubAgentId or externalSubAgentId",
987
- path: ["targetSubAgentId", "externalSubAgentId"]
1045
+ message: "Must specify exactly one of targetSubAgentId, externalSubAgentId, or teamSubAgentId",
1046
+ path: ["targetSubAgentId", "externalSubAgentId", "teamSubAgentId"]
988
1047
  }
989
1048
  ).openapi("SubAgentRelationCreate");
990
1049
  createAgentScopedApiUpdateSchema(
@@ -995,20 +1054,23 @@ createAgentScopedApiUpdateSchema(
995
1054
  (data) => {
996
1055
  const hasTarget = data.targetSubAgentId != null;
997
1056
  const hasExternal = data.externalSubAgentId != null;
998
- if (!hasTarget && !hasExternal) {
1057
+ const hasTeam = data.teamSubAgentId != null;
1058
+ const count = [hasTarget, hasExternal, hasTeam].filter(Boolean).length;
1059
+ if (count === 0) {
999
1060
  return true;
1000
1061
  }
1001
- return hasTarget !== hasExternal;
1062
+ return count === 1;
1002
1063
  },
1003
1064
  {
1004
- message: "Must specify exactly one of targetSubAgentId or externalSubAgentId when updating sub-agent relationships",
1005
- path: ["targetSubAgentId", "externalSubAgentId"]
1065
+ message: "Must specify exactly one of targetSubAgentId, externalSubAgentId, or teamSubAgentId when updating sub-agent relationships",
1066
+ path: ["targetSubAgentId", "externalSubAgentId", "teamSubAgentId"]
1006
1067
  }
1007
1068
  ).openapi("SubAgentRelationUpdate");
1008
1069
  zodOpenapi.z.object({
1009
1070
  sourceSubAgentId: zodOpenapi.z.string().optional(),
1010
1071
  targetSubAgentId: zodOpenapi.z.string().optional(),
1011
- externalSubAgentId: zodOpenapi.z.string().optional()
1072
+ externalSubAgentId: zodOpenapi.z.string().optional(),
1073
+ teamSubAgentId: zodOpenapi.z.string().optional()
1012
1074
  });
1013
1075
  var ExternalSubAgentRelationInsertSchema = drizzleZod.createInsertSchema(subAgentRelations).extend({
1014
1076
  id: resourceIdSchema,
@@ -1422,6 +1484,25 @@ createAgentScopedApiInsertSchema(
1422
1484
  createAgentScopedApiUpdateSchema(
1423
1485
  SubAgentExternalAgentRelationUpdateSchema
1424
1486
  ).openapi("SubAgentExternalAgentRelationUpdate");
1487
+ var SubAgentTeamAgentRelationSelectSchema = drizzleZod.createSelectSchema(subAgentTeamAgentRelations);
1488
+ var SubAgentTeamAgentRelationInsertSchema = drizzleZod.createInsertSchema(
1489
+ subAgentTeamAgentRelations
1490
+ ).extend({
1491
+ id: resourceIdSchema,
1492
+ subAgentId: resourceIdSchema,
1493
+ targetAgentId: resourceIdSchema,
1494
+ headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).nullish()
1495
+ });
1496
+ var SubAgentTeamAgentRelationUpdateSchema = SubAgentTeamAgentRelationInsertSchema.partial();
1497
+ createAgentScopedApiSchema(
1498
+ SubAgentTeamAgentRelationSelectSchema
1499
+ ).openapi("SubAgentTeamAgentRelation");
1500
+ createAgentScopedApiInsertSchema(
1501
+ SubAgentTeamAgentRelationInsertSchema
1502
+ ).omit({ id: true, subAgentId: true }).openapi("SubAgentTeamAgentRelationCreate");
1503
+ createAgentScopedApiUpdateSchema(
1504
+ SubAgentTeamAgentRelationUpdateSchema
1505
+ ).openapi("SubAgentTeamAgentRelationUpdate");
1425
1506
  var LedgerArtifactSelectSchema = drizzleZod.createSelectSchema(ledgerArtifacts);
1426
1507
  var LedgerArtifactInsertSchema = drizzleZod.createInsertSchema(ledgerArtifacts);
1427
1508
  var LedgerArtifactUpdateSchema = LedgerArtifactInsertSchema.partial();
@@ -1455,6 +1536,16 @@ var canDelegateToExternalAgentSchema = zodOpenapi.z.object({
1455
1536
  subAgentExternalAgentRelationId: zodOpenapi.z.string().optional(),
1456
1537
  headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).nullish()
1457
1538
  });
1539
+ var canDelegateToTeamAgentSchema = zodOpenapi.z.object({
1540
+ agentId: zodOpenapi.z.string(),
1541
+ subAgentTeamAgentRelationId: zodOpenapi.z.string().optional(),
1542
+ headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).nullish()
1543
+ });
1544
+ var TeamAgentSchema = zodOpenapi.z.object({
1545
+ id: zodOpenapi.z.string(),
1546
+ name: zodOpenapi.z.string(),
1547
+ description: zodOpenapi.z.string()
1548
+ });
1458
1549
  var FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
1459
1550
  type: zodOpenapi.z.literal("internal"),
1460
1551
  canUse: zodOpenapi.z.array(CanUseItemSchema),
@@ -1466,8 +1557,10 @@ var FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
1466
1557
  zodOpenapi.z.union([
1467
1558
  zodOpenapi.z.string(),
1468
1559
  // Internal subAgent ID
1469
- canDelegateToExternalAgentSchema
1560
+ canDelegateToExternalAgentSchema,
1470
1561
  // External agent with headers
1562
+ canDelegateToTeamAgentSchema
1563
+ // Team agent with headers
1471
1564
  ])
1472
1565
  ).optional()
1473
1566
  });
@@ -1478,6 +1571,8 @@ var AgentWithinContextOfProjectSchema = AgentApiInsertSchema.extend({
1478
1571
  // MCP tools (project-scoped)
1479
1572
  externalAgents: zodOpenapi.z.record(zodOpenapi.z.string(), ExternalAgentApiInsertSchema).optional(),
1480
1573
  // External agents (project-scoped)
1574
+ teamAgents: zodOpenapi.z.record(zodOpenapi.z.string(), TeamAgentSchema).optional(),
1575
+ // Team agents contain basic metadata for the agent to be delegated to
1481
1576
  functionTools: zodOpenapi.z.record(zodOpenapi.z.string(), FunctionToolApiInsertSchema).optional(),
1482
1577
  // Function tools (agent-scoped)
1483
1578
  functions: zodOpenapi.z.record(zodOpenapi.z.string(), FunctionApiInsertSchema).optional(),
@@ -2216,7 +2311,11 @@ var DataComponentApiInsertSchema2 = zod.z.object({
2216
2311
  id: zod.z.string(),
2217
2312
  name: zod.z.string(),
2218
2313
  description: zod.z.string().optional(),
2219
- props: zod.z.record(zod.z.string(), zod.z.unknown())
2314
+ props: zod.z.record(zod.z.string(), zod.z.unknown()),
2315
+ render: zod.z.object({
2316
+ component: zod.z.string(),
2317
+ mockData: zod.z.record(zod.z.string(), zod.z.unknown())
2318
+ }).nullable().optional()
2220
2319
  });
2221
2320
  var ArtifactComponentApiInsertSchema2 = ArtifactComponentApiInsertSchema;
2222
2321
  var ContextConfigApiInsertSchema2 = zod.z.object({
@@ -1,7 +1,7 @@
1
1
  export { i as ACTIVITY_NAMES, g as ACTIVITY_STATUS, f as ACTIVITY_TYPES, h as AGENT_IDS, p as AGGREGATE_OPERATORS, A as AI_OPERATIONS, j as AI_TOOL_TYPES, o as DATA_SOURCES, k as DATA_TYPES, D as DELEGATION_FROM_SUB_AGENT_ID, b as DELEGATION_ID, a as DELEGATION_TO_SUB_AGENT_ID, F as FIELD_TYPES, O as OPERATORS, m as ORDER_DIRECTIONS, P as PANEL_TYPES, q as QUERY_DEFAULTS, l as QUERY_EXPRESSIONS, Q as QUERY_FIELD_CONFIGS, n as QUERY_TYPES, R as REDUCE_OPERATIONS, e as SPAN_KEYS, S as SPAN_NAMES, T as TRANSFER_FROM_SUB_AGENT_ID, c as TRANSFER_TO_SUB_AGENT_ID, U as UNKNOWN_VALUE, d as detectAuthenticationRequired } from './auth-detection-DN8jWUDE.cjs';
2
2
  import { z } from 'zod';
3
- import { C as ConversationHistoryConfig, F as FunctionApiInsertSchema, A as ApiKeyApiUpdateSchema, a as FullAgentAgentInsertSchema } from './utility-CWjvUL4k.cjs';
4
- export { e as AgentStopWhen, b as AgentStopWhenSchema, h as CredentialStoreType, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, i as MCPTransportType, g as ModelSettings, M as ModelSettingsSchema, d as StopWhen, S as StopWhenSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema } from './utility-CWjvUL4k.cjs';
3
+ import { C as ConversationHistoryConfig, F as FunctionApiInsertSchema, A as ApiKeyApiUpdateSchema, a as FullAgentAgentInsertSchema } from './utility-aTj9Dhgx.cjs';
4
+ export { e as AgentStopWhen, b as AgentStopWhenSchema, h as CredentialStoreType, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, i as MCPTransportType, g as ModelSettings, M as ModelSettingsSchema, d as StopWhen, S as StopWhenSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema } from './utility-aTj9Dhgx.cjs';
5
5
  export { v as validatePropsAsJsonSchema } from './props-validation-BMR1qNiy.cjs';
6
6
  import 'pino';
7
7
  import 'drizzle-zod';
@@ -127,6 +127,10 @@ declare const DataComponentApiInsertSchema: z.ZodObject<{
127
127
  name: z.ZodString;
128
128
  description: z.ZodOptional<z.ZodString>;
129
129
  props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
130
+ render: z.ZodOptional<z.ZodNullable<z.ZodObject<{
131
+ component: z.ZodString;
132
+ mockData: z.ZodRecord<z.ZodString, z.ZodUnknown>;
133
+ }, z.core.$strip>>>;
130
134
  }, z.core.$strip>;
131
135
  declare const ArtifactComponentApiInsertSchema: z.ZodObject<{
132
136
  id: z.ZodString;
@@ -209,6 +213,10 @@ declare const FullAgentDefinitionSchema: z.ZodObject<{
209
213
  externalAgentId: z.ZodString;
210
214
  subAgentExternalAgentRelationId: z.ZodOptional<z.ZodString>;
211
215
  headers: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
216
+ }, z.core.$strip>, z.ZodObject<{
217
+ agentId: z.ZodString;
218
+ subAgentTeamAgentRelationId: z.ZodOptional<z.ZodString>;
219
+ headers: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
212
220
  }, z.core.$strip>]>>>;
213
221
  }, z.core.$strip>]>>;
214
222
  contextConfig: z.ZodOptional<z.ZodObject<{