@eagi/sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+
2
+ > @eagi/sdk@0.1.0 build /home/runner/work/eagi-mcp-framework/eagi-mcp-framework/packages/sdk
3
+ > tsup src/index.ts --format cjs,esm --dts
4
+
5
+ CLI Building entry: src/index.ts
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v8.5.1
8
+ CLI Target: es2022
9
+ CJS Build start
10
+ ESM Build start
11
+ CJS dist/index.js 16.41 KB
12
+ CJS ⚡️ Build success in 49ms
13
+ ESM dist/index.mjs 13.96 KB
14
+ ESM ⚡️ Build success in 50ms
15
+ DTS Build start
16
+ DTS ⚡️ Build success in 2156ms
17
+ DTS dist/index.d.ts 8.52 KB
18
+ DTS dist/index.d.mts 8.52 KB
package/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ EAGI Sustainable Use License
2
+
3
+ Version 1.0, June 2026
4
+
5
+ Copyright (c) 2026 EAGI Authors
6
+
7
+ This License governs the use of the EAGI MCP Framework (including its SDK, CLI, and Gateway). By using, copying, modifying, or distributing this software, you agree to comply with the terms of this License.
8
+
9
+ 1. Grant of License
10
+ Subject to the restrictions in Section 2, the authors hereby grant you a free, worldwide, non-exclusive, non-transferable, revocable license to:
11
+ a) Use, copy, and run the software for personal, educational, research, and internal business operations.
12
+ b) Modify the software's source code for your personal or internal business operations.
13
+ c) Distribute modifications of the software, provided that any recipient is bound by the terms of this License.
14
+
15
+ 2. Restrictions on Commercial and Competitive Use
16
+ You may NOT do any of the following without obtaining prior, written, explicit commercial licensing permission from the copyright holders:
17
+ a) Offer the software or any modified version thereof as a hosted service, Software-as-a-Service (SaaS), Platform-as-a-Service (PaaS), or managed cloud product where the core value or primary functionality derived by users comes from this software.
18
+ b) Sell, rent, lease, or sub-license the software, or any modified version thereof, for a fee.
19
+ c) Embed, bundle, or white-label the software (or any modified version thereof) inside a commercial application, platform, or hardware product that is distributed or sold to third parties.
20
+
21
+ 3. Professional Services Exception
22
+ You ARE permitted to charge for professional services related to this software (such as custom domain consulting, building workflows, training, deployment help, or infrastructure management) provided that your clients host and manage their own instances under their own names and comply with Section 1 and 2 of this License.
23
+
24
+ 4. Intellectual Property
25
+ All rights, title, and interest in and to the software, including copyright and other intellectual property rights, remain the exclusive property of the authors.
26
+
27
+ 5. Disclaimer of Warranty
28
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,272 @@
1
+ import { ZodType, z } from 'zod';
2
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
+
4
+ interface Identity {
5
+ userId: string;
6
+ role: string;
7
+ email?: string;
8
+ claims: Record<string, unknown>;
9
+ }
10
+ interface DomainManifest {
11
+ name: string;
12
+ version: string;
13
+ description?: string;
14
+ dependencies?: string[];
15
+ roles?: Record<string, {
16
+ description?: string;
17
+ includes?: string[];
18
+ }>;
19
+ triggers?: any[];
20
+ }
21
+ interface ToolResult {
22
+ content: Array<{
23
+ type: 'text';
24
+ text: string;
25
+ } | {
26
+ type: 'image';
27
+ data: string;
28
+ mimeType: string;
29
+ }>;
30
+ isError?: boolean;
31
+ }
32
+ interface HookContextMap {
33
+ 'before:tool:call': {
34
+ toolName: string;
35
+ input: unknown;
36
+ identity: Identity;
37
+ domain: DomainManifest;
38
+ };
39
+ 'after:tool:call': {
40
+ toolName: string;
41
+ input: unknown;
42
+ output: ToolResult;
43
+ identity: Identity;
44
+ duration: number;
45
+ };
46
+ 'on:tool:error': {
47
+ toolName: string;
48
+ input: unknown;
49
+ error: Error;
50
+ identity: Identity;
51
+ };
52
+ 'before:resource:read': {
53
+ uri: string;
54
+ identity: Identity;
55
+ };
56
+ 'after:resource:read': {
57
+ uri: string;
58
+ data: string;
59
+ identity: Identity;
60
+ };
61
+ 'on:server:start': {
62
+ config: any;
63
+ domains: DomainManifest[];
64
+ };
65
+ 'on:server:stop': {
66
+ uptime: number;
67
+ requestCount: number;
68
+ };
69
+ 'on:domain:load': {
70
+ domain: DomainManifest;
71
+ };
72
+ }
73
+ interface FilterDataMap {
74
+ 'filter:tool:input': unknown;
75
+ 'filter:tool:output': ToolResult;
76
+ 'filter:resource:data': string;
77
+ 'filter:tools:list': any[];
78
+ 'filter:audit:entry': any;
79
+ }
80
+ type ActionHandler<K extends keyof HookContextMap> = (ctx: HookContextMap[K]) => Promise<void> | void;
81
+ type FilterHandler<K extends keyof FilterDataMap> = (data: FilterDataMap[K], ctx?: any) => Promise<FilterDataMap[K]> | FilterDataMap[K];
82
+
83
+ declare class HookEngine {
84
+ private actions;
85
+ private filters;
86
+ addAction<K extends keyof HookContextMap>(hookName: K, handler: ActionHandler<K>, priority?: number): void;
87
+ addFilter<K extends keyof FilterDataMap>(hookName: K, handler: FilterHandler<K>, priority?: number): void;
88
+ doAction<K extends keyof HookContextMap>(hookName: K, context: HookContextMap[K]): Promise<void>;
89
+ applyFilters<K extends keyof FilterDataMap>(hookName: K, data: FilterDataMap[K], context?: any): Promise<FilterDataMap[K]>;
90
+ }
91
+
92
+ interface ToolContext {
93
+ identity: Identity;
94
+ domain: DomainManifest;
95
+ hooks: HookEngine;
96
+ logger: any;
97
+ services: Record<string, any>;
98
+ tools: {
99
+ call: <T = unknown>(toolName: string, input: Record<string, unknown>) => Promise<T>;
100
+ };
101
+ resources: {
102
+ get: <T = unknown>(uri: string) => Promise<T>;
103
+ };
104
+ }
105
+ interface ResourceContext {
106
+ identity: Identity;
107
+ domain: DomainManifest;
108
+ hooks: HookEngine;
109
+ logger: any;
110
+ services: Record<string, any>;
111
+ }
112
+ interface ToolDefinition<TInput extends ZodType = ZodType> {
113
+ name: string;
114
+ description: string;
115
+ input: TInput;
116
+ auth?: {
117
+ roles: string[];
118
+ };
119
+ audit?: boolean | {
120
+ redactFields?: string[];
121
+ };
122
+ approval?: {
123
+ required: boolean;
124
+ message: string | ((input: z.infer<TInput>) => string);
125
+ timeout?: string;
126
+ };
127
+ handler: (input: z.infer<TInput>, ctx: ToolContext) => Promise<ToolResult>;
128
+ }
129
+ type ExtractParams<T extends string> = T extends `${string}{${infer Param}}${infer Rest}` ? Param | ExtractParams<Rest> : never;
130
+ interface ResourceDefinition<TUri extends string = string> {
131
+ uri: TUri;
132
+ name: string;
133
+ description: string;
134
+ mimeType: string;
135
+ auth?: {
136
+ roles: string[];
137
+ };
138
+ handler: (params: Record<ExtractParams<TUri>, string>, ctx: ResourceContext) => Promise<string>;
139
+ }
140
+ interface PromptMessage {
141
+ role: 'user' | 'assistant';
142
+ content: {
143
+ type: 'text';
144
+ text: string;
145
+ } | {
146
+ type: 'image';
147
+ data: string;
148
+ mimeType: string;
149
+ };
150
+ }
151
+ interface PromptDefinition<TArgs extends ZodType = ZodType> {
152
+ name: string;
153
+ description: string;
154
+ arguments: TArgs;
155
+ handler: (args: z.infer<TArgs>, ctx: ResourceContext) => Promise<{
156
+ messages: PromptMessage[];
157
+ }>;
158
+ }
159
+ interface DomainConfig {
160
+ env: Record<string, string | undefined>;
161
+ }
162
+ type ResolvedDeps<TDeps extends readonly string[], TServiceMap> = {
163
+ [K in TDeps[number]]: K extends keyof TServiceMap ? TServiceMap[K] : never;
164
+ };
165
+ interface ServiceDefinition<TName extends string = string, TDeps extends readonly string[] = readonly string[], TInstance = any> {
166
+ name: TName;
167
+ deps?: TDeps;
168
+ factory: (config: DomainConfig, deps: ResolvedDeps<TDeps, any>) => Promise<TInstance>;
169
+ dispose?: (instance: TInstance) => Promise<void>;
170
+ }
171
+ interface EagiConfig {
172
+ name: string;
173
+ version: string;
174
+ gateway?: {
175
+ port: number;
176
+ auth?: {
177
+ provider: string;
178
+ issuer: string;
179
+ audience: string;
180
+ };
181
+ };
182
+ audit?: {
183
+ hashChain?: boolean;
184
+ output?: 'file' | 'stdout';
185
+ redactInputs?: boolean;
186
+ };
187
+ hooks?: {
188
+ [K in keyof HookContextMap]?: (ctx: HookContextMap[K]) => Promise<void> | void;
189
+ } & {
190
+ [K in keyof FilterDataMap]?: (data: FilterDataMap[K], ctx?: any) => Promise<FilterDataMap[K]> | FilterDataMap[K];
191
+ };
192
+ domains?: Record<string, {
193
+ enabled: boolean;
194
+ }>;
195
+ }
196
+
197
+ interface LoadedDomain {
198
+ manifest: DomainManifest;
199
+ services: ServiceDefinition[];
200
+ tools: ToolDefinition[];
201
+ resources: ResourceDefinition[];
202
+ prompts: PromptDefinition[];
203
+ hooksModule?: any;
204
+ dir: string;
205
+ }
206
+ declare class DomainLoader {
207
+ load(domainDir: string): Promise<LoadedDomain>;
208
+ private loadDirectory;
209
+ }
210
+ declare function sortServices(services: ServiceDefinition[]): ServiceDefinition[];
211
+
212
+ declare class DomainRegistry {
213
+ private domains;
214
+ register(domain: LoadedDomain): void;
215
+ get(name: string): LoadedDomain | undefined;
216
+ getAll(): LoadedDomain[];
217
+ getAllTools(): ToolDefinition[];
218
+ getAllResources(): ResourceDefinition[];
219
+ getAllPrompts(): PromptDefinition[];
220
+ }
221
+
222
+ declare function defineTool<TInput extends ZodType>(definition: ToolDefinition<TInput>): ToolDefinition<TInput>;
223
+
224
+ declare function defineResource<TUri extends string>(definition: ResourceDefinition<TUri>): ResourceDefinition<TUri>;
225
+
226
+ declare function definePrompt<TArgs extends ZodType>(definition: PromptDefinition<TArgs>): PromptDefinition<TArgs>;
227
+
228
+ declare function defineService<TName extends string, TDeps extends readonly string[], TInstance>(definition: ServiceDefinition<TName, TDeps, TInstance>): ServiceDefinition<TName, TDeps, TInstance>;
229
+
230
+ type HookRegistration = {
231
+ [K in keyof HookContextMap]?: ActionHandler<K>;
232
+ } & {
233
+ [K in keyof FilterDataMap]?: FilterHandler<K>;
234
+ };
235
+ declare function defineHooks(hooks: HookRegistration): HookRegistration;
236
+
237
+ declare function defineConfig(config: EagiConfig): EagiConfig;
238
+
239
+ declare class EagiServerBuilder {
240
+ private config;
241
+ private registry;
242
+ private hooks;
243
+ private servicesMap;
244
+ constructor(config: EagiConfig, registry: DomainRegistry, hooks: HookEngine, servicesMap: Record<string, any>);
245
+ build(): Server;
246
+ private registerTools;
247
+ private registerResources;
248
+ private registerPrompts;
249
+ }
250
+
251
+ declare class EagiRunner {
252
+ private config;
253
+ private registry;
254
+ private hooks;
255
+ private servicesMap;
256
+ constructor(config: EagiConfig);
257
+ start(domainDirs: string[]): Promise<void>;
258
+ }
259
+
260
+ declare class AuthError extends Error {
261
+ constructor(message: string);
262
+ }
263
+ declare function authMiddleware(tool: ToolDefinition, ctx: ToolContext): Promise<void>;
264
+
265
+ declare function auditMiddleware(tool: ToolDefinition, input: any, output: ToolResult, ctx: ToolContext): Promise<void>;
266
+
267
+ declare class ApprovalRequiredError extends Error {
268
+ constructor(message: string);
269
+ }
270
+ declare function approvalMiddleware(tool: ToolDefinition, input: any, ctx: ToolContext): Promise<void>;
271
+
272
+ export { type ActionHandler, ApprovalRequiredError, AuthError, type DomainConfig, DomainLoader, type DomainManifest, DomainRegistry, type EagiConfig, EagiRunner, EagiServerBuilder, type FilterDataMap, type FilterHandler, type HookContextMap, HookEngine, type Identity, type LoadedDomain, type PromptDefinition, type PromptMessage, type ResourceContext, type ResourceDefinition, type ServiceDefinition, type ToolContext, type ToolDefinition, type ToolResult, approvalMiddleware, auditMiddleware, authMiddleware, defineConfig, defineHooks, definePrompt, defineResource, defineService, defineTool, sortServices };
@@ -0,0 +1,272 @@
1
+ import { ZodType, z } from 'zod';
2
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
+
4
+ interface Identity {
5
+ userId: string;
6
+ role: string;
7
+ email?: string;
8
+ claims: Record<string, unknown>;
9
+ }
10
+ interface DomainManifest {
11
+ name: string;
12
+ version: string;
13
+ description?: string;
14
+ dependencies?: string[];
15
+ roles?: Record<string, {
16
+ description?: string;
17
+ includes?: string[];
18
+ }>;
19
+ triggers?: any[];
20
+ }
21
+ interface ToolResult {
22
+ content: Array<{
23
+ type: 'text';
24
+ text: string;
25
+ } | {
26
+ type: 'image';
27
+ data: string;
28
+ mimeType: string;
29
+ }>;
30
+ isError?: boolean;
31
+ }
32
+ interface HookContextMap {
33
+ 'before:tool:call': {
34
+ toolName: string;
35
+ input: unknown;
36
+ identity: Identity;
37
+ domain: DomainManifest;
38
+ };
39
+ 'after:tool:call': {
40
+ toolName: string;
41
+ input: unknown;
42
+ output: ToolResult;
43
+ identity: Identity;
44
+ duration: number;
45
+ };
46
+ 'on:tool:error': {
47
+ toolName: string;
48
+ input: unknown;
49
+ error: Error;
50
+ identity: Identity;
51
+ };
52
+ 'before:resource:read': {
53
+ uri: string;
54
+ identity: Identity;
55
+ };
56
+ 'after:resource:read': {
57
+ uri: string;
58
+ data: string;
59
+ identity: Identity;
60
+ };
61
+ 'on:server:start': {
62
+ config: any;
63
+ domains: DomainManifest[];
64
+ };
65
+ 'on:server:stop': {
66
+ uptime: number;
67
+ requestCount: number;
68
+ };
69
+ 'on:domain:load': {
70
+ domain: DomainManifest;
71
+ };
72
+ }
73
+ interface FilterDataMap {
74
+ 'filter:tool:input': unknown;
75
+ 'filter:tool:output': ToolResult;
76
+ 'filter:resource:data': string;
77
+ 'filter:tools:list': any[];
78
+ 'filter:audit:entry': any;
79
+ }
80
+ type ActionHandler<K extends keyof HookContextMap> = (ctx: HookContextMap[K]) => Promise<void> | void;
81
+ type FilterHandler<K extends keyof FilterDataMap> = (data: FilterDataMap[K], ctx?: any) => Promise<FilterDataMap[K]> | FilterDataMap[K];
82
+
83
+ declare class HookEngine {
84
+ private actions;
85
+ private filters;
86
+ addAction<K extends keyof HookContextMap>(hookName: K, handler: ActionHandler<K>, priority?: number): void;
87
+ addFilter<K extends keyof FilterDataMap>(hookName: K, handler: FilterHandler<K>, priority?: number): void;
88
+ doAction<K extends keyof HookContextMap>(hookName: K, context: HookContextMap[K]): Promise<void>;
89
+ applyFilters<K extends keyof FilterDataMap>(hookName: K, data: FilterDataMap[K], context?: any): Promise<FilterDataMap[K]>;
90
+ }
91
+
92
+ interface ToolContext {
93
+ identity: Identity;
94
+ domain: DomainManifest;
95
+ hooks: HookEngine;
96
+ logger: any;
97
+ services: Record<string, any>;
98
+ tools: {
99
+ call: <T = unknown>(toolName: string, input: Record<string, unknown>) => Promise<T>;
100
+ };
101
+ resources: {
102
+ get: <T = unknown>(uri: string) => Promise<T>;
103
+ };
104
+ }
105
+ interface ResourceContext {
106
+ identity: Identity;
107
+ domain: DomainManifest;
108
+ hooks: HookEngine;
109
+ logger: any;
110
+ services: Record<string, any>;
111
+ }
112
+ interface ToolDefinition<TInput extends ZodType = ZodType> {
113
+ name: string;
114
+ description: string;
115
+ input: TInput;
116
+ auth?: {
117
+ roles: string[];
118
+ };
119
+ audit?: boolean | {
120
+ redactFields?: string[];
121
+ };
122
+ approval?: {
123
+ required: boolean;
124
+ message: string | ((input: z.infer<TInput>) => string);
125
+ timeout?: string;
126
+ };
127
+ handler: (input: z.infer<TInput>, ctx: ToolContext) => Promise<ToolResult>;
128
+ }
129
+ type ExtractParams<T extends string> = T extends `${string}{${infer Param}}${infer Rest}` ? Param | ExtractParams<Rest> : never;
130
+ interface ResourceDefinition<TUri extends string = string> {
131
+ uri: TUri;
132
+ name: string;
133
+ description: string;
134
+ mimeType: string;
135
+ auth?: {
136
+ roles: string[];
137
+ };
138
+ handler: (params: Record<ExtractParams<TUri>, string>, ctx: ResourceContext) => Promise<string>;
139
+ }
140
+ interface PromptMessage {
141
+ role: 'user' | 'assistant';
142
+ content: {
143
+ type: 'text';
144
+ text: string;
145
+ } | {
146
+ type: 'image';
147
+ data: string;
148
+ mimeType: string;
149
+ };
150
+ }
151
+ interface PromptDefinition<TArgs extends ZodType = ZodType> {
152
+ name: string;
153
+ description: string;
154
+ arguments: TArgs;
155
+ handler: (args: z.infer<TArgs>, ctx: ResourceContext) => Promise<{
156
+ messages: PromptMessage[];
157
+ }>;
158
+ }
159
+ interface DomainConfig {
160
+ env: Record<string, string | undefined>;
161
+ }
162
+ type ResolvedDeps<TDeps extends readonly string[], TServiceMap> = {
163
+ [K in TDeps[number]]: K extends keyof TServiceMap ? TServiceMap[K] : never;
164
+ };
165
+ interface ServiceDefinition<TName extends string = string, TDeps extends readonly string[] = readonly string[], TInstance = any> {
166
+ name: TName;
167
+ deps?: TDeps;
168
+ factory: (config: DomainConfig, deps: ResolvedDeps<TDeps, any>) => Promise<TInstance>;
169
+ dispose?: (instance: TInstance) => Promise<void>;
170
+ }
171
+ interface EagiConfig {
172
+ name: string;
173
+ version: string;
174
+ gateway?: {
175
+ port: number;
176
+ auth?: {
177
+ provider: string;
178
+ issuer: string;
179
+ audience: string;
180
+ };
181
+ };
182
+ audit?: {
183
+ hashChain?: boolean;
184
+ output?: 'file' | 'stdout';
185
+ redactInputs?: boolean;
186
+ };
187
+ hooks?: {
188
+ [K in keyof HookContextMap]?: (ctx: HookContextMap[K]) => Promise<void> | void;
189
+ } & {
190
+ [K in keyof FilterDataMap]?: (data: FilterDataMap[K], ctx?: any) => Promise<FilterDataMap[K]> | FilterDataMap[K];
191
+ };
192
+ domains?: Record<string, {
193
+ enabled: boolean;
194
+ }>;
195
+ }
196
+
197
+ interface LoadedDomain {
198
+ manifest: DomainManifest;
199
+ services: ServiceDefinition[];
200
+ tools: ToolDefinition[];
201
+ resources: ResourceDefinition[];
202
+ prompts: PromptDefinition[];
203
+ hooksModule?: any;
204
+ dir: string;
205
+ }
206
+ declare class DomainLoader {
207
+ load(domainDir: string): Promise<LoadedDomain>;
208
+ private loadDirectory;
209
+ }
210
+ declare function sortServices(services: ServiceDefinition[]): ServiceDefinition[];
211
+
212
+ declare class DomainRegistry {
213
+ private domains;
214
+ register(domain: LoadedDomain): void;
215
+ get(name: string): LoadedDomain | undefined;
216
+ getAll(): LoadedDomain[];
217
+ getAllTools(): ToolDefinition[];
218
+ getAllResources(): ResourceDefinition[];
219
+ getAllPrompts(): PromptDefinition[];
220
+ }
221
+
222
+ declare function defineTool<TInput extends ZodType>(definition: ToolDefinition<TInput>): ToolDefinition<TInput>;
223
+
224
+ declare function defineResource<TUri extends string>(definition: ResourceDefinition<TUri>): ResourceDefinition<TUri>;
225
+
226
+ declare function definePrompt<TArgs extends ZodType>(definition: PromptDefinition<TArgs>): PromptDefinition<TArgs>;
227
+
228
+ declare function defineService<TName extends string, TDeps extends readonly string[], TInstance>(definition: ServiceDefinition<TName, TDeps, TInstance>): ServiceDefinition<TName, TDeps, TInstance>;
229
+
230
+ type HookRegistration = {
231
+ [K in keyof HookContextMap]?: ActionHandler<K>;
232
+ } & {
233
+ [K in keyof FilterDataMap]?: FilterHandler<K>;
234
+ };
235
+ declare function defineHooks(hooks: HookRegistration): HookRegistration;
236
+
237
+ declare function defineConfig(config: EagiConfig): EagiConfig;
238
+
239
+ declare class EagiServerBuilder {
240
+ private config;
241
+ private registry;
242
+ private hooks;
243
+ private servicesMap;
244
+ constructor(config: EagiConfig, registry: DomainRegistry, hooks: HookEngine, servicesMap: Record<string, any>);
245
+ build(): Server;
246
+ private registerTools;
247
+ private registerResources;
248
+ private registerPrompts;
249
+ }
250
+
251
+ declare class EagiRunner {
252
+ private config;
253
+ private registry;
254
+ private hooks;
255
+ private servicesMap;
256
+ constructor(config: EagiConfig);
257
+ start(domainDirs: string[]): Promise<void>;
258
+ }
259
+
260
+ declare class AuthError extends Error {
261
+ constructor(message: string);
262
+ }
263
+ declare function authMiddleware(tool: ToolDefinition, ctx: ToolContext): Promise<void>;
264
+
265
+ declare function auditMiddleware(tool: ToolDefinition, input: any, output: ToolResult, ctx: ToolContext): Promise<void>;
266
+
267
+ declare class ApprovalRequiredError extends Error {
268
+ constructor(message: string);
269
+ }
270
+ declare function approvalMiddleware(tool: ToolDefinition, input: any, ctx: ToolContext): Promise<void>;
271
+
272
+ export { type ActionHandler, ApprovalRequiredError, AuthError, type DomainConfig, DomainLoader, type DomainManifest, DomainRegistry, type EagiConfig, EagiRunner, EagiServerBuilder, type FilterDataMap, type FilterHandler, type HookContextMap, HookEngine, type Identity, type LoadedDomain, type PromptDefinition, type PromptMessage, type ResourceContext, type ResourceDefinition, type ServiceDefinition, type ToolContext, type ToolDefinition, type ToolResult, approvalMiddleware, auditMiddleware, authMiddleware, defineConfig, defineHooks, definePrompt, defineResource, defineService, defineTool, sortServices };