@enactprotocol/shared 1.0.12

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 (97) hide show
  1. package/dist/LocalToolResolver.d.ts +84 -0
  2. package/dist/LocalToolResolver.js +353 -0
  3. package/dist/api/enact-api.d.ts +124 -0
  4. package/dist/api/enact-api.js +406 -0
  5. package/dist/api/index.d.ts +2 -0
  6. package/dist/api/index.js +2 -0
  7. package/dist/api/types.d.ts +83 -0
  8. package/dist/api/types.js +1 -0
  9. package/dist/core/DaggerExecutionProvider.d.ts +169 -0
  10. package/dist/core/DaggerExecutionProvider.js +996 -0
  11. package/dist/core/DirectExecutionProvider.d.ts +23 -0
  12. package/dist/core/DirectExecutionProvider.js +406 -0
  13. package/dist/core/EnactCore.d.ts +138 -0
  14. package/dist/core/EnactCore.js +609 -0
  15. package/dist/core/index.d.ts +3 -0
  16. package/dist/core/index.js +3 -0
  17. package/dist/exec/index.d.ts +3 -0
  18. package/dist/exec/index.js +3 -0
  19. package/dist/exec/logger.d.ts +11 -0
  20. package/dist/exec/logger.js +57 -0
  21. package/dist/exec/validate.d.ts +5 -0
  22. package/dist/exec/validate.js +167 -0
  23. package/dist/index.d.ts +25 -0
  24. package/dist/index.js +29 -0
  25. package/dist/lib/enact-direct.d.ts +156 -0
  26. package/dist/lib/enact-direct.js +158 -0
  27. package/dist/lib/index.d.ts +1 -0
  28. package/dist/lib/index.js +1 -0
  29. package/dist/security/index.d.ts +3 -0
  30. package/dist/security/index.js +3 -0
  31. package/dist/security/security.d.ts +23 -0
  32. package/dist/security/security.js +137 -0
  33. package/dist/security/sign.d.ts +103 -0
  34. package/dist/security/sign.js +532 -0
  35. package/dist/security/verification-enforcer.d.ts +41 -0
  36. package/dist/security/verification-enforcer.js +181 -0
  37. package/dist/services/McpCoreService.d.ts +102 -0
  38. package/dist/services/McpCoreService.js +120 -0
  39. package/dist/services/index.d.ts +1 -0
  40. package/dist/services/index.js +1 -0
  41. package/dist/types.d.ts +130 -0
  42. package/dist/types.js +3 -0
  43. package/dist/utils/config.d.ts +32 -0
  44. package/dist/utils/config.js +78 -0
  45. package/dist/utils/env-loader.d.ts +54 -0
  46. package/dist/utils/env-loader.js +270 -0
  47. package/dist/utils/help.d.ts +36 -0
  48. package/dist/utils/help.js +248 -0
  49. package/dist/utils/index.d.ts +7 -0
  50. package/dist/utils/index.js +7 -0
  51. package/dist/utils/logger.d.ts +35 -0
  52. package/dist/utils/logger.js +75 -0
  53. package/dist/utils/silent-monitor.d.ts +67 -0
  54. package/dist/utils/silent-monitor.js +242 -0
  55. package/dist/utils/timeout.d.ts +5 -0
  56. package/dist/utils/timeout.js +23 -0
  57. package/dist/utils/version.d.ts +4 -0
  58. package/dist/utils/version.js +14 -0
  59. package/dist/web/env-manager-server.d.ts +29 -0
  60. package/dist/web/env-manager-server.js +367 -0
  61. package/dist/web/index.d.ts +1 -0
  62. package/dist/web/index.js +1 -0
  63. package/package.json +79 -0
  64. package/src/LocalToolResolver.ts +424 -0
  65. package/src/api/enact-api.ts +569 -0
  66. package/src/api/index.ts +2 -0
  67. package/src/api/types.ts +93 -0
  68. package/src/core/DaggerExecutionProvider.ts +1308 -0
  69. package/src/core/DirectExecutionProvider.ts +484 -0
  70. package/src/core/EnactCore.ts +833 -0
  71. package/src/core/index.ts +3 -0
  72. package/src/exec/index.ts +3 -0
  73. package/src/exec/logger.ts +63 -0
  74. package/src/exec/validate.ts +238 -0
  75. package/src/index.ts +42 -0
  76. package/src/lib/enact-direct.ts +258 -0
  77. package/src/lib/index.ts +1 -0
  78. package/src/security/index.ts +3 -0
  79. package/src/security/security.ts +188 -0
  80. package/src/security/sign.ts +797 -0
  81. package/src/security/verification-enforcer.ts +268 -0
  82. package/src/services/McpCoreService.ts +203 -0
  83. package/src/services/index.ts +1 -0
  84. package/src/types.ts +190 -0
  85. package/src/utils/config.ts +97 -0
  86. package/src/utils/env-loader.ts +370 -0
  87. package/src/utils/help.ts +257 -0
  88. package/src/utils/index.ts +7 -0
  89. package/src/utils/logger.ts +83 -0
  90. package/src/utils/silent-monitor.ts +328 -0
  91. package/src/utils/timeout.ts +26 -0
  92. package/src/utils/version.ts +16 -0
  93. package/src/web/env-manager-server.ts +465 -0
  94. package/src/web/index.ts +1 -0
  95. package/src/web/static/app.js +663 -0
  96. package/src/web/static/index.html +117 -0
  97. package/src/web/static/style.css +291 -0
