@inkeep/agents-core 0.0.0-dev-20250911210702 → 0.0.0-dev-20250911221549

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.
@@ -0,0 +1,40 @@
1
+ <!--
2
+ AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
3
+ Source: ./SUPPLEMENTAL_TERMS.md
4
+ This file is automatically copied from the root SUPPLEMENTAL_TERMS.md during build.
5
+ Any changes should be made to the root SUPPLEMENTAL_TERMS.md file.
6
+ -->
7
+
8
+ # Inkeep SDK – Elastic License 2.0 with Supplemental Terms
9
+
10
+ The Inkeep [SDK] (the "Software") is licensed under the Elastic License 2.0 ("ELv2"), available at [https://www.elastic.co/licensing/elastic-license](https://www.elastic.co/licensing/elastic-license), subject to the supplemental terms below. By using the Software, you, your company, and your licensees agree to both ELv2 and these Supplemental Terms – for purposes of these Supplemental Terms, references to "you" have the same meaning as in ELv2 and include your company and contractors acting on your behalf. In the event of conflict, these Supplemental Terms control.
11
+
12
+ Any copy or redistribution of the Software must include both the ELv2 license reference and these Supplemental Terms.
13
+
14
+ ## 1. Restrictions
15
+
16
+ ### 1.1
17
+ You may not use the Software, directly or indirectly, to offer, enable, operate, or provide any Agent Builder.
18
+
19
+ ### 1.2
20
+ You may not repackage, rebrand, or otherwise expose the Software's agent-creation or orchestration functionality for third-party use, including in specialized or verticalized offerings that present substantially similar functionality to the Software.
21
+
22
+ ### 1.3
23
+ For clarity, the foregoing restrictions do not prohibit your use of the Software as Embedded Assistants or Professional Services, provided neither allow third parties to create, configure, train, orchestrate, deploy, or manage their own agents or agent workflows.
24
+
25
+ ## 2. Definitions
26
+
27
+ ### 2.1 Inkeep
28
+ **"Inkeep"** means Inkeep, Inc., a Delaware corporation with principal offices at 169 Madison Ave, Ste 2544, New York, NY, 10016, the licensor (as defined in ELv2) of the Software.
29
+
30
+ ### 2.2 Agent Builder
31
+ **"Agent Builder"** means any hosted or on-premise product, platform, UI or API that allows third parties (e.g., customers, developers, or community users other than your personnel) to create, configure, compose, train, orchestrate, deploy, or manage their own Agents using the Software, or that otherwise exposes a substantial set of the Agent-creation and orchestration functionality of the Software.
32
+
33
+ ### 2.3 Agents
34
+ **"Agents"** means autonomous, semi-autonomous, or automated systems — including assistants, copilots, workflows, orchestrations, or other systems powered by or incorporating artificial intelligence, machine learning, large language models, or related technologies.
35
+
36
+ ### 2.4 Embedded Assistant
37
+ **"Embedded Assistant"** means embedding the Software in your own products or services to power a specific assistant/copilot/agent experience for you or your end users (e.g., a support bot in your app or an internal helpdesk agent), where end users do not receive access to any substantial set of the Software's agent-creation or orchestration features.
38
+
39
+ ### 2.5 Professional Services
40
+ **"Professional Services"** means using the Software to deliver a bespoke solution to a single client where only your personnel operate the Software, the client receives access solely to the resulting assistant within the client's environment and not to the agent-creation/orchestration features of the Software, and no multi-tenant or self-service builder is provided.
package/dist/index.cjs CHANGED
@@ -84,7 +84,11 @@ var LoggerFactory = class {
84
84
  */
85
85
  getLogger(name) {
86
86
  if (this.loggers.has(name)) {
87
- return this.loggers.get(name);
87
+ const logger12 = this.loggers.get(name);
88
+ if (!logger12) {
89
+ throw new Error(`Logger '${name}' not found in cache`);
90
+ }
91
+ return logger12;
88
92
  }
89
93
  let logger11;
90
94
  if (this.config.loggerFactory) {
@@ -2762,6 +2766,9 @@ var upsertAgent = (db) => async (params) => {
2762
2766
  stopWhen: params.data.stopWhen
2763
2767
  }
2764
2768
  });
2769
+ if (!updated) {
2770
+ throw new Error("Failed to update agent - no rows affected");
2771
+ }
2765
2772
  return updated;
2766
2773
  } else {
2767
2774
  return await createAgent(db)(params.data);
@@ -3048,6 +3055,9 @@ var upsertExternalAgent = (db) => async (params) => {
3048
3055
  headers: params.data.headers
3049
3056
  }
3050
3057
  });
