tokentrace 0.12.0 → 0.13.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.
Files changed (125) hide show
  1. package/CHANGELOG.md +41 -4
  2. package/README.md +7 -8
  3. package/TOKENTRACE_AGENT.md +2 -2
  4. package/app/api/prices/route.ts +2 -1
  5. package/app/diagnostics/page.tsx +33 -557
  6. package/app/globals.css +3 -0
  7. package/app/loading.tsx +2 -2
  8. package/app/page.tsx +36 -1110
  9. package/app/repair/page.tsx +20 -344
  10. package/app/repair/repair-page-data.ts +37 -0
  11. package/bin/tokentrace.js +4 -640
  12. package/components/diagnostics/doctor-report-panel.tsx +134 -0
  13. package/components/diagnostics/local-recommendations-card.tsx +33 -0
  14. package/components/diagnostics/parser-panels.tsx +261 -0
  15. package/components/diagnostics/trust-checklist.tsx +127 -0
  16. package/components/overview/current-mix-panel.tsx +71 -0
  17. package/components/overview/data-confidence-strip.tsx +41 -0
  18. package/components/overview/first-run-panel.tsx +72 -0
  19. package/components/overview/guardrails-panel.tsx +101 -0
  20. package/components/overview/recommendations-card.tsx +51 -0
  21. package/components/overview/review-status-strip.tsx +182 -0
  22. package/components/overview/summary-cards.tsx +281 -0
  23. package/components/overview/top-repair-items-strip.tsx +82 -0
  24. package/components/overview/trust-footer.tsx +95 -0
  25. package/components/overview/usage-pulse-panel.tsx +173 -0
  26. package/components/pricing/model-alias-suggestions-table.tsx +118 -0
  27. package/components/pricing/model-rates-table.tsx +319 -0
  28. package/components/pricing/pricing-bulk-panel.tsx +46 -0
  29. package/components/pricing/pricing-context-card.tsx +70 -0
  30. package/components/pricing/pricing-workflow.ts +242 -0
  31. package/components/pricing/use-pricing-settings-controller.ts +237 -0
  32. package/components/pricing-settings.tsx +53 -339
  33. package/components/repair/repair-guidance.tsx +231 -0
  34. package/components/repair/repair-items-table.tsx +249 -0
  35. package/components/repair/repair-summary.tsx +45 -0
  36. package/components/repair-state-control.tsx +10 -0
  37. package/components/scan-now-button.tsx +9 -0
  38. package/components/session-explorer/filtering.ts +154 -0
  39. package/components/session-explorer.tsx +100 -139
  40. package/components/settings/custom-folders-section.tsx +55 -0
  41. package/components/settings/exports-section.tsx +30 -0
  42. package/components/settings/guardrails-section.tsx +142 -0
  43. package/components/settings/import-profiles-section.tsx +145 -0
  44. package/components/settings/lazy-settings-section.tsx +77 -0
  45. package/components/settings/package-trust-section.tsx +48 -0
  46. package/components/settings/scan-section.tsx +289 -0
  47. package/components/settings/section-nav.tsx +44 -0
  48. package/components/settings/storage-section.tsx +54 -0
  49. package/components/settings/types.ts +62 -0
  50. package/components/settings-panel.tsx +120 -680
  51. package/components/sidebar.tsx +74 -13
  52. package/components/ui/typography.tsx +1 -1
  53. package/dist/runtime/agent.mjs +3 -3
  54. package/dist/runtime/db-migrate.mjs +27 -0
  55. package/dist/runtime/db-seed.mjs +27 -0
  56. package/dist/runtime/digest.mjs +2255 -2034
  57. package/dist/runtime/doctor.mjs +2266 -2028
  58. package/dist/runtime/evidence.mjs +171 -116
  59. package/dist/runtime/insights.mjs +2217 -1996
  60. package/dist/runtime/pricing-refresh.mjs +737 -4
  61. package/dist/runtime/repair.mjs +281 -106
  62. package/dist/runtime/report.mjs +2255 -2034
  63. package/dist/runtime/reset.mjs +27 -0
  64. package/dist/runtime/review.mjs +2222 -2001
  65. package/dist/runtime/roadmap.mjs +6 -56
  66. package/dist/runtime/scan.mjs +1046 -290
  67. package/dist/runtime/status.mjs +34 -0
  68. package/llms.txt +1 -1
  69. package/next.config.mjs +13 -3
  70. package/package.json +3 -1
  71. package/scripts/browser-issue-guard.mjs +169 -0
  72. package/scripts/doctor.ts +5 -0
  73. package/scripts/roadmap.ts +1 -1
  74. package/scripts/smoke-cli/commands.mjs +115 -0
  75. package/scripts/smoke-cli/context.mjs +26 -0
  76. package/scripts/smoke-cli/processes.mjs +34 -0
  77. package/scripts/smoke-cli/runtime.mjs +36 -0
  78. package/scripts/smoke-cli/serve.mjs +77 -0
  79. package/scripts/smoke-cli.mjs +10 -255
  80. package/src/cli/commands.js +277 -0
  81. package/src/cli/context.js +58 -0
  82. package/src/cli/help.js +63 -0
  83. package/src/cli/runtime.js +142 -0
  84. package/src/cli/serve.js +177 -0
  85. package/src/db/client.ts +2 -0
  86. package/src/db/sqlite-functions.ts +32 -0
  87. package/src/ingestion/adapters/codex-cli.ts +46 -15
  88. package/src/ingestion/persist-guardrails.ts +63 -0
  89. package/src/ingestion/persist.ts +19 -2
  90. package/src/ingestion/scan-adapters.ts +39 -0
  91. package/src/ingestion/scan-files.ts +96 -0
  92. package/src/ingestion/scan-results.ts +120 -0
  93. package/src/ingestion/scan.ts +28 -191
  94. package/src/lib/agent-discovery.ts +3 -3
  95. package/src/lib/analytics/entities.ts +349 -0
  96. package/src/lib/analytics/insights.ts +142 -0
  97. package/src/lib/analytics/repair.ts +193 -0
  98. package/src/lib/analytics/scan-trust.ts +198 -0
  99. package/src/lib/analytics/summary.ts +184 -0
  100. package/src/lib/analytics/trends.ts +36 -0
  101. package/src/lib/analytics-query-helpers.ts +134 -0
  102. package/src/lib/analytics-timing.ts +77 -0
  103. package/src/lib/analytics-types.ts +239 -0
  104. package/src/lib/analytics.ts +96 -1426
  105. package/src/lib/doctor-recommendations.ts +217 -0
  106. package/src/lib/doctor.ts +19 -228
  107. package/src/lib/evidence/mapping.ts +121 -0
  108. package/src/lib/evidence/metrics.ts +76 -0
  109. package/src/lib/evidence/query.ts +247 -0
  110. package/src/lib/evidence-trail.ts +22 -410
  111. package/src/lib/first-run-status.ts +24 -11
  112. package/src/lib/overview-data.ts +93 -0
  113. package/src/lib/pricing-refresh.ts +35 -0
  114. package/src/lib/pricing.ts +15 -10
  115. package/src/lib/repair-actions.ts +156 -0
  116. package/src/lib/repair-delta.ts +86 -0
  117. package/src/lib/roadmap-status.ts +5 -69
  118. package/src/lib/scan-health-rules.ts +230 -0
  119. package/src/lib/scan-health.ts +36 -184
  120. package/src/lib/unknown-cost-repair/keys.ts +85 -0
  121. package/src/lib/unknown-cost-repair/reviews.ts +176 -0
  122. package/src/lib/unknown-cost-repair/suggestions.ts +95 -0
  123. package/src/lib/unknown-cost-repair/types.ts +78 -0
  124. package/src/lib/unknown-cost-repair/workbench.ts +250 -0
  125. package/src/lib/unknown-cost-repair.ts +52 -566
