@inkeep/agents-core 0.0.0-dev-20250911175803 → 0.0.0-dev-20250911195722

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,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-355CYJ6K.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
 
@@ -404,7 +404,8 @@ var AgentToolRelationSelectSchema = createSelectSchema(agentToolRelations);
404
404
  var AgentToolRelationInsertSchema = createInsertSchema(agentToolRelations).extend({
405
405
  id: resourceIdSchema,
406
406
  agentId: resourceIdSchema,
407
- toolId: resourceIdSchema
407
+ toolId: resourceIdSchema,
408
+ selectedTools: z.array(z.string()).nullish()
408
409
  });
409
410
  var AgentToolRelationUpdateSchema = AgentToolRelationInsertSchema.partial();
410
411
  var AgentToolRelationApiSelectSchema = createApiSchema(AgentToolRelationSelectSchema);
@@ -438,6 +439,7 @@ var StatusUpdateSchema = z.object({
438
439
  });
439
440
  var FullGraphAgentInsertSchema = AgentApiInsertSchema.extend({
440
441
  tools: z.array(z.string()),
442
+ selectedTools: z.record(z.string(), z.array(z.string())).optional(),
441
443
  dataComponents: z.array(z.string()).optional(),
442
444
  artifactComponents: z.array(z.string()).optional(),
443
445
  canTransferTo: z.array(z.string()).optional(),
@@ -377,6 +377,7 @@ var agentToolRelations = sqliteTable(
377
377
  id: text("id").notNull(),
378
378
  agentId: text("agent_id").notNull(),
379
379
  toolId: text("tool_id").notNull(),
380
+ selectedTools: blob("selected_tools", { mode: "json" }).$type(),
380
381
  createdAt: text("created_at").notNull().default(sql`CURRENT_TIMESTAMP`),
381
382
  updatedAt: text("updated_at").notNull().default(sql`CURRENT_TIMESTAMP`)
382
383
  },
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export { C as CredentialStoreType, M as MCPTransportType } from './entities-B59eRwT_.cjs';
2
+ export { C as CredentialStoreType, M as MCPTransportType } from './entities-Cl_yssfC.cjs';
3
3
  import 'drizzle-zod';
4
4
  import 'drizzle-orm/sqlite-core';
5
5
  import '@hono/zod-openapi';
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export { C as CredentialStoreType, M as MCPTransportType } from './entities-B59eRwT_.js';
2
+ export { C as CredentialStoreType, M as MCPTransportType } from './entities-Cl_yssfC.js';
3
3
  import 'drizzle-zod';
4
4
  import 'drizzle-orm/sqlite-core';
5
5
  import '@hono/zod-openapi';
@@ -335,6 +335,7 @@ var agentToolRelations = sqliteCore.sqliteTable(
335
335
  id: sqliteCore.text("id").notNull(),
336
336
  agentId: sqliteCore.text("agent_id").notNull(),
337
337
  toolId: sqliteCore.text("tool_id").notNull(),
338
+ selectedTools: sqliteCore.blob("selected_tools", { mode: "json" }).$type(),
338
339
  createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
339
340
  updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
340
341
  },
@@ -1,7 +1,7 @@
1
1
  import 'drizzle-orm';
2
2
  import 'drizzle-orm/sqlite-core';
3
- import '../entities-B59eRwT_.cjs';
4
- export { k as agentArtifactComponents, N as agentArtifactComponentsRelations, i as agentDataComponents, f as agentGraph, E as agentGraphRelations, d as agentRelations, O as agentRelationsRelations, m as agentToolRelations, H as agentToolRelationsRelations, b as agents, D as agentsRelations, r as apiKeys, G as apiKeysRelations, j as artifactComponents, M as artifactComponentsRelations, a as contextCache, C as contextCacheRelations, c as contextConfigs, B as contextConfigsRelations, n as conversations, K as conversationsRelations, u as credentialReferences, I as credentialReferencesRelations, h as dataComponents, e as externalAgents, F as externalAgentsRelations, q as ledgerArtifacts, w as ledgerArtifactsContextIdIdx, x as ledgerArtifactsTaskContextNameUnique, v as ledgerArtifactsTaskIdIdx, o as messages, L as messagesRelations, p as projects, z as projectsRelations, g as taskRelations, A as taskRelationsRelations, t as tasks, y as tasksRelations, l as tools, J as toolsRelations } from '../schema-CzRwwW8E.cjs';
3
+ import '../entities-Cl_yssfC.cjs';
4
+ export { k as agentArtifactComponents, N as agentArtifactComponentsRelations, i as agentDataComponents, f as agentGraph, E as agentGraphRelations, d as agentRelations, O as agentRelationsRelations, m as agentToolRelations, H as agentToolRelationsRelations, b as agents, D as agentsRelations, r as apiKeys, G as apiKeysRelations, j as artifactComponents, M as artifactComponentsRelations, a as contextCache, C as contextCacheRelations, c as contextConfigs, B as contextConfigsRelations, n as conversations, K as conversationsRelations, u as credentialReferences, I as credentialReferencesRelations, h as dataComponents, e as externalAgents, F as externalAgentsRelations, q as ledgerArtifacts, w as ledgerArtifactsContextIdIdx, x as ledgerArtifactsTaskContextNameUnique, v as ledgerArtifactsTaskIdIdx, o as messages, L as messagesRelations, p as projects, z as projectsRelations, g as taskRelations, A as taskRelationsRelations, t as tasks, y as tasksRelations, l as tools, J as toolsRelations } from '../schema-BflhLoiw.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 '../entities-B59eRwT_.js';
4
- export { k as agentArtifactComponents, N as agentArtifactComponentsRelations, i as agentDataComponents, f as agentGraph, E as agentGraphRelations, d as agentRelations, O as agentRelationsRelations, m as agentToolRelations, H as agentToolRelationsRelations, b as agents, D as agentsRelations, r as apiKeys, G as apiKeysRelations, j as artifactComponents, M as artifactComponentsRelations, a as contextCache, C as contextCacheRelations, c as contextConfigs, B as contextConfigsRelations, n as conversations, K as conversationsRelations, u as credentialReferences, I as credentialReferencesRelations, h as dataComponents, e as externalAgents, F as externalAgentsRelations, q as ledgerArtifacts, w as ledgerArtifactsContextIdIdx, x as ledgerArtifactsTaskContextNameUnique, v as ledgerArtifactsTaskIdIdx, o as messages, L as messagesRelations, p as projects, z as projectsRelations, g as taskRelations, A as taskRelationsRelations, t as tasks, y as tasksRelations, l as tools, J as toolsRelations } from '../schema-B3zZJ85n.js';
3
+ import '../entities-Cl_yssfC.js';
4
+ export { k as agentArtifactComponents, N as agentArtifactComponentsRelations, i as agentDataComponents, f as agentGraph, E as agentGraphRelations, d as agentRelations, O as agentRelationsRelations, m as agentToolRelations, H as agentToolRelationsRelations, b as agents, D as agentsRelations, r as apiKeys, G as apiKeysRelations, j as artifactComponents, M as artifactComponentsRelations, a as contextCache, C as contextCacheRelations, c as contextConfigs, B as contextConfigsRelations, n as conversations, K as conversationsRelations, u as credentialReferences, I as credentialReferencesRelations, h as dataComponents, e as externalAgents, F as externalAgentsRelations, q as ledgerArtifacts, w as ledgerArtifactsContextIdIdx, x as ledgerArtifactsTaskContextNameUnique, v as ledgerArtifactsTaskIdIdx, o as messages, L as messagesRelations, p as projects, z as projectsRelations, g as taskRelations, A as taskRelationsRelations, t as tasks, y as tasksRelations, l as tools, J as toolsRelations } from '../schema-Baa5JhqR.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 { 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-355CYJ6K.js';
1
+ 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';
@@ -6197,6 +6197,25 @@ declare const AgentToolRelationSelectSchema: drizzle_zod.BuildSchema<"select", {
6197
6197
  }, {}, {
6198
6198
  length: number | undefined;
6199
6199
  }>;
6200
+ selectedTools: drizzle_orm_sqlite_core.SQLiteColumn<{
6201
+ name: "selected_tools";
6202
+ tableName: "agent_tool_relations";
6203
+ dataType: "json";
6204
+ columnType: "SQLiteBlobJson";
6205
+ data: string[] | null;
6206
+ driverParam: Buffer<ArrayBufferLike>;
6207
+ notNull: false;
6208
+ hasDefault: false;
6209
+ isPrimaryKey: false;
6210
+ isAutoincrement: false;
6211
+ hasRuntimeDefault: false;
6212
+ enumValues: undefined;
6213
+ baseColumn: never;
6214
+ identity: undefined;
6215
+ generated: undefined;
6216
+ }, {}, {
6217
+ $type: string[] | null;
6218
+ }>;
6200
6219
  createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
6201
6220
  name: "created_at";
6202
6221
  tableName: "agent_tool_relations";
@@ -6244,6 +6263,7 @@ declare const AgentToolRelationInsertSchema: z$1.ZodObject<{
6244
6263
  id: z$1.ZodString;
6245
6264
  agentId: z$1.ZodString;
6246
6265
  toolId: z$1.ZodString;
6266
+ selectedTools: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodString>>>;
6247
6267
  }, {
6248
6268
  out: {};
6249
6269
  in: {};
@@ -6256,6 +6276,7 @@ declare const AgentToolRelationUpdateSchema: z$1.ZodObject<{
6256
6276
  id: z$1.ZodOptional<z$1.ZodString>;
6257
6277
  agentId: z$1.ZodOptional<z$1.ZodString>;
6258
6278
  toolId: z$1.ZodOptional<z$1.ZodString>;
6279
+ selectedTools: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodString>>>>;
6259
6280
  }, {
6260
6281
  out: {};
6261
6282
  in: {};
@@ -6264,6 +6285,7 @@ declare const AgentToolRelationApiSelectSchema: z$1.ZodObject<{
6264
6285
  id: z$1.ZodString;
6265
6286
  createdAt: z$1.ZodString;
6266
6287
  updatedAt: z$1.ZodString;
6288
+ selectedTools: z$1.ZodNullable<z$1.ZodType<drizzle_zod.Json, unknown, z$1.core.$ZodTypeInternals<drizzle_zod.Json, unknown>>>;
6267
6289
  agentId: z$1.ZodString;
6268
6290
  toolId: z$1.ZodString;
6269
6291
  }, z$1.core.$strip>;
@@ -6271,6 +6293,7 @@ declare const AgentToolRelationApiInsertSchema: z$1.ZodObject<{
6271
6293
  id: z$1.ZodString;
6272
6294
  createdAt: z$1.ZodOptional<z$1.ZodString>;
6273
6295
  updatedAt: z$1.ZodOptional<z$1.ZodString>;
6296
+ selectedTools: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodString>>>;
6274
6297
  agentId: z$1.ZodString;
6275
6298
  toolId: z$1.ZodString;
6276
6299
  }, z$1.core.$strip>;
@@ -6278,6 +6301,7 @@ declare const AgentToolRelationApiUpdateSchema: z$1.ZodObject<{
6278
6301
  id: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
6279
6302
  createdAt: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>>;
6280
6303
  updatedAt: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>>;
6304
+ selectedTools: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodString>>>>>;
6281
6305
  agentId: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
6282
6306
  toolId: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
6283
6307
  }, z$1.core.$strip>;
@@ -7060,6 +7084,7 @@ declare const FullGraphAgentInsertSchema: z$1.ZodObject<{
7060
7084
  }>>>>;
7061
7085
  conversationHistoryConfig: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z$1.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
7062
7086
  tools: z$1.ZodArray<z$1.ZodString>;
7087
+ selectedTools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
7063
7088
  dataComponents: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
7064
7089
  artifactComponents: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
7065
7090
  canTransferTo: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
@@ -7105,6 +7130,7 @@ declare const FullGraphDefinitionSchema: z$1.ZodObject<{
7105
7130
  }>>>>;
7106
7131
  conversationHistoryConfig: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z$1.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
7107
7132
  tools: z$1.ZodArray<z$1.ZodString>;
7133
+ selectedTools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
7108
7134
  dataComponents: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
7109
7135
  artifactComponents: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
7110
7136
  canTransferTo: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
@@ -7846,6 +7872,7 @@ type FullGraphDefinition = z.infer<typeof FullGraphDefinitionSchema>;
7846
7872
  type FullGraphAgentInsert = z.infer<typeof FullGraphAgentInsertSchema>;
7847
7873
  type InternalAgentDefinition = z.infer<typeof AgentApiInsertSchema> & {
7848
7874
  tools: string[];
7875
+ selectedTools?: Record<string, string[]>;
7849
7876
  dataComponents?: string[];
7850
7877
  artifactComponents?: string[];
7851
7878
  canTransferTo?: string[];
@@ -6197,6 +6197,25 @@ declare const AgentToolRelationSelectSchema: drizzle_zod.BuildSchema<"select", {
6197
6197
  }, {}, {
6198
6198
  length: number | undefined;
6199
6199
  }>;
6200
+ selectedTools: drizzle_orm_sqlite_core.SQLiteColumn<{
6201
+ name: "selected_tools";
6202
+ tableName: "agent_tool_relations";
6203
+ dataType: "json";
6204
+ columnType: "SQLiteBlobJson";
6205
+ data: string[] | null;
6206
+ driverParam: Buffer<ArrayBufferLike>;
6207
+ notNull: false;
6208
+ hasDefault: false;
6209
+ isPrimaryKey: false;
6210
+ isAutoincrement: false;
6211
+ hasRuntimeDefault: false;
6212
+ enumValues: undefined;
6213
+ baseColumn: never;
6214
+ identity: undefined;
6215
+ generated: undefined;
6216
+ }, {}, {
6217
+ $type: string[] | null;
6218
+ }>;
6200
6219
  createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
6201
6220
  name: "created_at";
6202
6221
  tableName: "agent_tool_relations";
@@ -6244,6 +6263,7 @@ declare const AgentToolRelationInsertSchema: z$1.ZodObject<{
6244
6263
  id: z$1.ZodString;
6245
6264
  agentId: z$1.ZodString;
6246
6265
  toolId: z$1.ZodString;
6266
+ selectedTools: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodString>>>;
6247
6267
  }, {
6248
6268
  out: {};
6249
6269
  in: {};
@@ -6256,6 +6276,7 @@ declare const AgentToolRelationUpdateSchema: z$1.ZodObject<{
6256
6276
  id: z$1.ZodOptional<z$1.ZodString>;
6257
6277
  agentId: z$1.ZodOptional<z$1.ZodString>;
6258
6278
  toolId: z$1.ZodOptional<z$1.ZodString>;
6279
+ selectedTools: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodString>>>>;
6259
6280
  }, {
6260
6281
  out: {};
6261
6282
  in: {};
@@ -6264,6 +6285,7 @@ declare const AgentToolRelationApiSelectSchema: z$1.ZodObject<{
6264
6285
  id: z$1.ZodString;
6265
6286
  createdAt: z$1.ZodString;
6266
6287
  updatedAt: z$1.ZodString;
6288
+ selectedTools: z$1.ZodNullable<z$1.ZodType<drizzle_zod.Json, unknown, z$1.core.$ZodTypeInternals<drizzle_zod.Json, unknown>>>;
6267
6289
  agentId: z$1.ZodString;
6268
6290
  toolId: z$1.ZodString;
6269
6291
  }, z$1.core.$strip>;
@@ -6271,6 +6293,7 @@ declare const AgentToolRelationApiInsertSchema: z$1.ZodObject<{
6271
6293
  id: z$1.ZodString;
6272
6294
  createdAt: z$1.ZodOptional<z$1.ZodString>;
6273
6295
  updatedAt: z$1.ZodOptional<z$1.ZodString>;
6296
+ selectedTools: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodString>>>;
6274
6297
  agentId: z$1.ZodString;
6275
6298
  toolId: z$1.ZodString;
6276
6299
  }, z$1.core.$strip>;
@@ -6278,6 +6301,7 @@ declare const AgentToolRelationApiUpdateSchema: z$1.ZodObject<{
6278
6301
  id: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
6279
6302
  createdAt: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>>;
6280
6303
  updatedAt: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>>;
6304
+ selectedTools: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodOptional<z$1.ZodNullable<z$1.ZodArray<z$1.ZodString>>>>>;
6281
6305
  agentId: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
6282
6306
  toolId: z$1.ZodOptional<z$1.ZodOptional<z$1.ZodString>>;
6283
6307
  }, z$1.core.$strip>;
@@ -7060,6 +7084,7 @@ declare const FullGraphAgentInsertSchema: z$1.ZodObject<{
7060
7084
  }>>>>;
7061
7085
  conversationHistoryConfig: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z$1.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
7062
7086
  tools: z$1.ZodArray<z$1.ZodString>;
7087
+ selectedTools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
7063
7088
  dataComponents: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
7064
7089
  artifactComponents: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
7065
7090
  canTransferTo: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
@@ -7105,6 +7130,7 @@ declare const FullGraphDefinitionSchema: z$1.ZodObject<{
7105
7130
  }>>>>;
7106
7131
  conversationHistoryConfig: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodType<ConversationHistoryConfig, ConversationHistoryConfig, z$1.core.$ZodTypeInternals<ConversationHistoryConfig, ConversationHistoryConfig>>>>;
7107
7132
  tools: z$1.ZodArray<z$1.ZodString>;
7133
+ selectedTools: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodArray<z$1.ZodString>>>;
7108
7134
  dataComponents: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
7109
7135
  artifactComponents: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
7110
7136
  canTransferTo: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
@@ -7846,6 +7872,7 @@ type FullGraphDefinition = z.infer<typeof FullGraphDefinitionSchema>;
7846
7872
  type FullGraphAgentInsert = z.infer<typeof FullGraphAgentInsertSchema>;
7847
7873
  type InternalAgentDefinition = z.infer<typeof AgentApiInsertSchema> & {
7848
7874
  tools: string[];
7875
+ selectedTools?: Record<string, string[]>;
7849
7876
  dataComponents?: string[];
7850
7877
  artifactComponents?: string[];
7851
7878
  canTransferTo?: string[];
package/dist/index.cjs CHANGED
@@ -512,6 +512,7 @@ var agentToolRelations = sqliteCore.sqliteTable(
512
512
  id: sqliteCore.text("id").notNull(),
513
513
  agentId: sqliteCore.text("agent_id").notNull(),
514
514
  toolId: sqliteCore.text("tool_id").notNull(),
515
+ selectedTools: sqliteCore.blob("selected_tools", { mode: "json" }).$type(),
515
516
  createdAt: sqliteCore.text("created_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`),
516
517
  updatedAt: sqliteCore.text("updated_at").notNull().default(drizzleOrm.sql`CURRENT_TIMESTAMP`)
517
518
  },
@@ -1378,7 +1379,8 @@ var AgentToolRelationSelectSchema = drizzleZod.createSelectSchema(agentToolRelat
1378
1379
  var AgentToolRelationInsertSchema = drizzleZod.createInsertSchema(agentToolRelations).extend({
1379
1380
  id: resourceIdSchema,
1380
1381
  agentId: resourceIdSchema,
1381
- toolId: resourceIdSchema
1382
+ toolId: resourceIdSchema,
1383
+ selectedTools: zodOpenapi.z.array(zodOpenapi.z.string()).nullish()
1382
1384
  });
1383
1385
  var AgentToolRelationUpdateSchema = AgentToolRelationInsertSchema.partial();
1384
1386
  var AgentToolRelationApiSelectSchema = createApiSchema(AgentToolRelationSelectSchema);
@@ -1412,6 +1414,7 @@ var StatusUpdateSchema = zodOpenapi.z.object({
1412
1414
  });
1413
1415
  var FullGraphAgentInsertSchema = AgentApiInsertSchema.extend({
1414
1416
  tools: zodOpenapi.z.array(zodOpenapi.z.string()),
1417
+ selectedTools: zodOpenapi.z.record(zodOpenapi.z.string(), zodOpenapi.z.array(zodOpenapi.z.string())).optional(),
1415
1418
  dataComponents: zodOpenapi.z.array(zodOpenapi.z.string()).optional(),
1416
1419
  artifactComponents: zodOpenapi.z.array(zodOpenapi.z.string()).optional(),
1417
1420
  canTransferTo: zodOpenapi.z.array(zodOpenapi.z.string()).optional(),
@@ -2164,7 +2167,7 @@ var CredentialStuffer = class {
2164
2167
  /**
2165
2168
  * Build MCP server configuration with credentials
2166
2169
  */
2167
- async buildMcpServerConfig(context, tool2, storeReference) {
2170
+ async buildMcpServerConfig(context, tool2, storeReference, selectedTools) {
2168
2171
  let credentialHeaders = {};
2169
2172
  if (storeReference || tool2.headers) {
2170
2173
  credentialHeaders = await this.getCredentialHeaders({
@@ -2177,7 +2180,8 @@ var CredentialStuffer = class {
2177
2180
  const baseConfig = {
2178
2181
  type: tool2.transport?.type || MCPTransportType.streamableHttp,
2179
2182
  url: tool2.serverUrl,
2180
- activeTools: tool2.activeTools
2183
+ activeTools: tool2.activeTools,
2184
+ selectedTools
2181
2185
  };
2182
2186
  if (baseConfig.type === MCPTransportType.streamableHttp || baseConfig.type === MCPTransportType.sse) {
2183
2187
  const httpConfig = {
@@ -2445,7 +2449,8 @@ var createAgentToolRelation = (db) => async (params) => {
2445
2449
  tenantId: params.scopes.tenantId,
2446
2450
  projectId: params.scopes.projectId,
2447
2451
  agentId: params.data.agentId,
2448
- toolId: params.data.toolId
2452
+ toolId: params.data.toolId,
2453
+ selectedTools: params.data.selectedTools
2449
2454
  }).returning();
2450
2455
  return relation[0];
2451
2456
  };
@@ -2600,6 +2605,7 @@ var getToolsForAgent = (db) => async (params) => {
2600
2605
  tenantId: agentToolRelations.tenantId,
2601
2606
  agentId: agentToolRelations.agentId,
2602
2607
  toolId: agentToolRelations.toolId,
2608
+ selectedTools: agentToolRelations.selectedTools,
2603
2609
  createdAt: agentToolRelations.createdAt,
2604
2610
  updatedAt: agentToolRelations.updatedAt,
2605
2611
  tool: {
@@ -2647,6 +2653,7 @@ var getAgentsForTool = (db) => async (params) => {
2647
2653
  tenantId: agentToolRelations.tenantId,
2648
2654
  agentId: agentToolRelations.agentId,
2649
2655
  toolId: agentToolRelations.toolId,
2656
+ selectedTools: agentToolRelations.selectedTools,
2650
2657
  createdAt: agentToolRelations.createdAt,
2651
2658
  updatedAt: agentToolRelations.updatedAt,
2652
2659
  agent: {
@@ -3346,7 +3353,8 @@ var getFullGraphDefinition = (db) => async ({
3346
3353
  lastHealthCheck: tools.lastHealthCheck,
3347
3354
  lastError: tools.lastError,
3348
3355
  availableTools: tools.availableTools,
3349
- lastToolsSync: tools.lastToolsSync
3356
+ lastToolsSync: tools.lastToolsSync,
3357
+ selectedTools: agentToolRelations.selectedTools
3350
3358
  }).from(agentToolRelations).innerJoin(tools, drizzleOrm.eq(agentToolRelations.toolId, tools.id)).where(
3351
3359
  drizzleOrm.and(drizzleOrm.eq(agentToolRelations.tenantId, tenantId), drizzleOrm.eq(agentToolRelations.agentId, agentId))
3352
3360
  );
@@ -3366,6 +3374,12 @@ var getFullGraphDefinition = (db) => async ({
3366
3374
  const agentArtifactComponentIds = agentArtifactComponentRelations.map(
3367
3375
  (rel) => rel.artifactComponentId
3368
3376
  );
3377
+ const selectedTools = {};
3378
+ agentTools.forEach((tool2) => {
3379
+ if (tool2.selectedTools && Array.isArray(tool2.selectedTools)) {
3380
+ selectedTools[tool2.id] = tool2.selectedTools;
3381
+ }
3382
+ });
3369
3383
  return {
3370
3384
  id: agent.id,
3371
3385
  name: agent.name,
@@ -3377,6 +3391,7 @@ var getFullGraphDefinition = (db) => async ({
3377
3391
  canDelegateTo,
3378
3392
  dataComponents: agentDataComponentIds,
3379
3393
  artifactComponents: agentArtifactComponentIds,
3394
+ ...Object.keys(selectedTools).length > 0 && { selectedTools },
3380
3395
  tools: agentTools.map((tool2) => ({
3381
3396
  id: tool2.id,
3382
3397
  name: tool2.name,
@@ -3425,14 +3440,19 @@ var getFullGraphDefinition = (db) => async ({
3425
3440
  } else {
3426
3441
  const toolsData = agent.tools || [];
3427
3442
  const toolIds = [];
3443
+ const agentSelectedTools = {};
3428
3444
  for (const tool2 of toolsData) {
3429
3445
  toolsObject[tool2.id] = tool2;
3430
3446
  toolIds.push(tool2.id);
3447
+ if (tool2.selectedTools !== null && tool2.selectedTools !== void 0) {
3448
+ agentSelectedTools[tool2.id] = tool2.selectedTools;
3449
+ }
3431
3450
  }
3432
3451
  agentsObject[agent.id] = {
3433
3452
  ...agent,
3434
- tools: toolIds
3453
+ tools: toolIds,
3435
3454
  // Replace tool objects with tool IDs
3455
+ ...Object.keys(agentSelectedTools).length > 0 && { selectedTools: agentSelectedTools }
3436
3456
  };
3437
3457
  }
3438
3458
  }
@@ -4958,6 +4978,7 @@ var addToolToAgent = (db) => async (params) => {
4958
4978
  projectId: params.scopes.projectId,
4959
4979
  agentId: params.agentId,
4960
4980
  toolId: params.toolId,
4981
+ selectedTools: params.selectedTools,
4961
4982
  createdAt: now,
4962
4983
  updatedAt: now
4963
4984
  }).returning();
@@ -4986,7 +5007,15 @@ var upsertAgentToolRelation = (db) => async (params) => {
4986
5007
  if (!existing) {
4987
5008
  return await addToolToAgent(db)(params);
4988
5009
  }
4989
- return existing;
5010
+ return await updateAgentToolRelation(db)({
5011
+ scopes: params.scopes,
5012
+ relationId: existing.id,
5013
+ data: {
5014
+ agentId: params.agentId,
5015
+ toolId: params.toolId,
5016
+ selectedTools: params.selectedTools
5017
+ }
5018
+ });
4990
5019
  };
4991
5020
  var updateToolStatus = (db) => async (params) => {
4992
5021
  return updateTool(db)({
@@ -5344,11 +5373,13 @@ var createFullGraphServerSide = (db, logger11 = defaultLogger) => async (scopes,
5344
5373
  agentToolPromises.push(
5345
5374
  (async () => {
5346
5375
  try {
5376
+ const selectedTools = agentData.selectedTools?.[toolId];
5347
5377
  logger11.info({ agentId, toolId }, "Processing agent-tool relation");
5348
5378
  await upsertAgentToolRelation(db)({
5349
5379
  scopes: { tenantId, projectId },
5350
5380
  agentId,
5351
- toolId
5381
+ toolId,
5382
+ selectedTools
5352
5383
  });
5353
5384
  logger11.info({ agentId, toolId }, "Agent-tool relation processed successfully");
5354
5385
  } catch (error) {
@@ -5816,11 +5847,13 @@ var updateFullGraphServerSide = (db, logger11 = defaultLogger) => async (scopes,
5816
5847
  agentToolPromises.push(
5817
5848
  (async () => {
5818
5849
  try {
5850
+ const selectedTools = agentData.selectedTools?.[toolId];
5819
5851
  await createAgentToolRelation(db)({
5820
5852
  scopes: { tenantId, projectId },
5821
5853
  data: {
5822
5854
  agentId,
5823
- toolId
5855
+ toolId,
5856
+ selectedTools
5824
5857
  }
5825
5858
  });
5826
5859
  logger11.info({ agentId, toolId }, "Agent-tool relation created");
@@ -7044,11 +7077,18 @@ var McpClient = class {
7044
7077
  }
7045
7078
  async selectTools() {
7046
7079
  const { tools: tools2 } = await this.client.listTools({ timeout: this.timeout });
7047
- const { activeTools } = this.serverConfig;
7048
- if (!activeTools) return tools2;
7080
+ const { selectedTools, activeTools } = this.serverConfig;
7081
+ let toolsToFilter;
7082
+ if (selectedTools && selectedTools.length > 0) {
7083
+ toolsToFilter = selectedTools;
7084
+ } else if (activeTools && activeTools.length > 0) {
7085
+ toolsToFilter = activeTools;
7086
+ } else {
7087
+ return tools2;
7088
+ }
7049
7089
  const toolNames = tools2.map((tool2) => tool2.name);
7050
- this.validateSelectedTools(toolNames, activeTools);
7051
- return tools2.filter((tool2) => activeTools.includes(tool2.name));
7090
+ this.validateSelectedTools(toolNames, toolsToFilter);
7091
+ return tools2.filter((tool2) => toolsToFilter.includes(tool2.name));
7052
7092
  }
7053
7093
  async tools() {
7054
7094
  const tools2 = await this.selectTools();