Live invocation log — bridgeToolEventBus into an EventStream.
Orrery-style consoles (and any MCP host) subscribe to tool-call events and
stream each one as a named-blockFragmentover SSE. No historical
persistence — this is a live fan-out of the existing bus only.
Usage::
from chirp.tools.live_log import mount_invocation_log, tool_event_stream
mount_invocation_log(app) # GET /invocations/live
# or hand-roll a route:
@app.route("/feed", referenced=True)
def feed():
return tool_event_stream(app.tool_events)
tools.live_log
| Name | Type | Default | Description |
|---|---|---|---|
type
|
|
— | |
qualified_name
|
|
— | |
element_type
|
|
— | |
description
|
|
— | |
source_file
|
|
— | |
line_number
|
|
— | |
is_autodoc
|
|
— | |
autodoc_element
|
|
— | |
_autodoc_template
|
|
— | |
_autodoc_url_path
|
|
— | |
_autodoc_page_type
|
|
— | |
title
|
|
— | |
doc_content_hash
|
|
— |
Symbols on this page
Bridgebus.subscribe() into an EventStreamof live-log fragments.
Each successful tool invocation already emits aToolCallEventon
the app'sToolEventBus. This helper turns…
Register the live invocation-log SSE route and its fragment template.
Adds aDictLoader entry for template(row + optional sink shell)
and areferenced=True…
tool_event_stream
function
def tool_event_stream(bus: ToolEventBus, *, template: str = DEFAULT_INVOCATION_LOG_TEMPLATE, block: str = DEFAULT_INVOCATION_LOG_BLOCK, target: str | None = None) -> EventStream
Bridgebus.subscribe() into an EventStreamof live-log fragments.
Each successful tool invocation already emits aToolCallEventon
the app'sToolEventBus. This helper turns that subscription into
the standard Chirp SSE return type so consoles cansse-connectwithout
hand-rolling the generator.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
bus
|
ToolEventBus
|
— | |
template
|
str
|
DEFAULT_INVOCATION_LOG_TEMPLATE
|
|
block
|
str
|
DEFAULT_INVOCATION_LOG_BLOCK
|
|
target
|
str | None
|
None
|
mount_invocation_log
function
def mount_invocation_log(app: App, *, path: str = DEFAULT_INVOCATION_LOG_PATH, template: str = DEFAULT_INVOCATION_LOG_TEMPLATE, block: str = DEFAULT_INVOCATION_LOG_BLOCK, bus: ToolEventBus | None = None) -> str
Register the live invocation-log SSE route and its fragment template.
Adds aDictLoader entry for template(row + optional sink shell)
and areferenced=TrueGET route that returns
tool_event_stream() over bus (default: app.tool_events).
Returns the normalized route path.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
app
|
App
|
— | |
path
|
str
|
DEFAULT_INVOCATION_LOG_PATH
|
|
template
|
str
|
DEFAULT_INVOCATION_LOG_TEMPLATE
|
|
block
|
str
|
DEFAULT_INVOCATION_LOG_BLOCK
|
|
bus
|
ToolEventBus | None
|
None
|
View source · /home/runner/work/chirp/chirp/site/../src/chirp/tools/live_log.py:1