3058
+ if (!updated) {
3059
+ throw new Error("Failed to update external agent - no rows affected");
3060
+ }
3051
3061
  return updated;
3052
3062
  } else {
3053
3063
  return await createExternalAgent(db)(params.data);
@@ -4542,6 +4552,9 @@ var upsertCredentialReference = (db) => async (params) => {
4542
4552
  retrievalParams: params.data.retrievalParams
4543
4553
  }
4544
4554
  });
4555
+ if (!updated) {
4556
+ throw new Error("Failed to update credential reference - no rows affected");
4557
+ }
4545
4558
  return updated;
4546
4559
  } else {
4547
4560
  return await createCredentialReference(db)(params.data);
@@ -7181,7 +7194,7 @@ function getTracer(serviceName, serviceVersion) {
7181
7194
 
7182
7195
  // package.json
7183
7196
  var package_default = {
7184
- version: "0.0.0-dev-20250911210702"};
7197
+ version: "0.0.0-dev-20250911221549"};
7185
7198
 
7186
7199
  // src/utils/tracer.ts
7187
7200
  var tracer = getTracer("agents-core", package_default.version);
@@ -7865,7 +7878,15 @@ async function fetchExistingRequestContext({
7865
7878
  "No request context found in cache. Please provide requestContext in request body."
7866
7879
  );
7867
7880
  }
7868
- async function validateRequestContext(tenantId, projectId, graphId, conversationId, parsedRequest, dbClient, credentialStores, legacyRequestContext) {
7881
+ async function validateRequestContext({
7882
+ tenantId,
7883
+ projectId,
7884
+ graphId,
7885
+ conversationId,
7886
+ parsedRequest,
7887
+ dbClient,
7888
+ credentialStores
7889
+ }) {
7869
7890
  try {
7870
7891
  const agentGraph2 = await getAgentGraphWithDefaultAgent(dbClient)({
7871
7892
  scopes: { tenantId, projectId },
@@ -7908,10 +7929,7 @@ async function validateRequestContext(tenantId, projectId, graphId, conversation
7908
7929
  }
7909
7930
  try {
7910
7931
  const schema = contextConfig2.requestContextSchema;
7911
- logger7.debug(
7912
- { contextConfigId: contextConfig2.id },
7913
- "Using headers schema validation"
7914
- );
7932
+ logger7.debug({ contextConfigId: contextConfig2.id }, "Using headers schema validation");
7915
7933
  const httpRequest = parsedRequest;
7916
7934
  const validationResult = await validateHttpRequestHeaders(schema, httpRequest);
7917
7935
  if (validationResult.valid) {
@@ -7994,14 +8012,15 @@ function contextValidationMiddleware(dbClient) {
7994
8012
  const parsedRequest = {
7995
8013
  headers
7996
8014
  };
7997
- const validationResult = await validateRequestContext(
8015
+ const validationResult = await validateRequestContext({
7998
8016
  tenantId,
7999
8017
  projectId,
8000
8018
  graphId,
8001
8019
  conversationId,
8002
8020
  parsedRequest,
8003
8021
  dbClient,
8004
- credentialStores);
8022
+ credentialStores
8023
+ });
8005
8024
  if (!validationResult.valid) {
8006
8025
  logger7.warn(
8007
8026
  {
@@ -8068,13 +8087,11 @@ var ContextFetcher = class {
8068
8087
  __publicField(this, "tenantId");
8069
8088
  __publicField(this, "projectId");
8070
8089
  __publicField(this, "defaultTimeout");
8071
- __publicField(this, "credentialStoreRegistry");
8072
8090
  __publicField(this, "credentialStuffer");
8073
8091
  __publicField(this, "dbClient");
8074
8092
  this.tenantId = tenantId;
8075
8093
  this.projectId = projectId;
8076
8094
  this.defaultTimeout = defaultTimeout;
8077
- this.credentialStoreRegistry = credentialStoreRegistry;
8078
8095
  if (credentialStoreRegistry) {
8079
8096
  this.credentialStuffer = new CredentialStuffer(credentialStoreRegistry);
8080
8097
  }
package/dist/index.d.cts CHANGED
@@ -169,7 +169,6 @@ declare class ContextFetcher {
169
169
  private tenantId;
170
170
  private projectId;
171
171
  private defaultTimeout;
172
- private credentialStoreRegistry?;
173
172
  private credentialStuffer?;
174
173
  private dbClient;
175
174
  constructor(tenantId: string, projectId: string, dbClient: DatabaseClient, credentialStoreRegistry?: CredentialStoreRegistry, defaultTimeout?: number);
@@ -3336,7 +3335,15 @@ declare function validateHttpRequestHeaders(headersSchema: any, httpRequest: Par
3336
3335
  * Validates request context against the JSON Schema stored in context configuration
3337
3336
  * Supports both legacy simple schemas and new comprehensive HTTP request schemas
3338
3337
  */
3339
- declare function validateRequestContext(tenantId: string, projectId: string, graphId: string, conversationId: string, parsedRequest: ParsedHttpRequest, dbClient: DatabaseClient, credentialStores?: CredentialStoreRegistry, legacyRequestContext?: Record<string, unknown>): Promise<ContextValidationResult>;
3338
+ declare function validateRequestContext({ tenantId, projectId, graphId, conversationId, parsedRequest, dbClient, credentialStores, }: {
3339
+ tenantId: string;
3340
+ projectId: string;
3341
+ graphId: string;
3342
+ conversationId: string;
3343
+ parsedRequest: ParsedHttpRequest;
3344
+ dbClient: DatabaseClient;
3345
+ credentialStores?: CredentialStoreRegistry;
3346
+ }): Promise<ContextValidationResult>;
3340
3347
  /**
3341
3348
  * Hono middleware for context validation
3342
3349
  */
package/dist/index.d.ts CHANGED
@@ -169,7 +169,6 @@ declare class ContextFetcher {
169
169
  private tenantId;
170
170
  private projectId;
171
171
  private defaultTimeout;
172
- private credentialStoreRegistry?;
173
172
  private credentialStuffer?;
174
173
  private dbClient;
175
174
  constructor(tenantId: string, projectId: string, dbClient: DatabaseClient, credentialStoreRegistry?: CredentialStoreRegistry, defaultTimeout?: number);
@@ -3336,7 +3335,15 @@ declare function validateHttpRequestHeaders(headersSchema: any, httpRequest: Par
3336
3335
  * Validates request context against the JSON Schema stored in context configuration
3337
3336
  * Supports both legacy simple schemas and new comprehensive HTTP request schemas
3338
3337
  */
3339
- declare function validateRequestContext(tenantId: string, projectId: string, graphId: string, conversationId: string, parsedRequest: ParsedHttpRequest, dbClient: DatabaseClient, credentialStores?: CredentialStoreRegistry, legacyRequestContext?: Record<string, unknown>): Promise<ContextValidationResult>;
3338
+ declare function validateRequestContext({ tenantId, projectId, graphId, conversationId, parsedRequest, dbClient, credentialStores, }: {
3339
+ tenantId: string;
3340
+ projectId: string;
3341
+ graphId: string;
3342
+ conversationId: string;
3343
+ parsedRequest: ParsedHttpRequest;
3344
+ dbClient: DatabaseClient;
3345
+ credentialStores?: CredentialStoreRegistry;
3346
+ }): Promise<ContextValidationResult>;
3340
3347
  /**
3341
3348
  * Hono middleware for context validation
3342
3349
  */
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  export { TaskState } from './chunk-H2F72PDA.js';
2
- import { ContextConfigApiUpdateSchema, validateAndTypeGraphData, validateGraphStructure, isInternalAgent, isExternalAgent } from './chunk-PXIJWVD4.js';
3
- export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentArtifactComponentApiInsertSchema, AgentArtifactComponentApiSelectSchema, AgentArtifactComponentApiUpdateSchema, AgentArtifactComponentInsertSchema, AgentArtifactComponentSelectSchema, AgentArtifactComponentUpdateSchema, AgentDataComponentApiInsertSchema, AgentDataComponentApiSelectSchema, AgentDataComponentApiUpdateSchema, AgentDataComponentInsertSchema, AgentDataComponentSelectSchema, AgentDataComponentUpdateSchema, AgentGraphApiInsertSchema, AgentGraphApiSelectSchema, AgentGraphApiUpdateSchema, AgentGraphInsertSchema, AgentGraphSelectSchema, AgentGraphUpdateSchema, AgentInsertSchema, AgentRelationApiInsertSchema, AgentRelationApiSelectSchema, AgentRelationApiUpdateSchema, AgentRelationInsertSchema, AgentRelationQuerySchema, AgentRelationSelectSchema, AgentRelationUpdateSchema, AgentSelectSchema, AgentToolRelationApiInsertSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiUpdateSchema, AgentToolRelationInsertSchema, AgentToolRelationSelectSchema, AgentToolRelationUpdateSchema, AgentUpdateSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentRelationApiInsertSchema, ExternalAgentRelationInsertSchema, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, HeadersScopeSchema, IdParamsSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectModelSchema, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, resourceIdSchema, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './chunk-PXIJWVD4.js';
4
- import { schema_exports, agentRelations, agents, externalAgents, agentToolRelations, tools, contextConfigs, agentGraph, agentDataComponents, agentArtifactComponents, dataComponents, artifactComponents, projects, apiKeys, contextCache, conversations, messages, credentialReferences, ledgerArtifacts, tasks, taskRelations } from './chunk-M4JXMAG7.js';
5
- export { agentArtifactComponents, agentArtifactComponentsRelations, agentDataComponents, agentGraph, agentGraphRelations, agentRelations, agentRelationsRelations, agentToolRelations, agentToolRelationsRelations, agents, agentsRelations, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, externalAgents, externalAgentsRelations, ledgerArtifacts, ledgerArtifactsContextIdIdx, ledgerArtifactsTaskContextNameUnique, ledgerArtifactsTaskIdIdx, messages, messagesRelations, projects, projectsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-M4JXMAG7.js';
2
+ import { ContextConfigApiUpdateSchema, validateAndTypeGraphData, validateGraphStructure, isInternalAgent, isExternalAgent } from './chunk-G6FJN6G5.js';
3
+ export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentArtifactComponentApiInsertSchema, AgentArtifactComponentApiSelectSchema, AgentArtifactComponentApiUpdateSchema, AgentArtifactComponentInsertSchema, AgentArtifactComponentSelectSchema, AgentArtifactComponentUpdateSchema, AgentDataComponentApiInsertSchema, AgentDataComponentApiSelectSchema, AgentDataComponentApiUpdateSchema, AgentDataComponentInsertSchema, AgentDataComponentSelectSchema, AgentDataComponentUpdateSchema, AgentGraphApiInsertSchema, AgentGraphApiSelectSchema, AgentGraphApiUpdateSchema, AgentGraphInsertSchema, AgentGraphSelectSchema, AgentGraphUpdateSchema, AgentInsertSchema, AgentRelationApiInsertSchema, AgentRelationApiSelectSchema, AgentRelationApiUpdateSchema, AgentRelationInsertSchema, AgentRelationQuerySchema, AgentRelationSelectSchema, AgentRelationUpdateSchema, AgentSelectSchema, AgentToolRelationApiInsertSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiUpdateSchema, AgentToolRelationInsertSchema, AgentToolRelationSelectSchema, AgentToolRelationUpdateSchema, AgentUpdateSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentRelationApiInsertSchema, ExternalAgentRelationInsertSchema, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, HeadersScopeSchema, IdParamsSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectModelSchema, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, resourceIdSchema, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from './chunk-G6FJN6G5.js';
6
4
  import { CredentialStoreType, MCPServerType, MCPTransportType } from './chunk-SVGQSPW4.js';
7
5
  export { CredentialStoreType, MCPServerType, MCPTransportType, TOOL_STATUS_VALUES, VALID_RELATION_TYPES } from './chunk-SVGQSPW4.js';
6
+ import { schema_exports, agentRelations, agents, externalAgents, agentToolRelations, tools, contextConfigs, agentGraph, agentDataComponents, agentArtifactComponents, dataComponents, artifactComponents, projects, apiKeys, contextCache, conversations, messages, credentialReferences, ledgerArtifacts, tasks, taskRelations } from './chunk-M4JXMAG7.js';
7
+ export { agentArtifactComponents, agentArtifactComponentsRelations, agentDataComponents, agentGraph, agentGraphRelations, agentRelations, agentRelationsRelations, agentToolRelations, agentToolRelationsRelations, agents, agentsRelations, apiKeys, apiKeysRelations, artifactComponents, artifactComponentsRelations, contextCache, contextCacheRelations, contextConfigs, contextConfigsRelations, conversations, conversationsRelations, credentialReferences, credentialReferencesRelations, dataComponents, externalAgents, externalAgentsRelations, ledgerArtifacts, ledgerArtifactsContextIdIdx, ledgerArtifactsTaskContextNameUnique, ledgerArtifactsTaskIdIdx, messages, messagesRelations, projects, projectsRelations, taskRelations, taskRelationsRelations, tasks, tasksRelations, tools, toolsRelations } from './chunk-M4JXMAG7.js';
8
8
  import { __publicField } from './chunk-MKBO26DX.js';
9
9
  import { z as z$2 } from 'zod/v4';
10
10
  import jmespath from 'jmespath';
@@ -74,7 +74,11 @@ var LoggerFactory = class {
74
74
  */
75
75
  getLogger(name) {
76
76
  if (this.loggers.has(name)) {
77
- return this.loggers.get(name);
77
+ const logger12 = this.loggers.get(name);
78
+ if (!logger12) {
79
+ throw new Error(`Logger '${name}' not found in cache`);
80
+ }
81
+ return logger12;
78
82
  }
79
83
  let logger11;
80
84
  if (this.config.loggerFactory) {
@@ -1349,6 +1353,9 @@ var upsertAgent = (db) => async (params) => {
1349
1353
  stopWhen: params.data.stopWhen
1350
1354
  }
1351
1355
  });
1356
+ if (!updated) {
1357
+ throw new Error("Failed to update agent - no rows affected");
1358
+ }
1352
1359
  return updated;
1353
1360
  } else {
1354
1361
  return await createAgent(db)(params.data);
@@ -1635,6 +1642,9 @@ var upsertExternalAgent = (db) => async (params) => {
1635
1642
  headers: params.data.headers
1636
1643
  }
1637
1644
  });
1645
+ if (!updated) {
1646
+ throw new Error("Failed to update external agent - no rows affected");
1647
+ }
1638
1648
  return updated;
1639
1649
  } else {
1640
1650
  return await createExternalAgent(db)(params.data);
@@ -3129,6 +3139,9 @@ var upsertCredentialReference = (db) => async (params) => {
3129
3139
  retrievalParams: params.data.retrievalParams
3130
3140
  }
3131
3141
  });
3142
+ if (!updated) {
3143
+ throw new Error("Failed to update credential reference - no rows affected");
3144
+ }
3132
3145
  return updated;
3133
3146
  } else {
3134
3147
  return await createCredentialReference(db)(params.data);
@@ -5663,7 +5676,7 @@ function getTracer(serviceName, serviceVersion) {
5663
5676
 
5664
5677
  // package.json
5665
5678
  var package_default = {
5666
- version: "0.0.0-dev-20250911210702"};
5679
+ version: "0.0.0-dev-20250911221549"};
5667
5680
 
5668
5681
  // src/utils/tracer.ts
5669
5682
  var tracer = getTracer("agents-core", package_default.version);
@@ -6347,7 +6360,15 @@ async function fetchExistingRequestContext({
6347
6360
  "No request context found in cache. Please provide requestContext in request body."
6348
6361
  );
6349
6362
  }
6350
- async function validateRequestContext(tenantId, projectId, graphId, conversationId, parsedRequest, dbClient, credentialStores, legacyRequestContext) {
6363
+ async function validateRequestContext({
6364
+ tenantId,
6365
+ projectId,
6366
+ graphId,
6367
+ conversationId,
6368
+ parsedRequest,
6369
+ dbClient,
6370
+ credentialStores
6371
+ }) {
6351
6372
  try {
6352
6373
  const agentGraph2 = await getAgentGraphWithDefaultAgent(dbClient)({
6353
6374
  scopes: { tenantId, projectId },
@@ -6390,10 +6411,7 @@ async function validateRequestContext(tenantId, projectId, graphId, conversation
6390
6411
  }
6391
6412
  try {
6392
6413
  const schema = contextConfig2.requestContextSchema;
6393
- logger7.debug(
6394
- { contextConfigId: contextConfig2.id },
6395
- "Using headers schema validation"
6396
- );
6414
+ logger7.debug({ contextConfigId: contextConfig2.id }, "Using headers schema validation");
6397
6415
  const httpRequest = parsedRequest;
6398
6416
  const validationResult = await validateHttpRequestHeaders(schema, httpRequest);
6399
6417
  if (validationResult.valid) {
@@ -6476,14 +6494,15 @@ function contextValidationMiddleware(dbClient) {
6476
6494
  const parsedRequest = {
6477
6495
  headers
6478
6496
  };
6479
- const validationResult = await validateRequestContext(
6497
+ const validationResult = await validateRequestContext({
6480
6498
  tenantId,
6481
6499
  projectId,
6482
6500
  graphId,
6483
6501
  conversationId,
6484
6502
  parsedRequest,
6485
6503
  dbClient,
6486
- credentialStores);
6504
+ credentialStores
6505
+ });
6487
6506
  if (!validationResult.valid) {
6488
6507
  logger7.warn(
6489
6508
  {
@@ -6550,13 +6569,11 @@ var ContextFetcher = class {
6550
6569
  __publicField(this, "tenantId");
6551
6570
  __publicField(this, "projectId");
6552
6571
  __publicField(this, "defaultTimeout");
6553
- __publicField(this, "credentialStoreRegistry");
6554
6572
  __publicField(this, "credentialStuffer");
6555
6573
  __publicField(this, "dbClient");
6556
6574
  this.tenantId = tenantId;
6557
6575
  this.projectId = projectId;
6558
6576
  this.defaultTimeout = defaultTimeout;
6559
- this.credentialStoreRegistry = credentialStoreRegistry;
6560
6577
  if (credentialStoreRegistry) {
6561
6578
  this.credentialStuffer = new CredentialStuffer(credentialStoreRegistry);
6562
6579
  }
@@ -1 +1 @@
1
- export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentArtifactComponentApiInsertSchema, AgentArtifactComponentApiSelectSchema, AgentArtifactComponentApiUpdateSchema, AgentArtifactComponentInsertSchema, AgentArtifactComponentSelectSchema, AgentArtifactComponentUpdateSchema, AgentDataComponentApiInsertSchema, AgentDataComponentApiSelectSchema, AgentDataComponentApiUpdateSchema, AgentDataComponentInsertSchema, AgentDataComponentSelectSchema, AgentDataComponentUpdateSchema, AgentGraphApiInsertSchema, AgentGraphApiSelectSchema, AgentGraphApiUpdateSchema, AgentGraphInsertSchema, AgentGraphSelectSchema, AgentGraphUpdateSchema, AgentInsertSchema, AgentRelationApiInsertSchema, AgentRelationApiSelectSchema, AgentRelationApiUpdateSchema, AgentRelationInsertSchema, AgentRelationQuerySchema, AgentRelationSelectSchema, AgentRelationUpdateSchema, AgentSelectSchema, AgentToolRelationApiInsertSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiUpdateSchema, AgentToolRelationInsertSchema, AgentToolRelationSelectSchema, AgentToolRelationUpdateSchema, AgentUpdateSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentRelationApiInsertSchema, ExternalAgentRelationInsertSchema, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, HeadersScopeSchema, IdParamsSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectModelSchema, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, resourceIdSchema, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from '../chunk-PXIJWVD4.js';
1
+ export { AgentApiInsertSchema, AgentApiSelectSchema, AgentApiUpdateSchema, AgentArtifactComponentApiInsertSchema, AgentArtifactComponentApiSelectSchema, AgentArtifactComponentApiUpdateSchema, AgentArtifactComponentInsertSchema, AgentArtifactComponentSelectSchema, AgentArtifactComponentUpdateSchema, AgentDataComponentApiInsertSchema, AgentDataComponentApiSelectSchema, AgentDataComponentApiUpdateSchema, AgentDataComponentInsertSchema, AgentDataComponentSelectSchema, AgentDataComponentUpdateSchema, AgentGraphApiInsertSchema, AgentGraphApiSelectSchema, AgentGraphApiUpdateSchema, AgentGraphInsertSchema, AgentGraphSelectSchema, AgentGraphUpdateSchema, AgentInsertSchema, AgentRelationApiInsertSchema, AgentRelationApiSelectSchema, AgentRelationApiUpdateSchema, AgentRelationInsertSchema, AgentRelationQuerySchema, AgentRelationSelectSchema, AgentRelationUpdateSchema, AgentSelectSchema, AgentToolRelationApiInsertSchema, AgentToolRelationApiSelectSchema, AgentToolRelationApiUpdateSchema, AgentToolRelationInsertSchema, AgentToolRelationSelectSchema, AgentToolRelationUpdateSchema, AgentUpdateSchema, AllAgentSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiSelectSchema, ApiKeyApiUpdateSchema, ApiKeyInsertSchema, ApiKeySelectSchema, ApiKeyUpdateSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiUpdateSchema, ArtifactComponentInsertSchema, ArtifactComponentSelectSchema, ArtifactComponentUpdateSchema, ContextCacheApiInsertSchema, ContextCacheApiSelectSchema, ContextCacheApiUpdateSchema, ContextCacheInsertSchema, ContextCacheSelectSchema, ContextCacheUpdateSchema, ContextConfigApiInsertSchema, ContextConfigApiSelectSchema, ContextConfigApiUpdateSchema, ContextConfigInsertSchema, ContextConfigSelectSchema, ContextConfigUpdateSchema, ConversationApiInsertSchema, ConversationApiSelectSchema, ConversationApiUpdateSchema, ConversationInsertSchema, ConversationSelectSchema, ConversationUpdateSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiUpdateSchema, CredentialReferenceInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceUpdateSchema, DataComponentApiInsertSchema, DataComponentApiSelectSchema, DataComponentApiUpdateSchema, DataComponentBaseSchema, DataComponentInsertSchema, DataComponentSelectSchema, DataComponentUpdateSchema, ErrorResponseSchema, ExistsResponseSchema, ExternalAgentApiInsertSchema, ExternalAgentApiSelectSchema, ExternalAgentApiUpdateSchema, ExternalAgentInsertSchema, ExternalAgentRelationApiInsertSchema, ExternalAgentRelationInsertSchema, ExternalAgentSelectSchema, ExternalAgentUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, HeadersScopeSchema, IdParamsSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiUpdateSchema, LedgerArtifactInsertSchema, LedgerArtifactSelectSchema, LedgerArtifactUpdateSchema, ListResponseSchema, MAX_ID_LENGTH, MCPToolConfigSchema, MIN_ID_LENGTH, McpToolDefinitionSchema, McpToolSchema, McpTransportConfigSchema, MessageApiInsertSchema, MessageApiSelectSchema, MessageApiUpdateSchema, MessageInsertSchema, MessageSelectSchema, MessageUpdateSchema, ModelSchema, ModelSettingsSchema, PaginationQueryParamsSchema, PaginationSchema, ProjectApiInsertSchema, ProjectApiSelectSchema, ProjectApiUpdateSchema, ProjectInsertSchema, ProjectModelSchema, ProjectSelectSchema, ProjectUpdateSchema, RemovedResponseSchema, SingleResponseSchema, StatusComponentSchema, StatusUpdateSchema, TaskApiInsertSchema, TaskApiSelectSchema, TaskApiUpdateSchema, TaskInsertSchema, TaskRelationApiInsertSchema, TaskRelationApiSelectSchema, TaskRelationApiUpdateSchema, TaskRelationInsertSchema, TaskRelationSelectSchema, TaskRelationUpdateSchema, TaskSelectSchema, TaskUpdateSchema, TenantIdParamsSchema, TenantParamsSchema, TenantProjectIdParamsSchema, TenantProjectParamsSchema, ToolApiInsertSchema, ToolApiSelectSchema, ToolApiUpdateSchema, ToolInsertSchema, ToolSelectSchema, ToolStatusSchema, ToolUpdateSchema, URL_SAFE_ID_PATTERN, generateIdFromName, isExternalAgent, isInternalAgent, isValidResourceId, resourceIdSchema, validateAgentRelationships, validateAndTypeGraphData, validateArtifactComponentReferences, validateDataComponentReferences, validateGraphStructure, validateToolReferences } from '../chunk-G6FJN6G5.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-core",
3
- "version": "0.0.0-dev-20250911210702",
3
+ "version": "0.0.0-dev-20250911221549",
4
4
  "description": "Core database schema, types, and validation schemas for Inkeep Agent Framework",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -66,7 +66,8 @@
66
66
  "files": [
67
67
  "dist",
68
68
  "README.md",
69
- "LICENSE.md"
69
+ "LICENSE.md",
70
+ "SUPPLEMENTAL_TERMS.md"
70
71
  ],
71
72
  "repository": {
72
73
  "type": "git",
@@ -1,5 +1,5 @@
1
- import { agents, agentRelations, agentGraph, tasks, taskRelations, tools, conversations, messages, contextCache, dataComponents, agentDataComponents, artifactComponents, agentArtifactComponents, externalAgents, apiKeys, contextConfigs, agentToolRelations, ledgerArtifacts, projects } from './chunk-M4JXMAG7.js';
2
1
  import { VALID_RELATION_TYPES, MCPTransportType, TOOL_STATUS_VALUES, CredentialStoreType, MCPServerType } from './chunk-SVGQSPW4.js';
2
+ import { agents, agentRelations, agentGraph, tasks, taskRelations, tools, conversations, messages, contextCache, dataComponents, agentDataComponents, artifactComponents, agentArtifactComponents, externalAgents, apiKeys, contextConfigs, agentToolRelations, ledgerArtifacts, projects } from './chunk-M4JXMAG7.js';
3
3
  import { z } from '@hono/zod-openapi';
4
4
  import { createSelectSchema, createInsertSchema } from 'drizzle-zod';
5
5