Skip to main content

imbue-mngr-pi-coding-usage

pi data provider for mngr usage. pi loads a single explicit extension (mngr_pi_coding's lifecycle extension, via pi -e), so the per-message usage writer lives there -- it already holds each assistant message's cost and tokens. This package owns the two usage-specific pieces:

  • The reader: an aggregate_usage_source hookimpl claiming the pi-coding source, aggregated session-incrementally (pi reports cost per message, summed per session).
  • The writer gate: on_after_provisioning drops a pi_emit_usage marker in each pi agent's state dir. The lifecycle extension only emits usage events when that marker is present -- so the events are written exactly when their reader (this package) is installed.

What gets captured

pi computes per-message cost client-side (usage.cost.total), so cost is REPORTED (no estimation). Each assistant message_end appends one cost_snapshot to events/pi-coding/usage/events.jsonl with the reported cost, tokens (input/output/cacheRead/cacheWrite), the provider-qualified model (<provider>/<model>), and the session id (the pi session file's basename). cost_mode is API_KEY (pi bills a real provider key).

Why the writer is in the harness extension

Unlike Claude (statusline shim) or OpenCode (auto-loaded plugin/*.ts), pi loads exactly one explicit extension owned by mngr_pi_coding. A standalone writer would require a harness change either way, so the writer is folded into the lifecycle extension (which already extracts the message usage), and this package stays the reader + gate.

Metadata

Release files for imbue-mngr-pi-coding-usage 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imbue-mngr-pi-coding-usage 0.1.1
File Size Uploaded
imbue_mngr_pi_coding_usage-0.1.1.tar.gz 10.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for imbue-mngr-pi-coding-usage 0.1.1
File Interpreter ABI Platform
imbue_mngr_pi_coding_usage-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.9 kB

Release files / imbue_mngr_pi_coding_usage-0.1.1.tar.gz

Download URL imbue_mngr_pi_coding_usage-0.1.1.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3649d4b444241acc887079c81262baef453d27472125f77fa40c26bad07cd1b8
BLAKE2b-256 checksum
How to use checksums
b109ba472c3f3afd9e5129e8a6b825d07881348672b7174f42acb6dd1ffe1226
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 18, 2026.

Transparency log

Release files / imbue_mngr_pi_coding_usage-0.1.1-py3-none-any.whl

Download URL imbue_mngr_pi_coding_usage-0.1.1-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
634516c5df23620929e8cc9615cccb27d3e820061d9133b6fc48db0c992f142a
BLAKE2b-256 checksum
How to use checksums
5ae731cf4f63893ab7dabbc981d64dad567f4df638dc1750a7d9c26250d767b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 18, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page