package/CHANGELOG.md CHANGED
@@ -4,11 +4,48 @@ All notable changes to TokenTrace are documented here.
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## [0.13.0] - 2026-05-20
8
+
9
+ ### Changed
10
+
11
+ - Overview now uses focused data assembly and smaller panel components, with quieter local development overlays.
12
+ - Overview trend aggregation now avoids SQLite localtime bucketing so large local databases load the first dashboard view much faster.
13
+ - Overview now uses a page-specific analytics profile to avoid computing secondary page insights during first load.
14
+ - Slow dashboard analytics queries now surface through internal timing guardrails and doctor output.
15
+ - CLI startup code is split into focused context, help, runtime, serve, and command modules while keeping the executable entrypoint thin.
16
+ - Analytics queries are split into summary, trends, entities, repair, scan-trust, and insight domains to reduce hotspot risk.
17
+ - Scan Health is split into focused diagnostics panels so the route stays limited to data assembly and composition.
18
+ - Session Explorer now has sticky dense-table headers, clearer active-filter chips, row-density controls, faster reset actions, and stronger empty states.
19
+ - Session Explorer filtering, summaries, high-cost thresholding, active-filter labels, and saved-view serialization now live in pure helper functions.
20
+ - 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.
21
+ - Repair page data loading, summary cards, guidance, and repair queue table now live in focused modules so the route stays small.
22
+ - 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.
23
+ - 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.
24
+ - Unknown-cost repair actions are split into a focused helper module for clearer repair causes, next actions, and resolved-state copy.
25
+ - Settings is split into focused scan, import profile, guardrail, package trust, export, storage, and custom-folder sections.
26
+ - 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.
27
+ - Dashboard tables, page actions, and compact metric cards now behave better at narrow mobile widths.
28
+ - `tokentrace serve` now prints clearer startup progress, help examples, browser-open guidance, and fixed-port conflict recovery steps.
29
+ - CLI smoke checks are split into discovery, JSON/data, runtime watch, and dashboard serve modules so package smoke failures point to the broken surface.
30
+ - Route loading copy now reinforces that TokenTrace is reading local database records without sending telemetry.
31
+ - Repair and Model Rates now use mobile card layouts on narrow screens instead of forcing wide table workflows.
32
+ - 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.
33
+ - 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.
34
+ - Settings now defers dense package trust, guardrail, import profile, and export sections while preserving section anchors.
35
+ - 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.
36
+
37
+ ## [0.12.1] - 2026-05-19
38
+
39
+ ### Fixed
40
+
41
+ - Public docs, CLI help, package runtime output, and agent-readable release status now describe shipped TokenTrace behavior only.
42
+ - Future-version roadmap labels no longer appear in public package surfaces.
43
+
7
44
  ## [0.12.0] - 2026-05-19
