@ramarivera/coding-agent-langfuse 0.1.36 → 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/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
@@ -441,9 +441,10 @@ function parseNonNegativeInt(flag, value) {
441
441
  return parsed;
442
442
  }
443
443
  function runCommands(commands, options = {}) {
444
+ const env = lifecycleEnv();
444
445
  for (const command of commands) {
445
446
  try {
446
- execFileSync(command[0], command.slice(1), { stdio: "inherit" });
447
+ execFileSync(command[0], command.slice(1), { stdio: "inherit", env });
447
448
  }
448
449
  catch (error) {
449
450
  if (!options.ignoreFailure)
@@ -451,6 +452,34 @@ function runCommands(commands, options = {}) {
451
452
  }
452
453
  }
453
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
+ }
454
483
  function systemdCommand(command) {
455
484
  return ["/usr/bin/env", ...command].map(systemdQuote).join(" ");
456
485
  }
@@ -470,4 +499,4 @@ function escapeXml(value) {
470
499
  .replaceAll('"', "&quot;")
471
500
  .replaceAll("'", "&apos;");
472
501
  }
473
- 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.36",
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",