docs/everruns-seq-bridge-integration.md
This document describes the Flow integration that runs Everruns sessions and executes
client-side seq_* tool calls via seqd without duplicating Seq mapping logic.
f ai everruns already existed, but duplicated three things now maintained in ~/code/seq:
seq_* client-side tool catalogrequest_id, run_id, tool_call_id)Flow now imports the shared bridge crate instead of carrying its own copy.
Code path changed only in Everruns tool-bridge internals:
src/ai_everruns.rsCargo.toml dependency on seq_everruns_bridgeFlow still owns and keeps unchanged:
[everruns], FLOW_EVERRUNS_*)f seq-rpc command and other AI session commandsFlow now additionally supports Maple dual-ingest telemetry export from the Everruns runtime
when SEQ_EVERRUNS_MAPLE_* env vars are set.
Runtime path is now SSE-first for lower latency:
GET /v1/sessions/{id}/sse (push events, reconnect with since_id)GET /v1/sessions/{id}/events polling when SSE endpoint is unavailableThis integration is intentionally scoped to avoid feature overlap:
seq_* tool schema/mapping anymore.f ai claude / f ai codex / f seq-rpc behavior remains unchanged.When enabled, Flow emits:
everruns.tool_call)everruns.tool_call_requested, everruns.output_message_completed, etc.)using seq_everruns_bridge::maple::MapleTraceExporter and non-blocking background batching.
Required env keys:
SEQ_EVERRUNS_MAPLE_LOCAL_ENDPOINT (example: http://ingest.maple.localhost/v1/traces)SEQ_EVERRUNS_MAPLE_LOCAL_INGEST_KEYSEQ_EVERRUNS_MAPLE_HOSTED_ENDPOINT (example: https://ingest.1focus.ai/v1/traces)SEQ_EVERRUNS_MAPLE_HOSTED_INGEST_KEYOperational setup/run instructions:
docs/everruns-maple-runbook.mdCurrent local setup in Cargo.toml:
seq_everruns_bridge = { path = "../seq/api/rust/seq_everruns_bridge" }
This matches a sibling checkout layout:
~/code/flow~/code/seqIf you want reproducible CI/clone behavior, replace the sibling path with a submodule path:
third_party/seqseq_everruns_bridge = { path = "third_party/seq/api/rust/seq_everruns_bridge" }
Run from ~/code/flow:
cargo check
cargo run --release --bin f -- ai everruns --help
rg "bridge_tool_definitions|parse_tool_call_requested|bridge_build_request" src/ai_everruns.rs
rg "map_seq_operation|seq_client_tool_definitions" src/ai_everruns.rs
rg "MapleTraceExporter|MapleSpan::for_runtime_event" src/ai_everruns.rs
End-to-end smoke (requires local Everruns + seqd):
f ai everruns "ping"
Expected evidence of integration:
src/ai_everruns.rssrc/ai_everruns.rsKeep this integration if:
seq_* tool behaviorRevert if: