@inkeep/agents-core 0.31.7 → 0.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/{chunk-RBUBOGX6.js → chunk-FUJJ4OQ2.js} +62 -10
  2. package/dist/{chunk-T5TTDZ6L.js → chunk-VSQY72K5.js} +133 -133
  3. package/dist/{chunk-PPBBIDK4.js → chunk-X6ZMJ3G6.js} +1 -1
  4. package/dist/client-exports.cjs +283 -224
  5. package/dist/client-exports.d.cts +7 -7
  6. package/dist/client-exports.d.ts +7 -7
  7. package/dist/client-exports.js +15 -7
  8. package/dist/db/schema.cjs +211 -211
  9. package/dist/db/schema.d.cts +3 -3
  10. package/dist/db/schema.d.ts +3 -3
  11. package/dist/db/schema.js +1 -1
  12. package/dist/index.cjs +597 -402
  13. package/dist/index.d.cts +409 -352
  14. package/dist/index.d.ts +409 -352
  15. package/dist/index.js +281 -162
  16. package/dist/{schema-lEFnfOQ-.d.ts → schema-CuEjPQt7.d.ts} +876 -1014
  17. package/dist/{schema-ztSm-Iv6.d.cts → schema-D1P8r3qm.d.cts} +876 -1014
  18. package/dist/types/index.d.cts +3 -3
  19. package/dist/types/index.d.ts +3 -3
  20. package/dist/{utility-qLyZ45lb.d.cts → utility-DF5IUC9K.d.cts} +1230 -1394
  21. package/dist/{utility-qLyZ45lb.d.ts → utility-DF5IUC9K.d.ts} +1230 -1394
  22. package/dist/validation/index.cjs +270 -219
  23. package/dist/validation/index.d.cts +3 -3
  24. package/dist/validation/index.d.ts +3 -3
  25. package/dist/validation/index.js +2 -2
  26. package/drizzle/0000_exotic_mysterio.sql +398 -0
  27. package/drizzle/meta/0000_snapshot.json +1683 -1223
  28. package/drizzle/meta/_journal.json +4 -102
  29. package/package.json +6 -3
  30. package/drizzle/0000_material_menace.sql +0 -326
  31. package/drizzle/0001_eminent_fixer.sql +0 -43
  32. package/drizzle/0002_bumpy_romulus.sql +0 -3
  33. package/drizzle/0003_soft_forgotten_one.sql +0 -39
  34. package/drizzle/0004_melted_omega_flight.sql +0 -3
  35. package/drizzle/0005_wide_shriek.sql +0 -127
  36. package/drizzle/0006_damp_lenny_balinger.sql +0 -52
  37. package/drizzle/0007_mighty_typhoid_mary.sql +0 -227
  38. package/drizzle/0008_mysterious_crusher_hogan.sql +0 -20
  39. package/drizzle/0009_old_black_cat.sql +0 -1
  40. package/drizzle/0010_wet_vampiro.sql +0 -2
  41. package/drizzle/0011_slippery_korg.sql +0 -36
  42. package/drizzle/0012_salty_psynapse.sql +0 -17
  43. package/drizzle/0013_shocking_blur.sql +0 -19
  44. package/drizzle/0014_broad_hellfire_club.sql +0 -29
  45. package/drizzle/meta/0001_snapshot.json +0 -2435
  46. package/drizzle/meta/0002_snapshot.json +0 -2428
  47. package/drizzle/meta/0003_snapshot.json +0 -2559
  48. package/drizzle/meta/0004_snapshot.json +0 -2547
  49. package/drizzle/meta/0005_snapshot.json +0 -2558
  50. package/drizzle/meta/0006_snapshot.json +0 -2751
  51. package/drizzle/meta/0007_snapshot.json +0 -2766
  52. package/drizzle/meta/0008_snapshot.json +0 -2753
  53. package/drizzle/meta/0009_snapshot.json +0 -2744
  54. package/drizzle/meta/0010_snapshot.json +0 -2751
  55. package/drizzle/meta/0011_snapshot.json +0 -2849
  56. package/drizzle/meta/0012_snapshot.json +0 -2985
  57. package/drizzle/meta/0013_snapshot.json +0 -2988
  58. package/drizzle/meta/0014_snapshot.json +0 -2992
package/dist/index.js CHANGED
@@ -4,24 +4,33 @@ 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-PPBBIDK4.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-PPBBIDK4.js';
9
- import { ContextConfigApiUpdateSchema, validatePropsAsJsonSchema } from './chunk-RBUBOGX6.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, validatePropsAsJsonSchema } from './chunk-RBUBOGX6.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-T5TTDZ6L.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-T5TTDZ6L.js';
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
- import { z as z$1 } from 'zod';
16
+ import { z } from 'zod';
17
+ import fs from 'fs';
18
+ import os from 'os';
19
+ import path, { dirname } from 'path';
20
+ import dotenv from 'dotenv';
21
+ import { expand } from 'dotenv-expand';
22
+ import { findUpSync } from 'find-up';
17
23
  import jmespath from 'jmespath';
18
- import { createClient } from '@libsql/client';
19
- import { drizzle } from 'drizzle-orm/libsql';
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';
20
28
  import { and, eq, desc, sql, count, asc, isNotNull, inArray, not } from 'drizzle-orm';
29
+ import { drizzle as drizzle$1 } from 'drizzle-orm/pglite';
21
30
  import { customAlphabet, nanoid } from 'nanoid';
