@ramarivera/coding-agent-langfuse 0.1.35 → 0.1.37

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/README.md CHANGED
@@ -79,9 +79,9 @@ service binary; raw `sc.exe` is not a good fit for a transient npm command.
79
79
 
80
80
  The generated services are package-manager agnostic. By default the installer
81
81
  uses `npx` through the service `PATH` (`/usr/bin/env npx` on macOS and Linux)
82
- and captures the current `PATH`; use `--npx-path` and `--path` when installing
83
- from a shell manager such as Homebrew, nvm, fnm, Volta, asdf, mise, or a system
84
- Node.js install.
82
+ with a conservative cross-platform PATH. Use `--npx-path` and `--path` when a
83
+ host keeps Node.js somewhere outside the normal npm/Homebrew/system locations,
84
+ including nvm, fnm, Volta, asdf, mise, or another shell manager.
85
85
 
86
86
  ## Backfill windows
87
87
 
package/dist/service.d.ts CHANGED
@@ -34,4 +34,5 @@ type ServicePlan = {
34
34
  declare function parseServiceArgs(argv: string[]): ServiceOptions;
35
35
  declare function buildServicePlan(options: ServiceOptions): ServicePlan;
36
36
  declare function serviceMain(argv?: string[]): Promise<ServicePlan>;
37
- export { type ServiceOptions, type ServicePlan, buildServicePlan, parseServiceArgs, serviceMain, };
37
+ declare function lifecycleEnv(): NodeJS.ProcessEnv;
38
+ export { type ServiceOptions, type ServicePlan, buildServicePlan, parseServiceArgs, serviceMain, lifecycleEnv, };
package/dist/service.js CHANGED
@@ -20,7 +20,7 @@ Service options:
20
20
  --state PATH Dedupe state file
21
21
  --home PATH Home directory to scan (default: current user home)
22
22
  --package-spec SPEC npx package spec (default: ${defaultPackageSpec})
23
- --npx-path PATH npx executable path for host services (default: auto-detected)
23
+ --npx-path PATH npx executable path for host services (default: npx/npx.cmd)
24
24
  --batch-size N OTLP spans per POST (default: 10)
25
25
  --poll-interval-ms N Delay between --follow scans (default: 5000)
26
26
  --post-delay-ms N Delay after each successful OTLP POST (default: 0)
@@ -384,8 +384,6 @@ function defaultServiceName(agents, platform) {
384
384
  : `coding-agent-langfuse-${suffix}`;
385
385
  }
386
386
  function defaultPathEnv(homeDir, platform) {
387
- if (process.env.PATH)
388
- return process.env.PATH;
389
387
  if (platform === "win32") {
390
388
  return [
391
389
  "%APPDATA%\\npm",
@@ -443,9 +441,10 @@ function parseNonNegativeInt(flag, value) {
443
441
  return parsed;
444
442
  }
445
443
  function runCommands(commands, options = {}) {
444
+ const env = lifecycleEnv();
446
445
  for (const command of commands) {
447
446
  try {
448
- execFileSync(command[0], command.slice(1), { stdio: "inherit" });
447
+ execFileSync(command[0], command.slice(1), { stdio: "inherit", env });
449
448
  }
450
449
  catch (error) {
451
450
  if (!options.ignoreFailure)
@@ -453,6 +452,34 @@ function runCommands(commands, options = {}) {
453
452
  }
454
453
  }
455
454
  }
455
+ function lifecycleEnv() {
456
+ const keys = [
457
+ "PATH",
458
+ "Path",
459
+ "HOME",
460
+ "USER",
461
+ "LOGNAME",
462
+ "TMPDIR",
463
+ "TMP",
464
+ "TEMP",
465
+ "SystemRoot",
466
+ "WINDIR",
467
+ "APPDATA",
468
+ "LOCALAPPDATA",
469
+ "ProgramFiles",
470
+ "ProgramFiles(x86)",
471
+ "ProgramData",
472
+ ];
473
+ const env = {};
474
+ for (const key of keys) {
475
+ const value = process.env[key];
476
+ if (value)
477
+ env[key] = value;
478
+ }
479
+ if (!env.PATH && !env.Path)
480
+ env.PATH = defaultPathEnv(process.env.HOME ?? homedir(), currentServicePlatform());
481
+ return env;
482
+ }
456
483
  function systemdCommand(command) {
457
484
  return ["/usr/bin/env", ...command].map(systemdQuote).join(" ");
458
485
  }
@@ -472,4 +499,4 @@ function escapeXml(value) {
472
499
  .replaceAll('"', "&quot;")
473
500
  .replaceAll("'", "&apos;");
474
501
  }
475
- export { buildServicePlan, parseServiceArgs, serviceMain, };
502
+ export { buildServicePlan, parseServiceArgs, serviceMain, lifecycleEnv, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ramarivera/coding-agent-langfuse",
3
- "version": "0.1.35",
3
+ "version": "0.1.37",
4
4
  "description": "Universal coding-agent Langfuse backfiller and live OTLP helpers",
5
5
  "type": "module",
6
6
  "license": "MIT",