[STG-1566] Flow logger schema and collection cleanup to prepare for Observability
PI
8mo ago+3537+3537+0123456789012345678901234567890123456789-1286-1286-0123456789012345678901234567890123456789
Refactored flow logging to an event-based system with FlowLogger and a pluggable eventStore, improving LLM/CDP traces, action and screenshot events, and concise prompt/response summaries. V3 now carries a sessionId and flowLoggerContext. Split the server into server-v3 and server-v4 with separate OpenAPI, routes, and SEA builds, and updated CI.
-
New Features
- Added
eventStorewithFileEventStore, queries, aggregate metrics, and bus attachment; exportedgetEventStore,setEventStore,destroyEventStore, andgetFlowLogConfigDir. - Replaced
SessionFileLoggerwithFlowLoggeracross agents and handlers; addedwrapWithLoggingforPageactions; standardized event names viatoTitleCase. - Switched to concise LLM summary helpers (
extractLlmPromptSummary,extractLlmCuaPromptSummary,extractLlmCuaResponseSummary) andFlowLogger.createLlmLoggingMiddleware. V3Options.sessionIdnow used to associate flows; CDP calls are linked to flow events for better correlation.- Exported
FlowLogger,FlowEvent, andtoTitleCasefrom@core/v3/index.
- Added
-
Migration
- Replace
SessionFileLoggerand@logActionwithFlowLoggermethods (log*,wrapWithLogging). - Use
setEventStore/getEventStoreto plug custom storage (FileEventStoreby default); optionally passsessionIdinV3Options. - Update paths/scripts from
packages/servertopackages/server-v3; use new binariesstagehand-server-v3-*/stagehand-server-v4-*.
- Replace