22
31
  import crypto, { scrypt, randomBytes, timingSafeEqual } from 'crypto';
23
32
  import { promisify } from 'util';
24
- import { z } from '@hono/zod-openapi';
33
+ import { z as z$1 } from '@hono/zod-openapi';
25
34
  import { HTTPException } from 'hono/http-exception';
26
35
  import { Client } from '@modelcontextprotocol/sdk/client/index.js';
27
36
  import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
@@ -32,12 +41,6 @@ import { tool } from 'ai';
32
41
  import { asyncExitHook, gracefulExit } from 'exit-hook';
33
42
  import { match } from 'ts-pattern';
34
43
  import { SignJWT, jwtVerify } from 'jose';
35
- import fs from 'fs';
36
- import os from 'os';
37
- import path from 'path';
38
- import dotenv from 'dotenv';
39
- import { expand } from 'dotenv-expand';
40
- import { findUpSync } from 'find-up';
41
44
  import { trace, SpanStatusCode } from '@opentelemetry/api';
42
45
  import Ajv from 'ajv';
43
46
  import { Nango } from '@nangohq/node';
@@ -225,7 +228,7 @@ var require_util = __commonJS({
225
228
  return path2;
226
229
  }
227
230
  exports.normalize = normalize;
228
- function join(aRoot, aPath) {
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 = 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 = join(urlGenerate(parsed), sourceURL);
436
+ sourceURL = join2(urlGenerate(parsed), sourceURL);
434
437
  }
435
438
  return normalize(sourceURL);
436
439
  }
@@ -212876,6 +212879,144 @@ async function apiFetch(url, options = {}) {
212876
212879
  headers: headers2
212877
212880
  });
212878
212881
  }
212882
+ var loadEnvironmentFiles = () => {
212883
+ const environmentFiles = [];
212884
+ const currentEnv = path.resolve(process.cwd(), ".env");
212885
+ if (fs.existsSync(currentEnv)) {
212886
+ environmentFiles.push(currentEnv);
212887
+ }
212888
+ const rootEnv = findUpSync(".env", { cwd: path.dirname(process.cwd()) });
212889
+ if (rootEnv) {
212890
+ if (rootEnv !== currentEnv) {
212891
+ environmentFiles.push(rootEnv);
212892
+ }
212893
+ }
212894
+ const userConfigPath = path.join(os.homedir(), ".inkeep", "config");
212895
+ if (fs.existsSync(userConfigPath)) {
212896
+ dotenv.config({ path: userConfigPath, override: true, quiet: true });
212897
+ }
212898
+ if (environmentFiles.length > 0) {
212899
+ dotenv.config({
212900
+ path: environmentFiles,
212901
+ override: false,
212902
+ quiet: true
212903
+ });
212904
+ expand({ processEnv: process.env });
212905
+ }
212906
+ };
212907
+ loadEnvironmentFiles();
212908
+ var envSchema = z.object({
212909
+ ENVIRONMENT: z.enum(["development", "production", "pentest", "test"]).optional(),
212910
+ DATABASE_URL: z.string().optional(),
212911
+ POSTGRES_POOL_SIZE: z.string().optional(),
212912
+ INKEEP_AGENTS_JWT_SIGNING_SECRET: z.string().min(32, "INKEEP_AGENTS_JWT_SIGNING_SECRET must be at least 32 characters").optional()
212913
+ });
212914
+ var parseEnv = () => {
212915
+ try {
212916
+ const parsedEnv = envSchema.parse(process.env);
212917
+ return parsedEnv;
212918
+ } catch (error) {
212919
+ if (error instanceof z.ZodError) {
212920
+ const missingVars = error.issues.map((issue) => issue.path.join("."));
212921
+ throw new Error(
212922
+ `\u274C Invalid environment variables: ${missingVars.join(", ")}
212923
+ ${error.message}`
212924
+ );
212925
+ }
212926
+ throw error;
212927
+ }
212928
+ };
212929
+ var env = parseEnv();
212930
+
212931
+ // src/constants/execution-limits-shared/defaults.ts
212932
+ var executionLimitsSharedDefaults = {
212933
+ // MCP Tool Connection and Retry Behavior
212934
+ // Model Context Protocol (MCP) enables agents to connect to external tools and services.
212935
+ // These constants control connection timeouts and retry strategy with exponential backoff.
212936
+ // CONNECTION_TIMEOUT_MS: Maximum wait time for initial MCP server connection
212937
+ // MAX_RETRIES: Maximum number of connection retry attempts before failing
212938
+ // INITIAL_RECONNECTION_DELAY_MS: Starting delay between retry attempts
212939
+ // MAX_RECONNECTION_DELAY_MS: Maximum delay between retry attempts (after exponential growth)
212940
+ // RECONNECTION_DELAY_GROWTH_FACTOR: Multiplier applied to delay after each failed retry (exponential backoff)
212941
+ MCP_TOOL_CONNECTION_TIMEOUT_MS: 3e3,
212942
+ // 3 seconds
212943
+ MCP_TOOL_MAX_RETRIES: 3,
212944
+ MCP_TOOL_MAX_RECONNECTION_DELAY_MS: 3e4,
212945
+ // 30 seconds
212946
+ MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS: 1e3,
212947
+ // 1 second
212948
+ MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR: 1.5,
212949
+ // Conversation History Context Window
212950
+ // CONVERSATION_HISTORY_DEFAULT_LIMIT: Default number of recent messages to retrieve from conversation history.
212951
+ // Used when fetching conversation context for status updates and other operations.
212952
+ CONVERSATION_HISTORY_DEFAULT_LIMIT: 50,
212953
+ // CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT: Maximum number of tokens from previous conversation messages
212954
+ // to include in the LLM prompt. Prevents excessive token usage while maintaining relevant conversation context.
212955
+ // Messages exceeding this limit are truncated from the beginning of the conversation.
212956
+ CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT: 4e3
212957
+ };
212958
+
212959
+ // src/constants/execution-limits-shared/index.ts
212960
+ loadEnvironmentFiles();
212961
+ var constantsSchema = z.object(
212962
+ Object.fromEntries(
212963
+ Object.keys(executionLimitsSharedDefaults).map((key) => [
212964
+ `AGENTS_${key}`,
212965
+ z.coerce.number().optional()
212966
+ ])
212967
+ )
212968
+ );
212969
+ var parseConstants = () => {
212970
+ const envOverrides = constantsSchema.parse(process.env);
212971
+ return Object.fromEntries(
212972
+ Object.entries(executionLimitsSharedDefaults).map(([key, defaultValue]) => [
212973
+ key,
212974
+ envOverrides[`AGENTS_${key}`] ?? defaultValue
212975
+ ])
212976
+ );
212977
+ };
212978
+ var constants = parseConstants();
212979
+ var {
212980
+ MCP_TOOL_CONNECTION_TIMEOUT_MS,
212981
+ MCP_TOOL_MAX_RETRIES,
212982
+ MCP_TOOL_MAX_RECONNECTION_DELAY_MS,
212983
+ MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS,
212984
+ MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR,
212985
+ CONVERSATION_HISTORY_DEFAULT_LIMIT,
212986
+ CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT
212987
+ } = constants;
212988
+ loadEnvironmentFiles();
212989
+ var constantsSchema2 = z.object(
212990
+ Object.fromEntries(
212991
+ Object.keys(schemaValidationDefaults).map((key) => [
212992
+ `AGENTS_${key}`,
212993
+ z.coerce.number().optional()
212994
+ ])
212995
+ )
212996
+ );
212997
+ var parseConstants2 = () => {
212998
+ const envOverrides = constantsSchema2.parse(process.env);
212999
+ return Object.fromEntries(
213000
+ Object.entries(schemaValidationDefaults).map(([key, defaultValue]) => [
213001
+ key,
213002
+ envOverrides[`AGENTS_${key}`] ?? defaultValue
213003
+ ])
213004
+ );
213005
+ };
213006
+ var constants2 = parseConstants2();
213007
+ var {
213008
+ AGENT_EXECUTION_TRANSFER_COUNT_MIN,
213009
+ AGENT_EXECUTION_TRANSFER_COUNT_MAX,
213010
+ AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT,
213011
+ SUB_AGENT_TURN_GENERATION_STEPS_MIN,
213012
+ SUB_AGENT_TURN_GENERATION_STEPS_MAX,
213013
+ SUB_AGENT_TURN_GENERATION_STEPS_DEFAULT,
213014
+ STATUS_UPDATE_MAX_NUM_EVENTS,
213015
+ STATUS_UPDATE_MAX_INTERVAL_SECONDS,
213016
+ VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS,
213017
+ VALIDATION_AGENT_PROMPT_MAX_CHARS,
213018
+ CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT
213019
+ } = constants2;
212879
213020
  var logger = getLogger("context-config");
