@agentv/core 4.12.8-next.1 → 4.13.0-next.1
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/dist/index.cjs +42 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +51 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6673,7 +6673,7 @@ function subscribeToCopilotCliLogEntries(listener) {
|
|
|
6673
6673
|
// src/evaluation/providers/copilot-utils.ts
|
|
6674
6674
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
6675
6675
|
import { createWriteStream as createWriteStream4, existsSync, readdirSync } from "node:fs";
|
|
6676
|
-
import { arch, platform } from "node:os";
|
|
6676
|
+
import { arch, homedir, platform } from "node:os";
|
|
6677
6677
|
import path15 from "node:path";
|
|
6678
6678
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
6679
6679
|
function resolvePlatformCliPath() {
|
|
@@ -6740,8 +6740,50 @@ function resolvePlatformCliPath() {
|
|
|
6740
6740
|
if (parent === searchDir) break;
|
|
6741
6741
|
searchDir = parent;
|
|
6742
6742
|
}
|
|
6743
|
+
for (const root of globalNpmRoots()) {
|
|
6744
|
+
const hoisted = path15.join(root, "@github", `copilot-${osPart}-${archPart}`, binaryName);
|
|
6745
|
+
if (existsSync(hoisted)) {
|
|
6746
|
+
return hoisted;
|
|
6747
|
+
}
|
|
6748
|
+
const nested = path15.join(
|
|
6749
|
+
root,
|
|
6750
|
+
"@github",
|
|
6751
|
+
"copilot",
|
|
6752
|
+
"node_modules",
|
|
6753
|
+
"@github",
|
|
6754
|
+
`copilot-${osPart}-${archPart}`,
|
|
6755
|
+
binaryName
|
|
6756
|
+
);
|
|
6757
|
+
if (existsSync(nested)) {
|
|
6758
|
+
return nested;
|
|
6759
|
+
}
|
|
6760
|
+
}
|
|
6743
6761
|
return void 0;
|
|
6744
6762
|
}
|
|
6763
|
+
function globalNpmRoots() {
|
|
6764
|
+
const roots = [];
|
|
6765
|
+
const os4 = platform();
|
|
6766
|
+
const home = homedir();
|
|
6767
|
+
if (os4 === "win32") {
|
|
6768
|
+
if (process.env.APPDATA) {
|
|
6769
|
+
roots.push(path15.join(process.env.APPDATA, "npm", "node_modules"));
|
|
6770
|
+
}
|
|
6771
|
+
roots.push(path15.join(home, "AppData", "Roaming", "npm", "node_modules"));
|
|
6772
|
+
} else {
|
|
6773
|
+
roots.push("/opt/homebrew/lib/node_modules");
|
|
6774
|
+
roots.push("/usr/local/lib/node_modules");
|
|
6775
|
+
roots.push("/usr/lib/node_modules");
|
|
6776
|
+
roots.push(path15.join(home, ".npm-global", "lib", "node_modules"));
|
|
6777
|
+
roots.push(path15.join(home, ".local", "lib", "node_modules"));
|
|
6778
|
+
}
|
|
6779
|
+
if (process.env.npm_config_prefix) {
|
|
6780
|
+
const prefix = process.env.npm_config_prefix;
|
|
6781
|
+
roots.push(
|
|
6782
|
+
os4 === "win32" ? path15.join(prefix, "node_modules") : path15.join(prefix, "lib", "node_modules")
|
|
6783
|
+
);
|
|
6784
|
+
}
|
|
6785
|
+
return Array.from(new Set(roots));
|
|
6786
|
+
}
|
|
6745
6787
|
function buildLogFilename4(request, targetName, fallbackId) {
|
|
6746
6788
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
6747
6789
|
const evalId = sanitizeForFilename4(request.evalCaseId ?? fallbackId);
|
|
@@ -7212,7 +7254,7 @@ function summarizeAcpEvent(eventType, data) {
|
|
|
7212
7254
|
|
|
7213
7255
|
// src/evaluation/providers/copilot-log.ts
|
|
7214
7256
|
import { readFile as readFile10 } from "node:fs/promises";
|
|
7215
|
-
import { homedir as
|
|
7257
|
+
import { homedir as homedir3 } from "node:os";
|
|
7216
7258
|
import path18 from "node:path";
|
|
7217
7259
|
|
|
7218
7260
|
// src/evaluation/providers/copilot-log-parser.ts
|
|
@@ -7346,10 +7388,10 @@ function parseCopilotEvents(eventsJsonl) {
|
|
|
7346
7388
|
|
|
7347
7389
|
// src/evaluation/providers/copilot-session-discovery.ts
|
|
7348
7390
|
import { readFile as readFile9, readdir, stat } from "node:fs/promises";
|
|
7349
|
-
import { homedir } from "node:os";
|
|
7391
|
+
import { homedir as homedir2 } from "node:os";
|
|
7350
7392
|
import path17 from "node:path";
|
|
7351
7393
|
import { parse as parseYaml2 } from "yaml";
|
|
7352
|
-
var DEFAULT_SESSION_STATE_DIR = () => path17.join(
|
|
7394
|
+
var DEFAULT_SESSION_STATE_DIR = () => path17.join(homedir2(), ".copilot", "session-state");
|
|
7353
7395
|
async function discoverCopilotSessions(opts) {
|
|
7354
7396
|
const sessionStateDir = opts?.sessionStateDir ?? DEFAULT_SESSION_STATE_DIR();
|
|
7355
7397
|
const limit = opts?.limit ?? 10;
|
|
@@ -7446,7 +7488,7 @@ var CopilotLogProvider = class {
|
|
|
7446
7488
|
return this.config.sessionDir;
|
|
7447
7489
|
}
|
|
7448
7490
|
if (this.config.sessionId) {
|
|
7449
|
-
const stateDir = this.config.sessionStateDir ?? path18.join(
|
|
7491
|
+
const stateDir = this.config.sessionStateDir ?? path18.join(homedir3(), ".copilot", "session-state");
|
|
7450
7492
|
return path18.join(stateDir, this.config.sessionId);
|
|
7451
7493
|
}
|
|
7452
7494
|
if (this.config.discover === "latest") {
|
|
@@ -20218,9 +20260,9 @@ function extractResponseItemContent(content) {
|
|
|
20218
20260
|
|
|
20219
20261
|
// src/import/codex-session-discovery.ts
|
|
20220
20262
|
import { readdir as readdir9, stat as stat10 } from "node:fs/promises";
|
|
20221
|
-
import { homedir as
|
|
20263
|
+
import { homedir as homedir4 } from "node:os";
|
|
20222
20264
|
import path51 from "node:path";
|
|
20223
|
-
var DEFAULT_SESSIONS_DIR = () => path51.join(
|
|
20265
|
+
var DEFAULT_SESSIONS_DIR = () => path51.join(homedir4(), ".codex", "sessions");
|
|
20224
20266
|
async function discoverCodexSessions(opts) {
|
|
20225
20267
|
const sessionsDir = opts?.sessionsDir ?? DEFAULT_SESSIONS_DIR();
|
|
20226
20268
|
const limit = opts?.latest ? 1 : opts?.limit ?? 10;
|
|
@@ -20283,9 +20325,9 @@ async function discoverCodexSessions(opts) {
|
|
|
20283
20325
|
|
|
20284
20326
|
// src/import/session-discovery.ts
|
|
20285
20327
|
import { readdir as readdir10, stat as stat11 } from "node:fs/promises";
|
|
20286
|
-
import { homedir as
|
|
20328
|
+
import { homedir as homedir5 } from "node:os";
|
|
20287
20329
|
import path52 from "node:path";
|
|
20288
|
-
var DEFAULT_PROJECTS_DIR = () => path52.join(
|
|
20330
|
+
var DEFAULT_PROJECTS_DIR = () => path52.join(homedir5(), ".claude", "projects");
|
|
20289
20331
|
function encodeProjectPath(projectPath) {
|
|
20290
20332
|
return projectPath.replace(/\//g, "-");
|
|
20291
20333
|
}
|