@inkeep/agents-core 0.36.1 → 0.37.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/auth/auth-schema.js +1 -1
  2. package/dist/auth/auth-validation-schemas.js +1 -1
  3. package/dist/auth/auth.d.ts +3 -3
  4. package/dist/auth/auth.js +32 -5
  5. package/dist/{auth-detection-CGqhPDnj.d.ts → auth-detection-7G0Dxt55.d.ts} +11 -0
  6. package/dist/chunk-CMNLBV2A.js +39 -0
  7. package/dist/{chunk-SG75RA63.js → chunk-I6IF7ZTL.js} +2 -2
  8. package/dist/{chunk-ZCEKN54E.js → chunk-K6GMXJPW.js} +6 -6
  9. package/dist/{chunk-4RVJB4KV.js → chunk-LL6F3EAR.js} +4 -1
  10. package/dist/{chunk-TGESM3JG.js → chunk-MQMMFK2K.js} +14 -3
  11. package/dist/{chunk-NFYCSHD3.js → chunk-PVRIMF6N.js} +2 -1
  12. package/dist/{chunk-4OISWRFK.js → chunk-ROXPFQAM.js} +357 -40
  13. package/dist/{chunk-OEHP46F7.js → chunk-W3QDM7WH.js} +1 -1
  14. package/dist/{chunk-KMLLKRUY.js → chunk-ZEZCCHV7.js} +1 -1
  15. package/dist/{client-HrEgt7wv.d.ts → client-B_3j-V4-.d.ts} +1 -1
  16. package/dist/client-exports.d.ts +6 -3
  17. package/dist/client-exports.js +3 -3
  18. package/dist/constants/schema-validation/index.js +1 -1
  19. package/dist/credential-stores/index.d.ts +3 -3
  20. package/dist/db/schema.d.ts +2 -2
  21. package/dist/db/schema.js +2 -2
  22. package/dist/db/test-client.d.ts +3 -3
  23. package/dist/db/test-client.js +1 -1
  24. package/dist/index.d.ts +143 -9
  25. package/dist/index.js +280 -67
  26. package/dist/{schema-CoC3tYFX.d.ts → schema-DKbG39on.d.ts} +24 -1
  27. package/dist/server-BXoUiBMg.d.ts +127 -0
  28. package/dist/types/index.d.ts +33 -113
  29. package/dist/types/index.js +1 -1
  30. package/dist/{utility-C4QAannk.d.ts → utility-Lo5NoRHK.d.ts} +146 -11
  31. package/dist/validation/index.d.ts +2 -2
  32. package/dist/validation/index.js +2 -2
  33. package/drizzle/{0001_fair_malice.sql → 0001_calm_sheva_callister.sql} +1 -16
  34. package/drizzle/meta/0001_snapshot.json +7 -1
  35. package/drizzle/meta/_journal.json +2 -2
  36. package/package.json +12 -6
  37. package/dist/chunk-H2F72PDA.js +0 -15
  38. /package/dist/{chunk-NOPEANIU.js → chunk-NFTJ5JBY.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  import * as drizzle_orm from 'drizzle-orm';
2
2
  import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
3
- import { l as ContextFetchDefinition, C as ConversationHistoryConfig, T as TaskMetadataConfig, m as ToolMcpConfig, n as ToolServerCapabilities, o as ConversationMetadata, p as MessageContent, q as MessageMetadata, P as Part } from './utility-C4QAannk.js';
3
+ import { l as ContextFetchDefinition, C as ConversationHistoryConfig, T as TaskMetadataConfig, m as ToolMcpConfig, n as ToolServerCapabilities, o as ConversationMetadata, p as MessageContent, q as MessageMetadata, P as Part } from './utility-Lo5NoRHK.js';
4
4
  import { account, invitation, member, organization, session, ssoProvider, user, verification } from './auth/auth-schema.js';
5
5
 
6
6
  declare const projects: drizzle_orm_pg_core.PgTableWithColumns<{
@@ -3119,6 +3119,29 @@ declare const subAgentToolRelations: drizzle_orm_pg_core.PgTableWithColumns<{
3119
3119
  }, {}, {
3120
3120
  $type: Record<string, string> | null;
3121
3121
  }>;
3122
+ toolPolicies: drizzle_orm_pg_core.PgColumn<{
3123
+ name: "tool_policies";
3124
+ tableName: "sub_agent_tool_relations";
3125
+ dataType: "json";
3126
+ columnType: "PgJsonb";
3127
+ data: Record<string, {
3128
+ needsApproval?: boolean;
3129
+ }> | null;
3130
+ driverParam: unknown;
3131
+ notNull: false;
3132
+ hasDefault: false;
3133
+ isPrimaryKey: false;
3134
+ isAutoincrement: false;
3135
+ hasRuntimeDefault: false;
3136
+ enumValues: undefined;
3137
+ baseColumn: never;
3138
+ identity: undefined;
3139
+ generated: undefined;
3140
+ }, {}, {
3141
+ $type: Record<string, {
3142
+ needsApproval?: boolean;
3143
+ }> | null;
3144
+ }>;
3122
3145
  subAgentId: drizzle_orm_pg_core.PgColumn<{
3123
3146
  name: "sub_agent_id";
3124
3147
  tableName: "sub_agent_tool_relations";
@@ -0,0 +1,127 @@
1
+ import { Context } from 'hono';
2
+ import { h as CredentialStoreType } from './utility-Lo5NoRHK.js';
3
+
4
+ /**
5
+ * Credential store interface for managing different types of credentials
6
+ */
7
+ interface CredentialStore {
8
+ /**
9
+ * Unique identifier for this credential store
10
+ */
11
+ id: string;
12
+ /**
13
+ * Type of credential store
14
+ */
15
+ type: keyof typeof CredentialStoreType;
16
+ /**
17
+ * Get a credential by key
18
+ */
19
+ get(key: string): Promise<string | null>;
20
+ /**
21
+ * Set a credential
22
+ */
23
+ set(key: string, value: string, metadata?: Record<string, string>): Promise<void>;
24
+ /**
25
+ * Check if a credential exists
26
+ */
27
+ has(key: string): Promise<boolean>;
28
+ /**
29
+ * Delete a credential
30
+ */
31
+ delete(key: string): Promise<boolean>;
32
+ /**
33
+ * Check if the credential store is available and functional
34
+ * @returns Promise resolving to availability status and optional reason if unavailable
35
+ */
36
+ checkAvailability(): Promise<{
37
+ available: boolean;
38
+ reason?: string;
39
+ }>;
40
+ }
41
+ /**
42
+ * Server configuration options for HTTP server behavior
43
+ * These settings control connection management, timeouts, and server behavior
44
+ */
45
+ interface ServerOptions {
46
+ /**
47
+ * Server port to listen on
48
+ * Default: 3000
49
+ */
50
+ port?: number;
51
+ /**
52
+ * Keep alive timeout in milliseconds
53
+ * Time to wait for additional data after the last response before closing the connection.
54
+ * Used for persistent connections to improve performance by reusing connections.
55
+ * Scenario: Set higher (10-30s) for high-traffic APIs, lower (1-5s) for low-traffic services.
56
+ * Default: 60000ms (60 seconds)
57
+ */
58
+ keepAliveTimeout?: number;
59
+ /**
60
+ * Enable keep alive connections
61
+ * When true, allows connection reuse for multiple requests.
62
+ * Improves performance but uses more server resources.
63
+ * Scenario: Enable for APIs with frequent requests, disable for one-off services.
64
+ * Default: true
65
+ */
66
+ keepAlive?: boolean;
67
+ /**
68
+ * Request timeout in milliseconds
69
+ * Maximum time to wait for a complete request from the client.
70
+ * Helps prevent DoS attacks by limiting resource consumption from slow clients.
71
+ * Scenario: Set lower (30s) for simple APIs, higher (5-10min) for file upload services.
72
+ * Default: 60000ms (60 seconds)
73
+ */
74
+ requestTimeout?: number;
75
+ }
76
+ /**
77
+ * CORS configuration compatible with Hono's CORSOptions
78
+ */
79
+ interface CorsConfig {
80
+ /**
81
+ * Allowed origins - string, array of strings, or function
82
+ */
83
+ origin?: string | string[] | ((origin: string, c?: Context) => string | null | undefined);
84
+ /**
85
+ * Allowed methods
86
+ */
87
+ allowMethods?: string[];
88
+ /**
89
+ * Allowed headers
90
+ */
91
+ allowHeaders?: string[];
92
+ /**
93
+ * Exposed headers
94
+ */
95
+ exposeHeaders?: string[];
96
+ /**
97
+ * Max age for preflight requests
98
+ */
99
+ maxAge?: number;
100
+ /**
101
+ * Whether to allow credentials
102
+ */
103
+ credentials?: boolean;
104
+ }
105
+ /**
106
+ * Base server configuration for all Inkeep services
107
+ */
108
+ interface ServerConfig {
109
+ /**
110
+ * Server port to listen on
111
+ */
112
+ port?: number;
113
+ /**
114
+ * Server options for HTTP behavior
115
+ */
116
+ serverOptions?: ServerOptions;
117
+ /**
118
+ * Array of credential stores for managing API keys, tokens, etc.
119
+ */
120
+ credentialStores?: CredentialStore[];
121
+ /**
122
+ * CORS configuration
123
+ */
124
+ cors?: CorsConfig;
125
+ }
126
+
127
+ export type { CredentialStore as C, ServerOptions as S, CorsConfig as a, ServerConfig as b };
@@ -1,132 +1,52 @@
1
- import { h as CredentialStoreType } from '../utility-C4QAannk.js';
2
- export { bb as A2AError, bH as A2ARequest, bI as A2AResponse, aM as APIKeySecurityScheme, bW as AgentApiInsert, bV as AgentApiSelect, bX as AgentApiUpdate, aI as AgentCapabilities, aW as AgentCard, dy as AgentConversationHistoryConfig, y as AgentInsert, aJ as AgentProvider, w as AgentScopeConfig, B as AgentSelect, aK as AgentSkill, z as AgentUpdate, cQ as AllAgentSelect, cU as ApiKeyApiCreationResponse, cS as ApiKeyApiInsert, cR as ApiKeyApiSelect, cT as ApiKeyApiUpdate, I as ApiKeyCreateResult, E as ApiKeyInsert, D as ApiKeySelect, G as ApiKeyUpdate, a9 as Artifact, cF as ArtifactComponentApiInsert, cE as ArtifactComponentApiSelect, cG as ArtifactComponentApiUpdate, K as ArtifactComponentInsert, J as ArtifactComponentSelect, L as ArtifactComponentUpdate, aP as AuthorizationCodeOAuthFlow, dh as CanDelegateToExternalAgent, dg as CanUseItem, br as CancelTaskRequest, bC as CancelTaskResponse, bB as CancelTaskSuccessResponse, aQ as ClientCredentialsOAuthFlow, b9 as ContentTypeNotSupportedError, ct as ContextCacheApiInsert, cs as ContextCacheApiSelect, cu as ContextCacheApiUpdate, dz as ContextCacheEntry, Q as ContextCacheInsert, O as ContextCacheSelect, cr as ContextCacheUpdate, cn as ContextConfigApiInsert, cm as ContextConfigApiSelect, co as ContextConfigApiUpdate, R as ContextConfigInsert, s as ContextConfigSelect, U as ContextConfigUpdate, l as ContextFetchDefinition, cg as ConversationApiInsert, cf as ConversationApiSelect, ch as ConversationApiUpdate, C as ConversationHistoryConfig, W as ConversationInsert, o as ConversationMetadata, dx as ConversationScopeOptions, V as ConversationSelect, X as ConversationUpdate, H as CreateApiKeyParams, r as CredentialReferenceApiInsert, cV as CredentialReferenceApiSelect, cW as CredentialReferenceApiUpdate, $ as CredentialReferenceInsert, Y as CredentialReferenceSelect, a0 as CredentialReferenceUpdate, cw as DataComponentApiInsert, cv as DataComponentApiSelect, cx as DataComponentApiUpdate, a2 as DataComponentInsert, a1 as DataComponentSelect, a3 as DataComponentUpdate, aG as DataPart, ay as ExecutionContext, cO as ExternalAgentApiInsert, cN as ExternalAgentApiSelect, cP as ExternalAgentApiUpdate, a4 as ExternalAgentInsert, _ as ExternalAgentSelect, a5 as ExternalAgentUpdate, bU as ExternalSubAgentRelationApiInsert, bT as ExternalSubAgentRelationInsert, cq as FetchConfig, cp as FetchDefinition, aC as FileBase, aF as FilePart, aD as FileWithBytes, aE as FileWithUri, df as FullAgentAgentInsert, v as FullAgentDefinition, ae as FullProjectDefinition, a6 as FunctionApiInsert, cc as FunctionApiSelect, cd as FunctionApiUpdate, ca as FunctionInsert, c9 as FunctionSelect, a7 as FunctionToolApiInsert, ce as FunctionToolApiSelect, a8 as FunctionToolApiUpdate, cb as FunctionUpdate, bt as GetTaskPushNotificationConfigRequest, bG as GetTaskPushNotificationConfigResponse, bF as GetTaskPushNotificationConfigSuccessResponse, bq as GetTaskRequest, bA as GetTaskResponse, bz as GetTaskSuccessResponse, aN as HTTPAuthSecurityScheme, aR as ImplicitOAuthFlow, b4 as InternalError, ba as InvalidAgentResponseError, b3 as InvalidParamsError, b1 as InvalidRequestError, b0 as JSONParseError, bl as JSONRPCError, bn as JSONRPCErrorResponse, bj as JSONRPCMessage, bk as JSONRPCRequest, bm as JSONRPCResult, dd as LedgerArtifactApiInsert, dc as LedgerArtifactApiSelect, de as LedgerArtifactApiUpdate, da as LedgerArtifactInsert, aa as LedgerArtifactSelect, db as LedgerArtifactUpdate, dH as MCPServerType, t as MCPToolConfig, i as MCPTransportType, dA as McpAuthType, dB as McpServerAuth, dD as McpServerCapabilities, av as McpTool, dE as McpToolDefinition, dC as McpTransportConfig, aX as Message, ck as MessageApiInsert, cj as MessageApiSelect, cl as MessageApiUpdate, p as MessageContent, ac as MessageInsert, q as MessageMetadata, ds as MessageMode, bJ as MessagePart, dr as MessageRole, ci as MessageSelect, bh as MessageSendConfiguration, bi as MessageSendParams, dq as MessageType, ad as MessageUpdate, ab as MessageVisibility, b2 as MethodNotFoundError, dt as Models, aT as OAuth2SecurityScheme, aO as OAuthFlows, aU as OpenIdConnectSecurityScheme, dn as Pagination, x as PaginationConfig, ah as PaginationResult, P as Part, aA as PartBase, aS as PasswordOAuthFlow, dl as ProjectApiInsert, dk as ProjectApiSelect, dm as ProjectApiUpdate, af as ProjectInfo, aj as ProjectInsert, du as ProjectModels, ai as ProjectResourceCounts, u as ProjectScopeConfig, ag as ProjectSelect, ak as ProjectUpdate, bc as PushNotificationAuthenticationInfo, bd as PushNotificationConfig, b7 as PushNotificationNotSupportedError, aV as SecurityScheme, aL as SecuritySchemeBase, bo as SendMessageRequest, bw as SendMessageResponse, bv as SendMessageSuccessResponse, bp as SendStreamingMessageRequest, by as SendStreamingMessageResponse, bx as SendStreamingMessageSuccessResponse, bs as SetTaskPushNotificationConfigRequest, bE as SetTaskPushNotificationConfigResponse, bD as SetTaskPushNotificationConfigSuccessResponse, dw as StatusComponent, dv as StatusUpdateSettings, bM as SubAgentApiInsert, bL as SubAgentApiSelect, bN as SubAgentApiUpdate, cL as SubAgentArtifactComponentApiInsert, cK as SubAgentArtifactComponentApiSelect, cM as SubAgentArtifactComponentApiUpdate, cI as SubAgentArtifactComponentInsert, cH as SubAgentArtifactComponentSelect, cJ as SubAgentArtifactComponentUpdate, cC as SubAgentDataComponentApiInsert, cB as SubAgentDataComponentApiSelect, cD as SubAgentDataComponentApiUpdate, cz as SubAgentDataComponentInsert, cy as SubAgentDataComponentSelect, cA as SubAgentDataComponentUpdate, di as SubAgentDefinition, d3 as SubAgentExternalAgentRelationApiInsert, d2 as SubAgentExternalAgentRelationApiSelect, d4 as SubAgentExternalAgentRelationApiUpdate, al as SubAgentExternalAgentRelationInsert, d0 as SubAgentExternalAgentRelationSelect, d1 as SubAgentExternalAgentRelationUpdate, ap as SubAgentInsert, bQ as SubAgentRelationApiInsert, bP as SubAgentRelationApiSelect, bR as SubAgentRelationApiUpdate, am as SubAgentRelationInsert, bS as SubAgentRelationQuery, bO as SubAgentRelationSelect, an as SubAgentRelationUpdate, N as SubAgentScopeConfig, ar as SubAgentSelect, d8 as SubAgentTeamAgentRelationApiInsert, d7 as SubAgentTeamAgentRelationApiSelect, d9 as SubAgentTeamAgentRelationApiUpdate, as as SubAgentTeamAgentRelationInsert, d5 as SubAgentTeamAgentRelationSelect, d6 as SubAgentTeamAgentRelationUpdate, c_ as SubAgentToolRelationApiInsert, cZ as SubAgentToolRelationApiSelect, c$ as SubAgentToolRelationApiUpdate, cY as SubAgentToolRelationInsert, cX as SubAgentToolRelationSelect, ao as SubAgentToolRelationUpdate, aq as SubAgentUpdate, dp as SummaryEvent, dF as TOOL_STATUS_VALUES, aZ as Task, b_ as TaskApiInsert, bZ as TaskApiSelect, b$ as TaskApiUpdate, bK as TaskArtifact, a$ as TaskArtifactUpdateEvent, bf as TaskIdParams, at as TaskInsert, T as TaskMetadataConfig, b6 as TaskNotCancelableError, b5 as TaskNotFoundError, be as TaskPushNotificationConfig, bg as TaskQueryParams, c4 as TaskRelationApiInsert, c3 as TaskRelationApiSelect, c5 as TaskRelationApiUpdate, c1 as TaskRelationInsert, c0 as TaskRelationSelect, c2 as TaskRelationUpdate, bu as TaskResubscriptionRequest, au as TaskSelect, aH as TaskState, aY as TaskStatus, a_ as TaskStatusUpdateEvent, bY as TaskUpdate, aB as TextPart, c7 as ToolApiInsert, c6 as ToolApiSelect, c8 as ToolApiUpdate, dj as ToolDefinition, aw as ToolInsert, m as ToolMcpConfig, Z as ToolSelect, n as ToolServerCapabilities, ax as ToolUpdate, b8 as UnsupportedOperationError, dG as VALID_RELATION_TYPES } from '../utility-C4QAannk.js';
3
- import { Context } from 'hono';
1
+ export { bc as A2AError, bI as A2ARequest, bJ as A2AResponse, aN as APIKeySecurityScheme, bX as AgentApiInsert, bW as AgentApiSelect, bY as AgentApiUpdate, aJ as AgentCapabilities, aX as AgentCard, dy as AgentConversationHistoryConfig, y as AgentInsert, aK as AgentProvider, w as AgentScopeConfig, B as AgentSelect, aL as AgentSkill, z as AgentUpdate, cQ as AllAgentSelect, cU as ApiKeyApiCreationResponse, cS as ApiKeyApiInsert, cR as ApiKeyApiSelect, cT as ApiKeyApiUpdate, I as ApiKeyCreateResult, E as ApiKeyInsert, D as ApiKeySelect, G as ApiKeyUpdate, a9 as Artifact, cF as ArtifactComponentApiInsert, cE as ArtifactComponentApiSelect, cG as ArtifactComponentApiUpdate, K as ArtifactComponentInsert, J as ArtifactComponentSelect, L as ArtifactComponentUpdate, aQ as AuthorizationCodeOAuthFlow, dh as CanDelegateToExternalAgent, dg as CanUseItem, bs as CancelTaskRequest, bD as CancelTaskResponse, bC as CancelTaskSuccessResponse, aR as ClientCredentialsOAuthFlow, ba as ContentTypeNotSupportedError, ct as ContextCacheApiInsert, cs as ContextCacheApiSelect, cu as ContextCacheApiUpdate, dz as ContextCacheEntry, Q as ContextCacheInsert, O as ContextCacheSelect, cr as ContextCacheUpdate, cn as ContextConfigApiInsert, cm as ContextConfigApiSelect, co as ContextConfigApiUpdate, R as ContextConfigInsert, s as ContextConfigSelect, U as ContextConfigUpdate, l as ContextFetchDefinition, ch as ConversationApiInsert, cg as ConversationApiSelect, ci as ConversationApiUpdate, C as ConversationHistoryConfig, W as ConversationInsert, o as ConversationMetadata, dx as ConversationScopeOptions, V as ConversationSelect, X as ConversationUpdate, H as CreateApiKeyParams, r as CredentialReferenceApiInsert, cV as CredentialReferenceApiSelect, cW as CredentialReferenceApiUpdate, $ as CredentialReferenceInsert, Y as CredentialReferenceSelect, a0 as CredentialReferenceUpdate, h as CredentialStoreType, cw as DataComponentApiInsert, cv as DataComponentApiSelect, cx as DataComponentApiUpdate, a2 as DataComponentInsert, a1 as DataComponentSelect, a3 as DataComponentUpdate, aH as DataPart, ay as ExecutionContext, cO as ExternalAgentApiInsert, cN as ExternalAgentApiSelect, cP as ExternalAgentApiUpdate, a4 as ExternalAgentInsert, _ as ExternalAgentSelect, a5 as ExternalAgentUpdate, bV as ExternalSubAgentRelationApiInsert, bU as ExternalSubAgentRelationInsert, cq as FetchConfig, cp as FetchDefinition, aD as FileBase, aG as FilePart, aE as FileWithBytes, aF as FileWithUri, dI as Filter, df as FullAgentAgentInsert, v as FullAgentDefinition, ae as FullProjectDefinition, a6 as FunctionApiInsert, cd as FunctionApiSelect, ce as FunctionApiUpdate, cb as FunctionInsert, ca as FunctionSelect, a7 as FunctionToolApiInsert, cf as FunctionToolApiSelect, a8 as FunctionToolApiUpdate, cc as FunctionUpdate, bu as GetTaskPushNotificationConfigRequest, bH as GetTaskPushNotificationConfigResponse, bG as GetTaskPushNotificationConfigSuccessResponse, br as GetTaskRequest, bB as GetTaskResponse, bA as GetTaskSuccessResponse, aO as HTTPAuthSecurityScheme, aS as ImplicitOAuthFlow, b5 as InternalError, bb as InvalidAgentResponseError, b4 as InvalidParamsError, b2 as InvalidRequestError, b1 as JSONParseError, bm as JSONRPCError, bo as JSONRPCErrorResponse, bk as JSONRPCMessage, bl as JSONRPCRequest, bn as JSONRPCResult, dd as LedgerArtifactApiInsert, dc as LedgerArtifactApiSelect, de as LedgerArtifactApiUpdate, da as LedgerArtifactInsert, aa as LedgerArtifactSelect, db as LedgerArtifactUpdate, dH as MCPServerType, t as MCPToolConfig, i as MCPTransportType, dA as McpAuthType, dB as McpServerAuth, dD as McpServerCapabilities, av as McpTool, dE as McpToolDefinition, dC as McpTransportConfig, aY as Message, ck as MessageApiInsert, cj as MessageApiSelect, cl as MessageApiUpdate, p as MessageContent, ac as MessageInsert, q as MessageMetadata, ds as MessageMode, bK as MessagePart, dr as MessageRole, az as MessageSelect, bi as MessageSendConfiguration, bj as MessageSendParams, dq as MessageType, ad as MessageUpdate, ab as MessageVisibility, b3 as MethodNotFoundError, dt as Models, aU as OAuth2SecurityScheme, aP as OAuthFlows, aV as OpenIdConnectSecurityScheme, dn as Pagination, x as PaginationConfig, ah as PaginationResult, P as Part, aB as PartBase, aT as PasswordOAuthFlow, dl as ProjectApiInsert, dk as ProjectApiSelect, dm as ProjectApiUpdate, af as ProjectInfo, aj as ProjectInsert, du as ProjectModels, ai as ProjectResourceCounts, u as ProjectScopeConfig, ag as ProjectSelect, ak as ProjectUpdate, bd as PushNotificationAuthenticationInfo, be as PushNotificationConfig, b8 as PushNotificationNotSupportedError, aW as SecurityScheme, aM as SecuritySchemeBase, bp as SendMessageRequest, bx as SendMessageResponse, bw as SendMessageSuccessResponse, bq as SendStreamingMessageRequest, bz as SendStreamingMessageResponse, by as SendStreamingMessageSuccessResponse, bt as SetTaskPushNotificationConfigRequest, bF as SetTaskPushNotificationConfigResponse, bE as SetTaskPushNotificationConfigSuccessResponse, dw as StatusComponent, dv as StatusUpdateSettings, bN as SubAgentApiInsert, bM as SubAgentApiSelect, bO as SubAgentApiUpdate, cL as SubAgentArtifactComponentApiInsert, cK as SubAgentArtifactComponentApiSelect, cM as SubAgentArtifactComponentApiUpdate, cI as SubAgentArtifactComponentInsert, cH as SubAgentArtifactComponentSelect, cJ as SubAgentArtifactComponentUpdate, cC as SubAgentDataComponentApiInsert, cB as SubAgentDataComponentApiSelect, cD as SubAgentDataComponentApiUpdate, cz as SubAgentDataComponentInsert, cy as SubAgentDataComponentSelect, cA as SubAgentDataComponentUpdate, di as SubAgentDefinition, d3 as SubAgentExternalAgentRelationApiInsert, d2 as SubAgentExternalAgentRelationApiSelect, d4 as SubAgentExternalAgentRelationApiUpdate, al as SubAgentExternalAgentRelationInsert, d0 as SubAgentExternalAgentRelationSelect, d1 as SubAgentExternalAgentRelationUpdate, ap as SubAgentInsert, bR as SubAgentRelationApiInsert, bQ as SubAgentRelationApiSelect, bS as SubAgentRelationApiUpdate, am as SubAgentRelationInsert, bT as SubAgentRelationQuery, bP as SubAgentRelationSelect, an as SubAgentRelationUpdate, N as SubAgentScopeConfig, ar as SubAgentSelect, d8 as SubAgentTeamAgentRelationApiInsert, d7 as SubAgentTeamAgentRelationApiSelect, d9 as SubAgentTeamAgentRelationApiUpdate, as as SubAgentTeamAgentRelationInsert, d5 as SubAgentTeamAgentRelationSelect, d6 as SubAgentTeamAgentRelationUpdate, c_ as SubAgentToolRelationApiInsert, cZ as SubAgentToolRelationApiSelect, c$ as SubAgentToolRelationApiUpdate, cY as SubAgentToolRelationInsert, cX as SubAgentToolRelationSelect, ao as SubAgentToolRelationUpdate, aq as SubAgentUpdate, dp as SummaryEvent, dF as TOOL_STATUS_VALUES, a_ as Task, b$ as TaskApiInsert, b_ as TaskApiSelect, c0 as TaskApiUpdate, bL as TaskArtifact, b0 as TaskArtifactUpdateEvent, bg as TaskIdParams, at as TaskInsert, T as TaskMetadataConfig, b7 as TaskNotCancelableError, b6 as TaskNotFoundError, bf as TaskPushNotificationConfig, bh as TaskQueryParams, c5 as TaskRelationApiInsert, c4 as TaskRelationApiSelect, c6 as TaskRelationApiUpdate, c2 as TaskRelationInsert, c1 as TaskRelationSelect, c3 as TaskRelationUpdate, bv as TaskResubscriptionRequest, au as TaskSelect, aI as TaskState, aZ as TaskStatus, a$ as TaskStatusUpdateEvent, bZ as TaskUpdate, aC as TextPart, c8 as ToolApiInsert, c7 as ToolApiSelect, c9 as ToolApiUpdate, dj as ToolDefinition, aw as ToolInsert, m as ToolMcpConfig, Z as ToolSelect, n as ToolServerCapabilities, ax as ToolUpdate, b9 as UnsupportedOperationError, dG as VALID_RELATION_TYPES } from '../utility-Lo5NoRHK.js';
2
+ export { a as CorsConfig, C as CredentialStore, b as ServerConfig, S as ServerOptions } from '../server-BXoUiBMg.js';
4
3
  import 'zod';
5
4
  import 'drizzle-zod';
6
5
  import 'drizzle-orm/pg-core';
7
6
  import '@hono/zod-openapi';
7
+ import 'hono';
8
8
 
9
9
  /**
10
- * Credential store interface for managing different types of credentials
10
+ * Tool policy configuration for individual tools within an MCP server
11
11
  */
12
- interface CredentialStore {
12
+ interface ToolPolicy {
13
13
  /**
14
- * Unique identifier for this credential store
14
+ * Whether this specific tool requires user approval before execution
15
+ * If true, tool execution will pause and wait for explicit user approval
16
+ * If false/undefined, tool executes immediately when called
15
17
  */
16
- id: string;
17
- /**
18
- * Type of credential store
19
- */
20
- type: keyof typeof CredentialStoreType;
21
- /**
22
- * Get a credential by key
23
- */
24
- get(key: string): Promise<string | null>;
25
- /**
26
- * Set a credential
27
- */
28
- set(key: string, value: string, metadata?: Record<string, string>): Promise<void>;
29
- /**
30
- * Check if a credential exists
31
- */
32
- has(key: string): Promise<boolean>;
33
- /**
34
- * Delete a credential
35
- */
36
- delete(key: string): Promise<boolean>;
37
- /**
38
- * Check if the credential store is available and functional
39
- * @returns Promise resolving to availability status and optional reason if unavailable
40
- */
41
- checkAvailability(): Promise<{
42
- available: boolean;
43
- reason?: string;
44
- }>;
18
+ needsApproval?: boolean;
45
19
  }
46
20
  /**
47
- * Server configuration options for HTTP server behavior
48
- * These settings control connection management, timeouts, and server behavior
21
+ * Flexible tool selection format for MCP servers
22
+ * Can be either a simple string (tool name) or an object with policies
49
23
  */
50
- interface ServerOptions {
51
- /**
52
- * Server port to listen on
53
- * Default: 3000
54
- */
55
- port?: number;
56
- /**
57
- * Keep alive timeout in milliseconds
58
- * Time to wait for additional data after the last response before closing the connection.
59
- * Used for persistent connections to improve performance by reusing connections.
60
- * Scenario: Set higher (10-30s) for high-traffic APIs, lower (1-5s) for low-traffic services.
61
- * Default: 60000ms (60 seconds)
62
- */
63
- keepAliveTimeout?: number;
64
- /**
65
- * Enable keep alive connections
66
- * When true, allows connection reuse for multiple requests.
67
- * Improves performance but uses more server resources.
68
- * Scenario: Enable for APIs with frequent requests, disable for one-off services.
69
- * Default: true
70
- */
71
- keepAlive?: boolean;
72
- /**
73
- * Request timeout in milliseconds
74
- * Maximum time to wait for a complete request from the client.
75
- * Helps prevent DoS attacks by limiting resource consumption from slow clients.
76
- * Scenario: Set lower (30s) for simple APIs, higher (5-10min) for file upload services.
77
- * Default: 60000ms (60 seconds)
78
- */
79
- requestTimeout?: number;
80
- }
24
+ type McpToolSelection = string | {
25
+ name: string;
26
+ needsApproval?: boolean;
27
+ };
81
28
  /**
82
- * CORS configuration compatible with Hono's CORSOptions
29
+ * Input format for configuring MCP tool usage in agents
83
30
  */
84
- interface CorsConfig {
85
- /**
86
- * Allowed origins - string, array of strings, or function
87
- */
88
- origin?: string | string[] | ((origin: string, c?: Context) => string | null | undefined);
89
- /**
90
- * Allowed methods
91
- */
92
- allowMethods?: string[];
93
- /**
94
- * Allowed headers
95
- */
96
- allowHeaders?: string[];
97
- /**
98
- * Exposed headers
99
- */
100
- exposeHeaders?: string[];
101
- /**
102
- * Max age for preflight requests
103
- */
104
- maxAge?: number;
105
- /**
106
- * Whether to allow credentials
107
- */
108
- credentials?: boolean;
31
+ interface AgentMcpConfigInput {
32
+ selectedTools?: McpToolSelection[];
33
+ headers?: Record<string, string>;
109
34
  }
110
35
  /**
111
- * Base server configuration for all Inkeep services
36
+ * Normalized format stored in database and used at runtime
112
37
  */
113
- interface ServerConfig {
114
- /**
115
- * Server port to listen on
116
- */
117
- port?: number;
118
- /**
119
- * Server options for HTTP behavior
120
- */
121
- serverOptions?: ServerOptions;
122
- /**
123
- * Array of credential stores for managing API keys, tokens, etc.
124
- */
125
- credentialStores?: CredentialStore[];
126
- /**
127
- * CORS configuration
128
- */
129
- cors?: CorsConfig;
38
+ interface AgentMcpConfig {
39
+ server: any;
40
+ selectedTools?: string[];
41
+ headers?: Record<string, string>;
42
+ toolPolicies?: Record<string, ToolPolicy>;
130
43
  }
44
+ /**
45
+ * Helper function to normalize McpToolSelection[] into separate arrays
46
+ */
47
+ declare function normalizeToolSelections(selections?: McpToolSelection[]): {
48
+ selectedTools: string[];
49
+ toolPolicies: Record<string, ToolPolicy>;
50
+ };
131
51
 
132
- export { type CorsConfig, type CredentialStore, CredentialStoreType, type ServerConfig, type ServerOptions };
52
+ export { type AgentMcpConfig, type AgentMcpConfigInput, type McpToolSelection, type ToolPolicy, normalizeToolSelections };
@@ -1,2 +1,2 @@
1
- export { TaskState } from '../chunk-H2F72PDA.js';
1
+ export { TaskState, normalizeToolSelections } from '../chunk-CMNLBV2A.js';
2
2
  export { CredentialStoreType, MCPServerType, MCPTransportType, TOOL_STATUS_VALUES, VALID_RELATION_TYPES } from '../chunk-YFHT5M2R.js';