212880
213021
  var HeadersSchemaBuilder = class {
212881
213022
  constructor(options) {
@@ -213028,7 +213169,7 @@ var ContextConfigBuilder = class {
213028
213169
  });
213029
213170
  return { valid: true, errors: [] };
213030
213171
  } catch (error) {
213031
- if (error instanceof z$1.ZodError) {
213172
+ if (error instanceof z.ZodError) {
213032
213173
  return {
213033
213174
  valid: false,
213034
213175
  errors: error.issues.map((e) => `${e.path.join(".")}: ${e.message}`)
@@ -213533,20 +213674,38 @@ var CredentialStuffer = class {
213533
213674
  };
213534
213675
  }
213535
213676
  };
213536
- function createDatabaseClient(config) {
213537
- const client = createClient({
213538
- url: config.url,
213539
- authToken: config.authToken
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);
213540
213703
  });
213541
- return drizzle(client, {
213704
+ return drizzle(pool, {
213542
213705
  schema: schema_exports,
213543
213706
  logger: config.logger
213544
213707
  });
213545
213708
  }
213546
- function createInMemoryDatabaseClient() {
213547
- const db = createDatabaseClient({ url: ":memory:" });
213548
- return db;
213549
- }
213550
213709
  var generateId = customAlphabet("abcdefghijklmnopqrstuvwxyz0123456789", 21);
213551
213710
  function getConversationId() {
213552
213711
  return generateId();
@@ -214458,8 +214617,8 @@ var deleteSubAgentExternalAgentRelation = (db) => async (params) => {
214458
214617
  eq(subAgentExternalAgentRelations.subAgentId, params.scopes.subAgentId),
214459
214618
  eq(subAgentExternalAgentRelations.id, params.relationId)
214460
214619
  )
214461
- );
214462
- return (result.rowsAffected || 0) > 0;
214620
+ ).returning();
214621
+ return result.length > 0;
214463
214622
  };
214464
214623
  var deleteSubAgentExternalAgentRelationsBySubAgent = (db) => async (params) => {
214465
214624
  const result = await db.delete(subAgentExternalAgentRelations).where(
@@ -214469,8 +214628,8 @@ var deleteSubAgentExternalAgentRelationsBySubAgent = (db) => async (params) => {
214469
214628
  eq(subAgentExternalAgentRelations.agentId, params.scopes.agentId),
214470
214629
  eq(subAgentExternalAgentRelations.subAgentId, params.scopes.subAgentId)
214471
214630
  )
214472
- );
214473
- return (result.rowsAffected || 0) > 0;
214631
+ ).returning();
214632
+ return result.length > 0;
214474
214633
  };
