@inkeep/agents-cli 0.0.0-dev-20251010165126 → 0.0.0-dev-20251010180500

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +247 -140
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -21,11 +21,11 @@ var __export = (target, all) => {
21
21
  for (var name in all)
22
22
  __defProp(target, name, { get: all[name], enumerable: true });
23
23
  };
24
- var __copyProps = (to, from, except, desc14) => {
24
+ var __copyProps = (to, from, except, desc15) => {
25
25
  if (from && typeof from === "object" || typeof from === "function") {
26
26
  for (let key of __getOwnPropNames(from))
27
27
  if (!__hasOwnProp.call(to, key) && key !== except)
28
- __defProp(to, key, { get: () => from[key], enumerable: !(desc14 = __getOwnPropDesc(from, key)) || desc14.enumerable });
28
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc15 = __getOwnPropDesc(from, key)) || desc15.enumerable });
29
29
  }
30
30
  return to;
31
31
  };
@@ -330,22 +330,22 @@ var init_logger = __esm({
330
330
  */
331
331
  getLogger(name) {
332
332
  if (this.loggers.has(name)) {
333
- const logger15 = this.loggers.get(name);
334
- if (!logger15) {
333
+ const logger16 = this.loggers.get(name);
334
+ if (!logger16) {
335
335
  throw new Error(`Logger '${name}' not found in cache`);
336
336
  }
337
- return logger15;
337
+ return logger16;
338
338
  }
339
- let logger14;
339
+ let logger15;
340
340
  if (this.config.loggerFactory) {
341
- logger14 = this.config.loggerFactory(name);
341
+ logger15 = this.config.loggerFactory(name);
342
342
  } else if (this.config.defaultLogger) {
343
- logger14 = this.config.defaultLogger;
343
+ logger15 = this.config.defaultLogger;
344
344
  } else {
345
- logger14 = new PinoLogger(name, this.config.pinoConfig);
345
+ logger15 = new PinoLogger(name, this.config.pinoConfig);
346
346
  }
347
- this.loggers.set(name, logger14);
348
- return logger14;
347
+ this.loggers.set(name, logger15);
348
+ return logger15;
349
349
  }
350
350
  /**
351
351
  * Reset factory to default state
@@ -1539,7 +1539,7 @@ import {
1539
1539
  text,
1540
1540
  unique
1541
1541
  } from "drizzle-orm/sqlite-core";
1542
- var tenantScoped, projectScoped, graphScoped, subAgentScoped, uiProperties, timestamps, projects, agentGraph, contextConfigs, contextCache, subAgents, subAgentRelations, externalAgents, tasks, taskRelations, dataComponents, subAgentDataComponents, artifactComponents, subAgentArtifactComponents, tools, functions, subAgentToolRelations, conversations, messages, ledgerArtifacts, apiKeys, credentialReferences, tasksRelations, projectsRelations, taskRelationsRelations, contextConfigsRelations, contextCacheRelations, subAgentsRelations, agentGraphRelations, externalAgentsRelations, apiKeysRelations, agentToolRelationsRelations, credentialReferencesRelations, toolsRelations, conversationsRelations, messagesRelations, artifactComponentsRelations, subAgentArtifactComponentsRelations, dataComponentsRelations, subAgentDataComponentsRelations, ledgerArtifactsRelations, functionsRelations, subAgentRelationsRelations;
1542
+ var tenantScoped, projectScoped, graphScoped, subAgentScoped, uiProperties, timestamps, projects, agentGraph, contextConfigs, contextCache, subAgents, subAgentRelations, externalAgents, tasks, taskRelations, dataComponents, subAgentDataComponents, artifactComponents, subAgentArtifactComponents, tools, functionTools, functions, subAgentToolRelations, agentFunctionToolRelations, conversations, messages, ledgerArtifacts, apiKeys, credentialReferences, tasksRelations, projectsRelations, taskRelationsRelations, contextConfigsRelations, contextCacheRelations, subAgentsRelations, agentGraphRelations, externalAgentsRelations, apiKeysRelations, agentToolRelationsRelations, credentialReferencesRelations, toolsRelations, conversationsRelations, messagesRelations, artifactComponentsRelations, subAgentArtifactComponentsRelations, dataComponentsRelations, subAgentDataComponentsRelations, ledgerArtifactsRelations, functionsRelations, subAgentRelationsRelations, functionToolsRelations, agentFunctionToolRelationsRelations;
1543
1543
  var init_schema = __esm({
1544
1544
  "../packages/agents-core/src/db/schema.ts"() {
1545
1545
  "use strict";
@@ -1870,10 +1870,7 @@ var init_schema = __esm({
1870
1870
  ...projectScoped,
1871
1871
  name: text("name").notNull(),
1872
1872
  description: text("description"),
1873
- // Tool configuration - supports both MCP and function tools
1874
1873
  config: blob("config", { mode: "json" }).$type().notNull(),
1875
- // For function tools, reference the global functions table
1876
- functionId: text("function_id"),
1877
1874
  credentialReferenceId: text("credential_reference_id"),
1878
1875
  headers: blob("headers", { mode: "json" }).$type(),
1879
1876
  // Image URL for custom tool icon (supports regular URLs and base64 encoded images)
@@ -1889,12 +1886,30 @@ var init_schema = __esm({
1889
1886
  columns: [table.tenantId, table.projectId],
1890
1887
  foreignColumns: [projects.tenantId, projects.id],
1891
1888
  name: "tools_project_fk"
1889
+ }).onDelete("cascade")
1890
+ ]
1891
+ );
1892
+ functionTools = sqliteTable(
1893
+ "function_tools",
1894
+ {
1895
+ ...graphScoped,
1896
+ name: text("name").notNull(),
1897
+ description: text("description"),
1898
+ functionId: text("function_id").notNull(),
1899
+ ...timestamps
1900
+ },
1901
+ (table) => [
1902
+ primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
1903
+ foreignKey({
1904
+ columns: [table.tenantId, table.projectId, table.graphId],
1905
+ foreignColumns: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id],
1906
+ name: "function_tools_graph_fk"
1892
1907
  }).onDelete("cascade"),
1893
- // Foreign key constraint to functions table (for function tools)
1908
+ // Foreign key constraint to functions table
1894
1909
  foreignKey({
1895
1910
  columns: [table.tenantId, table.projectId, table.functionId],
1896
1911
  foreignColumns: [functions.tenantId, functions.projectId, functions.id],
1897
- name: "tools_function_fk"
1912
+ name: "function_tools_function_fk"
1898
1913
  }).onDelete("cascade")
1899
1914
  ]
1900
1915
  );
@@ -1933,7 +1948,7 @@ var init_schema = __esm({
1933
1948
  foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
1934
1949
  name: "sub_agent_tool_relations_agent_fk"
1935
1950
  }).onDelete("cascade"),
1936
- // Foreign key constraint to tools table
1951
+ // Foreign key constraint to tools table (MCP tools)
1937
1952
  foreignKey({
1938
1953
  columns: [table.tenantId, table.projectId, table.toolId],
1939
1954
  foreignColumns: [tools.tenantId, tools.projectId, tools.id],
@@ -1941,6 +1956,34 @@ var init_schema = __esm({
1941
1956
  }).onDelete("cascade")
1942
1957
  ]
1943
1958
  );
1959
+ agentFunctionToolRelations = sqliteTable(
1960
+ "agent_function_tool_relations",
1961
+ {
1962
+ ...subAgentScoped,
1963
+ functionToolId: text("function_tool_id").notNull(),
1964
+ ...timestamps
1965
+ },
1966
+ (table) => [
1967
+ primaryKey({ columns: [table.tenantId, table.projectId, table.graphId, table.id] }),
1968
+ // Foreign key constraint to agents table
1969
+ foreignKey({
1970
+ columns: [table.tenantId, table.projectId, table.graphId, table.subAgentId],
1971
+ foreignColumns: [subAgents.tenantId, subAgents.projectId, subAgents.graphId, subAgents.id],
1972
+ name: "agent_function_tool_relations_agent_fk"
1973
+ }).onDelete("cascade"),
1974
+ // Foreign key constraint to functionTools table
1975
+ foreignKey({
1976
+ columns: [table.tenantId, table.projectId, table.graphId, table.functionToolId],
1977
+ foreignColumns: [
1978
+ functionTools.tenantId,
1979
+ functionTools.projectId,
1980
+ functionTools.graphId,
1981
+ functionTools.id
1982
+ ],
1983
+ name: "agent_function_tool_relations_function_tool_fk"
1984
+ }).onDelete("cascade")
1985
+ ]
1986
+ );
1944
1987
  conversations = sqliteTable(
1945
1988
  "conversations",
1946
1989
  {
@@ -2126,6 +2169,7 @@ var init_schema = __esm({
2126
2169
  subAgents: many(subAgents),
2127
2170
  agentGraphs: many(agentGraph),
2128
2171
  tools: many(tools),
2172
+ functions: many(functions),
2129
2173
  contextConfigs: many(contextConfigs),
2130
2174
  externalAgents: many(externalAgents),
2131
2175
  conversations: many(conversations),
@@ -2184,10 +2228,11 @@ var init_schema = __esm({
2184
2228
  relationName: "associatedAgent"
2185
2229
  }),
2186
2230
  toolRelations: many(subAgentToolRelations),
2231
+ functionToolRelations: many(agentFunctionToolRelations),
2187
2232
  dataComponentRelations: many(subAgentDataComponents),
2188
2233
  artifactComponentRelations: many(subAgentArtifactComponents)
2189
2234
  }));
2190
- agentGraphRelations = relations(agentGraph, ({ one }) => ({
2235
+ agentGraphRelations = relations(agentGraph, ({ one, many }) => ({
2191
2236
  project: one(projects, {
2192
2237
  fields: [agentGraph.tenantId, agentGraph.projectId],
2193
2238
  references: [projects.tenantId, projects.id]
@@ -2199,7 +2244,8 @@ var init_schema = __esm({
2199
2244
  contextConfig: one(contextConfigs, {
2200
2245
  fields: [agentGraph.contextConfigId],
2201
2246
  references: [contextConfigs.id]
2202
- })
2247
+ }),
2248
+ functionTools: many(functionTools)
2203
2249
  }));
2204
2250
  externalAgentsRelations = relations(externalAgents, ({ one, many }) => ({
2205
2251
  project: one(projects, {
@@ -2244,10 +2290,6 @@ var init_schema = __esm({
2244
2290
  credentialReference: one(credentialReferences, {
2245
2291
  fields: [tools.credentialReferenceId],
2246
2292
  references: [credentialReferences.id]
2247
- }),
2248
- function: one(functions, {
2249
- fields: [tools.functionId],
2250
- references: [functions.id]
2251
2293
  })
2252
2294
  }));
2253
2295
  conversationsRelations = relations(conversations, ({ one, many }) => ({
@@ -2347,7 +2389,7 @@ var init_schema = __esm({
2347
2389
  })
2348
2390
  }));
2349
2391
  functionsRelations = relations(functions, ({ many }) => ({
2350
- tools: many(tools)
2392
+ functionTools: many(functionTools)
2351
2393
  }));
2352
2394
  subAgentRelationsRelations = relations(subAgentRelations, ({ one }) => ({
2353
2395
  graph: one(agentGraph, {
@@ -2369,6 +2411,34 @@ var init_schema = __esm({
2369
2411
  references: [externalAgents.id]
2370
2412
  })
2371
2413
  }));
2414
+ functionToolsRelations = relations(functionTools, ({ one, many }) => ({
2415
+ project: one(projects, {
2416
+ fields: [functionTools.tenantId, functionTools.projectId],
2417
+ references: [projects.tenantId, projects.id]
2418
+ }),
2419
+ graph: one(agentGraph, {
2420
+ fields: [functionTools.tenantId, functionTools.projectId, functionTools.graphId],
2421
+ references: [agentGraph.tenantId, agentGraph.projectId, agentGraph.id]
2422
+ }),
2423
+ function: one(functions, {
2424
+ fields: [functionTools.tenantId, functionTools.projectId, functionTools.functionId],
2425
+ references: [functions.tenantId, functions.projectId, functions.id]
2426
+ }),
2427
+ agentRelations: many(agentFunctionToolRelations)
2428
+ }));
2429
+ agentFunctionToolRelationsRelations = relations(
2430
+ agentFunctionToolRelations,
2431
+ ({ one }) => ({
2432
+ agent: one(subAgents, {
2433
+ fields: [agentFunctionToolRelations.subAgentId],
2434
+ references: [subAgents.id]
2435
+ }),
2436
+ functionTool: one(functionTools, {
2437
+ fields: [agentFunctionToolRelations.functionToolId],
2438
+ references: [functionTools.id]
2439
+ })
2440
+ })
2441
+ );
2372
2442
  }
2373
2443
  });
2374
2444
 
@@ -2397,7 +2467,7 @@ var init_utility = __esm({
2397
2467
  });
2398
2468
 
2399
2469
  // ../packages/agents-core/src/validation/schemas.ts
2400
- var StopWhenSchema, GraphStopWhenSchema, SubAgentStopWhenSchema, MIN_ID_LENGTH, MAX_ID_LENGTH, URL_SAFE_ID_PATTERN, resourceIdSchema, ModelSettingsSchema, ModelSchema, ProjectModelSchema, SandboxConfigSchema, FunctionToolConfigSchema, createApiSchema, createApiInsertSchema, createApiUpdateSchema, createGraphScopedApiSchema, createGraphScopedApiInsertSchema, createGraphScopedApiUpdateSchema, SubAgentSelectSchema, SubAgentInsertSchema, SubAgentUpdateSchema, SubAgentApiSelectSchema, SubAgentApiInsertSchema, SubAgentApiUpdateSchema, SubAgentRelationSelectSchema, SubAgentRelationInsertSchema, SubAgentRelationUpdateSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiInsertSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationQuerySchema, ExternalSubAgentRelationInsertSchema, ExternalSubAgentRelationApiInsertSchema, AgentGraphSelectSchema, AgentGraphInsertSchema, AgentGraphUpdateSchema, AgentGraphApiSelectSchema, AgentGraphApiInsertSchema, AgentGraphApiUpdateSchema, TaskSelectSchema, TaskInsertSchema, TaskUpdateSchema, TaskApiSelectSchema, TaskApiInsertSchema, TaskApiUpdateSchema, TaskRelationSelectSchema, TaskRelationInsertSchema, TaskRelationUpdateSchema, TaskRelationApiSelectSchema, TaskRelationApiInsertSchema, TaskRelationApiUpdateSchema, imageUrlSchema, McpTransportConfigSchema, ToolStatusSchema, McpToolDefinitionSchema, ToolSelectSchema, ToolInsertSchema, ConversationSelectSchema, ConversationInsertSchema, ConversationUpdateSchema, ConversationApiSelectSchema, ConversationApiInsertSchema, ConversationApiUpdateSchema, MessageSelectSchema, MessageInsertSchema, MessageUpdateSchema, MessageApiSelectSchema, MessageApiInsertSchema, MessageApiUpdateSchema, ContextCacheSelectSchema, ContextCacheInsertSchema, ContextCacheUpdateSchema, ContextCacheApiSelectSchema, ContextCacheApiInsertSchema, ContextCacheApiUpdateSchema, DataComponentSelectSchema, DataComponentInsertSchema, DataComponentBaseSchema, DataComponentUpdateSchema, DataComponentApiSelectSchema, DataComponentApiInsertSchema, DataComponentApiUpdateSchema, SubAgentDataComponentSelectSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentUpdateSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiUpdateSchema, ArtifactComponentSelectSchema, ArtifactComponentInsertSchema, ArtifactComponentUpdateSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiUpdateSchema, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentUpdateSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiUpdateSchema, ExternalAgentSelectSchema, ExternalAgentInsertSchema, ExternalAgentUpdateSchema, ExternalAgentApiSelectSchema, ExternalAgentApiInsertSchema, ExternalAgentApiUpdateSchema, AllAgentSchema, ApiKeySelectSchema, ApiKeyInsertSchema, ApiKeyUpdateSchema, ApiKeyApiSelectSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceInsertSchema, CredentialReferenceUpdateSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiUpdateSchema, McpToolSchema, MCPToolConfigSchema, ToolUpdateSchema, ToolApiSelectSchema, ToolApiInsertSchema, ToolApiUpdateSchema, FunctionSelectSchema, FunctionInsertSchema, FunctionUpdateSchema, FunctionApiSelectSchema, FunctionApiInsertSchema, FunctionApiUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, ContextConfigSelectSchema, ContextConfigInsertSchema, ContextConfigUpdateSchema, ContextConfigApiSelectSchema, ContextConfigApiInsertSchema, ContextConfigApiUpdateSchema, SubAgentToolRelationSelectSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationUpdateSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiUpdateSchema, LedgerArtifactSelectSchema, LedgerArtifactInsertSchema, LedgerArtifactUpdateSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiUpdateSchema, StatusComponentSchema, StatusUpdateSchema, CanUseItemSchema, FullGraphAgentInsertSchema, GraphWithinContextOfProjectSchema, PaginationSchema, ErrorResponseSchema, ExistsResponseSchema, RemovedResponseSchema, ProjectSelectSchema, ProjectInsertSchema, ProjectUpdateSchema, ProjectApiSelectSchema, ProjectApiInsertSchema, ProjectApiUpdateSchema, FullProjectDefinitionSchema, HeadersScopeSchema, TenantId, ProjectId, GraphId, SubAgentId, TenantParamsSchema, TenantIdParamsSchema, TenantProjectParamsSchema, TenantProjectIdParamsSchema, TenantProjectGraphParamsSchema, TenantProjectGraphIdParamsSchema, TenantProjectGraphSubAgentParamsSchema, TenantProjectGraphSubAgentIdParamsSchema, PaginationQueryParamsSchema;
2470
+ var StopWhenSchema, GraphStopWhenSchema, SubAgentStopWhenSchema, MIN_ID_LENGTH, MAX_ID_LENGTH, URL_SAFE_ID_PATTERN, resourceIdSchema, ModelSettingsSchema, ModelSchema, ProjectModelSchema, SandboxConfigSchema, FunctionToolConfigSchema, createApiSchema, createApiInsertSchema, createApiUpdateSchema, createGraphScopedApiSchema, createGraphScopedApiInsertSchema, createGraphScopedApiUpdateSchema, SubAgentSelectSchema, SubAgentInsertSchema, SubAgentUpdateSchema, SubAgentApiSelectSchema, SubAgentApiInsertSchema, SubAgentApiUpdateSchema, SubAgentRelationSelectSchema, SubAgentRelationInsertSchema, SubAgentRelationUpdateSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiInsertSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationQuerySchema, ExternalSubAgentRelationInsertSchema, ExternalSubAgentRelationApiInsertSchema, AgentGraphSelectSchema, AgentGraphInsertSchema, AgentGraphUpdateSchema, AgentGraphApiSelectSchema, AgentGraphApiInsertSchema, AgentGraphApiUpdateSchema, TaskSelectSchema, TaskInsertSchema, TaskUpdateSchema, TaskApiSelectSchema, TaskApiInsertSchema, TaskApiUpdateSchema, TaskRelationSelectSchema, TaskRelationInsertSchema, TaskRelationUpdateSchema, TaskRelationApiSelectSchema, TaskRelationApiInsertSchema, TaskRelationApiUpdateSchema, imageUrlSchema, McpTransportConfigSchema, ToolStatusSchema, McpToolDefinitionSchema, ToolSelectSchema, ToolInsertSchema, ConversationSelectSchema, ConversationInsertSchema, ConversationUpdateSchema, ConversationApiSelectSchema, ConversationApiInsertSchema, ConversationApiUpdateSchema, MessageSelectSchema, MessageInsertSchema, MessageUpdateSchema, MessageApiSelectSchema, MessageApiInsertSchema, MessageApiUpdateSchema, ContextCacheSelectSchema, ContextCacheInsertSchema, ContextCacheUpdateSchema, ContextCacheApiSelectSchema, ContextCacheApiInsertSchema, ContextCacheApiUpdateSchema, DataComponentSelectSchema, DataComponentInsertSchema, DataComponentBaseSchema, DataComponentUpdateSchema, DataComponentApiSelectSchema, DataComponentApiInsertSchema, DataComponentApiUpdateSchema, SubAgentDataComponentSelectSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentUpdateSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiUpdateSchema, ArtifactComponentSelectSchema, ArtifactComponentInsertSchema, ArtifactComponentUpdateSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiUpdateSchema, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentUpdateSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiUpdateSchema, ExternalAgentSelectSchema, ExternalAgentInsertSchema, ExternalAgentUpdateSchema, ExternalAgentApiSelectSchema, ExternalAgentApiInsertSchema, ExternalAgentApiUpdateSchema, AllAgentSchema, ApiKeySelectSchema, ApiKeyInsertSchema, ApiKeyUpdateSchema, ApiKeyApiSelectSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, CredentialReferenceSelectSchema, CredentialReferenceInsertSchema, CredentialReferenceUpdateSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiUpdateSchema, McpToolSchema, MCPToolConfigSchema, ToolUpdateSchema, ToolApiSelectSchema, ToolApiInsertSchema, ToolApiUpdateSchema, FunctionToolSelectSchema, FunctionToolInsertSchema, FunctionToolUpdateSchema, FunctionToolApiSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiUpdateSchema, FunctionSelectSchema, FunctionInsertSchema, FunctionUpdateSchema, FunctionApiSelectSchema, FunctionApiInsertSchema, FunctionApiUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, ContextConfigSelectSchema, ContextConfigInsertSchema, ContextConfigUpdateSchema, ContextConfigApiSelectSchema, ContextConfigApiInsertSchema, ContextConfigApiUpdateSchema, SubAgentToolRelationSelectSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationUpdateSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiUpdateSchema, LedgerArtifactSelectSchema, LedgerArtifactInsertSchema, LedgerArtifactUpdateSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiUpdateSchema, StatusComponentSchema, StatusUpdateSchema, CanUseItemSchema, FullGraphAgentInsertSchema, FullGraphDefinitionSchema, GraphWithinContextOfProjectSchema, PaginationSchema, ErrorResponseSchema, ExistsResponseSchema, RemovedResponseSchema, ProjectSelectSchema, ProjectInsertSchema, ProjectUpdateSchema, ProjectApiSelectSchema, ProjectApiInsertSchema, ProjectApiUpdateSchema, FullProjectDefinitionSchema, HeadersScopeSchema, TenantId, ProjectId, GraphId, SubAgentId, TenantParamsSchema, TenantIdParamsSchema, TenantProjectParamsSchema, TenantProjectIdParamsSchema, TenantProjectGraphParamsSchema, TenantProjectGraphIdParamsSchema, TenantProjectGraphSubAgentParamsSchema, TenantProjectGraphSubAgentIdParamsSchema, PaginationQueryParamsSchema;
2401
2471
  var init_schemas = __esm({
2402
2472
  "../packages/agents-core/src/validation/schemas.ts"() {
2403
2473
  "use strict";
@@ -2587,32 +2657,22 @@ var init_schemas = __esm({
2587
2657
  ToolInsertSchema = createInsertSchema(tools).extend({
2588
2658
  id: resourceIdSchema,
2589
2659
  imageUrl: imageUrlSchema,
2590
- functionId: resourceIdSchema.optional(),
2591
- // For function tools, reference to global functions table
2592
- config: z2.discriminatedUnion("type", [
2593
- // MCP tools
2594
- z2.object({
2595
- type: z2.literal("mcp"),
2596
- mcp: z2.object({
2597
- server: z2.object({
2598
- url: z2.string().url()
2599
- }),
2600
- transport: z2.object({
2601
- type: z2.enum(MCPTransportType),
2602
- requestInit: z2.record(z2.string(), z2.unknown()).optional(),
2603
- eventSourceInit: z2.record(z2.string(), z2.unknown()).optional(),
2604
- reconnectionOptions: z2.custom().optional(),
2605
- sessionId: z2.string().optional()
2606
- }).optional(),
2607
- activeTools: z2.array(z2.string()).optional()
2608
- })
2609
- }),
2610
- // Function tools (reference-only, no inline duplication)
2611
- z2.object({
2612
- type: z2.literal("function")
2613
- // No inline function details - they're in the functions table via functionId
2660
+ config: z2.object({
2661
+ type: z2.literal("mcp"),
2662
+ mcp: z2.object({
2663
+ server: z2.object({
2664
+ url: z2.string().url()
2665
+ }),
2666
+ transport: z2.object({
2667
+ type: z2.enum(MCPTransportType),
2668
+ requestInit: z2.record(z2.string(), z2.unknown()).optional(),
2669
+ eventSourceInit: z2.record(z2.string(), z2.unknown()).optional(),
2670
+ reconnectionOptions: z2.custom().optional(),
2671
+ sessionId: z2.string().optional()
2672
+ }).optional(),
2673
+ activeTools: z2.array(z2.string()).optional()
2614
2674
  })
2615
- ])
2675
+ })
2616
2676
  });
2617
2677
  ConversationSelectSchema = createSelectSchema(conversations);
2618
2678
  ConversationInsertSchema = createInsertSchema(conversations).extend({
@@ -2821,6 +2881,14 @@ var init_schemas = __esm({
2821
2881
  ToolApiSelectSchema = createApiSchema(ToolSelectSchema);
2822
2882
  ToolApiInsertSchema = createApiInsertSchema(ToolInsertSchema);
2823
2883
  ToolApiUpdateSchema = createApiUpdateSchema(ToolUpdateSchema);
2884
+ FunctionToolSelectSchema = createSelectSchema(functionTools);
2885
+ FunctionToolInsertSchema = createInsertSchema(functionTools).extend({
2886
+ id: resourceIdSchema
2887
+ });
2888
+ FunctionToolUpdateSchema = FunctionToolInsertSchema.partial();
2889
+ FunctionToolApiSelectSchema = createApiSchema(FunctionToolSelectSchema);
2890
+ FunctionToolApiInsertSchema = createGraphScopedApiInsertSchema(FunctionToolInsertSchema);
2891
+ FunctionToolApiUpdateSchema = createApiUpdateSchema(FunctionToolUpdateSchema);
2824
2892
  FunctionSelectSchema = createSelectSchema(functions);
2825
2893
  FunctionInsertSchema = createInsertSchema(functions).extend({
2826
2894
  id: resourceIdSchema
@@ -2923,6 +2991,24 @@ var init_schemas = __esm({
2923
2991
  canTransferTo: z2.array(z2.string()).optional(),
2924
2992
  canDelegateTo: z2.array(z2.string()).optional()
2925
2993
  });
2994
+ FullGraphDefinitionSchema = AgentGraphApiInsertSchema.extend({
2995
+ subAgents: z2.record(
2996
+ z2.string(),
2997
+ z2.union([FullGraphAgentInsertSchema, ExternalAgentApiInsertSchema])
2998
+ ),
2999
+ // Lookup maps for UI to resolve canUse items
3000
+ tools: z2.record(z2.string(), ToolApiInsertSchema).optional(),
3001
+ // MCP tools (project-scoped)
3002
+ functionTools: z2.record(z2.string(), FunctionToolApiInsertSchema).optional(),
3003
+ // Function tools (graph-scoped)
3004
+ functions: z2.record(z2.string(), FunctionApiInsertSchema).optional(),
3005
+ // Get function code for function tools
3006
+ contextConfig: z2.optional(ContextConfigApiInsertSchema),
3007
+ statusUpdates: z2.optional(StatusUpdateSchema),
3008
+ models: ModelSchema.optional(),
3009
+ stopWhen: GraphStopWhenSchema.optional(),
3010
+ graphPrompt: z2.string().max(5e3, "Graph prompt cannot exceed 5000 characters").optional()
3011
+ });
2926
3012
  GraphWithinContextOfProjectSchema = AgentGraphApiInsertSchema.extend({
2927
3013
  subAgents: z2.record(
2928
3014
  z2.string(),
@@ -2931,9 +3017,13 @@ var init_schemas = __esm({
2931
3017
  ExternalAgentApiInsertSchema.extend({ type: z2.literal("external") })
2932
3018
  ])
2933
3019
  ),
3020
+ // Lookup maps for UI to resolve canUse items
2934
3021
  tools: z2.record(z2.string(), ToolApiInsertSchema).optional(),
2935
- // Get tool name/description from toolId
3022
+ // MCP tools (project-scoped)
3023
+ functionTools: z2.record(z2.string(), FunctionToolApiInsertSchema).optional(),
3024
+ // Function tools (graph-scoped)
2936
3025
  functions: z2.record(z2.string(), FunctionApiInsertSchema).optional(),
3026
+ // Get function code for function tools
2937
3027
  contextConfig: z2.optional(ContextConfigApiInsertSchema),
2938
3028
  statusUpdates: z2.optional(StatusUpdateSchema),
2939
3029
  models: ModelSchema.optional(),
@@ -2974,9 +3064,9 @@ var init_schemas = __esm({
2974
3064
  FullProjectDefinitionSchema = ProjectApiInsertSchema.extend({
2975
3065
  graphs: z2.record(z2.string(), GraphWithinContextOfProjectSchema),
2976
3066
  tools: z2.record(z2.string(), ToolApiInsertSchema),
2977
- // Now includes both MCP and function tools
3067
+ // MCP tools (project-scoped)
2978
3068
  functions: z2.record(z2.string(), FunctionApiInsertSchema).optional(),
2979
- // Global functions
3069
+ // Functions (project-scoped)
2980
3070
  dataComponents: z2.record(z2.string(), DataComponentApiInsertSchema).optional(),
2981
3071
  artifactComponents: z2.record(z2.string(), ArtifactComponentApiInsertSchema).optional(),
2982
3072
  statusUpdates: z2.optional(StatusUpdateSchema),
@@ -4681,8 +4771,21 @@ var init_functions = __esm({
4681
4771
  }
4682
4772
  });
4683
4773
 
4774
+ // ../packages/agents-core/src/data-access/functionTools.ts
4775
+ import { and as and4, count as count3, desc as desc3, eq as eq4 } from "drizzle-orm";
4776
+ var logger4;
4777
+ var init_functionTools = __esm({
4778
+ "../packages/agents-core/src/data-access/functionTools.ts"() {
4779
+ "use strict";
4780
+ init_esm_shims();
4781
+ init_schema();
4782
+ init_logger();
4783
+ logger4 = getLogger("functionTools");
4784
+ }
4785
+ });
4786
+
4684
4787
  // ../packages/agents-core/src/data-access/subAgentRelations.ts
4685
- import { and as and4, count as count3, desc as desc3, eq as eq4, isNotNull } from "drizzle-orm";
4788
+ import { and as and5, count as count4, desc as desc4, eq as eq5, isNotNull } from "drizzle-orm";
4686
4789
  var init_subAgentRelations = __esm({
4687
4790
  "../packages/agents-core/src/data-access/subAgentRelations.ts"() {
4688
4791
  "use strict";
@@ -4692,7 +4795,7 @@ var init_subAgentRelations = __esm({
4692
4795
  });
4693
4796
 
4694
4797
  // ../packages/agents-core/src/data-access/subAgents.ts
4695
- import { and as and5, count as count4, desc as desc4, eq as eq5, inArray } from "drizzle-orm";
4798
+ import { and as and6, count as count5, desc as desc5, eq as eq6, inArray } from "drizzle-orm";
4696
4799
  var init_subAgents = __esm({
4697
4800
  "../packages/agents-core/src/data-access/subAgents.ts"() {
4698
4801
  "use strict";
@@ -4713,7 +4816,7 @@ var init_credential_stuffer = __esm({
4713
4816
  // ../packages/agents-core/src/utils/apiKeys.ts
4714
4817
  import { randomBytes, scrypt, timingSafeEqual } from "crypto";
4715
4818
  import { promisify } from "util";
4716
- var scryptAsync, logger4, PUBLIC_ID_LENGTH, PUBLIC_ID_ALPHABET, generatePublicId;
4819
+ var scryptAsync, logger5, PUBLIC_ID_LENGTH, PUBLIC_ID_ALPHABET, generatePublicId;
4717
4820
  var init_apiKeys = __esm({
4718
4821
  "../packages/agents-core/src/utils/apiKeys.ts"() {
4719
4822
  "use strict";
@@ -4721,7 +4824,7 @@ var init_apiKeys = __esm({
4721
4824
  init_nanoid();
4722
4825
  init_logger();
4723
4826
  scryptAsync = promisify(scrypt);
4724
- logger4 = getLogger("api-key");
4827
+ logger5 = getLogger("api-key");
4725
4828
  PUBLIC_ID_LENGTH = 12;
4726
4829
  PUBLIC_ID_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-";
4727
4830
  generatePublicId = customAlphabet(PUBLIC_ID_ALPHABET, PUBLIC_ID_LENGTH);
@@ -7363,26 +7466,26 @@ var require_resolve = __commonJS({
7363
7466
  return true;
7364
7467
  }
7365
7468
  function countKeys(schema) {
7366
- var count15 = 0, item;
7469
+ var count16 = 0, item;
7367
7470
  if (Array.isArray(schema)) {
7368
7471
  for (var i2 = 0; i2 < schema.length; i2++) {
7369
7472
  item = schema[i2];
7370
- if (typeof item == "object") count15 += countKeys(item);
7371
- if (count15 == Infinity) return Infinity;
7473
+ if (typeof item == "object") count16 += countKeys(item);
7474
+ if (count16 == Infinity) return Infinity;
7372
7475
  }
7373
7476
  } else {
7374
7477
  for (var key in schema) {
7375
7478
  if (key == "$ref") return Infinity;
7376
7479
  if (SIMPLE_INLINED[key]) {
7377
- count15++;
7480
+ count16++;
7378
7481
  } else {
7379
7482
  item = schema[key];
7380
- if (typeof item == "object") count15 += countKeys(item) + 1;
7381
- if (count15 == Infinity) return Infinity;
7483
+ if (typeof item == "object") count16 += countKeys(item) + 1;
7484
+ if (count16 == Infinity) return Infinity;
7382
7485
  }
7383
7486
  }
7384
7487
  }
7385
- return count15;
7488
+ return count16;
7386
7489
  }
7387
7490
  function getFullPath(id, normalize) {
7388
7491
  if (normalize !== false) id = normalizeId(id);
@@ -12104,14 +12207,14 @@ var require_ajv = __commonJS({
12104
12207
  return metaOpts;
12105
12208
  }
12106
12209
  function setLogger(self) {
12107
- var logger14 = self._opts.logger;
12108
- if (logger14 === false) {
12210
+ var logger15 = self._opts.logger;
12211
+ if (logger15 === false) {
12109
12212
  self.logger = { log: noop, warn: noop, error: noop };
12110
12213
  } else {
12111
- if (logger14 === void 0) logger14 = console;
12112
- if (!(typeof logger14 == "object" && logger14.log && logger14.warn && logger14.error))
12214
+ if (logger15 === void 0) logger15 = console;
12215
+ if (!(typeof logger15 == "object" && logger15.log && logger15.warn && logger15.error))
12113
12216
  throw new Error("logger must implement log, warn and error methods");
12114
- self.logger = logger14;
12217
+ self.logger = logger15;
12115
12218
  }
12116
12219
  }
12117
12220
  function noop() {
@@ -12756,12 +12859,12 @@ var init_global_utils = __esm({
12756
12859
 
12757
12860
  // ../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js
12758
12861
  function logProxy(funcName, namespace, args) {
12759
- var logger14 = getGlobal("diag");
12760
- if (!logger14) {
12862
+ var logger15 = getGlobal("diag");
12863
+ if (!logger15) {
12761
12864
  return;
12762
12865
  }
12763
12866
  args.unshift(namespace);
12764
- return logger14[funcName].apply(logger14, __spreadArray([], __read(args), false));
12867
+ return logger15[funcName].apply(logger15, __spreadArray([], __read(args), false));
12765
12868
  }
12766
12869
  var __read, __spreadArray, DiagComponentLogger;
12767
12870
  var init_ComponentLogger = __esm({
@@ -12859,17 +12962,17 @@ var init_types3 = __esm({
12859
12962
  });
12860
12963
 
12861
12964
  // ../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
12862
- function createLogLevelDiagLogger(maxLevel, logger14) {
12965
+ function createLogLevelDiagLogger(maxLevel, logger15) {
12863
12966
  if (maxLevel < DiagLogLevel.NONE) {
12864
12967
  maxLevel = DiagLogLevel.NONE;
12865
12968
  } else if (maxLevel > DiagLogLevel.ALL) {
12866
12969
  maxLevel = DiagLogLevel.ALL;
12867
12970
  }
12868
- logger14 = logger14 || {};
12971
+ logger15 = logger15 || {};
12869
12972
  function _filterFunc(funcName, theLevel) {
12870
- var theFunc = logger14[funcName];
12973
+ var theFunc = logger15[funcName];
12871
12974
  if (typeof theFunc === "function" && maxLevel >= theLevel) {
12872
- return theFunc.bind(logger14);
12975
+ return theFunc.bind(logger15);
12873
12976
  }
12874
12977
  return function() {
12875
12978
  };
@@ -12936,19 +13039,19 @@ var init_diag = __esm({
12936
13039
  for (var _i = 0; _i < arguments.length; _i++) {
12937
13040
  args[_i] = arguments[_i];
12938
13041
  }
12939
- var logger14 = getGlobal("diag");
12940
- if (!logger14)
13042
+ var logger15 = getGlobal("diag");
13043
+ if (!logger15)
12941
13044
  return;
12942
- return logger14[funcName].apply(logger14, __spreadArray2([], __read2(args), false));
13045
+ return logger15[funcName].apply(logger15, __spreadArray2([], __read2(args), false));
12943
13046
  };
12944
13047
  }
12945
13048
  var self = this;
12946
- var setLogger = function(logger14, optionsOrLogLevel) {
13049
+ var setLogger = function(logger15, optionsOrLogLevel) {
12947
13050
  var _a, _b, _c;
12948
13051
  if (optionsOrLogLevel === void 0) {
12949
13052
  optionsOrLogLevel = { logLevel: DiagLogLevel.INFO };
12950
13053
  }
12951
- if (logger14 === self) {
13054
+ if (logger15 === self) {
12952
13055
  var err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
12953
13056
  self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
12954
13057
  return false;
@@ -12959,7 +13062,7 @@ var init_diag = __esm({
12959
13062
  };
12960
13063
  }
12961
13064
  var oldLogger = getGlobal("diag");
12962
- var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger14);
13065
+ var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger15);
12963
13066
  if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
12964
13067
  var stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
12965
13068
  oldLogger.warn("Current logger will be overwritten from " + stack);
@@ -13528,18 +13631,18 @@ function getTracer(serviceName, serviceVersion) {
13528
13631
  try {
13529
13632
  return trace.getTracer(serviceName, serviceVersion);
13530
13633
  } catch (_error) {
13531
- logger5.debug({}, "OpenTelemetry tracer not available, using no-op tracer");
13634
+ logger6.debug({}, "OpenTelemetry tracer not available, using no-op tracer");
13532
13635
  return noopTracer;
13533
13636
  }
13534
13637
  }
13535
- var logger5, createNoOpSpan, noopTracer;
13638
+ var logger6, createNoOpSpan, noopTracer;
13536
13639
  var init_tracer_factory = __esm({
13537
13640
  "../packages/agents-core/src/utils/tracer-factory.ts"() {
13538
13641
  "use strict";
13539
13642
  init_esm_shims();
13540
13643
  init_esm();
13541
13644
  init_utils();
13542
- logger5 = getLogger("tracer");
13645
+ logger6 = getLogger("tracer");
13543
13646
  createNoOpSpan = () => ({
13544
13647
  setAttributes: () => ({}),
13545
13648
  recordException: () => ({}),
@@ -13590,7 +13693,7 @@ var init_utils = __esm({
13590
13693
  });
13591
13694
 
13592
13695
  // ../packages/agents-core/src/data-access/credentialReferences.ts
13593
- import { and as and6, count as count5, desc as desc5, eq as eq6, sql as sql3 } from "drizzle-orm";
13696
+ import { and as and7, count as count6, desc as desc6, eq as eq7, sql as sql3 } from "drizzle-orm";
13594
13697
  var init_credentialReferences = __esm({
13595
13698
  "../packages/agents-core/src/data-access/credentialReferences.ts"() {
13596
13699
  "use strict";
@@ -13600,8 +13703,8 @@ var init_credentialReferences = __esm({
13600
13703
  });
13601
13704
 
13602
13705
  // ../packages/agents-core/src/data-access/tools.ts
13603
- import { and as and7, count as count6, desc as desc6, eq as eq7 } from "drizzle-orm";
13604
- var logger6;
13706
+ import { and as and8, count as count7, desc as desc7, eq as eq8 } from "drizzle-orm";
13707
+ var logger7;
13605
13708
  var init_tools = __esm({
13606
13709
  "../packages/agents-core/src/data-access/tools.ts"() {
13607
13710
  "use strict";
@@ -13615,12 +13718,12 @@ var init_tools = __esm({
13615
13718
  init_mcp_client();
13616
13719
  init_credentialReferences();
13617
13720
  init_subAgentRelations();
13618
- logger6 = getLogger("tools");
13721
+ logger7 = getLogger("tools");
13619
13722
  }
13620
13723
  });
13621
13724
 
13622
13725
  // ../packages/agents-core/src/data-access/agentGraphs.ts
13623
- import { and as and8, count as count7, desc as desc7, eq as eq8, inArray as inArray2 } from "drizzle-orm";
13726
+ import { and as and9, count as count8, desc as desc8, eq as eq9, inArray as inArray2 } from "drizzle-orm";
13624
13727
  var init_agentGraphs = __esm({
13625
13728
  "../packages/agents-core/src/data-access/agentGraphs.ts"() {
13626
13729
  "use strict";
@@ -13629,6 +13732,7 @@ var init_agentGraphs = __esm({
13629
13732
  init_contextConfigs();
13630
13733
  init_externalAgents();
13631
13734
  init_functions();
13735
+ init_functionTools();
13632
13736
  init_subAgentRelations();
13633
13737
  init_subAgents();
13634
13738
  init_tools();
@@ -13636,7 +13740,7 @@ var init_agentGraphs = __esm({
13636
13740
  });
13637
13741
 
13638
13742
  // ../packages/agents-core/src/data-access/apiKeys.ts
13639
- import { and as and9, count as count8, desc as desc8, eq as eq9 } from "drizzle-orm";
13743
+ import { and as and10, count as count9, desc as desc9, eq as eq10 } from "drizzle-orm";
13640
13744
  var init_apiKeys2 = __esm({
13641
13745
  "../packages/agents-core/src/data-access/apiKeys.ts"() {
13642
13746
  "use strict";
@@ -14650,10 +14754,10 @@ var require_codegen = __commonJS({
14650
14754
  }
14651
14755
  exports.not = not2;
14652
14756
  var andCode = mappend(exports.operators.AND);
14653
- function and19(...args) {
14757
+ function and20(...args) {
14654
14758
  return args.reduce(andCode);
14655
14759
  }
14656
- exports.and = and19;
14760
+ exports.and = and20;
14657
14761
  var orCode = mappend(exports.operators.OR);
14658
14762
  function or(...args) {
14659
14763
  return args.reduce(orCode);
@@ -15814,20 +15918,20 @@ var require_resolve2 = __commonJS({
15814
15918
  return false;
15815
15919
  }
15816
15920
  function countKeys(schema) {
15817
- let count15 = 0;
15921
+ let count16 = 0;
15818
15922
  for (const key in schema) {
15819
15923
  if (key === "$ref")
15820
15924
  return Infinity;
15821
- count15++;
15925
+ count16++;
15822
15926
  if (SIMPLE_INLINED.has(key))
15823
15927
  continue;
15824
15928
  if (typeof schema[key] == "object") {
15825
- (0, util_1.eachItem)(schema[key], (sch) => count15 += countKeys(sch));
15929
+ (0, util_1.eachItem)(schema[key], (sch) => count16 += countKeys(sch));
15826
15930
  }
15827
- if (count15 === Infinity)
15931
+ if (count16 === Infinity)
15828
15932
  return Infinity;
15829
15933
  }
15830
- return count15;
15934
+ return count16;
15831
15935
  }
15832
15936
  function getFullPath(resolver, id = "", normalize) {
15833
15937
  if (normalize !== false)
@@ -17971,13 +18075,13 @@ var require_core = __commonJS({
17971
18075
  }, warn() {
17972
18076
  }, error() {
17973
18077
  } };
17974
- function getLogger2(logger14) {
17975
- if (logger14 === false)
18078
+ function getLogger2(logger15) {
18079
+ if (logger15 === false)
17976
18080
  return noLogs;
17977
- if (logger14 === void 0)
18081
+ if (logger15 === void 0)
17978
18082
  return console;
17979
- if (logger14.log && logger14.warn && logger14.error)
17980
- return logger14;
18083
+ if (logger15.log && logger15.warn && logger15.error)
18084
+ return logger15;
17981
18085
  throw new Error("logger must implement log, warn and error methods");
17982
18086
  }
17983
18087
  var KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;
@@ -18933,8 +19037,8 @@ var require_contains2 = __commonJS({
18933
19037
  cxt.result(valid, () => cxt.reset());
18934
19038
  function validateItemsWithCount() {
18935
19039
  const schValid = gen.name("_valid");
18936
- const count15 = gen.let("count", 0);
18937
- validateItems(schValid, () => gen.if(schValid, () => checkLimits(count15)));
19040
+ const count16 = gen.let("count", 0);
19041
+ validateItems(schValid, () => gen.if(schValid, () => checkLimits(count16)));
18938
19042
  }
18939
19043
  function validateItems(_valid, block) {
18940
19044
  gen.forRange("i", 0, len, (i2) => {
@@ -18947,16 +19051,16 @@ var require_contains2 = __commonJS({
18947
19051
  block();
18948
19052
  });
18949
19053
  }
18950
- function checkLimits(count15) {
18951
- gen.code((0, codegen_1._)`${count15}++`);
19054
+ function checkLimits(count16) {
19055
+ gen.code((0, codegen_1._)`${count16}++`);
18952
19056
  if (max === void 0) {
18953
- gen.if((0, codegen_1._)`${count15} >= ${min}`, () => gen.assign(valid, true).break());
19057
+ gen.if((0, codegen_1._)`${count16} >= ${min}`, () => gen.assign(valid, true).break());
18954
19058
  } else {
18955
- gen.if((0, codegen_1._)`${count15} > ${max}`, () => gen.assign(valid, false).break());
19059
+ gen.if((0, codegen_1._)`${count16} > ${max}`, () => gen.assign(valid, false).break());
18956
19060
  if (min === 1)
18957
19061
  gen.assign(valid, true);
18958
19062
  else
18959
- gen.if((0, codegen_1._)`${count15} >= ${min}`, () => gen.assign(valid, true));
19063
+ gen.if((0, codegen_1._)`${count16} >= ${min}`, () => gen.assign(valid, true));
18960
19064
  }
18961
19065
  }
18962
19066
  }
@@ -20130,7 +20234,7 @@ var init_props_validation = __esm({
20130
20234
  });
20131
20235
 
20132
20236
  // ../packages/agents-core/src/data-access/artifactComponents.ts
20133
- import { and as and10, count as count9, desc as desc9, eq as eq10 } from "drizzle-orm";
20237
+ import { and as and11, count as count10, desc as desc10, eq as eq11 } from "drizzle-orm";
20134
20238
  var init_artifactComponents = __esm({
20135
20239
  "../packages/agents-core/src/data-access/artifactComponents.ts"() {
20136
20240
  "use strict";
@@ -20141,7 +20245,7 @@ var init_artifactComponents = __esm({
20141
20245
  });
20142
20246
 
20143
20247
  // ../packages/agents-core/src/data-access/contextCache.ts
20144
- import { and as and11, eq as eq11 } from "drizzle-orm";
20248
+ import { and as and12, eq as eq12 } from "drizzle-orm";
20145
20249
  var init_contextCache = __esm({
20146
20250
  "../packages/agents-core/src/data-access/contextCache.ts"() {
20147
20251
  "use strict";
@@ -20151,7 +20255,7 @@ var init_contextCache = __esm({
20151
20255
  });
20152
20256
 
20153
20257
  // ../packages/agents-core/src/data-access/conversations.ts
20154
- import { and as and12, count as count10, desc as desc10, eq as eq12 } from "drizzle-orm";
20258
+ import { and as and13, count as count11, desc as desc11, eq as eq13 } from "drizzle-orm";
20155
20259
  var init_conversations2 = __esm({
20156
20260
  "../packages/agents-core/src/data-access/conversations.ts"() {
20157
20261
  "use strict";
@@ -20162,7 +20266,7 @@ var init_conversations2 = __esm({
20162
20266
  });
20163
20267
 
20164
20268
  // ../packages/agents-core/src/data-access/dataComponents.ts
20165
- import { and as and13, count as count11, desc as desc11, eq as eq13 } from "drizzle-orm";
20269
+ import { and as and14, count as count12, desc as desc12, eq as eq14 } from "drizzle-orm";
20166
20270
  var init_dataComponents = __esm({
20167
20271
  "../packages/agents-core/src/data-access/dataComponents.ts"() {
20168
20272
  "use strict";
@@ -20182,7 +20286,7 @@ var init_graphFull = __esm({
20182
20286
  });
20183
20287
 
20184
20288
  // ../packages/agents-core/src/data-access/graphFull.ts
20185
- import { and as and14, eq as eq14, inArray as inArray3, not } from "drizzle-orm";
20289
+ import { and as and15, eq as eq15, inArray as inArray3, not } from "drizzle-orm";
20186
20290
  var init_graphFull2 = __esm({
20187
20291
  "../packages/agents-core/src/data-access/graphFull.ts"() {
20188
20292
  "use strict";
@@ -20194,6 +20298,8 @@ var init_graphFull2 = __esm({
20194
20298
  init_contextConfigs();
20195
20299
  init_dataComponents();
20196
20300
  init_externalAgents();
20301
+ init_functions();
20302
+ init_functionTools();
20197
20303
  init_subAgentRelations();
20198
20304
  init_subAgents();
20199
20305
  init_tools();
@@ -20201,7 +20307,7 @@ var init_graphFull2 = __esm({
20201
20307
  });
20202
20308
 
20203
20309
  // ../packages/agents-core/src/data-access/ledgerArtifacts.ts
20204
- import { and as and15, count as count12, eq as eq15 } from "drizzle-orm";
20310
+ import { and as and16, count as count13, eq as eq16 } from "drizzle-orm";
20205
20311
  var init_ledgerArtifacts = __esm({
20206
20312
  "../packages/agents-core/src/data-access/ledgerArtifacts.ts"() {
20207
20313
  "use strict";
@@ -20211,7 +20317,7 @@ var init_ledgerArtifacts = __esm({
20211
20317
  });
20212
20318
 
20213
20319
  // ../packages/agents-core/src/data-access/messages.ts
20214
- import { and as and16, asc as asc2, count as count13, desc as desc12, eq as eq16, inArray as inArray4 } from "drizzle-orm";
20320
+ import { and as and17, asc as asc2, count as count14, desc as desc13, eq as eq17, inArray as inArray4 } from "drizzle-orm";
20215
20321
  var init_messages = __esm({
20216
20322
  "../packages/agents-core/src/data-access/messages.ts"() {
20217
20323
  "use strict";
@@ -20221,7 +20327,7 @@ var init_messages = __esm({
20221
20327
  });
20222
20328
 
20223
20329
  // ../packages/agents-core/src/data-access/projects.ts
20224
- import { and as and17, count as count14, desc as desc13, eq as eq17 } from "drizzle-orm";
20330
+ import { and as and18, count as count15, desc as desc14, eq as eq18 } from "drizzle-orm";
20225
20331
  var init_projects = __esm({
20226
20332
  "../packages/agents-core/src/data-access/projects.ts"() {
20227
20333
  "use strict";
@@ -20250,7 +20356,7 @@ var init_projectFull = __esm({
20250
20356
  });
20251
20357
 
20252
20358
  // ../packages/agents-core/src/data-access/tasks.ts
20253
- import { and as and18, eq as eq18 } from "drizzle-orm";
20359
+ import { and as and19, eq as eq19 } from "drizzle-orm";
20254
20360
  var init_tasks = __esm({
20255
20361
  "../packages/agents-core/src/data-access/tasks.ts"() {
20256
20362
  "use strict";
@@ -20284,6 +20390,7 @@ var init_data_access = __esm({
20284
20390
  init_dataComponents();
20285
20391
  init_externalAgents();
20286
20392
  init_functions();
20393
+ init_functionTools();
20287
20394
  init_graphFull2();
20288
20395
  init_ledgerArtifacts();
20289
20396
  init_messages();
@@ -20310,20 +20417,20 @@ var init_tracer = __esm({
20310
20417
  });
20311
20418
 
20312
20419
  // ../packages/agents-core/src/context/contextCache.ts
20313
- var logger7;
20420
+ var logger8;
20314
20421
  var init_contextCache2 = __esm({
20315
20422
  "../packages/agents-core/src/context/contextCache.ts"() {
20316
20423
  "use strict";
20317
20424
  init_esm_shims();
20318
20425
  init_data_access();
20319
20426
  init_logger();
20320
- logger7 = getLogger("context-cache");
20427
+ logger8 = getLogger("context-cache");
20321
20428
  }
20322
20429
  });
20323
20430
 
20324
20431
  // ../packages/agents-core/src/context/ContextResolver.ts
20325
20432
  import crypto4 from "crypto";
20326
- var logger8;
20433
+ var logger9;
20327
20434
  var init_ContextResolver = __esm({
20328
20435
  "../packages/agents-core/src/context/ContextResolver.ts"() {
20329
20436
  "use strict";
@@ -20332,12 +20439,12 @@ var init_ContextResolver = __esm({
20332
20439
  init_tracer();
20333
20440
  init_ContextFetcher();
20334
20441
  init_contextCache2();
20335
- logger8 = getLogger("context-resolver");
20442
+ logger9 = getLogger("context-resolver");
20336
20443
  }
20337
20444
  });
20338
20445
 
20339
20446
  // ../packages/agents-core/src/middleware/contextValidation.ts
20340
- var import_ajv3, logger9, ajv;
20447
+ var import_ajv3, logger10, ajv;
20341
20448
  var init_contextValidation = __esm({
20342
20449
  "../packages/agents-core/src/middleware/contextValidation.ts"() {
20343
20450
  "use strict";
@@ -20349,7 +20456,7 @@ var init_contextValidation = __esm({
20349
20456
  init_error();
20350
20457
  init_execution();
20351
20458
  init_logger();
20352
- logger9 = getLogger("context-validation");
20459
+ logger10 = getLogger("context-validation");
20353
20460
  ajv = new import_ajv3.default({ allErrors: true, strict: false });
20354
20461
  }
20355
20462
  });
@@ -20364,7 +20471,7 @@ var init_middleware = __esm({
20364
20471
  });
20365
20472
 
20366
20473
  // ../packages/agents-core/src/context/ContextFetcher.ts
20367
- var import_jmespath2, logger10;
20474
+ var import_jmespath2, logger11;
20368
20475
  var init_ContextFetcher = __esm({
20369
20476
  "../packages/agents-core/src/context/ContextFetcher.ts"() {
20370
20477
  "use strict";
@@ -20375,12 +20482,12 @@ var init_ContextFetcher = __esm({
20375
20482
  init_middleware();
20376
20483
  init_logger();
20377
20484
  init_TemplateEngine();
20378
- logger10 = getLogger("context-fetcher");
20485
+ logger11 = getLogger("context-fetcher");
20379
20486
  }
20380
20487
  });
20381
20488
 
20382
20489
  // ../packages/agents-core/src/context/context.ts
20383
- var logger11;
20490
+ var logger12;
20384
20491
  var init_context4 = __esm({
20385
20492
  "../packages/agents-core/src/context/context.ts"() {
20386
20493
  "use strict";
@@ -20389,7 +20496,7 @@ var init_context4 = __esm({
20389
20496
  init_utils();
20390
20497
  init_tracer();
20391
20498
  init_ContextResolver();
20392
- logger11 = getLogger("context");
20499
+ logger12 = getLogger("context");
20393
20500
  }
20394
20501
  });
20395
20502
 
@@ -20482,7 +20589,7 @@ var init_dist6 = __esm({
20482
20589
 
20483
20590
  // ../packages/agents-core/src/credential-stores/nango-store.ts
20484
20591
  import { z as z9 } from "zod";
20485
- var logger12, CredentialKeySchema;
20592
+ var logger13, CredentialKeySchema;
20486
20593
  var init_nango_store = __esm({
20487
20594
  "../packages/agents-core/src/credential-stores/nango-store.ts"() {
20488
20595
  "use strict";
@@ -20490,7 +20597,7 @@ var init_nango_store = __esm({
20490
20597
  init_dist6();
20491
20598
  init_types();
20492
20599
  init_logger();
20493
- logger12 = getLogger("nango-credential-store");
20600
+ logger13 = getLogger("nango-credential-store");
20494
20601
  CredentialKeySchema = z9.object({
20495
20602
  connectionId: z9.string().min(1, "connectionId must be a non-empty string"),
20496
20603
  providerConfigKey: z9.string().min(1, "providerConfigKey must be a non-empty string")
@@ -20854,7 +20961,7 @@ function findConfigFile(startPath = process.cwd()) {
20854
20961
  return null;
20855
20962
  }
20856
20963
  async function loadConfigFromFile(configPath) {
20857
- logger13.info({ fromPath: configPath }, `Loading config file`);
20964
+ logger14.info({ fromPath: configPath }, `Loading config file`);
20858
20965
  let resolvedPath;
20859
20966
  if (configPath) {
20860
20967
  resolvedPath = resolve2(process.cwd(), configPath);
@@ -20874,7 +20981,7 @@ async function loadConfigFromFile(configPath) {
20874
20981
  throw new Error(`No config exported from ${resolvedPath}`);
20875
20982
  }
20876
20983
  const config = normalizeConfig(rawConfig);
20877
- logger13.info({ config: maskSensitiveConfig(config) }, `Loaded config values`);
20984
+ logger14.info({ config: maskSensitiveConfig(config) }, `Loaded config values`);
20878
20985
  return config;
20879
20986
  } catch (error) {
20880
20987
  console.warn(`Warning: Failed to load config file ${resolvedPath}:`, error);
@@ -20895,9 +21002,9 @@ async function loadConfig(configPath) {
20895
21002
  config[key] = value;
20896
21003
  }
20897
21004
  });
20898
- logger13.info({ mergedConfig: maskSensitiveConfig(config) }, `Config loaded from file`);
21005
+ logger14.info({ mergedConfig: maskSensitiveConfig(config) }, `Config loaded from file`);
20899
21006
  } else {
20900
- logger13.info(
21007
+ logger14.info(
20901
21008
  { config: maskSensitiveConfig(config) },
20902
21009
  `Using default config (no config file found)`
20903
21010
  );
@@ -20949,14 +21056,14 @@ Please add agentsRunApiUrl to your configuration file`
20949
21056
  sources
20950
21057
  };
20951
21058
  }
20952
- var logger13;
21059
+ var logger14;
20953
21060
  var init_config = __esm({
20954
21061
  "src/utils/config.ts"() {
20955
21062
  "use strict";
20956
21063
  init_esm_shims();
20957
21064
  init_src();
20958
21065
  init_tsx_loader();
20959
- logger13 = getLogger("config");
21066
+ logger14 = getLogger("config");
20960
21067
  }
20961
21068
  });
20962
21069
 
@@ -23629,7 +23736,7 @@ async function pullProjectCommand(options) {
23629
23736
  for (const usage of usageInfo) {
23630
23737
  usageByType[usage.type] = (usageByType[usage.type] || 0) + 1;
23631
23738
  }
23632
- const usageSummary = Object.entries(usageByType).map(([type, count15]) => `${count15} ${type}${count15 > 1 ? "s" : ""}`).join(", ");
23739
+ const usageSummary = Object.entries(usageByType).map(([type, count16]) => `${count16} ${type}${count16 > 1 ? "s" : ""}`).join(", ");
23633
23740
  console.log(chalk7.gray(` Used by: ${usageSummary}`));
23634
23741
  }
23635
23742
  }
@@ -23940,7 +24047,7 @@ async function pushCommand(options) {
23940
24047
  for (const usage of usageInfo) {
23941
24048
  usageByType[usage.type] = (usageByType[usage.type] || 0) + 1;
23942
24049
  }
23943
- const usageSummary = Object.entries(usageByType).map(([type, count15]) => `${count15} ${type}${count15 > 1 ? "s" : ""}`).join(", ");
24050
+ const usageSummary = Object.entries(usageByType).map(([type, count16]) => `${count16} ${type}${count16 > 1 ? "s" : ""}`).join(", ");
23944
24051
  console.log(chalk8.gray(` Used by: ${usageSummary}`));
23945
24052
  }
23946
24053
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-cli",
3
- "version": "0.0.0-dev-20251010165126",
3
+ "version": "0.0.0-dev-20251010180500",
4
4
  "description": "Inkeep CLI tool",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -46,8 +46,8 @@
46
46
  "recast": "^0.23.0",
47
47
  "ts-morph": "^26.0.0",
48
48
  "tsx": "^4.20.5",
49
- "@inkeep/agents-core": "^0.0.0-dev-20251010165126",
50
- "@inkeep/agents-sdk": "^0.0.0-dev-20251010165126"
49
+ "@inkeep/agents-core": "^0.0.0-dev-20251010180500",
50
+ "@inkeep/agents-sdk": "^0.0.0-dev-20251010180500"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/degit": "^2.8.6",
@@ -62,7 +62,7 @@
62
62
  "vitest": "^3.2.4"
63
63
  },
64
64
  "peerDependencies": {
65
- "@inkeep/agents-manage-ui": "0.0.0-dev-20251010165126",
65
+ "@inkeep/agents-manage-ui": "0.0.0-dev-20251010180500",
66
66
  "zod": "^4.1.11"
67
67
  },
68
68
  "engines": {