Files
Mohamed Boudra 9c8d775895 Let plugins customize agent creation and observe lifecycle events (#4435)
* 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
2026-09-07 19:17:42 +02:00

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);
}