@wix/evalforge-evaluator 0.8.0 → 0.10.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,77 @@
1
+ /**
2
+ * Error Reporter Module
3
+ *
4
+ * Provides comprehensive error reporting functionality for the evaluator.
5
+ * Captures detailed error information including stack traces and context,
6
+ * and sends it to the server so failures can be debugged without accessing
7
+ * the remote machine logs.
8
+ */
9
+ import type { EvaluatorConfig } from './config.js';
10
+ /**
11
+ * Detailed error information to send to the server.
12
+ */
13
+ export interface ErrorDetails {
14
+ /** Short error message */
15
+ message: string;
16
+ /** Full stack trace if available */
17
+ stack?: string;
18
+ /** Error name/type (e.g., "TypeError", "Error") */
19
+ errorType?: string;
20
+ /** Phase of execution where the error occurred */
21
+ phase?: string;
22
+ /** Additional context about what was happening */
23
+ context?: Record<string, unknown>;
24
+ /** Timestamp when the error occurred */
25
+ timestamp: string;
26
+ }
27
+ /**
28
+ * Format an error into detailed error information.
29
+ *
30
+ * @param error - The error to format
31
+ * @param phase - The phase of execution (e.g., "config", "fetch", "execution")
32
+ * @param context - Additional context about what was happening
33
+ * @returns Formatted error details
34
+ */
35
+ export declare function formatError(error: unknown, phase?: string, context?: Record<string, unknown>): ErrorDetails;
36
+ /**
37
+ * Format error details into a string suitable for the jobError field.
38
+ * Includes the message, stack trace, and context in a readable format.
39
+ *
40
+ * @param details - The error details to format
41
+ * @returns A formatted string with all error information
42
+ */
43
+ export declare function formatErrorForJobError(details: ErrorDetails): string;
44
+ /**
45
+ * Report an error to the server.
46
+ *
47
+ * This function attempts to update the eval run status to FAILED
48
+ * with detailed error information. If the update fails, it logs
49
+ * the error to stderr.
50
+ *
51
+ * @param config - Evaluator configuration (can be partial if config loading failed)
52
+ * @param projectId - The project ID
53
+ * @param evalRunId - The eval run ID
54
+ * @param error - The error to report
55
+ * @param phase - The phase where the error occurred
56
+ * @param context - Additional context
57
+ */
58
+ export declare function reportError(config: Partial<EvaluatorConfig> | null, projectId: string, evalRunId: string, error: unknown, phase?: string, context?: Record<string, unknown>): Promise<void>;
59
+ /**
60
+ * Execution phases for error context.
61
+ */
62
+ export declare const ExecutionPhase: {
63
+ readonly CONFIG: "config-loading";
64
+ readonly API_CLIENT: "api-client-creation";
65
+ readonly FETCH_EVAL_RUN: "fetch-eval-run";
66
+ readonly FETCH_SKILLS: "fetch-skills";
67
+ readonly FETCH_AGENT: "fetch-agent";
68
+ readonly FETCH_SCENARIOS: "fetch-scenarios";
69
+ readonly VALIDATION: "validation";
70
+ readonly PREPARE_WORKSPACE: "prepare-workspace";
71
+ readonly EXECUTE_SKILL: "execute-skill";
72
+ readonly EXECUTE_AGENT: "execute-agent";
73
+ readonly CLAUDE_SDK_IMPORT: "claude-sdk-import";
74
+ readonly CLAUDE_SDK_EXECUTION: "claude-sdk-execution";
75
+ readonly ADD_RESULT: "add-result";
76
+ readonly UPDATE_STATUS: "update-status";
77
+ };
@@ -1,2 +1,9 @@
1
1
  #!/usr/bin/env node
2
+ /**
3
+ * EvalForge Evaluator Entry Point
4
+ *
5
+ * This module runs evaluations on a remote Dev Machine.
6
+ * It fetches evaluation data from the server, runs scenarios,
7
+ * and reports results (including detailed error information).
8
+ */
2
9
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/evalforge-evaluator",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "EvalForge Evaluator",
5
5
  "bin": "./build/index.js",
6
6
  "files": [
@@ -62,5 +62,5 @@
62
62
  "artifactId": "evalforge-evaluator"
63
63
  }
64
64
  },
65
- "falconPackageHash": "735722bbddaace0cacc744097d82598cda8f2190d1bb21d908530b68"
65
+ "falconPackageHash": "1991574d8163e3680b12af254b5a9c903c38835e3b952d83161a75fc"
66
66
  }