@ramarivera/coding-agent-langfuse 0.1.37 → 0.1.38
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 +2 -1
- package/dist/service.js +27 -2
- package/package.json +1 -1
package/dist/service.d.ts
CHANGED
|
@@ -34,5 +34,6 @@ 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
|
+
declare function redactStatusOutput(output: string): string;
|
|
37
38
|
declare function lifecycleEnv(): NodeJS.ProcessEnv;
|
|
38
|
-
export { type ServiceOptions, type ServicePlan, buildServicePlan, parseServiceArgs, serviceMain, lifecycleEnv, };
|
|
39
|
+
export { type ServiceOptions, type ServicePlan, buildServicePlan, redactStatusOutput, parseServiceArgs, serviceMain, lifecycleEnv, };
|
package/dist/service.js
CHANGED
|
@@ -249,7 +249,7 @@ async function serviceMain(argv = process.argv.slice(2)) {
|
|
|
249
249
|
return plan;
|
|
250
250
|
}
|
|
251
251
|
if (options.action === "status") {
|
|
252
|
-
|
|
252
|
+
runStatusCommands(plan.statusCommands);
|
|
253
253
|
console.log(JSON.stringify(plan, null, 2));
|
|
254
254
|
return plan;
|
|
255
255
|
}
|
|
@@ -452,6 +452,31 @@ function runCommands(commands, options = {}) {
|
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
+
function runStatusCommands(commands) {
|
|
456
|
+
const env = lifecycleEnv();
|
|
457
|
+
for (const command of commands) {
|
|
458
|
+
const output = execFileSync(command[0], command.slice(1), {
|
|
459
|
+
encoding: "utf8",
|
|
460
|
+
env,
|
|
461
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
462
|
+
});
|
|
463
|
+
process.stdout.write(redactStatusOutput(output));
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
function redactStatusOutput(output) {
|
|
467
|
+
return output
|
|
468
|
+
.split(/\r?\n/)
|
|
469
|
+
.map((line) => {
|
|
470
|
+
if (/^\s*[A-Za-z_][A-Za-z0-9_()]*\s*=>\s*/.test(line)) {
|
|
471
|
+
return line.replace(/=>\s*.*/, "=> [redacted]");
|
|
472
|
+
}
|
|
473
|
+
if (/^\s*(Path|PATH|.*(?:TOKEN|KEY|SECRET|PASSWORD|AUTH|CREDENTIAL).*)\s*:/i.test(line)) {
|
|
474
|
+
return line.replace(/:\s*.*/, ": [redacted]");
|
|
475
|
+
}
|
|
476
|
+
return line;
|
|
477
|
+
})
|
|
478
|
+
.join("\n");
|
|
479
|
+
}
|
|
455
480
|
function lifecycleEnv() {
|
|
456
481
|
const keys = [
|
|
457
482
|
"PATH",
|
|
@@ -499,4 +524,4 @@ function escapeXml(value) {
|
|
|
499
524
|
.replaceAll('"', """)
|
|
500
525
|
.replaceAll("'", "'");
|
|
501
526
|
}
|
|
502
|
-
export { buildServicePlan, parseServiceArgs, serviceMain, lifecycleEnv, };
|
|
527
|
+
export { buildServicePlan, redactStatusOutput, parseServiceArgs, serviceMain, lifecycleEnv, };
|