@inkeep/agents-core 0.18.1 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +4 -4
  2. package/dist/{chunk-JTHQYGCX.js → chunk-4FMDWUE4.js} +34 -34
  3. package/dist/{chunk-ID4CFGVF.js → chunk-B6F3RF4T.js} +87 -120
  4. package/dist/chunk-E6R6PML7.js +19 -0
  5. package/dist/chunk-HYS7HUYJ.js +27 -0
  6. package/dist/{chunk-H6PMWHNV.js → chunk-SLL6V3AE.js} +12 -12
  7. package/dist/{chunk-E4SFK6AI.js → chunk-VICWT3WO.js} +281 -142
  8. package/dist/{chunk-R2EERZSW.js → chunk-YECQCT5N.js} +1 -1
  9. package/dist/client-exports.cjs +390 -283
  10. package/dist/client-exports.d.cts +13 -14
  11. package/dist/client-exports.d.ts +13 -14
  12. package/dist/client-exports.js +10 -10
  13. package/dist/constants/models.cjs +31 -0
  14. package/dist/constants/models.d.cts +33 -0
  15. package/dist/constants/models.d.ts +33 -0
  16. package/dist/constants/models.js +1 -0
  17. package/dist/db/schema.cjs +85 -118
  18. package/dist/db/schema.d.cts +2 -3
  19. package/dist/db/schema.d.ts +2 -3
  20. package/dist/db/schema.js +1 -1
  21. package/dist/index.cjs +214164 -1095
  22. package/dist/index.d.cts +215 -214
  23. package/dist/index.d.ts +215 -214
  24. package/dist/index.js +213657 -767
  25. package/dist/{schema-ULFEZCOL.d.cts → schema-CcSN2XcZ.d.cts} +54 -52
  26. package/dist/{schema-wbZXiVWb.d.ts → schema-D8h85qdU.d.ts} +54 -52
  27. package/dist/{signoz-queries-BuiipZTk.d.cts → signoz-queries-CuWMQh1H.d.cts} +10 -10
  28. package/dist/{signoz-queries-BuiipZTk.d.ts → signoz-queries-CuWMQh1H.d.ts} +10 -10
  29. package/dist/types/index.d.cts +2 -3
  30. package/dist/types/index.d.ts +2 -3
  31. package/dist/{utility-CyPQ1tC_.d.cts → utility-HqRMF7sM.d.cts} +1775 -320
  32. package/dist/{utility-CyPQ1tC_.d.ts → utility-HqRMF7sM.d.ts} +1775 -320
  33. package/dist/utils/schema-conversion.js +1 -1
  34. package/dist/validation/index.cjs +445 -304
  35. package/dist/validation/index.d.cts +12 -13
  36. package/dist/validation/index.d.ts +12 -13
  37. package/dist/validation/index.js +2 -2
  38. package/drizzle/0007_mighty_typhoid_mary.sql +227 -0
  39. package/drizzle/meta/0007_snapshot.json +2766 -0
  40. package/drizzle/meta/_journal.json +7 -0
  41. package/package.json +6 -1
  42. package/dist/chunk-MKBO26DX.js +0 -9
@@ -57,12 +57,12 @@ var projectScoped = {
57
57
  ...tenantScoped,
58
58
  projectId: sqliteCore.text("project_id").notNull()
59
59
  };