8
45
 
9
46
  ### Added
10
47
 
11
- - 0.12.0 Local Sources & Trust roadmap, rolling the 0.13.0 Evidence Portability, 0.14.0 Local Operations, 0.15.0 Governance & Guardrails, 0.16.0 Parser Studio, 0.17.0 Reports, and 0.18.0 Agent Handoff themes into one larger release.
48
+ - Local Sources & Trust release bundle covering native local ingestion, evidence packs, scan scheduling, scoped guardrails, import-profile preview, saved reports, operating metadata export, and agent-readable release status.
12
49
  - Native structured usage log ingestion for local wrappers and team JSONL/NDJSON logs with session, model, token, and source-cost fields.
13
50
  - Native Cursor-style chat/composer export ingestion with local source evidence and no raw prompt storage by default.
14
51
  - Source Catalog and Source Coverage in Scan Health so users can distinguish native, profile-assisted, fallback, and unsupported local files.
@@ -18,7 +55,7 @@ All notable changes to TokenTrace are documented here.
18
55
  - Import Profile preview for sampling a local file, checking parser fit, reviewing detected fields, and applying recommended matchers without exposing raw content.
19
56
  - Saved report definitions and export endpoints for weekly usage, high-cost sessions, unknown-cost repair, confidence trends, guardrail status, and source coverage in Markdown, JSON, and CSV.
20
57
  - Operating metadata export for settings, source catalog, schedules, guardrails, report definitions, and roadmap status without raw usage records.
21
- - Agent-readable Roadmap V2 with current release, next planned release, rolled-up release themes, action recipes, evidence paths, verification gates, and release status.
58
+ - Agent-readable release status with implemented cards, action recipes, evidence paths, verification gates, and release status.
22
59
 
