@inkeep/agents-core 0.3.0 → 0.6.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,14 +1,16 @@
1
1
  export { TaskState } from './chunk-H2F72PDA.js';
2
- import { validateAndTypeGraphData, validateGraphStructure, isInternalAgent, isExternalAgent } from './chunk-XQRFKXVV.js';
3
- export { generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './chunk-XQRFKXVV.js';
4
- import { ContextConfigApiUpdateSchema } from './chunk-LPIKPCE5.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, 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-LPIKPCE5.js';
2
+ import { validateAndTypeGraphData, validateGraphStructure, isInternalAgent, isExternalAgent } from './chunk-T5JVBY6K.js';
3
+ export { generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './chunk-T5JVBY6K.js';
4
+ import { ContextConfigApiUpdateSchema } from './chunk-7OCPFKGI.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-7OCPFKGI.js';
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-TNFWLVL6.js';
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, messages, messagesRelations, projects, projectsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-TNFWLVL6.js';
6
8
  import { CredentialStoreType, MCPServerType, MCPTransportType } from './chunk-SVGQSPW4.js';
7
9
  export { CredentialStoreType, MCPServerType, MCPTransportType, TOOL_STATUS_VALUES, VALID_RELATION_TYPES } from './chunk-SVGQSPW4.js';
8
- 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-LFWFXR4O.js';
9
- 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, messages, messagesRelations, projects, projectsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-LFWFXR4O.js';
10
10
  import { __publicField } from './chunk-MKBO26DX.js';
11
11
  import { z as z$1 } from 'zod';
12
+ import pino from 'pino';
13
+ import pinoPretty from 'pino-pretty';
12
14
  import jmespath from 'jmespath';
13
15
  import { createClient } from '@libsql/client';
14
16
  import { drizzle } from 'drizzle-orm/libsql';
@@ -36,32 +38,114 @@ import dotenv from 'dotenv';
36
38
  import { expand } from 'dotenv-expand';
37
39
  import { findUpSync } from 'find-up';
38
40
 
39
- // src/utils/logger.ts
40
- var ConsoleLogger = class {
41
- constructor(name) {
41
+ var PinoLogger = class {
42
+ constructor(name, config = {}) {
42
43
  this.name = name;
44
+ __publicField(this, "transportConfigs", []);
45
+ __publicField(this, "pinoInstance");
46
+ __publicField(this, "options");
47
+ this.options = {
48
+ name: this.name,
49
+ level: process.env.LOG_LEVEL || "info",
50
+ serializers: {
51
+ obj: (value) => ({ ...value })
52
+ },
53
+ redact: ["req.headers.authorization", 'req.headers["x-inkeep-admin-authentication"]'],
54
+ ...config.options
55
+ };
56
+ if (config.transportConfigs) {
57
+ this.transportConfigs = config.transportConfigs;
58
+ }
59
+ if (this.transportConfigs.length > 0) {
60
+ this.pinoInstance = pino(this.options, pino.transport({ targets: this.transportConfigs }));
61
+ } else {
62
+ try {
63
+ const prettyStream = pinoPretty({
64
+ colorize: true,
65
+ translateTime: "HH:MM:ss",
66
+ ignore: "pid,hostname"
67
+ });
68
+ this.pinoInstance = pino(this.options, prettyStream);
69
+ } catch (error) {
70
+ console.warn("Warning: pino-pretty failed, using standard JSON output:", error);
71
+ this.pinoInstance = pino(this.options);
72
+ }
73
+ }
43
74
  }
44
- error(data, message) {
45
- console.error(`[${this.name}] ${message}`, data);
75
+ /**
76
+ * Recreate the pino instance with current transports
77
+ */
78
+ recreateInstance() {
79
+ if (this.pinoInstance && typeof this.pinoInstance.flush === "function") {
80
+ this.pinoInstance.flush();
81
+ }
82
+ if (this.transportConfigs.length === 0) {
83
+ try {
84
+ const prettyStream = pinoPretty({
85
+ colorize: true,
86
+ translateTime: "HH:MM:ss",
87
+ ignore: "pid,hostname"
88
+ });
89
+ this.pinoInstance = pino(this.options, prettyStream);
90
+ } catch (error) {
91
+ console.warn("Warning: pino-pretty failed, using standard JSON output:", error);
92
+ this.pinoInstance = pino(this.options);
93
+ }
94
+ } else {
95
+ const multiTransport = { targets: this.transportConfigs };
96
+ const pinoTransport = pino.transport(multiTransport);
97
+ this.pinoInstance = pino(this.options, pinoTransport);
98
+ }
46
99
  }
47
- warn(data, message) {
48
- console.warn(`[${this.name}] ${message}`, data);
100
+ /**
101
+ * Add a new transport to the logger
102
+ */
103
+ addTransport(transportConfig) {
104
+ this.transportConfigs.push(transportConfig);
105
+ this.recreateInstance();
49
106
  }
50
- info(data, message) {
51
- console.info(`[${this.name}] ${message}`, data);
107
+ /**
108
+ * Remove a transport by index
109
+ */
110
+ removeTransport(index) {
111
+ if (index >= 0 && index < this.transportConfigs.length) {
112
+ this.transportConfigs.splice(index, 1);
113
+ this.recreateInstance();
114
+ }
52
115
  }
53
- debug(data, message) {
54
- console.debug(`[${this.name}] ${message}`, data);
116
+ /**
117
+ * Get current transports
118
+ */
119
+ getTransports() {
120
+ return [...this.transportConfigs];
55
121
  }
56
- };
57
- var NoOpLogger = class {
58
- error(_data, _message) {
122
+ /**
123
+ * Update logger options
124
+ */
125
+ updateOptions(options) {
126
+ this.options = {
127
+ ...this.options,
128
+ ...options
129
+ };
130
+ this.recreateInstance();
59
131
  }
60
- warn(_data, _message) {
132
+ /**
133
+ * Get the underlying pino instance for advanced usage
134
+ */
135
+ getPinoInstance() {
136
+ return this.pinoInstance;
61
137
  }
62
- info(_data, _message) {
138
+ error(data, message) {
139
+ this.pinoInstance.error(data, message);
140
+ }
141
+ warn(data, message) {
142
+ this.pinoInstance.warn(data, message);
63
143
  }
64
- debug(_data, _message) {
144
+ info(data, message) {
145
+ this.pinoInstance.info(data, message);
146
+ }
147
+ debug(data, message) {
148
+ this.pinoInstance.debug(data, message);
65
149
  }
66
150
  };
67
151
  var LoggerFactory = class {
@@ -93,7 +177,7 @@ var LoggerFactory = class {
93
177
  } else if (this.config.defaultLogger) {
94
178
  logger11 = this.config.defaultLogger;
95
179
  } else {
96
- logger11 = new ConsoleLogger(name);
180
+ logger11 = new PinoLogger(name, this.config.pinoConfig);
97
181
  }
98
182
  this.loggers.set(name, logger11);
99
183
  return logger11;
@@ -110,9 +194,6 @@ var loggerFactory = new LoggerFactory();
110
194
  function getLogger(name) {
111
195
  return loggerFactory.getLogger(name);
112
196
  }
113
- function configureLogging(config) {
114
- loggerFactory.configure(config);
115
- }
116
197
 
117
198
  // src/context/ContextConfig.ts
118
199
  var logger = getLogger("context-config");
@@ -900,16 +981,21 @@ var getRelatedAgentsForGraph = (db) => async (params) => {
900
981
  name: agents.name,
901
982
  description: agents.description,
902
983
  relationType: agentRelations.relationType
903
- }).from(agentRelations).innerJoin(agents, eq(agentRelations.targetAgentId, agents.id)).where(
984
+ }).from(agentRelations).innerJoin(
985
+ agents,
986
+ and(
987
+ eq(agentRelations.targetAgentId, agents.id),
988
+ eq(agentRelations.tenantId, agents.tenantId),
989
+ eq(agentRelations.projectId, agents.projectId),
990
+ eq(agentRelations.graphId, agents.graphId)
991
+ )
992
+ ).where(
904
993
  and(
905
994
  eq(agentRelations.tenantId, params.scopes.tenantId),
906
995
  eq(agentRelations.projectId, params.scopes.projectId),
907
996
  eq(agentRelations.graphId, params.scopes.graphId),
908
997
  eq(agentRelations.sourceAgentId, params.agentId),
909
- isNotNull(agentRelations.targetAgentId),
910
- eq(agents.tenantId, params.scopes.tenantId),
911
- eq(agents.projectId, params.scopes.projectId),
912
- eq(agents.graphId, params.scopes.graphId)
998
+ isNotNull(agentRelations.targetAgentId)
913
999
  )
914
1000
  );
915
1001
  const externalRelations = await db.select({
@@ -921,16 +1007,21 @@ var getRelatedAgentsForGraph = (db) => async (params) => {
921
1007
  description: externalAgents.description,
922
1008
  baseUrl: externalAgents.baseUrl
923
1009
  }
924
- }).from(agentRelations).innerJoin(externalAgents, eq(agentRelations.externalAgentId, externalAgents.id)).where(
1010
+ }).from(agentRelations).innerJoin(
1011
+ externalAgents,
1012
+ and(
1013
+ eq(agentRelations.externalAgentId, externalAgents.id),
1014
+ eq(agentRelations.tenantId, externalAgents.tenantId),
1015
+ eq(agentRelations.projectId, externalAgents.projectId),
1016
+ eq(agentRelations.graphId, externalAgents.graphId)
1017
+ )
1018
+ ).where(
925
1019
  and(
926
1020
  eq(agentRelations.tenantId, params.scopes.tenantId),
927
1021
  eq(agentRelations.projectId, params.scopes.projectId),
928
1022
  eq(agentRelations.graphId, params.scopes.graphId),
929
1023
  eq(agentRelations.sourceAgentId, params.agentId),
930
- isNotNull(agentRelations.externalAgentId),
931
- eq(externalAgents.tenantId, params.scopes.tenantId),
932
- eq(externalAgents.projectId, params.scopes.projectId),
933
- eq(externalAgents.graphId, params.scopes.graphId)
1024
+ isNotNull(agentRelations.externalAgentId)
934
1025
  )
935
1026
  );
936
1027
  return {
@@ -1193,7 +1284,14 @@ var getToolsForAgent = (db) => async (params) => {
1193
1284
  availableTools: tools.availableTools,
1194
1285
  credentialReferenceId: tools.credentialReferenceId
1195
1286
  }
1196
- }).from(agentToolRelations).innerJoin(tools, eq(agentToolRelations.toolId, tools.id)).where(
1287
+ }).from(agentToolRelations).innerJoin(
1288
+ tools,
1289
+ and(
1290
+ eq(agentToolRelations.tenantId, tools.tenantId),
1291
+ eq(agentToolRelations.projectId, tools.projectId),
1292
+ eq(agentToolRelations.toolId, tools.id)
1293
+ )
1294
+ ).where(
1197
1295
  and(
1198
1296
  eq(agentToolRelations.tenantId, params.scopes.tenantId),
1199
1297
  eq(agentToolRelations.projectId, params.scopes.projectId),
@@ -1241,7 +1339,15 @@ var getAgentsForTool = (db) => async (params) => {
1241
1339
  createdAt: agents.createdAt,
1242
1340
  updatedAt: agents.updatedAt
1243
1341
  }
1244
- }).from(agentToolRelations).innerJoin(agents, eq(agentToolRelations.agentId, agents.id)).where(
1342
+ }).from(agentToolRelations).innerJoin(
1343
+ agents,
1344
+ and(
1345
+ eq(agentToolRelations.agentId, agents.id),
1346
+ eq(agentToolRelations.tenantId, agents.tenantId),
1347
+ eq(agentToolRelations.projectId, agents.projectId),
1348
+ eq(agentToolRelations.graphId, agents.graphId)
1349
+ )
1350
+ ).where(
1245
1351
  and(
1246
1352
  eq(agentToolRelations.tenantId, params.scopes.tenantId),
1247
1353
  eq(agentToolRelations.projectId, params.scopes.projectId),
@@ -1928,8 +2034,20 @@ var getFullGraphDefinition = (db) => async ({
1928
2034
  availableTools: tools.availableTools,
1929
2035
  lastToolsSync: tools.lastToolsSync,
1930
2036
  selectedTools: agentToolRelations.selectedTools
1931
- }).from(agentToolRelations).innerJoin(tools, eq(agentToolRelations.toolId, tools.id)).where(
1932
- and(eq(agentToolRelations.tenantId, tenantId), eq(agentToolRelations.agentId, agent.id))
2037
+ }).from(agentToolRelations).innerJoin(
2038
+ tools,
2039
+ and(
2040
+ eq(agentToolRelations.toolId, tools.id),
2041
+ eq(agentToolRelations.tenantId, tools.tenantId),
2042
+ eq(agentToolRelations.projectId, tools.projectId)
2043
+ )
2044
+ ).where(
2045
+ and(
2046
+ eq(agentToolRelations.tenantId, tenantId),
2047
+ eq(agentToolRelations.projectId, projectId),
2048
+ eq(agentToolRelations.graphId, graphId),
2049
+ eq(agentToolRelations.agentId, agent.id)
2050
+ )
1933
2051
  );
1934
2052
  const agentDataComponentRelations = await db.query.agentDataComponents.findMany({
1935
2053
  where: and(
@@ -1947,12 +2065,10 @@ var getFullGraphDefinition = (db) => async ({
1947
2065
  const agentArtifactComponentIds = agentArtifactComponentRelations.map(
1948
2066
  (rel) => rel.artifactComponentId
1949
2067
  );
1950
- const selectedTools = {};
1951
- agentTools.forEach((tool2) => {
1952
- if (tool2.selectedTools && Array.isArray(tool2.selectedTools)) {
1953
- selectedTools[tool2.id] = tool2.selectedTools;
1954
- }
1955
- });
2068
+ const canUse = agentTools.map((tool2) => ({
2069
+ toolId: tool2.id,
2070
+ toolSelection: tool2.selectedTools || null
2071
+ }));
1956
2072
  return {
1957
2073
  id: agent.id,
1958
2074
  name: agent.name,
@@ -1964,20 +2080,8 @@ var getFullGraphDefinition = (db) => async ({
1964
2080
  canDelegateTo,
1965
2081
  dataComponents: agentDataComponentIds,
1966
2082
  artifactComponents: agentArtifactComponentIds,
1967
- ...Object.keys(selectedTools).length > 0 && { selectedTools },
1968
- tools: agentTools.map((tool2) => ({
1969
- id: tool2.id,
1970
- name: tool2.name,
1971
- config: tool2.config,
1972
- imageUrl: tool2.imageUrl || void 0,
1973
- status: tool2.status,
1974
- capabilities: tool2.capabilities || void 0,
1975
- lastHealthCheck: tool2.lastHealthCheck && !Number.isNaN(new Date(tool2.lastHealthCheck).getTime()) ? new Date(tool2.lastHealthCheck).toISOString() : void 0,
1976
- lastError: tool2.lastError || void 0,
1977
- availableTools: tool2.availableTools || void 0,
1978
- activeTools: tool2.config?.mcp?.activeTools || void 0,
1979
- lastToolsSync: tool2.lastToolsSync && !Number.isNaN(new Date(tool2.lastToolsSync).getTime()) ? new Date(tool2.lastToolsSync).toISOString() : void 0
1980
- }))
2083
+ canUse
2084
+ // Use the new canUse structure
1981
2085
  };
1982
2086
  })
1983
2087
  );
@@ -2000,7 +2104,6 @@ var getFullGraphDefinition = (db) => async ({
2000
2104
  (agent) => agent !== null
2001
2105
  );
2002
2106
  const agentsObject = {};
2003
- const toolsObject = {};
2004
2107
  for (const agent of validAgents) {
2005
2108
  const isExternalAgent2 = "baseUrl" in agent && agent.baseUrl;
2006
2109
  if (isExternalAgent2) {
@@ -2011,22 +2114,7 @@ var getFullGraphDefinition = (db) => async ({
2011
2114
  baseUrl: agent.baseUrl
2012
2115
  };
2013
2116
  } else {
2014
- const toolsData = agent.tools || [];
2015
- const toolIds = [];
2016
- const agentSelectedTools = {};
2017
- for (const tool2 of toolsData) {
2018
- toolsObject[tool2.id] = tool2;
2019
- toolIds.push(tool2.id);
2020
- if (tool2.selectedTools !== null && tool2.selectedTools !== void 0) {
2021
- agentSelectedTools[tool2.id] = tool2.selectedTools;
2022
- }
2023
- }
2024
- agentsObject[agent.id] = {
2025
- ...agent,
2026
- tools: toolIds,
2027
- // Replace tool objects with tool IDs
2028
- ...Object.keys(agentSelectedTools).length > 0 && { selectedTools: agentSelectedTools }
2029
- };
2117
+ agentsObject[agent.id] = agent;
2030
2118
  }
2031
2119
  }
2032
2120
  let contextConfig2 = null;
@@ -2040,11 +2128,10 @@ var getFullGraphDefinition = (db) => async ({
2040
2128
  console.warn(`Failed to retrieve contextConfig ${graph.contextConfigId}:`, error);
2041
2129
  }
2042
2130
  }
2043
- let dataComponentsObject = {};
2044
2131
  try {
2045
2132
  const internalAgentIds = graphAgents.map((agent) => agent.id);
2046
2133
  const agentIds = Array.from(internalAgentIds);
2047
- dataComponentsObject = await fetchComponentRelationships(db)(
2134
+ await fetchComponentRelationships(db)(
2048
2135
  { tenantId, projectId },
2049
2136
  agentIds,
2050
2137
  {
@@ -2063,11 +2150,10 @@ var getFullGraphDefinition = (db) => async ({
2063
2150
  } catch (error) {
2064
2151
  console.warn("Failed to retrieve dataComponents:", error);
2065
2152
  }
2066
- let artifactComponentsObject = {};
2067
2153
  try {
2068
2154
  const internalAgentIds = graphAgents.map((agent) => agent.id);
2069
2155
  const agentIds = Array.from(internalAgentIds);
2070
- artifactComponentsObject = await fetchComponentRelationships(db)(
2156
+ await fetchComponentRelationships(db)(
2071
2157
  { tenantId, projectId },
2072
2158
  agentIds,
2073
2159
  {
@@ -2093,7 +2179,7 @@ var getFullGraphDefinition = (db) => async ({
2093
2179
  description: graph.description,
2094
2180
  defaultAgentId: graph.defaultAgentId,
2095
2181
  agents: agentsObject,
2096
- tools: toolsObject,
2182
+ // No tools field - tools are defined at project level
2097
2183
  createdAt: graph.createdAt && !Number.isNaN(new Date(graph.createdAt).getTime()) ? new Date(graph.createdAt).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
2098
2184
  updatedAt: graph.updatedAt && !Number.isNaN(new Date(graph.updatedAt).getTime()) ? new Date(graph.updatedAt).toISOString() : (/* @__PURE__ */ new Date()).toISOString()
2099
2185
  };
@@ -2118,12 +2204,6 @@ var getFullGraphDefinition = (db) => async ({
2118
2204
  contextVariables: contextConfig2.contextVariables
2119
2205
  };
2120
2206
  }
2121
- if (Object.keys(dataComponentsObject).length > 0) {
2122
- result.dataComponents = dataComponentsObject;
2123
- }
2124
- if (Object.keys(artifactComponentsObject).length > 0) {
2125
- result.artifactComponents = artifactComponentsObject;
2126
- }
2127
2207
  try {
2128
2208
  if (!db.query?.projects?.findFirst) {
2129
2209
  return result;
@@ -2326,6 +2406,7 @@ var createApiKey = (db) => async (params) => {
2326
2406
  const now = (/* @__PURE__ */ new Date()).toISOString();
2327
2407
  const [apiKey] = await db.insert(apiKeys).values({
2328
2408
  id: params.id,
2409
+ name: params.name,
2329
2410
  tenantId: params.tenantId,
2330
2411
  projectId: params.projectId,
2331
2412
  graphId: params.graphId,
@@ -2341,6 +2422,7 @@ var createApiKey = (db) => async (params) => {
2341
2422
  var updateApiKey = (db) => async (params) => {
2342
2423
  const now = (/* @__PURE__ */ new Date()).toISOString();
2343
2424
  const [updatedKey] = await db.update(apiKeys).set({
2425
+ name: params.data.name,
2344
2426
  expiresAt: params.data.expiresAt,
2345
2427
  updatedAt: now
2346
2428
  }).where(
@@ -2394,12 +2476,13 @@ var countApiKeys = (db) => async (params) => {
2394
2476
  return typeof total === "string" ? Number.parseInt(total, 10) : total;
2395
2477
  };
2396
2478
  var generateAndCreateApiKey = async (params, db) => {
2397
- const { tenantId, projectId, graphId, expiresAt } = params;
2479
+ const { tenantId, projectId, graphId, expiresAt, name } = params;
2398
2480
  const keyData = await generateApiKey();
2399
2481
  const apiKey = await createApiKey(db)({
2400
2482
  tenantId,
2401
2483
  projectId,
2402
2484
  graphId,
2485
+ name,
2403
2486
  expiresAt,
2404
2487
  ...keyData
2405
2488
  });
@@ -2595,7 +2678,21 @@ var isArtifactComponentAssociatedWithAgent = (db) => async (params) => {
2595
2678
  return result.length > 0;
2596
2679
  };
2597
2680
  var graphHasArtifactComponents = (db) => async (params) => {
2598
- const result = await db.select({ count: count() }).from(agentArtifactComponents).innerJoin(agents, eq(agentArtifactComponents.agentId, agents.id)).innerJoin(agentRelations, eq(agents.id, agentRelations.sourceAgentId)).where(
2681
+ const result = await db.select({ count: count() }).from(agentArtifactComponents).innerJoin(
2682
+ agents,
2683
+ and(
2684
+ eq(agentArtifactComponents.agentId, agents.id),
2685
+ eq(agentArtifactComponents.tenantId, agents.tenantId)
2686
+ )
2687
+ ).innerJoin(
2688
+ agentRelations,
2689
+ and(
2690
+ eq(agents.id, agentRelations.sourceAgentId),
2691
+ eq(agents.tenantId, agentRelations.tenantId),
2692
+ eq(agents.projectId, agentRelations.projectId),
2693
+ eq(agents.graphId, agentRelations.graphId)
2694
+ )
2695
+ ).where(
2599
2696
  and(
2600
2697
  eq(agentArtifactComponents.tenantId, params.scopes.tenantId),
2601
2698
  eq(agentArtifactComponents.projectId, params.scopes.projectId),
@@ -3783,22 +3880,22 @@ var createFullGraphServerSide = (db, logger11 = defaultLogger) => async (scopes,
3783
3880
  }
3784
3881
  const agentToolPromises = [];
3785
3882
  for (const [agentId, agentData] of Object.entries(typed.agents)) {
3786
- if (isInternalAgent(agentData) && agentData.tools && Array.isArray(agentData.tools)) {
3787
- for (const toolId of agentData.tools) {
3883
+ if (isInternalAgent(agentData) && agentData.canUse && Array.isArray(agentData.canUse)) {
3884
+ for (const canUseItem of agentData.canUse) {
3788
3885
  agentToolPromises.push(
3789
3886
  (async () => {
3790
3887
  try {
3791
- const selectedTools = agentData.selectedTools?.[toolId];
3888
+ const { toolId, toolSelection } = canUseItem;
3792
3889
  logger11.info({ agentId, toolId }, "Processing agent-tool relation");
3793
3890
  await upsertAgentToolRelation(db)({
3794
3891
  scopes: { tenantId, projectId, graphId: finalGraphId },
3795
3892
  agentId,
3796
3893
  toolId,
3797
- selectedTools
3894
+ selectedTools: toolSelection || void 0
3798
3895
  });
3799
3896
  logger11.info({ agentId, toolId }, "Agent-tool relation processed successfully");
3800
3897
  } catch (error) {
3801
- logger11.error({ agentId, toolId, error }, "Failed to create agent-tool relation");
3898
+ logger11.error({ agentId, toolId: canUseItem.toolId, error }, "Failed to create agent-tool relation");
3802
3899
  }
3803
3900
  })()
3804
3901
  );
@@ -4082,17 +4179,17 @@ var updateFullGraphServerSide = (db, logger11 = defaultLogger) => async (scopes,
4082
4179
  const modelTypes = ["base", "structuredOutput", "summarizer"];
4083
4180
  const cascadedModels = { ...finalModelSettings };
4084
4181
  for (const modelType of modelTypes) {
4085
- if (agentModels[modelType]?.model && existingGraphModels?.[modelType]?.model && agentModels[modelType].model === existingGraphModels[modelType].model && graphModels[modelType]?.model && graphModels[modelType].model !== existingGraphModels[modelType].model) {
4086
- cascadedModels[modelType] = {
4087
- ...cascadedModels[modelType],
4088
- model: graphModels[modelType].model
4089
- };
4182
+ if (agentModels[modelType]?.model && existingGraphModels?.[modelType]?.model && agentModels[modelType].model === existingGraphModels[modelType].model && graphModels[modelType] && // Model name changed
4183
+ (graphModels[modelType].model !== existingGraphModels[modelType].model || // OR providerOptions changed
4184
+ JSON.stringify(graphModels[modelType].providerOptions) !== JSON.stringify(existingGraphModels[modelType].providerOptions))) {
4185
+ cascadedModels[modelType] = graphModels[modelType];
4090
4186
  logger11.info(
4091
4187
  {
4092
4188
  agentId,
4093
4189
  modelType,
4094
4190
  oldModel: agentModels[modelType].model,
4095
- newModel: graphModels[modelType].model
4191
+ newModel: graphModels[modelType].model,
4192
+ hasProviderOptions: !!graphModels[modelType].providerOptions
4096
4193
  },
4097
4194
  "Cascading model change from graph to agent"
4098
4195
  );
@@ -4176,23 +4273,23 @@ var updateFullGraphServerSide = (db, logger11 = defaultLogger) => async (scopes,
4176
4273
  }
4177
4274
  const agentToolPromises = [];
4178
4275
  for (const [agentId, agentData] of Object.entries(typedGraphDefinition.agents)) {
4179
- if (isInternalAgent(agentData) && agentData.tools && Array.isArray(agentData.tools)) {
4180
- for (const toolId of agentData.tools) {
4276
+ if (isInternalAgent(agentData) && agentData.canUse && Array.isArray(agentData.canUse)) {
4277
+ for (const canUseItem of agentData.canUse) {
4181
4278
  agentToolPromises.push(
4182
4279
  (async () => {
4183
4280
  try {
4184
- const selectedTools = agentData.selectedTools?.[toolId];
4281
+ const { toolId, toolSelection } = canUseItem;
4185
4282
  await createAgentToolRelation(db)({
4186
4283
  scopes: { tenantId, projectId, graphId: finalGraphId },
4187
4284
  data: {
4188
4285
  agentId,
4189
4286
  toolId,
4190
- selectedTools
4287
+ selectedTools: toolSelection || void 0
4191
4288
  }
4192
4289
  });
4193
4290
  logger11.info({ agentId, toolId }, "Agent-tool relation created");
4194
4291
  } catch (error) {
4195
- logger11.error({ agentId, toolId, error }, "Failed to create agent-tool relation");
4292
+ logger11.error({ agentId, toolId: canUseItem.toolId, error }, "Failed to create agent-tool relation");
4196
4293
  }
4197
4294
  })()
4198
4295
  );
@@ -5056,7 +5153,6 @@ var createFullProjectServerSide = (db, logger11 = defaultLogger2) => async (scop
5056
5153
  );
5057
5154
  await upsertArtifactComponent(db)({
5058
5155
  data: {
5059
- id: componentId,
5060
5156
  ...componentData,
5061
5157
  tenantId,
5062
5158
  projectId: typed.id
@@ -5362,7 +5458,6 @@ var updateFullProjectServerSide = (db, logger11 = defaultLogger2) => async (scop
5362
5458
  );
5363
5459
  await upsertArtifactComponent(db)({
5364
5460
  data: {
5365
- id: componentId,
5366
5461
  ...componentData,
5367
5462
  tenantId,
5368
5463
  projectId: typed.id
@@ -5488,14 +5583,10 @@ var getFullProject = (db, logger11 = defaultLogger2) => async (params) => {
5488
5583
  id: tool2.id,
5489
5584
  name: tool2.name,
5490
5585
  config: tool2.config,
5491
- imageUrl: tool2.imageUrl || void 0,
5492
- status: tool2.status,
5493
- capabilities: tool2.capabilities || void 0,
5494
- lastHealthCheck: tool2.lastHealthCheck && !Number.isNaN(new Date(tool2.lastHealthCheck).getTime()) ? new Date(tool2.lastHealthCheck).toISOString() : void 0,
5495
- lastError: tool2.lastError || void 0,
5496
- availableTools: tool2.availableTools || void 0,
5497
- activeTools: tool2.config?.mcp?.activeTools || void 0,
5498
- lastToolsSync: tool2.lastToolsSync && !Number.isNaN(new Date(tool2.lastToolsSync).getTime()) ? new Date(tool2.lastToolsSync).toISOString() : void 0
5586
+ credentialReferenceId: tool2.credentialReferenceId || void 0,
5587
+ imageUrl: tool2.imageUrl || void 0
5588
+ // Don't include runtime fields in configuration
5589
+ // status, capabilities, lastHealthCheck, lastError, availableTools, activeTools, lastToolsSync are all runtime
5499
5590
  };
5500
5591
  }
5501
5592
  logger11.info(
@@ -8375,7 +8466,7 @@ function createDefaultCredentialStores() {
8375
8466
  if (process.env.NANGO_SECRET_KEY) {
8376
8467
  stores.push(
8377
8468
  createNangoCredentialStore("nango-default", {
8378
- apiUrl: process.env.NANGO_HOST || "https://api.nango.dev",
8469
+ apiUrl: process.env.NANGO_SERVER_URL || "https://api.nango.dev",
8379
8470
  secretKey: process.env.NANGO_SECRET_KEY
8380
8471
  })
8381
8472
  );
@@ -8411,7 +8502,7 @@ var loadEnvironmentFiles = () => {
8411
8502
  loadEnvironmentFiles();
8412
8503
  var envSchema = z$1.object({
8413
8504
  ENVIRONMENT: z$1.enum(["development", "production", "pentest", "test"]).optional(),
8414
- DB_FILE_NAME: z$1.string(),
8505
+ DB_FILE_NAME: z$1.string().optional(),
8415
8506
  OTEL_TRACES_FORCE_FLUSH_ENABLED: z$1.coerce.boolean().optional()
8416
8507
  });
8417
8508
  var parseEnv = () => {
@@ -8431,4 +8522,4 @@ ${error.message}`
8431
8522
  };
8432
8523
  parseEnv();
8433
8524
 
8434
- export { ConsoleLogger, ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStoreRegistry, CredentialStuffer, ERROR_DOCS_BASE_URL, ErrorCode, HTTP_REQUEST_PARTS, InMemoryCredentialStore, KeyChainStore, McpClient, NangoCredentialStore, NoOpLogger, TemplateEngine, addLedgerArtifacts, addToolToAgent, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, configureLogging, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentGraph, createAgentRelation, createAgentToolRelation, createApiError, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createDefaultCredentialStores, createExecutionContext, createExternalAgent, createExternalAgentRelation, createFullGraphServerSide, createFullProjectServerSide, createInMemoryDatabaseClient, createKeyChainStore, createMessage, createNangoCredentialStore, createOrGetConversation, createProject, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentGraph, deleteAgentRelation, deleteAgentRelationsByGraph, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullGraph, deleteFullProject, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteTool, detectAuthenticationRequired, determineContextTrigger, discoverOAuthEndpoints, errorResponseSchema, errorSchemaFactory, externalAgentExists, externalAgentUrlExists, extractPublicId, fetchComponentRelationships, fetchDefinition, generateAndCreateApiKey, generateApiKey, getActiveAgentForConversation, getAgentById, getAgentGraphById, getAgentGraphWithDefaultAgent, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByGraph, getAgentRelationsBySource, getAgentRelationsByTarget, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentsByIds, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getCachedValidator, getContextConfigById, getContextConfigCacheEntries, getContextConfigsByName, getConversation, getConversationCacheEntries, getConversationHistory, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithTools, getCredentialStoreLookupKeyFromRetrievalParams, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentRelations, getFullGraph, getFullGraphDefinition, getFullProject, getGraphAgentInfos, getHealthyToolsForAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getLogger, getMessageById, getMessagesByConversation, getMessagesByTask, getProject, getProjectResourceCounts, getRelatedAgentsForGraph, getRequestExecutionContext, getTask, getToolById, getToolsByStatus, getToolsForAgent, getTracer, getVisibleMessages, graphHasArtifactComponents, handleApiError, handleContextConfigChange, handleContextResolution, hasApiKey, hasContextConfig, hasCredentialReference, hashApiKey, invalidateInvocationDefinitionsCache, invalidateRequestContextCache, isApiKeyExpired, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentGraphs, listAgentGraphsPaginated, listAgentRelations, listAgentToolRelations, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listMessages, listProjects, listProjectsPaginated, listTaskIdsByContextId, listTools, listToolsByStatus, loadEnvironmentFiles, loggerFactory, maskApiKey, problemDetailsSchema, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, setSpanWithError, updateAgent, updateAgentGraph, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullGraphServerSide, updateFullProjectServerSide, updateMessage, updateProject, updateTask, updateTool, updateToolStatus, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertAgentGraph, upsertAgentRelation, upsertAgentToolRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateExternalAgent, validateHttpRequestHeaders, validateInternalAgent, validateProjectExists, validateRequestContext, validationHelper, withProjectValidation };
8525
+ export { ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStoreRegistry, CredentialStuffer, ERROR_DOCS_BASE_URL, ErrorCode, HTTP_REQUEST_PARTS, InMemoryCredentialStore, KeyChainStore, McpClient, NangoCredentialStore, PinoLogger, TemplateEngine, addLedgerArtifacts, addToolToAgent, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentGraph, createAgentRelation, createAgentToolRelation, createApiError, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createDefaultCredentialStores, createExecutionContext, createExternalAgent, createExternalAgentRelation, createFullGraphServerSide, createFullProjectServerSide, createInMemoryDatabaseClient, createKeyChainStore, createMessage, createNangoCredentialStore, createOrGetConversation, createProject, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentGraph, deleteAgentRelation, deleteAgentRelationsByGraph, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullGraph, deleteFullProject, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteTool, detectAuthenticationRequired, determineContextTrigger, discoverOAuthEndpoints, errorResponseSchema, errorSchemaFactory, externalAgentExists, externalAgentUrlExists, extractPublicId, fetchComponentRelationships, fetchDefinition, generateAndCreateApiKey, generateApiKey, getActiveAgentForConversation, getAgentById, getAgentGraphById, getAgentGraphWithDefaultAgent, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByGraph, getAgentRelationsBySource, getAgentRelationsByTarget, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentsByIds, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getCachedValidator, getContextConfigById, getContextConfigCacheEntries, getContextConfigsByName, getConversation, getConversationCacheEntries, getConversationHistory, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithTools, getCredentialStoreLookupKeyFromRetrievalParams, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentRelations, getFullGraph, getFullGraphDefinition, getFullProject, getGraphAgentInfos, getHealthyToolsForAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getLogger, getMessageById, getMessagesByConversation, getMessagesByTask, getProject, getProjectResourceCounts, getRelatedAgentsForGraph, getRequestExecutionContext, getTask, getToolById, getToolsByStatus, getToolsForAgent, getTracer, getVisibleMessages, graphHasArtifactComponents, handleApiError, handleContextConfigChange, handleContextResolution, hasApiKey, hasContextConfig, hasCredentialReference, hashApiKey, invalidateInvocationDefinitionsCache, invalidateRequestContextCache, isApiKeyExpired, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentGraphs, listAgentGraphsPaginated, listAgentRelations, listAgentToolRelations, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listMessages, listProjects, listProjectsPaginated, listTaskIdsByContextId, listTools, listToolsByStatus, loadEnvironmentFiles, loggerFactory, maskApiKey, problemDetailsSchema, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, setSpanWithError, updateAgent, updateAgentGraph, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullGraphServerSide, updateFullProjectServerSide, updateMessage, updateProject, updateTask, updateTool, updateToolStatus, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertAgentGraph, upsertAgentRelation, upsertAgentToolRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateExternalAgent, validateHttpRequestHeaders, validateInternalAgent, validateProjectExists, validateRequestContext, validationHelper, withProjectValidation };