60
- var graphScoped = {
60
+ var agentScoped = {
61
61
  ...projectScoped,
62
- graphId: sqliteCore.text("graph_id").notNull()
62
+ agentId: sqliteCore.text("agent_id").notNull()
63
63
  };
64
64
  var subAgentScoped = {
65
- ...graphScoped,
65
+ ...agentScoped,
66
66
  subAgentId: sqliteCore.text("sub_agent_id").notNull()
67
67
  };
68
68
  var uiProperties = {
@@ -78,9 +78,9 @@ var projects = sqliteCore.sqliteTable(
78
78
  {
79
79
  ...tenantScoped,
80
80
  ...uiProperties,
81
- // Project-level default model settings that can be inherited by graphs and agents
81
+ // Project-level default model settings that can be inherited by agents
82
82
  models: sqliteCore.text("models", { mode: "json" }).$type(),
83
- // Project-level stopWhen configuration that can be inherited by graphs and agents
83
+ // Project-level stopWhen configuration that can be inherited by agents
84
84
  stopWhen: sqliteCore.text("stop_when", { mode: "json" }).$type(),
85
85
  // Project-level sandbox configuration for function execution
86
86
  sandboxConfig: sqliteCore.text("sandbox_config", { mode: "json" }).$type(),
@@ -88,23 +88,17 @@ var projects = sqliteCore.sqliteTable(
88
88
  },
89
89
  (table) => [sqliteCore.primaryKey({ columns: [table.tenantId, table.id] })]
90
90
  );
91
- var agentGraph = sqliteCore.sqliteTable(
92
- "agent_graph",
91
+ var agents = sqliteCore.sqliteTable(
92
+ "agent",
93
93
  {
94
94
  ...projectScoped,
95
95
  name: sqliteCore.text("name").notNull(),
96
96
  description: sqliteCore.text("description"),
97
97
  defaultSubAgentId: sqliteCore.text("default_sub_agent_id"),
98
- // Reference to shared context configuration for all agents in this graph
99
98
  contextConfigId: sqliteCore.text("context_config_id"),
100
- // add fk relationship
101
- // Graph-level model settingsuration that can be inherited by agents
102
99
  models: sqliteCore.text("models", { mode: "json" }).$type(),
103
- // Status updates configuration for intelligent progress summaries
104
100
  statusUpdates: sqliteCore.text("status_updates", { mode: "json" }).$type(),
105
- // Graph-level prompt that can be used as additional context for agents
106
- graphPrompt: sqliteCore.text("graph_prompt"),
107
- // Graph-level stopWhen configuration that can be inherited by agents
101
+ prompt: sqliteCore.text("prompt"),
108
102
  stopWhen: sqliteCore.text("stop_when", { mode: "json" }).$type(),
109
103
  ...timestamps
110
104
  },
@@ -113,27 +107,26 @@ var agentGraph = sqliteCore.sqliteTable(
113
107
  sqliteCore.foreignKey({
114
108
  columns: [table.tenantId, table.projectId],
115
109
  foreignColumns: [projects.tenantId, projects.id],
116
- name: "agent_graph_project_fk"
110
+ name: "agent_project_fk"
117
111
  }).onDelete("cascade")
118
112
  ]
119
113
  );
120
114
  var contextConfigs = sqliteCore.sqliteTable(
121
115
  "context_configs",
122
116
  {
123
- ...graphScoped,
117
+ ...agentScoped,
124
118
  // Developer-defined Zod schema for validating incoming request context
125
119
  headersSchema: sqliteCore.blob("headers_schema", { mode: "json" }).$type(),
126
- // Stores serialized Zod schema
127
120
  // Object mapping template keys to fetch definitions that use request context data
128
121
  contextVariables: sqliteCore.blob("context_variables", { mode: "json" }).$type(),
129
122
  ...timestamps
130
123
  },
131
124
  (table) => [
132
- sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
125
+ sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
133
126
  sqliteCore.foreignKey({
134
- columns: [table.tenantId, table.projectId, table.graphId],
135
- foreignColumns: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id],
136
- name: "context_configs_graph_fk"
127
+ columns: [table.tenantId, table.projectId, table.agentId],
128
+ foreignColumns: [agents.tenantId, agents.projectId, agents.id],
129
+ name: "context_configs_agent_fk"
137
130
  }).onDelete("cascade")
138
131
  ]
139
132
  );
@@ -146,16 +139,12 @@ var contextCache = sqliteCore.sqliteTable(
146
139
  // Reference to the context config and specific fetch definition
147
140
  contextConfigId: sqliteCore.text("context_config_id").notNull(),
148
141
  contextVariableKey: sqliteCore.text("context_variable_key").notNull(),
149
- // Key from contextVariables object
150
- // The actual cached context data
151
142
  value: sqliteCore.blob("value", { mode: "json" }).$type().notNull(),
152
143
  // Request hash for cache invalidation based on context changes
153
144
  requestHash: sqliteCore.text("request_hash"),
154
- // Hash of request context that triggered this cache
155
145
  // Metadata for monitoring and debugging
156
146
  fetchedAt: sqliteCore.text("fetched_at").notNull(),
157
147
  fetchSource: sqliteCore.text("fetch_source"),
158
- // URL or source identifier
159
148
  fetchDurationMs: sqliteCore.integer("fetch_duration_ms"),
160
149
  ...timestamps
161
150
  },
@@ -176,30 +165,29 @@ var contextCache = sqliteCore.sqliteTable(
176
165
  var subAgents = sqliteCore.sqliteTable(
177
166
  "sub_agents",
178
167
  {
179
- ...graphScoped,
168
+ ...agentScoped,
180
169
  ...uiProperties,
181
170
  prompt: sqliteCore.text("prompt").notNull(),
182
171
  conversationHistoryConfig: sqliteCore.text("conversation_history_config", {
183
172
  mode: "json"
184
173
  }).$type(),
185
174
  models: sqliteCore.text("models", { mode: "json" }).$type(),
186
- // Agent-level stopWhen configuration (inherited from project)
187
175
  stopWhen: sqliteCore.text("stop_when", { mode: "json" }).$type(),
188
176
  ...timestamps
189
177
  },
190
178
  (table) => [
191
- sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
179
+ sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
192
180
  sqliteCore.foreignKey({
193
- columns: [table.tenantId, table.projectId, table.graphId],
194
- foreignColumns: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id],
195
- name: "agents_graph_fk"
181
+ columns: [table.tenantId, table.projectId, table.agentId],
182
+ foreignColumns: [agents.tenantId, agents.projectId, agents.id],
183
+ name: "sub_agents_agents_fk"
196
184
  }).onDelete("cascade")
197
185
  ]
198
186
  );
199
187
  var subAgentRelations = sqliteCore.sqliteTable(
200
188
  "sub_agent_relations",
201
189
  {
202
- ...graphScoped,
190
+ ...agentScoped,
203
191
  sourceSubAgentId: sqliteCore.text("source_sub_agent_id").notNull(),
204
192
  // For internal relationships
205
193
  targetSubAgentId: sqliteCore.text("target_sub_agent_id"),
@@ -209,31 +197,30 @@ var subAgentRelations = sqliteCore.sqliteTable(
209
197
  ...timestamps
210
198
  },
211
199
  (table) => [
212
- sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
200
+ sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
213
201
  sqliteCore.foreignKey({
214
- columns: [table.tenantId, table.projectId, table.graphId],
215
- foreignColumns: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id],
216
- name: "sub_agent_relations_graph_fk"
202
+ columns: [table.tenantId, table.projectId, table.agentId],
203
+ foreignColumns: [agents.tenantId, agents.projectId, agents.id],
204
+ name: "sub_agent_relations_agent_fk"
217
205
  }).onDelete("cascade")
218
206
  ]
219
207
  );
220
208
  var externalAgents = sqliteCore.sqliteTable(
221
209
  "external_agents",
222
210
  {
223
- ...graphScoped,
211
+ ...agentScoped,
224
212
  ...uiProperties,
225
213
  baseUrl: sqliteCore.text("base_url").notNull(),
226
- // A2A endpoint URL
227
214
  credentialReferenceId: sqliteCore.text("credential_reference_id"),
228
215
  headers: sqliteCore.blob("headers", { mode: "json" }).$type(),
229
216
  ...timestamps
230
217
  },
231
218
  (table) => [
232
- sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
219
+ sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
233
220
  sqliteCore.foreignKey({
234
- columns: [table.tenantId, table.projectId, table.graphId],
235
- foreignColumns: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id],
236
- name: "external_agents_graph_fk"
221
+ columns: [table.tenantId, table.projectId, table.agentId],
222
+ foreignColumns: [agents.tenantId, agents.projectId, agents.id],
223
+ name: "external_agents_agent_fk"
237
224
  }).onDelete("cascade"),
238
225
  sqliteCore.foreignKey({
239
226
  columns: [table.tenantId, table.projectId, table.credentialReferenceId],
@@ -258,8 +245,8 @@ var tasks = sqliteCore.sqliteTable(
258
245
  (table) => [
259
246
  sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
260
247
  sqliteCore.foreignKey({
261
- columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
262
- foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
248
+ columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
249
+ foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
263
250
  name: "tasks_sub_agent_fk"
264
251
  }).onDelete("cascade")
265
252
  ]
@@ -271,7 +258,6 @@ var taskRelations = sqliteCore.sqliteTable(
271
258
  parentTaskId: sqliteCore.text("parent_task_id").notNull(),
272
259
  childTaskId: sqliteCore.text("child_task_id").notNull(),
273
260
  relationType: sqliteCore.text("relation_type").default("parent_child"),
274
- // Could be extended for other relation types
275
261
  ...timestamps
276
262
  },
277
263
  (table) => [
@@ -309,13 +295,11 @@ var subAgentDataComponents = sqliteCore.sqliteTable(
309
295
  },
310
296
  (table) => [
311
297
  sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.id] }),
312
- // Foreign key constraint to agents table (ensures graph and project exist via cascade)
313
298
  sqliteCore.foreignKey({
314
- columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
315
- foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
299
+ columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
300
+ foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
316
301
  name: "sub_agent_data_components_sub_agent_fk"
317
302
  }).onDelete("cascade"),
318
- // Foreign key constraint to data_components table
319
303
  sqliteCore.foreignKey({
320
304
  columns: [table.tenantId, table.projectId, table.dataComponentId],
321
305
  foreignColumns: [dataComponents.tenantId, dataComponents.projectId, dataComponents.id],
@@ -349,15 +333,13 @@ var subAgentArtifactComponents = sqliteCore.sqliteTable(
349
333
  },
350
334
  (table) => [
351
335
  sqliteCore.primaryKey({
352
- columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId, table.id]
336
+ columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId, table.id]
353
337
  }),
354
- // Foreign key constraint to agents table (ensures graph and project exist via cascade)
355
338
  sqliteCore.foreignKey({
356
- columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
357
- foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
339
+ columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
340
+ foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
358
341
  name: "sub_agent_artifact_components_sub_agent_fk"
359
342
  }).onDelete("cascade"),
360
- // Foreign key constraint to artifact_components table
361
343
  sqliteCore.foreignKey({
362
344
  columns: [table.tenantId, table.projectId, table.artifactComponentId],
363
345
  foreignColumns: [
@@ -397,18 +379,18 @@ var tools = sqliteCore.sqliteTable(
397
379
  var functionTools = sqliteCore.sqliteTable(
398
380
  "function_tools",
399
381
  {
400
- ...graphScoped,
382
+ ...agentScoped,
401
383
  name: sqliteCore.text("name").notNull(),
402
384
  description: sqliteCore.text("description"),
403
385
  functionId: sqliteCore.text("function_id").notNull(),
404
386
  ...timestamps
405
387
  },
406
388
  (table) => [
407
- sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
389
+ sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
408
390
  sqliteCore.foreignKey({
409
- columns: [table.tenantId, table.projectId, table.graphId],
410
- foreignColumns: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id],
411
- name: "function_tools_graph_fk"
391
+ columns: [table.tenantId, table.projectId, table.agentId],
392
+ foreignColumns: [agents.tenantId, agents.projectId, agents.id],
393
+ name: "function_tools_agent_fk"
412
394
  }).onDelete("cascade"),
413
395
  // Foreign key constraint to functions table
414
396
  sqliteCore.foreignKey({
@@ -446,14 +428,12 @@ var subAgentToolRelations = sqliteCore.sqliteTable(
446
428
  ...timestamps
447
429
  },
448
430
  (table) => [
449
- sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
450
- // Foreign key constraint to agents table (which includes project and graph scope)
431
+ sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
451
432
  sqliteCore.foreignKey({
452
- columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
453
- foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
433
+ columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
434
+ foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
454
435
  name: "sub_agent_tool_relations_agent_fk"
455
436
  }).onDelete("cascade"),
456
- // Foreign key constraint to tools table (MCP tools)
457
437
  sqliteCore.foreignKey({
458
438
  columns: [table.tenantId, table.projectId, table.toolId],
459
439
  foreignColumns: [tools.tenantId, tools.projectId, tools.id],
@@ -469,20 +449,20 @@ var agentFunctionToolRelations = sqliteCore.sqliteTable(
469
449
  ...timestamps
470
450
  },
471
451
  (table) => [
472
- sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
452
+ sqliteCore.primaryKey({ columns: [table.tenantId, table.projectId, table.agentId, table.id] }),
473
453
  // Foreign key constraint to agents table
474
454
  sqliteCore.foreignKey({
475
- columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
476
- foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
455
+ columns: [table.tenantId, table.projectId, table.agentId, table.subAgentId],
456
+ foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.agentId, subAgents.id],
477
457
  name: "agent_function_tool_relations_agent_fk"
478
458
  }).onDelete("cascade"),
479
459
  // Foreign key constraint to functionTools table
480
460
  sqliteCore.foreignKey({
481
- columns: [table.tenantId, table.projectId, table.graphId, table.functionToolId],
461
+ columns: [table.tenantId, table.projectId, table.agentId, table.functionToolId],
482
462
  foreignColumns: [
483
463
  functionTools.tenantId,
484
464
  functionTools.projectId,
485
- functionTools.graphId,
465
+ functionTools.agentId,
486
466
  functionTools.id
487
467
  ],
488
468
  name: "agent_function_tool_relations_function_tool_fk"
@@ -516,33 +496,23 @@ var messages = sqliteCore.sqliteTable(
516
496
  conversationId: sqliteCore.text("conversation_id").notNull(),
517
497
  // Role mapping: user, agent, system (unified for both formats)
518
498
  role: sqliteCore.text("role").notNull(),
519
- // 'user' | 'agent' | 'system'
520
499
  // Agent sender/recipient tracking (nullable - only populated when relevant)
521
500
  fromSubAgentId: sqliteCore.text("from_sub_agent_id"),
522
- // Populated when message is from an agent
523
501
  toSubAgentId: sqliteCore.text("to_sub_agent_id"),
524
- // Populated when message is directed to a specific agent (e.g., transfers/delegations)
525
502
  // External agent sender tracking
526
503
  fromExternalAgentId: sqliteCore.text("from_external_sub_agent_id"),
527
- // Populated when message is directed from an external agent
528
504
  // External agent recipient tracking
529
505
  toExternalAgentId: sqliteCore.text("to_external_sub_agent_id"),
530
- // Populated when message is directed to an external agent
531
506
  // Message content stored as JSON to support both formats
532
507
  content: sqliteCore.blob("content", { mode: "json" }).$type().notNull(),
533
508
  // Message classification and filtering
534
509
  visibility: sqliteCore.text("visibility").notNull().default("user-facing"),
535
- // 'user-facing' | 'internal' | 'system' | 'external'
536
510
  messageType: sqliteCore.text("message_type").notNull().default("chat"),
537
- // 'chat' | 'a2a-request' | 'a2a-response' | 'task-update' | 'tool-call'
538
511
  taskId: sqliteCore.text("task_id"),
539
512
  parentMessageId: sqliteCore.text("parent_message_id"),
540
- // Remove self-reference constraint here
541
513
  // A2A specific fields
542
514
  a2aTaskId: sqliteCore.text("a2a_task_id"),
543
- // Links to A2A task when relevant
544
515
  a2aSessionId: sqliteCore.text("a2a_session_id"),
545
- // A2A session identifier
546
516
  // Metadata for extensions
547
517
  metadata: sqliteCore.blob("metadata", { mode: "json" }).$type(),
548
518
  ...timestamps
@@ -563,7 +533,6 @@ var ledgerArtifacts = sqliteCore.sqliteTable(
563
533
  // Links
564
534
  taskId: sqliteCore.text("task_id").notNull(),
565
535
  toolCallId: sqliteCore.text("tool_call_id"),
566
- // Added for traceability to the specific tool execution
567
536
  contextId: sqliteCore.text("context_id").notNull(),
568
537
  // Core Artifact fields
569
538
  type: sqliteCore.text("type").notNull().default("source"),
@@ -599,13 +568,10 @@ var ledgerArtifacts = sqliteCore.sqliteTable(
599
568
  var apiKeys = sqliteCore.sqliteTable(
600
569
  "api_keys",
601
570
  {
602
- ...graphScoped,
571
+ ...agentScoped,
603
572
  publicId: sqliteCore.text("public_id").notNull().unique(),
604
- // Public ID for O(1) lookup (e.g., "abc123def456")
605
573
  keyHash: sqliteCore.text("key_hash").notNull(),
606
- // Hashed API key (never store plaintext)
607
574
  keyPrefix: sqliteCore.text("key_prefix").notNull(),
608
- // First 8 chars for identification (e.g., "sk_live_abc...")
609
575
  name: sqliteCore.text("name"),
610
576
  lastUsedAt: sqliteCore.text("last_used_at"),
611
577
  expiresAt: sqliteCore.text("expires_at"),
@@ -618,11 +584,11 @@ var apiKeys = sqliteCore.sqliteTable(
618
584
  name: "api_keys_project_fk"
619
585
  }).onDelete("cascade"),
620
586
  sqliteCore.foreignKey({
621
- columns: [t.tenantId, t.projectId, t.graphId],
622
- foreignColumns: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id],
623
- name: "api_keys_graph_fk"
587
+ columns: [t.tenantId, t.projectId, t.agentId],
588
+ foreignColumns: [agents.tenantId, agents.projectId, agents.id],
589
+ name: "api_keys_agent_fk"
624
590
  }).onDelete("cascade"),
625
- sqliteCore.index("api_keys_tenant_graph_idx").on(t.tenantId, t.graphId),
591
+ sqliteCore.index("api_keys_tenant_agent_idx").on(t.tenantId, t.agentId),
626
592
  sqliteCore.index("api_keys_prefix_idx").on(t.keyPrefix),
627
593
  sqliteCore.index("api_keys_public_id_idx").on(t.publicId)
628
594
  ]
@@ -632,9 +598,7 @@ var credentialReferences = sqliteCore.sqliteTable(
632
598
  {
633
599
  ...projectScoped,
634
600
  type: sqliteCore.text("type").notNull(),
635
- // Implementation type: 'keychain', 'nango', 'memory', etc.
636
601
  credentialStoreId: sqliteCore.text("credential_store_id").notNull(),
637
- // Maps to framework.getCredentialStore(id)
638
602
  retrievalParams: sqliteCore.blob("retrieval_params", { mode: "json" }).$type(),
639
603
  ...timestamps
640
604
  },
@@ -648,7 +612,6 @@ var credentialReferences = sqliteCore.sqliteTable(
648
612
  ]
649
613
  );
650
614
  drizzleOrm.relations(tasks, ({ one, many }) => ({
651
- // A task belongs to one project
652
615
  project: one(projects, {
653
616
  fields: [tasks.tenantId, tasks.projectId],
654
617
  references: [projects.tenantId, projects.id]
@@ -665,14 +628,12 @@ drizzleOrm.relations(tasks, ({ one, many }) => ({
665
628
  fields: [tasks.subAgentId],
666
629
  references: [subAgents.id]
667
630
  }),
668
- // A task can have many messages associated with it
669
631
  messages: many(messages),
670
- // A task can have many ledger artifacts
671
632
  ledgerArtifacts: many(ledgerArtifacts)
672
633
  }));
673
634
  drizzleOrm.relations(projects, ({ many }) => ({
674
635
  subAgents: many(subAgents),
675
- agentGraphs: many(agentGraph),
636
+ agents: many(agents),
676
637
  tools: many(tools),
677
638
  functions: many(functions),
678
639
  contextConfigs: many(contextConfigs),
@@ -701,7 +662,7 @@ drizzleOrm.relations(contextConfigs, ({ many, one }) => ({
701
662
  fields: [contextConfigs.tenantId, contextConfigs.projectId],
702
663
  references: [projects.tenantId, projects.id]
703
664
  }),
704
- graphs: many(agentGraph),
665
+ agents: many(agents),
705
666
  cache: many(contextCache)
706
667
  }));
707
668
  drizzleOrm.relations(contextCache, ({ one }) => ({
@@ -716,7 +677,7 @@ drizzleOrm.relations(subAgents, ({ many, one }) => ({
716
677
  references: [projects.tenantId, projects.id]
717
678
  }),
718
679
  tasks: many(tasks),
719
- defaultForGraphs: many(agentGraph),
680
+ defaultForAgents: many(agents),
720
681
  sourceRelations: many(subAgentRelations, {
721
682
  relationName: "sourceRelations"
722
683
  }),
@@ -729,25 +690,22 @@ drizzleOrm.relations(subAgents, ({ many, one }) => ({
729
690
  receivedMessages: many(messages, {
730
691
  relationName: "receivedMessages"
731
692
  }),
732
- associatedMessages: many(messages, {
733
- relationName: "associatedAgent"
734
- }),
735
693
  toolRelations: many(subAgentToolRelations),
736
694
  functionToolRelations: many(agentFunctionToolRelations),
737
695
  dataComponentRelations: many(subAgentDataComponents),
738
696
  artifactComponentRelations: many(subAgentArtifactComponents)
739
697
  }));
740
- drizzleOrm.relations(agentGraph, ({ one, many }) => ({
698
+ drizzleOrm.relations(agents, ({ one, many }) => ({
741
699
  project: one(projects, {
742
- fields: [agentGraph.tenantId, agentGraph.projectId],
700
+ fields: [agents.tenantId, agents.projectId],
743
701
  references: [projects.tenantId, projects.id]
744
702
  }),
745
703
  defaultSubAgent: one(subAgents, {
746
- fields: [agentGraph.defaultSubAgentId],
704
+ fields: [agents.defaultSubAgentId],
747
705
  references: [subAgents.id]
748
706
  }),
749
707
  contextConfig: one(contextConfigs, {
750
- fields: [agentGraph.contextConfigId],
708
+ fields: [agents.contextConfigId],
751
709
  references: [contextConfigs.id]
752
710
  }),
753
711
  functionTools: many(functionTools)
@@ -768,9 +726,9 @@ drizzleOrm.relations(apiKeys, ({ one }) => ({
768
726
  fields: [apiKeys.tenantId, apiKeys.projectId],
769
727
  references: [projects.tenantId, projects.id]
770
728
  }),
771
- graph: one(agentGraph, {
772
- fields: [apiKeys.graphId],
773
- references: [agentGraph.id]
729
+ agent: one(agents, {
730
+ fields: [apiKeys.agentId],
731
+ references: [agents.id]
774
732
  })
775
733
  }));
776
734
  drizzleOrm.relations(subAgentToolRelations, ({ one }) => ({
@@ -783,8 +741,13 @@ drizzleOrm.relations(subAgentToolRelations, ({ one }) => ({
783
741
  references: [tools.id]
784
742
  })
785
743
  }));
786
- drizzleOrm.relations(credentialReferences, ({ many }) => ({
787
- tools: many(tools)
744
+ drizzleOrm.relations(credentialReferences, ({ one, many }) => ({
745
+ project: one(projects, {
746
+ fields: [credentialReferences.tenantId, credentialReferences.projectId],
747
+ references: [projects.tenantId, projects.id]
748
+ }),
749
+ tools: many(tools),
750
+ externalAgents: many(externalAgents)
788
751
  }));
789
752
  drizzleOrm.relations(tools, ({ one, many }) => ({
790
753
  project: one(projects, {
@@ -893,13 +856,17 @@ drizzleOrm.relations(ledgerArtifacts, ({ one }) => ({
893
856
  references: [tasks.id]
894
857
  })
895
858
  }));
896
- drizzleOrm.relations(functions, ({ many }) => ({
897
- functionTools: many(functionTools)
859
+ drizzleOrm.relations(functions, ({ many, one }) => ({
860
+ functionTools: many(functionTools),
861
+ project: one(projects, {
862
+ fields: [functions.tenantId, functions.projectId],
863
+ references: [projects.tenantId, projects.id]
864
+ })
898
865
  }));
899
866
  drizzleOrm.relations(subAgentRelations, ({ one }) => ({
900
- graph: one(agentGraph, {
901
- fields: [subAgentRelations.graphId],
902
- references: [agentGraph.id]
867
+ agent: one(agents, {
868
+ fields: [subAgentRelations.agentId],
869
+ references: [agents.id]
903
870
  }),
904
871
  sourceSubAgent: one(subAgents, {
905
872
  fields: [subAgentRelations.sourceSubAgentId],
@@ -921,9 +888,9 @@ drizzleOrm.relations(functionTools, ({ one, many }) => ({
921
888
  fields: [functionTools.tenantId, functionTools.projectId],
922
889
  references: [projects.tenantId, projects.id]
923
890
  }),
924
- graph: one(agentGraph, {
925
- fields: [functionTools.tenantId, functionTools.projectId, functionTools.graphId],
926
- references: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id]
891
+ agent: one(agents, {
892
+ fields: [functionTools.tenantId, functionTools.projectId, functionTools.agentId],
893
+ references: [agents.tenantId, agents.projectId, agents.id]
927
894
  }),
928
895
  function: one(functions, {
929
896
  fields: [functionTools.tenantId, functionTools.projectId, functionTools.functionId],
@@ -966,9 +933,13 @@ var CredentialStoreType = {
966
933
  var StopWhenSchema = zodOpenapi.z.object({
967
934
  transferCountIs: zodOpenapi.z.number().min(1).max(100).optional(),
968
935
  stepCountIs: zodOpenapi.z.number().min(1).max(1e3).optional()
969
- });
970
- var GraphStopWhenSchema = StopWhenSchema.pick({ transferCountIs: true });
971
- var SubAgentStopWhenSchema = StopWhenSchema.pick({ stepCountIs: true });
936
+ }).openapi("StopWhen");
937
+ var AgentStopWhenSchema = StopWhenSchema.pick({ transferCountIs: true }).openapi(
938
+ "AgentStopWhen"
939
+ );
940
+ var SubAgentStopWhenSchema = StopWhenSchema.pick({ stepCountIs: true }).openapi(
941
+ "SubAgentStopWhen"
942
+ );
972
943
  var MIN_ID_LENGTH = 1;
973
944
  var MAX_ID_LENGTH = 255;
974
945
  var URL_SAFE_ID_PATTERN = /^[a-zA-Z0-9\-_.]+$/;
@@ -981,23 +952,23 @@ var resourceIdSchema = zodOpenapi.z.string().min(MIN_ID_LENGTH).max(MAX_ID_LENGT
981
952
  var ModelSettingsSchema = zodOpenapi.z.object({
982
953
  model: zodOpenapi.z.string().optional(),
983
954
  providerOptions: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.any()).optional()
984
- });
955
+ }).openapi("ModelSettings");
985
956
  var ModelSchema = zodOpenapi.z.object({
986
957
  base: ModelSettingsSchema.optional(),
987
958
  structuredOutput: ModelSettingsSchema.optional(),
988
959
  summarizer: ModelSettingsSchema.optional()
989
- });
960
+ }).openapi("Model");
990
961
  var ProjectModelSchema = zodOpenapi.z.object({
991
962
  base: ModelSettingsSchema,
992
963
  structuredOutput: ModelSettingsSchema.optional(),
993
964
  summarizer: ModelSettingsSchema.optional()
994
- });
965
+ }).openapi("ProjectModel");
995
966
  var SandboxConfigSchema = zodOpenapi.z.object({
996
967
  provider: zodOpenapi.z.enum(["vercel", "local"]),
997
968
  runtime: zodOpenapi.z.enum(["node22", "typescript"]),
998
969
  timeout: zodOpenapi.z.number().min(1e3).max(3e5).optional(),
999
970
  vcpus: zodOpenapi.z.number().min(1).max(8).optional()
1000
- });
971
+ }).openapi("SandboxConfig");
1001
972
  var FunctionToolConfigSchema = zodOpenapi.z.object({
1002
973
  name: zodOpenapi.z.string(),
1003
974
  description: zodOpenapi.z.string(),
@@ -1008,31 +979,37 @@ var FunctionToolConfigSchema = zodOpenapi.z.object({
1008
979
  var createApiSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
1009
980
  var createApiInsertSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
1010
981
  var createApiUpdateSchema = (schema) => schema.omit({ tenantId: true, projectId: true }).partial();
1011
- var createGraphScopedApiSchema = (schema) => schema.omit({ tenantId: true, projectId: true, graphId: true });
1012
- var createGraphScopedApiInsertSchema = (schema) => schema.omit({ tenantId: true, projectId: true, graphId: true });
1013
- var createGraphScopedApiUpdateSchema = (schema) => schema.omit({ tenantId: true, projectId: true, graphId: true }).partial();
982
+ var createAgentScopedApiSchema = (schema) => schema.omit({ tenantId: true, projectId: true, agentId: true });
983
+ var createAgentScopedApiInsertSchema = (schema) => schema.omit({ tenantId: true, projectId: true, agentId: true });
984
+ var createAgentScopedApiUpdateSchema = (schema) => schema.omit({ tenantId: true, projectId: true, agentId: true }).partial();
1014
985
  var SubAgentSelectSchema = drizzleZod.createSelectSchema(subAgents);
1015
986
  var SubAgentInsertSchema = drizzleZod.createInsertSchema(subAgents).extend({
1016
987
  id: resourceIdSchema,
1017
988
  models: ModelSchema.optional()
1018
989
  });
1019
990
  var SubAgentUpdateSchema = SubAgentInsertSchema.partial();
1020
- var SubAgentApiSelectSchema = createGraphScopedApiSchema(SubAgentSelectSchema);
1021
- var SubAgentApiInsertSchema = createGraphScopedApiInsertSchema(SubAgentInsertSchema);
1022
- var SubAgentApiUpdateSchema = createGraphScopedApiUpdateSchema(SubAgentUpdateSchema);
991
+ var SubAgentApiSelectSchema = createAgentScopedApiSchema(SubAgentSelectSchema).openapi(
992
+ "SubAgent"
993
+ );
994
+ var SubAgentApiInsertSchema = createAgentScopedApiInsertSchema(
995
+ SubAgentInsertSchema
996
+ ).openapi("SubAgentCreate");
997
+ var SubAgentApiUpdateSchema = createAgentScopedApiUpdateSchema(
998
+ SubAgentUpdateSchema
999
+ ).openapi("SubAgentUpdate");
1023
1000
  var SubAgentRelationSelectSchema = drizzleZod.createSelectSchema(subAgentRelations);
1024
1001
  var SubAgentRelationInsertSchema = drizzleZod.createInsertSchema(subAgentRelations).extend({
1025
1002
  id: resourceIdSchema,
1026
- graphId: resourceIdSchema,
1003
+ agentId: resourceIdSchema,
1027
1004
  sourceSubAgentId: resourceIdSchema,
1028
1005
  targetSubAgentId: resourceIdSchema.optional(),
1029
1006
  externalSubAgentId: resourceIdSchema.optional()
1030
1007
  });
1031
1008
  var SubAgentRelationUpdateSchema = SubAgentRelationInsertSchema.partial();
1032
- var SubAgentRelationApiSelectSchema = createGraphScopedApiSchema(
1009
+ var SubAgentRelationApiSelectSchema = createAgentScopedApiSchema(
1033
1010
  SubAgentRelationSelectSchema
1034
- );
1035
- var SubAgentRelationApiInsertSchema = createGraphScopedApiInsertSchema(
1011
+ ).openapi("SubAgentRelation");
1012
+ var SubAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(
1036
1013
  SubAgentRelationInsertSchema
1037
1014
  ).extend({
1038
1015
  relationType: zodOpenapi.z.enum(VALID_RELATION_TYPES)
@@ -1046,8 +1023,8 @@ var SubAgentRelationApiInsertSchema = createGraphScopedApiInsertSchema(
1046
1023
  message: "Must specify exactly one of targetSubAgentId or externalSubAgentId",
1047
1024
  path: ["targetSubAgentId", "externalSubAgentId"]
1048
1025
  }
1049
- );
1050
- var SubAgentRelationApiUpdateSchema = createGraphScopedApiUpdateSchema(
1026
+ ).openapi("SubAgentRelationCreate");
1027
+ var SubAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
1051
1028
  SubAgentRelationUpdateSchema
1052
1029
  ).extend({
1053
1030
  relationType: zodOpenapi.z.enum(VALID_RELATION_TYPES).optional()
@@ -1064,7 +1041,7 @@ var SubAgentRelationApiUpdateSchema = createGraphScopedApiUpdateSchema(
1064
1041
  message: "Must specify exactly one of targetSubAgentId or externalSubAgentId when updating sub-agent relationships",
1065
1042
  path: ["targetSubAgentId", "externalSubAgentId"]
1066
1043
  }
1067
- );
1044
+ ).openapi("SubAgentRelationUpdate");
1068
1045
  var SubAgentRelationQuerySchema = zodOpenapi.z.object({
1069
1046
  sourceSubAgentId: zodOpenapi.z.string().optional(),
1070
1047
  targetSubAgentId: zodOpenapi.z.string().optional(),
@@ -1072,23 +1049,25 @@ var SubAgentRelationQuerySchema = zodOpenapi.z.object({
1072
1049
  });
1073
1050
  var ExternalSubAgentRelationInsertSchema = drizzleZod.createInsertSchema(subAgentRelations).extend({
1074
1051
  id: resourceIdSchema,
1075
- graphId: resourceIdSchema,
1052
+ agentId: resourceIdSchema,
1076
1053
  sourceSubAgentId: resourceIdSchema,
1077
1054
  externalSubAgentId: resourceIdSchema
1078
1055
  });
1079
1056
  var ExternalSubAgentRelationApiInsertSchema = createApiInsertSchema(
1080
1057
  ExternalSubAgentRelationInsertSchema
1081
1058
  );
1082
- var AgentGraphSelectSchema = drizzleZod.createSelectSchema(agentGraph);
1083
- var AgentGraphInsertSchema = drizzleZod.createInsertSchema(agentGraph).extend({
1059
+ var AgentSelectSchema = drizzleZod.createSelectSchema(agents);
1060
+ var AgentInsertSchema = drizzleZod.createInsertSchema(agents).extend({
1084
1061
  id: resourceIdSchema
1085
1062
  });
1086
- var AgentGraphUpdateSchema = AgentGraphInsertSchema.partial();
1087
- var AgentGraphApiSelectSchema = createApiSchema(AgentGraphSelectSchema);
1088
- var AgentGraphApiInsertSchema = createApiInsertSchema(AgentGraphInsertSchema).extend({
1063
+ var AgentUpdateSchema = AgentInsertSchema.partial();
1064
+ var AgentApiSelectSchema = createApiSchema(AgentSelectSchema).openapi("Agent");
1065
+ var AgentApiInsertSchema = createApiInsertSchema(AgentInsertSchema).extend({
1089
1066
  id: resourceIdSchema
1090
- });
1091
- var AgentGraphApiUpdateSchema = createApiUpdateSchema(AgentGraphUpdateSchema);
1067
+ }).openapi("AgentCreate");
1068
+ var AgentApiUpdateSchema = createApiUpdateSchema(AgentUpdateSchema).openapi(
1069
+ "AgentUpdate"
1070
+ );
1092
1071
  var TaskSelectSchema = drizzleZod.createSelectSchema(tasks);
1093
1072
  var TaskInsertSchema = drizzleZod.createInsertSchema(tasks).extend({
1094
1073
  id: resourceIdSchema,
@@ -1131,9 +1110,12 @@ var McpTransportConfigSchema = zodOpenapi.z.object({
1131
1110
  type: zodOpenapi.z.enum(MCPTransportType),
1132
1111
  requestInit: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).optional(),
1133
1112
  eventSourceInit: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).optional(),
1134
- reconnectionOptions: zodOpenapi.z.custom().optional(),
1113
+ reconnectionOptions: zodOpenapi.z.any().optional().openapi({
1114
+ type: "object",
1115
+ description: "Reconnection options for streamable HTTP transport"
1116
+ }),
1135
1117
  sessionId: zodOpenapi.z.string().optional()
1136
- });
1118
+ }).openapi("McpTransportConfig");
1137
1119
  var ToolStatusSchema = zodOpenapi.z.enum(TOOL_STATUS_VALUES);
1138
1120
  var McpToolDefinitionSchema = zodOpenapi.z.object({
1139
1121
  name: zodOpenapi.z.string(),
@@ -1148,13 +1130,16 @@ var ToolInsertSchema = drizzleZod.createInsertSchema(tools).extend({
1148
1130
  type: zodOpenapi.z.literal("mcp"),
1149
1131
  mcp: zodOpenapi.z.object({
1150
1132
  server: zodOpenapi.z.object({
1151
- url: zodOpenapi.z.string().url()
1133
+ url: zodOpenapi.z.url()
1152
1134
  }),
1153
1135
  transport: zodOpenapi.z.object({
1154
1136
  type: zodOpenapi.z.enum(MCPTransportType),
1155
1137
  requestInit: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).optional(),
1156
1138
  eventSourceInit: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).optional(),
1157
- reconnectionOptions: zodOpenapi.z.custom().optional(),
1139
+ reconnectionOptions: zodOpenapi.z.any().optional().openapi({
1140
+ type: "object",
1141
+ description: "Reconnection options for streamable HTTP transport"
1142
+ }),
1158
1143
  sessionId: zodOpenapi.z.string().optional()
1159
1144
  }).optional(),
1160
1145
  activeTools: zodOpenapi.z.array(zodOpenapi.z.string()).optional()
@@ -1167,9 +1152,15 @@ var ConversationInsertSchema = drizzleZod.createInsertSchema(conversations).exte
1167
1152
  contextConfigId: resourceIdSchema.optional()
1168
1153
  });
1169
1154
  var ConversationUpdateSchema = ConversationInsertSchema.partial();
1170
- var ConversationApiSelectSchema = createApiSchema(ConversationSelectSchema);
1171
- var ConversationApiInsertSchema = createApiInsertSchema(ConversationInsertSchema);
1172
- var ConversationApiUpdateSchema = createApiUpdateSchema(ConversationUpdateSchema);
1155
+ var ConversationApiSelectSchema = createApiSchema(ConversationSelectSchema).openapi(
1156
+ "Conversation"
1157
+ );
1158
+ var ConversationApiInsertSchema = createApiInsertSchema(ConversationInsertSchema).openapi(
1159
+ "ConversationCreate"
1160
+ );
1161
+ var ConversationApiUpdateSchema = createApiUpdateSchema(ConversationUpdateSchema).openapi(
1162
+ "ConversationUpdate"
1163
+ );
1173
1164
  var MessageSelectSchema = drizzleZod.createSelectSchema(messages);
1174
1165
  var MessageInsertSchema = drizzleZod.createInsertSchema(messages).extend({
1175
1166
  id: resourceIdSchema,
@@ -1177,9 +1168,13 @@ var MessageInsertSchema = drizzleZod.createInsertSchema(messages).extend({
1177
1168
  taskId: resourceIdSchema.optional()
1178
1169
  });
1179
1170
  var MessageUpdateSchema = MessageInsertSchema.partial();
1180
- var MessageApiSelectSchema = createApiSchema(MessageSelectSchema);
1181
- var MessageApiInsertSchema = createApiInsertSchema(MessageInsertSchema);
1182
- var MessageApiUpdateSchema = createApiUpdateSchema(MessageUpdateSchema);
1171
+ var MessageApiSelectSchema = createApiSchema(MessageSelectSchema).openapi("Message");
1172
+ var MessageApiInsertSchema = createApiInsertSchema(MessageInsertSchema).openapi(
1173
+ "MessageCreate"
1174
+ );
1175
+ var MessageApiUpdateSchema = createApiUpdateSchema(MessageUpdateSchema).openapi(
1176
+ "MessageUpdate"
1177
+ );
1183
1178
  var ContextCacheSelectSchema = drizzleZod.createSelectSchema(contextCache);
1184
1179
  var ContextCacheInsertSchema = drizzleZod.createInsertSchema(contextCache);
1185
1180
  var ContextCacheUpdateSchema = ContextCacheInsertSchema.partial();
@@ -1195,13 +1190,19 @@ var DataComponentBaseSchema = DataComponentInsertSchema.omit({
1195
1190
  updatedAt: true
1196
1191
  });
1197
1192
  var DataComponentUpdateSchema = DataComponentInsertSchema.partial();
1198
- var DataComponentApiSelectSchema = createApiSchema(DataComponentSelectSchema);
1199
- var DataComponentApiInsertSchema = createApiInsertSchema(DataComponentInsertSchema);
1200
- var DataComponentApiUpdateSchema = createApiUpdateSchema(DataComponentUpdateSchema);
1193
+ var DataComponentApiSelectSchema = createApiSchema(
1194
+ DataComponentSelectSchema
1195
+ ).openapi("DataComponent");
1196
+ var DataComponentApiInsertSchema = createApiInsertSchema(
1197
+ DataComponentInsertSchema
1198
+ ).openapi("DataComponentCreate");
1199
+ var DataComponentApiUpdateSchema = createApiUpdateSchema(
1200
+ DataComponentUpdateSchema
1201
+ ).openapi("DataComponentUpdate");
1201
1202
  var SubAgentDataComponentSelectSchema = drizzleZod.createSelectSchema(subAgentDataComponents);
1202
1203
  var SubAgentDataComponentInsertSchema = drizzleZod.createInsertSchema(subAgentDataComponents);
1203
1204
  var SubAgentDataComponentUpdateSchema = SubAgentDataComponentInsertSchema.partial();
1204
- var SubAgentDataComponentApiSelectSchema = createGraphScopedApiSchema(
1205
+ var SubAgentDataComponentApiSelectSchema = createAgentScopedApiSchema(
1205
1206
  SubAgentDataComponentSelectSchema
1206
1207
  );
1207
1208
  var SubAgentDataComponentApiInsertSchema = SubAgentDataComponentInsertSchema.omit({
@@ -1210,7 +1211,7 @@ var SubAgentDataComponentApiInsertSchema = SubAgentDataComponentInsertSchema.omi
1210
1211
  id: true,
1211
1212
  createdAt: true
1212
1213
  });
1213
- var SubAgentDataComponentApiUpdateSchema = createGraphScopedApiUpdateSchema(
1214
+ var SubAgentDataComponentApiUpdateSchema = createAgentScopedApiUpdateSchema(
1214
1215
  SubAgentDataComponentUpdateSchema
1215
1216
  );
1216
1217
  var ArtifactComponentSelectSchema = drizzleZod.createSelectSchema(artifactComponents);
@@ -1218,16 +1219,18 @@ var ArtifactComponentInsertSchema = drizzleZod.createInsertSchema(artifactCompon
1218
1219
  id: resourceIdSchema
1219
1220
  });
1220
1221
  var ArtifactComponentUpdateSchema = ArtifactComponentInsertSchema.partial();
1221
- var ArtifactComponentApiSelectSchema = createApiSchema(ArtifactComponentSelectSchema);
1222
+ var ArtifactComponentApiSelectSchema = createApiSchema(
1223
+ ArtifactComponentSelectSchema
1224
+ ).openapi("ArtifactComponent");
1222
1225
  var ArtifactComponentApiInsertSchema = ArtifactComponentInsertSchema.omit({
1223
1226
  tenantId: true,
1224
1227
  projectId: true,
1225
1228
  createdAt: true,
1226
1229
  updatedAt: true
1227
- });
1230
+ }).openapi("ArtifactComponentCreate");
1228
1231
  var ArtifactComponentApiUpdateSchema = createApiUpdateSchema(
1229
1232
  ArtifactComponentUpdateSchema
1230
- );
1233
+ ).openapi("ArtifactComponentUpdate");
1231
1234
  var SubAgentArtifactComponentSelectSchema = drizzleZod.createSelectSchema(subAgentArtifactComponents);
1232
1235
  var SubAgentArtifactComponentInsertSchema = drizzleZod.createInsertSchema(
1233
1236
  subAgentArtifactComponents
@@ -1237,7 +1240,7 @@ var SubAgentArtifactComponentInsertSchema = drizzleZod.createInsertSchema(
1237
1240
  artifactComponentId: resourceIdSchema
1238
1241
  });
1239
1242
  var SubAgentArtifactComponentUpdateSchema = SubAgentArtifactComponentInsertSchema.partial();
1240
- var SubAgentArtifactComponentApiSelectSchema = createGraphScopedApiSchema(
1243
+ var SubAgentArtifactComponentApiSelectSchema = createAgentScopedApiSchema(
1241
1244
  SubAgentArtifactComponentSelectSchema
1242
1245
  );
1243
1246
  var SubAgentArtifactComponentApiInsertSchema = SubAgentArtifactComponentInsertSchema.omit({
@@ -1246,7 +1249,7 @@ var SubAgentArtifactComponentApiInsertSchema = SubAgentArtifactComponentInsertSc
1246
1249
  id: true,
1247
1250
  createdAt: true
1248
1251
  });
1249
- var SubAgentArtifactComponentApiUpdateSchema = createGraphScopedApiUpdateSchema(
1252
+ var SubAgentArtifactComponentApiUpdateSchema = createAgentScopedApiUpdateSchema(
1250
1253
  SubAgentArtifactComponentUpdateSchema
1251
1254
  );
1252
1255
  var ExternalAgentSelectSchema = drizzleZod.createSelectSchema(externalAgents).extend({
@@ -1257,9 +1260,15 @@ var ExternalAgentInsertSchema = drizzleZod.createInsertSchema(externalAgents).ex
1257
1260
  id: resourceIdSchema
1258
1261
  });
1259
1262
  var ExternalAgentUpdateSchema = ExternalAgentInsertSchema.partial();
1260
- var ExternalAgentApiSelectSchema = createGraphScopedApiSchema(ExternalAgentSelectSchema);
1261
- var ExternalAgentApiInsertSchema = createGraphScopedApiInsertSchema(ExternalAgentInsertSchema);
1262
- var ExternalAgentApiUpdateSchema = createGraphScopedApiUpdateSchema(ExternalAgentUpdateSchema);
1263
+ var ExternalAgentApiSelectSchema = createAgentScopedApiSchema(
1264
+ ExternalAgentSelectSchema
1265
+ ).openapi("ExternalAgent");
1266
+ var ExternalAgentApiInsertSchema = createAgentScopedApiInsertSchema(
1267
+ ExternalAgentInsertSchema
1268
+ ).openapi("ExternalAgentCreate");
1269
+ var ExternalAgentApiUpdateSchema = createAgentScopedApiUpdateSchema(
1270
+ ExternalAgentUpdateSchema
1271
+ ).openapi("ExternalAgentUpdate");
1263
1272
  var AllAgentSchema = zodOpenapi.z.discriminatedUnion("type", [
1264
1273
  SubAgentApiSelectSchema.extend({ type: zodOpenapi.z.literal("internal") }),
1265
1274
  ExternalAgentApiSelectSchema.extend({ type: zodOpenapi.z.literal("external") })
@@ -1267,7 +1276,7 @@ var AllAgentSchema = zodOpenapi.z.discriminatedUnion("type", [
1267
1276
  var ApiKeySelectSchema = drizzleZod.createSelectSchema(apiKeys);
1268
1277
  var ApiKeyInsertSchema = drizzleZod.createInsertSchema(apiKeys).extend({
1269
1278
  id: resourceIdSchema,
1270
- graphId: resourceIdSchema
1279
+ agentId: resourceIdSchema
1271
1280
  });
1272
1281
  var ApiKeyUpdateSchema = ApiKeyInsertSchema.partial().omit({
1273
1282
  tenantId: true,
@@ -1283,7 +1292,7 @@ var ApiKeyApiSelectSchema = ApiKeySelectSchema.omit({
1283
1292
  projectId: true,
1284
1293
  keyHash: true
1285
1294
  // Never expose the hash
1286
- });
1295
+ }).openapi("ApiKey");
1287
1296
  var ApiKeyApiCreationResponseSchema = zodOpenapi.z.object({
1288
1297
  data: zodOpenapi.z.object({
1289
1298
  apiKey: ApiKeyApiSelectSchema,
@@ -1303,8 +1312,8 @@ var ApiKeyApiInsertSchema = ApiKeyInsertSchema.omit({
1303
1312
  // Auto-generated
1304
1313
  lastUsedAt: true
1305
1314
  // Not set on creation
1306
- });
1307
- var ApiKeyApiUpdateSchema = ApiKeyUpdateSchema;
1315
+ }).openapi("ApiKeyCreate");
1316
+ var ApiKeyApiUpdateSchema = ApiKeyUpdateSchema.openapi("ApiKeyUpdate");
1308
1317
  var CredentialReferenceSelectSchema = zodOpenapi.z.object({
1309
1318
  id: zodOpenapi.z.string(),
1310
1319
  tenantId: zodOpenapi.z.string(),
@@ -1327,17 +1336,17 @@ var CredentialReferenceApiSelectSchema = createApiSchema(
1327
1336
  ).extend({
1328
1337
  type: zodOpenapi.z.enum(CredentialStoreType),
1329
1338
  tools: zodOpenapi.z.array(ToolSelectSchema).optional()
1330
- });
1339
+ }).openapi("CredentialReference");
1331
1340
  var CredentialReferenceApiInsertSchema = createApiInsertSchema(
1332
1341
  CredentialReferenceInsertSchema
1333
1342
  ).extend({
1334
1343
  type: zodOpenapi.z.enum(CredentialStoreType)
1335
- });
1344
+ }).openapi("CredentialReferenceCreate");
1336
1345
  var CredentialReferenceApiUpdateSchema = createApiUpdateSchema(
1337
1346
  CredentialReferenceUpdateSchema
1338
1347
  ).extend({
1339
1348
  type: zodOpenapi.z.enum(CredentialStoreType).optional()
1340
- });
1349
+ }).openapi("CredentialReferenceUpdate");
1341
1350
  var McpToolSchema = ToolInsertSchema.extend({
1342
1351
  imageUrl: imageUrlSchema,
1343
1352
  availableTools: zodOpenapi.z.array(McpToolDefinitionSchema).optional(),
@@ -1366,25 +1375,35 @@ var MCPToolConfigSchema = McpToolSchema.omit({
1366
1375
  credential: CredentialReferenceApiInsertSchema.optional()
1367
1376
  });
1368
1377
  var ToolUpdateSchema = ToolInsertSchema.partial();
1369
- var ToolApiSelectSchema = createApiSchema(ToolSelectSchema);
1370
- var ToolApiInsertSchema = createApiInsertSchema(ToolInsertSchema);
1371
- var ToolApiUpdateSchema = createApiUpdateSchema(ToolUpdateSchema);
1378
+ var ToolApiSelectSchema = createApiSchema(ToolSelectSchema).openapi("Tool");
1379
+ var ToolApiInsertSchema = createApiInsertSchema(ToolInsertSchema).openapi("ToolCreate");
1380
+ var ToolApiUpdateSchema = createApiUpdateSchema(ToolUpdateSchema).openapi("ToolUpdate");
1372
1381
  var FunctionToolSelectSchema = drizzleZod.createSelectSchema(functionTools);
1373
1382
  var FunctionToolInsertSchema = drizzleZod.createInsertSchema(functionTools).extend({
1374
1383
  id: resourceIdSchema
1375
1384
  });
1376
1385
  var FunctionToolUpdateSchema = FunctionToolInsertSchema.partial();
1377
- var FunctionToolApiSelectSchema = createApiSchema(FunctionToolSelectSchema);
1378
- var FunctionToolApiInsertSchema = createGraphScopedApiInsertSchema(FunctionToolInsertSchema);
1379
- var FunctionToolApiUpdateSchema = createApiUpdateSchema(FunctionToolUpdateSchema);
1386
+ var FunctionToolApiSelectSchema = createApiSchema(FunctionToolSelectSchema).openapi(
1387
+ "FunctionTool"
1388
+ );
1389
+ var FunctionToolApiInsertSchema = createAgentScopedApiInsertSchema(
1390
+ FunctionToolInsertSchema
1391
+ ).openapi("FunctionToolCreate");
1392
+ var FunctionToolApiUpdateSchema = createApiUpdateSchema(
1393
+ FunctionToolUpdateSchema
1394
+ ).openapi("FunctionToolUpdate");
1380
1395
  var FunctionSelectSchema = drizzleZod.createSelectSchema(functions);
1381
1396
  var FunctionInsertSchema = drizzleZod.createInsertSchema(functions).extend({
1382
1397
  id: resourceIdSchema
1383
1398
  });
1384
1399
  var FunctionUpdateSchema = FunctionInsertSchema.partial();
1385
- var FunctionApiSelectSchema = createApiSchema(FunctionSelectSchema);
1386
- var FunctionApiInsertSchema = createApiInsertSchema(FunctionInsertSchema);
1387
- var FunctionApiUpdateSchema = createApiUpdateSchema(FunctionUpdateSchema);
1400
+ var FunctionApiSelectSchema = createApiSchema(FunctionSelectSchema).openapi("Function");
1401
+ var FunctionApiInsertSchema = createApiInsertSchema(FunctionInsertSchema).openapi(
1402
+ "FunctionCreate"
1403
+ );
1404
+ var FunctionApiUpdateSchema = createApiUpdateSchema(FunctionUpdateSchema).openapi(
1405
+ "FunctionUpdate"
1406
+ );
1388
1407
  var FetchConfigSchema = zodOpenapi.z.object({
1389
1408
  url: zodOpenapi.z.string().min(1, "URL is required"),
1390
1409
  method: zodOpenapi.z.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).optional().default("GET"),
@@ -1393,7 +1412,7 @@ var FetchConfigSchema = zodOpenapi.z.object({
1393
1412
  transform: zodOpenapi.z.string().optional(),
1394
1413
  // JSONPath or JS transform function
1395
1414
  timeout: zodOpenapi.z.number().min(0).optional().default(1e4).optional()
1396
- });
1415
+ }).openapi("FetchConfig");
1397
1416
  var FetchDefinitionSchema = zodOpenapi.z.object({
1398
1417
  id: zodOpenapi.z.string().min(1, "Fetch definition ID is required"),
1399
1418
  name: zodOpenapi.z.string().optional(),
@@ -1401,29 +1420,41 @@ var FetchDefinitionSchema = zodOpenapi.z.object({
1401
1420
  fetchConfig: FetchConfigSchema,
1402
1421
  responseSchema: zodOpenapi.z.any().optional(),
1403
1422
  // JSON Schema for validating HTTP response
1404
- defaultValue: zodOpenapi.z.unknown().optional(),
1423
+ defaultValue: zodOpenapi.z.any().optional().openapi({
1424
+ description: "Default value if fetch fails"
1425
+ }),
1405
1426
  credential: CredentialReferenceApiInsertSchema.optional()
1406
- });
1427
+ }).openapi("FetchDefinition");
1407
1428
  var ContextConfigSelectSchema = drizzleZod.createSelectSchema(contextConfigs).extend({
1408
- headersSchema: zodOpenapi.z.unknown().optional()
1429
+ headersSchema: zodOpenapi.z.any().optional().openapi({
1430
+ type: "object",
1431
+ description: "JSON Schema for validating request headers"
1432
+ })
1409
1433
  });
1410
1434
  var ContextConfigInsertSchema = drizzleZod.createInsertSchema(contextConfigs).extend({
1411
1435
  id: resourceIdSchema.optional(),
1412
- headersSchema: zodOpenapi.z.unknown().optional()
1436
+ headersSchema: zodOpenapi.z.any().nullable().optional().openapi({
1437
+ type: "object",
1438
+ description: "JSON Schema for validating request headers"
1439
+ }),
1440
+ contextVariables: zodOpenapi.z.any().nullable().optional().openapi({
1441
+ type: "object",
1442
+ description: "Context variables configuration with fetch definitions"
1443
+ })
1413
1444
  }).omit({
1414
1445
  createdAt: true,
1415
1446
  updatedAt: true
1416
1447
  });
1417
1448
  var ContextConfigUpdateSchema = ContextConfigInsertSchema.partial();
1418
1449
  var ContextConfigApiSelectSchema = createApiSchema(ContextConfigSelectSchema).omit({
1419
- graphId: true
1420
- });
1450
+ agentId: true
1451
+ }).openapi("ContextConfig");
1421
1452
  var ContextConfigApiInsertSchema = createApiInsertSchema(ContextConfigInsertSchema).omit({
1422
- graphId: true
1423
- });
1453
+ agentId: true
1454
+ }).openapi("ContextConfigCreate");
1424
1455
  var ContextConfigApiUpdateSchema = createApiUpdateSchema(ContextConfigUpdateSchema).omit({
1425
- graphId: true
1426
- });
1456
+ agentId: true
1457
+ }).openapi("ContextConfigUpdate");
1427
1458
  var SubAgentToolRelationSelectSchema = drizzleZod.createSelectSchema(subAgentToolRelations);
1428
1459
  var SubAgentToolRelationInsertSchema = drizzleZod.createInsertSchema(subAgentToolRelations).extend({
1429
1460
  id: resourceIdSchema,
@@ -1433,15 +1464,15 @@ var SubAgentToolRelationInsertSchema = drizzleZod.createInsertSchema(subAgentToo
1433
1464
  headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).nullish()
1434
1465
  });
1435
1466
  var SubAgentToolRelationUpdateSchema = SubAgentToolRelationInsertSchema.partial();
1436
- var SubAgentToolRelationApiSelectSchema = createGraphScopedApiSchema(
1467
+ var SubAgentToolRelationApiSelectSchema = createAgentScopedApiSchema(
1437
1468
  SubAgentToolRelationSelectSchema
1438
- );
1439
- var SubAgentToolRelationApiInsertSchema = createGraphScopedApiInsertSchema(
1469
+ ).openapi("SubAgentToolRelation");
1470
+ var SubAgentToolRelationApiInsertSchema = createAgentScopedApiInsertSchema(
1440
1471
  SubAgentToolRelationInsertSchema
1441
- );
1442
- var SubAgentToolRelationApiUpdateSchema = createGraphScopedApiUpdateSchema(
1472
+ ).openapi("SubAgentToolRelationCreate");
1473
+ var SubAgentToolRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
1443
1474
  SubAgentToolRelationUpdateSchema
1444
- );
1475
+ ).openapi("SubAgentToolRelationUpdate");
1445
1476
  var LedgerArtifactSelectSchema = drizzleZod.createSelectSchema(ledgerArtifacts);
1446
1477
  var LedgerArtifactInsertSchema = drizzleZod.createInsertSchema(ledgerArtifacts);
1447
1478
  var LedgerArtifactUpdateSchema = LedgerArtifactInsertSchema.partial();
@@ -1456,21 +1487,21 @@ var StatusComponentSchema = zodOpenapi.z.object({
1456
1487
  properties: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.any()),
1457
1488
  required: zodOpenapi.z.array(zodOpenapi.z.string()).optional()
1458
1489
  }).optional()
1459
- });
1490
+ }).openapi("StatusComponent");
1460
1491
  var StatusUpdateSchema = zodOpenapi.z.object({
1461
1492
  enabled: zodOpenapi.z.boolean().optional(),
1462
1493
  numEvents: zodOpenapi.z.number().min(1).max(100).optional(),
1463
1494
  timeInSeconds: zodOpenapi.z.number().min(1).max(600).optional(),
1464
1495
  prompt: zodOpenapi.z.string().max(2e3, "Custom prompt cannot exceed 2000 characters").optional(),
1465
1496
  statusComponents: zodOpenapi.z.array(StatusComponentSchema).optional()
1466
- });
1497
+ }).openapi("StatusUpdate");
1467
1498
  var CanUseItemSchema = zodOpenapi.z.object({
1468
1499
  agentToolRelationId: zodOpenapi.z.string().optional(),
1469
1500
  toolId: zodOpenapi.z.string(),
1470
1501
  toolSelection: zodOpenapi.z.array(zodOpenapi.z.string()).nullish(),
1471
1502
  headers: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.string()).nullish()
1472
- });
1473
- var FullGraphAgentInsertSchema = SubAgentApiInsertSchema.extend({
1503
+ }).openapi("CanUseItem");
1504
+ var FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
1474
1505
  type: zodOpenapi.z.literal("internal"),
1475
1506
  canUse: zodOpenapi.z.array(CanUseItemSchema),
1476
1507
  // All tools (both MCP and function tools)
@@ -1479,51 +1510,30 @@ var FullGraphAgentInsertSchema = SubAgentApiInsertSchema.extend({
1479
1510
  canTransferTo: zodOpenapi.z.array(zodOpenapi.z.string()).optional(),
1480
1511
  canDelegateTo: zodOpenapi.z.array(zodOpenapi.z.string()).optional()
1481
1512
  });
1482
- var FullGraphDefinitionSchema = AgentGraphApiInsertSchema.extend({
1483
- subAgents: zodOpenapi.z.record(
1484
- zodOpenapi.z.string(),
1485
- zodOpenapi.z.union([FullGraphAgentInsertSchema, ExternalAgentApiInsertSchema])
1486
- ),
1487
- // Lookup maps for UI to resolve canUse items
1488
- tools: zodOpenapi.z.record(zodOpenapi.z.string(), ToolApiInsertSchema).optional(),
1489
- // MCP tools (project-scoped)
1490
- functionTools: zodOpenapi.z.record(zodOpenapi.z.string(), FunctionToolApiInsertSchema).optional(),
1491
- // Function tools (graph-scoped)
1492
- functions: zodOpenapi.z.record(zodOpenapi.z.string(), FunctionApiInsertSchema).optional(),
1493
- // Get function code for function tools
1494
- contextConfig: zodOpenapi.z.optional(ContextConfigApiInsertSchema),
1495
- statusUpdates: zodOpenapi.z.optional(StatusUpdateSchema),
1496
- models: ModelSchema.optional(),
1497
- stopWhen: GraphStopWhenSchema.optional(),
1498
- graphPrompt: zodOpenapi.z.string().max(5e3, "Graph prompt cannot exceed 5000 characters").optional()
1499
- });
1500
- var GraphWithinContextOfProjectSchema = AgentGraphApiInsertSchema.extend({
1513
+ var AgentWithinContextOfProjectSchema = AgentApiInsertSchema.extend({
1501
1514
  subAgents: zodOpenapi.z.record(
1502
1515
  zodOpenapi.z.string(),
1503
- zodOpenapi.z.discriminatedUnion("type", [
1504
- FullGraphAgentInsertSchema,
1505
- ExternalAgentApiInsertSchema.extend({ type: zodOpenapi.z.literal("external") })
1506
- ])
1516
+ zodOpenapi.z.union([FullAgentAgentInsertSchema, ExternalAgentApiInsertSchema])
1507
1517
  ),
1508
1518
  // Lookup maps for UI to resolve canUse items
1509
1519
  tools: zodOpenapi.z.record(zodOpenapi.z.string(), ToolApiInsertSchema).optional(),
1510
1520
  // MCP tools (project-scoped)
1511
1521
  functionTools: zodOpenapi.z.record(zodOpenapi.z.string(), FunctionToolApiInsertSchema).optional(),
1512
- // Function tools (graph-scoped)
1522
+ // Function tools (agent-scoped)
1513
1523
  functions: zodOpenapi.z.record(zodOpenapi.z.string(), FunctionApiInsertSchema).optional(),
1514
1524
  // Get function code for function tools
1515
1525
  contextConfig: zodOpenapi.z.optional(ContextConfigApiInsertSchema),
1516
1526
  statusUpdates: zodOpenapi.z.optional(StatusUpdateSchema),
1517
1527
  models: ModelSchema.optional(),
1518
- stopWhen: GraphStopWhenSchema.optional(),
1519
- graphPrompt: zodOpenapi.z.string().max(5e3, "Graph prompt cannot exceed 5000 characters").optional()
1528
+ stopWhen: AgentStopWhenSchema.optional(),
1529
+ prompt: zodOpenapi.z.string().max(5e3, "Agent prompt cannot exceed 5000 characters").optional()
1520
1530
  });
1521
1531
  var PaginationSchema = zodOpenapi.z.object({
1522
1532
  page: zodOpenapi.z.coerce.number().min(1).default(1),
1523
1533
  limit: zodOpenapi.z.coerce.number().min(1).max(100).default(10),
1524
1534
  total: zodOpenapi.z.number(),
1525
1535
  pages: zodOpenapi.z.number()
1526
- });
1536
+ }).openapi("Pagination");
1527
1537
  var ListResponseSchema = (itemSchema) => zodOpenapi.z.object({
1528
1538
  data: zodOpenapi.z.array(itemSchema),
1529
1539
  pagination: PaginationSchema
@@ -1534,15 +1544,17 @@ var SingleResponseSchema = (itemSchema) => zodOpenapi.z.object({
1534
1544
  var ErrorResponseSchema = zodOpenapi.z.object({
1535
1545
  error: zodOpenapi.z.string(),
1536
1546
  message: zodOpenapi.z.string().optional(),
1537
- details: zodOpenapi.z.unknown().optional()
1538
- });
1547
+ details: zodOpenapi.z.any().optional().openapi({
1548
+ description: "Additional error details"
1549
+ })
1550
+ }).openapi("ErrorResponse");
1539
1551
  var ExistsResponseSchema = zodOpenapi.z.object({
1540
1552
  exists: zodOpenapi.z.boolean()
1541
- });
1553
+ }).openapi("ExistsResponse");
1542
1554
  var RemovedResponseSchema = zodOpenapi.z.object({
1543
1555
  message: zodOpenapi.z.string(),
1544
1556
  removed: zodOpenapi.z.boolean()
1545
- });
1557
+ }).openapi("RemovedResponse");
1546
1558
  var ProjectSelectSchema = drizzleZod.createSelectSchema(projects);
1547
1559
  var ProjectInsertSchema = drizzleZod.createInsertSchema(projects).extend({
1548
1560
  models: ProjectModelSchema,
@@ -1553,15 +1565,19 @@ var ProjectInsertSchema = drizzleZod.createInsertSchema(projects).extend({
1553
1565
  updatedAt: true
1554
1566
  });
1555
1567
  var ProjectUpdateSchema = ProjectInsertSchema.partial();
1556
- var ProjectApiSelectSchema = ProjectSelectSchema.omit({ tenantId: true });
1557
- var ProjectApiInsertSchema = ProjectInsertSchema.omit({ tenantId: true });
1558
- var ProjectApiUpdateSchema = ProjectUpdateSchema.omit({ tenantId: true });
1568
+ var ProjectApiSelectSchema = ProjectSelectSchema.omit({ tenantId: true }).openapi(
1569
+ "Project"
1570
+ );
1571
+ var ProjectApiInsertSchema = ProjectInsertSchema.omit({ tenantId: true }).openapi(
1572
+ "ProjectCreate"
1573
+ );
1574
+ var ProjectApiUpdateSchema = ProjectUpdateSchema.omit({ tenantId: true }).openapi(
1575
+ "ProjectUpdate"
1576
+ );
1559
1577
  var FullProjectDefinitionSchema = ProjectApiInsertSchema.extend({
1560
- graphs: zodOpenapi.z.record(zodOpenapi.z.string(), GraphWithinContextOfProjectSchema),
1578
+ agents: zodOpenapi.z.record(zodOpenapi.z.string(), AgentWithinContextOfProjectSchema),
1561
1579
  tools: zodOpenapi.z.record(zodOpenapi.z.string(), ToolApiInsertSchema),
1562
- // MCP tools (project-scoped)
1563
1580
  functions: zodOpenapi.z.record(zodOpenapi.z.string(), FunctionApiInsertSchema).optional(),
1564
- // Functions (project-scoped)
1565
1581
  dataComponents: zodOpenapi.z.record(zodOpenapi.z.string(), DataComponentApiInsertSchema).optional(),
1566
1582
  artifactComponents: zodOpenapi.z.record(zodOpenapi.z.string(), ArtifactComponentApiInsertSchema).optional(),
1567
1583
  statusUpdates: zodOpenapi.z.optional(StatusUpdateSchema),
@@ -1569,6 +1585,96 @@ var FullProjectDefinitionSchema = ProjectApiInsertSchema.extend({
1569
1585
  createdAt: zodOpenapi.z.string().optional(),
1570
1586
  updatedAt: zodOpenapi.z.string().optional()
1571
1587
  });
1588
+ var ProjectResponse = zodOpenapi.z.object({ data: ProjectApiSelectSchema }).openapi("ProjectResponse");
1589
+ var SubAgentResponse = zodOpenapi.z.object({ data: SubAgentApiSelectSchema }).openapi("SubAgentResponse");
1590
+ var AgentResponse = zodOpenapi.z.object({ data: AgentApiSelectSchema }).openapi("AgentResponse");
1591
+ var ToolResponse = zodOpenapi.z.object({ data: ToolApiSelectSchema }).openapi("ToolResponse");
1592
+ var ExternalAgentResponse = zodOpenapi.z.object({ data: ExternalAgentApiSelectSchema }).openapi("ExternalAgentResponse");
1593
+ var ContextConfigResponse = zodOpenapi.z.object({ data: ContextConfigApiSelectSchema }).openapi("ContextConfigResponse");
1594
+ var ApiKeyResponse = zodOpenapi.z.object({ data: ApiKeyApiSelectSchema }).openapi("ApiKeyResponse");
1595
+ var CredentialReferenceResponse = zodOpenapi.z.object({ data: CredentialReferenceApiSelectSchema }).openapi("CredentialReferenceResponse");
1596
+ var FunctionResponse = zodOpenapi.z.object({ data: FunctionApiSelectSchema }).openapi("FunctionResponse");
1597
+ var FunctionToolResponse = zodOpenapi.z.object({ data: FunctionToolApiSelectSchema }).openapi("FunctionToolResponse");
1598
+ var DataComponentResponse = zodOpenapi.z.object({ data: DataComponentApiSelectSchema }).openapi("DataComponentResponse");
1599
+ var ArtifactComponentResponse = zodOpenapi.z.object({ data: ArtifactComponentApiSelectSchema }).openapi("ArtifactComponentResponse");
1600
+ var SubAgentRelationResponse = zodOpenapi.z.object({ data: SubAgentRelationApiSelectSchema }).openapi("SubAgentRelationResponse");
1601
+ var SubAgentToolRelationResponse = zodOpenapi.z.object({ data: SubAgentToolRelationApiSelectSchema }).openapi("SubAgentToolRelationResponse");
1602
+ var ConversationResponse = zodOpenapi.z.object({ data: ConversationApiSelectSchema }).openapi("ConversationResponse");
1603
+ var MessageResponse = zodOpenapi.z.object({ data: MessageApiSelectSchema }).openapi("MessageResponse");
1604
+ var ProjectListResponse = zodOpenapi.z.object({
1605
+ data: zodOpenapi.z.array(ProjectApiSelectSchema),
1606
+ pagination: PaginationSchema
1607
+ }).openapi("ProjectListResponse");
1608
+ var SubAgentListResponse = zodOpenapi.z.object({
1609
+ data: zodOpenapi.z.array(SubAgentApiSelectSchema),
1610
+ pagination: PaginationSchema
1611
+ }).openapi("SubAgentListResponse");
1612
+ var AgentListResponse = zodOpenapi.z.object({
1613
+ data: zodOpenapi.z.array(AgentApiSelectSchema),
1614
+ pagination: PaginationSchema
1615
+ }).openapi("AgentListResponse");
1616
+ var ToolListResponse = zodOpenapi.z.object({
1617
+ data: zodOpenapi.z.array(ToolApiSelectSchema),
1618
+ pagination: PaginationSchema
1619
+ }).openapi("ToolListResponse");
1620
+ var ExternalAgentListResponse = zodOpenapi.z.object({
1621
+ data: zodOpenapi.z.array(ExternalAgentApiSelectSchema),
1622
+ pagination: PaginationSchema
1623
+ }).openapi("ExternalAgentListResponse");
1624
+ var ContextConfigListResponse = zodOpenapi.z.object({
1625
+ data: zodOpenapi.z.array(ContextConfigApiSelectSchema),
1626
+ pagination: PaginationSchema
1627
+ }).openapi("ContextConfigListResponse");
1628
+ var ApiKeyListResponse = zodOpenapi.z.object({
1629
+ data: zodOpenapi.z.array(ApiKeyApiSelectSchema),
1630
+ pagination: PaginationSchema
1631
+ }).openapi("ApiKeyListResponse");
1632
+ var CredentialReferenceListResponse = zodOpenapi.z.object({
1633
+ data: zodOpenapi.z.array(CredentialReferenceApiSelectSchema),
1634
+ pagination: PaginationSchema
1635
+ }).openapi("CredentialReferenceListResponse");
1636
+ var FunctionListResponse = zodOpenapi.z.object({
1637
+ data: zodOpenapi.z.array(FunctionApiSelectSchema),
1638
+ pagination: PaginationSchema
1639
+ }).openapi("FunctionListResponse");
1640
+ var FunctionToolListResponse = zodOpenapi.z.object({
1641
+ data: zodOpenapi.z.array(FunctionToolApiSelectSchema),
1642
+ pagination: PaginationSchema
1643
+ }).openapi("FunctionToolListResponse");
1644
+ var DataComponentListResponse = zodOpenapi.z.object({
1645
+ data: zodOpenapi.z.array(DataComponentApiSelectSchema),
1646
+ pagination: PaginationSchema
1647
+ }).openapi("DataComponentListResponse");
1648
+ var ArtifactComponentListResponse = zodOpenapi.z.object({
1649
+ data: zodOpenapi.z.array(ArtifactComponentApiSelectSchema),
1650
+ pagination: PaginationSchema
1651
+ }).openapi("ArtifactComponentListResponse");
1652
+ var SubAgentRelationListResponse = zodOpenapi.z.object({
1653
+ data: zodOpenapi.z.array(SubAgentRelationApiSelectSchema),
1654
+ pagination: PaginationSchema
1655
+ }).openapi("SubAgentRelationListResponse");
1656
+ var SubAgentToolRelationListResponse = zodOpenapi.z.object({
1657
+ data: zodOpenapi.z.array(SubAgentToolRelationApiSelectSchema),
1658
+ pagination: PaginationSchema
1659
+ }).openapi("SubAgentToolRelationListResponse");
1660
+ var ConversationListResponse = zodOpenapi.z.object({
1661
+ data: zodOpenapi.z.array(ConversationApiSelectSchema),
1662
+ pagination: PaginationSchema
1663
+ }).openapi("ConversationListResponse");
1664
+ var MessageListResponse = zodOpenapi.z.object({
1665
+ data: zodOpenapi.z.array(MessageApiSelectSchema),
1666
+ pagination: PaginationSchema
1667
+ }).openapi("MessageListResponse");
1668
+ var SubAgentDataComponentResponse = zodOpenapi.z.object({ data: SubAgentDataComponentApiSelectSchema }).openapi("SubAgentDataComponentResponse");
1669
+ var SubAgentArtifactComponentResponse = zodOpenapi.z.object({ data: SubAgentArtifactComponentApiSelectSchema }).openapi("SubAgentArtifactComponentResponse");
1670
+ var SubAgentDataComponentListResponse = zodOpenapi.z.object({
1671
+ data: zodOpenapi.z.array(SubAgentDataComponentApiSelectSchema),
1672
+ pagination: PaginationSchema
1673
+ }).openapi("SubAgentDataComponentListResponse");
1674
+ var SubAgentArtifactComponentListResponse = zodOpenapi.z.object({
1675
+ data: zodOpenapi.z.array(SubAgentArtifactComponentApiSelectSchema),
1676
+ pagination: PaginationSchema
1677
+ }).openapi("SubAgentArtifactComponentListResponse");
1572
1678
  var HeadersScopeSchema = zodOpenapi.z.object({
1573
1679
  "x-inkeep-tenant-id": zodOpenapi.z.string().optional().openapi({
1574
1680
  description: "Tenant identifier",
@@ -1578,9 +1684,9 @@ var HeadersScopeSchema = zodOpenapi.z.object({
1578
1684
  description: "Project identifier",
1579
1685
  example: "project_456"
1580
1686
  }),
1581
- "x-inkeep-graph-id": zodOpenapi.z.string().optional().openapi({
1582
- description: "Graph identifier",
1583
- example: "graph_789"
1687
+ "x-inkeep-agent-id": zodOpenapi.z.string().optional().openapi({
1688
+ description: "Agent identifier",
1689
+ example: "agent_789"
1584
1690
  })
1585
1691
  });
1586
1692
  var TenantId = zodOpenapi.z.string().openapi({
@@ -1591,9 +1697,9 @@ var ProjectId = zodOpenapi.z.string().openapi({
1591
1697
  description: "Project identifier",
1592
1698
  example: "project_456"
1593
1699
  });
1594
- var GraphId = zodOpenapi.z.string().openapi({
1595
- description: "Graph identifier",
1596
- example: "graph_789"
1700
+ var AgentId = zodOpenapi.z.string().openapi({
1701
+ description: "Agent identifier",
1702
+ example: "agent_789"
1597
1703
  });
1598
1704
  var SubAgentId = zodOpenapi.z.string().openapi({
1599
1705
  description: "Sub-agent identifier",
@@ -1611,41 +1717,41 @@ var TenantProjectParamsSchema = TenantParamsSchema.extend({
1611
1717
  var TenantProjectIdParamsSchema = TenantProjectParamsSchema.extend({
1612
1718
  id: resourceIdSchema
1613
1719
  }).openapi("TenantProjectIdParams");
1614
- var TenantProjectGraphParamsSchema = TenantProjectParamsSchema.extend({
1615
- graphId: GraphId
1616
- }).openapi("TenantProjectGraphParams");
1617
- var TenantProjectGraphIdParamsSchema = TenantProjectGraphParamsSchema.extend({
1720
+ var TenantProjectAgentParamsSchema = TenantProjectParamsSchema.extend({
1721
+ agentId: AgentId
1722
+ }).openapi("TenantProjectAgentParams");
1723
+ var TenantProjectAgentIdParamsSchema = TenantProjectAgentParamsSchema.extend({
1618
1724
  id: resourceIdSchema
1619
- }).openapi("TenantProjectGraphIdParams");
1620
- var TenantProjectGraphSubAgentParamsSchema = TenantProjectGraphParamsSchema.extend({
1725
+ }).openapi("TenantProjectAgentIdParams");
1726
+ var TenantProjectAgentSubAgentParamsSchema = TenantProjectAgentParamsSchema.extend({
1621
1727
  subAgentId: SubAgentId
1622
- }).openapi("TenantProjectGraphSubAgentParams");
1623
- var TenantProjectGraphSubAgentIdParamsSchema = TenantProjectGraphSubAgentParamsSchema.extend({
1728
+ }).openapi("TenantProjectAgentSubAgentParams");
1729
+ var TenantProjectAgentSubAgentIdParamsSchema = TenantProjectAgentSubAgentParamsSchema.extend({
1624
1730
  id: resourceIdSchema
1625
- }).openapi("TenantProjectGraphSubAgentIdParams");
1731
+ }).openapi("TenantProjectAgentSubAgentIdParams");
1626
1732
  var PaginationQueryParamsSchema = zodOpenapi.z.object({
1627
1733
  page: zodOpenapi.z.coerce.number().min(1).default(1),
1628
1734
  limit: zodOpenapi.z.coerce.number().min(1).max(100).default(10)
1629
1735
  });
1630
1736
 
1631
- // src/validation/graphFull.ts
1737
+ // src/validation/agentFull.ts
1632
1738
  function isInternalAgent(agent) {
1633
1739
  return "prompt" in agent;
1634
1740
  }
1635
1741
  function isExternalAgent(agent) {
1636
1742
  return "baseUrl" in agent;
1637
1743
  }
1638
- function validateAndTypeGraphData(data) {
1639
- return GraphWithinContextOfProjectSchema.parse(data);
1744
+ function validateAndTypeAgentData(data) {
1745
+ return AgentWithinContextOfProjectSchema.parse(data);
1640
1746
  }
1641
- function validateToolReferences(graphData, availableToolIds) {
1747
+ function validateToolReferences(agentData, availableToolIds) {
1642
1748
  if (!availableToolIds) {
1643
1749
  return;
1644
1750
  }
1645
1751
  const errors = [];
1646
- for (const [subAgentId, agentData] of Object.entries(graphData.subAgents)) {
1647
- if (isInternalAgent(agentData) && agentData.canUse && Array.isArray(agentData.canUse)) {
1648
- for (const canUseItem of agentData.canUse) {
1752
+ for (const [subAgentId, subAgent] of Object.entries(agentData.subAgents)) {
1753
+ if (isInternalAgent(subAgent) && subAgent.canUse && Array.isArray(subAgent.canUse)) {
1754
+ for (const canUseItem of subAgent.canUse) {
1649
1755
  if (!availableToolIds.has(canUseItem.toolId)) {
1650
1756
  errors.push(`Agent '${subAgentId}' references non-existent tool '${canUseItem.toolId}'`);
1651
1757
  }
@@ -1657,14 +1763,14 @@ function validateToolReferences(graphData, availableToolIds) {
1657
1763
  ${errors.join("\n")}`);
1658
1764
  }
1659
1765
  }
1660
- function validateDataComponentReferences(graphData, availableDataComponentIds) {
1766
+ function validateDataComponentReferences(agentData, availableDataComponentIds) {
1661
1767
  if (!availableDataComponentIds) {
1662
1768
  return;
1663
1769
  }
1664
1770
  const errors = [];
1665
- for (const [subAgentId, agentData] of Object.entries(graphData.subAgents)) {
1666
- if (isInternalAgent(agentData) && agentData.dataComponents) {
1667
- for (const dataComponentId of agentData.dataComponents) {
1771
+ for (const [subAgentId, subAgent] of Object.entries(agentData.subAgents)) {
1772
+ if (isInternalAgent(subAgent) && subAgent.dataComponents) {
1773
+ for (const dataComponentId of subAgent.dataComponents) {
1668
1774
  if (!availableDataComponentIds.has(dataComponentId)) {
1669
1775
  errors.push(
1670
1776
  `Agent '${subAgentId}' references non-existent dataComponent '${dataComponentId}'`
@@ -1678,14 +1784,14 @@ function validateDataComponentReferences(graphData, availableDataComponentIds) {
1678
1784
  ${errors.join("\n")}`);
1679
1785
  }
1680
1786
  }
1681
- function validateArtifactComponentReferences(graphData, availableArtifactComponentIds) {
1787
+ function validateArtifactComponentReferences(agentData, availableArtifactComponentIds) {
1682
1788
  if (!availableArtifactComponentIds) {
1683
1789
  return;
1684
1790
  }
1685
1791
  const errors = [];
1686
- for (const [subAgentId, agentData] of Object.entries(graphData.subAgents)) {
1687
- if (isInternalAgent(agentData) && agentData.artifactComponents) {
1688
- for (const artifactComponentId of agentData.artifactComponents) {
1792
+ for (const [subAgentId, subAgent] of Object.entries(agentData.subAgents)) {
1793
+ if (isInternalAgent(subAgent) && subAgent.artifactComponents) {
1794
+ for (const artifactComponentId of subAgent.artifactComponents) {
1689
1795
  if (!availableArtifactComponentIds.has(artifactComponentId)) {
1690
1796
  errors.push(
1691
1797
  `Agent '${subAgentId}' references non-existent artifactComponent '${artifactComponentId}'`
@@ -1699,25 +1805,25 @@ function validateArtifactComponentReferences(graphData, availableArtifactCompone
1699
1805
  ${errors.join("\n")}`);
1700
1806
  }
1701
1807
  }
1702
- function validateAgentRelationships(graphData) {
1808
+ function validateAgentRelationships(agentData) {
1703
1809
  const errors = [];
1704
- const availableAgentIds = new Set(Object.keys(graphData.subAgents));
1705
- for (const [subAgentId, agentData] of Object.entries(graphData.subAgents)) {
1706
- if (isInternalAgent(agentData)) {
1707
- if (agentData.canTransferTo && Array.isArray(agentData.canTransferTo)) {
1708
- for (const targetId of agentData.canTransferTo) {
1810
+ const availableAgentIds = new Set(Object.keys(agentData.subAgents));
1811
+ for (const [subAgentId, subAgent] of Object.entries(agentData.subAgents)) {
1812
+ if (isInternalAgent(subAgent)) {
1813
+ if (subAgent.canTransferTo && Array.isArray(subAgent.canTransferTo)) {
1814
+ for (const targetId of subAgent.canTransferTo) {
1709
1815
  if (!availableAgentIds.has(targetId)) {
1710
1816
  errors.push(
1711
- `Agent '${subAgentId}' has transfer target '${targetId}' that doesn't exist in graph`
1817
+ `Agent '${subAgentId}' has transfer target '${targetId}' that doesn't exist in agent`
1712
1818
  );
1713
1819
  }
1714
1820
  }
1715
1821
  }
1716
- if (agentData.canDelegateTo && Array.isArray(agentData.canDelegateTo)) {
1717
- for (const targetId of agentData.canDelegateTo) {
1822
+ if (subAgent.canDelegateTo && Array.isArray(subAgent.canDelegateTo)) {
1823
+ for (const targetId of subAgent.canDelegateTo) {
1718
1824
  if (!availableAgentIds.has(targetId)) {
1719
1825
  errors.push(
1720
- `Agent '${subAgentId}' has delegation target '${targetId}' that doesn't exist in graph`
1826
+ `Agent '${subAgentId}' has delegation target '${targetId}' that doesn't exist in agent`
1721
1827
  );
1722
1828
  }
1723
1829
  }
@@ -1729,16 +1835,16 @@ function validateAgentRelationships(graphData) {
1729
1835
  ${errors.join("\n")}`);
1730
1836
  }
1731
1837
  }
1732
- function validateGraphStructure(graphData, projectResources) {
1733
- if (graphData.defaultSubAgentId && !graphData.subAgents[graphData.defaultSubAgentId]) {
1734
- throw new Error(`Default agent '${graphData.defaultSubAgentId}' does not exist in agents`);
1838
+ function validateAgentStructure(agentData, projectResources) {
1839
+ if (agentData.defaultSubAgentId && !agentData.subAgents[agentData.defaultSubAgentId]) {
1840
+ throw new Error(`Default agent '${agentData.defaultSubAgentId}' does not exist in agents`);
1735
1841
  }
1736
1842
  if (projectResources) {
1737
- validateToolReferences(graphData, projectResources.toolIds);
1738
- validateDataComponentReferences(graphData, projectResources.dataComponentIds);
1739
- validateArtifactComponentReferences(graphData, projectResources.artifactComponentIds);
1843
+ validateToolReferences(agentData, projectResources.toolIds);
1844
+ validateDataComponentReferences(agentData, projectResources.dataComponentIds);
1845
+ validateArtifactComponentReferences(agentData, projectResources.artifactComponentIds);
1740
1846
  }
1741
- validateAgentRelationships(graphData);
1847
+ validateAgentRelationships(agentData);
1742
1848
  }
1743
1849
 
1744
1850
  // src/validation/id-validation.ts
@@ -1862,24 +1968,32 @@ function validatePropsAsJsonSchema(props) {
1862
1968
  }
1863
1969
 
1864
1970
  exports.A2AMessageMetadataSchema = A2AMessageMetadataSchema;
1865
- exports.AgentGraphApiInsertSchema = AgentGraphApiInsertSchema;
1866
- exports.AgentGraphApiSelectSchema = AgentGraphApiSelectSchema;
1867
- exports.AgentGraphApiUpdateSchema = AgentGraphApiUpdateSchema;
1868
- exports.AgentGraphInsertSchema = AgentGraphInsertSchema;
1869
- exports.AgentGraphSelectSchema = AgentGraphSelectSchema;
1870
- exports.AgentGraphUpdateSchema = AgentGraphUpdateSchema;
1971
+ exports.AgentApiInsertSchema = AgentApiInsertSchema;
1972
+ exports.AgentApiSelectSchema = AgentApiSelectSchema;
1973
+ exports.AgentApiUpdateSchema = AgentApiUpdateSchema;
1974
+ exports.AgentInsertSchema = AgentInsertSchema;
1975
+ exports.AgentListResponse = AgentListResponse;
1976
+ exports.AgentResponse = AgentResponse;
1977
+ exports.AgentSelectSchema = AgentSelectSchema;
1978
+ exports.AgentStopWhenSchema = AgentStopWhenSchema;
1979
+ exports.AgentUpdateSchema = AgentUpdateSchema;
1980
+ exports.AgentWithinContextOfProjectSchema = AgentWithinContextOfProjectSchema;
1871
1981
  exports.AllAgentSchema = AllAgentSchema;
1872
1982
  exports.ApiKeyApiCreationResponseSchema = ApiKeyApiCreationResponseSchema;
1873
1983
  exports.ApiKeyApiInsertSchema = ApiKeyApiInsertSchema;
1874
1984
  exports.ApiKeyApiSelectSchema = ApiKeyApiSelectSchema;
1875
1985
  exports.ApiKeyApiUpdateSchema = ApiKeyApiUpdateSchema;
1876
1986
  exports.ApiKeyInsertSchema = ApiKeyInsertSchema;
1987
+ exports.ApiKeyListResponse = ApiKeyListResponse;
1988
+ exports.ApiKeyResponse = ApiKeyResponse;
1877
1989
  exports.ApiKeySelectSchema = ApiKeySelectSchema;
1878
1990
  exports.ApiKeyUpdateSchema = ApiKeyUpdateSchema;
1879
1991
  exports.ArtifactComponentApiInsertSchema = ArtifactComponentApiInsertSchema;
1880
1992
  exports.ArtifactComponentApiSelectSchema = ArtifactComponentApiSelectSchema;
1881
1993
  exports.ArtifactComponentApiUpdateSchema = ArtifactComponentApiUpdateSchema;
1882
1994
  exports.ArtifactComponentInsertSchema = ArtifactComponentInsertSchema;
1995
+ exports.ArtifactComponentListResponse = ArtifactComponentListResponse;
1996
+ exports.ArtifactComponentResponse = ArtifactComponentResponse;
1883
1997
  exports.ArtifactComponentSelectSchema = ArtifactComponentSelectSchema;
1884
1998
  exports.ArtifactComponentUpdateSchema = ArtifactComponentUpdateSchema;
1885
1999
  exports.CanUseItemSchema = CanUseItemSchema;
@@ -1893,18 +2007,24 @@ exports.ContextConfigApiInsertSchema = ContextConfigApiInsertSchema;
1893
2007
  exports.ContextConfigApiSelectSchema = ContextConfigApiSelectSchema;
1894
2008
  exports.ContextConfigApiUpdateSchema = ContextConfigApiUpdateSchema;
1895
2009
  exports.ContextConfigInsertSchema = ContextConfigInsertSchema;
2010
+ exports.ContextConfigListResponse = ContextConfigListResponse;
2011
+ exports.ContextConfigResponse = ContextConfigResponse;
1896
2012
  exports.ContextConfigSelectSchema = ContextConfigSelectSchema;
1897
2013
  exports.ContextConfigUpdateSchema = ContextConfigUpdateSchema;
1898
2014
  exports.ConversationApiInsertSchema = ConversationApiInsertSchema;
1899
2015
  exports.ConversationApiSelectSchema = ConversationApiSelectSchema;
1900
2016
  exports.ConversationApiUpdateSchema = ConversationApiUpdateSchema;
1901
2017
  exports.ConversationInsertSchema = ConversationInsertSchema;
2018
+ exports.ConversationListResponse = ConversationListResponse;
2019
+ exports.ConversationResponse = ConversationResponse;
1902
2020
  exports.ConversationSelectSchema = ConversationSelectSchema;
1903
2021
  exports.ConversationUpdateSchema = ConversationUpdateSchema;
1904
2022
  exports.CredentialReferenceApiInsertSchema = CredentialReferenceApiInsertSchema;
1905
2023
  exports.CredentialReferenceApiSelectSchema = CredentialReferenceApiSelectSchema;
1906
2024
  exports.CredentialReferenceApiUpdateSchema = CredentialReferenceApiUpdateSchema;
1907
2025
  exports.CredentialReferenceInsertSchema = CredentialReferenceInsertSchema;
2026
+ exports.CredentialReferenceListResponse = CredentialReferenceListResponse;
2027
+ exports.CredentialReferenceResponse = CredentialReferenceResponse;
1908
2028
  exports.CredentialReferenceSelectSchema = CredentialReferenceSelectSchema;
1909
2029
  exports.CredentialReferenceUpdateSchema = CredentialReferenceUpdateSchema;
1910
2030
  exports.DataComponentApiInsertSchema = DataComponentApiInsertSchema;
@@ -1912,6 +2032,8 @@ exports.DataComponentApiSelectSchema = DataComponentApiSelectSchema;
1912
2032
  exports.DataComponentApiUpdateSchema = DataComponentApiUpdateSchema;
1913
2033
  exports.DataComponentBaseSchema = DataComponentBaseSchema;
1914
2034
  exports.DataComponentInsertSchema = DataComponentInsertSchema;
2035
+ exports.DataComponentListResponse = DataComponentListResponse;
2036
+ exports.DataComponentResponse = DataComponentResponse;
1915
2037
  exports.DataComponentSelectSchema = DataComponentSelectSchema;
1916
2038
  exports.DataComponentUpdateSchema = DataComponentUpdateSchema;
1917
2039
  exports.DataOperationDetailsSchema = DataOperationDetailsSchema;
@@ -1924,30 +2046,33 @@ exports.ExternalAgentApiInsertSchema = ExternalAgentApiInsertSchema;
1924
2046
  exports.ExternalAgentApiSelectSchema = ExternalAgentApiSelectSchema;
1925
2047
  exports.ExternalAgentApiUpdateSchema = ExternalAgentApiUpdateSchema;
1926
2048
  exports.ExternalAgentInsertSchema = ExternalAgentInsertSchema;
2049
+ exports.ExternalAgentListResponse = ExternalAgentListResponse;
2050
+ exports.ExternalAgentResponse = ExternalAgentResponse;
1927
2051
  exports.ExternalAgentSelectSchema = ExternalAgentSelectSchema;
1928
2052
  exports.ExternalAgentUpdateSchema = ExternalAgentUpdateSchema;
1929
2053
  exports.ExternalSubAgentRelationApiInsertSchema = ExternalSubAgentRelationApiInsertSchema;
1930
2054
  exports.ExternalSubAgentRelationInsertSchema = ExternalSubAgentRelationInsertSchema;
1931
2055
  exports.FetchConfigSchema = FetchConfigSchema;
1932
2056
  exports.FetchDefinitionSchema = FetchDefinitionSchema;
1933
- exports.FullGraphAgentInsertSchema = FullGraphAgentInsertSchema;
1934
- exports.FullGraphDefinitionSchema = FullGraphDefinitionSchema;
2057
+ exports.FullAgentAgentInsertSchema = FullAgentAgentInsertSchema;
1935
2058
  exports.FullProjectDefinitionSchema = FullProjectDefinitionSchema;
1936
2059
  exports.FunctionApiInsertSchema = FunctionApiInsertSchema;
1937
2060
  exports.FunctionApiSelectSchema = FunctionApiSelectSchema;
1938
2061
  exports.FunctionApiUpdateSchema = FunctionApiUpdateSchema;
1939
2062
  exports.FunctionInsertSchema = FunctionInsertSchema;
2063
+ exports.FunctionListResponse = FunctionListResponse;
2064
+ exports.FunctionResponse = FunctionResponse;
1940
2065
  exports.FunctionSelectSchema = FunctionSelectSchema;
1941
2066
  exports.FunctionToolApiInsertSchema = FunctionToolApiInsertSchema;
1942
2067
  exports.FunctionToolApiSelectSchema = FunctionToolApiSelectSchema;
1943
2068
  exports.FunctionToolApiUpdateSchema = FunctionToolApiUpdateSchema;
1944
2069
  exports.FunctionToolConfigSchema = FunctionToolConfigSchema;
1945
2070
  exports.FunctionToolInsertSchema = FunctionToolInsertSchema;
2071
+ exports.FunctionToolListResponse = FunctionToolListResponse;
2072
+ exports.FunctionToolResponse = FunctionToolResponse;
1946
2073
  exports.FunctionToolSelectSchema = FunctionToolSelectSchema;
1947
2074
  exports.FunctionToolUpdateSchema = FunctionToolUpdateSchema;
1948
2075
  exports.FunctionUpdateSchema = FunctionUpdateSchema;
1949
- exports.GraphStopWhenSchema = GraphStopWhenSchema;
1950
- exports.GraphWithinContextOfProjectSchema = GraphWithinContextOfProjectSchema;
1951
2076
  exports.HeadersScopeSchema = HeadersScopeSchema;
1952
2077
  exports.LedgerArtifactApiInsertSchema = LedgerArtifactApiInsertSchema;
1953
2078
  exports.LedgerArtifactApiSelectSchema = LedgerArtifactApiSelectSchema;
@@ -1966,6 +2091,8 @@ exports.MessageApiInsertSchema = MessageApiInsertSchema;
1966
2091
  exports.MessageApiSelectSchema = MessageApiSelectSchema;
1967
2092
  exports.MessageApiUpdateSchema = MessageApiUpdateSchema;
1968
2093
  exports.MessageInsertSchema = MessageInsertSchema;
2094
+ exports.MessageListResponse = MessageListResponse;
2095
+ exports.MessageResponse = MessageResponse;
1969
2096
  exports.MessageSelectSchema = MessageSelectSchema;
1970
2097
  exports.MessageUpdateSchema = MessageUpdateSchema;
1971
2098
  exports.ModelSchema = ModelSchema;
@@ -1976,7 +2103,9 @@ exports.ProjectApiInsertSchema = ProjectApiInsertSchema;
1976
2103
  exports.ProjectApiSelectSchema = ProjectApiSelectSchema;
1977
2104
  exports.ProjectApiUpdateSchema = ProjectApiUpdateSchema;
1978
2105
  exports.ProjectInsertSchema = ProjectInsertSchema;
2106
+ exports.ProjectListResponse = ProjectListResponse;
1979
2107
  exports.ProjectModelSchema = ProjectModelSchema;
2108
+ exports.ProjectResponse = ProjectResponse;
1980
2109
  exports.ProjectSelectSchema = ProjectSelectSchema;
1981
2110
  exports.ProjectUpdateSchema = ProjectUpdateSchema;
1982
2111
  exports.RemovedResponseSchema = RemovedResponseSchema;
@@ -1992,28 +2121,38 @@ exports.SubAgentArtifactComponentApiInsertSchema = SubAgentArtifactComponentApiI
1992
2121
  exports.SubAgentArtifactComponentApiSelectSchema = SubAgentArtifactComponentApiSelectSchema;
1993
2122
  exports.SubAgentArtifactComponentApiUpdateSchema = SubAgentArtifactComponentApiUpdateSchema;
1994
2123
  exports.SubAgentArtifactComponentInsertSchema = SubAgentArtifactComponentInsertSchema;
2124
+ exports.SubAgentArtifactComponentListResponse = SubAgentArtifactComponentListResponse;
2125
+ exports.SubAgentArtifactComponentResponse = SubAgentArtifactComponentResponse;
1995
2126
  exports.SubAgentArtifactComponentSelectSchema = SubAgentArtifactComponentSelectSchema;
1996
2127
  exports.SubAgentArtifactComponentUpdateSchema = SubAgentArtifactComponentUpdateSchema;
1997
2128
  exports.SubAgentDataComponentApiInsertSchema = SubAgentDataComponentApiInsertSchema;
1998
2129
  exports.SubAgentDataComponentApiSelectSchema = SubAgentDataComponentApiSelectSchema;
1999
2130
  exports.SubAgentDataComponentApiUpdateSchema = SubAgentDataComponentApiUpdateSchema;
2000
2131
  exports.SubAgentDataComponentInsertSchema = SubAgentDataComponentInsertSchema;
2132
+ exports.SubAgentDataComponentListResponse = SubAgentDataComponentListResponse;
2133
+ exports.SubAgentDataComponentResponse = SubAgentDataComponentResponse;
2001
2134
  exports.SubAgentDataComponentSelectSchema = SubAgentDataComponentSelectSchema;
2002
2135
  exports.SubAgentDataComponentUpdateSchema = SubAgentDataComponentUpdateSchema;
2003
2136
  exports.SubAgentInsertSchema = SubAgentInsertSchema;
2137
+ exports.SubAgentListResponse = SubAgentListResponse;
2004
2138
  exports.SubAgentRelationApiInsertSchema = SubAgentRelationApiInsertSchema;
2005
2139
  exports.SubAgentRelationApiSelectSchema = SubAgentRelationApiSelectSchema;
2006
2140
  exports.SubAgentRelationApiUpdateSchema = SubAgentRelationApiUpdateSchema;
2007
2141
  exports.SubAgentRelationInsertSchema = SubAgentRelationInsertSchema;
2142
+ exports.SubAgentRelationListResponse = SubAgentRelationListResponse;
2008
2143
  exports.SubAgentRelationQuerySchema = SubAgentRelationQuerySchema;
2144
+ exports.SubAgentRelationResponse = SubAgentRelationResponse;
2009
2145
  exports.SubAgentRelationSelectSchema = SubAgentRelationSelectSchema;
2010
2146
  exports.SubAgentRelationUpdateSchema = SubAgentRelationUpdateSchema;
2147
+ exports.SubAgentResponse = SubAgentResponse;
2011
2148
  exports.SubAgentSelectSchema = SubAgentSelectSchema;
2012
2149
  exports.SubAgentStopWhenSchema = SubAgentStopWhenSchema;
2013
2150
  exports.SubAgentToolRelationApiInsertSchema = SubAgentToolRelationApiInsertSchema;
2014
2151
  exports.SubAgentToolRelationApiSelectSchema = SubAgentToolRelationApiSelectSchema;
2015
2152
  exports.SubAgentToolRelationApiUpdateSchema = SubAgentToolRelationApiUpdateSchema;
2016
2153
  exports.SubAgentToolRelationInsertSchema = SubAgentToolRelationInsertSchema;
2154
+ exports.SubAgentToolRelationListResponse = SubAgentToolRelationListResponse;
2155
+ exports.SubAgentToolRelationResponse = SubAgentToolRelationResponse;
2017
2156
  exports.SubAgentToolRelationSelectSchema = SubAgentToolRelationSelectSchema;
2018
2157
  exports.SubAgentToolRelationUpdateSchema = SubAgentToolRelationUpdateSchema;
2019
2158
  exports.SubAgentUpdateSchema = SubAgentUpdateSchema;
@@ -2031,16 +2170,18 @@ exports.TaskSelectSchema = TaskSelectSchema;
2031
2170
  exports.TaskUpdateSchema = TaskUpdateSchema;
2032
2171
  exports.TenantIdParamsSchema = TenantIdParamsSchema;
2033
2172
  exports.TenantParamsSchema = TenantParamsSchema;
2034
- exports.TenantProjectGraphIdParamsSchema = TenantProjectGraphIdParamsSchema;
2035
- exports.TenantProjectGraphParamsSchema = TenantProjectGraphParamsSchema;
2036
- exports.TenantProjectGraphSubAgentIdParamsSchema = TenantProjectGraphSubAgentIdParamsSchema;
2037
- exports.TenantProjectGraphSubAgentParamsSchema = TenantProjectGraphSubAgentParamsSchema;
2173
+ exports.TenantProjectAgentIdParamsSchema = TenantProjectAgentIdParamsSchema;
2174
+ exports.TenantProjectAgentParamsSchema = TenantProjectAgentParamsSchema;
2175
+ exports.TenantProjectAgentSubAgentIdParamsSchema = TenantProjectAgentSubAgentIdParamsSchema;
2176
+ exports.TenantProjectAgentSubAgentParamsSchema = TenantProjectAgentSubAgentParamsSchema;
2038
2177
  exports.TenantProjectIdParamsSchema = TenantProjectIdParamsSchema;
2039
2178
  exports.TenantProjectParamsSchema = TenantProjectParamsSchema;
2040
2179
  exports.ToolApiInsertSchema = ToolApiInsertSchema;
2041
2180
  exports.ToolApiSelectSchema = ToolApiSelectSchema;
2042
2181
  exports.ToolApiUpdateSchema = ToolApiUpdateSchema;
2043
2182
  exports.ToolInsertSchema = ToolInsertSchema;
2183
+ exports.ToolListResponse = ToolListResponse;
2184
+ exports.ToolResponse = ToolResponse;
2044
2185
  exports.ToolSelectSchema = ToolSelectSchema;
2045
2186
  exports.ToolStatusSchema = ToolStatusSchema;
2046
2187
  exports.ToolUpdateSchema = ToolUpdateSchema;
@@ -2052,9 +2193,9 @@ exports.isInternalAgent = isInternalAgent;
2052
2193
  exports.isValidResourceId = isValidResourceId;
2053
2194
  exports.resourceIdSchema = resourceIdSchema;
2054
2195
  exports.validateAgentRelationships = validateAgentRelationships;
2055
- exports.validateAndTypeGraphData = validateAndTypeGraphData;
2196
+ exports.validateAgentStructure = validateAgentStructure;
2197
+ exports.validateAndTypeAgentData = validateAndTypeAgentData;
2056
2198
  exports.validateArtifactComponentReferences = validateArtifactComponentReferences;
2057
2199
  exports.validateDataComponentReferences = validateDataComponentReferences;
2058
- exports.validateGraphStructure = validateGraphStructure;
2059
2200
  exports.validatePropsAsJsonSchema = validatePropsAsJsonSchema;
2060
2201
  exports.validateToolReferences = validateToolReferences;