@agimon-ai/doompi-log

Pi session metrics, findings, sink status, and a Log Metrics overlay for agent observability.

Packages

Package details

extension

Install @agimon-ai/doompi-log from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@agimon-ai/doompi-log
Package
@agimon-ai/doompi-log
Version
0.0.1-alpha.76
Published
Sep 18, 2026
Downloads
7,755/mo · 966/wk
Author
agiflow-ai
License
MIT
Types
extension
Size
760.3 KB
Dependencies
8 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./dist/extensions/pi.mjs"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@agimon-ai/doompi-log

Session metrics, findings, sink status, and a Log Metrics overlay for Pi.

Part of the DoomPi distribution.

The extension aggregates telemetry it observes in-process and can query historical data from @agimon-ai/log-sink-mcp.

Alpha: metric attribution and UI contracts may change between releases.

Requirements

  • Node.js 22.19.0 or newer
  • Pi 0.85.0 and Pi TUI 0.85.0

Install

doompi init and dpi init include Log in default.packages in .doom/modes.yaml. Remove it or move it to a named layer to change which major modes load it. Pi discovers its sole extension entry through package.json.pi.extensions. For standalone Pi:

pi install npm:@agimon-ai/doompi-log

Use SPC h l to open the current session's Log Metrics overlay.

What is collected

The in-process aggregator tracks operational records such as turn token totals, cache use, tool calls and failures, operation durations, recent errors, and event counts. It derives findings from those records without requiring an external sink.

Historical panels resolve a sink over HTTP first and then use the Log Sink CLI fallback. Without a reachable sink, current-session headline metrics, findings, errors, and tool metrics still work; historical top-consumer and burn-rate views are unavailable. Sink failures are reported in status rather than failing the Pi session.

Turn cost attribution is contextual: when a turn invokes several tools, the emitted turn total can be associated with each participating tool. The overlay uses that value for ranking, not as a precise per-tool share.

Keys: r refreshes, g changes dimension, p changes period, ? opens details, and Escape closes.

Telemetry controls

Variable Effect
AGENT_TELEMETRY_DISABLED Disables the extension's telemetry export
OTEL_SDK_DISABLED Disables OpenTelemetry SDK export
AGENT_OTEL_TRACES Enables/disables trace export; logs can remain enabled

File fallback is opt-in through host options. The absence of a configured or reachable endpoint does not prevent in-process aggregation. Exceptions and caller-supplied attributes can still be sensitive; do not assume "metadata" is harmless.

The overlay requires a TUI. The aggregator, findings, and metrics-source APIs can be embedded in headless hosts.

Public API

import { deriveFindings, LogMetricsAggregator, openLogMetricsOverlay } from '@agimon-ai/doompi-log';

Normal Pi activation uses extensions/pi. Composition hosts await doomLogExtension.install(context, pi) from that entry. The helper owns registrations and cleanup. Session shutdown flushes final telemetry before onDispose releases the telemetry handle. Optional UI services follow provider replacement.

src/extensions/ declares the Pi, server, and web plugins. Controllers handle events and HTTP requests, services own aggregation and sink queries, and src/tui/ owns terminal presentation. Flat src/exports/ modules expose reusable APIs. The overlay component is available through metrics-overlay.

Development

pnpm build
pnpm typecheck
pnpm test
pnpm lint

Maintained by Agimon.

License

MIT