@inkeep/agents-core 0.0.0-dev-20250911195722 → 0.0.0-dev-20250911212652
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.cjs +92 -182
- package/dist/index.d.cts +14 -17
- package/dist/index.d.ts +14 -17
- package/dist/index.js +95 -159
- package/dist/validation/index.js +1 -1
- package/package.json +1 -1
- package/dist/{chunk-G6FJN6G5.js → chunk-PXIJWVD4.js} +1 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { TaskState } from './chunk-H2F72PDA.js';
|
|
2
|
-
import { ContextConfigApiUpdateSchema, validateAndTypeGraphData, validateGraphStructure, isInternalAgent, isExternalAgent } from './chunk-
|
|
3
|
-
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, AgentToolRelationApiInsertSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiUpdateSchema, AgentToolRelationInsertSchema, AgentToolRelationSelectSchema, AgentToolRelationUpdateSchema, AgentUpdateSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentRelationApiInsertSchema, ExternalAgentRelationInsertSchema, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, 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, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, resourceIdSchema, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './chunk-
|
|
4
|
-
import { CredentialStoreType, MCPServerType, MCPTransportType } from './chunk-SVGQSPW4.js';
|
|
5
|
-
export { CredentialStoreType, MCPServerType, MCPTransportType, TOOL_STATUS_VALUES, VALID_RELATION_TYPES } from './chunk-SVGQSPW4.js';
|
|
2
|
+
import { ContextConfigApiUpdateSchema, validateAndTypeGraphData, validateGraphStructure, isInternalAgent, isExternalAgent } from './chunk-PXIJWVD4.js';
|
|
3
|
+
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, AgentToolRelationApiInsertSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiUpdateSchema, AgentToolRelationInsertSchema, AgentToolRelationSelectSchema, AgentToolRelationUpdateSchema, AgentUpdateSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentRelationApiInsertSchema, ExternalAgentRelationInsertSchema, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, 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, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, resourceIdSchema, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './chunk-PXIJWVD4.js';
|
|
6
4
|
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-M4JXMAG7.js';
|
|
7
5
|
export { agentArtifactComponents, agentArtifactComponentsRelations, agentDataComponents, agentGraph, agentGraphRelations, agentRelations, agentRelationsRelations, agentToolRelations, agentToolRelationsRelations, agents, agentsRelations, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, externalAgents, externalAgentsRelations, ledgerArtifacts, ledgerArtifactsContextIdIdx, ledgerArtifactsTaskContextNameUnique, ledgerArtifactsTaskIdIdx, messages, messagesRelations, projects, projectsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-M4JXMAG7.js';
|
|
6
|
+
import { CredentialStoreType, MCPServerType, MCPTransportType } from './chunk-SVGQSPW4.js';
|
|
7
|
+
export { CredentialStoreType, MCPServerType, MCPTransportType, TOOL_STATUS_VALUES, VALID_RELATION_TYPES } from './chunk-SVGQSPW4.js';
|
|
8
8
|
import { __publicField } from './chunk-MKBO26DX.js';
|
|
9
9
|
import { z as z$2 } from 'zod/v4';
|
|
10
10
|
import jmespath from 'jmespath';
|
|
@@ -27,9 +27,6 @@ import { tool } from 'ai';
|
|
|
27
27
|
import { asyncExitHook, gracefulExit } from 'exit-hook';
|
|
28
28
|
import { match } from 'ts-pattern';
|
|
29
29
|
import { z as z$1 } from 'zod';
|
|
30
|
-
import fs from 'fs';
|
|
31
|
-
import path from 'path';
|
|
32
|
-
import * as dotenv from 'dotenv';
|
|
33
30
|
import { Nango } from '@nangohq/node';
|
|
34
31
|
|
|
35
32
|
// src/utils/logger.ts
|
|
@@ -68,8 +65,8 @@ var LoggerFactory = class {
|
|
|
68
65
|
/**
|
|
69
66
|
* Configure the logger factory
|
|
70
67
|
*/
|
|
71
|
-
configure(
|
|
72
|
-
this.config =
|
|
68
|
+
configure(config) {
|
|
69
|
+
this.config = config;
|
|
73
70
|
this.loggers.clear();
|
|
74
71
|
}
|
|
75
72
|
/**
|
|
@@ -77,7 +74,11 @@ var LoggerFactory = class {
|
|
|
77
74
|
*/
|
|
78
75
|
getLogger(name) {
|
|
79
76
|
if (this.loggers.has(name)) {
|
|
80
|
-
|
|
77
|
+
const logger12 = this.loggers.get(name);
|
|
78
|
+
if (!logger12) {
|
|
79
|
+
throw new Error(`Logger '${name}' not found in cache`);
|
|
80
|
+
}
|
|
81
|
+
return logger12;
|
|
81
82
|
}
|
|
82
83
|
let logger11;
|
|
83
84
|
if (this.config.loggerFactory) {
|
|
@@ -102,8 +103,8 @@ var loggerFactory = new LoggerFactory();
|
|
|
102
103
|
function getLogger(name) {
|
|
103
104
|
return loggerFactory.getLogger(name);
|
|
104
105
|
}
|
|
105
|
-
function configureLogging(
|
|
106
|
-
loggerFactory.configure(
|
|
106
|
+
function configureLogging(config) {
|
|
107
|
+
loggerFactory.configure(config);
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
// src/context/ContextConfig.ts
|
|
@@ -416,8 +417,8 @@ var _TemplateEngine = class _TemplateEngine {
|
|
|
416
417
|
* Process variable substitutions {{variable.path}} using JMESPath
|
|
417
418
|
*/
|
|
418
419
|
static processVariables(template, context, options) {
|
|
419
|
-
return template.replace(/\{\{([^}]+)\}\}/g, (match2,
|
|
420
|
-
const trimmedPath =
|
|
420
|
+
return template.replace(/\{\{([^}]+)\}\}/g, (match2, path) => {
|
|
421
|
+
const trimmedPath = path.trim();
|
|
421
422
|
try {
|
|
422
423
|
if (trimmedPath.startsWith("$")) {
|
|
423
424
|
return _TemplateEngine.processBuiltinVariable(trimmedPath);
|
|
@@ -763,14 +764,14 @@ var CredentialStuffer = class {
|
|
|
763
764
|
return baseConfig;
|
|
764
765
|
}
|
|
765
766
|
};
|
|
766
|
-
function createDatabaseClient(
|
|
767
|
+
function createDatabaseClient(config) {
|
|
767
768
|
const client = createClient({
|
|
768
|
-
url:
|
|
769
|
-
authToken:
|
|
769
|
+
url: config.url,
|
|
770
|
+
authToken: config.authToken
|
|
770
771
|
});
|
|
771
772
|
return drizzle(client, {
|
|
772
773
|
schema: schema_exports,
|
|
773
|
-
logger:
|
|
774
|
+
logger: config.logger
|
|
774
775
|
});
|
|
775
776
|
}
|
|
776
777
|
function createInMemoryDatabaseClient() {
|
|
@@ -1352,6 +1353,9 @@ var upsertAgent = (db) => async (params) => {
|
|
|
1352
1353
|
stopWhen: params.data.stopWhen
|
|
1353
1354
|
}
|
|
1354
1355
|
});
|
|
1356
|
+
if (!updated) {
|
|
1357
|
+
throw new Error("Failed to update agent - no rows affected");
|
|
1358
|
+
}
|
|
1355
1359
|
return updated;
|
|
1356
1360
|
} else {
|
|
1357
1361
|
return await createAgent(db)(params.data);
|
|
@@ -1638,6 +1642,9 @@ var upsertExternalAgent = (db) => async (params) => {
|
|
|
1638
1642
|
headers: params.data.headers
|
|
1639
1643
|
}
|
|
1640
1644
|
});
|
|
1645
|
+
if (!updated) {
|
|
1646
|
+
throw new Error("Failed to update external agent - no rows affected");
|
|
1647
|
+
}
|
|
1641
1648
|
return updated;
|
|
1642
1649
|
} else {
|
|
1643
1650
|
return await createExternalAgent(db)(params.data);
|
|
@@ -1804,14 +1811,14 @@ var deleteAgentGraph = (db) => async (params) => {
|
|
|
1804
1811
|
).returning();
|
|
1805
1812
|
return result.length > 0;
|
|
1806
1813
|
};
|
|
1807
|
-
var fetchComponentRelationships = (db) => async (scopes, agentIds,
|
|
1814
|
+
var fetchComponentRelationships = (db) => async (scopes, agentIds, config) => {
|
|
1808
1815
|
const componentsObject = {};
|
|
1809
1816
|
if (agentIds.length > 0) {
|
|
1810
|
-
const results = await db.select(
|
|
1817
|
+
const results = await db.select(config.selectFields).from(config.relationTable).innerJoin(config.componentTable, eq(config.relationIdField, config.componentIdField)).where(
|
|
1811
1818
|
and(
|
|
1812
|
-
eq(
|
|
1813
|
-
eq(
|
|
1814
|
-
inArray(
|
|
1819
|
+
eq(config.relationTable.tenantId, scopes.tenantId),
|
|
1820
|
+
eq(config.relationTable.projectId, scopes.projectId),
|
|
1821
|
+
inArray(config.relationTable.agentId, agentIds)
|
|
1815
1822
|
)
|
|
1816
1823
|
);
|
|
1817
1824
|
for (const component of results) {
|
|
@@ -3132,6 +3139,9 @@ var upsertCredentialReference = (db) => async (params) => {
|
|
|
3132
3139
|
retrievalParams: params.data.retrievalParams
|
|
3133
3140
|
}
|
|
3134
3141
|
});
|
|
3142
|
+
if (!updated) {
|
|
3143
|
+
throw new Error("Failed to update credential reference - no rows affected");
|
|
3144
|
+
}
|
|
3135
3145
|
return updated;
|
|
3136
3146
|
} else {
|
|
3137
3147
|
return await createCredentialReference(db)(params.data);
|
|
@@ -5087,8 +5097,8 @@ var tryWellKnownEndpoints = async (baseUrl, logger11) => {
|
|
|
5087
5097
|
return null;
|
|
5088
5098
|
};
|
|
5089
5099
|
var checkForOAuthEndpoints = async (serverUrl, logger11) => {
|
|
5090
|
-
const
|
|
5091
|
-
return
|
|
5100
|
+
const config = await discoverOAuthEndpoints(serverUrl, logger11);
|
|
5101
|
+
return config !== null;
|
|
5092
5102
|
};
|
|
5093
5103
|
var discoverOAuthEndpoints = async (serverUrl, logger11) => {
|
|
5094
5104
|
try {
|
|
@@ -5468,7 +5478,7 @@ var McpClient = class {
|
|
|
5468
5478
|
}
|
|
5469
5479
|
async connect() {
|
|
5470
5480
|
if (this.connected) return;
|
|
5471
|
-
await match(this.serverConfig).with({ type: MCPTransportType.streamableHttp }, (
|
|
5481
|
+
await match(this.serverConfig).with({ type: MCPTransportType.streamableHttp }, (config) => this.connectHttp(config)).with({ type: MCPTransportType.sse }, (config) => this.connectSSE(config)).exhaustive();
|
|
5472
5482
|
this.connected = true;
|
|
5473
5483
|
const close = this.client.onclose;
|
|
5474
5484
|
this.client.onclose = () => {
|
|
@@ -5480,25 +5490,25 @@ var McpClient = class {
|
|
|
5480
5490
|
asyncExitHook(() => this.disconnect(), { wait: 5e3 });
|
|
5481
5491
|
process.on("SIGTERM", () => gracefulExit());
|
|
5482
5492
|
}
|
|
5483
|
-
async connectSSE(
|
|
5484
|
-
const url = typeof
|
|
5493
|
+
async connectSSE(config) {
|
|
5494
|
+
const url = typeof config.url === "string" ? config.url : config.url.toString();
|
|
5485
5495
|
this.transport = new SSEClientTransport(new URL(url), {
|
|
5486
|
-
eventSourceInit:
|
|
5496
|
+
eventSourceInit: config.eventSourceInit,
|
|
5487
5497
|
requestInit: {
|
|
5488
|
-
headers:
|
|
5498
|
+
headers: config.headers || {}
|
|
5489
5499
|
}
|
|
5490
5500
|
});
|
|
5491
5501
|
await this.client.connect(this.transport, {
|
|
5492
|
-
timeout:
|
|
5502
|
+
timeout: config.timeout ?? this.timeout
|
|
5493
5503
|
});
|
|
5494
5504
|
}
|
|
5495
|
-
async connectHttp(
|
|
5496
|
-
const { url, requestInit } =
|
|
5505
|
+
async connectHttp(config) {
|
|
5506
|
+
const { url, requestInit } = config;
|
|
5497
5507
|
const mergedRequestInit = {
|
|
5498
5508
|
...requestInit,
|
|
5499
5509
|
headers: {
|
|
5500
5510
|
...requestInit?.headers || {},
|
|
5501
|
-
...
|
|
5511
|
+
...config.headers || {}
|
|
5502
5512
|
}
|
|
5503
5513
|
};
|
|
5504
5514
|
const urlObj = new URL(url);
|
|
@@ -5509,9 +5519,9 @@ var McpClient = class {
|
|
|
5509
5519
|
maxReconnectionDelay: 3e4,
|
|
5510
5520
|
initialReconnectionDelay: 1e3,
|
|
5511
5521
|
reconnectionDelayGrowFactor: 1.5,
|
|
5512
|
-
...
|
|
5522
|
+
...config.reconnectionOptions
|
|
5513
5523
|
},
|
|
5514
|
-
sessionId:
|
|
5524
|
+
sessionId: config.sessionId
|
|
5515
5525
|
});
|
|
5516
5526
|
await this.client.connect(this.transport, { timeout: 3e3 });
|
|
5517
5527
|
}
|
|
@@ -5615,52 +5625,7 @@ var McpClient = class {
|
|
|
5615
5625
|
return results;
|
|
5616
5626
|
}
|
|
5617
5627
|
};
|
|
5618
|
-
dotenv.config({ quiet: true });
|
|
5619
|
-
var environmentSchema = z$1.enum(["development", "pentest", "production", "test"]);
|
|
5620
|
-
var criticalEnv = z$1.object({
|
|
5621
|
-
ENVIRONMENT: environmentSchema
|
|
5622
|
-
}).parse(process.env);
|
|
5623
|
-
var loadEnvFile = () => {
|
|
5624
|
-
const envPath = path.resolve(process.cwd(), `.env.${criticalEnv.ENVIRONMENT}.nonsecret`);
|
|
5625
|
-
if (fs.existsSync(envPath)) {
|
|
5626
|
-
const envConfig = dotenv.parse(fs.readFileSync(envPath));
|
|
5627
|
-
for (const k in envConfig) {
|
|
5628
|
-
if (!(k in process.env)) {
|
|
5629
|
-
process.env[k] = envConfig[k];
|
|
5630
|
-
}
|
|
5631
|
-
}
|
|
5632
|
-
}
|
|
5633
|
-
};
|
|
5634
|
-
loadEnvFile();
|
|
5635
|
-
var envSchema = z$1.object({
|
|
5636
|
-
ENVIRONMENT: z$1.enum(["development", "production", "pentest", "test"]).optional(),
|
|
5637
|
-
DB_FILE_NAME: z$1.string().default("file:../../local.db"),
|
|
5638
|
-
OTEL_TRACES_FORCE_FLUSH_ENABLED: z$1.stringbool().optional()
|
|
5639
|
-
});
|
|
5640
|
-
var parseEnv = () => {
|
|
5641
|
-
try {
|
|
5642
|
-
const parsedEnv = envSchema.parse(process.env);
|
|
5643
|
-
return parsedEnv;
|
|
5644
|
-
} catch (error) {
|
|
5645
|
-
if (error instanceof z$1.ZodError) {
|
|
5646
|
-
const missingVars = error.issues.map((issue) => issue.path.join("."));
|
|
5647
|
-
throw new Error(
|
|
5648
|
-
`\u274C Invalid environment variables: ${missingVars.join(", ")}
|
|
5649
|
-
${error.message}`
|
|
5650
|
-
);
|
|
5651
|
-
}
|
|
5652
|
-
throw error;
|
|
5653
|
-
}
|
|
5654
|
-
};
|
|
5655
|
-
var env = parseEnv();
|
|
5656
|
-
|
|
5657
|
-
// src/utils/tracer.ts
|
|
5658
5628
|
var logger4 = getLogger("tracer");
|
|
5659
|
-
var FORCE_FLUSH_ENVIRONMENTS = ["development"];
|
|
5660
|
-
var BASE = "inkeep-chat";
|
|
5661
|
-
var SERVICE_NAME = "inkeep-chat";
|
|
5662
|
-
var SERVICE_VERSION = "1.0.0";
|
|
5663
|
-
var createSpanName = (suffix) => `${BASE}.${suffix}`;
|
|
5664
5629
|
var createNoOpSpan = () => ({
|
|
5665
5630
|
setAttributes: () => ({}),
|
|
5666
5631
|
recordException: () => ({}),
|
|
@@ -5689,8 +5654,7 @@ var noopTracer = {
|
|
|
5689
5654
|
return createNoOpSpan();
|
|
5690
5655
|
}
|
|
5691
5656
|
};
|
|
5692
|
-
|
|
5693
|
-
function handleSpanError(span, error, logger11, logMessage) {
|
|
5657
|
+
function setSpanWithError(span, error, logger11, logMessage) {
|
|
5694
5658
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
5695
5659
|
span.recordException(error);
|
|
5696
5660
|
span.setStatus({
|
|
@@ -5701,45 +5665,21 @@ function handleSpanError(span, error, logger11, logMessage) {
|
|
|
5701
5665
|
logger11.error({ error: errorMessage }, logMessage);
|
|
5702
5666
|
}
|
|
5703
5667
|
}
|
|
5704
|
-
function
|
|
5705
|
-
if (!globalTracerInstance) {
|
|
5706
|
-
try {
|
|
5707
|
-
globalTracerInstance = trace.getTracer(SERVICE_NAME, SERVICE_VERSION);
|
|
5708
|
-
} catch (error) {
|
|
5709
|
-
logger4.debug(
|
|
5710
|
-
{ error: error instanceof Error ? error.message : "Unknown error" },
|
|
5711
|
-
"OpenTelemetry tracer not available, using no-op tracer"
|
|
5712
|
-
);
|
|
5713
|
-
globalTracerInstance = noopTracer;
|
|
5714
|
-
}
|
|
5715
|
-
}
|
|
5716
|
-
return globalTracerInstance;
|
|
5717
|
-
}
|
|
5718
|
-
async function forceFlushTracer() {
|
|
5719
|
-
const isOtelTracesForceFlushEnabled = env.OTEL_TRACES_FORCE_FLUSH_ENABLED;
|
|
5720
|
-
const isForceFlushEnvironment = env.ENVIRONMENT && FORCE_FLUSH_ENVIRONMENTS.includes(env.ENVIRONMENT);
|
|
5721
|
-
const shouldForceFlush = isOtelTracesForceFlushEnabled === true || isOtelTracesForceFlushEnabled == null && isForceFlushEnvironment;
|
|
5722
|
-
if (!shouldForceFlush) {
|
|
5723
|
-
return;
|
|
5724
|
-
}
|
|
5668
|
+
function getTracer(serviceName, serviceVersion) {
|
|
5725
5669
|
try {
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
{ message: "Tracer provider force flush completed" },
|
|
5731
|
-
"Tracer provider force flush completed"
|
|
5732
|
-
);
|
|
5733
|
-
} else {
|
|
5734
|
-
logger4.debug(
|
|
5735
|
-
{ message: "Tracer provider does not support force flush or is not available" },
|
|
5736
|
-
"Tracer provider does not support force flush or is not available"
|
|
5737
|
-
);
|
|
5738
|
-
}
|
|
5739
|
-
} catch (error) {
|
|
5740
|
-
logger4.warn({ error }, "Failed to force flush tracer");
|
|
5670
|
+
return trace.getTracer(serviceName, serviceVersion);
|
|
5671
|
+
} catch (_error) {
|
|
5672
|
+
logger4.debug({}, "OpenTelemetry tracer not available, using no-op tracer");
|
|
5673
|
+
return noopTracer;
|
|
5741
5674
|
}
|
|
5742
5675
|
}
|
|
5676
|
+
|
|
5677
|
+
// package.json
|
|
5678
|
+
var package_default = {
|
|
5679
|
+
version: "0.0.0-dev-20250911212652"};
|
|
5680
|
+
|
|
5681
|
+
// src/utils/tracer.ts
|
|
5682
|
+
var tracer = getTracer("agents-core", package_default.version);
|
|
5743
5683
|
var logger5 = getLogger("context-cache");
|
|
5744
5684
|
var ContextCache = class {
|
|
5745
5685
|
constructor(tenantId, projectId, dbClient) {
|
|
@@ -5935,7 +5875,6 @@ var ContextCache = class {
|
|
|
5935
5875
|
|
|
5936
5876
|
// src/context/ContextResolver.ts
|
|
5937
5877
|
var logger6 = getLogger("context-resolver");
|
|
5938
|
-
var tracer = getGlobalTracer();
|
|
5939
5878
|
var ContextResolver = class {
|
|
5940
5879
|
constructor(tenantId, projectId, dbClient, credentialStoreRegistry) {
|
|
5941
5880
|
__publicField(this, "fetcher");
|
|
@@ -5968,7 +5907,7 @@ var ContextResolver = class {
|
|
|
5968
5907
|
"Starting context resolution"
|
|
5969
5908
|
);
|
|
5970
5909
|
return tracer.startActiveSpan(
|
|
5971
|
-
|
|
5910
|
+
"context.resolve",
|
|
5972
5911
|
{
|
|
5973
5912
|
attributes: {
|
|
5974
5913
|
"context.config_id": contextConfig2.id,
|
|
@@ -6120,7 +6059,7 @@ var ContextResolver = class {
|
|
|
6120
6059
|
return result;
|
|
6121
6060
|
} catch (error) {
|
|
6122
6061
|
const durationMs = Date.now() - startTime;
|
|
6123
|
-
|
|
6062
|
+
setSpanWithError(parentSpan, error);
|
|
6124
6063
|
logger6.error(
|
|
6125
6064
|
{
|
|
6126
6065
|
contextConfigId: contextConfig2.id,
|
|
@@ -6141,7 +6080,7 @@ var ContextResolver = class {
|
|
|
6141
6080
|
*/
|
|
6142
6081
|
async resolveSingleFetchDefinition(contextConfig2, definition, templateKey, options, requestHash, result) {
|
|
6143
6082
|
return tracer.startActiveSpan(
|
|
6144
|
-
|
|
6083
|
+
"context-resolver.resolve_single_fetch_definition",
|
|
6145
6084
|
{
|
|
6146
6085
|
attributes: {
|
|
6147
6086
|
"context.definition_id": definition.id,
|
|
@@ -6226,7 +6165,7 @@ var ContextResolver = class {
|
|
|
6226
6165
|
"Context variable resolved and cached"
|
|
6227
6166
|
);
|
|
6228
6167
|
} catch (error) {
|
|
6229
|
-
|
|
6168
|
+
setSpanWithError(parentSpan, error);
|
|
6230
6169
|
throw error;
|
|
6231
6170
|
} finally {
|
|
6232
6171
|
parentSpan.end();
|
|
@@ -6421,7 +6360,15 @@ async function fetchExistingRequestContext({
|
|
|
6421
6360
|
"No request context found in cache. Please provide requestContext in request body."
|
|
6422
6361
|
);
|
|
6423
6362
|
}
|
|
6424
|
-
async function validateRequestContext(
|
|
6363
|
+
async function validateRequestContext({
|
|
6364
|
+
tenantId,
|
|
6365
|
+
projectId,
|
|
6366
|
+
graphId,
|
|
6367
|
+
conversationId,
|
|
6368
|
+
parsedRequest,
|
|
6369
|
+
dbClient,
|
|
6370
|
+
credentialStores
|
|
6371
|
+
}) {
|
|
6425
6372
|
try {
|
|
6426
6373
|
const agentGraph2 = await getAgentGraphWithDefaultAgent(dbClient)({
|
|
6427
6374
|
scopes: { tenantId, projectId },
|
|
@@ -6464,10 +6411,7 @@ async function validateRequestContext(tenantId, projectId, graphId, conversation
|
|
|
6464
6411
|
}
|
|
6465
6412
|
try {
|
|
6466
6413
|
const schema = contextConfig2.requestContextSchema;
|
|
6467
|
-
logger7.debug(
|
|
6468
|
-
{ contextConfigId: contextConfig2.id },
|
|
6469
|
-
"Using headers schema validation"
|
|
6470
|
-
);
|
|
6414
|
+
logger7.debug({ contextConfigId: contextConfig2.id }, "Using headers schema validation");
|
|
6471
6415
|
const httpRequest = parsedRequest;
|
|
6472
6416
|
const validationResult = await validateHttpRequestHeaders(schema, httpRequest);
|
|
6473
6417
|
if (validationResult.valid) {
|
|
@@ -6550,14 +6494,15 @@ function contextValidationMiddleware(dbClient) {
|
|
|
6550
6494
|
const parsedRequest = {
|
|
6551
6495
|
headers
|
|
6552
6496
|
};
|
|
6553
|
-
const validationResult = await validateRequestContext(
|
|
6497
|
+
const validationResult = await validateRequestContext({
|
|
6554
6498
|
tenantId,
|
|
6555
6499
|
projectId,
|
|
6556
6500
|
graphId,
|
|
6557
6501
|
conversationId,
|
|
6558
6502
|
parsedRequest,
|
|
6559
6503
|
dbClient,
|
|
6560
|
-
credentialStores
|
|
6504
|
+
credentialStores
|
|
6505
|
+
});
|
|
6561
6506
|
if (!validationResult.valid) {
|
|
6562
6507
|
logger7.warn(
|
|
6563
6508
|
{
|
|
@@ -6624,13 +6569,11 @@ var ContextFetcher = class {
|
|
|
6624
6569
|
__publicField(this, "tenantId");
|
|
6625
6570
|
__publicField(this, "projectId");
|
|
6626
6571
|
__publicField(this, "defaultTimeout");
|
|
6627
|
-
__publicField(this, "credentialStoreRegistry");
|
|
6628
6572
|
__publicField(this, "credentialStuffer");
|
|
6629
6573
|
__publicField(this, "dbClient");
|
|
6630
6574
|
this.tenantId = tenantId;
|
|
6631
6575
|
this.projectId = projectId;
|
|
6632
6576
|
this.defaultTimeout = defaultTimeout;
|
|
6633
|
-
this.credentialStoreRegistry = credentialStoreRegistry;
|
|
6634
6577
|
if (credentialStoreRegistry) {
|
|
6635
6578
|
this.credentialStuffer = new CredentialStuffer(credentialStoreRegistry);
|
|
6636
6579
|
}
|
|
@@ -6817,21 +6760,21 @@ var ContextFetcher = class {
|
|
|
6817
6760
|
/**
|
|
6818
6761
|
* Perform HTTP request
|
|
6819
6762
|
*/
|
|
6820
|
-
async performRequest(
|
|
6763
|
+
async performRequest(config) {
|
|
6821
6764
|
const startTime = Date.now();
|
|
6822
6765
|
try {
|
|
6823
6766
|
logger8.debug(
|
|
6824
6767
|
{
|
|
6825
|
-
url:
|
|
6826
|
-
method:
|
|
6768
|
+
url: config.url,
|
|
6769
|
+
method: config.method
|
|
6827
6770
|
},
|
|
6828
6771
|
"Performing HTTP request"
|
|
6829
6772
|
);
|
|
6830
|
-
const response = await fetch(
|
|
6831
|
-
method:
|
|
6832
|
-
headers:
|
|
6833
|
-
body:
|
|
6834
|
-
signal: AbortSignal.timeout(
|
|
6773
|
+
const response = await fetch(config.url, {
|
|
6774
|
+
method: config.method,
|
|
6775
|
+
headers: config.headers,
|
|
6776
|
+
body: config.body ? JSON.stringify(config.body) : void 0,
|
|
6777
|
+
signal: AbortSignal.timeout(config.timeout || this.defaultTimeout)
|
|
6835
6778
|
});
|
|
6836
6779
|
if (!response.ok) {
|
|
6837
6780
|
const errorText = await response.text();
|
|
@@ -6851,7 +6794,7 @@ var ContextFetcher = class {
|
|
|
6851
6794
|
}
|
|
6852
6795
|
return {
|
|
6853
6796
|
data,
|
|
6854
|
-
source:
|
|
6797
|
+
source: config.url,
|
|
6855
6798
|
durationMs
|
|
6856
6799
|
};
|
|
6857
6800
|
} catch (error) {
|
|
@@ -6859,7 +6802,7 @@ var ContextFetcher = class {
|
|
|
6859
6802
|
const requestError = error instanceof Error ? error : new Error("Unknown error");
|
|
6860
6803
|
logger8.warn(
|
|
6861
6804
|
{
|
|
6862
|
-
url:
|
|
6805
|
+
url: config.url,
|
|
6863
6806
|
error: requestError.message,
|
|
6864
6807
|
durationMs
|
|
6865
6808
|
},
|
|
@@ -6947,7 +6890,6 @@ var ContextFetcher = class {
|
|
|
6947
6890
|
}
|
|
6948
6891
|
};
|
|
6949
6892
|
var logger9 = getLogger("context");
|
|
6950
|
-
var tracer2 = getGlobalTracer();
|
|
6951
6893
|
async function determineContextTrigger(tenantId, projectId, conversationId, dbClient) {
|
|
6952
6894
|
const conversation = await getConversation(dbClient)({
|
|
6953
6895
|
scopes: { tenantId, projectId },
|
|
@@ -6978,8 +6920,8 @@ async function handleContextConfigChange(tenantId, projectId, conversationId, gr
|
|
|
6978
6920
|
}
|
|
6979
6921
|
}
|
|
6980
6922
|
async function handleContextResolution(tenantId, projectId, conversationId, graphId, requestContext, dbClient, credentialStores) {
|
|
6981
|
-
return
|
|
6982
|
-
|
|
6923
|
+
return tracer.startActiveSpan(
|
|
6924
|
+
"context.handle_context_resolution",
|
|
6983
6925
|
{
|
|
6984
6926
|
attributes: {
|
|
6985
6927
|
"context.request_context_keys": Object.keys(requestContext)
|
|
@@ -7054,7 +6996,6 @@ async function handleContextResolution(tenantId, projectId, conversationId, grap
|
|
|
7054
6996
|
} else {
|
|
7055
6997
|
parentSpan.setStatus({ code: SpanStatusCode.OK });
|
|
7056
6998
|
}
|
|
7057
|
-
await forceFlushTracer();
|
|
7058
6999
|
logger9.info(
|
|
7059
7000
|
{
|
|
7060
7001
|
conversationId,
|
|
@@ -7072,15 +7013,11 @@ async function handleContextResolution(tenantId, projectId, conversationId, grap
|
|
|
7072
7013
|
return resolvedContext;
|
|
7073
7014
|
} catch (error) {
|
|
7074
7015
|
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
7075
|
-
parentSpan.recordException(error);
|
|
7076
7016
|
parentSpan.setAttributes({
|
|
7077
7017
|
"context.final_status": "failed",
|
|
7078
7018
|
"context.error_message": errorMessage
|
|
7079
7019
|
});
|
|
7080
|
-
parentSpan
|
|
7081
|
-
code: SpanStatusCode.ERROR,
|
|
7082
|
-
message: errorMessage
|
|
7083
|
-
});
|
|
7020
|
+
setSpanWithError(parentSpan, error);
|
|
7084
7021
|
logger9.error(
|
|
7085
7022
|
{
|
|
7086
7023
|
error: errorMessage,
|
|
@@ -7094,7 +7031,6 @@ async function handleContextResolution(tenantId, projectId, conversationId, grap
|
|
|
7094
7031
|
},
|
|
7095
7032
|
"Failed to resolve context, proceeding without context resolution"
|
|
7096
7033
|
);
|
|
7097
|
-
await forceFlushTracer();
|
|
7098
7034
|
return null;
|
|
7099
7035
|
} finally {
|
|
7100
7036
|
parentSpan.end();
|
|
@@ -7444,13 +7380,13 @@ function isSupportedAuthMode(mode) {
|
|
|
7444
7380
|
return SUPPORTED_AUTH_MODES.includes(mode);
|
|
7445
7381
|
}
|
|
7446
7382
|
var NangoCredentialStore = class {
|
|
7447
|
-
constructor(id,
|
|
7383
|
+
constructor(id, config) {
|
|
7448
7384
|
__publicField(this, "id");
|
|
7449
7385
|
__publicField(this, "type", CredentialStoreType.nango);
|
|
7450
7386
|
__publicField(this, "nangoConfig");
|
|
7451
7387
|
__publicField(this, "nangoClient");
|
|
7452
7388
|
this.id = id;
|
|
7453
|
-
this.nangoConfig =
|
|
7389
|
+
this.nangoConfig = config;
|
|
7454
7390
|
this.nangoClient = new Nango({
|
|
7455
7391
|
secretKey: this.nangoConfig.secretKey,
|
|
7456
7392
|
host: this.nangoConfig.apiUrl
|
|
@@ -7677,8 +7613,8 @@ var NangoCredentialStore = class {
|
|
|
7677
7613
|
}
|
|
7678
7614
|
}
|
|
7679
7615
|
};
|
|
7680
|
-
function createNangoCredentialStore(id,
|
|
7681
|
-
const nangoSecretKey =
|
|
7616
|
+
function createNangoCredentialStore(id, config) {
|
|
7617
|
+
const nangoSecretKey = config?.secretKey || process.env.NANGO_SECRET_KEY;
|
|
7682
7618
|
if (!nangoSecretKey || nangoSecretKey === "your_nango_secret_key" || nangoSecretKey.includes("mock")) {
|
|
7683
7619
|
throw new Error(
|
|
7684
7620
|
"NANGO_SECRET_KEY environment variable is required and must be a real Nango secret key (not mock/placeholder)"
|
|
@@ -7686,7 +7622,7 @@ function createNangoCredentialStore(id, config2) {
|
|
|
7686
7622
|
}
|
|
7687
7623
|
return new NangoCredentialStore(id, {
|
|
7688
7624
|
apiUrl: "https://api.nango.dev",
|
|
7689
|
-
...
|
|
7625
|
+
...config,
|
|
7690
7626
|
secretKey: nangoSecretKey
|
|
7691
7627
|
});
|
|
7692
7628
|
}
|
|
@@ -7707,4 +7643,4 @@ function createDefaultCredentialStores() {
|
|
|
7707
7643
|
return stores;
|
|
7708
7644
|
}
|
|
7709
7645
|
|
|
7710
|
-
export {
|
|
7646
|
+
export { ConsoleLogger, ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStoreRegistry, CredentialStuffer, ERROR_DOCS_BASE_URL, ErrorCode, HTTP_REQUEST_PARTS, InMemoryCredentialStore, KeyChainStore, McpClient, NangoCredentialStore, NoOpLogger, TemplateEngine, addLedgerArtifacts, addToolToAgent, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, configureLogging, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentGraph, createAgentRelation, createAgentToolRelation, createApiError, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createDefaultCredentialStores, createExecutionContext, createExternalAgent, createExternalAgentRelation, createFullGraphServerSide, 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, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteTool, detectAuthenticationRequired, determineContextTrigger, discoverOAuthEndpoints, errorResponseSchema, errorSchemaFactory, externalAgentExists, externalAgentUrlExists, extractPublicId, fetchComponentRelationships, fetchDefinition, generateAndCreateApiKey, generateApiKey, getActiveAgentForConversation, getAgentById, getAgentGraph, getAgentGraphById, getAgentGraphWithDefaultAgent, getAgentInGraphContext, 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, getGraphAgentInfos, getHealthyToolsForAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getLogger, getMessageById, getMessagesByConversation, getMessagesByTask, getProject, getProjectResourceCounts, getRelatedAgentsForGraph, getRequestExecutionContext, getTask, getToolById, getToolsByStatus, getToolsForAgent, getTracer, getVisibleMessages, graphHasArtifactComponents, handleApiError, handleContextConfigChange, handleContextResolution, hasApiKey, hasContextConfig, hasCredentialReference, hashApiKey, invalidateInvocationDefinitionsCache, invalidateRequestContextCache, isApiKeyExpired, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentGraphs, listAgentGraphsPaginated, listAgentRelations, listAgentToolRelations, listAgentToolRelationsByAgent, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listMessages, listProjects, listProjectsPaginated, listTaskIdsByContextId, listTools, listToolsByStatus, loggerFactory, maskApiKey, problemDetailsSchema, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, setSpanWithError, updateAgent, updateAgentGraph, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullGraphServerSide, updateMessage, updateProject, updateTask, updateTool, updateToolStatus, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertAgentGraph, upsertAgentRelation, upsertAgentToolRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateExternalAgent, validateHttpRequestHeaders, validateInternalAgent, validateProjectExists, validateRequestContext, validationHelper, withProjectValidation };
|
package/dist/validation/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
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, AgentToolRelationApiInsertSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiUpdateSchema, AgentToolRelationInsertSchema, AgentToolRelationSelectSchema, AgentToolRelationUpdateSchema, AgentUpdateSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentRelationApiInsertSchema, ExternalAgentRelationInsertSchema, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, 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, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, resourceIdSchema, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from '../chunk-
|
|
1
|
+
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, AgentToolRelationApiInsertSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiUpdateSchema, AgentToolRelationInsertSchema, AgentToolRelationSelectSchema, AgentToolRelationUpdateSchema, AgentUpdateSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentRelationApiInsertSchema, ExternalAgentRelationInsertSchema, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, 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, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, resourceIdSchema, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from '../chunk-PXIJWVD4.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-core",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20250911212652",
|
|
4
4
|
"description": "Core database schema, types, and validation schemas for Inkeep Agent Framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VALID_RELATION_TYPES, MCPTransportType, TOOL_STATUS_VALUES, CredentialStoreType, MCPServerType } from './chunk-SVGQSPW4.js';
|
|
2
1
|
import { agents, agentRelations, agentGraph, tasks, taskRelations, tools, conversations, messages, contextCache, dataComponents, agentDataComponents, artifactComponents, agentArtifactComponents, externalAgents, apiKeys, contextConfigs, agentToolRelations, ledgerArtifacts, projects } from './chunk-M4JXMAG7.js';
|
|
2
|
+
import { VALID_RELATION_TYPES, MCPTransportType, TOOL_STATUS_VALUES, CredentialStoreType, MCPServerType } from './chunk-SVGQSPW4.js';
|
|
3
3
|
import { z } from '@hono/zod-openapi';
|
|
4
4
|
import { createSelectSchema, createInsertSchema } from 'drizzle-zod';
|
|
5
5
|
|