pi usage data provider for `mngr usage` (reader + writer gate; the per-message writer lives in mngr_pi_coding's lifecycle extension)
Project description
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_sourcehookimpl claiming thepi-codingsource, aggregated session-incrementally (pi reports cost per message, summed per session). - The writer gate:
on_after_provisioningdrops api_emit_usagemarker 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imbue_mngr_pi_coding_usage-0.1.1.tar.gz.
File metadata
- Download URL: imbue_mngr_pi_coding_usage-0.1.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3649d4b444241acc887079c81262baef453d27472125f77fa40c26bad07cd1b8
|
|
| MD5 |
2b0166202ed00d17dcef6bc62bff9e5b
|
|
| BLAKE2b-256 |
b109ba472c3f3afd9e5129e8a6b825d07881348672b7174f42acb6dd1ffe1226
|
Provenance
The following attestation bundles were made for imbue_mngr_pi_coding_usage-0.1.1.tar.gz:
Publisher:
publish.yml on imbue-ai/mngr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imbue_mngr_pi_coding_usage-0.1.1.tar.gz -
Subject digest:
3649d4b444241acc887079c81262baef453d27472125f77fa40c26bad07cd1b8 - Sigstore transparency entry: 1858307881
- Sigstore integration time:
-
Permalink:
imbue-ai/mngr@ed465f3fc2a0b4ad935d473b03bcffb205fac223 -
Branch / Tag:
refs/tags/v0.2.17 - Owner: https://github.com/imbue-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ed465f3fc2a0b4ad935d473b03bcffb205fac223 -
Trigger Event:
push
-
Statement type:
File details
Details for the file imbue_mngr_pi_coding_usage-0.1.1-py3-none-any.whl.
File metadata
- Download URL: imbue_mngr_pi_coding_usage-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
634516c5df23620929e8cc9615cccb27d3e820061d9133b6fc48db0c992f142a
|
|
| MD5 |
1a3069e90a759aa1ef4c50a51436984f
|
|
| BLAKE2b-256 |
5ae731cf4f63893ab7dabbc981d64dad567f4df638dc1750a7d9c26250d767b6
|
Provenance
The following attestation bundles were made for imbue_mngr_pi_coding_usage-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on imbue-ai/mngr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imbue_mngr_pi_coding_usage-0.1.1-py3-none-any.whl -
Subject digest:
634516c5df23620929e8cc9615cccb27d3e820061d9133b6fc48db0c992f142a - Sigstore transparency entry: 1858308246
- Sigstore integration time:
-
Permalink:
imbue-ai/mngr@ed465f3fc2a0b4ad935d473b03bcffb205fac223 -
Branch / Tag:
refs/tags/v0.2.17 - Owner: https://github.com/imbue-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ed465f3fc2a0b4ad935d473b03bcffb205fac223 -
Trigger Event:
push
-
Statement type: