@wix/evalforge-evaluator 0.97.0 → 0.99.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,26 @@
1
+ /**
2
+ * Generic `{{placeholder}}` resolution utilities.
3
+ *
4
+ * Provides low-level functions for detecting and replacing `{{key}}`
5
+ * tokens inside arbitrary JSON-like values (strings, arrays, objects).
6
+ *
7
+ * Used by:
8
+ * - MCP config resolution (wix-auth tokens)
9
+ * - LLM judge assertion param substitution
10
+ */
11
+ /**
12
+ * Find all unique placeholder keys referenced in an arbitrary value.
13
+ * Recursively traverses strings, arrays, and plain objects.
14
+ */
15
+ export declare function findPlaceholders(value: unknown): string[];
16
+ /**
17
+ * Replace `{{key}}` tokens in an arbitrary value using the given map.
18
+ * Recursively traverses strings, arrays, and plain objects.
19
+ * Unknown placeholders (not in `placeholders`) are left as-is.
20
+ */
21
+ export declare function resolveValue(value: unknown, placeholders: Record<string, string>): unknown;
22
+ /**
23
+ * Replace `{{key}}` tokens in a single string.
24
+ * Convenience wrapper around {@link resolveValue} with a narrower return type.
25
+ */
26
+ export declare function resolvePlaceholdersInString(text: string, placeholders: Record<string, string>): string;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * MCP Config Placeholder Resolution
3
+ *
4
+ * Resolves `{{placeholder}}` patterns in MCP config values at eval startup.
5
+ * Currently supports Wix auth placeholders sourced from ~/.wix/auth/api-key.json
6
+ * (the same file that @wix/mcp reads via WIX_API_THROUGH_FS).
7
+ *
8
+ * Supported placeholders:
9
+ * - {{wix-auth-token}} → token from api-key.json
10
+ * - {{wix-auth-user-id}} → userInfo.userId from api-key.json
11
+ */
12
+ import { findPlaceholders, resolveValue } from '../../../resolve-placeholders.js';
13
+ export { findPlaceholders, resolveValue };
14
+ /**
15
+ * Read Wix auth placeholders from ~/.wix/auth/api-key.json.
16
+ * Returns an empty map when the file is missing or malformed.
17
+ *
18
+ * @param authFilePath - Override for testing (default: ~/.wix/auth/api-key.json)
19
+ */
20
+ export declare function loadWixAuthPlaceholders(authFilePath?: string): Promise<Record<string, string>>;
21
+ /**
22
+ * Resolve all `{{...}}` placeholders in an MCP server config map.
23
+ *
24
+ * Loads available placeholder values (currently from Wix auth file),
25
+ * scans the config for placeholders, and fails if any are unresolvable.
26
+ *
27
+ * @param mcpServers - The mcpServers map (server-name → config)
28
+ * @param authFilePath - Override for testing
29
+ * @throws When a config references placeholders that cannot be resolved
30
+ */
31
+ export declare function resolveMcpPlaceholders(mcpServers: Record<string, Record<string, unknown>>, authFilePath?: string): Promise<Record<string, Record<string, unknown>>>;
@@ -6,6 +6,9 @@ import type { MCPEntity } from '@wix/evalforge-types';
6
6
  * (e.g. `{ "wix-mcp": { "type": "http", ... } }`), so each MCP's config
7
7
  * is spread directly into the mcpServers object.
8
8
  *
9
+ * Any `{{placeholder}}` values in the config are resolved before writing
10
+ * (e.g. `{{wix-auth-token}}` → token from ~/.wix/auth/api-key.json).
11
+ *
9
12
  * @see https://code.claude.com/docs/en/mcp#mcp-installation-scopes
10
13
  * @param cwd - Working directory (project root for Claude Code)
11
14
  * @param mcps - MCP entities whose config is merged into mcpServers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/evalforge-evaluator",
3
- "version": "0.97.0",
3
+ "version": "0.99.0",
4
4
  "description": "EvalForge Evaluator",
5
5
  "bin": "./build/index.js",
6
6
  "files": [
@@ -19,7 +19,7 @@
19
19
  "@ai-sdk/anthropic": "^3.0.2",
20
20
  "@anthropic-ai/claude-agent-sdk": "^0.2.44",
21
21
  "@anthropic-ai/claude-code": "^2.1.44",
22
- "@wix/eval-assertions": "0.20.0",
22
+ "@wix/eval-assertions": "0.21.0",
23
23
  "@wix/evalforge-github-client": "0.17.0",
24
24
  "@wix/evalforge-types": "0.42.0",
25
25
  "ai": "^6.0.6",
@@ -60,5 +60,5 @@
60
60
  "artifactId": "evalforge-evaluator"
61
61
  }
62
62
  },
63
- "falconPackageHash": "a9a6442771b1e4bd9e5c6dad77b1253211c204acb7039bd84d49238f"
63
+ "falconPackageHash": "8a408bc699dc103228032cd55ff124376df9fefe004f21315d98ae9d"
64
64
  }