Files
paseo/plugin-examples/lifecycle-logger
Mohamed Boudra 986687b8fd feat(plugins): unify lifecycle hooks and await worktree initialization (#8081)
* refactor(plugins): make lifecycle hook timing explicit

Use one registration method and subject.operation.step names so plugin authors can read whether an operation waits. Preserve old registrations through a single SDK adapter and keep timing and payloads unchanged.

* fix(plugins): align hook notes and example fixtures with release contracts

Keep the changelog inside its versioned beta entry for app parsing. Run current plugin examples against the checkout version so their declared requirements remain valid.

* docs(plugins): align translated hook dependency guidance

* fix(plugins): align hook exports and release documentation

* feat(plugins): use lifecycle positions and await worktree initialization

* test(plugins): cover first-agent worktree initialization

* test(plugins): verify rollback against workspace catalog entries
2026-10-28 17:04:52 +07:00
..

Lifecycle logger

Registers all eleven server lifecycle hooks and logs their data as JSON. It observes agent creation, session opening, turns, permissions, archive, and workspace creation/archive. Before hooks return the request unchanged. Environment values are redacted; prompts and timeline content are logged.

Install it on a daemon where plugins are enabled:

paseo plugin install /absolute/path/to/plugin-examples/lifecycle-logger
paseo plugin logs lifecycle-logger

The same entries appear in the target daemon's daemon.log. The plugin log viewer retains a bounded tail; use the daemon log for longer captures. Log lines are capped at 16 KiB, so a large timeline can be truncated.

See the lifecycle reference for callback shapes and delivery rules. The real-provider test in packages/server/src/server/plugins/lifecycle.real.e2e.test.ts runs both examples on an isolated daemon and saves evidence under .dev/lifecycle-proof/.

Run it from packages/server on Linux with Claude configured:

npx vitest run src/server/plugins/lifecycle.real.e2e.test.ts --bail=1

The test uses real provider calls and a temporary daemon home. Its failure check uses Linux /proc to identify and terminate only its own Claude subprocess. The credits check asks the real agent to emit the matching phrase; it does not exhaust an account's credits.