tokentrace 0.12.1 → 0.14.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/CHANGELOG.md +41 -0
- package/README.md +14 -0
- package/TOKENTRACE_AGENT.md +11 -0
- package/app/api/prices/route.ts +2 -1
- package/app/diagnostics/page.tsx +33 -557
- package/app/globals.css +3 -0
- package/app/loading.tsx +2 -2
- package/app/page.tsx +36 -1110
- package/app/repair/page.tsx +20 -344
- package/app/repair/repair-page-data.ts +37 -0
- package/bin/tokentrace.js +4 -640
- package/components/diagnostics/doctor-report-panel.tsx +134 -0
- package/components/diagnostics/local-recommendations-card.tsx +33 -0
- package/components/diagnostics/parser-panels.tsx +261 -0
- package/components/diagnostics/trust-checklist.tsx +127 -0
- package/components/overview/current-mix-panel.tsx +71 -0
- package/components/overview/data-confidence-strip.tsx +41 -0
- package/components/overview/first-run-panel.tsx +72 -0
- package/components/overview/guardrails-panel.tsx +101 -0
- package/components/overview/recommendations-card.tsx +51 -0
- package/components/overview/review-status-strip.tsx +182 -0
- package/components/overview/summary-cards.tsx +281 -0
- package/components/overview/top-repair-items-strip.tsx +82 -0
- package/components/overview/trust-footer.tsx +95 -0
- package/components/overview/usage-pulse-panel.tsx +173 -0
- package/components/pricing/model-alias-suggestions-table.tsx +118 -0
- package/components/pricing/model-rates-table.tsx +319 -0
- package/components/pricing/pricing-bulk-panel.tsx +46 -0
- package/components/pricing/pricing-context-card.tsx +70 -0
- package/components/pricing/pricing-workflow.ts +242 -0
- package/components/pricing/use-pricing-settings-controller.ts +237 -0
- package/components/pricing-settings.tsx +53 -339
- package/components/repair/repair-guidance.tsx +231 -0
- package/components/repair/repair-items-table.tsx +249 -0
- package/components/repair/repair-summary.tsx +45 -0
- package/components/repair-state-control.tsx +10 -0
- package/components/scan-now-button.tsx +9 -0
- package/components/session-explorer/filtering.ts +154 -0
- package/components/session-explorer.tsx +100 -139
- package/components/settings/custom-folders-section.tsx +55 -0
- package/components/settings/exports-section.tsx +30 -0
- package/components/settings/guardrails-section.tsx +142 -0
- package/components/settings/import-profiles-section.tsx +145 -0
- package/components/settings/lazy-settings-section.tsx +77 -0
- package/components/settings/package-trust-section.tsx +48 -0
- package/components/settings/scan-section.tsx +289 -0
- package/components/settings/section-nav.tsx +44 -0
- package/components/settings/storage-section.tsx +54 -0
- package/components/settings/types.ts +62 -0
- package/components/settings-panel.tsx +120 -680
- package/components/sidebar.tsx +74 -13
- package/components/ui/typography.tsx +1 -1
- package/dist/runtime/agent.mjs +21 -1
- package/dist/runtime/db-migrate.mjs +27 -0
- package/dist/runtime/db-seed.mjs +27 -0
- package/dist/runtime/digest.mjs +2255 -2034
- package/dist/runtime/doctor.mjs +2266 -2028
- package/dist/runtime/evidence.mjs +171 -116
- package/dist/runtime/insights.mjs +2217 -1996
- package/dist/runtime/mcp.mjs +286 -0
- package/dist/runtime/pricing-refresh.mjs +737 -4
- package/dist/runtime/repair.mjs +281 -106
- package/dist/runtime/report.mjs +2255 -2034
- package/dist/runtime/reset.mjs +27 -0
- package/dist/runtime/review.mjs +2222 -2001
- package/dist/runtime/scan.mjs +1046 -290
- package/dist/runtime/status.mjs +34 -0
- package/llms.txt +11 -0
- package/next.config.mjs +13 -3
- package/package.json +4 -1
- package/scripts/browser-issue-guard.mjs +169 -0
- package/scripts/build-cli-runtime.mjs +1 -0
- package/scripts/doctor.ts +5 -0
- package/scripts/mcp.ts +39 -0
- package/scripts/package-inspect.mjs +2 -1
- package/scripts/smoke-cli/commands.mjs +130 -0
- package/scripts/smoke-cli/context.mjs +26 -0
- package/scripts/smoke-cli/processes.mjs +34 -0
- package/scripts/smoke-cli/runtime.mjs +36 -0
- package/scripts/smoke-cli/serve.mjs +77 -0
- package/scripts/smoke-cli.mjs +10 -255
- package/scripts/smoke-packed-install.mjs +14 -1
- package/server.json +29 -0
- package/src/cli/commands.js +289 -0
- package/src/cli/context.js +58 -0
- package/src/cli/help.js +64 -0
- package/src/cli/runtime.js +142 -0
- package/src/cli/serve.js +177 -0
- package/src/db/client.ts +2 -0
- package/src/db/sqlite-functions.ts +32 -0
- package/src/ingestion/adapters/codex-cli.ts +46 -15
- package/src/ingestion/persist-guardrails.ts +63 -0
- package/src/ingestion/persist.ts +19 -2
- package/src/ingestion/scan-adapters.ts +39 -0
- package/src/ingestion/scan-files.ts +96 -0
- package/src/ingestion/scan-results.ts +120 -0
- package/src/ingestion/scan.ts +28 -191
- package/src/lib/agent-discovery.ts +21 -1
- package/src/lib/analytics/entities.ts +349 -0
- package/src/lib/analytics/insights.ts +142 -0
- package/src/lib/analytics/repair.ts +193 -0
- package/src/lib/analytics/scan-trust.ts +198 -0
- package/src/lib/analytics/summary.ts +184 -0
- package/src/lib/analytics/trends.ts +36 -0
- package/src/lib/analytics-query-helpers.ts +134 -0
- package/src/lib/analytics-timing.ts +77 -0
- package/src/lib/analytics-types.ts +239 -0
- package/src/lib/analytics.ts +96 -1426
- package/src/lib/doctor-recommendations.ts +217 -0
- package/src/lib/doctor.ts +19 -228
- package/src/lib/evidence/mapping.ts +121 -0
- package/src/lib/evidence/metrics.ts +76 -0
- package/src/lib/evidence/query.ts +247 -0
- package/src/lib/evidence-trail.ts +22 -410
- package/src/lib/first-run-status.ts +24 -11
- package/src/lib/mcp-server.ts +289 -0
- package/src/lib/overview-data.ts +93 -0
- package/src/lib/pricing-refresh.ts +35 -0
- package/src/lib/pricing.ts +15 -10
- package/src/lib/repair-actions.ts +156 -0
- package/src/lib/repair-delta.ts +86 -0
- package/src/lib/scan-health-rules.ts +230 -0
- package/src/lib/scan-health.ts +36 -184
- package/src/lib/unknown-cost-repair/keys.ts +85 -0
- package/src/lib/unknown-cost-repair/reviews.ts +176 -0
- package/src/lib/unknown-cost-repair/suggestions.ts +95 -0
- package/src/lib/unknown-cost-repair/types.ts +78 -0
- package/src/lib/unknown-cost-repair/workbench.ts +250 -0
- package/src/lib/unknown-cost-repair.ts +52 -566
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,47 @@ All notable changes to TokenTrace are documented here.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## [0.14.0] - 2026-05-20
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `tokentrace mcp` now starts a local stdio MCP server for capabilities, status, Scan Health, evidence, repair queue, reports, and explicit local scans.
|
|
12
|
+
- Added a validated MCP registry manifest for the npm package, with `tokentrace mcp` as the stdio entrypoint and no placeholder secrets.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Agent discovery, package smoke checks, packed-install smoke checks, and package inspection now cover the MCP server surface.
|
|
17
|
+
|
|
18
|
+
## [0.13.0] - 2026-05-20
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Overview now uses focused data assembly and smaller panel components, with quieter local development overlays.
|
|
23
|
+
- Overview trend aggregation now avoids SQLite localtime bucketing so large local databases load the first dashboard view much faster.
|
|
24
|
+
- Overview now uses a page-specific analytics profile to avoid computing secondary page insights during first load.
|
|
25
|
+
- Slow dashboard analytics queries now surface through internal timing guardrails and doctor output.
|
|
26
|
+
- CLI startup code is split into focused context, help, runtime, serve, and command modules while keeping the executable entrypoint thin.
|
|
27
|
+
- Analytics queries are split into summary, trends, entities, repair, scan-trust, and insight domains to reduce hotspot risk.
|
|
28
|
+
- Scan Health is split into focused diagnostics panels so the route stays limited to data assembly and composition.
|
|
29
|
+
- Session Explorer now has sticky dense-table headers, clearer active-filter chips, row-density controls, faster reset actions, and stronger empty states.
|
|
30
|
+
- Session Explorer filtering, summaries, high-cost thresholding, active-filter labels, and saved-view serialization now live in pure helper functions.
|
|
31
|
+
- Repair now highlights the top unknown-cost cause, next best repair, expected impact, and clearer resolved, ignored, and parser-review state copy backed by executable repair actions.
|
|
32
|
+
- Repair page data loading, summary cards, guidance, and repair queue table now live in focused modules so the route stays small.
|
|
33
|
+
- Model Rates now has clearer repair-context copy, edit validation, duplicate provider/model warnings, save-result feedback, and CSV import/export for bulk rate changes.
|
|
34
|
+
- Codex CLI ingestion now handles JSON-array session exports, warns on malformed local records, and persistence now reports empty, duplicate, or mismatched replacement imports before writing.
|
|
35
|
+
- Unknown-cost repair actions are split into a focused helper module for clearer repair causes, next actions, and resolved-state copy.
|
|
36
|
+
- Settings is split into focused scan, import profile, guardrail, package trust, export, storage, and custom-folder sections.
|
|
37
|
+
- Mobile navigation now uses a compact command menu plus priority shortcuts, and first-run setup now leads users through local folders, model rates, scan, Scan Health, and review without cloud or sample-data assumptions.
|
|
38
|
+
- Dashboard tables, page actions, and compact metric cards now behave better at narrow mobile widths.
|
|
39
|
+
- `tokentrace serve` now prints clearer startup progress, help examples, browser-open guidance, and fixed-port conflict recovery steps.
|
|
40
|
+
- CLI smoke checks are split into discovery, JSON/data, runtime watch, and dashboard serve modules so package smoke failures point to the broken surface.
|
|
41
|
+
- Route loading copy now reinforces that TokenTrace is reading local database records without sending telemetry.
|
|
42
|
+
- Repair and Model Rates now use mobile card layouts on narrow screens instead of forcing wide table workflows.
|
|
43
|
+
- Unknown-cost repair, scan ingestion, Evidence Trail, and Pricing Settings internals are split into smaller focused modules to reduce hotspot risk and make future repair work safer.
|
|
44
|
+
- Pricing saves, model-rate refreshes, and scans now report a repair delta showing unknown-cost before/after counts, resolved groups, and the top remaining blocked cause.
|
|
45
|
+
- Settings now defers dense package trust, guardrail, import profile, and export sections while preserving section anchors.
|
|
46
|
+
- Added `npm run browser:guard` to fail browser smoke runs on console errors, page errors, Next dev overlay issues, blank charts, and severe mobile overflow.
|
|
47
|
+
|
|
7
48
|
## [0.12.1] - 2026-05-19
|
|
8
49
|
|
|
9
50
|
### Fixed
|
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ tokentrace capabilities --json
|
|
|
41
41
|
# Alias for agent discovery manifest
|
|
42
42
|
tokentrace roadmap --json
|
|
43
43
|
# Print release status handoff
|
|
44
|
+
tokentrace mcp # Start the local stdio MCP server
|
|
44
45
|
tokentrace scan # Scan local AI CLI usage logs
|
|
45
46
|
tokentrace doctor --json
|
|
46
47
|
# Inspect scan health and repair recommendations
|
|
@@ -106,6 +107,19 @@ or npm package contents before invoking commands:
|
|
|
106
107
|
- [llms.txt](llms.txt)
|
|
107
108
|
- [docs/agent-discovery.schema.json](docs/agent-discovery.schema.json)
|
|
108
109
|
|
|
110
|
+
MCP-capable clients can start the local stdio server after installing or using
|
|
111
|
+
the npm package:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
tokentrace mcp
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The MCP server exposes the same local-first surfaces as tools: capabilities,
|
|
118
|
+
status, Scan Health, evidence, repair queue, reports, and an explicit scan tool.
|
|
119
|
+
It does not scan files on startup, and its scan tool requires
|
|
120
|
+
`confirmLocalScan=true` before reading local usage files or writing the local
|
|
121
|
+
database.
|
|
122
|
+
|
|
109
123
|
When the local dashboard is already running, agents can fetch the same manifest
|
|
110
124
|
over localhost:
|
|
111
125
|
|
package/TOKENTRACE_AGENT.md
CHANGED
|
@@ -19,6 +19,16 @@ tokentrace capabilities --json
|
|
|
19
19
|
|
|
20
20
|
The manifest follows the schema in `docs/agent-discovery.schema.json`.
|
|
21
21
|
|
|
22
|
+
MCP-capable clients can use the local stdio server:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
tokentrace mcp
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The MCP server does not scan on startup. Its `run_scan` tool requires
|
|
29
|
+
`confirmLocalScan=true` before reading local usage files or writing the local
|
|
30
|
+
database.
|
|
31
|
+
|
|
22
32
|
If the local dashboard is already running, the same manifest is available from:
|
|
23
33
|
|
|
24
34
|
```bash
|
|
@@ -67,6 +77,7 @@ curl http://127.0.0.1:3030/api/roadmap
|
|
|
67
77
|
- Do not call processed tokens current context size. Use `ctx` for live context-window pressure.
|
|
68
78
|
- Treat database paths, source file paths, prompts, and raw transcript settings as local sensitive data.
|
|
69
79
|
- Discovery is read-only: it does not scan files, initialize the dashboard database, start a server, or make a network request.
|
|
80
|
+
- MCP startup is read-only; use `run_scan` only when the human expects a local scan.
|
|
70
81
|
|
|
71
82
|
## Integrations
|
|
72
83
|
|
package/app/api/prices/route.ts
CHANGED
|
@@ -62,6 +62,7 @@ export async function POST(request: Request) {
|
|
|
62
62
|
interactionsChecked: result.interactionsChecked,
|
|
63
63
|
unknownCostInteractions: result.unknownCostInteractions,
|
|
64
64
|
modelAliasesUpdated: result.modelsUpdated,
|
|
65
|
-
resolvedRepairItems: result.resolvedRepairItems
|
|
65
|
+
resolvedRepairItems: result.resolvedRepairItems,
|
|
66
|
+
repairDelta: result.repairDelta
|
|
66
67
|
});
|
|
67
68
|
}
|