@enactprotocol/shared 1.2.13 → 2.0.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.
Files changed (134) hide show
  1. package/README.md +44 -0
  2. package/package.json +16 -58
  3. package/src/config.ts +476 -0
  4. package/src/constants.ts +36 -0
  5. package/src/execution/command.ts +314 -0
  6. package/src/execution/index.ts +73 -0
  7. package/src/execution/runtime.ts +308 -0
  8. package/src/execution/types.ts +379 -0
  9. package/src/execution/validation.ts +508 -0
  10. package/src/index.ts +237 -30
  11. package/src/manifest/index.ts +36 -0
  12. package/src/manifest/loader.ts +187 -0
  13. package/src/manifest/parser.ts +173 -0
  14. package/src/manifest/validator.ts +309 -0
  15. package/src/paths.ts +108 -0
  16. package/src/registry.ts +219 -0
  17. package/src/resolver.ts +345 -0
  18. package/src/types/index.ts +30 -0
  19. package/src/types/manifest.ts +255 -0
  20. package/src/types.ts +5 -188
  21. package/src/utils/fs.ts +281 -0
  22. package/src/utils/logger.ts +270 -59
  23. package/src/utils/version.ts +304 -36
  24. package/tests/config.test.ts +515 -0
  25. package/tests/execution/command.test.ts +317 -0
  26. package/tests/execution/validation.test.ts +384 -0
  27. package/tests/fixtures/invalid-tool.yaml +4 -0
  28. package/tests/fixtures/valid-tool.md +62 -0
  29. package/tests/fixtures/valid-tool.yaml +40 -0
  30. package/tests/index.test.ts +8 -0
  31. package/tests/manifest/loader.test.ts +291 -0
  32. package/tests/manifest/parser.test.ts +345 -0
  33. package/tests/manifest/validator.test.ts +394 -0
  34. package/tests/manifest-types.test.ts +358 -0
  35. package/tests/paths.test.ts +153 -0
  36. package/tests/registry.test.ts +231 -0
  37. package/tests/resolver.test.ts +272 -0
  38. package/tests/utils/fs.test.ts +388 -0
  39. package/tests/utils/logger.test.ts +480 -0
  40. package/tests/utils/version.test.ts +390 -0
  41. package/tsconfig.json +12 -0
  42. package/tsconfig.tsbuildinfo +1 -0
  43. package/dist/LocalToolResolver.d.ts +0 -84
  44. package/dist/LocalToolResolver.js +0 -353
  45. package/dist/api/enact-api.d.ts +0 -130
  46. package/dist/api/enact-api.js +0 -428
  47. package/dist/api/index.d.ts +0 -2
  48. package/dist/api/index.js +0 -2
  49. package/dist/api/types.d.ts +0 -103
  50. package/dist/api/types.js +0 -1
  51. package/dist/constants.d.ts +0 -7
  52. package/dist/constants.js +0 -10
  53. package/dist/core/DaggerExecutionProvider.d.ts +0 -169
  54. package/dist/core/DaggerExecutionProvider.js +0 -1029
  55. package/dist/core/DirectExecutionProvider.d.ts +0 -23
  56. package/dist/core/DirectExecutionProvider.js +0 -406
  57. package/dist/core/EnactCore.d.ts +0 -162
  58. package/dist/core/EnactCore.js +0 -597
  59. package/dist/core/NativeExecutionProvider.d.ts +0 -9
  60. package/dist/core/NativeExecutionProvider.js +0 -16
  61. package/dist/core/index.d.ts +0 -3
  62. package/dist/core/index.js +0 -3
  63. package/dist/exec/index.d.ts +0 -3
  64. package/dist/exec/index.js +0 -3
  65. package/dist/exec/logger.d.ts +0 -11
  66. package/dist/exec/logger.js +0 -57
  67. package/dist/exec/validate.d.ts +0 -5
  68. package/dist/exec/validate.js +0 -167
  69. package/dist/index.d.ts +0 -21
  70. package/dist/index.js +0 -25
  71. package/dist/lib/enact-direct.d.ts +0 -150
  72. package/dist/lib/enact-direct.js +0 -159
  73. package/dist/lib/index.d.ts +0 -1
  74. package/dist/lib/index.js +0 -1
  75. package/dist/security/index.d.ts +0 -3
  76. package/dist/security/index.js +0 -3
  77. package/dist/security/security.d.ts +0 -23
  78. package/dist/security/security.js +0 -137
  79. package/dist/security/sign.d.ts +0 -103
  80. package/dist/security/sign.js +0 -666
  81. package/dist/security/verification-enforcer.d.ts +0 -53
  82. package/dist/security/verification-enforcer.js +0 -204
  83. package/dist/services/McpCoreService.d.ts +0 -98
  84. package/dist/services/McpCoreService.js +0 -124
  85. package/dist/services/index.d.ts +0 -1
  86. package/dist/services/index.js +0 -1
  87. package/dist/types.d.ts +0 -132
  88. package/dist/types.js +0 -3
  89. package/dist/utils/config.d.ts +0 -111
  90. package/dist/utils/config.js +0 -342
  91. package/dist/utils/env-loader.d.ts +0 -54
  92. package/dist/utils/env-loader.js +0 -270
  93. package/dist/utils/help.d.ts +0 -36
  94. package/dist/utils/help.js +0 -248
  95. package/dist/utils/index.d.ts +0 -7
  96. package/dist/utils/index.js +0 -7
  97. package/dist/utils/logger.d.ts +0 -35
  98. package/dist/utils/logger.js +0 -75
  99. package/dist/utils/silent-monitor.d.ts +0 -67
  100. package/dist/utils/silent-monitor.js +0 -242
  101. package/dist/utils/timeout.d.ts +0 -5
  102. package/dist/utils/timeout.js +0 -23
  103. package/dist/utils/version.d.ts +0 -4
  104. package/dist/utils/version.js +0 -35
  105. package/dist/web/env-manager-server.d.ts +0 -29
  106. package/dist/web/env-manager-server.js +0 -367
  107. package/dist/web/index.d.ts +0 -1
  108. package/dist/web/index.js +0 -1
  109. package/src/LocalToolResolver.ts +0 -424
  110. package/src/api/enact-api.ts +0 -604
  111. package/src/api/index.ts +0 -2
  112. package/src/api/types.ts +0 -114
  113. package/src/core/DaggerExecutionProvider.ts +0 -1357
  114. package/src/core/DirectExecutionProvider.ts +0 -484
  115. package/src/core/EnactCore.ts +0 -847
  116. package/src/core/index.ts +0 -3
  117. package/src/exec/index.ts +0 -3
  118. package/src/exec/logger.ts +0 -63
  119. package/src/exec/validate.ts +0 -238
  120. package/src/lib/enact-direct.ts +0 -254
  121. package/src/lib/index.ts +0 -1
  122. package/src/services/McpCoreService.ts +0 -201
  123. package/src/services/index.ts +0 -1
  124. package/src/utils/config.ts +0 -438
  125. package/src/utils/env-loader.ts +0 -370
  126. package/src/utils/help.ts +0 -257
  127. package/src/utils/index.ts +0 -7
  128. package/src/utils/silent-monitor.ts +0 -328
  129. package/src/utils/timeout.ts +0 -26
  130. package/src/web/env-manager-server.ts +0 -465
  131. package/src/web/index.ts +0 -1
  132. package/src/web/static/app.js +0 -663
  133. package/src/web/static/index.html +0 -117
  134. package/src/web/static/style.css +0 -291