@@ -0,0 +1,84 @@
1
+ import { EnactCore } from "./core/EnactCore";
2
+ export interface LocalTool {
3
+ name: string;
4
+ path: string;
5
+ definition: any;
6
+ lastModified: Date;
7
+ cached: boolean;
8
+ }
9
+ export interface ToolResolutionResult {
10
+ tool: LocalTool | any;
11
+ source: "local" | "registry" | "cache";
12
+ metadata?: any;
13
+ }
14
+ export declare class LocalToolResolver {
15
+ private enactCore;
16
+ private localToolsDir;
17
+ private cacheDir;
18
+ private toolCache;
19
+ private aliases;
20
+ private favorites;
21
+ constructor(enactCore: EnactCore, localToolsDir?: string, cacheDir?: string);
22
+ /**
23
+ * Main resolution method - checks local first, then registry
24
+ */
25
+ resolveTool(toolName: string): Promise<ToolResolutionResult | null>;
26
+ /**
27
+ * Get tool from local directory
28
+ */
29
+ private getLocalTool;
30
+ /**
31
+ * Cache a registry tool locally for faster access
32
+ */
33
+ private cacheRegistryTool;
34
+ /**
35
+ * Check if cached tool is expired (24 hours by default)
36
+ */
37
+ private isCacheExpired;
38
+ /**
39
+ * List all available tools from all sources
40
+ */
41
+ listAllTools(): Promise<{
42
+ local: LocalTool[];
43
+ cached: LocalTool[];
44
+ favorites: string[];
45
+ aliases: Record<string, string>;
46
+ }>;
47
+ /**
48
+ * Scan local tools directory
49
+ */
50
+ private scanLocalTools;
51
+ /**
52
+ * Recursively scan directory for tool files
53
+ */
54
+ private scanDirectory;
55
+ /**
56
+ * Add a tool to favorites for priority resolution
57
+ */
58
+ addToFavorites(toolName: string): void;
59
+ /**
60
+ * Add an alias for a tool
61
+ */
62
+ addAlias(alias: string, toolName: string): void;
63
+ /**
64
+ * Get suggestions based on partial tool name
65
+ */
66
+ getSuggestions(partial: string): Promise<string[]>;
67
+ /**
68
+ * Clear expired cache entries
69
+ */
70
+ cleanupCache(): Promise<number>;
71
+ /**
72
+ * Load configuration from file
73
+ */
74
+ private loadConfiguration;
75
+ /**
76
+ * Save configuration to file
77
+ */
78
+ private saveConfiguration;
79
+ /**
80
+ * Initialize local tools directory with examples
81
+ */
82
+ initialize(): Promise<void>;
83
+ }
84
+ export default LocalToolResolver;
@@ -0,0 +1,353 @@
1
+ import { promises as fs, readFileSync, writeFileSync } from "fs";
2
+ import { join, resolve, basename } from "path";
3
+ import * as yaml from "yaml";
4
+ import logger from "./exec/logger";
5
+ export class LocalToolResolver {
6
+ constructor(enactCore, localToolsDir = "./tools", cacheDir = "./.tool-cache") {
7
+ this.enactCore = enactCore;
8
+ this.toolCache = new Map();
9
+ this.aliases = new Map();
10
+ this.favorites = new Set();
11
+ this.localToolsDir = resolve(localToolsDir);
12
+ this.cacheDir = resolve(cacheDir);
13
+ this.loadConfiguration();
14
+ }
15
+ /**
16
+ * Main resolution method - checks local first, then registry
17
+ */
18
+ async resolveTool(toolName) {
19
+ // Check aliases first
20
+ const resolvedName = this.aliases.get(toolName) || toolName;
21
+ // 1. Check local directory first
22
+ const localTool = await this.getLocalTool(resolvedName);
23
+ if (localTool) {
24
+ return {
25
+ tool: localTool,
26
+ source: "local",
27
+ metadata: { path: localTool.path },
28
+ };
29
+ }
30
+ // 2. Check cache for registry tools
31
+ const cachedTool = this.toolCache.get(resolvedName);
32
+ if (cachedTool && !this.isCacheExpired(cachedTool)) {
33
+ return {
34
+ tool: cachedTool,
35
+ source: "cache",
36
+ metadata: { cachedAt: cachedTool.lastModified },
37
+ };
38
+ }
39
+ // 3. Fall back to registry
40
+ try {
41
+ const registryTool = await this.enactCore.getToolByName(resolvedName);
42
+ if (registryTool) {
43
+ // Cache the registry tool locally
44
+ await this.cacheRegistryTool(resolvedName, registryTool);
45
+ return {
46
+ tool: registryTool,
47
+ source: "registry",
48
+ metadata: { cached: true },
49
+ };
50
+ }
51
+ }
52
+ catch (error) {
53
+ logger.debug(`Registry lookup failed for ${resolvedName}:`, error);
54
+ }
55
+ return null;
56
+ }
57
+ /**
58
+ * Get tool from local directory
59
+ */
60
+ async getLocalTool(toolName) {
61
+ const possiblePaths = [
62
+ join(this.localToolsDir, `${toolName}.yaml`),
63
+ join(this.localToolsDir, `${toolName}.yml`),
64
+ join(this.localToolsDir, toolName, "tool.yaml"),
65
+ join(this.localToolsDir, toolName, "tool.yml"),
66
+ join(this.localToolsDir, toolName, `${toolName}.yaml`),
67
+ join(this.localToolsDir, toolName, `${toolName}.yml`),
68
+ ];
69
+ for (const toolPath of possiblePaths) {
70
+ try {
71
+ const stats = await fs.stat(toolPath);
72
+ const content = await fs.readFile(toolPath, "utf-8");
73
+ const definition = yaml.parse(content);
74
+ if (definition &&
75
+ (definition.name === toolName || definition.name === undefined)) {
76
+ return {
77
+ name: definition.name || toolName,
78
+ path: toolPath,
79
+ definition,
80
+ lastModified: stats.mtime,
81
+ cached: false,
82
+ };
83
+ }
84
+ }
85
+ catch (error) {
86
+ // File doesn't exist or can't be read, continue to next path
87
+ continue;
88
+ }
89
+ }
90
+ return null;
91
+ }
92
+ /**
93
+ * Cache a registry tool locally for faster access
94
+ */
95
+ async cacheRegistryTool(toolName, tool) {
96
+ try {
97
+ await fs.mkdir(this.cacheDir, { recursive: true });
98
+ const cachePath = join(this.cacheDir, `${toolName}.yaml`);
99
+ const cacheData = {
100
+ ...tool,
101
+ _cached: true,
102
+ _cachedAt: new Date().toISOString(),
103
+ _source: "registry",
104
+ };
105
+ await fs.writeFile(cachePath, yaml.stringify(cacheData));
106
+ this.toolCache.set(toolName, {
107
+ name: toolName,
108
+ path: cachePath,
109
+ definition: tool,
110
+ lastModified: new Date(),
111
+ cached: true,
112
+ });
113
+ logger.debug(`Cached registry tool: ${toolName}`);
114
+ }
115
+ catch (error) {
116
+ logger.warn(`Failed to cache tool ${toolName}:`, error);
117
+ }
118
+ }
119
+ /**
120
+ * Check if cached tool is expired (24 hours by default)
121
+ */
122
+ isCacheExpired(tool, maxAge = 24 * 60 * 60 * 1000) {
123
+ return Date.now() - tool.lastModified.getTime() > maxAge;
124
+ }
125
+ /**
126
+ * List all available tools from all sources
127
+ */
128
+ async listAllTools() {
129
+ const localTools = await this.scanLocalTools();
130
+ const cachedTools = Array.from(this.toolCache.values());
131
+ return {
132
+ local: localTools,
133
+ cached: cachedTools,
134
+ favorites: Array.from(this.favorites),
135
+ aliases: Object.fromEntries(this.aliases),
136
+ };
137
+ }
138
+ /**
139
+ * Scan local tools directory
140
+ */
141
+ async scanLocalTools() {
142
+ const tools = [];
143
+ try {
144
+ await fs.mkdir(this.localToolsDir, { recursive: true });
145
+ const entries = await this.scanDirectory(this.localToolsDir);
146
+ for (const entry of entries) {
147
+ if (entry.endsWith(".yaml") || entry.endsWith(".yml")) {
148
+ try {
149
+ const content = await fs.readFile(entry, "utf-8");
150
+ const definition = yaml.parse(content);
151
+ if (definition && (definition.name || definition.command)) {
152
+ const stats = await fs.stat(entry);
153
+ tools.push({
154
+ name: definition.name ||
155
+ basename(entry, ".yaml").replace(".yml", ""),
156
+ path: entry,
157
+ definition,
158
+ lastModified: stats.mtime,
159
+ cached: false,
160
+ });
161
+ }
162
+ }
163
+ catch (error) {
164
+ logger.debug(`Skipping invalid tool file ${entry}:`, error);
165
+ }
166
+ }
167
+ }
168
+ }
169
+ catch (error) {
170
+ logger.warn(`Failed to scan local tools directory:`, error);
171
+ }
172
+ return tools;
173
+ }
174
+ /**
175
+ * Recursively scan directory for tool files
176
+ */
177
+ async scanDirectory(dir) {
178
+ const files = [];
179
+ try {
180
+ const entries = await fs.readdir(dir, { withFileTypes: true });
181
+ for (const entry of entries) {
182
+ const fullPath = join(dir, entry.name);
183
+ if (entry.isDirectory()) {
184
+ const subFiles = await this.scanDirectory(fullPath);
185
+ files.push(...subFiles);
186
+ }
187
+ else if (entry.isFile()) {
188
+ files.push(fullPath);
189
+ }
190
+ }
191
+ }
192
+ catch (error) {
193
+ logger.debug(`Cannot scan directory ${dir}:`, error);
194
+ }
195
+ return files;
196
+ }
197
+ /**
198
+ * Add a tool to favorites for priority resolution
199
+ */
200
+ addToFavorites(toolName) {
201
+ this.favorites.add(toolName);
202
+ this.saveConfiguration();
203
+ }
204
+ /**
205
+ * Add an alias for a tool
206
+ */
207
+ addAlias(alias, toolName) {
208
+ this.aliases.set(alias, toolName);
209
+ this.saveConfiguration();
210
+ }
211
+ /**
212
+ * Get suggestions based on partial tool name
213
+ */
214
+ async getSuggestions(partial) {
215
+ const allTools = await this.listAllTools();
216
+ const suggestions = new Set();
217
+ // Add local tools
218
+ allTools.local.forEach((tool) => {
219
+ if (tool.name.includes(partial)) {
220
+ suggestions.add(tool.name);
221
+ }
222
+ });
223
+ // Add favorites first
224
+ this.favorites.forEach((fav) => {
225
+ if (fav.includes(partial)) {
226
+ suggestions.add(fav);
227
+ }
228
+ });
229
+ // Add aliases
230
+ this.aliases.forEach((toolName, alias) => {
231
+ if (alias.includes(partial) || toolName.includes(partial)) {
232
+ suggestions.add(alias);
233
+ }
234
+ });
235
+ return Array.from(suggestions).slice(0, 10); // Limit suggestions
236
+ }
237
+ /**
238
+ * Clear expired cache entries
239
+ */
240
+ async cleanupCache() {
241
+ let cleaned = 0;
242
+ for (const [toolName, tool] of this.toolCache.entries()) {
243
+ if (this.isCacheExpired(tool)) {
244
+ try {
245
+ await fs.unlink(tool.path);
246
+ this.toolCache.delete(toolName);
247
+ cleaned++;
248
+ }
249
+ catch (error) {
250
+ logger.debug(`Failed to clean cache for ${toolName}:`, error);
251
+ }
252
+ }
253
+ }
254
+ logger.info(`Cleaned ${cleaned} expired cache entries`);
255
+ return cleaned;
256
+ }
257
+ /**
258
+ * Load configuration from file
259
+ */
260
+ loadConfiguration() {
261
+ try {
262
+ const configPath = join(this.localToolsDir, "config.json");
263
+ const config = JSON.parse(readFileSync(configPath, "utf-8"));
264
+ if (config.aliases) {
265
+ this.aliases = new Map(Object.entries(config.aliases));
266
+ }
267
+ if (config.favorites) {
268
+ this.favorites = new Set(config.favorites);
269
+ }
270
+ }
271
+ catch (error) {
272
+ // Config file doesn't exist or is invalid, use defaults
273
+ logger.debug("No tool configuration found, using defaults");
274
+ }
275
+ }
276
+ /**
277
+ * Save configuration to file
278
+ */
279
+ saveConfiguration() {
280
+ try {
281
+ const configPath = join(this.localToolsDir, "config.json");
282
+ const config = {
283
+ aliases: Object.fromEntries(this.aliases),
284
+ favorites: Array.from(this.favorites),
285
+ lastUpdated: new Date().toISOString(),
286
+ };
287
+ writeFileSync(configPath, JSON.stringify(config, null, 2));
288
+ }
289
+ catch (error) {
290
+ logger.warn("Failed to save tool configuration:", error);
291
+ }
292
+ }
293
+ /**
294
+ * Initialize local tools directory with examples
295
+ */
296
+ async initialize() {
297
+ await fs.mkdir(this.localToolsDir, { recursive: true });
298
+ await fs.mkdir(this.cacheDir, { recursive: true });
299
+ // Create a sample local tool if directory is empty
300
+ const tools = await this.scanLocalTools();
301
+ if (tools.length === 0) {
302
+ const sampleTool = {
303
+ name: "hello-world",
304
+ description: "A simple hello world tool",
305
+ version: "1.0.0",
306
+ command: 'echo "Hello, World!"',
307
+ inputSchema: {
308
+ properties: {
309
+ message: {
310
+ type: "string",
311
+ description: "Custom message to display",
312
+ },
313
+ },
314
+ },
315
+ };
316
+ const samplePath = join(this.localToolsDir, "hello-world.yaml");
317
+ await fs.writeFile(samplePath, yaml.stringify(sampleTool));
318
+ logger.info(`Created sample tool at ${samplePath}`);
319
+ }
320
+ // Create README
321
+ const readmePath = join(this.localToolsDir, "README.md");
322
+ const readme = `# Local Tools Directory
323
+
324
+ This directory contains your local Enact tools. Tools can be organized as:
325
+
326
+ ## File Structure
327
+ - \`tool-name.yaml\` - Single tool file
328
+ - \`tool-name/tool.yaml\` - Tool in subdirectory
329
+ - \`tool-name/tool-name.yaml\` - Named tool in subdirectory
330
+
331
+ ## Configuration
332
+ - \`config.json\` - Aliases and favorites configuration
333
+
334
+ ## Cache
335
+ Registry tools are cached in \`.tool-cache/\` for faster access.
336
+
337
+ ## Priority Order
338
+ 1. Favorites (if name matches)
339
+ 2. Local tools
340
+ 3. Cached registry tools
341
+ 4. Registry lookup
342
+
343
+ Use the MCP tools to manage this directory programmatically.
344
+ `;
345
+ try {
346
+ await fs.access(readmePath);
347
+ }
348
+ catch {
349
+ await fs.writeFile(readmePath, readme);
350
+ }
351
+ }
352
+ }
353
+ export default LocalToolResolver;
@@ -0,0 +1,124 @@
1
+ import { EnactToolDefinition, ToolUsage, ToolSearchQuery, CLITokenCreate, OAuthTokenExchange } from "./types";
2
+ export declare class EnactApiClient {
3
+ baseUrl: string;
4
+ supabaseUrl: string;
5
+ constructor(baseUrl?: string, supabaseUrl?: string);
6
+ private makeRequest;
7
+ /**
8
+ * Get all tools (public, no auth required)
9
+ */
10
+ getTools(params?: {
11
+ limit?: number;
12
+ offset?: number;
13
+ tags?: string[];
14
+ author?: string;
15
+ }): Promise<EnactToolDefinition[]>;
16
+ /**
17
+ * Get specific tool details (public, no auth required)
18
+ */
19
+ getTool(name: string): Promise<EnactToolDefinition>;
20
+ /**
21
+ * Get tool usage statistics (public, no auth required)
22
+ */
23
+ getToolUsage(name: string): Promise<any>;
24
+ /**
25
+ * Log tool usage (public, no auth required)
26
+ */
27
+ logToolUsage(name: string, usage: ToolUsage): Promise<any>;
28
+ /**
29
+ * Search tools with semantic/text search (public, no auth required)
30
+ */
31
+ searchTools(query: ToolSearchQuery): Promise<EnactToolDefinition[]>;
32
+ /**
33
+ * Publish/create new tool (requires authentication)
34
+ */
35
+ publishTool(tool: EnactToolDefinition, token: string, tokenType?: "jwt" | "cli"): Promise<any>;
36
+ /**
37
+ * Update existing tool (requires authentication, must be owner)
38
+ */
39
+ updateTool(name: string, tool: EnactToolDefinition, token: string, tokenType?: "jwt" | "cli"): Promise<any>;
40
+ /**
41
+ * Delete tool (requires authentication, must be owner)
42
+ */
43
+ deleteTool(name: string, token: string, tokenType?: "jwt" | "cli"): Promise<any>;
44
+ /**
45
+ * Create new CLI token (requires JWT authentication)
46
+ */
47
+ createCLIToken(tokenData: CLITokenCreate, jwtToken: string): Promise<{
48
+ token: string;
49
+ id: string;
50
+ name?: string;
51
+ }>;
52
+ /**
53
+ * List user's CLI tokens (requires JWT authentication)
54
+ */
55
+ getCLITokens(jwtToken: string): Promise<any[]>;
56
+ /**
57
+ * Delete CLI token (requires JWT authentication, must be owner)
58
+ */
59
+ deleteCLIToken(tokenId: string, jwtToken: string): Promise<any>;
60
+ /**
61
+ * Exchange OAuth authorization code for access token
62
+ */
63
+ exchangeOAuthCode(oauthData: OAuthTokenExchange): Promise<{
64
+ access_token: string;
65
+ token_type: string;
66
+ expires_in: number;
67
+ scope?: string;
68
+ }>;
69
+ /**
70
+ * Generate embeddings for tools (requires authentication)
71
+ */
72
+ generateEmbeddings(data: {
73
+ toolId: string;
74
+ text: string;
75
+ }, token: string, tokenType?: "jwt" | "cli"): Promise<any>;
76
+ /**
77
+ * Check if a tool exists
78
+ */
79
+ toolExists(name: string): Promise<boolean>;
80
+ /**
81
+ * Publish or update tool based on existence
82
+ */
83
+ publishOrUpdateTool(tool: EnactToolDefinition, token: string, tokenType?: "jwt" | "cli"): Promise<{
84
+ isUpdate: boolean;
85
+ result: any;
86
+ }>;
87
+ /**
88
+ * Search tools by tags
89
+ */
90
+ getToolsByTags(tags: string[], limit?: number): Promise<EnactToolDefinition[]>;
91
+ /**
92
+ * Get tools by author
93
+ */
94
+ getToolsByAuthor(author: string, limit?: number): Promise<EnactToolDefinition[]>;
95
+ /**
96
+ * Get a user's public key
97
+ */
98
+ getUserPublicKey(userId: string): Promise<any>;
99
+ /**
100
+ * Generate OAuth authorization URL
101
+ */
102
+ generateOAuthUrl(options: {
103
+ clientId: string;
104
+ redirectUri: string;
105
+ scope: string;
106
+ state: string;
107
+ codeChallenge: string;
108
+ codeChallengeMethod: string;
109
+ }): string;
110
+ /**
111
+ * Validate tool definition before publishing
112
+ */
113
+ validateTool(tool: any): {
114
+ valid: boolean;
115
+ errors: string[];
116
+ };
117
+ }
118
+ export declare const enactApi: EnactApiClient;
119
+ export declare class EnactApiError extends Error {
120
+ statusCode?: number | undefined;
121
+ endpoint?: string | undefined;
122
+ constructor(message: string, statusCode?: number | undefined, endpoint?: string | undefined);
123
+ }
124
+ export declare function createEnactApiClient(baseUrl?: string, supabaseUrl?: string): EnactApiClient;