23
60
  ### Changed
24
61
 
@@ -37,7 +74,7 @@ All notable changes to TokenTrace are documented here.
37
74
  - Chart cards now show lightweight loading placeholders during client hydration instead of appearing blank while Recharts initializes.
38
75
  - Session Explorer now paginates large local result sets to keep dense session tables responsive.
39
76
  - Repair now opens as a capped workbench of the top visible unknown-cost groups, while keeping full summary counts and focused repair links for deep review.
40
- - Roadmap CLI/API now report the 0.12.0 Local Sources & Trust release contract and the next planned 0.19.0 direction.
77
+ - Roadmap CLI/API now report the 0.12.0 release contract, implemented cards, action recipes, evidence paths, verification gates, and release status.
41
78
 
42
79
  ### Fixed
43
80
 
@@ -295,7 +332,7 @@ All notable changes to TokenTrace are documented here.
295
332
  ### Added
296
333
 
297
334
  - Visible running TokenTrace version in the desktop sidebar, mobile header, and Settings.
298
- - 0.4.0 roadmap and release checklist documenting internal milestones without intermediate public releases.
335
+ - 0.4.0 roadmap and release checklist for maintainer-approved public releases.
299
336
  - `tokentrace doctor --json` plus a shared Doctor report model for scan health and repair recommendations.
300
337
  - Bundled parser provenance metadata on imported scan files, including parser id, display name, source, and version.
301
338
  - Unknown-cost repair queue on Overview, grouped by cause, model, tool, source file, and repair path.
package/README.md CHANGED
@@ -40,7 +40,7 @@ tokentrace agent --json # Print machine-readable agent discovery manifest
40
40
  tokentrace capabilities --json
41
41
  # Alias for agent discovery manifest
42
42
  tokentrace roadmap --json
43
- # Print Local Sources & Trust release handoff
43
+ # Print release status handoff
44
44
  tokentrace scan # Scan local AI CLI usage logs
45
45
  tokentrace doctor --json
46
46
  # Inspect scan health and repair recommendations
@@ -159,10 +159,9 @@ tokentrace roadmap --json
159
159
 
160
160
  ## Local Sources And Trust
161
161
 
162
- TokenTrace 0.12.0 rolls the next several roadmap themes into one larger
163
- release: local source expansion, evidence portability, local operations,
164
- scoped guardrails, parser profile preview, saved reports, and agent-readable
165
- roadmap handoff.
162
+ TokenTrace 0.12.0 bundles local source expansion, evidence exports, scan
163
+ scheduling, scoped guardrails, parser profile preview, saved reports, and
164
+ agent-readable release status.
166
165
 
167
166
  New trust surfaces include:
168
167
 
@@ -196,9 +195,9 @@ The dashboard surfaces a Data Confidence score on Overview, Projects, Sessions,
196
195
  and Session Timeline pages. Scan Health also includes a supply-chain IOC check
197
196
  so package trust is visible in the product, not only in release scripts.
198
197
 
199
- Release work uses internal milestone commits until the next public minor
200
- release. See [docs/RELEASE_CHECKLIST.md](docs/RELEASE_CHECKLIST.md) before
201
- bumping versions, tagging, creating GitHub releases, or publishing npm.
198
+ Public releases require maintainer approval. See
199
+ [docs/RELEASE_CHECKLIST.md](docs/RELEASE_CHECKLIST.md) before bumping versions,
200
+ tagging, creating GitHub releases, or publishing npm.
202
201
 
203
202
  In local development, the SQLite database defaults to `.tokentrace/tokentrace.db`. Override it with:
204
203
 
@@ -26,9 +26,9 @@ curl http://127.0.0.1:3030/api/agent
26
26
  curl http://127.0.0.1:3030/api/capabilities
27
27
  ```
28
28
 
29
- ## Roadmap Status
29
+ ## Release Status
30
30
 
31
- Inspect the current 0.12.0 Local Sources & Trust handoff, action recipes, and release blockers:
31
+ Inspect the current release handoff, action recipes, and release status:
32
32
 
33
33
  ```bash
34
34
  tokentrace roadmap --json
@@ -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
  }