@inkeep/agents-core 0.8.7 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { TaskState } from './chunk-H2F72PDA.js';
2
- import { validateAndTypeGraphData, validateGraphStructure, isInternalAgent, isExternalAgent } from './chunk-GPGFF2K4.js';
3
- export { generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './chunk-GPGFF2K4.js';
4
- import { ContextConfigApiUpdateSchema } from './chunk-AX77SEE3.js';
5
- export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentArtifactComponentApiInsertSchema, AgentArtifactComponentApiSelectSchema, AgentArtifactComponentApiUpdateSchema, AgentArtifactComponentInsertSchema, AgentArtifactComponentSelectSchema, AgentArtifactComponentUpdateSchema, AgentDataComponentApiInsertSchema, AgentDataComponentApiSelectSchema, AgentDataComponentApiUpdateSchema, AgentDataComponentInsertSchema, AgentDataComponentSelectSchema, AgentDataComponentUpdateSchema, AgentGraphApiInsertSchema, AgentGraphApiSelectSchema, AgentGraphApiUpdateSchema, AgentGraphInsertSchema, AgentGraphSelectSchema, AgentGraphUpdateSchema, AgentInsertSchema, AgentRelationApiInsertSchema, AgentRelationApiSelectSchema, AgentRelationApiUpdateSchema, AgentRelationInsertSchema, AgentRelationQuerySchema, AgentRelationSelectSchema, AgentRelationUpdateSchema, AgentSelectSchema, AgentStopWhenSchema, AgentToolRelationApiInsertSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiUpdateSchema, AgentToolRelationInsertSchema, AgentToolRelationSelectSchema, AgentToolRelationUpdateSchema, AgentUpdateSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentRelationApiInsertSchema, ExternalAgentRelationInsertSchema, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, FullProjectDefinitionSchema, GraphStopWhenSchema, GraphWithinContextOfProjectSchema, HeadersScopeSchema, IdParamsSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectModelSchema, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectGraphIdParamsSchema, TenantProjectGraphParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, resourceIdSchema } from './chunk-AX77SEE3.js';
2
+ import { validateAndTypeGraphData, validateGraphStructure, isInternalAgent, isExternalAgent } from './chunk-YVGNJIQZ.js';
3
+ export { generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './chunk-YVGNJIQZ.js';
4
+ import { ContextConfigApiUpdateSchema } from './chunk-JXAL2ALG.js';
5
+ export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentArtifactComponentApiInsertSchema, AgentArtifactComponentApiSelectSchema, AgentArtifactComponentApiUpdateSchema, AgentArtifactComponentInsertSchema, AgentArtifactComponentSelectSchema, AgentArtifactComponentUpdateSchema, AgentDataComponentApiInsertSchema, AgentDataComponentApiSelectSchema, AgentDataComponentApiUpdateSchema, AgentDataComponentInsertSchema, AgentDataComponentSelectSchema, AgentDataComponentUpdateSchema, AgentGraphApiInsertSchema, AgentGraphApiSelectSchema, AgentGraphApiUpdateSchema, AgentGraphInsertSchema, AgentGraphSelectSchema, AgentGraphUpdateSchema, AgentInsertSchema, AgentRelationApiInsertSchema, AgentRelationApiSelectSchema, AgentRelationApiUpdateSchema, AgentRelationInsertSchema, AgentRelationQuerySchema, AgentRelationSelectSchema, AgentRelationUpdateSchema, AgentSelectSchema, AgentStopWhenSchema, AgentToolRelationApiInsertSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiUpdateSchema, AgentToolRelationInsertSchema, AgentToolRelationSelectSchema, AgentToolRelationUpdateSchema, AgentUpdateSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentRelationApiInsertSchema, ExternalAgentRelationInsertSchema, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, FullProjectDefinitionSchema, GraphStopWhenSchema, GraphWithinContextOfProjectSchema, HeadersScopeSchema, IdParamsSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectModelSchema, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectGraphIdParamsSchema, TenantProjectGraphParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, resourceIdSchema } from './chunk-JXAL2ALG.js';
6
6
  import { schema_exports, agentRelations, agents, externalAgents, agentToolRelations, tools, contextConfigs, agentGraph, agentDataComponents, agentArtifactComponents, dataComponents, artifactComponents, projects, apiKeys, contextCache, conversations, messages, credentialReferences, ledgerArtifacts, tasks, taskRelations } from './chunk-URSDNK76.js';
