@openagentsy/ledger 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +20 -2
- package/data/pricing/litellm.json +8882 -0
- package/data/pricing/models.dev.json +12151 -0
- package/data/pricing/openrouter.json +1017 -0
- package/dist/db.d.ts +44 -0
- package/dist/db.d.ts.map +1 -0
- package/dist/db.js +97 -0
- package/dist/db.js.map +1 -0
- package/dist/export.d.ts +71 -0
- package/dist/export.d.ts.map +1 -0
- package/dist/export.js +78 -0
- package/dist/export.js.map +1 -0
- package/dist/footprint.d.ts +24 -0
- package/dist/footprint.d.ts.map +1 -0
- package/dist/footprint.js +33 -0
- package/dist/footprint.js.map +1 -0
- package/dist/git.d.ts +44 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +126 -0
- package/dist/git.js.map +1 -0
- package/dist/git.test.d.ts +2 -0
- package/dist/git.test.d.ts.map +1 -0
- package/dist/git.test.js +101 -0
- package/dist/git.test.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/ingest.d.ts +133 -0
- package/dist/ingest.d.ts.map +1 -0
- package/dist/ingest.js +324 -0
- package/dist/ingest.js.map +1 -0
- package/dist/ingest.test.d.ts +2 -0
- package/dist/ingest.test.d.ts.map +1 -0
- package/dist/ingest.test.js +245 -0
- package/dist/ingest.test.js.map +1 -0
- package/dist/outcomes.d.ts +81 -0
- package/dist/outcomes.d.ts.map +1 -0
- package/dist/outcomes.js +85 -0
- package/dist/outcomes.js.map +1 -0
- package/dist/outcomes.test.d.ts +2 -0
- package/dist/outcomes.test.d.ts.map +1 -0
- package/dist/outcomes.test.js +160 -0
- package/dist/outcomes.test.js.map +1 -0
- package/dist/policy.d.ts +48 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +99 -0
- package/dist/policy.js.map +1 -0
- package/dist/policy.test.d.ts +2 -0
- package/dist/policy.test.d.ts.map +1 -0
- package/dist/policy.test.js +126 -0
- package/dist/policy.test.js.map +1 -0
- package/dist/pricing.d.ts +92 -0
- package/dist/pricing.d.ts.map +1 -0
- package/dist/pricing.js +341 -0
- package/dist/pricing.js.map +1 -0
- package/dist/pricing.test.d.ts +2 -0
- package/dist/pricing.test.d.ts.map +1 -0
- package/dist/pricing.test.js +167 -0
- package/dist/pricing.test.js.map +1 -0
- package/dist/query.d.ts +134 -0
- package/dist/query.d.ts.map +1 -0
- package/dist/query.js +247 -0
- package/dist/query.js.map +1 -0
- package/dist/query.test.d.ts +2 -0
- package/dist/query.test.d.ts.map +1 -0
- package/dist/query.test.js +242 -0
- package/dist/query.test.js.map +1 -0
- package/dist/schema.d.ts +33 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +139 -0
- package/dist/schema.js.map +1 -0
- package/dist/schema.test.d.ts +2 -0
- package/dist/schema.test.d.ts.map +1 -0
- package/dist/schema.test.js +129 -0
- package/dist/schema.test.js.map +1 -0
- package/dist/waste.d.ts +116 -0
- package/dist/waste.d.ts.map +1 -0
- package/dist/waste.js +553 -0
- package/dist/waste.js.map +1 -0
- package/dist/waste.test.d.ts +2 -0
- package/dist/waste.test.d.ts.map +1 -0
- package/dist/waste.test.js +278 -0
- package/dist/waste.test.js.map +1 -0
- package/package.json +52 -4
package/README.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @openagentsy/ledger
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The usage ledger: tokens, cost, waste, outcomes and footprint, per message.
|
|
4
|
+
|
|
5
|
+
**Numbers only.** The ledger stores token counts, model ids, timestamps, task
|
|
6
|
+
ids and commit shas. It never stores a prompt, a completion or a line of
|
|
7
|
+
code: the transcripts stay in OpenCode's own storage, and nothing here is
|
|
8
|
+
uploaded anywhere. A report can say what the work cost without ever holding
|
|
9
|
+
the work.
|
|
10
|
+
|
|
11
|
+
The role of a message arrives **already resolved** by the adapter. The ledger
|
|
12
|
+
stores the role it is given and never resolves one, so a report cannot
|
|
13
|
+
mis-attribute a message to a role it was not given.
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
oa ledger export --json # the counters, and only the counters
|
|
17
|
+
oa ledger --root . # the same numbers, for a human
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The shape of the export is in [SCHEMA.md](./SCHEMA.md), and the tables are
|
|
21
|
+
described there too.
|