@inkeep/agents-core 0.8.7 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-AX77SEE3.js → chunk-JXAL2ALG.js} +1 -0
- package/dist/{chunk-GPGFF2K4.js → chunk-YVGNJIQZ.js} +1 -1
- package/dist/client-exports.cjs +1 -0
- package/dist/client-exports.d.cts +6 -5
- package/dist/client-exports.d.ts +6 -5
- package/dist/client-exports.js +2 -2
- package/dist/db/schema.d.cts +2 -2
- package/dist/db/schema.d.ts +2 -2
- package/dist/index.cjs +346 -111
- package/dist/index.d.cts +166 -186
- package/dist/index.d.ts +166 -186
- package/dist/index.js +351 -116
- package/dist/{schema-BsLudkuV.d.cts → schema-BXVLXPQq.d.cts} +1 -1
- package/dist/{schema-CjWNQuEl.d.ts → schema-D66X7wP_.d.ts} +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/{utility-DP6lt8z3.d.cts → utility-D7QP8MkV.d.cts} +157 -152
- package/dist/{utility-DP6lt8z3.d.ts → utility-D7QP8MkV.d.ts} +157 -152
- package/dist/validation/index.cjs +1 -0
- package/dist/validation/index.d.cts +2 -2
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +2 -2
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { TaskState } from './chunk-H2F72PDA.js';
|
|
2
|
-
import { validateAndTypeGraphData, validateGraphStructure, isInternalAgent, isExternalAgent } from './chunk-
|
|
3
|
-
export { generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './chunk-
|
|
4
|
-
import { ContextConfigApiUpdateSchema } from './chunk-
|
|
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-
|
|
2
|
+
import { validateAndTypeGraphData, validateGraphStructure, isInternalAgent, isExternalAgent } from './chunk-YVGNJIQZ.js';
|
|
3
|
+
export { generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './chunk-YVGNJIQZ.js';
|
|
4
|
+
import { ContextConfigApiUpdateSchema } from './chunk-JXAL2ALG.js';
|
|
5
|
+
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentArtifactComponentApiInsertSchema, AgentArtifactComponentApiSelectSchema, AgentArtifactComponentApiUpdateSchema, AgentArtifactComponentInsertSchema, AgentArtifactComponentSelectSchema, AgentArtifactComponentUpdateSchema, AgentDataComponentApiInsertSchema, AgentDataComponentApiSelectSchema, AgentDataComponentApiUpdateSchema, AgentDataComponentInsertSchema, AgentDataComponentSelectSchema, AgentDataComponentUpdateSchema, AgentGraphApiInsertSchema, AgentGraphApiSelectSchema, AgentGraphApiUpdateSchema, AgentGraphInsertSchema, AgentGraphSelectSchema, AgentGraphUpdateSchema, AgentInsertSchema, AgentRelationApiInsertSchema, AgentRelationApiSelectSchema, AgentRelationApiUpdateSchema, AgentRelationInsertSchema, AgentRelationQuerySchema, AgentRelationSelectSchema, AgentRelationUpdateSchema, AgentSelectSchema, AgentStopWhenSchema, AgentToolRelationApiInsertSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiUpdateSchema, AgentToolRelationInsertSchema, AgentToolRelationSelectSchema, AgentToolRelationUpdateSchema, AgentUpdateSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentRelationApiInsertSchema, ExternalAgentRelationInsertSchema, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, FullProjectDefinitionSchema, GraphStopWhenSchema, GraphWithinContextOfProjectSchema, HeadersScopeSchema, IdParamsSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectModelSchema, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectGraphIdParamsSchema, TenantProjectGraphParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, resourceIdSchema } from './chunk-JXAL2ALG.js';
|
|
6
6
|
import { schema_exports, agentRelations, agents, externalAgents, agentToolRelations, tools, contextConfigs, agentGraph, agentDataComponents, agentArtifactComponents, dataComponents, artifactComponents, projects, apiKeys, contextCache, conversations, messages, credentialReferences, ledgerArtifacts, tasks, taskRelations } from './chunk-URSDNK76.js';
|
|
7
7
|
export { agentArtifactComponents, agentArtifactComponentsRelations, agentDataComponents, agentDataComponentsRelations, agentGraph, agentGraphRelations, agentRelations, agentRelationsRelations, agentToolRelations, agentToolRelationsRelations, agents, agentsRelations, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, ledgerArtifacts, ledgerArtifactsContextIdIdx, ledgerArtifactsRelations, ledgerArtifactsTaskContextNameUnique, ledgerArtifactsTaskIdIdx, ledgerArtifactsToolCallIdIdx, messages, messagesRelations, projects, projectsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-URSDNK76.js';
|
|
8
8
|
import { CredentialStoreType, MCPServerType, MCPTransportType } from './chunk-YFHT5M2R.js';
|
|
@@ -14,7 +14,7 @@ import pinoPretty from 'pino-pretty';
|
|
|
14
14
|
import jmespath from 'jmespath';
|
|
15
15
|
import { createClient } from '@libsql/client';
|
|
16
16
|
import { drizzle } from 'drizzle-orm/libsql';
|
|
17
|
-
import { and, eq, desc, count, isNotNull, inArray, sql, asc } from 'drizzle-orm';
|
|
17
|
+
import { and, eq, desc, count, isNotNull, inArray, sql, asc, not } from 'drizzle-orm';
|
|
18
18
|
import { customAlphabet, nanoid } from 'nanoid';
|
|
19
19
|
import crypto, { scrypt, randomBytes, timingSafeEqual } from 'crypto';
|
|
20
20
|
import { promisify } from 'util';
|
|
@@ -2071,7 +2071,8 @@ var getFullGraphDefinition = (db) => async ({
|
|
|
2071
2071
|
projectId: tools.projectId,
|
|
2072
2072
|
imageUrl: tools.imageUrl,
|
|
2073
2073
|
selectedTools: agentToolRelations.selectedTools,
|
|
2074
|
-
headers: agentToolRelations.headers
|
|
2074
|
+
headers: agentToolRelations.headers,
|
|
2075
|
+
agentToolRelationId: agentToolRelations.id
|
|
2075
2076
|
}).from(agentToolRelations).innerJoin(
|
|
2076
2077
|
tools,
|
|
2077
2078
|
and(
|
|
@@ -2104,6 +2105,7 @@ var getFullGraphDefinition = (db) => async ({
|
|
|
2104
2105
|
(rel) => rel.artifactComponentId
|
|
2105
2106
|
);
|
|
2106
2107
|
const canUse = agentTools.map((tool2) => ({
|
|
2108
|
+
agentToolRelationId: tool2.agentToolRelationId,
|
|
2107
2109
|
toolId: tool2.id,
|
|
2108
2110
|
toolSelection: tool2.selectedTools || null,
|
|
2109
2111
|
headers: tool2.headers || null
|
|
@@ -4322,28 +4324,19 @@ var removeToolFromAgent = (db) => async (params) => {
|
|
|
4322
4324
|
return deleted;
|
|
4323
4325
|
};
|
|
4324
4326
|
var upsertAgentToolRelation = (db) => async (params) => {
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4327
|
+
if (params.relationId) {
|
|
4328
|
+
return await updateAgentToolRelation(db)({
|
|
4329
|
+
scopes: params.scopes,
|
|
4330
|
+
relationId: params.relationId,
|
|
4331
|
+
data: {
|
|
4332
|
+
agentId: params.agentId,
|
|
4333
|
+
toolId: params.toolId,
|
|
4334
|
+
selectedTools: params.selectedTools,
|
|
4335
|
+
headers: params.headers
|
|
4336
|
+
}
|
|
4337
|
+
});
|
|
4336
4338
|
}
|
|
4337
|
-
return await
|
|
4338
|
-
scopes: params.scopes,
|
|
4339
|
-
relationId: existing.id,
|
|
4340
|
-
data: {
|
|
4341
|
-
agentId: params.agentId,
|
|
4342
|
-
toolId: params.toolId,
|
|
4343
|
-
selectedTools: params.selectedTools,
|
|
4344
|
-
headers: params.headers
|
|
4345
|
-
}
|
|
4346
|
-
});
|
|
4339
|
+
return await addToolToAgent(db)(params);
|
|
4347
4340
|
};
|
|
4348
4341
|
var upsertTool = (db) => async (params) => {
|
|
4349
4342
|
const scopes = { tenantId: params.data.tenantId, projectId: params.data.projectId };
|
|
@@ -4602,14 +4595,15 @@ var createFullGraphServerSide = (db, logger12 = defaultLogger) => async (scopes,
|
|
|
4602
4595
|
agentToolPromises.push(
|
|
4603
4596
|
(async () => {
|
|
4604
4597
|
try {
|
|
4605
|
-
const { toolId, toolSelection, headers } = canUseItem;
|
|
4598
|
+
const { toolId, toolSelection, headers, agentToolRelationId } = canUseItem;
|
|
4606
4599
|
logger12.info({ agentId, toolId }, "Processing agent-tool relation");
|
|
4607
4600
|
await upsertAgentToolRelation(db)({
|
|
4608
4601
|
scopes: { tenantId, projectId, graphId: finalGraphId },
|
|
4609
4602
|
agentId,
|
|
4610
4603
|
toolId,
|
|
4611
4604
|
selectedTools: toolSelection || void 0,
|
|
4612
|
-
headers: headers || void 0
|
|
4605
|
+
headers: headers || void 0,
|
|
4606
|
+
relationId: agentToolRelationId
|
|
4613
4607
|
});
|
|
4614
4608
|
logger12.info({ agentId, toolId }, "Agent-tool relation processed successfully");
|
|
4615
4609
|
} catch (error) {
|
|
@@ -4973,6 +4967,53 @@ var updateFullGraphServerSide = (db, logger12 = defaultLogger) => async (scopes,
|
|
|
4973
4967
|
([_, agentData]) => isExternalAgent(agentData)
|
|
4974
4968
|
).length;
|
|
4975
4969
|
logger12.info({ externalAgentCount }, "All external agents created/updated successfully");
|
|
4970
|
+
const incomingAgentIds = new Set(Object.keys(typedGraphDefinition.agents));
|
|
4971
|
+
const existingInternalAgents = await listAgents(db)({
|
|
4972
|
+
scopes: { tenantId, projectId, graphId: finalGraphId }
|
|
4973
|
+
});
|
|
4974
|
+
const existingExternalAgents = await listExternalAgents(db)({
|
|
4975
|
+
scopes: { tenantId, projectId, graphId: finalGraphId }
|
|
4976
|
+
});
|
|
4977
|
+
let deletedInternalCount = 0;
|
|
4978
|
+
for (const agent of existingInternalAgents) {
|
|
4979
|
+
if (!incomingAgentIds.has(agent.id)) {
|
|
4980
|
+
try {
|
|
4981
|
+
await deleteAgent(db)({
|
|
4982
|
+
scopes: { tenantId, projectId, graphId: finalGraphId },
|
|
4983
|
+
agentId: agent.id
|
|
4984
|
+
});
|
|
4985
|
+
deletedInternalCount++;
|
|
4986
|
+
logger12.info({ agentId: agent.id }, "Deleted orphaned internal agent");
|
|
4987
|
+
} catch (error) {
|
|
4988
|
+
logger12.error({ agentId: agent.id, error }, "Failed to delete orphaned internal agent");
|
|
4989
|
+
}
|
|
4990
|
+
}
|
|
4991
|
+
}
|
|
4992
|
+
let deletedExternalCount = 0;
|
|
4993
|
+
for (const agent of existingExternalAgents) {
|
|
4994
|
+
if (!incomingAgentIds.has(agent.id)) {
|
|
4995
|
+
try {
|
|
4996
|
+
await deleteExternalAgent(db)({
|
|
4997
|
+
scopes: { tenantId, projectId, graphId: finalGraphId },
|
|
4998
|
+
agentId: agent.id
|
|
4999
|
+
});
|
|
5000
|
+
deletedExternalCount++;
|
|
5001
|
+
logger12.info({ agentId: agent.id }, "Deleted orphaned external agent");
|
|
5002
|
+
} catch (error) {
|
|
5003
|
+
logger12.error({ agentId: agent.id, error }, "Failed to delete orphaned external agent");
|
|
5004
|
+
}
|
|
5005
|
+
}
|
|
5006
|
+
}
|
|
5007
|
+
if (deletedInternalCount > 0 || deletedExternalCount > 0) {
|
|
5008
|
+
logger12.info(
|
|
5009
|
+
{
|
|
5010
|
+
deletedInternalCount,
|
|
5011
|
+
deletedExternalCount,
|
|
5012
|
+
totalDeleted: deletedInternalCount + deletedExternalCount
|
|
5013
|
+
},
|
|
5014
|
+
"Deleted orphaned agents from graph"
|
|
5015
|
+
);
|
|
5016
|
+
}
|
|
4976
5017
|
await updateAgentGraph(db)({
|
|
4977
5018
|
scopes: { tenantId, projectId, graphId: typedGraphDefinition.id },
|
|
4978
5019
|
data: {
|
|
@@ -4987,10 +5028,47 @@ var updateFullGraphServerSide = (db, logger12 = defaultLogger) => async (scopes,
|
|
|
4987
5028
|
}
|
|
4988
5029
|
});
|
|
4989
5030
|
logger12.info({ graphId: typedGraphDefinition.id }, "Graph metadata updated");
|
|
5031
|
+
const incomingRelationshipIds = /* @__PURE__ */ new Set();
|
|
5032
|
+
for (const [_agentId, agentData] of Object.entries(typedGraphDefinition.agents)) {
|
|
5033
|
+
if (isInternalAgent(agentData) && agentData.canUse && Array.isArray(agentData.canUse)) {
|
|
5034
|
+
for (const canUseItem of agentData.canUse) {
|
|
5035
|
+
if (canUseItem.agentToolRelationId) {
|
|
5036
|
+
incomingRelationshipIds.add(canUseItem.agentToolRelationId);
|
|
5037
|
+
}
|
|
5038
|
+
}
|
|
5039
|
+
}
|
|
5040
|
+
}
|
|
4990
5041
|
for (const agentId of Object.keys(typedGraphDefinition.agents)) {
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
5042
|
+
try {
|
|
5043
|
+
let deletedCount = 0;
|
|
5044
|
+
if (incomingRelationshipIds.size === 0) {
|
|
5045
|
+
const result = await db.delete(agentToolRelations).where(
|
|
5046
|
+
and(
|
|
5047
|
+
eq(agentToolRelations.tenantId, tenantId),
|
|
5048
|
+
eq(agentToolRelations.projectId, projectId),
|
|
5049
|
+
eq(agentToolRelations.graphId, finalGraphId),
|
|
5050
|
+
eq(agentToolRelations.agentId, agentId)
|
|
5051
|
+
)
|
|
5052
|
+
);
|
|
5053
|
+
deletedCount = result.rowsAffected || 0;
|
|
5054
|
+
} else {
|
|
5055
|
+
const result = await db.delete(agentToolRelations).where(
|
|
5056
|
+
and(
|
|
5057
|
+
eq(agentToolRelations.tenantId, tenantId),
|
|
5058
|
+
eq(agentToolRelations.projectId, projectId),
|
|
5059
|
+
eq(agentToolRelations.graphId, finalGraphId),
|
|
5060
|
+
eq(agentToolRelations.agentId, agentId),
|
|
5061
|
+
not(inArray(agentToolRelations.id, Array.from(incomingRelationshipIds)))
|
|
5062
|
+
)
|
|
5063
|
+
);
|
|
5064
|
+
deletedCount = result.rowsAffected || 0;
|
|
5065
|
+
}
|
|
5066
|
+
if (deletedCount > 0) {
|
|
5067
|
+
logger12.info({ agentId, deletedCount }, "Deleted orphaned agent-tool relations");
|
|
5068
|
+
}
|
|
5069
|
+
} catch (error) {
|
|
5070
|
+
logger12.error({ agentId, error }, "Failed to delete orphaned agent-tool relations");
|
|
5071
|
+
}
|
|
4994
5072
|
}
|
|
4995
5073
|
const agentToolPromises = [];
|
|
4996
5074
|
for (const [agentId, agentData] of Object.entries(typedGraphDefinition.agents)) {
|
|
@@ -4999,21 +5077,28 @@ var updateFullGraphServerSide = (db, logger12 = defaultLogger) => async (scopes,
|
|
|
4999
5077
|
agentToolPromises.push(
|
|
5000
5078
|
(async () => {
|
|
5001
5079
|
try {
|
|
5002
|
-
const { toolId, toolSelection, headers } = canUseItem;
|
|
5003
|
-
await
|
|
5080
|
+
const { toolId, toolSelection, headers, agentToolRelationId } = canUseItem;
|
|
5081
|
+
await upsertAgentToolRelation(db)({
|
|
5004
5082
|
scopes: { tenantId, projectId, graphId: finalGraphId },
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
}
|
|
5083
|
+
agentId,
|
|
5084
|
+
toolId,
|
|
5085
|
+
selectedTools: toolSelection || void 0,
|
|
5086
|
+
headers: headers || void 0,
|
|
5087
|
+
relationId: agentToolRelationId
|
|
5011
5088
|
});
|
|
5012
|
-
logger12.info(
|
|
5089
|
+
logger12.info(
|
|
5090
|
+
{ agentId, toolId, relationId: agentToolRelationId },
|
|
5091
|
+
"Agent-tool relation upserted"
|
|
5092
|
+
);
|
|
5013
5093
|
} catch (error) {
|
|
5014
5094
|
logger12.error(
|
|
5015
|
-
{
|
|
5016
|
-
|
|
5095
|
+
{
|
|
5096
|
+
agentId,
|
|
5097
|
+
toolId: canUseItem.toolId,
|
|
5098
|
+
relationId: canUseItem.agentToolRelationId,
|
|
5099
|
+
error
|
|
5100
|
+
},
|
|
5101
|
+
"Failed to upsert agent-tool relation"
|
|
5017
5102
|
);
|
|
5018
5103
|
}
|
|
5019
5104
|
})()
|
|
@@ -6377,6 +6462,36 @@ var updateFullProjectServerSide = (db, logger12 = defaultLogger2) => async (scop
|
|
|
6377
6462
|
"All project artifactComponents updated successfully"
|
|
6378
6463
|
);
|
|
6379
6464
|
}
|
|
6465
|
+
const incomingGraphIds = new Set(Object.keys(typed.graphs || {}));
|
|
6466
|
+
const existingGraphs = await listAgentGraphs(db)({
|
|
6467
|
+
scopes: { tenantId, projectId: typed.id }
|
|
6468
|
+
});
|
|
6469
|
+
let deletedGraphCount = 0;
|
|
6470
|
+
for (const graph of existingGraphs) {
|
|
6471
|
+
if (!incomingGraphIds.has(graph.id)) {
|
|
6472
|
+
try {
|
|
6473
|
+
await deleteFullGraph(db, logger12)({
|
|
6474
|
+
scopes: { tenantId, projectId: typed.id, graphId: graph.id }
|
|
6475
|
+
});
|
|
6476
|
+
deletedGraphCount++;
|
|
6477
|
+
logger12.info({ graphId: graph.id }, "Deleted orphaned graph from project");
|
|
6478
|
+
} catch (error) {
|
|
6479
|
+
logger12.error(
|
|
6480
|
+
{ graphId: graph.id, error },
|
|
6481
|
+
"Failed to delete orphaned graph from project"
|
|
6482
|
+
);
|
|
6483
|
+
}
|
|
6484
|
+
}
|
|
6485
|
+
}
|
|
6486
|
+
if (deletedGraphCount > 0) {
|
|
6487
|
+
logger12.info(
|
|
6488
|
+
{
|
|
6489
|
+
deletedGraphCount,
|
|
6490
|
+
projectId: typed.id
|
|
6491
|
+
},
|
|
6492
|
+
"Deleted orphaned graphs from project"
|
|
6493
|
+
);
|
|
6494
|
+
}
|
|
6380
6495
|
if (typed.graphs && Object.keys(typed.graphs).length > 0) {
|
|
6381
6496
|
logger12.info(
|
|
6382
6497
|
{
|
|
@@ -7192,7 +7307,42 @@ var ContextResolver = class {
|
|
|
7192
7307
|
* Resolve a single context variable
|
|
7193
7308
|
*/
|
|
7194
7309
|
async resolveSingleFetchDefinition(contextConfig2, definition, templateKey, options, requestHash, result) {
|
|
7195
|
-
|
|
7310
|
+
const cachedEntry = await this.cache.get({
|
|
7311
|
+
conversationId: options.conversationId,
|
|
7312
|
+
contextConfigId: contextConfig2.id,
|
|
7313
|
+
contextVariableKey: templateKey,
|
|
7314
|
+
requestHash
|
|
7315
|
+
});
|
|
7316
|
+
if (cachedEntry) {
|
|
7317
|
+
result.resolvedContext[templateKey] = cachedEntry.value;
|
|
7318
|
+
result.cacheHits.push(definition.id);
|
|
7319
|
+
logger7.debug(
|
|
7320
|
+
{
|
|
7321
|
+
definitionId: definition.id,
|
|
7322
|
+
templateKey,
|
|
7323
|
+
conversationId: options.conversationId
|
|
7324
|
+
},
|
|
7325
|
+
"Cache hit for context variable"
|
|
7326
|
+
);
|
|
7327
|
+
return;
|
|
7328
|
+
}
|
|
7329
|
+
result.cacheMisses.push(definition.id);
|
|
7330
|
+
logger7.debug(
|
|
7331
|
+
{
|
|
7332
|
+
definitionId: definition.id,
|
|
7333
|
+
templateKey,
|
|
7334
|
+
conversationId: options.conversationId
|
|
7335
|
+
},
|
|
7336
|
+
"Cache miss for context variable, fetching data"
|
|
7337
|
+
);
|
|
7338
|
+
const definitionWithConversationId = {
|
|
7339
|
+
...definition,
|
|
7340
|
+
fetchConfig: {
|
|
7341
|
+
...definition.fetchConfig,
|
|
7342
|
+
conversationId: options.conversationId
|
|
7343
|
+
}
|
|
7344
|
+
};
|
|
7345
|
+
const fetchedData = await tracer.startActiveSpan(
|
|
7196
7346
|
"context-resolver.resolve_single_fetch_definition",
|
|
7197
7347
|
{
|
|
7198
7348
|
attributes: {
|
|
@@ -7205,78 +7355,17 @@ var ContextResolver = class {
|
|
|
7205
7355
|
},
|
|
7206
7356
|
async (parentSpan) => {
|
|
7207
7357
|
try {
|
|
7208
|
-
const
|
|
7209
|
-
conversationId: options.conversationId,
|
|
7210
|
-
contextConfigId: contextConfig2.id,
|
|
7211
|
-
contextVariableKey: templateKey,
|
|
7212
|
-
requestHash
|
|
7213
|
-
});
|
|
7214
|
-
if (cachedEntry) {
|
|
7215
|
-
result.resolvedContext[templateKey] = cachedEntry.value;
|
|
7216
|
-
result.cacheHits.push(definition.id);
|
|
7217
|
-
parentSpan.setStatus({ code: SpanStatusCode.OK });
|
|
7218
|
-
parentSpan.addEvent("context.cache_hit", {
|
|
7219
|
-
definition_id: definition.id,
|
|
7220
|
-
template_key: templateKey
|
|
7221
|
-
});
|
|
7222
|
-
logger7.debug(
|
|
7223
|
-
{
|
|
7224
|
-
definitionId: definition.id,
|
|
7225
|
-
templateKey,
|
|
7226
|
-
conversationId: options.conversationId
|
|
7227
|
-
},
|
|
7228
|
-
"Cache hit for context variable"
|
|
7229
|
-
);
|
|
7230
|
-
return;
|
|
7231
|
-
}
|
|
7232
|
-
result.cacheMisses.push(definition.id);
|
|
7233
|
-
parentSpan.addEvent("context.cache_miss", {
|
|
7234
|
-
definition_id: definition.id,
|
|
7235
|
-
template_key: templateKey
|
|
7236
|
-
});
|
|
7237
|
-
logger7.debug(
|
|
7238
|
-
{
|
|
7239
|
-
definitionId: definition.id,
|
|
7240
|
-
templateKey,
|
|
7241
|
-
conversationId: options.conversationId
|
|
7242
|
-
},
|
|
7243
|
-
"Cache miss for context variable, fetching data"
|
|
7244
|
-
);
|
|
7245
|
-
const definitionWithConversationId = {
|
|
7246
|
-
...definition,
|
|
7247
|
-
fetchConfig: {
|
|
7248
|
-
...definition.fetchConfig,
|
|
7249
|
-
conversationId: options.conversationId
|
|
7250
|
-
}
|
|
7251
|
-
};
|
|
7252
|
-
const fetchedData = await this.fetcher.fetch(
|
|
7358
|
+
const data = await this.fetcher.fetch(
|
|
7253
7359
|
definitionWithConversationId,
|
|
7254
7360
|
result.resolvedContext
|
|
7255
7361
|
);
|
|
7256
|
-
result.resolvedContext[templateKey] = fetchedData;
|
|
7257
|
-
result.fetchedDefinitions.push(definition.id);
|
|
7258
|
-
await this.cache.set({
|
|
7259
|
-
contextConfigId: contextConfig2.id,
|
|
7260
|
-
contextVariableKey: templateKey,
|
|
7261
|
-
conversationId: options.conversationId,
|
|
7262
|
-
value: fetchedData,
|
|
7263
|
-
requestHash,
|
|
7264
|
-
tenantId: this.tenantId
|
|
7265
|
-
});
|
|
7266
7362
|
parentSpan.setStatus({ code: SpanStatusCode.OK });
|
|
7267
7363
|
parentSpan.addEvent("context.fetch_success", {
|
|
7268
7364
|
definition_id: definition.id,
|
|
7269
7365
|
template_key: templateKey,
|
|
7270
7366
|
source: definition.fetchConfig.url
|
|
7271
7367
|
});
|
|
7272
|
-
|
|
7273
|
-
{
|
|
7274
|
-
definitionId: definition.id,
|
|
7275
|
-
templateKey,
|
|
7276
|
-
conversationId: options.conversationId
|
|
7277
|
-
},
|
|
7278
|
-
"Context variable resolved and cached"
|
|
7279
|
-
);
|
|
7368
|
+
return data;
|
|
7280
7369
|
} catch (error) {
|
|
7281
7370
|
setSpanWithError(parentSpan, error);
|
|
7282
7371
|
throw error;
|
|
@@ -7285,6 +7374,24 @@ var ContextResolver = class {
|
|
|
7285
7374
|
}
|
|
7286
7375
|
}
|
|
7287
7376
|
);
|
|
7377
|
+
result.resolvedContext[templateKey] = fetchedData;
|
|
7378
|
+
result.fetchedDefinitions.push(definition.id);
|
|
7379
|
+
await this.cache.set({
|
|
7380
|
+
contextConfigId: contextConfig2.id,
|
|
7381
|
+
contextVariableKey: templateKey,
|
|
7382
|
+
conversationId: options.conversationId,
|
|
7383
|
+
value: fetchedData,
|
|
7384
|
+
requestHash,
|
|
7385
|
+
tenantId: this.tenantId
|
|
7386
|
+
});
|
|
7387
|
+
logger7.debug(
|
|
7388
|
+
{
|
|
7389
|
+
definitionId: definition.id,
|
|
7390
|
+
templateKey,
|
|
7391
|
+
conversationId: options.conversationId
|
|
7392
|
+
},
|
|
7393
|
+
"Context variable resolved and cached"
|
|
7394
|
+
);
|
|
7288
7395
|
}
|
|
7289
7396
|
/**
|
|
7290
7397
|
* Resolve the request context for a given conversation
|
|
@@ -8552,14 +8659,31 @@ var NangoCredentialStore = class {
|
|
|
8552
8659
|
if (!isSupportedAuthMode(type)) {
|
|
8553
8660
|
return null;
|
|
8554
8661
|
}
|
|
8662
|
+
const extractAccessTokenForBearerType = (tokenString) => {
|
|
8663
|
+
if (tokenString && typeof tokenString === "string") {
|
|
8664
|
+
try {
|
|
8665
|
+
const parsedToken = JSON.parse(tokenString);
|
|
8666
|
+
if (parsedToken.access_token && typeof parsedToken.access_token === "string") {
|
|
8667
|
+
return parsedToken.access_token;
|
|
8668
|
+
}
|
|
8669
|
+
} catch {
|
|
8670
|
+
}
|
|
8671
|
+
return tokenString;
|
|
8672
|
+
}
|
|
8673
|
+
return void 0;
|
|
8674
|
+
};
|
|
8555
8675
|
switch (type) {
|
|
8556
8676
|
case "API_KEY":
|
|
8557
8677
|
return {
|
|
8558
|
-
token:
|
|
8678
|
+
token: extractAccessTokenForBearerType(
|
|
8679
|
+
credentials.apiKey || credentials.api_key
|
|
8680
|
+
)
|
|
8559
8681
|
};
|
|
8560
8682
|
case "APP":
|
|
8561
8683
|
return {
|
|
8562
|
-
token:
|
|
8684
|
+
token: extractAccessTokenForBearerType(
|
|
8685
|
+
credentials.accessToken || credentials.access_token
|
|
8686
|
+
)
|
|
8563
8687
|
};
|
|
8564
8688
|
case "BASIC":
|
|
8565
8689
|
return {
|
|
@@ -8570,7 +8694,7 @@ var NangoCredentialStore = class {
|
|
|
8570
8694
|
return credentials.raw;
|
|
8571
8695
|
case "JWT":
|
|
8572
8696
|
return {
|
|
8573
|
-
token: credentials.token
|
|
8697
|
+
token: extractAccessTokenForBearerType(credentials.token)
|
|
8574
8698
|
};
|
|
8575
8699
|
case "OAUTH1":
|
|
8576
8700
|
return {
|
|
@@ -8579,12 +8703,12 @@ var NangoCredentialStore = class {
|
|
|
8579
8703
|
};
|
|
8580
8704
|
case "OAUTH2":
|
|
8581
8705
|
return {
|
|
8582
|
-
token: credentials.access_token,
|
|
8706
|
+
token: extractAccessTokenForBearerType(credentials.access_token),
|
|
8583
8707
|
refresh_token: credentials.refresh_token
|
|
8584
8708
|
};
|
|
8585
8709
|
case "OAUTH2_CC":
|
|
8586
8710
|
return {
|
|
8587
|
-
token: credentials.token,
|
|
8711
|
+
token: extractAccessTokenForBearerType(credentials.token),
|
|
8588
8712
|
client_certificate: credentials.client_certificate,
|
|
8589
8713
|
client_id: credentials.client_id,
|
|
8590
8714
|
client_private_key: credentials.client_private_key,
|
|
@@ -8610,6 +8734,104 @@ var NangoCredentialStore = class {
|
|
|
8610
8734
|
}
|
|
8611
8735
|
return result;
|
|
8612
8736
|
}
|
|
8737
|
+
/**
|
|
8738
|
+
* Fetch a specific Nango integration
|
|
8739
|
+
*/
|
|
8740
|
+
async fetchNangoIntegration(uniqueKey) {
|
|
8741
|
+
try {
|
|
8742
|
+
const response = await this.nangoClient.getIntegration(
|
|
8743
|
+
{ uniqueKey },
|
|
8744
|
+
{ include: ["credentials"] }
|
|
8745
|
+
);
|
|
8746
|
+
const integration = response.data;
|
|
8747
|
+
let areCredentialsSet = false;
|
|
8748
|
+
if (integration.credentials?.type === "OAUTH2" || integration.credentials?.type === "OAUTH1" || integration.credentials?.type === "TBA") {
|
|
8749
|
+
areCredentialsSet = !!(integration.credentials?.client_id && integration.credentials?.client_secret);
|
|
8750
|
+
} else if (integration.credentials?.type === "APP") {
|
|
8751
|
+
areCredentialsSet = !!(integration.credentials?.app_id && integration.credentials?.app_link);
|
|
8752
|
+
} else {
|
|
8753
|
+
areCredentialsSet = true;
|
|
8754
|
+
}
|
|
8755
|
+
const { credentials: _credentials, ...integrationWithoutCredentials } = integration;
|
|
8756
|
+
return {
|
|
8757
|
+
...integrationWithoutCredentials,
|
|
8758
|
+
areCredentialsSet
|
|
8759
|
+
};
|
|
8760
|
+
} catch (error) {
|
|
8761
|
+
if (error && typeof error === "object" && "status" in error && error.status === 404) {
|
|
8762
|
+
return null;
|
|
8763
|
+
}
|
|
8764
|
+
console.error(`Failed to fetch integration ${uniqueKey}:`, error);
|
|
8765
|
+
return null;
|
|
8766
|
+
}
|
|
8767
|
+
}
|
|
8768
|
+
/**
|
|
8769
|
+
* Create an API key credential by setting up Nango integration and importing the connection
|
|
8770
|
+
*/
|
|
8771
|
+
async createNangoApiKeyConnection({
|
|
8772
|
+
name,
|
|
8773
|
+
apiKeyToSet,
|
|
8774
|
+
metadata
|
|
8775
|
+
}) {
|
|
8776
|
+
const provider = "private-api-bearer";
|
|
8777
|
+
try {
|
|
8778
|
+
let integration;
|
|
8779
|
+
try {
|
|
8780
|
+
const response2 = await this.nangoClient.createIntegration({
|
|
8781
|
+
provider,
|
|
8782
|
+
unique_key: name,
|
|
8783
|
+
display_name: name
|
|
8784
|
+
});
|
|
8785
|
+
integration = response2.data;
|
|
8786
|
+
} catch (error) {
|
|
8787
|
+
const existingIntegration = await this.fetchNangoIntegration(name);
|
|
8788
|
+
if (existingIntegration) {
|
|
8789
|
+
integration = existingIntegration;
|
|
8790
|
+
} else {
|
|
8791
|
+
console.log(`Integration creation failed for unexpected reasons`, error);
|
|
8792
|
+
}
|
|
8793
|
+
}
|
|
8794
|
+
if (!integration) {
|
|
8795
|
+
throw new Error(`Integration '${name}' not found`);
|
|
8796
|
+
}
|
|
8797
|
+
const importConnectionUrl = `${process.env.NANGO_SERVER_URL || "https://api.nango.dev"}/connections`;
|
|
8798
|
+
const credentials = {
|
|
8799
|
+
type: "API_KEY",
|
|
8800
|
+
apiKey: apiKeyToSet
|
|
8801
|
+
};
|
|
8802
|
+
const body = {
|
|
8803
|
+
provider_config_key: integration.unique_key,
|
|
8804
|
+
connection_id: name,
|
|
8805
|
+
metadata,
|
|
8806
|
+
credentials
|
|
8807
|
+
};
|
|
8808
|
+
const response = await fetch(importConnectionUrl, {
|
|
8809
|
+
method: "POST",
|
|
8810
|
+
headers: {
|
|
8811
|
+
Authorization: `Bearer ${process.env.NANGO_SECRET_KEY}`,
|
|
8812
|
+
"Content-Type": "application/json"
|
|
8813
|
+
},
|
|
8814
|
+
body: JSON.stringify(body)
|
|
8815
|
+
});
|
|
8816
|
+
if (!response.ok) {
|
|
8817
|
+
throw new Error(
|
|
8818
|
+
`Failed to import connection: HTTP ${response.status} - ${response.statusText}`
|
|
8819
|
+
);
|
|
8820
|
+
}
|
|
8821
|
+
} catch (error) {
|
|
8822
|
+
console.error("Unexpected error creating API key credential:", error);
|
|
8823
|
+
logger11.error(
|
|
8824
|
+
{
|
|
8825
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
8826
|
+
name
|
|
8827
|
+
},
|
|
8828
|
+
`Unexpected error creating API key credential '${name}'`
|
|
8829
|
+
);
|
|
8830
|
+
throw new Error(
|
|
8831
|
+
`Failed to create API key credential '${name}': ${error instanceof Error ? error.message : "Unknown error"}`
|
|
8832
|
+
);
|
|
8833
|
+
}
|
|
8834
|
+
}
|
|
8613
8835
|
/**
|
|
8614
8836
|
* Fetch credentials from Nango API using connection information
|
|
8615
8837
|
* @param connectionId - The connection ID for the Nango connection
|
|
@@ -8699,8 +8921,12 @@ var NangoCredentialStore = class {
|
|
|
8699
8921
|
/**
|
|
8700
8922
|
* Set credentials - not supported for Nango (OAuth flow handles this)
|
|
8701
8923
|
*/
|
|
8702
|
-
async set(
|
|
8703
|
-
|
|
8924
|
+
async set(key, value) {
|
|
8925
|
+
await this.createNangoApiKeyConnection({
|
|
8926
|
+
name: key,
|
|
8927
|
+
apiKeyToSet: value,
|
|
8928
|
+
metadata: {}
|
|
8929
|
+
});
|
|
8704
8930
|
}
|
|
8705
8931
|
/**
|
|
8706
8932
|
* Check if credentials exist by attempting to fetch them
|
|
@@ -8794,7 +9020,16 @@ function createDefaultCredentialStores() {
|
|
|
8794
9020
|
})
|
|
8795
9021
|
);
|
|
8796
9022
|
}
|
|
8797
|
-
|
|
9023
|
+
if (process.env.ENABLE_KEYCHAIN_STORE === "true") {
|
|
9024
|
+
try {
|
|
9025
|
+
stores.push(createKeyChainStore("keychain-default"));
|
|
9026
|
+
} catch (error) {
|
|
9027
|
+
console.warn(
|
|
9028
|
+
"Failed to create keychain store:",
|
|
9029
|
+
error instanceof Error ? error.message : error
|
|
9030
|
+
);
|
|
9031
|
+
}
|
|
9032
|
+
}
|
|
8798
9033
|
return stores;
|
|
8799
9034
|
}
|
|
8800
9035
|
var loadEnvironmentFiles = () => {
|
|
@@ -8847,4 +9082,4 @@ ${error.message}`
|
|
|
8847
9082
|
};
|
|
8848
9083
|
parseEnv();
|
|
8849
9084
|
|
|
8850
|
-
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,
|
|
9085
|
+
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, 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, getLedgerArtifacts, getLedgerArtifactsByContext, getLogger, 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, listMessages, listProjects, listProjectsPaginated, listTaskIdsByContextId, listTools, loadEnvironmentFiles, loggerFactory, 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, upsertLedgerArtifact, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateExternalAgent, validateHttpRequestHeaders, validateInternalAgent, validateProjectExists, validateRequestContext, validationHelper, withProjectValidation };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as drizzle_orm from 'drizzle-orm';
|
|
2
2
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
3
|
-
import { f as ContextFetchDefinition, C as ConversationHistoryConfig, T as TaskMetadataConfig, g as ToolMcpConfig, h as ToolServerCapabilities, i as ConversationMetadata, j as MessageContent, k as MessageMetadata, P as Part } from './utility-
|
|
3
|
+
import { f as ContextFetchDefinition, C as ConversationHistoryConfig, T as TaskMetadataConfig, g as ToolMcpConfig, h as ToolServerCapabilities, i as ConversationMetadata, j as MessageContent, k as MessageMetadata, P as Part } from './utility-D7QP8MkV.cjs';
|
|
4
4
|
|
|
5
5
|
declare const projects: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
6
6
|
name: "projects";
|