@agentprojectcontext/apx 1.48.1 → 1.48.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentprojectcontext/apx",
3
- "version": "1.48.1",
3
+ "version": "1.48.2",
4
4
  "description": "APX — unified CLI + daemon for the Agent Project Context (APC) standard.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -31,19 +31,28 @@ export function detectHardware() {
31
31
  const platform = os.platform(); // "darwin" | "linux" | "win32"
32
32
  const arch = os.arch(); // "arm64" | "x64" | ...
33
33
  const appleSilicon = platform === "darwin" && arch === "arm64";
34
+ const mem_gb = Math.round((os.totalmem() / 1024 ** 3) * 10) / 10;
34
35
 
35
36
  if (appleSilicon) {
36
- return { platform, arch, appleSilicon: true, gpu: "metal", gpuName: cpuBrand() };
37
+ // Unified memory: the GPU shares system RAM, so mem_gb is also the VRAM ceiling.
38
+ return { platform, arch, appleSilicon: true, gpu: "metal", gpuName: cpuBrand(), mem_gb, unified_memory: true };
37
39
  }
38
40
  // NVIDIA: nvidia-smi exits 0 when a CUDA GPU + driver are present.
39
41
  if (cmdOk("nvidia-smi", ["-L"])) {
40
- return { platform, arch, appleSilicon: false, gpu: "cuda" };
42
+ return { platform, arch, appleSilicon: false, gpu: "cuda", gpuName: nvidiaName(), mem_gb };
41
43
  }
42
44
  // AMD/Radeon: rocminfo (ROCm stack) is the clearest signal on Linux.
43
45
  if (platform === "linux" && cmdOk("rocminfo")) {
44
- return { platform, arch, appleSilicon: false, gpu: "rocm" };
46
+ return { platform, arch, appleSilicon: false, gpu: "rocm", mem_gb };
45
47
  }
46
- return { platform, arch, appleSilicon: false, gpu: "none" };
48
+ return { platform, arch, appleSilicon: false, gpu: "none", gpuName: cpuBrand(), mem_gb };
49
+ }
50
+
51
+ function nvidiaName() {
52
+ try {
53
+ const r = spawnSync("nvidia-smi", ["--query-gpu=name", "--format=csv,noheader"], { timeout: 1500, encoding: "utf8" });
54
+ return r.status === 0 ? (r.stdout || "").split("\n")[0].trim() || undefined : undefined;
55
+ } catch { return undefined; }
47
56
  }
48
57
 
49
58
  function cpuBrand() {
@@ -70,7 +70,11 @@ export function register(app) {
70
70
  try {
71
71
  const { transcribeBuffer } = await import("#core/voice/transcription.js");
72
72
  const result = await transcribeBuffer(buf, format, {
73
- language: language === "auto" ? undefined : language,
73
+ // Only override the language when the caller pins a real one. An
74
+ // "auto" header must NOT clobber the configured language (e.g. the
75
+ // desktop always sends "auto", which used to override config.user
76
+ // .language="es" with detection — hurting accuracy on short clips).
77
+ ...(language && language !== "auto" ? { language } : {}),
74
78
  beam_size: 3,
75
79
  ...(provider ? { provider } : {}),
76
80
  });