mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-19 07:42:52 +00:00
* feat(plugins): expose agent and workspace lifecycle hooks * test(plugins): verify lifecycle examples with version requirements * fix(plugins): publish archive hooks for closed agents * test(plugins): remove diagnostic catch from lifecycle test * refactor(plugins): define hook handlers in lifecycle module
15 lines
487 B
TypeScript
15 lines
487 B
TypeScript
export function logHook(hook: string, data: unknown): void {
|
|
const entry = { hook, timestamp: new Date().toISOString(), data };
|
|
const line = JSON.stringify(entry, (key, value: unknown) => {
|
|
if (key === "env" && value !== null && typeof value === "object") {
|
|
const redacted: Record<string, string> = {};
|
|
for (const name of Object.keys(value)) {
|
|
redacted[name] = "[redacted]";
|
|
}
|
|
return redacted;
|
|
}
|
|
return value;
|
|
});
|
|
console.log(line);
|
|
}
|