7
7
  export { agentArtifactComponents, agentArtifactComponentsRelations, agentDataComponents, agentDataComponentsRelations, agentGraph, agentGraphRelations, agentRelations, agentRelationsRelations, agentToolRelations, agentToolRelationsRelations, agents, agentsRelations, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, ledgerArtifacts, ledgerArtifactsContextIdIdx, ledgerArtifactsRelations, ledgerArtifactsTaskContextNameUnique, ledgerArtifactsTaskIdIdx, ledgerArtifactsToolCallIdIdx, messages, messagesRelations, projects, projectsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-URSDNK76.js';
8
8
  import { CredentialStoreType, MCPServerType, MCPTransportType } from './chunk-YFHT5M2R.js';
@@ -14,7 +14,7 @@ import pinoPretty from 'pino-pretty';
14
14
  import jmespath from 'jmespath';
15
15
  import { createClient } from '@libsql/client';
16
16
  import { drizzle } from 'drizzle-orm/libsql';
17
- import { and, eq, desc, count, isNotNull, inArray, sql, asc } from 'drizzle-orm';
17
+ import { and, eq, desc, count, isNotNull, inArray, sql, asc, not } from 'drizzle-orm';
18
18
  import { customAlphabet, nanoid } from 'nanoid';
19
19
  import crypto, { scrypt, randomBytes, timingSafeEqual } from 'crypto';
20
20
  import { promisify } from 'util';
@@ -2071,7 +2071,8 @@ var getFullGraphDefinition = (db) => async ({
2071
2071
  projectId: tools.projectId,
2072
2072
  imageUrl: tools.imageUrl,
2073
2073
  selectedTools: agentToolRelations.selectedTools,
2074
- headers: agentToolRelations.headers
2074
+ headers: agentToolRelations.headers,
2075
+ agentToolRelationId: agentToolRelations.id
2075
2076
  }).from(agentToolRelations).innerJoin(
2076
2077
  tools,
2077
2078
  and(
@@ -2104,6 +2105,7 @@ var getFullGraphDefinition = (db) => async ({
2104
2105
  (rel) => rel.artifactComponentId
2105
2106
  );
2106
2107
  const canUse = agentTools.map((tool2) => ({
2108
+ agentToolRelationId: tool2.agentToolRelationId,
2107
2109
  toolId: tool2.id,
2108
2110
  toolSelection: tool2.selectedTools || null,
2109
2111
  headers: tool2.headers || null
@@ -4322,28 +4324,19 @@ var removeToolFromAgent = (db) => async (params) => {
4322
4324
  return deleted;
4323
4325
  };
4324
4326
  var upsertAgentToolRelation = (db) => async (params) => {
4325
- const existing = await db.query.agentToolRelations.findFirst({
4326
- where: and(
4327
- eq(agentToolRelations.tenantId, params.scopes.tenantId),
4328
- eq(agentToolRelations.projectId, params.scopes.projectId),
4329
- eq(agentToolRelations.graphId, params.scopes.graphId),
4330
- eq(agentToolRelations.agentId, params.agentId),
4331
- eq(agentToolRelations.toolId, params.toolId)
4332
- )
4333
- });
4334
- if (!existing) {
4335
- return await addToolToAgent(db)(params);
4327
+ if (params.relationId) {
4328
+ return await updateAgentToolRelation(db)({
4329
+ scopes: params.scopes,
4330
+ relationId: params.relationId,
4331
+ data: {
4332
+ agentId: params.agentId,
4333
+ toolId: params.toolId,
4334
+ selectedTools: params.selectedTools,
4335
+ headers: params.headers
4336
+ }
4337
+ });
4336
4338
  }
4337
- return await updateAgentToolRelation(db)({
4338
- scopes: params.scopes,
4339
- relationId: existing.id,
4340
- data: {
4341
- agentId: params.agentId,
4342
- toolId: params.toolId,
4343
- selectedTools: params.selectedTools,
4344
- headers: params.headers
4345
- }
4346
- });
4339
+ return await addToolToAgent(db)(params);
4347
4340
  };
4348
4341
  var upsertTool = (db) => async (params) => {
4349
4342
  const scopes = { tenantId: params.data.tenantId, projectId: params.data.projectId };
@@ -4602,14 +4595,15 @@ var createFullGraphServerSide = (db, logger12 = defaultLogger) => async (scopes,
4602
4595
  agentToolPromises.push(
4603
4596
  (async () => {
4604
4597
  try {
4605
- const { toolId, toolSelection, headers } = canUseItem;
4598
+ const { toolId, toolSelection, headers, agentToolRelationId } = canUseItem;
4606
4599
  logger12.info({ agentId, toolId }, "Processing agent-tool relation");
4607
4600
  await upsertAgentToolRelation(db)({
4608
4601
  scopes: { tenantId, projectId, graphId: finalGraphId },
4609
4602
  agentId,
4610
4603
  toolId,
4611
4604
  selectedTools: toolSelection || void 0,
4612
- headers: headers || void 0
4605
+ headers: headers || void 0,
4606
+ relationId: agentToolRelationId
4613
4607
  });
4614
4608
  logger12.info({ agentId, toolId }, "Agent-tool relation processed successfully");
4615
4609
  } catch (error) {
@@ -4973,6 +4967,53 @@ var updateFullGraphServerSide = (db, logger12 = defaultLogger) => async (scopes,
4973
4967
  ([_, agentData]) => isExternalAgent(agentData)
4974
4968
  ).length;
4975
4969
  logger12.info({ externalAgentCount }, "All external agents created/updated successfully");
4970
+ const incomingAgentIds = new Set(Object.keys(typedGraphDefinition.agents));
4971
+ const existingInternalAgents = await listAgents(db)({
4972
+ scopes: { tenantId, projectId, graphId: finalGraphId }
4973
+ });
4974
+ const existingExternalAgents = await listExternalAgents(db)({
4975
+ scopes: { tenantId, projectId, graphId: finalGraphId }
4976
+ });
4977
+ let deletedInternalCount = 0;
4978
+ for (const agent of existingInternalAgents) {
4979
+ if (!incomingAgentIds.has(agent.id)) {
4980
+ try {
4981
+ await deleteAgent(db)({
4982
+ scopes: { tenantId, projectId, graphId: finalGraphId },
4983
+ agentId: agent.id
4984
+ });
4985
+ deletedInternalCount++;
4986
+ logger12.info({ agentId: agent.id }, "Deleted orphaned internal agent");
4987
+ } catch (error) {
4988
+ logger12.error({ agentId: agent.id, error }, "Failed to delete orphaned internal agent");
4989
+ }
4990
+ }
4991
+ }
4992
+ let deletedExternalCount = 0;
4993
+ for (const agent of existingExternalAgents) {
4994
+ if (!incomingAgentIds.has(agent.id)) {
4995
+ try {
4996
+ await deleteExternalAgent(db)({
4997
+ scopes: { tenantId, projectId, graphId: finalGraphId },
4998
+ agentId: agent.id
4999
+ });
5000
+ deletedExternalCount++;
5001
+ logger12.info({ agentId: agent.id }, "Deleted orphaned external agent");
5002
+ } catch (error) {
5003
+ logger12.error({ agentId: agent.id, error }, "Failed to delete orphaned external agent");
5004
+ }
5005
+ }
5006
+ }
5007
+ if (deletedInternalCount > 0 || deletedExternalCount > 0) {
5008
+ logger12.info(
5009
+ {
5010
+ deletedInternalCount,
5011
+ deletedExternalCount,
5012
+ totalDeleted: deletedInternalCount + deletedExternalCount
5013
+ },
5014
+ "Deleted orphaned agents from graph"
5015
+ );
5016
+ }
4976
5017
  await updateAgentGraph(db)({
4977
5018
  scopes: { tenantId, projectId, graphId: typedGraphDefinition.id },
4978
5019
  data: {
@@ -4987,10 +5028,47 @@ var updateFullGraphServerSide = (db, logger12 = defaultLogger) => async (scopes,
4987
5028
  }
4988
5029
  });
4989
5030
  logger12.info({ graphId: typedGraphDefinition.id }, "Graph metadata updated");
5031
+ const incomingRelationshipIds = /* @__PURE__ */ new Set();
5032
+ for (const [_agentId, agentData] of Object.entries(typedGraphDefinition.agents)) {
5033
+ if (isInternalAgent(agentData) && agentData.canUse && Array.isArray(agentData.canUse)) {
5034
+ for (const canUseItem of agentData.canUse) {
5035
+ if (canUseItem.agentToolRelationId) {
5036
+ incomingRelationshipIds.add(canUseItem.agentToolRelationId);
5037
+ }
5038
+ }
5039
+ }
5040
+ }
4990
5041
  for (const agentId of Object.keys(typedGraphDefinition.agents)) {
4991
- await deleteAgentToolRelationByAgent(db)({
4992
- scopes: { tenantId, projectId, graphId: finalGraphId, agentId }
4993
- });
5042
+ try {
5043
+ let deletedCount = 0;
5044
+ if (incomingRelationshipIds.size === 0) {
5045
+ const result = await db.delete(agentToolRelations).where(
5046
+ and(
5047
+ eq(agentToolRelations.tenantId, tenantId),
5048
+ eq(agentToolRelations.projectId, projectId),
5049
+ eq(agentToolRelations.graphId, finalGraphId),
5050
+ eq(agentToolRelations.agentId, agentId)
5051
+ )
5052
+ );
5053
+ deletedCount = result.rowsAffected || 0;
5054
+ } else {
5055
+ const result = await db.delete(agentToolRelations).where(
5056
+ and(
5057
+ eq(agentToolRelations.tenantId, tenantId),
5058
+ eq(agentToolRelations.projectId, projectId),
5059
+ eq(agentToolRelations.graphId, finalGraphId),
5060
+ eq(agentToolRelations.agentId, agentId),
5061
+ not(inArray(agentToolRelations.id, Array.from(incomingRelationshipIds)))
5062
+ )
5063
+ );
5064
+ deletedCount = result.rowsAffected || 0;
5065
+ }
5066
+ if (deletedCount > 0) {
5067
+ logger12.info({ agentId, deletedCount }, "Deleted orphaned agent-tool relations");
5068
+ }
5069
+ } catch (error) {
5070
+ logger12.error({ agentId, error }, "Failed to delete orphaned agent-tool relations");
5071
+ }
4994
5072
  }
4995
5073
  const agentToolPromises = [];
4996
5074
  for (const [agentId, agentData] of Object.entries(typedGraphDefinition.agents)) {
@@ -4999,21 +5077,28 @@ var updateFullGraphServerSide = (db, logger12 = defaultLogger) => async (scopes,
4999
5077
  agentToolPromises.push(
5000
5078
  (async () => {
5001
5079
  try {
5002
- const { toolId, toolSelection, headers } = canUseItem;
5003
- await createAgentToolRelation(db)({
5080
+ const { toolId, toolSelection, headers, agentToolRelationId } = canUseItem;
5081
+ await upsertAgentToolRelation(db)({
5004
5082
  scopes: { tenantId, projectId, graphId: finalGraphId },
5005
- data: {
5006
- agentId,
5007
- toolId,
5008
- selectedTools: toolSelection || void 0,
5009
- headers: headers || void 0
5010
- }
5083
+ agentId,
5084
+ toolId,
5085
+ selectedTools: toolSelection || void 0,
5086
+ headers: headers || void 0,
5087
+ relationId: agentToolRelationId
5011
5088
  });
5012
- logger12.info({ agentId, toolId }, "Agent-tool relation created");
5089
+ logger12.info(
5090
+ { agentId, toolId, relationId: agentToolRelationId },
5091
+ "Agent-tool relation upserted"
5092
+ );
5013
5093
  } catch (error) {
5014
5094
  logger12.error(
5015
- { agentId, toolId: canUseItem.toolId, error },
5016
- "Failed to create agent-tool relation"
5095
+ {
5096
+ agentId,
5097
+ toolId: canUseItem.toolId,
5098
+ relationId: canUseItem.agentToolRelationId,
5099
+ error
5100
+ },
5101
+ "Failed to upsert agent-tool relation"
5017
5102
  );
5018
5103
  }
5019
5104
  })()
@@ -6377,6 +6462,36 @@ var updateFullProjectServerSide = (db, logger12 = defaultLogger2) => async (scop
6377
6462
  "All project artifactComponents updated successfully"
6378
6463
  );
6379
6464
  }
6465
+ const incomingGraphIds = new Set(Object.keys(typed.graphs || {}));
6466
+ const existingGraphs = await listAgentGraphs(db)({
6467
+ scopes: { tenantId, projectId: typed.id }
6468
+ });
6469
+ let deletedGraphCount = 0;
6470
+ for (const graph of existingGraphs) {
6471
+ if (!incomingGraphIds.has(graph.id)) {
6472
+ try {
6473
+ await deleteFullGraph(db, logger12)({
6474
+ scopes: { tenantId, projectId: typed.id, graphId: graph.id }
6475
+ });
6476
+ deletedGraphCount++;
6477
+ logger12.info({ graphId: graph.id }, "Deleted orphaned graph from project");
6478
+ } catch (error) {
6479
+ logger12.error(
6480
+ { graphId: graph.id, error },
6481
+ "Failed to delete orphaned graph from project"
6482
+ );
6483
+ }
6484
+ }
6485
+ }
6486
+ if (deletedGraphCount > 0) {
6487
+ logger12.info(
6488
+ {
6489
+ deletedGraphCount,
6490
+ projectId: typed.id
6491
+ },
6492
+ "Deleted orphaned graphs from project"
6493
+ );
6494
+ }
6380
6495
  if (typed.graphs && Object.keys(typed.graphs).length > 0) {
6381
6496
  logger12.info(
6382
6497
  {
@@ -1,6 +1,6 @@
1
1
  import * as drizzle_orm from 'drizzle-orm';
2
2
  import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
3
- import { f as ContextFetchDefinition, C as ConversationHistoryConfig, T as TaskMetadataConfig, g as ToolMcpConfig, h as ToolServerCapabilities, i as ConversationMetadata, j as MessageContent, k as MessageMetadata, P as Part } from './utility-DP6lt8z3.cjs';
3
+ import { f as ContextFetchDefinition, C as ConversationHistoryConfig, T as TaskMetadataConfig, g as ToolMcpConfig, h as ToolServerCapabilities, i as ConversationMetadata, j as MessageContent, k as MessageMetadata, P as Part } from './utility-8RXSemmL.cjs';
4
4
 
5
5
  declare const projects: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
6
6
  name: "projects";
@@ -1,6 +1,6 @@
1
1
  import * as drizzle_orm from 'drizzle-orm';
2
2
  import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
3
- import { f as ContextFetchDefinition, C as ConversationHistoryConfig, T as TaskMetadataConfig, g as ToolMcpConfig, h as ToolServerCapabilities, i as ConversationMetadata, j as MessageContent, k as MessageMetadata, P as Part } from './utility-DP6lt8z3.js';
3
+ import { f as ContextFetchDefinition, C as ConversationHistoryConfig, T as TaskMetadataConfig, g as ToolMcpConfig, h as ToolServerCapabilities, i as ConversationMetadata, j as MessageContent, k as MessageMetadata, P as Part } from './utility-8RXSemmL.js';
4
4
 
5
5
  declare const projects: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
6
6
  name: "projects";
@@ -1,5 +1,5 @@
1
- import { e as CredentialStoreType } from '../utility-DP6lt8z3.cjs';
2
- export { b0 as A2AError, bw as A2ARequest, bx as A2AResponse, aB as APIKeySecurityScheme, bB as AgentApiInsert, bA as AgentApiSelect, bC as AgentApiUpdate, cu as AgentArtifactComponentApiInsert, ct as AgentArtifactComponentApiSelect, cv as AgentArtifactComponentApiUpdate, cr as AgentArtifactComponentInsert, cq as AgentArtifactComponentSelect, cs as AgentArtifactComponentUpdate, ax as AgentCapabilities, aL as AgentCard, d7 as AgentConversationHistoryConfig, cl as AgentDataComponentApiInsert, ck as AgentDataComponentApiSelect, cm as AgentDataComponentApiUpdate, ci as AgentDataComponentInsert, ch as AgentDataComponentSelect, cj as AgentDataComponentUpdate, cT as AgentDefinition, bL as AgentGraphApiInsert, bK as AgentGraphApiSelect, bM as AgentGraphApiUpdate, r as AgentGraphInsert, bJ as AgentGraphSelect, s as AgentGraphUpdate, y as AgentInsert, ay as AgentProvider, bF as AgentRelationApiInsert, bE as AgentRelationApiSelect, bG as AgentRelationApiUpdate, v as AgentRelationInsert, bH as AgentRelationQuery, bD as AgentRelationSelect, w as AgentRelationUpdate, u as AgentScopeConfig, B as AgentSelect, az as AgentSkill, cJ as AgentToolRelationApiInsert, cI as AgentToolRelationApiSelect, cK as AgentToolRelationApiUpdate, cH as AgentToolRelationInsert, cG as AgentToolRelationSelect, x as AgentToolRelationUpdate, z as AgentUpdate, cz as AllAgentSelect, cD as ApiKeyApiCreationResponse, cB as ApiKeyApiInsert, cA as ApiKeyApiSelect, cC as ApiKeyApiUpdate, K as ApiKeyCreateResult, H as ApiKeyInsert, D as ApiKeySelect, I as ApiKeyUpdate, a7 as Artifact, co as ArtifactComponentApiInsert, cn as ArtifactComponentApiSelect, cp as ArtifactComponentApiUpdate, N as ArtifactComponentInsert, L as ArtifactComponentSelect, O as ArtifactComponentUpdate, aE as AuthorizationCodeOAuthFlow, cR as CanUseItem, bg as CancelTaskRequest, br as CancelTaskResponse, bq as CancelTaskSuccessResponse, aF as ClientCredentialsOAuthFlow, a_ as ContentTypeNotSupportedError, cc as ContextCacheApiInsert, cb as ContextCacheApiSelect, cd as ContextCacheApiUpdate, d8 as ContextCacheEntry, R as ContextCacheInsert, Q as ContextCacheSelect, ca as ContextCacheUpdate, c6 as ContextConfigApiInsert, c5 as ContextConfigApiSelect, c7 as ContextConfigApiUpdate, U as ContextConfigInsert, m as ContextConfigSelect, V as ContextConfigUpdate, f as ContextFetchDefinition, b$ as ConversationApiInsert, b_ as ConversationApiSelect, c0 as ConversationApiUpdate, C as ConversationHistoryConfig, X as ConversationInsert, i as ConversationMetadata, d6 as ConversationScopeOptions, W as ConversationSelect, Y as ConversationUpdate, J as CreateApiKeyParams, l as CredentialReferenceApiInsert, cE as CredentialReferenceApiSelect, cF as CredentialReferenceApiUpdate, $ as CredentialReferenceInsert, Z as CredentialReferenceSelect, a0 as CredentialReferenceUpdate, cf as DataComponentApiInsert, ce as DataComponentApiSelect, cg as DataComponentApiUpdate, a2 as DataComponentInsert, a1 as DataComponentSelect, a3 as DataComponentUpdate, av as DataPart, ao as ExecutionContext, cx as ExternalAgentApiInsert, cw as ExternalAgentApiSelect, cy as ExternalAgentApiUpdate, a4 as ExternalAgentInsert, bI as ExternalAgentRelationApiInsert, E as ExternalAgentRelationInsert, a5 as ExternalAgentSelect, a6 as ExternalAgentUpdate, c9 as FetchConfig, c8 as FetchDefinition, ar as FileBase, au as FilePart, as as FileWithBytes, at as FileWithUri, cQ as FullGraphAgentInsert, t as FullGraphDefinition, ac as FullProjectDefinition, bi as GetTaskPushNotificationConfigRequest, bv as GetTaskPushNotificationConfigResponse, bu as GetTaskPushNotificationConfigSuccessResponse, bf as GetTaskRequest, bp as GetTaskResponse, bo as GetTaskSuccessResponse, o as GraphScopeConfig, aC as HTTPAuthSecurityScheme, aG as ImplicitOAuthFlow, cS as InternalAgentDefinition, aV as InternalError, a$ as InvalidAgentResponseError, aU as InvalidParamsError, aS as InvalidRequestError, aR as JSONParseError, ba as JSONRPCError, bc as JSONRPCErrorResponse, b8 as JSONRPCMessage, b9 as JSONRPCRequest, bb as JSONRPCResult, cO as LedgerArtifactApiInsert, cN as LedgerArtifactApiSelect, cP as LedgerArtifactApiUpdate, cL as LedgerArtifactInsert, a8 as LedgerArtifactSelect, cM as LedgerArtifactUpdate, dg as MCPServerType, n as MCPToolConfig, M as MCPTransportType, d9 as McpAuthType, da as McpServerAuth, dc as McpServerCapabilities, al as McpTool, dd as McpToolDefinition, db as McpTransportConfig, aM as Message, c3 as MessageApiInsert, c2 as MessageApiSelect, c4 as MessageApiUpdate, j as MessageContent, aa as MessageInsert, k as MessageMetadata, d0 as MessageMode, by as MessagePart, c$ as MessageRole, c1 as MessageSelect, b6 as MessageSendConfiguration, b7 as MessageSendParams, c_ as MessageType, ab as MessageUpdate, a9 as MessageVisibility, aT as MethodNotFoundError, d3 as ModelSettings, d1 as Models, aI as OAuth2SecurityScheme, aD as OAuthFlows, aJ as OpenIdConnectSecurityScheme, cY as Pagination, q as PaginationConfig, af as PaginationResult, P as Part, ap as PartBase, aH as PasswordOAuthFlow, cW as ProjectApiInsert, cV as ProjectApiSelect, cX as ProjectApiUpdate, ad as ProjectInfo, ah as ProjectInsert, d2 as ProjectModels, ag as ProjectResourceCounts, p as ProjectScopeConfig, ae as ProjectSelect, ai as ProjectUpdate, b1 as PushNotificationAuthenticationInfo, b2 as PushNotificationConfig, aY as PushNotificationNotSupportedError, aK as SecurityScheme, aA as SecuritySchemeBase, bd as SendMessageRequest, bl as SendMessageResponse, bk as SendMessageSuccessResponse, be as SendStreamingMessageRequest, bn as SendStreamingMessageResponse, bm as SendStreamingMessageSuccessResponse, bh as SetTaskPushNotificationConfigRequest, bt as SetTaskPushNotificationConfigResponse, bs as SetTaskPushNotificationConfigSuccessResponse, d5 as StatusComponent, d4 as StatusUpdateSettings, cZ as SummaryEvent, de as TOOL_STATUS_VALUES, aO as Task, bP as TaskApiInsert, bO as TaskApiSelect, bQ as TaskApiUpdate, bz as TaskArtifact, aQ as TaskArtifactUpdateEvent, b4 as TaskIdParams, aj as TaskInsert, T as TaskMetadataConfig, aX as TaskNotCancelableError, aW as TaskNotFoundError, b3 as TaskPushNotificationConfig, b5 as TaskQueryParams, bV as TaskRelationApiInsert, bU as TaskRelationApiSelect, bW as TaskRelationApiUpdate, bS as TaskRelationInsert, bR as TaskRelationSelect, bT as TaskRelationUpdate, bj as TaskResubscriptionRequest, ak as TaskSelect, aw as TaskState, aN as TaskStatus, aP as TaskStatusUpdateEvent, bN as TaskUpdate, aq as TextPart, bY as ToolApiInsert, bX as ToolApiSelect, bZ as ToolApiUpdate, cU as ToolDefinition, am as ToolInsert, g as ToolMcpConfig, _ as ToolSelect, h as ToolServerCapabilities, an as ToolUpdate, aZ as UnsupportedOperationError, df as VALID_RELATION_TYPES } from '../utility-DP6lt8z3.cjs';
1
+ import { e as CredentialStoreType } from '../utility-8RXSemmL.cjs';
2
+ export { b0 as A2AError, bw as A2ARequest, bx as A2AResponse, aB as APIKeySecurityScheme, bB as AgentApiInsert, bA as AgentApiSelect, bC as AgentApiUpdate, cu as AgentArtifactComponentApiInsert, ct as AgentArtifactComponentApiSelect, cv as AgentArtifactComponentApiUpdate, cr as AgentArtifactComponentInsert, cq as AgentArtifactComponentSelect, cs as AgentArtifactComponentUpdate, ax as AgentCapabilities, aL as AgentCard, d7 as AgentConversationHistoryConfig, cl as AgentDataComponentApiInsert, ck as AgentDataComponentApiSelect, cm as AgentDataComponentApiUpdate, ci as AgentDataComponentInsert, ch as AgentDataComponentSelect, cj as AgentDataComponentUpdate, cT as AgentDefinition, bL as AgentGraphApiInsert, bK as AgentGraphApiSelect, bM as AgentGraphApiUpdate, r as AgentGraphInsert, bJ as AgentGraphSelect, s as AgentGraphUpdate, y as AgentInsert, ay as AgentProvider, bF as AgentRelationApiInsert, bE as AgentRelationApiSelect, bG as AgentRelationApiUpdate, v as AgentRelationInsert, bH as AgentRelationQuery, bD as AgentRelationSelect, w as AgentRelationUpdate, u as AgentScopeConfig, B as AgentSelect, az as AgentSkill, cJ as AgentToolRelationApiInsert, cI as AgentToolRelationApiSelect, cK as AgentToolRelationApiUpdate, cH as AgentToolRelationInsert, cG as AgentToolRelationSelect, x as AgentToolRelationUpdate, z as AgentUpdate, cz as AllAgentSelect, cD as ApiKeyApiCreationResponse, cB as ApiKeyApiInsert, cA as ApiKeyApiSelect, cC as ApiKeyApiUpdate, K as ApiKeyCreateResult, H as ApiKeyInsert, D as ApiKeySelect, I as ApiKeyUpdate, a7 as Artifact, co as ArtifactComponentApiInsert, cn as ArtifactComponentApiSelect, cp as ArtifactComponentApiUpdate, N as ArtifactComponentInsert, L as ArtifactComponentSelect, O as ArtifactComponentUpdate, aE as AuthorizationCodeOAuthFlow, cR as CanUseItem, bg as CancelTaskRequest, br as CancelTaskResponse, bq as CancelTaskSuccessResponse, aF as ClientCredentialsOAuthFlow, a_ as ContentTypeNotSupportedError, cc as ContextCacheApiInsert, cb as ContextCacheApiSelect, cd as ContextCacheApiUpdate, d8 as ContextCacheEntry, R as ContextCacheInsert, Q as ContextCacheSelect, ca as ContextCacheUpdate, c6 as ContextConfigApiInsert, c5 as ContextConfigApiSelect, c7 as ContextConfigApiUpdate, U as ContextConfigInsert, m as ContextConfigSelect, V as ContextConfigUpdate, f as ContextFetchDefinition, b$ as ConversationApiInsert, b_ as ConversationApiSelect, c0 as ConversationApiUpdate, C as ConversationHistoryConfig, X as ConversationInsert, i as ConversationMetadata, d6 as ConversationScopeOptions, W as ConversationSelect, Y as ConversationUpdate, J as CreateApiKeyParams, l as CredentialReferenceApiInsert, cE as CredentialReferenceApiSelect, cF as CredentialReferenceApiUpdate, $ as CredentialReferenceInsert, Z as CredentialReferenceSelect, a0 as CredentialReferenceUpdate, cf as DataComponentApiInsert, ce as DataComponentApiSelect, cg as DataComponentApiUpdate, a2 as DataComponentInsert, a1 as DataComponentSelect, a3 as DataComponentUpdate, av as DataPart, ao as ExecutionContext, cx as ExternalAgentApiInsert, cw as ExternalAgentApiSelect, cy as ExternalAgentApiUpdate, a4 as ExternalAgentInsert, bI as ExternalAgentRelationApiInsert, E as ExternalAgentRelationInsert, a5 as ExternalAgentSelect, a6 as ExternalAgentUpdate, c9 as FetchConfig, c8 as FetchDefinition, ar as FileBase, au as FilePart, as as FileWithBytes, at as FileWithUri, cQ as FullGraphAgentInsert, t as FullGraphDefinition, ac as FullProjectDefinition, bi as GetTaskPushNotificationConfigRequest, bv as GetTaskPushNotificationConfigResponse, bu as GetTaskPushNotificationConfigSuccessResponse, bf as GetTaskRequest, bp as GetTaskResponse, bo as GetTaskSuccessResponse, o as GraphScopeConfig, aC as HTTPAuthSecurityScheme, aG as ImplicitOAuthFlow, cS as InternalAgentDefinition, aV as InternalError, a$ as InvalidAgentResponseError, aU as InvalidParamsError, aS as InvalidRequestError, aR as JSONParseError, ba as JSONRPCError, bc as JSONRPCErrorResponse, b8 as JSONRPCMessage, b9 as JSONRPCRequest, bb as JSONRPCResult, cO as LedgerArtifactApiInsert, cN as LedgerArtifactApiSelect, cP as LedgerArtifactApiUpdate, cL as LedgerArtifactInsert, a8 as LedgerArtifactSelect, cM as LedgerArtifactUpdate, dg as MCPServerType, n as MCPToolConfig, M as MCPTransportType, d9 as McpAuthType, da as McpServerAuth, dc as McpServerCapabilities, al as McpTool, dd as McpToolDefinition, db as McpTransportConfig, aM as Message, c3 as MessageApiInsert, c2 as MessageApiSelect, c4 as MessageApiUpdate, j as MessageContent, aa as MessageInsert, k as MessageMetadata, d0 as MessageMode, by as MessagePart, c$ as MessageRole, c1 as MessageSelect, b6 as MessageSendConfiguration, b7 as MessageSendParams, c_ as MessageType, ab as MessageUpdate, a9 as MessageVisibility, aT as MethodNotFoundError, d3 as ModelSettings, d1 as Models, aI as OAuth2SecurityScheme, aD as OAuthFlows, aJ as OpenIdConnectSecurityScheme, cY as Pagination, q as PaginationConfig, af as PaginationResult, P as Part, ap as PartBase, aH as PasswordOAuthFlow, cW as ProjectApiInsert, cV as ProjectApiSelect, cX as ProjectApiUpdate, ad as ProjectInfo, ah as ProjectInsert, d2 as ProjectModels, ag as ProjectResourceCounts, p as ProjectScopeConfig, ae as ProjectSelect, ai as ProjectUpdate, b1 as PushNotificationAuthenticationInfo, b2 as PushNotificationConfig, aY as PushNotificationNotSupportedError, aK as SecurityScheme, aA as SecuritySchemeBase, bd as SendMessageRequest, bl as SendMessageResponse, bk as SendMessageSuccessResponse, be as SendStreamingMessageRequest, bn as SendStreamingMessageResponse, bm as SendStreamingMessageSuccessResponse, bh as SetTaskPushNotificationConfigRequest, bt as SetTaskPushNotificationConfigResponse, bs as SetTaskPushNotificationConfigSuccessResponse, d5 as StatusComponent, d4 as StatusUpdateSettings, cZ as SummaryEvent, de as TOOL_STATUS_VALUES, aO as Task, bP as TaskApiInsert, bO as TaskApiSelect, bQ as TaskApiUpdate, bz as TaskArtifact, aQ as TaskArtifactUpdateEvent, b4 as TaskIdParams, aj as TaskInsert, T as TaskMetadataConfig, aX as TaskNotCancelableError, aW as TaskNotFoundError, b3 as TaskPushNotificationConfig, b5 as TaskQueryParams, bV as TaskRelationApiInsert, bU as TaskRelationApiSelect, bW as TaskRelationApiUpdate, bS as TaskRelationInsert, bR as TaskRelationSelect, bT as TaskRelationUpdate, bj as TaskResubscriptionRequest, ak as TaskSelect, aw as TaskState, aN as TaskStatus, aP as TaskStatusUpdateEvent, bN as TaskUpdate, aq as TextPart, bY as ToolApiInsert, bX as ToolApiSelect, bZ as ToolApiUpdate, cU as ToolDefinition, am as ToolInsert, g as ToolMcpConfig, _ as ToolSelect, h as ToolServerCapabilities, an as ToolUpdate, aZ as UnsupportedOperationError, df as VALID_RELATION_TYPES } from '../utility-8RXSemmL.cjs';
3
3
  import { Context } from 'hono';
4
4
  import 'zod';
5
5
  import 'drizzle-zod';
@@ -1,5 +1,5 @@
1
- import { e as CredentialStoreType } from '../utility-DP6lt8z3.js';
2
- export { b0 as A2AError, bw as A2ARequest, bx as A2AResponse, aB as APIKeySecurityScheme, bB as AgentApiInsert, bA as AgentApiSelect, bC as AgentApiUpdate, cu as AgentArtifactComponentApiInsert, ct as AgentArtifactComponentApiSelect, cv as AgentArtifactComponentApiUpdate, cr as AgentArtifactComponentInsert, cq as AgentArtifactComponentSelect, cs as AgentArtifactComponentUpdate, ax as AgentCapabilities, aL as AgentCard, d7 as AgentConversationHistoryConfig, cl as AgentDataComponentApiInsert, ck as AgentDataComponentApiSelect, cm as AgentDataComponentApiUpdate, ci as AgentDataComponentInsert, ch as AgentDataComponentSelect, cj as AgentDataComponentUpdate, cT as AgentDefinition, bL as AgentGraphApiInsert, bK as AgentGraphApiSelect, bM as AgentGraphApiUpdate, r as AgentGraphInsert, bJ as AgentGraphSelect, s as AgentGraphUpdate, y as AgentInsert, ay as AgentProvider, bF as AgentRelationApiInsert, bE as AgentRelationApiSelect, bG as AgentRelationApiUpdate, v as AgentRelationInsert, bH as AgentRelationQuery, bD as AgentRelationSelect, w as AgentRelationUpdate, u as AgentScopeConfig, B as AgentSelect, az as AgentSkill, cJ as AgentToolRelationApiInsert, cI as AgentToolRelationApiSelect, cK as AgentToolRelationApiUpdate, cH as AgentToolRelationInsert, cG as AgentToolRelationSelect, x as AgentToolRelationUpdate, z as AgentUpdate, cz as AllAgentSelect, cD as ApiKeyApiCreationResponse, cB as ApiKeyApiInsert, cA as ApiKeyApiSelect, cC as ApiKeyApiUpdate, K as ApiKeyCreateResult, H as ApiKeyInsert, D as ApiKeySelect, I as ApiKeyUpdate, a7 as Artifact, co as ArtifactComponentApiInsert, cn as ArtifactComponentApiSelect, cp as ArtifactComponentApiUpdate, N as ArtifactComponentInsert, L as ArtifactComponentSelect, O as ArtifactComponentUpdate, aE as AuthorizationCodeOAuthFlow, cR as CanUseItem, bg as CancelTaskRequest, br as CancelTaskResponse, bq as CancelTaskSuccessResponse, aF as ClientCredentialsOAuthFlow, a_ as ContentTypeNotSupportedError, cc as ContextCacheApiInsert, cb as ContextCacheApiSelect, cd as ContextCacheApiUpdate, d8 as ContextCacheEntry, R as ContextCacheInsert, Q as ContextCacheSelect, ca as ContextCacheUpdate, c6 as ContextConfigApiInsert, c5 as ContextConfigApiSelect, c7 as ContextConfigApiUpdate, U as ContextConfigInsert, m as ContextConfigSelect, V as ContextConfigUpdate, f as ContextFetchDefinition, b$ as ConversationApiInsert, b_ as ConversationApiSelect, c0 as ConversationApiUpdate, C as ConversationHistoryConfig, X as ConversationInsert, i as ConversationMetadata, d6 as ConversationScopeOptions, W as ConversationSelect, Y as ConversationUpdate, J as CreateApiKeyParams, l as CredentialReferenceApiInsert, cE as CredentialReferenceApiSelect, cF as CredentialReferenceApiUpdate, $ as CredentialReferenceInsert, Z as CredentialReferenceSelect, a0 as CredentialReferenceUpdate, cf as DataComponentApiInsert, ce as DataComponentApiSelect, cg as DataComponentApiUpdate, a2 as DataComponentInsert, a1 as DataComponentSelect, a3 as DataComponentUpdate, av as DataPart, ao as ExecutionContext, cx as ExternalAgentApiInsert, cw as ExternalAgentApiSelect, cy as ExternalAgentApiUpdate, a4 as ExternalAgentInsert, bI as ExternalAgentRelationApiInsert, E as ExternalAgentRelationInsert, a5 as ExternalAgentSelect, a6 as ExternalAgentUpdate, c9 as FetchConfig, c8 as FetchDefinition, ar as FileBase, au as FilePart, as as FileWithBytes, at as FileWithUri, cQ as FullGraphAgentInsert, t as FullGraphDefinition, ac as FullProjectDefinition, bi as GetTaskPushNotificationConfigRequest, bv as GetTaskPushNotificationConfigResponse, bu as GetTaskPushNotificationConfigSuccessResponse, bf as GetTaskRequest, bp as GetTaskResponse, bo as GetTaskSuccessResponse, o as GraphScopeConfig, aC as HTTPAuthSecurityScheme, aG as ImplicitOAuthFlow, cS as InternalAgentDefinition, aV as InternalError, a$ as InvalidAgentResponseError, aU as InvalidParamsError, aS as InvalidRequestError, aR as JSONParseError, ba as JSONRPCError, bc as JSONRPCErrorResponse, b8 as JSONRPCMessage, b9 as JSONRPCRequest, bb as JSONRPCResult, cO as LedgerArtifactApiInsert, cN as LedgerArtifactApiSelect, cP as LedgerArtifactApiUpdate, cL as LedgerArtifactInsert, a8 as LedgerArtifactSelect, cM as LedgerArtifactUpdate, dg as MCPServerType, n as MCPToolConfig, M as MCPTransportType, d9 as McpAuthType, da as McpServerAuth, dc as McpServerCapabilities, al as McpTool, dd as McpToolDefinition, db as McpTransportConfig, aM as Message, c3 as MessageApiInsert, c2 as MessageApiSelect, c4 as MessageApiUpdate, j as MessageContent, aa as MessageInsert, k as MessageMetadata, d0 as MessageMode, by as MessagePart, c$ as MessageRole, c1 as MessageSelect, b6 as MessageSendConfiguration, b7 as MessageSendParams, c_ as MessageType, ab as MessageUpdate, a9 as MessageVisibility, aT as MethodNotFoundError, d3 as ModelSettings, d1 as Models, aI as OAuth2SecurityScheme, aD as OAuthFlows, aJ as OpenIdConnectSecurityScheme, cY as Pagination, q as PaginationConfig, af as PaginationResult, P as Part, ap as PartBase, aH as PasswordOAuthFlow, cW as ProjectApiInsert, cV as ProjectApiSelect, cX as ProjectApiUpdate, ad as ProjectInfo, ah as ProjectInsert, d2 as ProjectModels, ag as ProjectResourceCounts, p as ProjectScopeConfig, ae as ProjectSelect, ai as ProjectUpdate, b1 as PushNotificationAuthenticationInfo, b2 as PushNotificationConfig, aY as PushNotificationNotSupportedError, aK as SecurityScheme, aA as SecuritySchemeBase, bd as SendMessageRequest, bl as SendMessageResponse, bk as SendMessageSuccessResponse, be as SendStreamingMessageRequest, bn as SendStreamingMessageResponse, bm as SendStreamingMessageSuccessResponse, bh as SetTaskPushNotificationConfigRequest, bt as SetTaskPushNotificationConfigResponse, bs as SetTaskPushNotificationConfigSuccessResponse, d5 as StatusComponent, d4 as StatusUpdateSettings, cZ as SummaryEvent, de as TOOL_STATUS_VALUES, aO as Task, bP as TaskApiInsert, bO as TaskApiSelect, bQ as TaskApiUpdate, bz as TaskArtifact, aQ as TaskArtifactUpdateEvent, b4 as TaskIdParams, aj as TaskInsert, T as TaskMetadataConfig, aX as TaskNotCancelableError, aW as TaskNotFoundError, b3 as TaskPushNotificationConfig, b5 as TaskQueryParams, bV as TaskRelationApiInsert, bU as TaskRelationApiSelect, bW as TaskRelationApiUpdate, bS as TaskRelationInsert, bR as TaskRelationSelect, bT as TaskRelationUpdate, bj as TaskResubscriptionRequest, ak as TaskSelect, aw as TaskState, aN as TaskStatus, aP as TaskStatusUpdateEvent, bN as TaskUpdate, aq as TextPart, bY as ToolApiInsert, bX as ToolApiSelect, bZ as ToolApiUpdate, cU as ToolDefinition, am as ToolInsert, g as ToolMcpConfig, _ as ToolSelect, h as ToolServerCapabilities, an as ToolUpdate, aZ as UnsupportedOperationError, df as VALID_RELATION_TYPES } from '../utility-DP6lt8z3.js';
1
+ import { e as CredentialStoreType } from '../utility-8RXSemmL.js';
2
+ export { b0 as A2AError, bw as A2ARequest, bx as A2AResponse, aB as APIKeySecurityScheme, bB as AgentApiInsert, bA as AgentApiSelect, bC as AgentApiUpdate, cu as AgentArtifactComponentApiInsert, ct as AgentArtifactComponentApiSelect, cv as AgentArtifactComponentApiUpdate, cr as AgentArtifactComponentInsert, cq as AgentArtifactComponentSelect, cs as AgentArtifactComponentUpdate, ax as AgentCapabilities, aL as AgentCard, d7 as AgentConversationHistoryConfig, cl as AgentDataComponentApiInsert, ck as AgentDataComponentApiSelect, cm as AgentDataComponentApiUpdate, ci as AgentDataComponentInsert, ch as AgentDataComponentSelect, cj as AgentDataComponentUpdate, cT as AgentDefinition, bL as AgentGraphApiInsert, bK as AgentGraphApiSelect, bM as AgentGraphApiUpdate, r as AgentGraphInsert, bJ as AgentGraphSelect, s as AgentGraphUpdate, y as AgentInsert, ay as AgentProvider, bF as AgentRelationApiInsert, bE as AgentRelationApiSelect, bG as AgentRelationApiUpdate, v as AgentRelationInsert, bH as AgentRelationQuery, bD as AgentRelationSelect, w as AgentRelationUpdate, u as AgentScopeConfig, B as AgentSelect, az as AgentSkill, cJ as AgentToolRelationApiInsert, cI as AgentToolRelationApiSelect, cK as AgentToolRelationApiUpdate, cH as AgentToolRelationInsert, cG as AgentToolRelationSelect, x as AgentToolRelationUpdate, z as AgentUpdate, cz as AllAgentSelect, cD as ApiKeyApiCreationResponse, cB as ApiKeyApiInsert, cA as ApiKeyApiSelect, cC as ApiKeyApiUpdate, K as ApiKeyCreateResult, H as ApiKeyInsert, D as ApiKeySelect, I as ApiKeyUpdate, a7 as Artifact, co as ArtifactComponentApiInsert, cn as ArtifactComponentApiSelect, cp as ArtifactComponentApiUpdate, N as ArtifactComponentInsert, L as ArtifactComponentSelect, O as ArtifactComponentUpdate, aE as AuthorizationCodeOAuthFlow, cR as CanUseItem, bg as CancelTaskRequest, br as CancelTaskResponse, bq as CancelTaskSuccessResponse, aF as ClientCredentialsOAuthFlow, a_ as ContentTypeNotSupportedError, cc as ContextCacheApiInsert, cb as ContextCacheApiSelect, cd as ContextCacheApiUpdate, d8 as ContextCacheEntry, R as ContextCacheInsert, Q as ContextCacheSelect, ca as ContextCacheUpdate, c6 as ContextConfigApiInsert, c5 as ContextConfigApiSelect, c7 as ContextConfigApiUpdate, U as ContextConfigInsert, m as ContextConfigSelect, V as ContextConfigUpdate, f as ContextFetchDefinition, b$ as ConversationApiInsert, b_ as ConversationApiSelect, c0 as ConversationApiUpdate, C as ConversationHistoryConfig, X as ConversationInsert, i as ConversationMetadata, d6 as ConversationScopeOptions, W as ConversationSelect, Y as ConversationUpdate, J as CreateApiKeyParams, l as CredentialReferenceApiInsert, cE as CredentialReferenceApiSelect, cF as CredentialReferenceApiUpdate, $ as CredentialReferenceInsert, Z as CredentialReferenceSelect, a0 as CredentialReferenceUpdate, cf as DataComponentApiInsert, ce as DataComponentApiSelect, cg as DataComponentApiUpdate, a2 as DataComponentInsert, a1 as DataComponentSelect, a3 as DataComponentUpdate, av as DataPart, ao as ExecutionContext, cx as ExternalAgentApiInsert, cw as ExternalAgentApiSelect, cy as ExternalAgentApiUpdate, a4 as ExternalAgentInsert, bI as ExternalAgentRelationApiInsert, E as ExternalAgentRelationInsert, a5 as ExternalAgentSelect, a6 as ExternalAgentUpdate, c9 as FetchConfig, c8 as FetchDefinition, ar as FileBase, au as FilePart, as as FileWithBytes, at as FileWithUri, cQ as FullGraphAgentInsert, t as FullGraphDefinition, ac as FullProjectDefinition, bi as GetTaskPushNotificationConfigRequest, bv as GetTaskPushNotificationConfigResponse, bu as GetTaskPushNotificationConfigSuccessResponse, bf as GetTaskRequest, bp as GetTaskResponse, bo as GetTaskSuccessResponse, o as GraphScopeConfig, aC as HTTPAuthSecurityScheme, aG as ImplicitOAuthFlow, cS as InternalAgentDefinition, aV as InternalError, a$ as InvalidAgentResponseError, aU as InvalidParamsError, aS as InvalidRequestError, aR as JSONParseError, ba as JSONRPCError, bc as JSONRPCErrorResponse, b8 as JSONRPCMessage, b9 as JSONRPCRequest, bb as JSONRPCResult, cO as LedgerArtifactApiInsert, cN as LedgerArtifactApiSelect, cP as LedgerArtifactApiUpdate, cL as LedgerArtifactInsert, a8 as LedgerArtifactSelect, cM as LedgerArtifactUpdate, dg as MCPServerType, n as MCPToolConfig, M as MCPTransportType, d9 as McpAuthType, da as McpServerAuth, dc as McpServerCapabilities, al as McpTool, dd as McpToolDefinition, db as McpTransportConfig, aM as Message, c3 as MessageApiInsert, c2 as MessageApiSelect, c4 as MessageApiUpdate, j as MessageContent, aa as MessageInsert, k as MessageMetadata, d0 as MessageMode, by as MessagePart, c$ as MessageRole, c1 as MessageSelect, b6 as MessageSendConfiguration, b7 as MessageSendParams, c_ as MessageType, ab as MessageUpdate, a9 as MessageVisibility, aT as MethodNotFoundError, d3 as ModelSettings, d1 as Models, aI as OAuth2SecurityScheme, aD as OAuthFlows, aJ as OpenIdConnectSecurityScheme, cY as Pagination, q as PaginationConfig, af as PaginationResult, P as Part, ap as PartBase, aH as PasswordOAuthFlow, cW as ProjectApiInsert, cV as ProjectApiSelect, cX as ProjectApiUpdate, ad as ProjectInfo, ah as ProjectInsert, d2 as ProjectModels, ag as ProjectResourceCounts, p as ProjectScopeConfig, ae as ProjectSelect, ai as ProjectUpdate, b1 as PushNotificationAuthenticationInfo, b2 as PushNotificationConfig, aY as PushNotificationNotSupportedError, aK as SecurityScheme, aA as SecuritySchemeBase, bd as SendMessageRequest, bl as SendMessageResponse, bk as SendMessageSuccessResponse, be as SendStreamingMessageRequest, bn as SendStreamingMessageResponse, bm as SendStreamingMessageSuccessResponse, bh as SetTaskPushNotificationConfigRequest, bt as SetTaskPushNotificationConfigResponse, bs as SetTaskPushNotificationConfigSuccessResponse, d5 as StatusComponent, d4 as StatusUpdateSettings, cZ as SummaryEvent, de as TOOL_STATUS_VALUES, aO as Task, bP as TaskApiInsert, bO as TaskApiSelect, bQ as TaskApiUpdate, bz as TaskArtifact, aQ as TaskArtifactUpdateEvent, b4 as TaskIdParams, aj as TaskInsert, T as TaskMetadataConfig, aX as TaskNotCancelableError, aW as TaskNotFoundError, b3 as TaskPushNotificationConfig, b5 as TaskQueryParams, bV as TaskRelationApiInsert, bU as TaskRelationApiSelect, bW as TaskRelationApiUpdate, bS as TaskRelationInsert, bR as TaskRelationSelect, bT as TaskRelationUpdate, bj as TaskResubscriptionRequest, ak as TaskSelect, aw as TaskState, aN as TaskStatus, aP as TaskStatusUpdateEvent, bN as TaskUpdate, aq as TextPart, bY as ToolApiInsert, bX as ToolApiSelect, bZ as ToolApiUpdate, cU as ToolDefinition, am as ToolInsert, g as ToolMcpConfig, _ as ToolSelect, h as ToolServerCapabilities, an as ToolUpdate, aZ as UnsupportedOperationError, df as VALID_RELATION_TYPES } from '../utility-8RXSemmL.js';
3
3
  import { Context } from 'hono';
4
4
  import 'zod';
5
5
  import 'drizzle-zod';