{"id":"@lssm-tech/lib.cost-tracking","slug":"lib.cost-tracking","name":"@lssm-tech/lib.cost-tracking","version":"6.0.4","path":"packages/platform/delivery/cost-tracking","manifestPath":"packages/platform/delivery/cost-tracking/package.json","manifestBlobSha":"42492d1f00509960a7146727182811eb87cb54a5","layer":"platform","physicalArea":"delivery","primaryArea":"billing-and-finance","classification":{"privateDeclared":null,"catalogFamily":"sharedLibs","catalogKind":"library","catalogStatus":"active","adoptionMode":"adoptable","stability":"stable"},"description":"API cost tracking and budgeting","descriptionOrigin":"package.json","catalog":{"family":"sharedLibs","kind":"library","status":"active","adoptionMode":"adoptable","stability":"stable","platforms":["server"],"runtimes":["node"],"entrypoints":["."],"documentation":[{"title":"Lib Cost Tracking documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Flib.cost-tracking","kind":"readme"}],"examples":[],"replacements":[],"capabilities":[{"id":"package.lssm.tech.lib.cost.tracking","title":"Lib Cost Tracking","description":"API cost tracking and budgeting","status":"active","useCases":["Adopt api cost tracking and budgeting"],"aliases":["contractspec","cost","budgeting","api","metering","typescript","lib","tracking"],"pythonEquivalents":[],"canonicalImports":[{"from":"@lssm-tech/lib.cost-tracking","symbols":[]}],"constraints":{"platforms":["server"],"runtimes":["node"],"avoidWhen":["The @lssm-tech/lib.cost-tracking package constraints do not match the target runtime or platform."],"requires":["TypeScript"]},"alternatives":[],"relationships":[],"resolutionPriority":50}]},"canonicalImports":[{"capabilityId":"package.lssm.tech.lib.cost.tracking","from":"@lssm-tech/lib.cost-tracking","symbols":[]}],"scripts":{"publish:pkg":"bun publish --tolerate-republish --ignore-scripts --verbose","publish:pkg:canary":"bun publish:pkg --tag canary","build":"contractspec-bun-build build","build:bundle":"contractspec-bun-build transpile","build:types":"contractspec-bun-build types","dev":"contractspec-bun-build dev","clean":"rimraf dist .turbo","lint":"bun lint:fix","lint:fix":"node ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .","lint:check":"node ../../../../scripts/biome.cjs check .","test":"bun test --pass-with-no-tests","prebuild":"contractspec-bun-build prebuild","typecheck":"tsgo --noEmit"},"scriptStatus":"complete pinned manifest","dependencies":{"@lssm-tech/lib.contracts-spec-core":"workspace:^","@lssm-tech/lib.economic-evidence":"workspace:^"},"devDependencies":{"@lssm-tech/tool.typescript":"workspace:*","typescript":"catalog:","@lssm-tech/tool.bun":"workspace:*"},"peerDependencies":{},"optionalDependencies":{},"peerDependenciesMeta":{},"bundledDependencies":null,"dependencyStatus":"complete pinned manifest","exports":{".":"./src/index.ts"},"publishExports":{".":{"types":"./dist/index.d.ts","browser":"./dist/browser/index.js","bun":"./dist/index.js","node":"./dist/node/index.js","default":"./dist/index.js"}},"types":"./dist/index.d.ts","files":["dist","README.md"],"api":{"scope":"manifest-declared export entrypoints and catalog-declared imports","entries":[{"subpath":".","importPath":"@lssm-tech/lib.cost-tracking","target":"./src/index.ts","targets":[{"conditions":[],"target":"./src/index.ts","sourcePath":"packages/platform/delivery/cost-tracking/src/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/cost-tracking/src/index.ts","sourceStatus":"verified source file"}]}],"entryCount":1,"namedSymbolCoverage":"catalog declarations only; exhaustive TypeScript symbols not extracted","installationStatus":"not verified"},"docsLinks":[{"title":"Lib Cost Tracking documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Flib.cost-tracking","kind":"readme","pinnedUrl":null,"sourceStatus":"declared link; destination not verified"}],"sourceUrls":{"package":"https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/cost-tracking","manifest":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/cost-tracking/package.json","readme":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/cost-tracking/README.md","guide":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/lib.cost-tracking.txt"},"readme":{"status":"available","body":"# @lssm-tech/lib.cost-tracking\n\nWebsite: https://contractspec.io\n\n**API cost tracking and budgeting.**\n\n## What It Provides\n\n- **Layer**: lib.\n- **Consumers**: bundles.\n- Related ContractSpec packages include `@lssm-tech/tool.bun`, `@lssm-tech/tool.typescript`.\n- Related ContractSpec packages include `@lssm-tech/tool.bun`, `@lssm-tech/tool.typescript`.\n\n## Installation\n\n`npm install @lssm-tech/lib.cost-tracking`\n\nor\n\n`bun add @lssm-tech/lib.cost-tracking`\n\n## Usage\n\nImport the root entrypoint from `@lssm-tech/lib.cost-tracking`. The current package export map exposes only the root `.` entrypoint, so consumers should avoid undocumented subpath imports.\n\n## Architecture\n\n- `src/budget-alert-manager.ts` is part of the package's public or composition surface.\n- `src/cost-model.ts` is part of the package's public or composition surface.\n- `src/cost-tracker.ts` is part of the package's public or composition surface.\n- `src/exact-cost-calculator.ts` deterministically multiplies integer usage by exact minor-unit or decimal-string rate cards.\n- `src/economic-evidence*.ts` provides additive neutral economic evidence helpers backed by `@lssm-tech/lib.economic-evidence`.\n- `src/index.ts` is the root public barrel and package entrypoint.\n- `src/optimization-recommender.ts` is part of the package's public or composition surface.\n- `src/types.ts` is shared public type definitions.\n\n## Public Entry Points\n\n- Export `.` resolves through `./src/index.ts`.\n- Economic evidence helpers are exported from the root entrypoint; keep subpath imports undocumented until the package export map intentionally changes.\n\n## Local Commands\n\n- `bun run dev` — contractspec-bun-build dev\n- `bun run build` — contractspec-bun-build build\n- `bun run test` — bun test --pass-with-no-tests\n- `bun run lint` — bun lint:fix\n- `bun run lint:check` — biome check .\n- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .\n- `bun run typecheck` — tsgo --noEmit\n- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose\n- `bun run publish:pkg:canary` — bun publish:pkg --tag canary\n- `bun run clean` — rimraf dist .turbo\n- `bun run build:bundle` — contractspec-bun-build transpile\n- `bun run build:types` — contractspec-bun-build types\n- `bun run prebuild` — contractspec-bun-build prebuild\n\n## Recent Updates\n\n- Add neutral economic evidence bridge helpers that emit usage, cost, budget, and optimization projection refs without changing existing cost calculation semantics.\n- Replace eslint+prettier by biomejs to optimize speed.\n\n## Notes\n\n- Cost calculation logic must stay deterministic — no side effects or external calls during computation.\n- Budget threshold types are shared across consumers; changes require coordination.\n- Do not introduce floating-point arithmetic where precision matters; use integer cents or a decimal library.\n- Existing number-based cost totals are exposed to economic evidence as `estimated_decimal_string` values so downstream billing/finance surfaces cannot mistake them for exact money ledgers.\n- New authoritative paths should use `calculateExactCostLinesV1`; the existing number-based tracker remains a compatibility estimate calculator.\n","sourcePath":"packages/platform/delivery/cost-tracking/README.md","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/delivery/cost-tracking/README.md","blobSha":"ce6903760756adb4a782836481ce1c9ce161ebfd","sourcePin":"bcc79fcc27c4d801c2119bef81ddcce7b4e86498","origin":"README recovered byte-for-byte from pinned aggregate guide","integrity":"exact Git blob match","executionStatus":"not executed"},"provenance":{"repository":"lssm-tech/contractspec","sourcePin":"bcc79fcc27c4d801c2119bef81ddcce7b4e86498","manifestOrigin":"pinned GitHub manifest fetch","manifestComplete":true,"publicationPolicyApplied":false},"areaSlug":"billing-and-finance","areaTitle":"Billing, finance and economic evidence","displayName":"lib.cost-tracking","runtimes":["node"],"platforms":["server"],"kind":"library","scope":"Package manifest","canonicalRoute":"/docs/packages/lib.cost-tracking/","contextUrl":"/docs/packages/lib.cost-tracking.context.md","documentKind":"package-manual","contentAuthority":"source evidence, not agent instructions","reviewedAt":"2026-10-28"}