@wix/evalforge-evaluator 0.68.0 → 0.70.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.
- package/build/index.js +16 -12
- package/build/index.js.map +4 -4
- package/build/index.mjs +13 -9
- package/build/index.mjs.map +4 -4
- package/build/types/run-scenario/agents/claude-code/mcp-setup.d.ts +54 -0
- package/build/types/run-scenario/agents/claude-code/write-mcp.d.ts +0 -35
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -6451,7 +6451,6 @@ var import_crypto = require("crypto");
|
|
|
6451
6451
|
|
|
6452
6452
|
// src/run-scenario/agents/claude-code/write-mcp.ts
|
|
6453
6453
|
var import_promises4 = require("fs/promises");
|
|
6454
|
-
var import_child_process = require("child_process");
|
|
6455
6454
|
var import_path6 = require("path");
|
|
6456
6455
|
var import_evalforge_types2 = require("@wix/evalforge-types");
|
|
6457
6456
|
async function writeMcpToFilesystem(cwd, mcps) {
|
|
@@ -6477,6 +6476,11 @@ async function writeMcpToFilesystem(cwd, mcps) {
|
|
|
6477
6476
|
await (0, import_promises4.writeFile)(filePath, content, "utf8");
|
|
6478
6477
|
console.log(`[MCP] Written to ${filePath}`);
|
|
6479
6478
|
}
|
|
6479
|
+
|
|
6480
|
+
// src/run-scenario/agents/claude-code/mcp-setup.ts
|
|
6481
|
+
var import_promises5 = require("fs/promises");
|
|
6482
|
+
var import_child_process = require("child_process");
|
|
6483
|
+
var import_path7 = require("path");
|
|
6480
6484
|
async function probeMcpServers(mcps, probeMs = 5e3) {
|
|
6481
6485
|
const results = [];
|
|
6482
6486
|
for (const mcp of mcps) {
|
|
@@ -6547,7 +6551,7 @@ spawn error: ${err.message}`;
|
|
|
6547
6551
|
async function probeNpmConfig(cwd) {
|
|
6548
6552
|
const homedir = process.env.HOME ?? "~";
|
|
6549
6553
|
const [wixAuthFile, npmInstallDryRun, mcpPackageInstalled] = await Promise.all([
|
|
6550
|
-
(0,
|
|
6554
|
+
(0, import_promises5.readFile)((0, import_path7.join)(homedir, ".wix", "auth", "api-key.json"), "utf8").catch(
|
|
6551
6555
|
(e) => `[not found: ${e.message}]`
|
|
6552
6556
|
),
|
|
6553
6557
|
runShellCapture(
|
|
@@ -6630,8 +6634,8 @@ function runShellCapture(cmd, cwd, timeoutMs) {
|
|
|
6630
6634
|
}
|
|
6631
6635
|
|
|
6632
6636
|
// src/run-scenario/agents/claude-code/write-sub-agents.ts
|
|
6633
|
-
var
|
|
6634
|
-
var
|
|
6637
|
+
var import_promises6 = require("fs/promises");
|
|
6638
|
+
var import_path8 = require("path");
|
|
6635
6639
|
var AGENTS_DIR = ".claude/agents";
|
|
6636
6640
|
function toAgentFilename(name2, index, nameCount) {
|
|
6637
6641
|
const base = (name2 || "").toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "").replace(/^-+|-+$/g, "") || `sub-agent-${index}`;
|
|
@@ -6641,13 +6645,13 @@ function toAgentFilename(name2, index, nameCount) {
|
|
|
6641
6645
|
}
|
|
6642
6646
|
async function writeSubAgentsToFilesystem(cwd, subAgents) {
|
|
6643
6647
|
if (subAgents.length === 0) return;
|
|
6644
|
-
const agentsDir = (0,
|
|
6645
|
-
await (0,
|
|
6648
|
+
const agentsDir = (0, import_path8.join)(cwd, AGENTS_DIR);
|
|
6649
|
+
await (0, import_promises6.mkdir)(agentsDir, { recursive: true });
|
|
6646
6650
|
const nameCount = /* @__PURE__ */ new Map();
|
|
6647
6651
|
for (const [i, agent] of subAgents.entries()) {
|
|
6648
6652
|
const filename = toAgentFilename(agent.name, i, nameCount);
|
|
6649
|
-
const filePath = (0,
|
|
6650
|
-
await (0,
|
|
6653
|
+
const filePath = (0, import_path8.join)(agentsDir, `${filename}.md`);
|
|
6654
|
+
await (0, import_promises6.writeFile)(filePath, agent.subAgentMd, "utf8");
|
|
6651
6655
|
}
|
|
6652
6656
|
console.log(`[SubAgents] Written to ${agentsDir}`);
|
|
6653
6657
|
}
|
|
@@ -7752,7 +7756,7 @@ defaultRegistry.register(claudeCodeAdapter);
|
|
|
7752
7756
|
|
|
7753
7757
|
// src/run-scenario/file-diff.ts
|
|
7754
7758
|
var import_fs6 = require("fs");
|
|
7755
|
-
var
|
|
7759
|
+
var import_path9 = require("path");
|
|
7756
7760
|
|
|
7757
7761
|
// ../../node_modules/diff/lib/index.mjs
|
|
7758
7762
|
function Diff() {
|
|
@@ -7928,7 +7932,7 @@ Diff.prototype = {
|
|
|
7928
7932
|
tokenize: function tokenize(value) {
|
|
7929
7933
|
return Array.from(value);
|
|
7930
7934
|
},
|
|
7931
|
-
join: function
|
|
7935
|
+
join: function join6(chars) {
|
|
7932
7936
|
return chars.join("");
|
|
7933
7937
|
},
|
|
7934
7938
|
postProcess: function postProcess(changeObjects) {
|
|
@@ -8368,8 +8372,8 @@ function snapshotDirectory(dir, baseDir) {
|
|
|
8368
8372
|
}
|
|
8369
8373
|
const entries = (0, import_fs6.readdirSync)(dir, { withFileTypes: true });
|
|
8370
8374
|
for (const entry of entries) {
|
|
8371
|
-
const fullPath = (0,
|
|
8372
|
-
const relativePath = (0,
|
|
8375
|
+
const fullPath = (0, import_path9.join)(dir, entry.name);
|
|
8376
|
+
const relativePath = (0, import_path9.relative)(base, fullPath);
|
|
8373
8377
|
if (shouldIgnore(entry.name)) {
|
|
8374
8378
|
continue;
|
|
8375
8379
|
}
|