@inkeep/agents-core 0.28.0 → 0.29.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.
@@ -1,4 +1,4 @@
1
- import { subAgents, subAgentRelations, agents, tasks, taskRelations, tools, conversations, messages, contextCache, dataComponents, subAgentDataComponents, artifactComponents, subAgentArtifactComponents, externalAgents, apiKeys, credentialReferences, functionTools, functions, contextConfigs, subAgentToolRelations, subAgentExternalAgentRelations, subAgentTeamAgentRelations, ledgerArtifacts, projects } from './chunk-FDR5SA4O.js';
1
+ import { subAgents, subAgentRelations, agents, tasks, taskRelations, tools, conversations, messages, contextCache, dataComponents, subAgentDataComponents, artifactComponents, subAgentArtifactComponents, externalAgents, apiKeys, credentialReferences, functionTools, functions, contextConfigs, subAgentToolRelations, subAgentExternalAgentRelations, subAgentTeamAgentRelations, ledgerArtifacts, projects } from './chunk-T5TTDZ6L.js';
2
2
  import { VALID_RELATION_TYPES, MCPTransportType, TOOL_STATUS_VALUES, CredentialStoreType, MCPServerType } from './chunk-YFHT5M2R.js';
3
3
  import { z } from '@hono/zod-openapi';
4
4
  import { createSelectSchema, createInsertSchema } from 'drizzle-zod';