214475
214634
  var deleteSubAgentExternalAgentRelationsByAgent = (db) => async (params) => {
214476
214635
  const result = await db.delete(subAgentExternalAgentRelations).where(
@@ -214479,8 +214638,8 @@ var deleteSubAgentExternalAgentRelationsByAgent = (db) => async (params) => {
214479
214638
  eq(subAgentExternalAgentRelations.projectId, params.scopes.projectId),
214480
214639
  eq(subAgentExternalAgentRelations.agentId, params.scopes.agentId)
214481
214640
  )
214482
- );
214483
- return (result.rowsAffected || 0) > 0;
214641
+ ).returning();
214642
+ return result.length > 0;
214484
214643
  };
214485
214644
  var getAgentRelationById = (db) => async (params) => {
214486
214645
  return db.query.subAgentRelations.findFirst({
@@ -214667,8 +214826,8 @@ var deleteSubAgentRelation = (db) => async (params) => {
214667
214826
  eq(subAgentRelations.agentId, params.scopes.agentId),
214668
214827
  eq(subAgentRelations.id, params.relationId)
214669
214828
  )
214670
- );
214671
- return (result.rowsAffected || 0) > 0;
214829
+ ).returning();
214830
+ return result.length > 0;
214672
214831
  };
214673
214832
  var deleteAgentRelationsByAgent = (db) => async (params) => {
214674
214833
  const result = await db.delete(subAgentRelations).where(
@@ -214676,8 +214835,8 @@ var deleteAgentRelationsByAgent = (db) => async (params) => {
214676
214835
  eq(subAgentRelations.tenantId, params.scopes.tenantId),
214677
214836
  eq(subAgentRelations.agentId, params.scopes.agentId)
214678
214837
  )
214679
- );
214680
- return (result.rowsAffected || 0) > 0;
214838
+ ).returning();
214839
+ return result.length > 0;
214681
214840
  };
214682
214841
  var createAgentToolRelation = (db) => async (params) => {
214683
214842
  const finalRelationId = params.relationId ?? generateId();
@@ -214716,8 +214875,8 @@ var deleteAgentToolRelation = (db) => async (params) => {
214716
214875
  eq(subAgentToolRelations.agentId, params.scopes.agentId),
214717
214876
  eq(subAgentToolRelations.id, params.relationId)
214718
214877
  )
214719
- );
214720
- return (result.rowsAffected || 0) > 0;
214878
+ ).returning();
214879
+ return result.length > 0;
214721
214880
  };
214722
214881
  var deleteAgentToolRelationByAgent = (db) => async (params) => {
214723
214882
  const result = await db.delete(subAgentToolRelations).where(
@@ -214727,8 +214886,8 @@ var deleteAgentToolRelationByAgent = (db) => async (params) => {
214727
214886
  eq(subAgentToolRelations.agentId, params.scopes.agentId),
214728
214887
  eq(subAgentToolRelations.subAgentId, params.scopes.subAgentId)
214729
214888
  )
214730
- );
214731
- return (result.rowsAffected || 0) > 0;
214889
+ ).returning();
214890
+ return result.length > 0;
214732
214891
  };
214733
214892
  var getAgentToolRelationById = (db) => async (params) => {
214734
214893
  return await db.query.subAgentToolRelations.findFirst({
@@ -215330,8 +215489,8 @@ var deleteSubAgentTeamAgentRelation = (db) => async (params) => {
215330
215489
  eq(subAgentTeamAgentRelations.subAgentId, params.scopes.subAgentId),
215331
215490
  eq(subAgentTeamAgentRelations.id, params.relationId)
215332
215491
  )
215333
- );
215334
- return (result.rowsAffected || 0) > 0;
215492
+ ).returning();
215493
+ return result.length > 0;
215335
215494
  };
215336
215495
  var deleteSubAgentTeamAgentRelationsBySubAgent = (db) => async (params) => {
215337
215496
  const result = await db.delete(subAgentTeamAgentRelations).where(
@@ -215341,8 +215500,8 @@ var deleteSubAgentTeamAgentRelationsBySubAgent = (db) => async (params) => {
215341
215500
  eq(subAgentTeamAgentRelations.agentId, params.scopes.agentId),
215342
215501
  eq(subAgentTeamAgentRelations.subAgentId, params.scopes.subAgentId)
215343
215502
  )
215344
- );
215345
- return (result.rowsAffected || 0) > 0;
215503
+ ).returning();
215504
+ return result.length > 0;
215346
215505
  };
