feat(FN-3889): emit shutdown event when Fusion session is disposed

Emit a session shutdown event when a Fusion session is disposed, with a matching test update in the engine package.

Fusion-Task-Id: FN-3889
This commit is contained in:
Fusion
2026-05-09 13:51:31 -07:00
committed by gsxdsm
parent 1e800594d5
commit f4967162c9
5 changed files with 153 additions and 1 deletions

View File

@@ -158,6 +158,12 @@ describe.skipIf(!SHOULD_RUN_EXTENSION_INTEGRATION)("built fn pi extension integr
}
});
it("exposes a callable session_shutdown handler", async () => {
const shutdown = api.events.get("session_shutdown");
expect(typeof shutdown).toBe("function");
await expect(shutdown?.()).resolves.toBeUndefined();
});
it("creates and lists tasks through the built extension", async () => {
const createTool = api.tools.get("fn_task_create")!;
const created = await createTool.execute(