@@ -361,6 +361,7 @@ var CredentialReferenceSelectSchema = z.object({
361
361
  id: z.string(),
362
362
  tenantId: z.string(),
363
363
  projectId: z.string(),
364
+ name: z.string(),
364
365
  type: z.string(),
365
366
  credentialStoreId: z.string(),
366
367
  retrievalParams: z.record(z.string(), z.unknown()).nullish(),
@@ -1,4 +1,4 @@
1
- import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-OYTJILYZ.js';
1
+ import { AgentWithinContextOfProjectSchema, resourceIdSchema, MAX_ID_LENGTH } from './chunk-C2QU7WTO.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  // src/validation/agentFull.ts
@@ -621,6 +621,7 @@ var credentialReferences = sqliteTable(
621
621
  "credential_references",
622
622
  {
623
623
  ...projectScoped,
624
+ name: text("name").notNull(),
624
625
  type: text("type").notNull(),
625
626
  credentialStoreId: text("credential_store_id").notNull(),
626
627
  retrievalParams: blob("retrieval_params", { mode: "json" }).$type(),
@@ -595,6 +595,7 @@ var credentialReferences = sqliteCore.sqliteTable(
595
595
  "credential_references",
596
596
  {
597
597
  ...projectScoped,
598
+ name: sqliteCore.text("name").notNull(),
598
599
  type: sqliteCore.text("type").notNull(),
599
600
  credentialStoreId: sqliteCore.text("credential_store_id").notNull(),
600
601
  retrievalParams: sqliteCore.blob("retrieval_params", { mode: "json" }).$type(),
@@ -1318,6 +1319,7 @@ var CredentialReferenceSelectSchema = zodOpenapi.z.object({
1318
1319
  id: zodOpenapi.z.string(),
1319
1320
  tenantId: zodOpenapi.z.string(),
1320
1321
  projectId: zodOpenapi.z.string(),
1322
+ name: zodOpenapi.z.string(),
1321
1323
  type: zodOpenapi.z.string(),
1322
1324
  credentialStoreId: zodOpenapi.z.string(),
1323
1325
  retrievalParams: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).nullish(),
@@ -2303,6 +2305,7 @@ var CredentialReferenceApiInsertSchema2 = zod.z.object({
2303
2305
  id: zod.z.string(),
2304
2306
  tenantId: zod.z.string().optional(),
2305
2307
  projectId: zod.z.string().optional(),
2308
+ name: zod.z.string(),
2306
2309
  type: zod.z.enum(CredentialStoreType),
2307
2310
  credentialStoreId: zod.z.string(),
2308
2311
  retrievalParams: zod.z.record(zod.z.string(), zod.z.unknown()).nullish()
@@ -1,7 +1,7 @@
1
1
  export { i as ACTIVITY_NAMES, g as ACTIVITY_STATUS, f as ACTIVITY_TYPES, h as AGENT_IDS, p as AGGREGATE_OPERATORS, A as AI_OPERATIONS, j as AI_TOOL_TYPES, o as DATA_SOURCES, k as DATA_TYPES, D as DELEGATION_FROM_SUB_AGENT_ID, b as DELEGATION_ID, a as DELEGATION_TO_SUB_AGENT_ID, F as FIELD_TYPES, O as OPERATORS, m as ORDER_DIRECTIONS, P as PANEL_TYPES, q as QUERY_DEFAULTS, l as QUERY_EXPRESSIONS, Q as QUERY_FIELD_CONFIGS, n as QUERY_TYPES, R as REDUCE_OPERATIONS, e as SPAN_KEYS, S as SPAN_NAMES, T as TRANSFER_FROM_SUB_AGENT_ID, c as TRANSFER_TO_SUB_AGENT_ID, U as UNKNOWN_VALUE, d as detectAuthenticationRequired } from './auth-detection-DN8jWUDE.cjs';
2
2
  import { z } from 'zod';
3
- import { C as ConversationHistoryConfig, F as FunctionApiInsertSchema, A as ApiKeyApiUpdateSchema, a as FullAgentAgentInsertSchema } from './utility-aTj9Dhgx.cjs';
4
- export { e as AgentStopWhen, b as AgentStopWhenSchema, h as CredentialStoreType, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, i as MCPTransportType, g as ModelSettings, M as ModelSettingsSchema, d as StopWhen, S as StopWhenSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema } from './utility-aTj9Dhgx.cjs';
3
+ import { C as ConversationHistoryConfig, F as FunctionApiInsertSchema, A as ApiKeyApiUpdateSchema, a as FullAgentAgentInsertSchema } from './utility-DhRaNM5g.cjs';
4
+ export { e as AgentStopWhen, b as AgentStopWhenSchema, h as CredentialStoreType, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, i as MCPTransportType, g as ModelSettings, M as ModelSettingsSchema, d as StopWhen, S as StopWhenSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema } from './utility-DhRaNM5g.cjs';
5
5
  export { v as validatePropsAsJsonSchema } from './props-validation-BMR1qNiy.cjs';
6
6
  import 'pino';
7
7
  import 'drizzle-zod';
@@ -114,6 +114,7 @@ declare const CredentialReferenceApiInsertSchema: z.ZodObject<{
114
114
  id: z.ZodString;
115
115
  tenantId: z.ZodOptional<z.ZodString>;
116
116
  projectId: z.ZodOptional<z.ZodString>;
117
+ name: z.ZodString;
117
118
  type: z.ZodEnum<{
118
119
  readonly memory: "memory";
119
120
  readonly keychain: "keychain";
@@ -133,8 +134,8 @@ declare const DataComponentApiInsertSchema: z.ZodObject<{
133
134
  }, z.core.$strip>>>;
134
135
  }, z.core.$strip>;
135
136
  declare const ArtifactComponentApiInsertSchema: z.ZodObject<{
136
- id: z.ZodString;
137
137
  name: z.ZodString;
138
+ id: z.ZodString;
138
139
  description: z.ZodString;
139
140
  props: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
140
141
  }, {
@@ -169,12 +170,11 @@ declare const FullAgentDefinitionSchema: z.ZodObject<{
169
170
  description: z.ZodOptional<z.ZodString>;
170
171
  defaultSubAgentId: z.ZodOptional<z.ZodString>;
171
172
  subAgents: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
172
- id: z.ZodString;
173
173
  name: z.ZodString;
174
- description: z.ZodString;
175
- prompt: z.ZodString;
174
+ id: z.ZodString;
176
175
  createdAt: z.ZodOptional<z.ZodString>;
177
176
  updatedAt: z.ZodOptional<z.ZodString>;
177
+ description: z.ZodString;
178
178
  models: z.ZodOptional<z.ZodObject<{
179
179
  base: z.ZodOptional<z.ZodObject<{
180
180
  model: z.ZodOptional<z.ZodString>;
@@ -198,6 +198,7 @@ declare const FullAgentDefinitionSchema: z.ZodObject<{
198
198
  }, {
199
199
  stepCountIs?: number | undefined;
200
200
  }>>>>;
201
+ prompt: z.ZodString;
201
202
  conversationHistoryConfig: z.ZodOptional<z.ZodNullable<z.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
202
203
  type: z.ZodLiteral<"internal">;
203
204
  canUse: z.ZodArray<z.ZodObject<{
@@ -1,7 +1,7 @@
1
1
  export { i as ACTIVITY_NAMES, g as ACTIVITY_STATUS, f as ACTIVITY_TYPES, h as AGENT_IDS, p as AGGREGATE_OPERATORS, A as AI_OPERATIONS, j as AI_TOOL_TYPES, o as DATA_SOURCES, k as DATA_TYPES, D as DELEGATION_FROM_SUB_AGENT_ID, b as DELEGATION_ID, a as DELEGATION_TO_SUB_AGENT_ID, F as FIELD_TYPES, O as OPERATORS, m as ORDER_DIRECTIONS, P as PANEL_TYPES, q as QUERY_DEFAULTS, l as QUERY_EXPRESSIONS, Q as QUERY_FIELD_CONFIGS, n as QUERY_TYPES, R as REDUCE_OPERATIONS, e as SPAN_KEYS, S as SPAN_NAMES, T as TRANSFER_FROM_SUB_AGENT_ID, c as TRANSFER_TO_SUB_AGENT_ID, U as UNKNOWN_VALUE, d as detectAuthenticationRequired } from './auth-detection-DN8jWUDE.js';
2
2
  import { z } from 'zod';
3
- import { C as ConversationHistoryConfig, F as FunctionApiInsertSchema, A as ApiKeyApiUpdateSchema, a as FullAgentAgentInsertSchema } from './utility-aTj9Dhgx.js';
4
- export { e as AgentStopWhen, b as AgentStopWhenSchema, h as CredentialStoreType, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, i as MCPTransportType, g as ModelSettings, M as ModelSettingsSchema, d as StopWhen, S as StopWhenSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema } from './utility-aTj9Dhgx.js';
3
+ import { C as ConversationHistoryConfig, F as FunctionApiInsertSchema, A as ApiKeyApiUpdateSchema, a as FullAgentAgentInsertSchema } from './utility-DhRaNM5g.js';
4
+ export { e as AgentStopWhen, b as AgentStopWhenSchema, h as CredentialStoreType, j as FunctionApiSelectSchema, k as FunctionApiUpdateSchema, i as MCPTransportType, g as ModelSettings, M as ModelSettingsSchema, d as StopWhen, S as StopWhenSchema, f as SubAgentStopWhen, c as SubAgentStopWhenSchema } from './utility-DhRaNM5g.js';
5
5
  export { v as validatePropsAsJsonSchema } from './props-validation-BMR1qNiy.js';
6
6
  import 'pino';
7
7
  import 'drizzle-zod';
@@ -114,6 +114,7 @@ declare const CredentialReferenceApiInsertSchema: z.ZodObject<{
114
114
  id: z.ZodString;
115
115
  tenantId: z.ZodOptional<z.ZodString>;
116
116
  projectId: z.ZodOptional<z.ZodString>;
117
+ name: z.ZodString;
117
118
  type: z.ZodEnum<{
118
119
  readonly memory: "memory";
119
120
  readonly keychain: "keychain";
@@ -133,8 +134,8 @@ declare const DataComponentApiInsertSchema: z.ZodObject<{
133
134
  }, z.core.$strip>>>;
134
135
  }, z.core.$strip>;
135
136
  declare const ArtifactComponentApiInsertSchema: z.ZodObject<{
136
- id: z.ZodString;
137
137
  name: z.ZodString;
138
+ id: z.ZodString;
138
139
  description: z.ZodString;
139
140
  props: z.ZodOptional<z.ZodNullable<z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>>>;
140
141
  }, {
@@ -169,12 +170,11 @@ declare const FullAgentDefinitionSchema: z.ZodObject<{
169
170
  description: z.ZodOptional<z.ZodString>;
170
171
  defaultSubAgentId: z.ZodOptional<z.ZodString>;
171
172
  subAgents: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
172
- id: z.ZodString;
173
173
  name: z.ZodString;
174
- description: z.ZodString;
175
- prompt: z.ZodString;
174
+ id: z.ZodString;
176
175
  createdAt: z.ZodOptional<z.ZodString>;
177
176
  updatedAt: z.ZodOptional<z.ZodString>;
177
+ description: z.ZodString;
178
178
  models: z.ZodOptional<z.ZodObject<{
179
179
  base: z.ZodOptional<z.ZodObject<{
180
180
  model: z.ZodOptional<z.ZodString>;
@@ -198,6 +198,7 @@ declare const FullAgentDefinitionSchema: z.ZodObject<{
198
198
  }, {
199
199
  stepCountIs?: number | undefined;
200
200
  }>>>>;
201
+ prompt: z.ZodString;
201
202
  conversationHistoryConfig: z.ZodOptional<z.ZodNullable<z.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
202
203
  type: z.ZodLiteral<"internal">;
203
204
  canUse: z.ZodArray<z.ZodObject<{
@@ -1,6 +1,6 @@
1
1
  export { ACTIVITY_NAMES, ACTIVITY_STATUS, ACTIVITY_TYPES, AGENT_IDS, AGGREGATE_OPERATORS, AI_OPERATIONS, AI_TOOL_TYPES, DATA_SOURCES, DATA_TYPES, DELEGATION_FROM_SUB_AGENT_ID, DELEGATION_ID, DELEGATION_TO_SUB_AGENT_ID, FIELD_TYPES, OPERATORS, ORDER_DIRECTIONS, PANEL_TYPES, QUERY_DEFAULTS, QUERY_EXPRESSIONS, QUERY_FIELD_CONFIGS, QUERY_TYPES, REDUCE_OPERATIONS, SPAN_KEYS, SPAN_NAMES, TRANSFER_FROM_SUB_AGENT_ID, TRANSFER_TO_SUB_AGENT_ID, UNKNOWN_VALUE, detectAuthenticationRequired } from './chunk-CK2M5I4Q.js';
2
- import { ModelSettingsSchema, FullAgentAgentInsertSchema, ArtifactComponentApiInsertSchema } from './chunk-OYTJILYZ.js';
3
- export { AgentStopWhenSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, ModelSettingsSchema, StopWhenSchema, SubAgentStopWhenSchema, validatePropsAsJsonSchema } from './chunk-OYTJILYZ.js';
2
+ import { ModelSettingsSchema, FullAgentAgentInsertSchema, ArtifactComponentApiInsertSchema } from './chunk-C2QU7WTO.js';
3
+ export { AgentStopWhenSchema, FunctionApiInsertSchema, FunctionApiSelectSchema, FunctionApiUpdateSchema, ModelSettingsSchema, StopWhenSchema, SubAgentStopWhenSchema, validatePropsAsJsonSchema } from './chunk-C2QU7WTO.js';
4
4
  import { CredentialStoreType } from './chunk-YFHT5M2R.js';
5
5
  export { CredentialStoreType, MCPTransportType } from './chunk-YFHT5M2R.js';
6
6
  import { z } from 'zod';
@@ -80,6 +80,7 @@ var CredentialReferenceApiInsertSchema = z.object({
80
80
  id: z.string(),
81
81
  tenantId: z.string().optional(),
82
82
  projectId: z.string().optional(),
83
+ name: z.string(),
83
84
  type: z.enum(CredentialStoreType),
84
85
  credentialStoreId: z.string(),
85
86
  retrievalParams: z.record(z.string(), z.unknown()).nullish()
@@ -569,6 +569,7 @@ var credentialReferences = sqliteCore.sqliteTable(
569
569
  "credential_references",
570
570
  {
571
571
  ...projectScoped,
572
+ name: sqliteCore.text("name").notNull(),
572
573
  type: sqliteCore.text("type").notNull(),
573
574
  credentialStoreId: sqliteCore.text("credential_store_id").notNull(),
574
575
  retrievalParams: sqliteCore.blob("retrieval_params", { mode: "json" }).$type(),
@@ -1,7 +1,7 @@
1
1
  import 'drizzle-orm';
2
2
  import 'drizzle-orm/sqlite-core';
3
- import '../utility-aTj9Dhgx.cjs';
4
- export { G as agentRelations, J as agentToolRelationsRelations, a as agents, y as apiKeys, I as apiKeysRelations, j as artifactComponents, O as artifactComponentsRelations, b as contextCache, E as contextCacheRelations, c as contextConfigs, D as contextConfigsRelations, v as conversations, M as conversationsRelations, z as credentialReferences, K as credentialReferencesRelations, h as dataComponents, Q as dataComponentsRelations, f as externalAgents, H as externalAgentsRelations, m as functionTools, V as functionToolsRelations, n as functions, T as functionsRelations, x as ledgerArtifacts, S as ledgerArtifactsRelations, w as messages, N as messagesRelations, p as projects, B as projectsRelations, k as subAgentArtifactComponents, P as subAgentArtifactComponentsRelations, i as subAgentDataComponents, R as subAgentDataComponentsRelations, q as subAgentExternalAgentRelations, X as subAgentExternalAgentRelationsRelations, u as subAgentFunctionToolRelations, W as subAgentFunctionToolRelationsRelations, e as subAgentRelations, U as subAgentRelationsRelations, r as subAgentTeamAgentRelations, Y as subAgentTeamAgentRelationsRelations, o as subAgentToolRelations, d as subAgents, F as subAgentsRelations, g as taskRelations, C as taskRelationsRelations, t as tasks, A as tasksRelations, l as tools, L as toolsRelations } from '../schema-Dl4IdQS5.cjs';
3
+ import '../utility-DhRaNM5g.cjs';
4
+ export { G as agentRelations, J as agentToolRelationsRelations, a as agents, y as apiKeys, I as apiKeysRelations, j as artifactComponents, O as artifactComponentsRelations, b as contextCache, E as contextCacheRelations, c as contextConfigs, D as contextConfigsRelations, v as conversations, M as conversationsRelations, z as credentialReferences, K as credentialReferencesRelations, h as dataComponents, Q as dataComponentsRelations, f as externalAgents, H as externalAgentsRelations, m as functionTools, V as functionToolsRelations, n as functions, T as functionsRelations, x as ledgerArtifacts, S as ledgerArtifactsRelations, w as messages, N as messagesRelations, p as projects, B as projectsRelations, k as subAgentArtifactComponents, P as subAgentArtifactComponentsRelations, i as subAgentDataComponents, R as subAgentDataComponentsRelations, q as subAgentExternalAgentRelations, X as subAgentExternalAgentRelationsRelations, u as subAgentFunctionToolRelations, W as subAgentFunctionToolRelationsRelations, e as subAgentRelations, U as subAgentRelationsRelations, r as subAgentTeamAgentRelations, Y as subAgentTeamAgentRelationsRelations, o as subAgentToolRelations, d as subAgents, F as subAgentsRelations, g as taskRelations, C as taskRelationsRelations, t as tasks, A as tasksRelations, l as tools, L as toolsRelations } from '../schema-BiOhaqXf.cjs';
5
5
  import 'zod';
6
6
  import 'drizzle-zod';
7
7
  import '@hono/zod-openapi';
@@ -1,7 +1,7 @@
1
1
  import 'drizzle-orm';
2
2
  import 'drizzle-orm/sqlite-core';
3
- import '../utility-aTj9Dhgx.js';
4
- export { G as agentRelations, J as agentToolRelationsRelations, a as agents, y as apiKeys, I as apiKeysRelations, j as artifactComponents, O as artifactComponentsRelations, b as contextCache, E as contextCacheRelations, c as contextConfigs, D as contextConfigsRelations, v as conversations, M as conversationsRelations, z as credentialReferences, K as credentialReferencesRelations, h as dataComponents, Q as dataComponentsRelations, f as externalAgents, H as externalAgentsRelations, m as functionTools, V as functionToolsRelations, n as functions, T as functionsRelations, x as ledgerArtifacts, S as ledgerArtifactsRelations, w as messages, N as messagesRelations, p as projects, B as projectsRelations, k as subAgentArtifactComponents, P as subAgentArtifactComponentsRelations, i as subAgentDataComponents, R as subAgentDataComponentsRelations, q as subAgentExternalAgentRelations, X as subAgentExternalAgentRelationsRelations, u as subAgentFunctionToolRelations, W as subAgentFunctionToolRelationsRelations, e as subAgentRelations, U as subAgentRelationsRelations, r as subAgentTeamAgentRelations, Y as subAgentTeamAgentRelationsRelations, o as subAgentToolRelations, d as subAgents, F as subAgentsRelations, g as taskRelations, C as taskRelationsRelations, t as tasks, A as tasksRelations, l as tools, L as toolsRelations } from '../schema-O4RZSGWH.js';
3
+ import '../utility-DhRaNM5g.js';
4
+ export { G as agentRelations, J as agentToolRelationsRelations, a as agents, y as apiKeys, I as apiKeysRelations, j as artifactComponents, O as artifactComponentsRelations, b as contextCache, E as contextCacheRelations, c as contextConfigs, D as contextConfigsRelations, v as conversations, M as conversationsRelations, z as credentialReferences, K as credentialReferencesRelations, h as dataComponents, Q as dataComponentsRelations, f as externalAgents, H as externalAgentsRelations, m as functionTools, V as functionToolsRelations, n as functions, T as functionsRelations, x as ledgerArtifacts, S as ledgerArtifactsRelations, w as messages, N as messagesRelations, p as projects, B as projectsRelations, k as subAgentArtifactComponents, P as subAgentArtifactComponentsRelations, i as subAgentDataComponents, R as subAgentDataComponentsRelations, q as subAgentExternalAgentRelations, X as subAgentExternalAgentRelationsRelations, u as subAgentFunctionToolRelations, W as subAgentFunctionToolRelationsRelations, e as subAgentRelations, U as subAgentRelationsRelations, r as subAgentTeamAgentRelations, Y as subAgentTeamAgentRelationsRelations, o as subAgentToolRelations, d as subAgents, F as subAgentsRelations, g as taskRelations, C as taskRelationsRelations, t as tasks, A as tasksRelations, l as tools, L as toolsRelations } from '../schema-B7LgU7Uc.js';
5
5
  import 'zod';
6
6
  import 'drizzle-zod';
7
7
  import '@hono/zod-openapi';
package/dist/db/schema.js CHANGED
@@ -1 +1 @@
1
- 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-FDR5SA4O.js';
1
+ 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';
package/dist/index.cjs CHANGED
@@ -214051,6 +214051,7 @@ var credentialReferences = sqliteCore.sqliteTable(
214051
214051
  "credential_references",
214052
214052
  {
214053
214053
  ...projectScoped,
214054
+ name: sqliteCore.text("name").notNull(),
214054
214055
  type: sqliteCore.text("type").notNull(),
214055
214056
  credentialStoreId: sqliteCore.text("credential_store_id").notNull(),
214056
214057
  retrievalParams: sqliteCore.blob("retrieval_params", { mode: "json" }).$type(),
@@ -214791,6 +214792,7 @@ var CredentialReferenceSelectSchema = zodOpenapi.z.object({
214791
214792
  id: zodOpenapi.z.string(),
214792
214793
  tenantId: zodOpenapi.z.string(),
214793
214794
  projectId: zodOpenapi.z.string(),
214795
+ name: zodOpenapi.z.string(),
214794
214796
  type: zodOpenapi.z.string(),
214795
214797
  credentialStoreId: zodOpenapi.z.string(),
214796
214798
  retrievalParams: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.unknown()).nullish(),
@@ -215637,31 +215639,20 @@ var _TemplateEngine = class _TemplateEngine {
215637
215639
  });
215638
215640
  }
215639
215641
  /**
215640
- * Process built-in variables like $now, $env, etc.
215642
+ * Process built-in variables like $env, etc.
215641
215643
  */
215642
215644
  static processBuiltinVariable(variable) {
215643
- switch (variable) {
215644
- case "$now":
215645
- return (/* @__PURE__ */ new Date()).toISOString();
215646
- case "$timestamp":
215647
- return Date.now().toString();
215648
- case "$date":
215649
- return (/* @__PURE__ */ new Date()).toDateString();
215650
- case "$time":
215651
- return (/* @__PURE__ */ new Date()).toTimeString();
215652
- default:
215653
- if (variable.startsWith("$env.")) {
215654
- const envVar = variable.substring(5);
215655
- return process.env[envVar] || "";
215656
- }
215657
- logger3.warn(
215658
- {
215659
- variable
215660
- },
215661
- "Unknown built-in variable"
215662
- );
215663
- return "";
215645
+ if (variable.startsWith("$env.")) {
215646
+ const envVar = variable.substring(5);
215647
+ return process.env[envVar] || "";
215664
215648
  }
215649
+ logger3.warn(
215650
+ {
215651
+ variable
215652
+ },
215653
+ "Unknown built-in variable"
215654
+ );
215655
+ return "";
215665
215656
  }
215666
215657
  /**
215667
215658
  * Check if template contains template variables
@@ -215876,7 +215867,7 @@ var CredentialStuffer = class {
215876
215867
  if (!contextConfigId || !conversationId || !this.contextResolver) {
215877
215868
  return null;
215878
215869
  }
215879
- const context = await this.contextResolver.resolveHeaders(
215870
+ const headersContext = await this.contextResolver.resolveHeaders(
215880
215871
  conversationId,
215881
215872
  contextConfigId
215882
215873
  );
@@ -215884,7 +215875,7 @@ var CredentialStuffer = class {
215884
215875
  for (const [key, value] of Object.entries(headers2)) {
215885
215876
  resolvedHeaders[key] = TemplateEngine.render(
215886
215877
  value,
215887
- context,
215878
+ { headers: headersContext },
215888
215879
  { strict: true }
215889
215880
  );
215890
215881
  }
@@ -215933,24 +215924,13 @@ var CredentialStuffer = class {
215933
215924
  headers: tool2.headers || {}
215934
215925
  });
215935
215926
  }
215936
- const baseConfig = {
215927
+ return {
215937
215928
  type: tool2.transport?.type || MCPTransportType.streamableHttp,
215938
215929
  url: tool2.serverUrl,
215939
215930
  activeTools: tool2.activeTools,
215940
- selectedTools
215931
+ selectedTools,
215932
+ headers: credentialHeaders
215941
215933
  };
215942
- if (baseConfig.type === MCPTransportType.streamableHttp || baseConfig.type === MCPTransportType.sse) {
215943
- const httpConfig = {
215944
- ...baseConfig,
215945
- url: tool2.serverUrl,
215946
- headers: {
215947
- ...tool2.headers,
215948
- ...credentialHeaders
215949
- }
215950
- };
215951
- return httpConfig;
215952
- }
215953
- return baseConfig;
215954
215934
  }
215955
215935
  };
215956
215936
  function createDatabaseClient(config) {
@@ -218971,6 +218951,7 @@ var upsertCredentialReference = (db) => async (params) => {
218971
218951
  scopes,
218972
218952
  id: params.data.id,
218973
218953
  data: {
218954
+ name: params.data.name,
218974
218955
  type: params.data.type,
218975
218956
  credentialStoreId: params.data.credentialStoreId,
218976
218957
  retrievalParams: params.data.retrievalParams
@@ -219152,7 +219133,8 @@ var dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry) => {
219152
219133
  logger: logger8
219153
219134
  });
219154
219135
  status = toolNeedsAuth ? "needs_auth" : "unhealthy";
219155
- lastErrorComputed = toolNeedsAuth ? "Authentication required - OAuth login needed" : error instanceof Error ? error.message : "Tool discovery failed";
219136
+ const errorMessage = error instanceof Error ? error.message : "Tool discovery failed";
219137
+ lastErrorComputed = toolNeedsAuth ? `Authentication required - OAuth login needed. ${errorMessage}` : errorMessage;
219156
219138
  }
219157
219139
  const now = (/* @__PURE__ */ new Date()).toISOString();
219158
219140
  await updateTool(dbClient)({
@@ -225510,7 +225492,6 @@ async function handleContextResolution({
225510
225492
  });
225511
225493
  const resolvedContext = {
225512
225494
  ...contextResult.resolvedContext,
225513
- $now: (/* @__PURE__ */ new Date()).toISOString(),
225514
225495
  $env: process.env
225515
225496
  };
225516
225497
  await updateConversation(dbClient)({
@@ -225714,8 +225695,9 @@ var KeyChainStore = class {
225714
225695
  }
225715
225696
  /**
225716
225697
  * Set a credential in the keychain
225698
+ * @param metadata - Optional metadata (ignored by keychain store)
225717
225699
  */
225718
- async set(key, value) {
225700
+ async set(key, value, _metadata) {
225719
225701
  await this.initializationPromise;
225720
225702
  if (!this.keytarAvailable || !this.keytar) {
225721
225703
  this.logger.warn({ storeId: this.id, key }, "Keytar not available, cannot set credential");
@@ -225885,8 +225867,9 @@ var InMemoryCredentialStore = class {
225885
225867
  * Set a credential in the in memory store.
225886
225868
  * @param key - The key of the credential to set
225887
225869
  * @param value - The value of the credential to set
225870
+ * @param metadata - Optional metadata (ignored by memory store)
225888
225871
  */
225889
- async set(key, value) {
225872
+ async set(key, value, _metadata) {
225890
225873
  this.credentials.set(key, value);
225891
225874
  }
225892
225875
  /**
@@ -225917,8 +225900,24 @@ var InMemoryCredentialStore = class {
225917
225900
  var logger14 = getLogger("nango-credential-store");
225918
225901
  var CredentialKeySchema = zod.z.object({
225919
225902
  connectionId: zod.z.string().min(1, "connectionId must be a non-empty string"),
225920
- providerConfigKey: zod.z.string().min(1, "providerConfigKey must be a non-empty string")
225903
+ providerConfigKey: zod.z.string().min(1, "providerConfigKey must be a non-empty string"),
225904
+ integrationDisplayName: zod.z.string().nullish()
225921
225905
  });
225906
+ function parseCredentialKey(key) {
225907
+ try {
225908
+ const parsed = JSON.parse(key);
225909
+ return CredentialKeySchema.parse(parsed);
225910
+ } catch (error) {
225911
+ logger14.warn(
225912
+ {
225913
+ key: key.substring(0, 100),
225914
+ error: error instanceof Error ? error.message : "Unknown error"
225915
+ },
225916
+ "Failed to parse credential key"
225917
+ );
225918
+ return null;
225919
+ }
225920
+ }
225922
225921
  var SUPPORTED_AUTH_MODES = [
225923
225922
  "APP",
225924
225923
  "API_KEY",
@@ -226062,45 +226061,12 @@ var NangoCredentialStore = class {
226062
226061
  return null;
226063
226062
  }
226064
226063
  }
226065
- /**
226066
- * Optimize OAuth token data to fit within Nango's 1024 character limit for apiKey field
226067
- * Strategy: Remove unnecessary fields
226068
- */
226069
- optimizeOAuthTokenForNango(tokenData) {
226070
- const parsed = JSON.parse(tokenData);
226071
- const essential = {
226072
- access_token: parsed.access_token,
226073
- token_type: parsed.token_type,
226074
- expires_in: parsed.expires_in,
226075
- refresh_token: parsed.refresh_token
226076
- };
226077
- Object.keys(essential).forEach((key) => {
226078
- if (essential[key] === void 0) {
226079
- delete essential[key];
226080
- }
226081
- });
226082
- const result = JSON.stringify(essential);
226083
- if (result.length > 1024) {
226084
- logger14.error(
226085
- {
226086
- originalLength: tokenData.length,
226087
- essentialLength: result.length,
226088
- accessTokenLength: parsed.access_token?.length || 0,
226089
- refreshTokenLength: parsed.refresh_token?.length || 0
226090
- },
226091
- "OAuth token too large for Nango storage even after removing non-essential fields"
226092
- );
226093
- throw new Error(
226094
- `OAuth token (${result.length} chars) exceeds Nango's 1024 character limit. Essential fields cannot be truncated without breaking functionality. Consider using keychain storage instead of Nango for this provider.`
226095
- );
226096
- }
226097
- return result;
226098
- }
226099
226064
  /**
226100
226065
  * Create an API key credential by setting up Nango integration and importing the connection
226101
226066
  */
226102
226067
  async createNangoApiKeyConnection({
226103
- name,
226068
+ uniqueKey,
226069
+ displayName,
226104
226070
  apiKeyToSet,
226105
226071
  metadata
226106
226072
  }) {
@@ -226110,12 +226076,12 @@ var NangoCredentialStore = class {
226110
226076
  try {
226111
226077
  const response2 = await this.nangoClient.createIntegration({
226112
226078
  provider,
226113
- unique_key: name,
226114
- display_name: name
226079
+ unique_key: uniqueKey,
226080
+ display_name: displayName
226115
226081
  });
226116
226082
  integration = response2.data;
226117
226083
  } catch (error) {
226118
- const existingIntegration = await this.fetchNangoIntegration(name);
226084
+ const existingIntegration = await this.fetchNangoIntegration(uniqueKey);
226119
226085
  if (existingIntegration) {
226120
226086
  integration = existingIntegration;
226121
226087
  } else {
@@ -226123,20 +226089,16 @@ var NangoCredentialStore = class {
226123
226089
  }
226124
226090
  }
226125
226091
  if (!integration) {
226126
- throw new Error(`Integration '${name}' not found`);
226092
+ throw new Error(`Integration '${uniqueKey}' not found`);
226127
226093
  }
226128
226094
  const importConnectionUrl = `${process.env.NANGO_SERVER_URL || "https://api.nango.dev"}/connections`;
226129
- const optimizedApiKey = this.optimizeOAuthTokenForNango(apiKeyToSet);
226130
- if (!optimizedApiKey) {
226131
- throw new Error(`Failed to optimize OAuth token for Nango.`);
226132
- }
226133
226095
  const credentials = {
226134
226096
  type: "API_KEY",
226135
- apiKey: optimizedApiKey
226097
+ apiKey: apiKeyToSet
226136
226098
  };
226137
226099
  const body = {
226138
226100
  provider_config_key: integration.unique_key,
226139
- connection_id: name,
226101
+ connection_id: uniqueKey,
226140
226102
  metadata,
226141
226103
  credentials
226142
226104
  };
@@ -226158,12 +226120,12 @@ var NangoCredentialStore = class {
226158
226120
  logger14.error(
226159
226121
  {
226160
226122
  error: error instanceof Error ? error.message : "Unknown error",
226161
- name
226123
+ displayName
226162
226124
  },
226163
- `Unexpected error creating API key credential '${name}'`
226125
+ `Unexpected error creating API key credential '${displayName}'`
226164
226126
  );
226165
226127
  throw new Error(
226166
- `Failed to create API key credential '${name}': ${error instanceof Error ? error.message : "Unknown error"}`
226128
+ `Failed to create API key credential '${displayName}': ${error instanceof Error ? error.message : "Unknown error"}`
226167
226129
  );
226168
226130
  }
226169
226131
  }
@@ -226207,34 +226169,11 @@ var NangoCredentialStore = class {
226207
226169
  */
226208
226170
  async get(key) {
226209
226171
  try {
226210
- let parsedKey;
226211
- try {
226212
- parsedKey = JSON.parse(key);
226213
- } catch (parseError) {
226214
- logger14.warn(
226215
- {
226216
- storeId: this.id,
226217
- key: key.substring(0, 50),
226218
- // Log only first 100 chars to avoid log pollution
226219
- error: parseError instanceof Error ? parseError.message : "Unknown parsing error"
226220
- },
226221
- "Invalid JSON format in credential key"
226222
- );
226172
+ const parsedKey = parseCredentialKey(key);
226173
+ if (!parsedKey) {
226223
226174
  return null;
226224
226175
  }
226225
- const validationResult = CredentialKeySchema.safeParse(parsedKey);
226226
- if (!validationResult.success) {
226227
- logger14.warn(
226228
- {
226229
- storeId: this.id,
226230
- key: key.substring(0, 100),
226231
- validationErrors: validationResult.error.issues
226232
- },
226233
- "Invalid credential key structure"
226234
- );
226235
- return null;
226236
- }
226237
- const { connectionId, providerConfigKey } = validationResult.data;
226176
+ const { connectionId, providerConfigKey } = parsedKey;
226238
226177
  const credentials = await this.fetchCredentialsFromNango({ connectionId, providerConfigKey });
226239
226178
  if (!credentials) {
226240
226179
  return null;
@@ -226254,13 +226193,20 @@ var NangoCredentialStore = class {
226254
226193
  }
226255
226194
  }
226256
226195
  /**
226257
- * Set credentials - not supported for Nango (OAuth flow handles this)
226196
+ * Set credentials - this is used to save bearer auth
226197
+ * Key format: JSON string with connectionId and providerConfigKey
226258
226198
  */
226259
- async set(key, value) {
226199
+ async set(key, value, metadata = {}) {
226200
+ const parsedKey = parseCredentialKey(key);
226201
+ if (!parsedKey) {
226202
+ throw new Error(`Invalid credential key: ${key}`);
226203
+ }
226204
+ const { connectionId, providerConfigKey, integrationDisplayName } = parsedKey;
226260
226205
  await this.createNangoApiKeyConnection({
226261
- name: key,
226206
+ uniqueKey: connectionId,
226207
+ displayName: integrationDisplayName ?? providerConfigKey,
226262
226208
  apiKeyToSet: value,
226263
- metadata: {}
226209
+ metadata
226264
226210
  });
226265
226211
  }
226266
226212
  /**
@@ -226286,34 +226232,11 @@ var NangoCredentialStore = class {
226286
226232
  */
226287
226233
  async delete(key) {
226288
226234
  try {
226289
- let parsedKey;
226290
- try {
226291
- parsedKey = JSON.parse(key);
226292
- } catch (parseError) {
226293
- logger14.warn(
226294
- {
226295
- storeId: this.id,
226296
- key: key.substring(0, 50),
226297
- // Log only first 100 chars to avoid log pollution
226298
- error: parseError instanceof Error ? parseError.message : "Unknown parsing error"
226299
- },
226300
- "Invalid JSON format in credential key"
226301
- );
226302
- return false;
226303
- }
226304
- const validationResult = CredentialKeySchema.safeParse(parsedKey);
226305
- if (!validationResult.success) {
226306
- logger14.warn(
226307
- {
226308
- storeId: this.id,
226309
- key: key.substring(0, 100),
226310
- validationErrors: validationResult.error.issues
226311
- },
226312
- "Invalid credential key structure"
226313
- );
226235
+ const parsedKey = parseCredentialKey(key);
226236
+ if (!parsedKey) {
226314
226237
  return false;
226315
226238
  }
226316
- const { connectionId, providerConfigKey } = validationResult.data;
226239
+ const { connectionId, providerConfigKey } = parsedKey;
226317
226240
  await this.nangoClient.deleteConnection(providerConfigKey, connectionId);
226318
226241
  return true;
226319
226242
  } catch (error) {