215347
215506
  var deleteSubAgentTeamAgentRelationsByAgent = (db) => async (params) => {
215348
215507
  const result = await db.delete(subAgentTeamAgentRelations).where(
@@ -215351,8 +215510,8 @@ var deleteSubAgentTeamAgentRelationsByAgent = (db) => async (params) => {
215351
215510
  eq(subAgentTeamAgentRelations.projectId, params.scopes.projectId),
215352
215511
  eq(subAgentTeamAgentRelations.agentId, params.scopes.agentId)
215353
215512
  )
215354
- );
215355
- return (result.rowsAffected || 0) > 0;
215513
+ ).returning();
215514
+ return result.length > 0;
215356
215515
  };
215357
215516
  var scryptAsync = promisify(scrypt);
215358
215517
  var logger4 = getLogger("api-key");
@@ -215427,7 +215586,19 @@ function extractPublicId(key) {
215427
215586
  function maskApiKey(keyPrefix) {
215428
215587
  return `${keyPrefix}...`;
215429
215588
  }
215430
- var ErrorCode = z.enum([
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
+ }
215601
+ var ErrorCode = z$1.enum([
215431
215602
  "bad_request",
215432
215603
  "unauthorized",
215433
215604
  "forbidden",
@@ -215446,28 +215617,28 @@ var errorCodeToHttpStatus = {
215446
215617
  internal_server_error: 500
215447
215618
  };
215448
215619
  var ERROR_DOCS_BASE_URL = "https://docs.inkeep.com/agents-api/errors";
215449
- var problemDetailsSchema = z.object({
215620
+ var problemDetailsSchema = z$1.object({
215450
215621
  // type: z.string().url().openapi({
215451
215622
  // description: "A URI reference that identifies the problem type.",
215452
215623
  // example: `${ERROR_DOCS_BASE_URL}#not-found`,
215453
215624
  // }),
215454
- title: z.string().openapi({
215625
+ title: z$1.string().openapi({
215455
215626
  description: "A short, human-readable summary of the problem type.",
215456
215627
  example: "Resource Not Found"
215457
215628
  }),
215458
- status: z.number().int().openapi({
215629
+ status: z$1.number().int().openapi({
215459
215630
  description: "The HTTP status code.",
215460
215631
  example: 404
215461
215632
  }),
215462
- detail: z.string().openapi({
215633
+ detail: z$1.string().openapi({
215463
215634
  description: "A human-readable explanation specific to this occurrence of the problem.",
215464
215635
  example: "The requested resource was not found."
215465
215636
  }),
215466
- instance: z.string().optional().openapi({
215637
+ instance: z$1.string().optional().openapi({
215467
215638
  description: "A URI reference that identifies the specific occurrence of the problem.",
215468
215639
  example: "/conversations/123"
215469
215640
  }),
215470
- requestId: z.string().optional().openapi({
215641
+ requestId: z$1.string().optional().openapi({
215471
215642
  description: "A unique identifier for the request, useful for troubleshooting.",
215472
215643
  example: "req_1234567890"
215473
215644
  }),
@@ -215476,13 +215647,13 @@ var problemDetailsSchema = z.object({
215476
215647
  example: "not_found"
215477
215648
  })
215478
215649
  }).openapi("ProblemDetails");
215479
- var errorResponseSchema = z.object({
215480
- error: z.object({
215650
+ var errorResponseSchema = z$1.object({
215651
+ error: z$1.object({
215481
215652
  code: ErrorCode.openapi({
215482
215653
  description: "A short code indicating the error code returned.",
215483
215654
  example: "not_found"
215484
215655
  }),
215485
- message: z.string().openapi({
215656
+ message: z$1.string().openapi({
215486
215657
  description: "A human readable error message.",
215487
215658
  example: "The requested resource was not found."
215488
215659
  })
@@ -215620,15 +215791,15 @@ var errorSchemaFactory = (code, description) => ({
215620
215791
  content: {
215621
215792
  "application/problem+json": {
215622
215793
  schema: problemDetailsSchema.extend({
215623
- code: z.literal(code).openapi({
215794
+ code: z$1.literal(code).openapi({
215624
215795
  description: "A short code indicating the error code returned.",
215625
215796
  example: code
215626
215797
  }),
215627
- detail: z.string().openapi({
215798
+ detail: z$1.string().openapi({
215628
215799
  description: "A detailed explanation specific to this occurrence of the problem, providing context and specifics about what went wrong.",
215629
215800
  example: description
215630
215801
  }),
215631
- title: z.string().openapi({
215802
+ title: z$1.string().openapi({
215632
215803
  description: "A short, human-readable summary of the problem type.",
215633
215804
  example: getTitleFromCode(code)
215634
215805
  }),
@@ -215636,16 +215807,16 @@ var errorSchemaFactory = (code, description) => ({
215636
215807
  // description: "A URI reference that identifies the problem type.",
215637
215808
  // example: `${ERROR_DOCS_BASE_URL}#${code}`,
215638
215809
  // }),
215639
- status: z.literal(errorCodeToHttpStatus[code]).openapi({
215810
+ status: z$1.literal(errorCodeToHttpStatus[code]).openapi({
215640
215811
  description: "The HTTP status code.",
215641
215812
  example: errorCodeToHttpStatus[code]
215642
215813
  }),
215643
- error: z.object({
215644
- code: z.literal(code).openapi({
215814
+ error: z$1.object({
215815
+ code: z$1.literal(code).openapi({
215645
215816
  description: "A short code indicating the error code returned.",
215646
215817
  example: code
215647
215818
  }),
215648
- message: z.string().openapi({
215819
+ message: z$1.string().openapi({
215649
215820
  description: "A concise error message suitable for display to end users. May be truncated if the full detail is long.",
215650
215821
  example: description.length > 100 ? `${description.substring(0, 97)}...` : description
215651
215822
  })
@@ -215764,15 +215935,15 @@ var McpClient = class {
215764
215935
  this.transport = new StreamableHTTPClientTransport(new URL(urlString), {
215765
215936
  requestInit: mergedRequestInit,
215766
215937
  reconnectionOptions: {
215767
- maxRetries: 3,
215768
- maxReconnectionDelay: 3e4,
215769
- initialReconnectionDelay: 1e3,
215770
- reconnectionDelayGrowFactor: 1.5,
215938
+ maxRetries: MCP_TOOL_MAX_RETRIES,
215939
+ maxReconnectionDelay: MCP_TOOL_MAX_RECONNECTION_DELAY_MS,
215940
+ initialReconnectionDelay: MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS,
215941
+ reconnectionDelayGrowFactor: MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR,
215771
215942
  ...config.reconnectionOptions
215772
215943
  },
215773
215944
  sessionId: config.sessionId
215774
215945
  });
215775
- await this.client.connect(this.transport, { timeout: 3e3 });
215946
+ await this.client.connect(this.transport, { timeout: MCP_TOOL_CONNECTION_TIMEOUT_MS });
215776
215947
  }
215777
215948
  async disconnect() {
215778
215949
  if (!this.transport) {
@@ -215823,7 +215994,7 @@ var McpClient = class {
215823
215994
  try {
215824
215995
  const createZodSchema = (inputSchema) => {
215825
215996
  if (!inputSchema || !inputSchema.properties) {
215826
- return z$1.object({});
215997
+ return z.object({});
215827
215998
  }
215828
215999
  const zodProperties = {};
215829
216000
  for (const [key, prop] of Object.entries(inputSchema.properties)) {
@@ -215831,19 +216002,19 @@ var McpClient = class {
215831
216002
  let zodType;
215832
216003
  switch (propDef.type) {
215833
216004
  case "string":
215834
- zodType = z$1.string();
216005
+ zodType = z.string();
215835
216006
  break;
215836
216007
  case "number":
215837
- zodType = z$1.number();
216008
+ zodType = z.number();
215838
216009
  break;
215839
216010
  case "boolean":
215840
- zodType = z$1.boolean();
216011
+ zodType = z.boolean();
215841
216012
  break;
215842
216013
  case "array":
215843
- zodType = z$1.array(z$1.any());
216014
+ zodType = z.array(z.any());
215844
216015
  break;
215845
216016
  default:
215846
- zodType = z$1.any();
216017
+ zodType = z.any();
215847
216018
  }
215848
216019
  if (propDef.description) {
215849
216020
  zodType = zodType.describe(propDef.description);
@@ -215854,7 +216025,7 @@ var McpClient = class {
215854
216025
  }
215855
216026
  zodProperties[key] = zodType;
215856
216027
  }
215857
- return z$1.object(zodProperties);
216028
+ return z.object(zodProperties);
215858
216029
  };
215859
216030
  const schema = createZodSchema(def.inputSchema);
215860
216031
  const createdTool = tool({
@@ -215880,57 +216051,6 @@ var McpClient = class {
215880
216051
  return results;
215881
216052
  }
215882
216053
  };
215883
- var loadEnvironmentFiles = () => {
215884
- const environmentFiles = [];
215885
- const currentEnv = path.resolve(process.cwd(), ".env");
215886
- if (fs.existsSync(currentEnv)) {
215887
- environmentFiles.push(currentEnv);
215888
- }
215889
- const rootEnv = findUpSync(".env", { cwd: path.dirname(process.cwd()) });
215890
- if (rootEnv) {
215891
- if (rootEnv !== currentEnv) {
215892
- environmentFiles.push(rootEnv);
215893
- }
215894
- }
215895
- const userConfigPath = path.join(os.homedir(), ".inkeep", "config");
215896
- if (fs.existsSync(userConfigPath)) {
215897
- dotenv.config({ path: userConfigPath, override: true, quiet: true });
215898
- }
215899
- if (environmentFiles.length > 0) {
215900
- dotenv.config({
215901
- path: environmentFiles,
215902
- override: false,
215903
- quiet: true
215904
- });
215905
- expand({ processEnv: process.env });
215906
- }
215907
- };
215908
- loadEnvironmentFiles();
215909
- var envSchema = z$1.object({
215910
- ENVIRONMENT: z$1.enum(["development", "production", "pentest", "test"]).optional(),
215911
- DB_FILE_NAME: z$1.string().optional(),
215912
- TURSO_DATABASE_URL: z$1.string().optional(),
215913
- TURSO_AUTH_TOKEN: z$1.string().optional(),
215914
- INKEEP_AGENTS_JWT_SIGNING_SECRET: z$1.string().min(32, "INKEEP_AGENTS_JWT_SIGNING_SECRET must be at least 32 characters").optional()
215915
- });
215916
- var parseEnv = () => {
215917
- try {
215918
- const parsedEnv = envSchema.parse(process.env);
215919
- return parsedEnv;
215920
- } catch (error) {
215921
- if (error instanceof z$1.ZodError) {
215922
- const missingVars = error.issues.map((issue) => issue.path.join("."));
215923
- throw new Error(
215924
- `\u274C Invalid environment variables: ${missingVars.join(", ")}
215925
- ${error.message}`
215926
- );
215927
- }
215928
- throw error;
215929
- }
215930
- };
215931
- var env = parseEnv();
215932
-
215933
- // src/utils/service-token-auth.ts
215934
216054
  var logger5 = getLogger("service-token-auth");
215935
216055
  function getJwtSecret() {
215936
216056
  const secret = env.INKEEP_AGENTS_JWT_SIGNING_SECRET;
@@ -216399,8 +216519,8 @@ var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry) => {
216399
216519
  availableTools: [],
216400
216520
  capabilities: capabilities || void 0,
216401
216521
  credentialReferenceId: credentialReferenceId || void 0,
216402
- createdAt: new Date(createdAt),
216403
- updatedAt: new Date(dbResult.updatedAt),
216522
+ createdAt: new Date(normalizeDateString(createdAt)),
216523
+ updatedAt: new Date(normalizeDateString(dbResult.updatedAt)),
216404
216524
  lastError: null,
216405
216525
  headers: headers2 || void 0,
216406
216526
  imageUrl: imageUrl || void 0
@@ -216433,7 +216553,7 @@ var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry) => {
216433
216553
  } else if (credentialStore.type === CredentialStoreType.keychain) {
216434
216554
  const oauthTokens = JSON.parse(credentialDataString);
216435
216555
  if (oauthTokens.expires_at) {
216436
- expiresAt = new Date(oauthTokens.expires_at);
216556
+ expiresAt = new Date(normalizeDateString(oauthTokens.expires_at));
216437
216557
  }
216438
216558
  }
216439
216559
  }
@@ -216470,7 +216590,7 @@ var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry) => {
216470
216590
  availableTools,
216471
216591
  capabilities: capabilities || void 0,
216472
216592
  credentialReferenceId: credentialReferenceId || void 0,
216473
- createdAt: new Date(createdAt),
216593
+ createdAt: new Date(normalizeDateString(createdAt)),
216474
216594
  updatedAt: new Date(now),
216475
216595
  expiresAt,
216476
216596
  lastError: lastErrorComputed,
@@ -217032,8 +217152,8 @@ var getFullAgentDefinition = (db) => async ({
217032
217152
  description: agent.description,
217033
217153
  defaultSubAgentId: agent.defaultSubAgentId,
217034
217154
  subAgents: agentsObject,
217035
- createdAt: agent.createdAt && !Number.isNaN(new Date(agent.createdAt).getTime()) ? new Date(agent.createdAt).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
217036
- updatedAt: agent.updatedAt && !Number.isNaN(new Date(agent.updatedAt).getTime()) ? new Date(agent.updatedAt).toISOString() : (/* @__PURE__ */ new Date()).toISOString()
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()
217037
217157
  };
217038
217158
  if (Object.keys(externalAgentsObject).length > 0) {
217039
217159
  result.externalAgents = externalAgentsObject;
@@ -217338,8 +217458,8 @@ var deleteAgentArtifactComponentRelationByAgent = (db) => async (params) => {
217338
217458
  eq(subAgentArtifactComponents.agentId, params.scopes.agentId),
217339
217459
  eq(subAgentArtifactComponents.subAgentId, params.scopes.subAgentId)
217340
217460
  )
217341
- );
217342
- return (result.rowsAffected || 0) > 0;
217461
+ ).returning();
217462
+ return result.length > 0;
217343
217463
  };
217344
217464
  var getAgentsUsingArtifactComponent = (db) => async (params) => {
217345
217465
  return await db.select({
@@ -217604,8 +217724,8 @@ var deleteAgentDataComponentRelationByAgent = (db) => async (params) => {
217604
217724
  eq(subAgentDataComponents.agentId, params.scopes.agentId),
217605
217725
  eq(subAgentDataComponents.subAgentId, params.scopes.subAgentId)
217606
217726
  )
217607
- );
217608
- return (result.rowsAffected || 0) > 0;
217727
+ ).returning();
217728
+ return result.length > 0;
217609
217729
  };
217610
217730
  var getAgentsUsingDataComponent = (db) => async (params) => {
217611
217731
  return await db.select({
@@ -218689,8 +218809,8 @@ var updateFullAgentServerSide = (db, logger14 = defaultLogger) => async (scopes,
218689
218809
  eq(subAgentToolRelations.agentId, finalAgentId),
218690
218810
  eq(subAgentToolRelations.subAgentId, subAgentId)
218691
218811
  )
218692
- );
218693
- deletedCount = result.rowsAffected || 0;
218812
+ ).returning();
218813
+ deletedCount = result.length;
218694
218814
  } else {
218695
218815
  const result = await db.delete(subAgentToolRelations).where(
218696
218816
  and(
@@ -218700,8 +218820,8 @@ var updateFullAgentServerSide = (db, logger14 = defaultLogger) => async (scopes,
218700
218820
  eq(subAgentToolRelations.subAgentId, subAgentId),
218701
218821
  not(inArray(subAgentToolRelations.id, Array.from(incomingRelationshipIds)))
218702
218822
  )
218703
- );
218704
- deletedCount = result.rowsAffected || 0;
218823
+ ).returning();
218824
+ deletedCount = result.length;
218705
218825
  }
218706
218826
  if (deletedCount > 0) {
218707
218827
  logger14.info({ subAgentId, deletedCount }, "Deleted orphaned agent-tool relations");
@@ -219159,6 +219279,7 @@ var deleteApiKey = (db) => async (params) => {
219159
219279
  id: params.id
219160
219280
  });
219161
219281
  if (!existingKey) {
219282
+ console.error("API key not found", { params });
219162
219283
  return false;
219163
219284
  }
219164
219285
  await db.delete(apiKeys).where(
@@ -219289,8 +219410,8 @@ var clearConversationCache = (db) => async (params) => {
219289
219410
  eq(contextCache.projectId, params.scopes.projectId),
219290
219411
  eq(contextCache.conversationId, params.conversationId)
219291
219412
  )
219292
- );
219293
- return result.rowsAffected || 0;
219413
+ ).returning();
219414
+ return result.length;
219294
219415
  };
219295
219416
  var clearContextConfigCache = (db) => async (params) => {
219296
219417
  const result = await db.delete(contextCache).where(
@@ -219299,8 +219420,8 @@ var clearContextConfigCache = (db) => async (params) => {
219299
219420
  eq(contextCache.projectId, params.scopes.projectId),
219300
219421
  eq(contextCache.contextConfigId, params.contextConfigId)
219301
219422
  )
219302
- );
219303
- return result.rowsAffected || 0;
219423
+ ).returning();
219424
+ return result.length;
219304
219425
  };
219305
219426
  var cleanupTenantCache = (db) => async (params) => {
219306
219427
  const result = await db.delete(contextCache).where(
@@ -219308,8 +219429,8 @@ var cleanupTenantCache = (db) => async (params) => {
219308
219429
  eq(contextCache.tenantId, params.scopes.tenantId),
219309
219430
  eq(contextCache.projectId, params.scopes.projectId)
219310
219431
  )
219311
- );
219312
- return result.rowsAffected || 0;
219432
+ ).returning();
219433
+ return result.length;
219313
219434
  };
219314
219435
  var invalidateHeadersCache = (db) => async (params) => {
219315
219436
  const result = await db.delete(contextCache).where(
@@ -219320,8 +219441,8 @@ var invalidateHeadersCache = (db) => async (params) => {
219320
219441
  eq(contextCache.contextConfigId, params.contextConfigId),
219321
219442
  eq(contextCache.contextVariableKey, "headers")
219322
219443
  )
219323
- );
219324
- return result.rowsAffected || 0;
219444
+ ).returning();
219445
+ return result.length;
219325
219446
  };
219326
219447
  var invalidateInvocationDefinitionsCache = (db) => async (params) => {
219327
219448
  let totalRowsAffected = 0;
@@ -219334,8 +219455,8 @@ var invalidateInvocationDefinitionsCache = (db) => async (params) => {
219334
219455
  eq(contextCache.contextConfigId, params.contextConfigId),
219335
219456
  eq(contextCache.contextVariableKey, definitionId)
219336
219457
  )
219337
- );
219338
- totalRowsAffected += result.rowsAffected || 0;
219458
+ ).returning();
219459
+ totalRowsAffected += result.length;
219339
219460
  }
219340
219461
  return totalRowsAffected;
219341
219462
  };
@@ -219754,7 +219875,7 @@ var addLedgerArtifacts = (db) => async (params) => {
219754
219875
  return;
219755
219876
  } catch (error) {
219756
219877
  lastError = error;
219757
- const isRetryable = error.code === "SQLITE_BUSY" || error.code === "SQLITE_LOCKED" || error.message?.includes("database is locked") || error.message?.includes("busy") || error.message?.includes("timeout");
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");
219758
219879
  if (!isRetryable || attempt === maxRetries) {
219759
219880
  await tryFallbackInsert(db, rows);
219760
219881
  return;
@@ -220172,9 +220293,7 @@ var createFullProjectServerSide = (db, logger14 = defaultLogger2) => async (scop
220172
220293
  description: typed.description || "",
220173
220294
  models: typed.models,
220174
220295
  stopWhen: typed.stopWhen,
220175
- tenantId,
220176
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
220177
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
220296
+ tenantId
220178
220297
  };
220179
220298
  logger14.info({ projectId: typed.id }, "Creating project metadata");
220180
220299
  await createProject(db)(projectPayload);
@@ -223053,10 +223172,10 @@ var InMemoryCredentialStore = class {
223053
223172
  }
223054
223173
  };
223055
223174
  var logger13 = getLogger("nango-credential-store");
223056
- var CredentialKeySchema = z$1.object({
223057
- connectionId: z$1.string().min(1, "connectionId must be a non-empty string"),
223058
- providerConfigKey: z$1.string().min(1, "providerConfigKey must be a non-empty string"),
223059
- integrationDisplayName: z$1.string().nullish()
223175
+ var CredentialKeySchema = z.object({
223176
+ connectionId: z.string().min(1, "connectionId must be a non-empty string"),
223177
+ providerConfigKey: z.string().min(1, "providerConfigKey must be a non-empty string"),
223178
+ integrationDisplayName: z.string().nullish()
223060
223179
  });
223061
223180
  function parseCredentialKey(key) {
223062
223181
  try {
@@ -223482,4 +223601,4 @@ typescript/lib/typescript.js:
223482
223601
  ***************************************************************************** *)
223483
223602
  */
223484
223603
 
223485
- export { ContextCache, ContextConfigBuilder, ContextFetcher, ContextResolver, CredentialStoreRegistry, CredentialStuffer, ERROR_DOCS_BASE_URL, ErrorCode, HTTP_REQUEST_PARTS, InMemoryCredentialStore, KeyChainStore, McpClient, NangoCredentialStore, TemplateEngine, 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, createInMemoryDatabaseClient, 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, 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, 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 };
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 };