Thanks for helping agents stop paying twice.
git clone https://github.com/Neal006/deja && cd deja
npm install
npm test
npm run typecheck
npm run build && node dist/cli.js doctorNode 20+ is required. There are no runtime dependencies, so please keep it that way.
- Never break the prefix invariant. The rewrite of message k must depend only on messages 0..k (and the eviction set). If you change matching or rendering, add a test proving an earlier message renders identically when the conversation grows (see
test/transform.test.ts). - Fail open. Anything deja doesn't understand must pass through byte for byte.
- Measure, don't guess. Changes that affect savings should come with
deja auditnumbers before and after. Paste only the summary lines: no conversation content. - No content at rest. The ledger and decay state store counts and ids only.
| path | what |
|---|---|
src/core/ |
line model, matcher, rendering, token estimate, ledger, pricing |
src/anthropic/ |
Messages API types and the request transform |
src/openai/ |
Chat Completions and Responses API adapters onto the same engine |
src/decay/ |
inventory, ski-rental policy, stubs, persisted state |
src/proxy/ |
the HTTP proxy, usage sniffing, ledger recording |
src/fetch.ts |
dejaFetch, the in-process wrapper |
src/audit/ |
transcript parsing, billing model, strategy replay, reports |
src/audit/agents/ |
agent adapter registry and transcript parsers |
src/cli/ |
commands and formatting |
- Support another agent's transcript format in
deja audit(Cline, OpenCode, aider…; seesrc/audit/agents/codex.tsfor a small example) - Better stubs for specific tools (test runners, package managers,
git diff) - More tasks for the task-success benchmark (
bench/tasks/)
Small, focused commits with conventional prefixes (feat:, fix:, docs:, test:, perf:, refactor:, chore:).
Maintainers with publish rights on the dejactx npm package:
# 1. update CHANGELOG.md (move items under a new version heading)
npm version patch # or minor; bumps package.json and tags vX.Y.Z
git push --follow-tags
npm publish --access public # runs build + tests first (prepublishOnly)- The account needs 2FA. With an authenticator app, pass
--otp=<code>. With a passkey, runnpm publishin a normal terminal so npm can wait while you approve in the browser. - npm may show a
0.0.0-stageplaceholder for a few minutes while it processes a release. Check withnpm view dejactx versions. - Then create the GitHub release:
gh release create vX.Y.Z --notes-file <(sed -n '/^## X.Y.Z/,/^## /p' CHANGELOG.md). - To give someone publish rights:
npm owner add <npm-username> dejactx.