agentv 4.12.8 → 4.13.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.
@@ -14470,14 +14470,14 @@ var RequestError = class _RequestError extends Error {
14470
14470
  // ../../packages/core/dist/index.js
14471
14471
  import { randomUUID as randomUUID4 } from "node:crypto";
14472
14472
  import { createWriteStream as createWriteStream4, existsSync, readdirSync } from "node:fs";
14473
- import { arch, platform } from "node:os";
14473
+ import { arch, homedir, platform } from "node:os";
14474
14474
  import path15 from "node:path";
14475
14475
  import { fileURLToPath as fileURLToPath3 } from "node:url";
14476
14476
  import { readFile as readFile10 } from "node:fs/promises";
14477
- import { homedir as homedir2 } from "node:os";
14477
+ import { homedir as homedir3 } from "node:os";
14478
14478
  import path18 from "node:path";
14479
14479
  import { readFile as readFile9, readdir, stat } from "node:fs/promises";
14480
- import { homedir } from "node:os";
14480
+ import { homedir as homedir2 } from "node:os";
14481
14481
  import path17 from "node:path";
14482
14482
  import { parse as parseYaml22 } from "yaml";
14483
14483
  import { randomUUID as randomUUID6 } from "node:crypto";
@@ -14581,10 +14581,10 @@ import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as rea
14581
14581
  import path50 from "node:path";
14582
14582
  import { parse as parseYaml3, stringify as stringifyYaml } from "yaml";
14583
14583
  import { readdir as readdir9, stat as stat10 } from "node:fs/promises";
14584
- import { homedir as homedir3 } from "node:os";
14584
+ import { homedir as homedir4 } from "node:os";
14585
14585
  import path51 from "node:path";
14586
14586
  import { readdir as readdir10, stat as stat11 } from "node:fs/promises";
14587
- import { homedir as homedir4 } from "node:os";
14587
+ import { homedir as homedir5 } from "node:os";
14588
14588
  import path52 from "node:path";
14589
14589
  import { readFile as readFile17 } from "node:fs/promises";
14590
14590
  function computeTraceSummary(messages) {
@@ -21145,8 +21145,50 @@ function resolvePlatformCliPath() {
21145
21145
  if (parent === searchDir) break;
21146
21146
  searchDir = parent;
21147
21147
  }
21148
+ for (const root of globalNpmRoots()) {
21149
+ const hoisted = path15.join(root, "@github", `copilot-${osPart}-${archPart}`, binaryName);
21150
+ if (existsSync(hoisted)) {
21151
+ return hoisted;
21152
+ }
21153
+ const nested = path15.join(
21154
+ root,
21155
+ "@github",
21156
+ "copilot",
21157
+ "node_modules",
21158
+ "@github",
21159
+ `copilot-${osPart}-${archPart}`,
21160
+ binaryName
21161
+ );
21162
+ if (existsSync(nested)) {
21163
+ return nested;
21164
+ }
21165
+ }
21148
21166
  return void 0;
21149
21167
  }
21168
+ function globalNpmRoots() {
21169
+ const roots = [];
21170
+ const os4 = platform();
21171
+ const home = homedir();
21172
+ if (os4 === "win32") {
21173
+ if (process.env.APPDATA) {
21174
+ roots.push(path15.join(process.env.APPDATA, "npm", "node_modules"));
21175
+ }
21176
+ roots.push(path15.join(home, "AppData", "Roaming", "npm", "node_modules"));
21177
+ } else {
21178
+ roots.push("/opt/homebrew/lib/node_modules");
21179
+ roots.push("/usr/local/lib/node_modules");
21180
+ roots.push("/usr/lib/node_modules");
21181
+ roots.push(path15.join(home, ".npm-global", "lib", "node_modules"));
21182
+ roots.push(path15.join(home, ".local", "lib", "node_modules"));
21183
+ }
21184
+ if (process.env.npm_config_prefix) {
21185
+ const prefix = process.env.npm_config_prefix;
21186
+ roots.push(
21187
+ os4 === "win32" ? path15.join(prefix, "node_modules") : path15.join(prefix, "lib", "node_modules")
21188
+ );
21189
+ }
21190
+ return Array.from(new Set(roots));
21191
+ }
21150
21192
  function buildLogFilename4(request, targetName, fallbackId) {
21151
21193
  const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
21152
21194
  const evalId = sanitizeForFilename4(request.evalCaseId ?? fallbackId);
@@ -21739,7 +21781,7 @@ function parseCopilotEvents(eventsJsonl) {
21739
21781
  durationMs
21740
21782
  };
21741
21783
  }
21742
- var DEFAULT_SESSION_STATE_DIR = () => path17.join(homedir(), ".copilot", "session-state");
21784
+ var DEFAULT_SESSION_STATE_DIR = () => path17.join(homedir2(), ".copilot", "session-state");
21743
21785
  async function discoverCopilotSessions(opts) {
21744
21786
  const sessionStateDir = opts?.sessionStateDir ?? DEFAULT_SESSION_STATE_DIR();
21745
21787
  const limit = opts?.limit ?? 10;
@@ -21834,7 +21876,7 @@ var CopilotLogProvider = class {
21834
21876
  return this.config.sessionDir;
21835
21877
  }
21836
21878
  if (this.config.sessionId) {
21837
- const stateDir = this.config.sessionStateDir ?? path18.join(homedir2(), ".copilot", "session-state");
21879
+ const stateDir = this.config.sessionStateDir ?? path18.join(homedir3(), ".copilot", "session-state");
21838
21880
  return path18.join(stateDir, this.config.sessionId);
21839
21881
  }
21840
21882
  if (this.config.discover === "latest") {
@@ -34325,7 +34367,7 @@ function extractResponseItemContent(content) {
34325
34367
  }
34326
34368
  return parts.length > 0 ? parts.join("") : void 0;
34327
34369
  }
34328
- var DEFAULT_SESSIONS_DIR = () => path51.join(homedir3(), ".codex", "sessions");
34370
+ var DEFAULT_SESSIONS_DIR = () => path51.join(homedir4(), ".codex", "sessions");
34329
34371
  async function discoverCodexSessions(opts) {
34330
34372
  const sessionsDir = opts?.sessionsDir ?? DEFAULT_SESSIONS_DIR();
34331
34373
  const limit = opts?.latest ? 1 : opts?.limit ?? 10;
@@ -34385,7 +34427,7 @@ async function discoverCodexSessions(opts) {
34385
34427
  sessions.sort((a, b) => b.updatedAt.getTime() - a.updatedAt.getTime());
34386
34428
  return sessions.slice(0, limit);
34387
34429
  }
34388
- var DEFAULT_PROJECTS_DIR = () => path52.join(homedir4(), ".claude", "projects");
34430
+ var DEFAULT_PROJECTS_DIR = () => path52.join(homedir5(), ".claude", "projects");
34389
34431
  function encodeProjectPath(projectPath) {
34390
34432
  return projectPath.replace(/\//g, "-");
34391
34433
  }
@@ -34709,4 +34751,4 @@ export {
34709
34751
  TranscriptProvider,
34710
34752
  createAgentKernel
34711
34753
  };
34712
- //# sourceMappingURL=chunk-LRVNXL6J.js.map
34754
+ //# sourceMappingURL=chunk-72AVLOSN.js.map