@inkeep/agents-core 0.0.0-dev-20251111181029 → 0.0.0-dev-20251111230615
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-FSGS4BXB.js → chunk-FUJJ4OQ2.js} +1 -1
- package/dist/{chunk-T5TTDZ6L.js → chunk-VSQY72K5.js} +133 -133
- package/dist/{chunk-OFKWNZQL.js → chunk-X6ZMJ3G6.js} +1 -1
- package/dist/client-exports.cjs +211 -211
- package/dist/client-exports.d.cts +3 -3
- package/dist/client-exports.d.ts +3 -3
- package/dist/client-exports.js +2 -2
- package/dist/db/schema.cjs +211 -211
- package/dist/db/schema.d.cts +3 -3
- package/dist/db/schema.d.ts +3 -3
- package/dist/db/schema.js +1 -1
- package/dist/index.cjs +363 -331
- package/dist/index.d.cts +109 -104
- package/dist/index.d.ts +109 -104
- package/dist/index.js +104 -73
- package/dist/{schema-lPPu5F4P.d.ts → schema-CuEjPQt7.d.ts} +876 -1014
- package/dist/{schema-WwzWCq2K.d.cts → schema-D1P8r3qm.d.cts} +876 -1014
- package/dist/types/index.d.cts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/dist/{utility-DJc47Ab9.d.cts → utility-DF5IUC9K.d.cts} +962 -1126
- package/dist/{utility-DJc47Ab9.d.ts → utility-DF5IUC9K.d.ts} +962 -1126
- package/dist/validation/index.cjs +211 -211
- package/dist/validation/index.d.cts +3 -3
- package/dist/validation/index.d.ts +3 -3
- package/dist/validation/index.js +2 -2
- package/drizzle/0000_exotic_mysterio.sql +398 -0
- package/drizzle/meta/0000_snapshot.json +1683 -1223
- package/drizzle/meta/_journal.json +4 -102
- package/package.json +6 -3
- package/drizzle/0000_material_menace.sql +0 -326
- package/drizzle/0001_eminent_fixer.sql +0 -43
- package/drizzle/0002_bumpy_romulus.sql +0 -3
- package/drizzle/0003_soft_forgotten_one.sql +0 -39
- package/drizzle/0004_melted_omega_flight.sql +0 -3
- package/drizzle/0005_wide_shriek.sql +0 -127
- package/drizzle/0006_damp_lenny_balinger.sql +0 -52
- package/drizzle/0007_mighty_typhoid_mary.sql +0 -227
- package/drizzle/0008_mysterious_crusher_hogan.sql +0 -20
- package/drizzle/0009_old_black_cat.sql +0 -1
- package/drizzle/0010_wet_vampiro.sql +0 -2
- package/drizzle/0011_slippery_korg.sql +0 -36
- package/drizzle/0012_salty_psynapse.sql +0 -17
- package/drizzle/0013_shocking_blur.sql +0 -19
- package/drizzle/0014_broad_hellfire_club.sql +0 -29
- package/drizzle/meta/0001_snapshot.json +0 -2435
- package/drizzle/meta/0002_snapshot.json +0 -2428
- package/drizzle/meta/0003_snapshot.json +0 -2559
- package/drizzle/meta/0004_snapshot.json +0 -2547
- package/drizzle/meta/0005_snapshot.json +0 -2558
- package/drizzle/meta/0006_snapshot.json +0 -2751
- package/drizzle/meta/0007_snapshot.json +0 -2766
- package/drizzle/meta/0008_snapshot.json +0 -2753
- package/drizzle/meta/0009_snapshot.json +0 -2744
- package/drizzle/meta/0010_snapshot.json +0 -2751
- package/drizzle/meta/0011_snapshot.json +0 -2849
- package/drizzle/meta/0012_snapshot.json +0 -2985
- package/drizzle/meta/0013_snapshot.json +0 -2988
- package/drizzle/meta/0014_snapshot.json +0 -2992
package/dist/index.js
CHANGED
|
@@ -4,26 +4,29 @@ export { ANTHROPIC_MODELS, GOOGLE_MODELS, OPENAI_MODELS } from './chunk-MQTANAMG
|
|
|
4
4
|
export { TaskState } from './chunk-H2F72PDA.js';
|
|
5
5
|
import { getLogger, convertZodToJsonSchema } from './chunk-YECQCT5N.js';
|
|
6
6
|
export { PinoLogger, convertZodToJsonSchema, convertZodToJsonSchemaWithPreview, extractPreviewFields, getLogger, isZodSchema, loggerFactory, preview } from './chunk-YECQCT5N.js';
|
|
7
|
-
import { validateRender, validateAndTypeAgentData, validateAgentStructure } from './chunk-
|
|
8
|
-
export { A2AMessageMetadataSchema, DataComponentStreamEventSchema, DataOperationDetailsSchema, DataOperationEventSchema, DataOperationStreamEventSchema, DataSummaryStreamEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, StreamErrorEventSchema, StreamEventSchema, StreamFinishEventSchema, TextDeltaEventSchema, TextEndEventSchema, TextStartEventSchema, TransferDataSchema, generateIdFromName, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateRender, validateSubAgentExternalAgentRelations, validateToolReferences } from './chunk-
|
|
9
|
-
import { schemaValidationDefaults, ContextConfigApiUpdateSchema, validatePropsAsJsonSchema } from './chunk-
|
|
10
|
-
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ComponentAssociationSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CreateCredentialInStoreRequestSchema, CreateCredentialInStoreResponseSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, CredentialStoreListResponseSchema, CredentialStoreSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, OAuthCallbackQuerySchema, OAuthLoginQuerySchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RelatedAgentInfoSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TeamAgentSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, canDelegateToExternalAgentSchema, canDelegateToTeamAgentSchema, resourceIdSchema, schemaValidationDefaults, validatePropsAsJsonSchema } from './chunk-
|
|
11
|
-
import { schema_exports, contextConfigs, externalAgents, functions, functionTools, subAgentFunctionToolRelations, subAgentExternalAgentRelations, subAgents, subAgentRelations, subAgentToolRelations, tools, subAgentTeamAgentRelations, agents, credentialReferences, subAgentDataComponents, subAgentArtifactComponents, dataComponents, artifactComponents, projects, apiKeys, contextCache, conversations, messages, ledgerArtifacts, tasks, taskRelations } from './chunk-
|
|
12
|
-
export { agentRelations, agentToolRelationsRelations, agents, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, functionTools, functionToolsRelations, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentExternalAgentRelations, subAgentExternalAgentRelationsRelations, subAgentFunctionToolRelations, subAgentFunctionToolRelationsRelations, subAgentRelations, subAgentRelationsRelations, subAgentTeamAgentRelations, subAgentTeamAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-
|
|
7
|
+
import { validateRender, validateAndTypeAgentData, validateAgentStructure } from './chunk-X6ZMJ3G6.js';
|
|
8
|
+
export { A2AMessageMetadataSchema, DataComponentStreamEventSchema, DataOperationDetailsSchema, DataOperationEventSchema, DataOperationStreamEventSchema, DataSummaryStreamEventSchema, DelegationReturnedDataSchema, DelegationSentDataSchema, StreamErrorEventSchema, StreamEventSchema, StreamFinishEventSchema, TextDeltaEventSchema, TextEndEventSchema, TextStartEventSchema, TransferDataSchema, generateIdFromName, isValidResourceId, validateAgentRelationships, validateAgentStructure, validateAndTypeAgentData, validateArtifactComponentReferences, validateDataComponentReferences, validateRender, validateSubAgentExternalAgentRelations, validateToolReferences } from './chunk-X6ZMJ3G6.js';
|
|
9
|
+
import { schemaValidationDefaults, ContextConfigApiUpdateSchema, validatePropsAsJsonSchema } from './chunk-FUJJ4OQ2.js';
|
|
10
|
+
export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentInsertSchema, AgentListResponse, AgentResponse, AgentSelectSchema, AgentStopWhenSchema, AgentUpdateSchema, AgentWithinContextOfProjectSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeyListResponse, ApiKeyResponse, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentListResponse, ArtifactComponentResponse, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, CanUseItemSchema, ComponentAssociationSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigListResponse, ContextConfigResponse, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationListResponse, ConversationResponse, ConversationSelectSchema, ConversationUpdateSchema, CreateCredentialInStoreRequestSchema, CreateCredentialInStoreResponseSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceListResponse, CredentialReferenceResponse, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, CredentialStoreListResponseSchema, CredentialStoreSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentListResponse, DataComponentResponse, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentListResponse, ExternalAgentResponse, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, ExternalSubAgentRelationApiInsertSchema, ExternalSubAgentRelationInsertSchema, FetchConfigSchema, FetchDefinitionSchema, FullAgentAgentInsertSchema, FullProjectDefinitionSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, FunctionInsertSchema, FunctionListResponse, FunctionResponse, FunctionSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiSelectSchema, FunctionToolApiUpdateSchema, FunctionToolConfigSchema, FunctionToolInsertSchema, FunctionToolListResponse, FunctionToolResponse, FunctionToolSelectSchema, FunctionToolUpdateSchema, FunctionUpdateSchema, HeadersScopeSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageListResponse, MessageResponse, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, OAuthCallbackQuerySchema, OAuthLoginQuerySchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectListResponse, ProjectModelSchema, ProjectResponse, ProjectSelectSchema, ProjectUpdateSchema, RelatedAgentInfoSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, StopWhenSchema, SubAgentApiInsertSchema, SubAgentApiSelectSchema, SubAgentApiUpdateSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiUpdateSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentListResponse, SubAgentArtifactComponentResponse, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentUpdateSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiUpdateSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentListResponse, SubAgentDataComponentResponse, SubAgentDataComponentSelectSchema, SubAgentDataComponentUpdateSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentInsertSchema, SubAgentListResponse, SubAgentRelationApiInsertSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationInsertSchema, SubAgentRelationListResponse, SubAgentRelationQuerySchema, SubAgentRelationResponse, SubAgentRelationSelectSchema, SubAgentRelationUpdateSchema, SubAgentResponse, SubAgentSelectSchema, SubAgentStopWhenSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiUpdateSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationListResponse, SubAgentToolRelationResponse, SubAgentToolRelationSelectSchema, SubAgentToolRelationUpdateSchema, SubAgentUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TeamAgentSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolListResponse, ToolResponse, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, canDelegateToExternalAgentSchema, canDelegateToTeamAgentSchema, resourceIdSchema, schemaValidationDefaults, validatePropsAsJsonSchema } from './chunk-FUJJ4OQ2.js';
|
|
11
|
+
import { schema_exports, contextConfigs, externalAgents, functions, functionTools, subAgentFunctionToolRelations, subAgentExternalAgentRelations, subAgents, subAgentRelations, subAgentToolRelations, tools, subAgentTeamAgentRelations, agents, credentialReferences, subAgentDataComponents, subAgentArtifactComponents, dataComponents, artifactComponents, projects, apiKeys, contextCache, conversations, messages, ledgerArtifacts, tasks, taskRelations } from './chunk-VSQY72K5.js';
|
|
12
|
+
export { agentRelations, agentToolRelationsRelations, agents, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, dataComponentsRelations, externalAgents, externalAgentsRelations, functionTools, functionToolsRelations, functions, functionsRelations, ledgerArtifacts, ledgerArtifactsRelations, messages, messagesRelations, projects, projectsRelations, subAgentArtifactComponents, subAgentArtifactComponentsRelations, subAgentDataComponents, subAgentDataComponentsRelations, subAgentExternalAgentRelations, subAgentExternalAgentRelationsRelations, subAgentFunctionToolRelations, subAgentFunctionToolRelationsRelations, subAgentRelations, subAgentRelationsRelations, subAgentTeamAgentRelations, subAgentTeamAgentRelationsRelations, subAgentToolRelations, subAgents, subAgentsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-VSQY72K5.js';
|
|
13
13
|
import { CredentialStoreType, MCPServerType, MCPTransportType } from './chunk-YFHT5M2R.js';
|
|
14
14
|
export { CredentialStoreType, MCPServerType, MCPTransportType, TOOL_STATUS_VALUES, VALID_RELATION_TYPES } from './chunk-YFHT5M2R.js';
|
|
15
15
|
import { __commonJS, __require, __publicField } from './chunk-E6R6PML7.js';
|
|
16
16
|
import { z } from 'zod';
|
|
17
17
|
import fs from 'fs';
|
|
18
18
|
import os from 'os';
|
|
19
|
-
import path from 'path';
|
|
19
|
+
import path, { dirname } from 'path';
|
|
20
20
|
import dotenv from 'dotenv';
|
|
21
21
|
import { expand } from 'dotenv-expand';
|
|
22
22
|
import { findUpSync } from 'find-up';
|
|
23
23
|
import jmespath from 'jmespath';
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
24
|
+
import { drizzle } from 'drizzle-orm/node-postgres';
|
|
25
|
+
import { Pool } from 'pg';
|
|
26
|
+
import { fileURLToPath } from 'url';
|
|
27
|
+
import { PGlite } from '@electric-sql/pglite';
|
|
26
28
|
import { and, eq, desc, sql, count, asc, isNotNull, inArray, not } from 'drizzle-orm';
|
|
29
|
+
import { drizzle as drizzle$1 } from 'drizzle-orm/pglite';
|
|
27
30
|
import { customAlphabet, nanoid } from 'nanoid';
|
|
28
31
|
import crypto, { scrypt, randomBytes, timingSafeEqual } from 'crypto';
|
|
29
32
|
import { promisify } from 'util';
|
|
@@ -225,7 +228,7 @@ var require_util = __commonJS({
|
|
|
225
228
|
return path2;
|
|
226
229
|
}
|
|
227
230
|
exports.normalize = normalize;
|
|
228
|
-
function
|
|
231
|
+
function join2(aRoot, aPath) {
|
|
229
232
|
if (aRoot === "") {
|
|
230
233
|
aRoot = ".";
|
|
231
234
|
}
|
|
@@ -257,7 +260,7 @@ var require_util = __commonJS({
|
|
|
257
260
|
}
|
|
258
261
|
return joined;
|
|
259
262
|
}
|
|
260
|
-
exports.join =
|
|
263
|
+
exports.join = join2;
|
|
261
264
|
exports.isAbsolute = function(aPath) {
|
|
262
265
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
263
266
|
};
|
|
@@ -430,7 +433,7 @@ var require_util = __commonJS({
|
|
|
430
433
|
parsed.path = parsed.path.substring(0, index + 1);
|
|
431
434
|
}
|
|
432
435
|
}
|
|
433
|
-
sourceURL =
|
|
436
|
+
sourceURL = join2(urlGenerate(parsed), sourceURL);
|
|
434
437
|
}
|
|
435
438
|
return normalize(sourceURL);
|
|
436
439
|
}
|
|
@@ -212904,9 +212907,8 @@ var loadEnvironmentFiles = () => {
|
|
|
212904
212907
|
loadEnvironmentFiles();
|
|
212905
212908
|
var envSchema = z.object({
|
|
212906
212909
|
ENVIRONMENT: z.enum(["development", "production", "pentest", "test"]).optional(),
|
|
212907
|
-
|
|
212908
|
-
|
|
212909
|
-
TURSO_AUTH_TOKEN: z.string().optional(),
|
|
212910
|
+
DATABASE_URL: z.string().optional(),
|
|
212911
|
+
POSTGRES_POOL_SIZE: z.string().optional(),
|
|
212910
212912
|
INKEEP_AGENTS_JWT_SIGNING_SECRET: z.string().min(32, "INKEEP_AGENTS_JWT_SIGNING_SECRET must be at least 32 characters").optional()
|
|
212911
212913
|
});
|
|
212912
212914
|
var parseEnv = () => {
|
|
@@ -213672,20 +213674,38 @@ var CredentialStuffer = class {
|
|
|
213672
213674
|
};
|
|
213673
213675
|
}
|
|
213674
213676
|
};
|
|
213675
|
-
|
|
213676
|
-
|
|
213677
|
-
|
|
213678
|
-
|
|
213677
|
+
var __filename2 = fileURLToPath(import.meta.url);
|
|
213678
|
+
dirname(__filename2);
|
|
213679
|
+
function createTestDatabaseClientNoMigrations() {
|
|
213680
|
+
const client = new PGlite();
|
|
213681
|
+
const db = drizzle$1(client, { schema: schema_exports });
|
|
213682
|
+
return db;
|
|
213683
|
+
}
|
|
213684
|
+
|
|
213685
|
+
// src/db/client.ts
|
|
213686
|
+
loadEnvironmentFiles();
|
|
213687
|
+
function createDatabaseClient(config = {}) {
|
|
213688
|
+
const connectionString = config.connectionString || process.env.DATABASE_URL;
|
|
213689
|
+
if (env.ENVIRONMENT === "test") {
|
|
213690
|
+
return createTestDatabaseClientNoMigrations();
|
|
213691
|
+
}
|
|
213692
|
+
if (!connectionString) {
|
|
213693
|
+
throw new Error(
|
|
213694
|
+
"DATABASE_URL environment variable is required. Please set it to your PostgreSQL connection string."
|
|
213695
|
+
);
|
|
213696
|
+
}
|
|
213697
|
+
const pool = new Pool({
|
|
213698
|
+
connectionString,
|
|
213699
|
+
max: config.poolSize || Number(env.POSTGRES_POOL_SIZE) || 10
|
|
213700
|
+
});
|
|
213701
|
+
pool.on("error", (err) => {
|
|
213702
|
+
console.error("Unexpected PostgreSQL pool error:", err);
|
|
213679
213703
|
});
|
|
213680
|
-
return drizzle(
|
|
213704
|
+
return drizzle(pool, {
|
|
213681
213705
|
schema: schema_exports,
|
|
213682
213706
|
logger: config.logger
|
|
213683
213707
|
});
|
|
213684
213708
|
}
|
|
213685
|
-
function createInMemoryDatabaseClient() {
|
|
213686
|
-
const db = createDatabaseClient({ url: ":memory:" });
|
|
213687
|
-
return db;
|
|
213688
|
-
}
|
|
213689
213709
|
var generateId = customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789", 21);
|
|
213690
213710
|
function getConversationId() {
|
|
213691
213711
|
return generateId();
|
|
@@ -214597,8 +214617,8 @@ var deleteSubAgentExternalAgentRelation = (db) => async (params) => {
|
|
|
214597
214617
|
eq(subAgentExternalAgentRelations.subAgentId, params.scopes.subAgentId),
|
|
214598
214618
|
eq(subAgentExternalAgentRelations.id, params.relationId)
|
|
214599
214619
|
)
|
|
214600
|
-
);
|
|
214601
|
-
return
|
|
214620
|
+
).returning();
|
|
214621
|
+
return result.length > 0;
|
|
214602
214622
|
};
|
|
214603
214623
|
var deleteSubAgentExternalAgentRelationsBySubAgent = (db) => async (params) => {
|
|
214604
214624
|
const result = await db.delete(subAgentExternalAgentRelations).where(
|
|
@@ -214608,8 +214628,8 @@ var deleteSubAgentExternalAgentRelationsBySubAgent = (db) => async (params) => {
|
|
|
214608
214628
|
eq(subAgentExternalAgentRelations.agentId, params.scopes.agentId),
|
|
214609
214629
|
eq(subAgentExternalAgentRelations.subAgentId, params.scopes.subAgentId)
|
|
214610
214630
|
)
|
|
214611
|
-
);
|
|
214612
|
-
return
|
|
214631
|
+
).returning();
|
|
214632
|
+
return result.length > 0;
|
|
214613
214633
|
};
|
|
214614
214634
|
var deleteSubAgentExternalAgentRelationsByAgent = (db) => async (params) => {
|
|
214615
214635
|
const result = await db.delete(subAgentExternalAgentRelations).where(
|
|
@@ -214618,8 +214638,8 @@ var deleteSubAgentExternalAgentRelationsByAgent = (db) => async (params) => {
|
|
|
214618
214638
|
eq(subAgentExternalAgentRelations.projectId, params.scopes.projectId),
|
|
214619
214639
|
eq(subAgentExternalAgentRelations.agentId, params.scopes.agentId)
|
|
214620
214640
|
)
|
|
214621
|
-
);
|
|
214622
|
-
return
|
|
214641
|
+
).returning();
|
|
214642
|
+
return result.length > 0;
|
|
214623
214643
|
};
|
|
214624
214644
|
var getAgentRelationById = (db) => async (params) => {
|
|
214625
214645
|
return db.query.subAgentRelations.findFirst({
|
|
@@ -214806,8 +214826,8 @@ var deleteSubAgentRelation = (db) => async (params) => {
|
|
|
214806
214826
|
eq(subAgentRelations.agentId, params.scopes.agentId),
|
|
214807
214827
|
eq(subAgentRelations.id, params.relationId)
|
|
214808
214828
|
)
|
|
214809
|
-
);
|
|
214810
|
-
return
|
|
214829
|
+
).returning();
|
|
214830
|
+
return result.length > 0;
|
|
214811
214831
|
};
|
|
214812
214832
|
var deleteAgentRelationsByAgent = (db) => async (params) => {
|
|
214813
214833
|
const result = await db.delete(subAgentRelations).where(
|
|
@@ -214815,8 +214835,8 @@ var deleteAgentRelationsByAgent = (db) => async (params) => {
|
|
|
214815
214835
|
eq(subAgentRelations.tenantId, params.scopes.tenantId),
|
|
214816
214836
|
eq(subAgentRelations.agentId, params.scopes.agentId)
|
|
214817
214837
|
)
|
|
214818
|
-
);
|
|
214819
|
-
return
|
|
214838
|
+
).returning();
|
|
214839
|
+
return result.length > 0;
|
|
214820
214840
|
};
|
|
214821
214841
|
var createAgentToolRelation = (db) => async (params) => {
|
|
214822
214842
|
const finalRelationId = params.relationId ?? generateId();
|
|
@@ -214855,8 +214875,8 @@ var deleteAgentToolRelation = (db) => async (params) => {
|
|
|
214855
214875
|
eq(subAgentToolRelations.agentId, params.scopes.agentId),
|
|
214856
214876
|
eq(subAgentToolRelations.id, params.relationId)
|
|
214857
214877
|
)
|
|
214858
|
-
);
|
|
214859
|
-
return
|
|
214878
|
+
).returning();
|
|
214879
|
+
return result.length > 0;
|
|
214860
214880
|
};
|
|
214861
214881
|
var deleteAgentToolRelationByAgent = (db) => async (params) => {
|
|
214862
214882
|
const result = await db.delete(subAgentToolRelations).where(
|
|
@@ -214866,8 +214886,8 @@ var deleteAgentToolRelationByAgent = (db) => async (params) => {
|
|
|
214866
214886
|
eq(subAgentToolRelations.agentId, params.scopes.agentId),
|
|
214867
214887
|
eq(subAgentToolRelations.subAgentId, params.scopes.subAgentId)
|
|
214868
214888
|
)
|
|
214869
|
-
);
|
|
214870
|
-
return
|
|
214889
|
+
).returning();
|
|
214890
|
+
return result.length > 0;
|
|
214871
214891
|
};
|
|
214872
214892
|
var getAgentToolRelationById = (db) => async (params) => {
|
|
214873
214893
|
return await db.query.subAgentToolRelations.findFirst({
|
|
@@ -215469,8 +215489,8 @@ var deleteSubAgentTeamAgentRelation = (db) => async (params) => {
|
|
|
215469
215489
|
eq(subAgentTeamAgentRelations.subAgentId, params.scopes.subAgentId),
|
|
215470
215490
|
eq(subAgentTeamAgentRelations.id, params.relationId)
|
|
215471
215491
|
)
|
|
215472
|
-
);
|
|
215473
|
-
return
|
|
215492
|
+
).returning();
|
|
215493
|
+
return result.length > 0;
|
|
215474
215494
|
};
|
|
215475
215495
|
var deleteSubAgentTeamAgentRelationsBySubAgent = (db) => async (params) => {
|
|
215476
215496
|
const result = await db.delete(subAgentTeamAgentRelations).where(
|
|
@@ -215480,8 +215500,8 @@ var deleteSubAgentTeamAgentRelationsBySubAgent = (db) => async (params) => {
|
|
|
215480
215500
|
eq(subAgentTeamAgentRelations.agentId, params.scopes.agentId),
|
|
215481
215501
|
eq(subAgentTeamAgentRelations.subAgentId, params.scopes.subAgentId)
|
|
215482
215502
|
)
|
|
215483
|
-
);
|
|
215484
|
-
return
|
|
215503
|
+
).returning();
|
|
215504
|
+
return result.length > 0;
|
|
215485
215505
|
};
|
|
215486
215506
|
var deleteSubAgentTeamAgentRelationsByAgent = (db) => async (params) => {
|
|
215487
215507
|
const result = await db.delete(subAgentTeamAgentRelations).where(
|
|
@@ -215490,8 +215510,8 @@ var deleteSubAgentTeamAgentRelationsByAgent = (db) => async (params) => {
|
|
|
215490
215510
|
eq(subAgentTeamAgentRelations.projectId, params.scopes.projectId),
|
|
215491
215511
|
eq(subAgentTeamAgentRelations.agentId, params.scopes.agentId)
|
|
215492
215512
|
)
|
|
215493
|
-
);
|
|
215494
|
-
return
|
|
215513
|
+
).returning();
|
|
215514
|
+
return result.length > 0;
|
|
215495
215515
|
};
|
|
215496
215516
|
var scryptAsync = promisify(scrypt);
|
|
215497
215517
|
var logger4 = getLogger("api-key");
|
|
@@ -215566,6 +215586,18 @@ function extractPublicId(key) {
|
|
|
215566
215586
|
function maskApiKey(keyPrefix) {
|
|
215567
215587
|
return `${keyPrefix}...`;
|
|
215568
215588
|
}
|
|
215589
|
+
|
|
215590
|
+
// src/utils/date.ts
|
|
215591
|
+
function normalizeDateString(dateString) {
|
|
215592
|
+
if (typeof dateString !== "string") {
|
|
215593
|
+
return dateString;
|
|
215594
|
+
}
|
|
215595
|
+
const pgTimestampPattern = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(\.\d{1,3})?$/;
|
|
215596
|
+
if (pgTimestampPattern.test(dateString)) {
|
|
215597
|
+
return dateString.replace(" ", "T") + "Z";
|
|
215598
|
+
}
|
|
215599
|
+
return dateString;
|
|
215600
|
+
}
|
|
215569
215601
|
var ErrorCode = z$1.enum([
|
|
215570
215602
|
"bad_request",
|
|
215571
215603
|
"unauthorized",
|
|
@@ -216487,8 +216519,8 @@ var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry) => {
|
|
|
216487
216519
|
availableTools: [],
|
|
216488
216520
|
capabilities: capabilities || void 0,
|
|
216489
216521
|
credentialReferenceId: credentialReferenceId || void 0,
|
|
216490
|
-
createdAt: new Date(createdAt),
|
|
216491
|
-
updatedAt: new Date(dbResult.updatedAt),
|
|
216522
|
+
createdAt: new Date(normalizeDateString(createdAt)),
|
|
216523
|
+
updatedAt: new Date(normalizeDateString(dbResult.updatedAt)),
|
|
216492
216524
|
lastError: null,
|
|
216493
216525
|
headers: headers2 || void 0,
|
|
216494
216526
|
imageUrl: imageUrl || void 0
|
|
@@ -216521,7 +216553,7 @@ var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry) => {
|
|
|
216521
216553
|
} else if (credentialStore.type === CredentialStoreType.keychain) {
|
|
216522
216554
|
const oauthTokens = JSON.parse(credentialDataString);
|
|
216523
216555
|
if (oauthTokens.expires_at) {
|
|
216524
|
-
expiresAt = new Date(oauthTokens.expires_at);
|
|
216556
|
+
expiresAt = new Date(normalizeDateString(oauthTokens.expires_at));
|
|
216525
216557
|
}
|
|
216526
216558
|
}
|
|
216527
216559
|
}
|
|
@@ -216558,7 +216590,7 @@ var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry) => {
|
|
|
216558
216590
|
availableTools,
|
|
216559
216591
|
capabilities: capabilities || void 0,
|
|
216560
216592
|
credentialReferenceId: credentialReferenceId || void 0,
|
|
216561
|
-
createdAt: new Date(createdAt),
|
|
216593
|
+
createdAt: new Date(normalizeDateString(createdAt)),
|
|
216562
216594
|
updatedAt: new Date(now),
|
|
216563
216595
|
expiresAt,
|
|
216564
216596
|
lastError: lastErrorComputed,
|
|
@@ -217120,8 +217152,8 @@ var getFullAgentDefinition = (db) => async ({
|
|
|
217120
217152
|
description: agent.description,
|
|
217121
217153
|
defaultSubAgentId: agent.defaultSubAgentId,
|
|
217122
217154
|
subAgents: agentsObject,
|
|
217123
|
-
createdAt: agent.createdAt && !Number.isNaN(new Date(agent.createdAt).getTime()) ? new Date(agent.createdAt)
|
|
217124
|
-
updatedAt: agent.updatedAt && !Number.isNaN(new Date(agent.updatedAt).getTime()) ? new Date(agent.updatedAt)
|
|
217155
|
+
createdAt: agent.createdAt && !Number.isNaN(new Date(agent.createdAt).getTime()) ? new Date(agent.createdAt) : /* @__PURE__ */ new Date(),
|
|
217156
|
+
updatedAt: agent.updatedAt && !Number.isNaN(new Date(agent.updatedAt).getTime()) ? new Date(agent.updatedAt) : /* @__PURE__ */ new Date()
|
|
217125
217157
|
};
|
|
217126
217158
|
if (Object.keys(externalAgentsObject).length > 0) {
|
|
217127
217159
|
result.externalAgents = externalAgentsObject;
|
|
@@ -217426,8 +217458,8 @@ var deleteAgentArtifactComponentRelationByAgent = (db) => async (params) => {
|
|
|
217426
217458
|
eq(subAgentArtifactComponents.agentId, params.scopes.agentId),
|
|
217427
217459
|
eq(subAgentArtifactComponents.subAgentId, params.scopes.subAgentId)
|
|
217428
217460
|
)
|
|
217429
|
-
);
|
|
217430
|
-
return
|
|
217461
|
+
).returning();
|
|
217462
|
+
return result.length > 0;
|
|
217431
217463
|
};
|
|
217432
217464
|
var getAgentsUsingArtifactComponent = (db) => async (params) => {
|
|
217433
217465
|
return await db.select({
|
|
@@ -217692,8 +217724,8 @@ var deleteAgentDataComponentRelationByAgent = (db) => async (params) => {
|
|
|
217692
217724
|
eq(subAgentDataComponents.agentId, params.scopes.agentId),
|
|
217693
217725
|
eq(subAgentDataComponents.subAgentId, params.scopes.subAgentId)
|
|
217694
217726
|
)
|
|
217695
|
-
);
|
|
217696
|
-
return
|
|
217727
|
+
).returning();
|
|
217728
|
+
return result.length > 0;
|
|
217697
217729
|
};
|
|
217698
217730
|
var getAgentsUsingDataComponent = (db) => async (params) => {
|
|
217699
217731
|
return await db.select({
|
|
@@ -218777,8 +218809,8 @@ var updateFullAgentServerSide = (db, logger14 = defaultLogger) => async (scopes,
|
|
|
218777
218809
|
eq(subAgentToolRelations.agentId, finalAgentId),
|
|
218778
218810
|
eq(subAgentToolRelations.subAgentId, subAgentId)
|
|
218779
218811
|
)
|
|
218780
|
-
);
|
|
218781
|
-
deletedCount = result.
|
|
218812
|
+
).returning();
|
|
218813
|
+
deletedCount = result.length;
|
|
218782
218814
|
} else {
|
|
218783
218815
|
const result = await db.delete(subAgentToolRelations).where(
|
|
218784
218816
|
and(
|
|
@@ -218788,8 +218820,8 @@ var updateFullAgentServerSide = (db, logger14 = defaultLogger) => async (scopes,
|
|
|
218788
218820
|
eq(subAgentToolRelations.subAgentId, subAgentId),
|
|
218789
218821
|
not(inArray(subAgentToolRelations.id, Array.from(incomingRelationshipIds)))
|
|
218790
218822
|
)
|
|
218791
|
-
);
|
|
218792
|
-
deletedCount = result.
|
|
218823
|
+
).returning();
|
|
218824
|
+
deletedCount = result.length;
|
|
218793
218825
|
}
|
|
218794
218826
|
if (deletedCount > 0) {
|
|
218795
218827
|
logger14.info({ subAgentId, deletedCount }, "Deleted orphaned agent-tool relations");
|
|
@@ -219247,6 +219279,7 @@ var deleteApiKey = (db) => async (params) => {
|
|
|
219247
219279
|
id: params.id
|
|
219248
219280
|
});
|
|
219249
219281
|
if (!existingKey) {
|
|
219282
|
+
console.error("API key not found", { params });
|
|
219250
219283
|
return false;
|
|
219251
219284
|
}
|
|
219252
219285
|
await db.delete(apiKeys).where(
|
|
@@ -219377,8 +219410,8 @@ var clearConversationCache = (db) => async (params) => {
|
|
|
219377
219410
|
eq(contextCache.projectId, params.scopes.projectId),
|
|
219378
219411
|
eq(contextCache.conversationId, params.conversationId)
|
|
219379
219412
|
)
|
|
219380
|
-
);
|
|
219381
|
-
return result.
|
|
219413
|
+
).returning();
|
|
219414
|
+
return result.length;
|
|
219382
219415
|
};
|
|
219383
219416
|
var clearContextConfigCache = (db) => async (params) => {
|
|
219384
219417
|
const result = await db.delete(contextCache).where(
|
|
@@ -219387,8 +219420,8 @@ var clearContextConfigCache = (db) => async (params) => {
|
|
|
219387
219420
|
eq(contextCache.projectId, params.scopes.projectId),
|
|
219388
219421
|
eq(contextCache.contextConfigId, params.contextConfigId)
|
|
219389
219422
|
)
|
|
219390
|
-
);
|
|
219391
|
-
return result.
|
|
219423
|
+
).returning();
|
|
219424
|
+
return result.length;
|
|
219392
219425
|
};
|
|
219393
219426
|
var cleanupTenantCache = (db) => async (params) => {
|
|
219394
219427
|
const result = await db.delete(contextCache).where(
|
|
@@ -219396,8 +219429,8 @@ var cleanupTenantCache = (db) => async (params) => {
|
|
|
219396
219429
|
eq(contextCache.tenantId, params.scopes.tenantId),
|
|
219397
219430
|
eq(contextCache.projectId, params.scopes.projectId)
|
|
219398
219431
|
)
|
|
219399
|
-
);
|
|
219400
|
-
return result.
|
|
219432
|
+
).returning();
|
|
219433
|
+
return result.length;
|
|
219401
219434
|
};
|
|
219402
219435
|
var invalidateHeadersCache = (db) => async (params) => {
|
|
219403
219436
|
const result = await db.delete(contextCache).where(
|
|
@@ -219408,8 +219441,8 @@ var invalidateHeadersCache = (db) => async (params) => {
|
|
|
219408
219441
|
eq(contextCache.contextConfigId, params.contextConfigId),
|
|
219409
219442
|
eq(contextCache.contextVariableKey, "headers")
|
|
219410
219443
|
)
|
|
219411
|
-
);
|
|
219412
|
-
return result.
|
|
219444
|
+
).returning();
|
|
219445
|
+
return result.length;
|
|
219413
219446
|
};
|
|
219414
219447
|
var invalidateInvocationDefinitionsCache = (db) => async (params) => {
|
|
219415
219448
|
let totalRowsAffected = 0;
|
|
@@ -219422,8 +219455,8 @@ var invalidateInvocationDefinitionsCache = (db) => async (params) => {
|
|
|
219422
219455
|
eq(contextCache.contextConfigId, params.contextConfigId),
|
|
219423
219456
|
eq(contextCache.contextVariableKey, definitionId)
|
|
219424
219457
|
)
|
|
219425
|
-
);
|
|
219426
|
-
totalRowsAffected += result.
|
|
219458
|
+
).returning();
|
|
219459
|
+
totalRowsAffected += result.length;
|
|
219427
219460
|
}
|
|
219428
219461
|
return totalRowsAffected;
|
|
219429
219462
|
};
|
|
@@ -219842,7 +219875,7 @@ var addLedgerArtifacts = (db) => async (params) => {
|
|
|
219842
219875
|
return;
|
|
219843
219876
|
} catch (error) {
|
|
219844
219877
|
lastError = error;
|
|
219845
|
-
const isRetryable = error.code === "
|
|
219878
|
+
const isRetryable = error.cause.code === "40P01" || error.cause.code === "40001" || error.cause.code === "55P03" || error.message?.includes("database is locked") || error.message?.includes("busy") || error.message?.includes("timeout") || error.message?.includes("deadlock") || error.message?.includes("serialization failure");
|
|
219846
219879
|
if (!isRetryable || attempt === maxRetries) {
|
|
219847
219880
|
await tryFallbackInsert(db, rows);
|
|
219848
219881
|
return;
|
|
@@ -220260,9 +220293,7 @@ var createFullProjectServerSide = (db, logger14 = defaultLogger2) => async (scop
|
|
|
220260
220293
|
description: typed.description || "",
|
|
220261
220294
|
models: typed.models,
|
|
220262
220295
|
stopWhen: typed.stopWhen,
|
|
220263
|
-
tenantId
|
|
220264
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
220265
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
220296
|
+
tenantId
|
|
220266
220297
|
};
|
|
220267
220298
|
logger14.info({ projectId: typed.id }, "Creating project metadata");
|
|
220268
220299
|
await createProject(db)(projectPayload);
|
|
@@ -223570,4 +223601,4 @@ typescript/lib/typescript.js:
|
|
|
223570
223601
|
***************************************************************************** *)
|
|
223571
223602
|
*/
|
|
223572
223603
|
|
|
223573
|
-
export { AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT, AGENT_EXECUTION_TRANSFER_COUNT_MAX, AGENT_EXECUTION_TRANSFER_COUNT_MIN, CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT, CONVERSATION_HISTORY_DEFAULT_LIMIT, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStoreRegistry, CredentialStuffer, ERROR_DOCS_BASE_URL, ErrorCode, HTTP_REQUEST_PARTS, InMemoryCredentialStore, KeyChainStore, MCP_TOOL_CONNECTION_TIMEOUT_MS, MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RETRIES, MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR, McpClient, NangoCredentialStore, STATUS_UPDATE_MAX_INTERVAL_SECONDS, STATUS_UPDATE_MAX_NUM_EVENTS, SUB_AGENT_TURN_GENERATION_STEPS_DEFAULT, SUB_AGENT_TURN_GENERATION_STEPS_MAX, SUB_AGENT_TURN_GENERATION_STEPS_MIN, TemplateEngine, VALIDATION_AGENT_PROMPT_MAX_CHARS, VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS, addFunctionToolToSubAgent, addLedgerArtifacts, addToolToAgent, agentHasArtifactComponents, apiFetch, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentToolRelation, createApiError, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createDefaultCredentialStores, createExecutionContext, createExternalAgent, createFullAgentServerSide, createFullProjectServerSide, createFunctionTool,
|
|
223604
|
+
export { AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT, AGENT_EXECUTION_TRANSFER_COUNT_MAX, AGENT_EXECUTION_TRANSFER_COUNT_MIN, CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT, CONVERSATION_HISTORY_DEFAULT_LIMIT, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStoreRegistry, CredentialStuffer, ERROR_DOCS_BASE_URL, ErrorCode, HTTP_REQUEST_PARTS, InMemoryCredentialStore, KeyChainStore, MCP_TOOL_CONNECTION_TIMEOUT_MS, MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RETRIES, MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR, McpClient, NangoCredentialStore, STATUS_UPDATE_MAX_INTERVAL_SECONDS, STATUS_UPDATE_MAX_NUM_EVENTS, SUB_AGENT_TURN_GENERATION_STEPS_DEFAULT, SUB_AGENT_TURN_GENERATION_STEPS_MAX, SUB_AGENT_TURN_GENERATION_STEPS_MIN, TemplateEngine, VALIDATION_AGENT_PROMPT_MAX_CHARS, VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS, addFunctionToolToSubAgent, addLedgerArtifacts, addToolToAgent, agentHasArtifactComponents, apiFetch, associateArtifactComponentWithAgent, associateDataComponentWithAgent, cleanupTenantCache, clearContextConfigCache, clearConversationCache, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, contextConfig, contextValidationMiddleware, countApiKeys, countArtifactComponents, countArtifactComponentsForAgent, countContextConfigs, countCredentialReferences, countDataComponents, countExternalAgents, countLedgerArtifactsByTask, countMessagesByConversation, countProjects, createAgent, createAgentToolRelation, createApiError, createApiKey, createArtifactComponent, createContextConfig, createConversation, createCredentialReference, createDataComponent, createDatabaseClient, createDefaultCredentialStores, createExecutionContext, createExternalAgent, createFullAgentServerSide, createFullProjectServerSide, createFunctionTool, createKeyChainStore, createMessage, createNangoCredentialStore, createOrGetConversation, createProject, createSubAgent, createSubAgentExternalAgentRelation, createSubAgentRelation, createSubAgentTeamAgentRelation, createTask, createTool, createValidatedDataAccess, dbResultToMcpTool, deleteAgent, deleteAgentArtifactComponentRelationByAgent, deleteAgentDataComponentRelationByAgent, deleteAgentRelationsByAgent, deleteAgentToolRelation, deleteAgentToolRelationByAgent, deleteApiKey, deleteArtifactComponent, deleteContextConfig, deleteConversation, deleteCredentialReference, deleteDataComponent, deleteExternalAgent, deleteFullAgent, deleteFullProject, deleteFunction, deleteFunctionTool, deleteLedgerArtifactsByContext, deleteLedgerArtifactsByTask, deleteMessage, deleteProject, deleteSubAgent, deleteSubAgentExternalAgentRelation, deleteSubAgentExternalAgentRelationsByAgent, deleteSubAgentExternalAgentRelationsBySubAgent, deleteSubAgentRelation, deleteSubAgentTeamAgentRelation, deleteSubAgentTeamAgentRelationsByAgent, deleteSubAgentTeamAgentRelationsBySubAgent, deleteTool, determineContextTrigger, errorResponseSchema, errorSchemaFactory, executionLimitsSharedDefaults, externalAgentExists, externalAgentUrlExists, extractPublicId, fetchComponentRelationships, fetchDefinition, generateAndCreateApiKey, generateApiKey, generateId, generateServiceToken, getActiveAgentForConversation, getAgentById, getAgentRelationById, getAgentRelationByParams, getAgentRelations, getAgentRelationsByAgent, getAgentRelationsBySource, getAgentSubAgentInfos, getAgentToolRelationByAgent, getAgentToolRelationById, getAgentToolRelationByTool, getAgentWithDefaultSubAgent, getAgentsForTool, getAgentsUsingArtifactComponent, getAgentsUsingDataComponent, getApiKeyById, getApiKeyByPublicId, getArtifactComponentById, getArtifactComponentsForAgent, getCacheEntry, getCachedValidator, getContextConfigById, getContextConfigCacheEntries, getConversation, getConversationCacheEntries, getConversationHistory, getConversationId, getCredentialReference, getCredentialReferenceById, getCredentialReferenceWithResources, getCredentialStoreLookupKeyFromRetrievalParams, getDataComponent, getDataComponentsForAgent, getExternalAgent, getExternalAgentByUrl, getExternalAgentsForSubAgent, getFullAgent, getFullAgentDefinition, getFullProject, getFunction, getFunctionToolById, getFunctionToolsForSubAgent, getLedgerArtifacts, getLedgerArtifactsByContext, getMessageById, getMessagesByConversation, getMessagesByTask, getProject, getProjectResourceCounts, getRelatedAgentsForAgent, getRequestExecutionContext, getSubAgentById, getSubAgentExternalAgentRelationById, getSubAgentExternalAgentRelationByParams, getSubAgentExternalAgentRelations, getSubAgentExternalAgentRelationsByAgent, getSubAgentExternalAgentRelationsByExternalAgent, getSubAgentRelationsByTarget, getSubAgentTeamAgentRelationById, getSubAgentTeamAgentRelationByParams, getSubAgentTeamAgentRelations, getSubAgentTeamAgentRelationsByAgent, getSubAgentTeamAgentRelationsByTeamAgent, getSubAgentsByIds, getSubAgentsForExternalAgent, getSubAgentsForTeamAgent, getTask, getTeamAgentsForSubAgent, getToolById, getToolsForAgent, getTracer, getVisibleMessages, handleApiError, handleContextConfigChange, handleContextResolution, hasApiKey, hasContextConfig, hasCredentialReference, hashApiKey, headers, invalidateHeadersCache, invalidateInvocationDefinitionsCache, isApiKeyExpired, isArtifactComponentAssociatedWithAgent, isDataComponentAssociatedWithAgent, isValidHttpRequest, listAgentRelations, listAgentToolRelations, listAgents, listAgentsPaginated, listApiKeys, listApiKeysPaginated, listArtifactComponents, listArtifactComponentsPaginated, listContextConfigs, listContextConfigsPaginated, listConversations, listCredentialReferences, listCredentialReferencesPaginated, listDataComponents, listDataComponentsPaginated, listExternalAgents, listExternalAgentsPaginated, listFunctionTools, listFunctions, listMessages, listProjects, listProjectsPaginated, listSubAgentExternalAgentRelations, listSubAgentTeamAgentRelations, listSubAgents, listSubAgentsPaginated, listTaskIdsByContextId, listTools, loadEnvironmentFiles, maskApiKey, normalizeDateString, problemDetailsSchema, projectExists, projectExistsInTable, projectHasResources, removeArtifactComponentFromAgent, removeDataComponentFromAgent, removeToolFromAgent, setActiveAgentForConversation, setActiveAgentForThread, setCacheEntry, setSpanWithError, updateAgent, updateAgentRelation, updateAgentToolRelation, updateApiKey, updateApiKeyLastUsed, updateArtifactComponent, updateContextConfig, updateConversation, updateConversationActiveAgent, updateCredentialReference, updateDataComponent, updateExternalAgent, updateFullAgentServerSide, updateFullProjectServerSide, updateFunctionTool, updateMessage, updateProject, updateSubAgent, updateSubAgentExternalAgentRelation, updateSubAgentFunctionToolRelation, updateSubAgentTeamAgentRelation, updateTask, updateTool, upsertAgent, upsertAgentArtifactComponentRelation, upsertAgentDataComponentRelation, upsertArtifactComponent, upsertContextConfig, upsertCredentialReference, upsertDataComponent, upsertExternalAgent, upsertFunction, upsertFunctionTool, upsertLedgerArtifact, upsertSubAgent, upsertSubAgentExternalAgentRelation, upsertSubAgentFunctionToolRelation, upsertSubAgentRelation, upsertSubAgentTeamAgentRelation, upsertSubAgentToolRelation, upsertTool, validateAgainstJsonSchema, validateAndGetApiKey, validateApiKey, validateHeaders, validateHttpRequestHeaders, validateProjectExists, validateSubAgent, validateTargetAgent, validateTenantId, validationHelper, verifyAuthorizationHeader, verifyServiceToken, withProjectValidation };
|