@inkeep/agents-core 0.0.0-dev-20251009010805 → 0.0.0-dev-20251009070204

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,21 +1,21 @@
1
1
  export { TaskState } from './chunk-H2F72PDA.js';
2
- import { validateAndTypeGraphData, validateGraphStructure, isInternalAgent, isExternalAgent } from './chunk-MLKHAZVU.js';
3
- export { generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './chunk-MLKHAZVU.js';
4
- import { ContextConfigApiUpdateSchema, validatePropsAsJsonSchema } from './chunk-HZZTBK7Y.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, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionSelectSchema, FunctionToolConfigSchema, FunctionUpdateSchema, 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, SandboxConfigSchema, 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, validatePropsAsJsonSchema } from './chunk-HZZTBK7Y.js';
6
- import { schema_exports, agentRelations, agents, externalAgents, agentToolRelations, tools, contextConfigs, functions, credentialReferences, agentGraph, agentDataComponents, agentArtifactComponents, dataComponents, artifactComponents, projects, apiKeys, contextCache, conversations, messages, ledgerArtifacts, tasks, taskRelations } from './chunk-TN5JDW2L.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, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-TN5JDW2L.js';
2
+ import { validateAndTypeGraphData, validateGraphStructure, isInternalAgent, isExternalAgent } from './chunk-L53XWAYG.js';
3
+ export { generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './chunk-L53XWAYG.js';
4
+ import { ContextConfigApiUpdateSchema, validatePropsAsJsonSchema } from './chunk-TO2HNKGP.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, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionSelectSchema, FunctionToolConfigSchema, FunctionUpdateSchema, 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, SandboxConfigSchema, 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, validatePropsAsJsonSchema } from './chunk-TO2HNKGP.js';
6
+ import { schema_exports, agentRelations, agents, externalAgents, agentToolRelations, tools, contextConfigs, functions, credentialReferences, agentGraph, agentDataComponents, agentArtifactComponents, dataComponents, artifactComponents, projects, apiKeys, contextCache, conversations, messages, ledgerArtifacts, tasks, taskRelations } from './chunk-VPJ6Z5QZ.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, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-VPJ6Z5QZ.js';
8
8
  import { CredentialStoreType, MCPServerType, MCPTransportType } from './chunk-YFHT5M2R.js';
9
9
  export { CredentialStoreType, MCPServerType, MCPTransportType, TOOL_STATUS_VALUES, VALID_RELATION_TYPES } from './chunk-YFHT5M2R.js';
10
10
  import { getLogger, convertZodToJsonSchema } from './chunk-R2EERZSW.js';
11
11
  export { PinoLogger, convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, getLogger, isZodSchema, loggerFactory, preview } from './chunk-R2EERZSW.js';
12
12
  import { __publicField } from './chunk-MKBO26DX.js';
13
13
  import { z as z$1 } from 'zod';
14
+ import { customAlphabet, nanoid } from 'nanoid';
14
15
  import jmespath from 'jmespath';
15
16
  import { createClient } from '@libsql/client';
16
17
  import { drizzle } from 'drizzle-orm/libsql';
17
18
  import { and, eq, desc, count, isNotNull, inArray, sql, asc, not } from 'drizzle-orm';
18
- import { customAlphabet, nanoid } from 'nanoid';
19
19
  import crypto, { scrypt, randomBytes, timingSafeEqual } from 'crypto';
20
20
  import { promisify } from 'util';
21
21
  import { z } from '@hono/zod-openapi';
@@ -40,25 +40,31 @@ import { findUpSync } from 'find-up';
40
40
 
41
41
  // src/api-client/base-client.ts
42
42
  async function apiFetch(url, options = {}) {
43
- const headers = {
43
+ const headers2 = {
44
44
  "Content-Type": "application/json",
45
45
  Accept: "application/json",
46
46
  ...options.headers || {}
47
47
  };
48
48
  return fetch(url, {
49
49
  ...options,
50
- headers
50
+ headers: headers2
51
51
  });
52
52
  }
53
+ var generateId = customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789", 21);
54
+ function getConversationId() {
55
+ return generateId();
56
+ }
57
+
58
+ // src/context/ContextConfig.ts
53
59
  var logger = getLogger("context-config");
54
- var RequestContextSchemaBuilder = class {
60
+ var HeadersSchemaBuilder = class {
55
61
  constructor(options) {
56
62
  __publicField(this, "schema");
57
63
  this.schema = options.schema;
58
64
  }
59
- /** Template function for request context paths with type-safe autocomplete */
65
+ /** Template function for headers paths with type-safe autocomplete */
60
66
  toTemplate(path2) {
61
- return `{{requestContext.${path2}}}`;
67
+ return `{{headers.${path2}}}`;
62
68
  }
63
69
  getSchema() {
64
70
  return this.schema;
@@ -78,16 +84,16 @@ var ContextConfigBuilder = class {
78
84
  this.projectId = options.projectId || "default";
79
85
  this.graphId = options.graphId || "default";
80
86
  this.baseURL = process.env.INKEEP_AGENTS_MANAGE_API_URL || "http://localhost:3002";
81
- let requestContextSchema2;
82
- if (options.requestContextSchema) {
83
- const actualSchema = options.requestContextSchema instanceof RequestContextSchemaBuilder ? options.requestContextSchema.getSchema() : options.requestContextSchema;
87
+ let headers2;
88
+ if (options.headers) {
89
+ const actualSchema = options.headers instanceof HeadersSchemaBuilder ? options.headers.getSchema() : options.headers;
84
90
  logger.info(
85
91
  {
86
- requestContextSchema: options.requestContextSchema
92
+ headers: options.headers
87
93
  },
88
- "Converting request headers schema to JSON Schema for database storage"
94
+ "Converting headers schema to JSON Schema for database storage"
89
95
  );
90
- requestContextSchema2 = convertZodToJsonSchema(actualSchema);
96
+ headers2 = convertZodToJsonSchema(actualSchema);
91
97
  }
92
98
  const processedContextVariables = {};
93
99
  if (options.contextVariables) {
@@ -110,12 +116,10 @@ var ContextConfigBuilder = class {
110
116
  }
111
117
  }
112
118
  this.config = {
113
- id: options.id,
119
+ id: options.id || generateId(),
114
120
  tenantId: this.tenantId,
115
121
  projectId: this.projectId,
116
- name: options.name,
117
- description: options.description || "",
118
- requestContextSchema: requestContextSchema2,
122
+ headersSchema: headers2,
119
123
  contextVariables: processedContextVariables
120
124
  };
121
125
  logger.info(
@@ -157,9 +161,7 @@ var ContextConfigBuilder = class {
157
161
  tenantId: this.tenantId,
158
162
  projectId: this.projectId,
159
163
  graphId: this.graphId,
160
- name: this.getName(),
161
- description: this.getDescription(),
162
- requestContextSchema: this.getRequestContextSchema(),
164
+ headersSchema: this.getHeadersSchema(),
163
165
  contextVariables: this.getContextVariables(),
164
166
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
165
167
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
@@ -172,24 +174,15 @@ var ContextConfigBuilder = class {
172
174
  }
173
175
  return this.config.id;
174
176
  }
175
- getName() {
176
- if (!this.config.name) {
177
- throw new Error("Context config name is not set");
178
- }
179
- return this.config.name;
180
- }
181
- getDescription() {
182
- return this.config.description || "";
183
- }
184
- getRequestContextSchema() {
185
- return this.config.requestContextSchema || null;
177
+ getHeadersSchema() {
178
+ return this.config.headersSchema || null;
186
179
  }
187
180
  getContextVariables() {
188
181
  return this.config.contextVariables || {};
189
182
  }
190
183
  // Builder methods for fluent API
191
- withRequestContextSchema(schema) {
192
- this.config.requestContextSchema = schema;
184
+ withHeadersSchema(schema) {
185
+ this.config.headersSchema = schema;
193
186
  return this;
194
187
  }
195
188
  /** 4) The function you ship: path autocomplete + validation, returns {{path}} */
@@ -200,19 +193,17 @@ var ContextConfigBuilder = class {
200
193
  validate() {
201
194
  try {
202
195
  const contextVariables = this.config.contextVariables || {};
203
- if ("requestContext" in contextVariables) {
196
+ if ("headers" in contextVariables) {
204
197
  return {
205
198
  valid: false,
206
199
  errors: [
207
- "The key 'requestContext' is reserved for the request context and cannot be used in contextVariables"
200
+ "The key 'headers' is reserved for the headers context and cannot be used in contextVariables"
208
201
  ]
209
202
  };
210
203
  }
211
204
  ContextConfigApiUpdateSchema.parse({
212
205
  id: this.config.id,
213
- name: this.config.name,
214
- description: this.config.description,
215
- requestContextSchema: this.config.requestContextSchema,
206
+ headersSchema: this.config.headersSchema,
216
207
  contextVariables: this.config.contextVariables
217
208
  });
218
209
  return { valid: true, errors: [] };
@@ -255,9 +246,7 @@ var ContextConfigBuilder = class {
255
246
  async upsertContextConfig() {
256
247
  const configData = {
257
248
  id: this.getId(),
258
- name: this.getName(),
259
- description: this.getDescription(),
260
- requestContextSchema: this.getRequestContextSchema(),
249
+ headersSchema: this.getHeadersSchema(),
261
250
  contextVariables: this.getContextVariables()
262
251
  };
263
252
  try {
@@ -339,8 +328,8 @@ var ContextConfigBuilder = class {
339
328
  function contextConfig(options) {
340
329
  return new ContextConfigBuilder(options);
341
330
  }
342
- function requestContextSchema(options) {
343
- return new RequestContextSchemaBuilder(options);
331
+ function headers(options) {
332
+ return new HeadersSchemaBuilder(options);
344
333
  }
345
334
  function fetchDefinition(options) {
346
335
  const fetchConfig = options.fetchConfig;
@@ -405,15 +394,15 @@ var _TemplateEngine = class _TemplateEngine {
405
394
  if (options.preserveUnresolved) {
406
395
  return match2;
407
396
  }
408
- if (trimmedPath.startsWith("requestContext.")) {
397
+ if (trimmedPath.startsWith("headers.")) {
409
398
  logger2.warn(
410
399
  {
411
400
  variable: trimmedPath,
412
401
  availableKeys: Object.keys(context),
413
402
  contextStructure: JSON.stringify(context, null, 2),
414
- requestContextContent: context.requestContext ? JSON.stringify(context.requestContext, null, 2) : "undefined"
403
+ headersContent: context.headers ? JSON.stringify(context.headers, null, 2) : "undefined"
415
404
  },
416
- "RequestContext template variable debugging"
405
+ "Headers template variable debugging"
417
406
  );
418
407
  } else {
419
408
  logger2.warn(
@@ -615,12 +604,12 @@ var CredentialStuffer = class {
615
604
  metadata: nangoCredentialData.metadata
616
605
  };
617
606
  }
618
- const headers = {};
607
+ const headers2 = {};
619
608
  if (nangoCredentialData.token) {
620
- headers.Authorization = `Bearer ${nangoCredentialData.token}`;
609
+ headers2.Authorization = `Bearer ${nangoCredentialData.token}`;
621
610
  }
622
611
  return {
623
- headers,
612
+ headers: headers2,
624
613
  metadata: nangoCredentialData.metadata
625
614
  };
626
615
  } catch (parseError) {
@@ -665,23 +654,23 @@ var CredentialStuffer = class {
665
654
  }) || context.tenantId;
666
655
  }
667
656
  /**
668
- * Get credentials from request context
657
+ * Get credentials from headers context
669
658
  */
670
- async getCredentialsFromRequestContext(credentialContext, headers) {
659
+ async getCredentialsFromHeaders(credentialContext, headers2) {
671
660
  const contextConfigId = credentialContext.contextConfigId;
672
661
  const conversationId = credentialContext.conversationId;
673
662
  if (!contextConfigId || !conversationId || !this.contextResolver) {
674
663
  return null;
675
664
  }
676
- const requestContext = await this.contextResolver.resolveRequestContext(
665
+ const context = await this.contextResolver.resolveHeaders(
677
666
  conversationId,
678
667
  contextConfigId
679
668
  );
680
669
  const resolvedHeaders = {};
681
- for (const [key, value] of Object.entries(headers)) {
670
+ for (const [key, value] of Object.entries(headers2)) {
682
671
  resolvedHeaders[key] = TemplateEngine.render(
683
672
  value,
684
- { requestContext },
673
+ context,
685
674
  { strict: true }
686
675
  );
687
676
  }
@@ -697,23 +686,23 @@ var CredentialStuffer = class {
697
686
  context,
698
687
  mcpType,
699
688
  storeReference,
700
- headers
689
+ headers: headers2
701
690
  }) {
702
- let credentialsFromRequestContext = null;
703
- if (context.contextConfigId && context.conversationId && headers) {
704
- credentialsFromRequestContext = await this.getCredentialsFromRequestContext(context, headers);
691
+ let credentialsFromHeaders = null;
692
+ if (context.contextConfigId && context.conversationId && headers2) {
693
+ credentialsFromHeaders = await this.getCredentialsFromHeaders(context, headers2);
705
694
  }
706
695
  let credentialStoreHeaders = null;
707
696
  if (storeReference) {
708
697
  credentialStoreHeaders = await this.getCredentials(context, storeReference, mcpType);
709
698
  }
710
699
  if (!credentialStoreHeaders) {
711
- return credentialsFromRequestContext ? credentialsFromRequestContext.headers : {};
700
+ return credentialsFromHeaders ? credentialsFromHeaders.headers : {};
712
701
  }
713
702
  const combinedHeaders = {
714
703
  ...credentialStoreHeaders.headers,
715
704
  ...credentialStoreHeaders.metadata,
716
- ...credentialsFromRequestContext?.headers
705
+ ...credentialsFromHeaders?.headers
717
706
  };
718
707
  return combinedHeaders;
719
708
  }
@@ -1478,9 +1467,7 @@ var createContextConfig = (db) => async (params) => {
1478
1467
  tenantId: params.tenantId,
1479
1468
  projectId: params.projectId,
1480
1469
  graphId: params.graphId,
1481
- name: params.name,
1482
- description: params.description,
1483
- requestContextSchema: params.requestContextSchema ?? null,
1470
+ headersSchema: params.headersSchema ?? null,
1484
1471
  contextVariables: contextVariables ?? null,
1485
1472
  createdAt: now,
1486
1473
  updatedAt: now
@@ -1495,8 +1482,8 @@ var updateContextConfig = (db) => async (params) => {
1495
1482
  processedData.contextVariables = null;
1496
1483
  }
1497
1484
  }
1498
- if ("requestContextSchema" in params.data && params.data.requestContextSchema === null) {
1499
- processedData.requestContextSchema = null;
1485
+ if ("headersSchema" in params.data && params.data.headersSchema === null) {
1486
+ processedData.headersSchema = null;
1500
1487
  }
1501
1488
  const updated = await db.update(contextConfigs).set({
1502
1489
  ...processedData,
@@ -1542,17 +1529,6 @@ var countContextConfigs = (db) => async (params) => {
1542
1529
  const total = result[0]?.count || 0;
1543
1530
  return typeof total === "string" ? Number.parseInt(total, 10) : total;
1544
1531
  };
1545
- var getContextConfigsByName = (db) => async (params) => {
1546
- return await db.query.contextConfigs.findMany({
1547
- where: and(
1548
- eq(contextConfigs.tenantId, params.scopes.tenantId),
1549
- eq(contextConfigs.projectId, params.scopes.projectId),
1550
- eq(contextConfigs.graphId, params.scopes.graphId),
1551
- eq(contextConfigs.name, params.name)
1552
- ),
1553
- orderBy: [desc(contextConfigs.createdAt)]
1554
- });
1555
- };
1556
1532
  var upsertContextConfig = (db) => async (params) => {
1557
1533
  const scopes = {
1558
1534
  tenantId: params.data.tenantId,
@@ -1569,9 +1545,7 @@ var upsertContextConfig = (db) => async (params) => {
1569
1545
  scopes,
1570
1546
  id: params.data.id,
1571
1547
  data: {
1572
- name: params.data.name,
1573
- description: params.data.description,
1574
- requestContextSchema: params.data.requestContextSchema,
1548
+ headersSchema: params.data.headersSchema,
1575
1549
  contextVariables: params.data.contextVariables
1576
1550
  }
1577
1551
  });
@@ -1991,10 +1965,6 @@ var detectAuthenticationRequired = async ({
1991
1965
  );
1992
1966
  return false;
1993
1967
  };
1994
- var generateId = customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789", 21);
1995
- function getConversationId() {
1996
- return generateId();
1997
- }
1998
1968
  var ErrorCode = z.enum([
1999
1969
  "bad_request",
2000
1970
  "unauthorized",
@@ -2754,7 +2724,7 @@ var discoverToolsFromServer = async (tool2, dbClient, credentialStoreRegistry) =
2754
2724
  }
2755
2725
  };
2756
2726
  var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry) => {
2757
- const { headers, capabilities, credentialReferenceId, imageUrl, createdAt, ...rest } = dbResult;
2727
+ const { headers: headers2, capabilities, credentialReferenceId, imageUrl, createdAt, ...rest } = dbResult;
2758
2728
  if (dbResult.config.type !== "mcp") {
2759
2729
  return {
2760
2730
  ...rest,
@@ -2767,7 +2737,7 @@ var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry) => {
2767
2737
  createdAt: new Date(createdAt),
2768
2738
  updatedAt: new Date(dbResult.updatedAt),
2769
2739
  lastError: null,
2770
- headers: headers || void 0,
2740
+ headers: headers2 || void 0,
2771
2741
  imageUrl: imageUrl || void 0
2772
2742
  };
2773
2743
  }
@@ -2808,7 +2778,7 @@ var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry) => {
2808
2778
  createdAt: new Date(createdAt),
2809
2779
  updatedAt: new Date(now),
2810
2780
  lastError: lastErrorComputed,
2811
- headers: headers || void 0,
2781
+ headers: headers2 || void 0,
2812
2782
  imageUrl: imageUrl || void 0
2813
2783
  };
2814
2784
  };
@@ -3324,9 +3294,7 @@ var getFullGraphDefinition = (db) => async ({
3324
3294
  if (contextConfig2) {
3325
3295
  result.contextConfig = {
3326
3296
  id: contextConfig2.id,
3327
- name: contextConfig2.name,
3328
- description: contextConfig2.description,
3329
- requestContextSchema: contextConfig2.requestContextSchema,
3297
+ headersSchema: contextConfig2.headersSchema,
3330
3298
  contextVariables: contextConfig2.contextVariables
3331
3299
  };
3332
3300
  }
@@ -3939,14 +3907,14 @@ var cleanupTenantCache = (db) => async (params) => {
3939
3907
  );
3940
3908
  return result.rowsAffected || 0;
3941
3909
  };
3942
- var invalidateRequestContextCache = (db) => async (params) => {
3910
+ var invalidateHeadersCache = (db) => async (params) => {
3943
3911
  const result = await db.delete(contextCache).where(
3944
3912
  and(
3945
3913
  eq(contextCache.tenantId, params.scopes.tenantId),
3946
3914
  eq(contextCache.projectId, params.scopes.projectId),
3947
3915
  eq(contextCache.conversationId, params.conversationId),
3948
3916
  eq(contextCache.contextConfigId, params.contextConfigId),
3949
- eq(contextCache.contextVariableKey, "requestContext")
3917
+ eq(contextCache.contextVariableKey, "headers")
3950
3918
  )
3951
3919
  );
3952
3920
  return result.rowsAffected || 0;
@@ -4670,14 +4638,14 @@ var createFullGraphServerSide = (db, logger12 = defaultLogger) => async (scopes,
4670
4638
  agentToolPromises.push(
4671
4639
  (async () => {
4672
4640
  try {
4673
- const { toolId, toolSelection, headers, agentToolRelationId } = canUseItem;
4641
+ const { toolId, toolSelection, headers: headers2, agentToolRelationId } = canUseItem;
4674
4642
  logger12.info({ agentId, toolId }, "Processing agent-tool relation");
4675
4643
  await upsertAgentToolRelation(db)({
4676
4644
  scopes: { tenantId, projectId, graphId: finalGraphId },
4677
4645
  agentId,
4678
4646
  toolId,
4679
4647
  selectedTools: toolSelection || void 0,
4680
- headers: headers || void 0,
4648
+ headers: headers2 || void 0,
4681
4649
  relationId: agentToolRelationId
4682
4650
  });
4683
4651
  logger12.info({ agentId, toolId }, "Agent-tool relation processed successfully");
@@ -5188,14 +5156,14 @@ var updateFullGraphServerSide = (db, logger12 = defaultLogger) => async (scopes,
5188
5156
  agentToolPromises.push(
5189
5157
  (async () => {
5190
5158
  try {
5191
- const { toolId, toolSelection, headers, agentToolRelationId } = canUseItem;
5159
+ const { toolId, toolSelection, headers: headers2, agentToolRelationId } = canUseItem;
5192
5160
  logger12.info({ agentId, toolId }, "Processing agent-tool relation");
5193
5161
  await upsertAgentToolRelation(db)({
5194
5162
  scopes: { tenantId, projectId, graphId: finalGraphId },
5195
5163
  agentId,
5196
5164
  toolId,
5197
5165
  selectedTools: toolSelection || void 0,
5198
- headers: headers || void 0,
5166
+ headers: headers2 || void 0,
5199
5167
  relationId: agentToolRelationId
5200
5168
  });
5201
5169
  logger12.info(
@@ -7180,8 +7148,8 @@ var ContextCache = class {
7180
7148
  invocationDefinitionIds: definitionIds
7181
7149
  });
7182
7150
  }
7183
- async invalidateRequestContext(tenantId, projectId, conversationId, contextConfigId) {
7184
- await invalidateRequestContextCache(this.dbClient)({
7151
+ async invalidateHeaders(tenantId, projectId, conversationId, contextConfigId) {
7152
+ await invalidateHeadersCache(this.dbClient)({
7185
7153
  scopes: { tenantId, projectId },
7186
7154
  conversationId,
7187
7155
  contextConfigId
@@ -7234,21 +7202,21 @@ var ContextResolver = class {
7234
7202
  try {
7235
7203
  const result = {
7236
7204
  resolvedContext: {},
7237
- requestContext: options.requestContext || {},
7205
+ headers: options.headers || {},
7238
7206
  fetchedDefinitions: [],
7239
7207
  cacheHits: [],
7240
7208
  cacheMisses: [],
7241
7209
  errors: [],
7242
7210
  totalDurationMs: 0
7243
7211
  };
7244
- result.resolvedContext.requestContext = result.requestContext;
7245
- const currentRequestContext = await this.cache.get({
7212
+ result.resolvedContext.headers = result.headers;
7213
+ const currentHeaders = await this.cache.get({
7246
7214
  conversationId: options.conversationId,
7247
7215
  contextConfigId: contextConfig2.id,
7248
- contextVariableKey: "requestContext"
7216
+ contextVariableKey: "headers"
7249
7217
  });
7250
- if (options.requestContext && Object.keys(options.requestContext).length > 0) {
7251
- await this.cache.invalidateRequestContext(
7218
+ if (options.headers && Object.keys(options.headers).length > 0) {
7219
+ await this.cache.invalidateHeaders(
7252
7220
  this.tenantId,
7253
7221
  this.projectId,
7254
7222
  options.conversationId,
@@ -7259,13 +7227,13 @@ var ContextResolver = class {
7259
7227
  conversationId: options.conversationId,
7260
7228
  contextConfigId: contextConfig2.id
7261
7229
  },
7262
- "Invalidated request context in cache"
7230
+ "Invalidated headers in cache"
7263
7231
  );
7264
7232
  await this.cache.set({
7265
7233
  contextConfigId: contextConfig2.id,
7266
- contextVariableKey: "requestContext",
7234
+ contextVariableKey: "headers",
7267
7235
  conversationId: options.conversationId,
7268
- value: options.requestContext,
7236
+ value: options.headers,
7269
7237
  tenantId: this.tenantId
7270
7238
  });
7271
7239
  logger7.info(
@@ -7273,14 +7241,14 @@ var ContextResolver = class {
7273
7241
  conversationId: options.conversationId,
7274
7242
  contextConfigId: contextConfig2.id
7275
7243
  },
7276
- "Request context set in cache"
7244
+ "Headers set in cache"
7277
7245
  );
7278
- } else if (currentRequestContext) {
7279
- result.requestContext = currentRequestContext.value;
7246
+ } else if (currentHeaders) {
7247
+ result.headers = currentHeaders.value;
7280
7248
  } else {
7281
- result.requestContext = {};
7249
+ result.headers = {};
7282
7250
  }
7283
- result.resolvedContext.requestContext = result.requestContext;
7251
+ result.resolvedContext.headers = result.headers;
7284
7252
  const contextVariables = contextConfig2.contextVariables || {};
7285
7253
  const contextVariableEntries = Object.entries(contextVariables);
7286
7254
  if (contextVariableEntries.length === 0) {
@@ -7309,7 +7277,7 @@ var ContextResolver = class {
7309
7277
  invocationDefs.map(([, def]) => def.id)
7310
7278
  );
7311
7279
  }
7312
- const requestHash = this.createRequestHash(result.requestContext);
7280
+ const requestHash = this.createRequestHash(result.headers);
7313
7281
  const fetchPromises = contextVariableEntries.map(
7314
7282
  ([templateKey, definition]) => this.resolveSingleFetchDefinition(
7315
7283
  contextConfig2,
@@ -7482,13 +7450,13 @@ var ContextResolver = class {
7482
7450
  );
7483
7451
  }
7484
7452
  /**
7485
- * Resolve the request context for a given conversation
7453
+ * Resolve the headers for a given conversation
7486
7454
  */
7487
- async resolveRequestContext(conversationId, contextConfigId) {
7455
+ async resolveHeaders(conversationId, contextConfigId) {
7488
7456
  const cachedEntry = await this.cache.get({
7489
7457
  conversationId,
7490
7458
  contextConfigId,
7491
- contextVariableKey: "requestContext"
7459
+ contextVariableKey: "headers"
7492
7460
  });
7493
7461
  if (cachedEntry) {
7494
7462
  return cachedEntry.value;
@@ -7496,10 +7464,10 @@ var ContextResolver = class {
7496
7464
  return {};
7497
7465
  }
7498
7466
  /**
7499
- * Create a hash of the request context for cache invalidation
7467
+ * Create a hash of the headers for cache invalidation
7500
7468
  */
7501
- createRequestHash(requestContext) {
7502
- const contextString = JSON.stringify(requestContext, Object.keys(requestContext).sort());
7469
+ createRequestHash(headers2) {
7470
+ const contextString = JSON.stringify(headers2, Object.keys(headers2).sort());
7503
7471
  return crypto.createHash("sha256").update(contextString).digest("hex").substring(0, 16);
7504
7472
  }
7505
7473
  /**
@@ -7685,7 +7653,7 @@ async function validateHttpRequestHeaders(headersSchema, httpRequest) {
7685
7653
  };
7686
7654
  }
7687
7655
  }
7688
- async function fetchExistingRequestContext({
7656
+ async function fetchExistingHeaders({
7689
7657
  tenantId,
7690
7658
  projectId,
7691
7659
  contextConfig: contextConfig2,
@@ -7694,22 +7662,22 @@ async function fetchExistingRequestContext({
7694
7662
  credentialStores
7695
7663
  }) {
7696
7664
  const contextResolver = new ContextResolver(tenantId, projectId, dbClient, credentialStores);
7697
- const requestContext = await contextResolver.resolveRequestContext(
7665
+ const headers2 = await contextResolver.resolveHeaders(
7698
7666
  conversationId,
7699
7667
  contextConfig2.id
7700
7668
  );
7701
- if (Object.keys(requestContext).length > 0) {
7669
+ if (Object.keys(headers2).length > 0) {
7702
7670
  return {
7703
7671
  valid: true,
7704
7672
  errors: [],
7705
- validatedContext: requestContext
7673
+ validatedContext: headers2
7706
7674
  };
7707
7675
  }
7708
7676
  throw new Error(
7709
- "No request context found in cache. Please provide requestContext in request body."
7677
+ "No headers found in cache. Please provide headers in request."
7710
7678
  );
7711
7679
  }
7712
- async function validateRequestContext({
7680
+ async function validateHeaders({
7713
7681
  tenantId,
7714
7682
  projectId,
7715
7683
  graphId,
@@ -7746,10 +7714,10 @@ async function validateRequestContext({
7746
7714
  ]
7747
7715
  };
7748
7716
  }
7749
- if (!contextConfig2.requestContextSchema) {
7717
+ if (!contextConfig2.headersSchema) {
7750
7718
  logger8.debug(
7751
7719
  { contextConfigId: contextConfig2.id },
7752
- "No request context schema defined, accepting any context"
7720
+ "No headers schema defined, accepting any context"
7753
7721
  );
7754
7722
  return {
7755
7723
  valid: true,
@@ -7758,7 +7726,7 @@ async function validateRequestContext({
7758
7726
  };
7759
7727
  }
7760
7728
  try {
7761
- const schema = contextConfig2.requestContextSchema;
7729
+ const schema = contextConfig2.headersSchema;
7762
7730
  logger8.debug({ contextConfigId: contextConfig2.id }, "Using headers schema validation");
7763
7731
  const httpRequest = parsedRequest;
7764
7732
  const validationResult = await validateHttpRequestHeaders(schema, httpRequest);
@@ -7766,7 +7734,7 @@ async function validateRequestContext({
7766
7734
  return validationResult;
7767
7735
  }
7768
7736
  try {
7769
- return await fetchExistingRequestContext({
7737
+ return await fetchExistingHeaders({
7770
7738
  tenantId,
7771
7739
  projectId,
7772
7740
  contextConfig: contextConfig2,
@@ -7776,8 +7744,8 @@ async function validateRequestContext({
7776
7744
  });
7777
7745
  } catch (_error) {
7778
7746
  validationResult.errors.push({
7779
- field: "requestContext",
7780
- message: "Failed to fetch request context from cache"
7747
+ field: "headers",
7748
+ message: "Failed to fetch headers from cache"
7781
7749
  });
7782
7750
  return validationResult;
7783
7751
  }
@@ -7806,7 +7774,7 @@ async function validateRequestContext({
7806
7774
  graphId,
7807
7775
  error: error instanceof Error ? error.message : "Unknown error"
7808
7776
  },
7809
- "Failed to validate request context"
7777
+ "Failed to validate headers"
7810
7778
  );
7811
7779
  return {
7812
7780
  valid: false,
@@ -7834,15 +7802,15 @@ function contextValidationMiddleware(dbClient) {
7834
7802
  }
7835
7803
  const body = c.get("requestBody") || {};
7836
7804
  const conversationId = body.conversationId || "";
7837
- const headers = {};
7805
+ const headers2 = {};
7838
7806
  c.req.raw.headers.forEach((value, key) => {
7839
- headers[key.toLowerCase()] = value;
7807
+ headers2[key.toLowerCase()] = value;
7840
7808
  });
7841
7809
  const credentialStores = c.get("credentialStores");
7842
7810
  const parsedRequest = {
7843
- headers
7811
+ headers: headers2
7844
7812
  };
7845
- const validationResult = await validateRequestContext({
7813
+ const validationResult = await validateHeaders({
7846
7814
  tenantId,
7847
7815
  projectId,
7848
7816
  graphId,
@@ -7858,9 +7826,9 @@ function contextValidationMiddleware(dbClient) {
7858
7826
  graphId,
7859
7827
  errors: validationResult.errors
7860
7828
  },
7861
- "Request context validation failed"
7829
+ "Headers validation failed"
7862
7830
  );
7863
- const errorMessage = `Invalid request context: ${validationResult.errors.map((e) => `${e.field}: ${e.message}`).join(", ")}`;
7831
+ const errorMessage = `Invalid headers: ${validationResult.errors.map((e) => `${e.field}: ${e.message}`).join(", ")}`;
7864
7832
  throw createApiError({
7865
7833
  code: "bad_request",
7866
7834
  message: errorMessage
@@ -8267,7 +8235,7 @@ async function handleContextResolution({
8267
8235
  projectId,
8268
8236
  graphId,
8269
8237
  conversationId,
8270
- requestContext,
8238
+ headers: headers2,
8271
8239
  dbClient,
8272
8240
  credentialStores
8273
8241
  }) {
@@ -8275,7 +8243,7 @@ async function handleContextResolution({
8275
8243
  "context.handle_context_resolution",
8276
8244
  {
8277
8245
  attributes: {
8278
- "context.request_context_keys": Object.keys(requestContext)
8246
+ "context.headers_keys": Object.keys(headers2)
8279
8247
  }
8280
8248
  },
8281
8249
  async (parentSpan) => {
@@ -8323,7 +8291,7 @@ async function handleContextResolution({
8323
8291
  const contextResult = await contextResolver.resolve(contextConfig2, {
8324
8292
  triggerEvent: trigger,
8325
8293
  conversationId,
8326
- requestContext,
8294
+ headers: headers2,
8327
8295
  tenantId
8328
8296
  });
8329
8297
  const resolvedContext = {
@@ -9211,4 +9179,4 @@ ${error.message}`
9211
9179
  };
9212
9180
  parseEnv();
9213
9181
 
9214
- export { ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStoreRegistry, CredentialStuffer, ERROR_DOCS_BASE_URL, ErrorCode, HTTP_REQUEST_PARTS, InMemoryCredentialStore, KeyChainStore, McpClient, NangoCredentialStore, TemplateEngine, addLedgerArtifacts, addToolToAgent, apiFetch, 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, deleteFunction, 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, getConversationId, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithTools, getCredentialStoreLookupKeyFromRetrievalParams, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentRelations, getFullGraph, getFullGraphDefinition, getFullProject, getFunction, getGraphAgentInfos, getLedgerArtifacts, getLedgerArtifactsByContext, getMessageById, getMessagesByConversation, getMessagesByTask, getProject, getProjectResourceCounts, getRelatedAgentsForGraph, getRequestExecutionContext, getTask, getToolById, 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, listFunctions, listMessages, listProjects, listProjectsPaginated, listTaskIdsByContextId, listTools, loadEnvironmentFiles, maskApiKey, problemDetailsSchema, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, requestContextSchema, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, setSpanWithError, updateAgent, updateAgentGraph, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullGraphServerSide, updateFullProjectServerSide, updateMessage, updateProject, updateTask, updateTool, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertAgentGraph, upsertAgentRelation, upsertAgentToolRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertLedgerArtifact, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateExternalAgent, validateHttpRequestHeaders, validateInternalAgent, validateProjectExists, validateRequestContext, validationHelper, withProjectValidation };
9182
+ export { ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStoreRegistry, CredentialStuffer, ERROR_DOCS_BASE_URL, ErrorCode, HTTP_REQUEST_PARTS, InMemoryCredentialStore, KeyChainStore, McpClient, NangoCredentialStore, TemplateEngine, addLedgerArtifacts, addToolToAgent, apiFetch, 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, deleteFunction, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteTool, detectAuthenticationRequired, determineContextTrigger, discoverOAuthEndpoints, errorResponseSchema, errorSchemaFactory, externalAgentExists, externalAgentUrlExists, extractPublicId, fetchComponentRelationships, fetchDefinition, generateAndCreateApiKey, generateApiKey, generateId, 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, getConversation, getConversationCacheEntries, getConversationHistory, getConversationId, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithTools, getCredentialStoreLookupKeyFromRetrievalParams, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentRelations, getFullGraph, getFullGraphDefinition, getFullProject, getFunction, getGraphAgentInfos, getLedgerArtifacts, getLedgerArtifactsByContext, getMessageById, getMessagesByConversation, getMessagesByTask, getProject, getProjectResourceCounts, getRelatedAgentsForGraph, getRequestExecutionContext, getTask, getToolById, getToolsForAgent, getTracer, getVisibleMessages, graphHasArtifactComponents, handleApiError, handleContextConfigChange, handleContextResolution, hasApiKey, hasContextConfig, hasCredentialReference, hashApiKey, headers, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isApiKeyExpired, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentGraphs, listAgentGraphsPaginated, listAgentRelations, listAgentToolRelations, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listFunctions, listMessages, listProjects, listProjectsPaginated, listTaskIdsByContextId, listTools, loadEnvironmentFiles, 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, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertAgentGraph, upsertAgentRelation, upsertAgentToolRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertLedgerArtifact, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateExternalAgent, validateHeaders, validateHttpRequestHeaders, validateInternalAgent, validateProjectExists, validationHelper, withProjectValidation };