@@ -1,53 +0,0 @@
1
- import type { EnactTool, ExecutionResult } from "../types";
2
- export interface SecurityPolicy {
3
- allowSkipVerification: boolean;
4
- allowUnsigned: boolean;
5
- requireInteractiveConfirmation: boolean;
6
- defaultVerificationPolicy: "permissive" | "enterprise" | "paranoid";
7
- }
8
- export interface VerificationEnforcementOptions {
9
- skipVerification?: boolean;
10
- verifyPolicy?: "permissive" | "enterprise" | "paranoid";
11
- force?: boolean;
12
- allowUnsigned?: boolean;
13
- isLocalFile?: boolean;
14
- interactive?: boolean;
15
- }
16
- export interface VerificationEnforcementResult {
17
- allowed: boolean;
18
- reason: string;
19
- verificationResult?: {
20
- isValid: boolean;
21
- message: string;
22
- validSignatures: number;
23
- totalSignatures: number;
24
- verifiedSigners: Array<{
25
- signer: string;
26
- role?: string;
27
- keyId: string;
28
- }>;
29
- errors: string[];
30
- };
31
- error?: {
32
- message: string;
33
- code: string;
34
- details?: any;
35
- };
36
- }
37
- /**
38
- * Enforce mandatory signature verification for tool execution
39
- * This is the central function that should be called before ANY tool execution
40
- */
41
- /**
42
- * Get security policy based on execution context
43
- */
44
- export declare function getSecurityPolicy(options: VerificationEnforcementOptions): SecurityPolicy;
45
- export declare function enforceSignatureVerification(tool: EnactTool, options?: VerificationEnforcementOptions): Promise<VerificationEnforcementResult>;
46
- /**
47
- * Create an execution result for verification failure
48
- */
49
- export declare function createVerificationFailureResult(tool: EnactTool, verificationResult: VerificationEnforcementResult, executionId: string): ExecutionResult;
50
- /**
51
- * Log security audit information for tool execution
52
- */
53
- export declare function logSecurityAudit(tool: EnactTool, verificationResult: VerificationEnforcementResult, executionAllowed: boolean, options: VerificationEnforcementOptions): void;
@@ -1,204 +0,0 @@
1
- // src/security/verification-enforcer.ts - Mandatory signature verification enforcement
2
- import { verifyTool, VERIFICATION_POLICIES, } from "./sign";
3
- import logger from "../exec/logger";
4
- /**
5
- * Enforce mandatory signature verification for tool execution
6
- * This is the central function that should be called before ANY tool execution
7
- */
8
- /**
9
- * Get security policy based on execution context
10
- */
11
- export function getSecurityPolicy(options) {
12
- // Local files have different security policies
13
- if (options.isLocalFile) {
14
- return {
15
- allowSkipVerification: true,
16
- allowUnsigned: true,
17
- requireInteractiveConfirmation: false,
18
- defaultVerificationPolicy: "permissive",
19
- };
20
- }
21
- // Production/registry tools have strict policies
22
- return {
23
- allowSkipVerification: false,
24
- allowUnsigned: false,
25
- requireInteractiveConfirmation: !!options.interactive,
26
- defaultVerificationPolicy: options.verifyPolicy || "permissive",
27
- };
28
- }
29
- export async function enforceSignatureVerification(tool, options = {}) {
30
- const toolName = tool.name || "unknown";
31
- // Apply centralized security policy based on context
32
- const securityPolicy = getSecurityPolicy(options);
33
- // Check if verification is explicitly skipped
34
- if (options.skipVerification && securityPolicy.allowSkipVerification) {
35
- logger.warn(`🚨 SECURITY WARNING: Signature verification skipped for tool: ${toolName}`);
36
- logger.warn(` This bypasses security measures and is NOT recommended for production use!`);
37
- return {
38
- allowed: true,
39
- reason: `Verification skipped by request for tool: ${toolName}`,
40
- verificationResult: {
41
- isValid: false,
42
- message: "Verification skipped",
43
- validSignatures: 0,
44
- totalSignatures: 0,
45
- verifiedSigners: [],
46
- errors: ["Signature verification was explicitly skipped"],
47
- },
48
- };
49
- }
50
- // Check if tool has any signatures
51
- const hasSignatures = !!(tool.signatures && Object.keys(tool.signatures).length > 0) ||
52
- !!tool.signature;
53
- if (!hasSignatures) {
54
- logger.warn(`⚠️ Tool has no signatures: ${toolName}`);
55
- // Only allow unsigned tools if policy permits (for development/testing)
56
- if (options.allowUnsigned || securityPolicy.allowUnsigned) {
57
- logger.warn(` Allowing unsigned tool execution due to allowUnsigned flag (DEV/TEST ONLY)`);
58
- return {
59
- allowed: true,
60
- reason: `Unsigned tool allowed by explicit permission: ${toolName}`,
61
- verificationResult: {
62
- isValid: false,
63
- message: "No signatures found, but execution allowed",
64
- validSignatures: 0,
65
- totalSignatures: 0,
66
- verifiedSigners: [],
67
- errors: [
68
- "Tool has no signatures but execution was explicitly allowed",
69
- ],
70
- },
71
- };
72
- }
73
- // Reject unsigned tools by default
74
- return {
75
- allowed: false,
76
- reason: `Tool has no signatures and unsigned execution is not permitted: ${toolName}`,
77
- error: {
78
- message: `Tool "${toolName}" has no cryptographic signatures. For security, only signed tools can be executed.`,
79
- code: "NO_SIGNATURES_FOUND",
80
- details: {
81
- toolName,
82
- hasSignature: !!tool.signature,
83
- hasSignatures: !!tool.signatures,
84
- signatureCount: tool.signatures
85
- ? Object.keys(tool.signatures).length
86
- : 0,
87
- },
88
- },
89
- };
90
- }
91
- // Perform signature verification
92
- try {
93
- logger.info(`🔐 Verifying signatures for tool: ${toolName}`);
94
- // Determine verification policy
95
- const policyKey = (options.verifyPolicy || "permissive").toUpperCase();
96
- const policy = VERIFICATION_POLICIES[policyKey] || VERIFICATION_POLICIES.PERMISSIVE;
97
- logger.info(` Using verification policy: ${policyKey.toLowerCase()}`);
98
- if (policy.minimumSignatures) {
99
- logger.info(` Minimum signatures required: ${policy.minimumSignatures}`);
100
- }
101
- if (policy.requireRoles) {
102
- logger.info(` Required roles: ${policy.requireRoles.join(", ")}`);
103
- }
104
- // Verify the tool
105
- const verificationResult = await verifyTool(tool, policy);
106
- if (verificationResult.isValid) {
107
- logger.info(`✅ Signature verification passed for tool: ${toolName}`);
108
- logger.info(` Valid signatures: ${verificationResult.validSignatures}/${verificationResult.totalSignatures}`);
109
- if (verificationResult.verifiedSigners.length > 0) {
110
- logger.info(` Verified signers: ${verificationResult.verifiedSigners
111
- .map((s) => `${s.signer}${s.role ? ` (${s.role})` : ""}`)
112
- .join(", ")}`);
113
- }
114
- return {
115
- allowed: true,
116
- reason: `Tool signature verification passed: ${verificationResult.message}`,
117
- verificationResult,
118
- };
119
- }
120
- else {
121
- logger.error(`❌ Signature verification failed for tool: ${toolName}`);
122
- logger.error(` Policy: ${policyKey.toLowerCase()}`);
123
- logger.error(` Valid signatures: ${verificationResult.validSignatures}/${verificationResult.totalSignatures}`);
124
- if (verificationResult.errors.length > 0) {
125
- logger.error(` Errors:`);
126
- verificationResult.errors.forEach((error) => logger.error(` - ${error}`));
127
- }
128
- return {
129
- allowed: false,
130
- reason: `Tool signature verification failed: ${verificationResult.message}`,
131
- verificationResult,
132
- error: {
133
- message: `Tool "${toolName}" failed signature verification. ${verificationResult.message}`,
134
- code: "SIGNATURE_VERIFICATION_FAILED",
135
- details: {
136
- toolName,
137
- policy: policyKey.toLowerCase(),
138
- validSignatures: verificationResult.validSignatures,
139
- totalSignatures: verificationResult.totalSignatures,
140
- errors: verificationResult.errors,
141
- verifiedSigners: verificationResult.verifiedSigners,
142
- },
143
- },
144
- };
145
- }
146
- }
147
- catch (error) {
148
- const errorMessage = error instanceof Error ? error.message : "Unknown verification error";
149
- logger.error(`💥 Signature verification error for tool: ${toolName} - ${errorMessage}`);
150
- return {
151
- allowed: false,
152
- reason: `Signature verification error: ${errorMessage}`,
153
- error: {
154
- message: `Signature verification failed due to error: ${errorMessage}`,
155
- code: "VERIFICATION_ERROR",
156
- details: { toolName, originalError: error },
157
- },
158
- };
159
- }
160
- }
161
- /**
162
- * Create an execution result for verification failure
163
- */
164
- export function createVerificationFailureResult(tool, verificationResult, executionId) {
165
- return {
166
- success: false,
167
- error: verificationResult.error || {
168
- message: verificationResult.reason,
169
- code: "VERIFICATION_FAILED",
170
- },
171
- metadata: {
172
- executionId,
173
- toolName: tool.name || "unknown",
174
- version: tool.version,
175
- executedAt: new Date().toISOString(),
176
- environment: "direct",
177
- command: tool.command,
178
- },
179
- };
180
- }
181
- /**
182
- * Log security audit information for tool execution
183
- */
184
- export function logSecurityAudit(tool, verificationResult, executionAllowed, options) {
185
- const auditLog = {
186
- timestamp: new Date().toISOString(),
187
- tool: tool.name || "unknown",
188
- version: tool.version,
189
- command: tool.command,
190
- executionAllowed,
191
- verificationSkipped: options.skipVerification || false,
192
- verificationPolicy: options.verifyPolicy || "permissive",
193
- verificationResult: verificationResult.verificationResult
194
- ? {
195
- isValid: verificationResult.verificationResult.isValid,
196
- validSignatures: verificationResult.verificationResult.validSignatures,
197
- totalSignatures: verificationResult.verificationResult.totalSignatures,
198
- verifiedSigners: verificationResult.verificationResult.verifiedSigners,
199
- }
200
- : null,
201
- errors: verificationResult.error ? [verificationResult.error.message] : [],
202
- };
203
- logger.info(`🔍 Security Audit Log:`, auditLog);
204
- }
@@ -1,98 +0,0 @@
1
- import type { EnactTool, ExecutionResult } from "../types";
2
- export declare class McpCoreService {
3
- private core;
4
- constructor(options?: {
5
- apiUrl?: string;
6
- supabaseUrl?: string;
7
- authToken?: string;
8
- });
9
- /**
10
- * Create McpCoreService with config-based URLs
11
- */
12
- static create(options?: {
13
- apiUrl?: string;
14
- supabaseUrl?: string;
15
- authToken?: string;
16
- }): Promise<McpCoreService>;
17
- /**
18
- * Set authentication token
19
- */
20
- setAuthToken(token: string): void;
21
- /**
22
- * Search for tools
23
- */
24
- searchTools(query: string, options?: {
25
- limit?: number;
26
- tags?: string[];
27
- author?: string;
28
- }): Promise<EnactTool[]>;
29
- /**
30
- * Get a specific tool by name
31
- */
32
- getToolInfo(name: string): Promise<EnactTool | null>;
33
- /**
34
- * Execute a tool by name
35
- */
36
- executeToolByName(name: string, inputs?: Record<string, any>, options?: {
37
- timeout?: string;
38
- force?: boolean;
39
- dryRun?: boolean;
40
- }): Promise<ExecutionResult>;
41
- /**
42
- * Execute a tool from raw YAML definition
43
- */
44
- executeRawTool(toolYaml: string, inputs?: Record<string, any>, options?: {
45
- timeout?: string;
46
- force?: boolean;
47
- dryRun?: boolean;
48
- }): Promise<ExecutionResult>;
49
- /**
50
- * Check if a tool exists
51
- */
52
- toolExists(name: string): Promise<boolean>;
53
- /**
54
- * Get tools by tags
55
- */
56
- getToolsByTags(tags: string[], limit?: number): Promise<EnactTool[]>;
57
- /**
58
- * Get tools by author
59
- */
60
- getToolsByAuthor(author: string, limit?: number): Promise<EnactTool[]>;
61
- /**
62
- * Get all tools with filters
63
- */
64
- getTools(options?: {
65
- limit?: number;
66
- offset?: number;
67
- tags?: string[];
68
- author?: string;
69
- }): Promise<EnactTool[]>;
70
- /**
71
- * Get authentication status
72
- */
73
- getAuthStatus(): Promise<{
74
- authenticated: boolean;
75
- user?: string;
76
- server?: string;
77
- }>;
78
- /**
79
- * Check if service is available (always true for core service)
80
- */
81
- isAvailable(): Promise<boolean>;
82
- /**
83
- * Get service path info (not applicable for core service)
84
- */
85
- getPathInfo(): Promise<{
86
- detectedPath: string | null;
87
- isAvailable: boolean;
88
- version?: string;
89
- }>;
90
- /**
91
- * Publish a tool (requires authentication)
92
- */
93
- publishTool(tool: EnactTool): Promise<{
94
- success: boolean;
95
- message: string;
96
- }>;
97
- }
98
- export declare const mcpCoreService: McpCoreService;
@@ -1,124 +0,0 @@
1
- // src/services/McpCoreService.ts - Direct core integration for MCP server
2
- import { EnactCore } from "../core/EnactCore";
3
- import { getFrontendUrl, getApiUrl } from "../utils/config";
4
- export class McpCoreService {
5
- constructor(options) {
6
- this.core = new EnactCore({
7
- apiUrl: options?.apiUrl || "https://enact.tools",
8
- supabaseUrl: options?.supabaseUrl || "https://xjnhhxwxovjifdxdwzih.supabase.co",
9
- authToken: options?.authToken,
10
- });
11
- }
12
- /**
13
- * Create McpCoreService with config-based URLs
14
- */
15
- static async create(options) {
16
- const frontendUrl = options?.apiUrl || await getFrontendUrl();
17
- const apiUrl = options?.supabaseUrl || await getApiUrl();
18
- return new McpCoreService({
19
- ...options,
20
- apiUrl: frontendUrl,
21
- supabaseUrl: apiUrl,
22
- });
23
- }
24
- /**
25
- * Set authentication token
26
- */
27
- setAuthToken(token) {
28
- this.core.setAuthToken(token);
29
- }
30
- /**
31
- * Search for tools
32
- */
33
- async searchTools(query, options) {
34
- const searchOptions = {
35
- query,
36
- limit: options?.limit,
37
- tags: options?.tags,
38
- author: options?.author,
39
- };
40
- return await this.core.searchTools(searchOptions);
41
- }
42
- /**
43
- * Get a specific tool by name
44
- */
45
- async getToolInfo(name) {
46
- return await this.core.getToolByName(name);
47
- }
48
- /**
49
- * Execute a tool by name
50
- */
51
- async executeToolByName(name, inputs = {}, options) {
52
- const executeOptions = {
53
- timeout: options?.timeout,
54
- force: options?.force,
55
- dryRun: options?.dryRun,
56
- };
57
- return await this.core.executeToolByName(name, inputs, executeOptions);
58
- }
59
- /**
60
- * Execute a tool from raw YAML definition
61
- */
62
- async executeRawTool(toolYaml, inputs = {}, options) {
63
- const executeOptions = {
64
- timeout: options?.timeout,
65
- force: options?.force,
66
- dryRun: options?.dryRun,
67
- };
68
- return await this.core.executeRawTool(toolYaml, inputs, executeOptions);
69
- }
70
- /**
71
- * Check if a tool exists
72
- */
73
- async toolExists(name) {
74
- return await this.core.toolExists(name);
75
- }
76
- /**
77
- * Get tools by tags
78
- */
79
- async getToolsByTags(tags, limit = 20) {
80
- return await this.core.getToolsByTags(tags, limit);
81
- }
82
- /**
83
- * Get tools by author
84
- */
85
- async getToolsByAuthor(author, limit = 20) {
86
- return await this.core.getToolsByAuthor(author, limit);
87
- }
88
- /**
89
- * Get all tools with filters
90
- */
91
- async getTools(options) {
92
- return await this.core.getTools(options);
93
- }
94
- /**
95
- * Get authentication status
96
- */
97
- async getAuthStatus() {
98
- return await this.core.getAuthStatus();
99
- }
100
- /**
101
- * Check if service is available (always true for core service)
102
- */
103
- async isAvailable() {
104
- return true;
105
- }
106
- /**
107
- * Get service path info (not applicable for core service)
108
- */
109
- async getPathInfo() {
110
- return {
111
- detectedPath: "core-library",
112
- isAvailable: true,
113
- version: "2.0.0-core",
114
- };
115
- }
116
- /**
117
- * Publish a tool (requires authentication)
118
- */
119
- async publishTool(tool) {
120
- return await this.core.publishTool(tool);
121
- }
122
- }
123
- // Create and export singleton instance
124
- export const mcpCoreService = new McpCoreService();
@@ -1 +0,0 @@
1
- export * from './McpCoreService';
@@ -1 +0,0 @@
1
- export * from './McpCoreService';
package/dist/types.d.ts DELETED
@@ -1,132 +0,0 @@
1
- export interface EnactTool {
2
- name: string;
3
- description: string;
4
- command: string;
5
- from?: string;
6
- timeout?: string;
7
- tags?: string[];
8
- license?: string;
9
- outputSchema?: JSONSchemaDefinition;
10
- enact?: string;
11
- version?: string;
12
- namespace?: string;
13
- resources?: {
14
- memory?: string;
15
- gpu?: string;
16
- disk?: string;
17
- };
18
- env?: Record<string, {
19
- description: string;
20
- source: string;
21
- required: boolean;
22
- default?: string;
23
- }>;
24
- inputSchema?: JSONSchemaDefinition;
25
- doc?: string;
26
- authors?: Array<{
27
- name: string;
28
- email?: string;
29
- url?: string;
30
- }>;
31
- examples?: Array<{
32
- input: Record<string, any>;
33
- output?: any;
34
- description?: string;
35
- }>;
36
- annotations?: {
37
- title?: string;
38
- readOnlyHint?: boolean;
39
- destructiveHint?: boolean;
40
- idempotentHint?: boolean;
41
- openWorldHint?: boolean;
42
- };
43
- signature?: {
44
- algorithm: string;
45
- type: string;
46
- signer: string;
47
- created: string;
48
- value: string;
49
- role?: string;
50
- };
51
- signatures?: {
52
- signer: string;
53
- algorithm: string;
54
- type: string;
55
- value: string;
56
- created: string;
57
- role?: string;
58
- }[];
59
- [key: string]: any;
60
- }
61
- export interface JSONSchemaDefinition {
62
- type?: string | string[];
63
- description?: string;
64
- format?: string;
65
- default?: any;
66
- enum?: any[];
67
- const?: any;
68
- pattern?: string;
69
- minLength?: number;
70
- maxLength?: number;
71
- minimum?: number;
72
- maximum?: number;
73
- exclusiveMinimum?: number;
74
- exclusiveMaximum?: number;
75
- multipleOf?: number;
76
- items?: JSONSchemaDefinition | JSONSchemaDefinition[];
77
- minItems?: number;
78
- maxItems?: number;
79
- uniqueItems?: boolean;
80
- properties?: Record<string, JSONSchemaDefinition>;
81
- required?: string[];
82
- additionalProperties?: JSONSchemaDefinition | boolean;
83
- allOf?: JSONSchemaDefinition[];
84
- anyOf?: JSONSchemaDefinition[];
85
- oneOf?: JSONSchemaDefinition[];
86
- not?: JSONSchemaDefinition;
87
- definitions?: Record<string, JSONSchemaDefinition>;
88
- $ref?: string;
89
- $id?: string;
90
- $schema?: string;
91
- [key: string]: any;
92
- }
93
- export interface ExecutionResult {
94
- success: boolean;
95
- output?: any;
96
- error?: {
97
- message: string;
98
- code?: string;
99
- details?: any;
100
- };
101
- metadata: {
102
- executionId: string;
103
- toolName: string;
104
- version?: string;
105
- executedAt: string;
106
- environment: string;
107
- timeout?: string;
108
- command?: string;
109
- };
110
- }
111
- export interface ExecutionEnvironment {
112
- vars: Record<string, any>;
113
- resources?: {
114
- memory?: string;
115
- gpu?: string;
116
- disk?: string;
117
- timeout?: string;
118
- };
119
- namespace?: string;
120
- mount?: string;
121
- }
122
- export declare abstract class ExecutionProvider {
123
- abstract setup(tool: EnactTool): Promise<boolean>;
124
- abstract execute(tool: EnactTool, inputs: Record<string, any>, environment: ExecutionEnvironment): Promise<ExecutionResult>;
125
- abstract cleanup(): Promise<boolean>;
126
- abstract resolveEnvironmentVariables(envConfig: Record<string, any>, namespace?: string): Promise<Record<string, any>>;
127
- abstract executeCommand(command: string, inputs: Record<string, any>, environment: ExecutionEnvironment, timeout?: string): Promise<{
128
- stdout: string;
129
- stderr: string;
130
- exitCode: number;
131
- }>;
132
- }
package/dist/types.js DELETED
@@ -1,3 +0,0 @@
1
- // Updated execution provider interface
2
- export class ExecutionProvider {
3
- }