argus-code 0.7.1__tar.gz → 0.8.0__tar.gz
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.
- {argus_code-0.7.1 → argus_code-0.8.0}/PKG-INFO +1 -1
- argus_code-0.8.0/dashboard-dist/assets/AlertsPage-D_VX2kEm.js +1 -0
- argus_code-0.7.1/dashboard-dist/assets/AreaLine-BKfPVgnO.js → argus_code-0.8.0/dashboard-dist/assets/AreaLine-C2pbmMiI.js +1 -1
- argus_code-0.7.1/dashboard-dist/assets/AttentionStrip-DQUV5LTN.js → argus_code-0.8.0/dashboard-dist/assets/AttentionStrip-DMp-7mLu.js +1 -1
- argus_code-0.7.1/dashboard-dist/assets/Bars-CwquOD-V.js → argus_code-0.8.0/dashboard-dist/assets/Bars-BM1Q9Juw.js +1 -1
- argus_code-0.7.1/dashboard-dist/assets/Button-BY-h2O0Z.js → argus_code-0.8.0/dashboard-dist/assets/Button-C6Vpou9C.js +1 -1
- argus_code-0.7.1/dashboard-dist/assets/ChartTable-iQFTYj1d.js → argus_code-0.8.0/dashboard-dist/assets/ChartTable-jq-9YnND.js +1 -1
- argus_code-0.7.1/dashboard-dist/assets/Chip-C_zmBEC6.js → argus_code-0.8.0/dashboard-dist/assets/Chip-DX-VLUbj.js +1 -1
- argus_code-0.8.0/dashboard-dist/assets/ErrorPanel-DWD9Fov9.js +1 -0
- argus_code-0.8.0/dashboard-dist/assets/ModelsPage-D1JodlZj.js +1 -0
- argus_code-0.8.0/dashboard-dist/assets/MultiLine-CH2ovZmZ.js +1 -0
- argus_code-0.8.0/dashboard-dist/assets/OverviewPage-m5IFbFw-.js +1 -0
- argus_code-0.8.0/dashboard-dist/assets/Panel-Bp9ZgSnf.js +1 -0
- argus_code-0.8.0/dashboard-dist/assets/ProjectPage-B-UDtELd.js +1 -0
- argus_code-0.8.0/dashboard-dist/assets/ProjectsPage-CJI_bLck.js +1 -0
- argus_code-0.8.0/dashboard-dist/assets/SearchPage-C_4qyNi0.js +1 -0
- argus_code-0.8.0/dashboard-dist/assets/Seg-BhkJzldV.js +1 -0
- argus_code-0.7.1/dashboard-dist/assets/SessionPage-B5py8aO_.js → argus_code-0.8.0/dashboard-dist/assets/SessionPage-_fGhVrh-.js +2 -2
- argus_code-0.7.1/dashboard-dist/assets/SessionsPage-Br0MV0yN.js → argus_code-0.8.0/dashboard-dist/assets/SessionsPage-CNNM4AqX.js +2 -2
- argus_code-0.8.0/dashboard-dist/assets/SettingsPage-C6Wcoud4.js +1 -0
- argus_code-0.7.1/dashboard-dist/assets/StackedColumns-Di1FeFpF.js → argus_code-0.8.0/dashboard-dist/assets/StackedColumns-DUiup4fS.js +1 -1
- argus_code-0.8.0/dashboard-dist/assets/ThreadCard-3Ao_BW3U.js +1 -0
- argus_code-0.7.1/dashboard-dist/assets/Tile-BlnGo9bN.js → argus_code-0.8.0/dashboard-dist/assets/Tile-BF8_h63E.js +1 -1
- argus_code-0.8.0/dashboard-dist/assets/TimelineTab-T9CBXijX.js +1 -0
- argus_code-0.8.0/dashboard-dist/assets/ToolsPage-ClvevCIt.js +1 -0
- argus_code-0.8.0/dashboard-dist/assets/TopBar-l88js9Iq.js +1 -0
- argus_code-0.8.0/dashboard-dist/assets/TrendsPage-hdpevmbY.js +1 -0
- argus_code-0.8.0/dashboard-dist/assets/index-8QDYCqiB.css +1 -0
- argus_code-0.8.0/dashboard-dist/assets/index-kEmLC0Ll.js +50 -0
- argus_code-0.7.1/dashboard-dist/assets/uplotTheme-Dv4lAb8e.js → argus_code-0.8.0/dashboard-dist/assets/uplotTheme-DVpHp5Uh.js +1 -1
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/index.html +2 -2
- {argus_code-0.7.1 → argus_code-0.8.0}/pyproject.toml +1 -1
- argus_code-0.8.0/python/argus/AGENTS.md +203 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/__init__.py +1 -1
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/cli.py +103 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/server/app.py +6 -0
- argus_code-0.8.0/python/argus/work/__init__.py +6 -0
- argus_code-0.8.0/python/argus/work/api.py +91 -0
- argus_code-0.8.0/python/argus/work/collector.py +286 -0
- argus_code-0.8.0/python/argus/work/db.py +118 -0
- argus_code-0.8.0/python/argus/work/edits.py +91 -0
- argus_code-0.8.0/python/argus/work/facts.py +165 -0
- argus_code-0.8.0/python/argus/work/github.py +154 -0
- argus_code-0.8.0/python/argus/work/gitscan.py +372 -0
- argus_code-0.8.0/python/argus/work/linker.py +129 -0
- argus_code-0.8.0/python/argus/work/queries.py +570 -0
- argus_code-0.8.0/python/argus/work/stories.py +129 -0
- argus_code-0.8.0/python/argus/work/threads.py +79 -0
- argus_code-0.8.0/tests/cli/test_work_github_cli.py +26 -0
- argus_code-0.8.0/tests/work/__init__.py +0 -0
- argus_code-0.8.0/tests/work/test_api.py +97 -0
- argus_code-0.8.0/tests/work/test_collector.py +314 -0
- argus_code-0.8.0/tests/work/test_db.py +120 -0
- argus_code-0.8.0/tests/work/test_edits.py +118 -0
- argus_code-0.8.0/tests/work/test_facts.py +132 -0
- argus_code-0.8.0/tests/work/test_github.py +121 -0
- argus_code-0.8.0/tests/work/test_gitscan.py +449 -0
- argus_code-0.8.0/tests/work/test_isolation.py +28 -0
- argus_code-0.8.0/tests/work/test_linker.py +186 -0
- argus_code-0.8.0/tests/work/test_queries.py +445 -0
- argus_code-0.8.0/tests/work/test_stories.py +115 -0
- argus_code-0.8.0/tests/work/test_threads.py +99 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/uv.lock +1 -1
- argus_code-0.7.1/dashboard-dist/assets/AlertsPage-hQBct4uk.js +0 -1
- argus_code-0.7.1/dashboard-dist/assets/ErrorPanel-lb1Tt_Cg.js +0 -1
- argus_code-0.7.1/dashboard-dist/assets/ModelsPage-DwKKIQAH.js +0 -1
- argus_code-0.7.1/dashboard-dist/assets/MultiLine-Bp4Mitsq.js +0 -1
- argus_code-0.7.1/dashboard-dist/assets/OverviewPage-CAx6S0a6.js +0 -1
- argus_code-0.7.1/dashboard-dist/assets/Panel-rzVYig0L.js +0 -1
- argus_code-0.7.1/dashboard-dist/assets/SearchPage-DIj0iG5P.js +0 -1
- argus_code-0.7.1/dashboard-dist/assets/SettingsPage-BFb2-hq_.js +0 -1
- argus_code-0.7.1/dashboard-dist/assets/TimelineTab-Cwp4_Kwm.js +0 -1
- argus_code-0.7.1/dashboard-dist/assets/ToolsPage-1lP1X2_y.js +0 -1
- argus_code-0.7.1/dashboard-dist/assets/TrendsPage-C-GToldA.js +0 -1
- argus_code-0.7.1/dashboard-dist/assets/index-B8TteJkn.css +0 -1
- argus_code-0.7.1/dashboard-dist/assets/index-kRaX6JLH.js +0 -50
- argus_code-0.7.1/python/argus/AGENTS.md +0 -117
- {argus_code-0.7.1 → argus_code-0.8.0}/.gitignore +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/LICENSE +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/NOTICE +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/README.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/agents-CDuRxAZi.js +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/cumulative-C3-3HW0n.js +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/rollups-Dqiwg3gD.js +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/series-BjP-80tt.js +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/uplotTheme-D1GxaB_c.css +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/dashboard-dist/assets/windows-B3y4OLGl.js +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/pricing/2026-05-02.json +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/pricing/2026-06-12.json +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/pricing/2026-09-22.json +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/pricing/2026-10-04.json +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/pricing/2026-10-26.json +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/AGENTS.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/base.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/claude_code/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/claude_code/adapter.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/claude_code/discover.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/claude_code/extract_tool_calls.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/claude_code/extract_transcript.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/claude_code/extract_turns.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/claude_code/history_jsonl.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/claude_code/ingest_file.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/claude_code/model.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/claude_code/schemas.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/codex/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/codex/adapter.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/codex/discover.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/codex/ingest_file.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/codex/lines.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/codex/records.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/codex/state.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/adapters/registry.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/collector/AGENTS.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/collector/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/collector/aggregate.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/collector/first_run.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/collector/pipeline.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/collector/rollup_subagents.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/collector/scheduler.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/collector/search_backfill.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/collector/session_files.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/collector/watcher.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/core/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/core/runtime.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/daemon/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/daemon/logging.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/daemon/pidfile.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/daemon/process.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/daemon/service.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/detectors/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/detectors/base.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/detectors/cache_hit_drop.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/detectors/cost_spike.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/detectors/registry.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/detectors/tool_error_rate_spike.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/pricing/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/pricing/compute.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/pricing/load.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/pricing/refresh.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/pricing/types.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/scaffold/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/scaffold/scaffolder.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/scaffold/snapshot.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/scaffold/storage.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/schema/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/schema/types.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/server/AGENTS.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/server/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/server/api.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/store/AGENTS.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/store/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/store/db.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/store/migrations/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/store/migrations/inline.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/python/argus/store/repository.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/templates/default/.claude/agents/code-reviewer.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/templates/default/.claude/agents/security-auditor.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/templates/default/.claude/commands/commit.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/templates/default/.claude/commands/deploy.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/templates/default/.claude/commands/fix-issue.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/templates/default/.claude/commands/pr.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/templates/default/.claude/commands/review.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/templates/default/.claude/rules/api-conventions.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/templates/default/.claude/rules/code-style.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/templates/default/.claude/rules/testing.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/templates/default/.claude/settings.json +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/templates/default/.claude/skills/example/SKILL.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/templates/default/CLAUDE.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/AGENTS.md +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/claude_code/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/claude_code/test_adapter.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/claude_code/test_discover.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/claude_code/test_extract_tool_calls.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/claude_code/test_extract_transcript.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/claude_code/test_extract_turns.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/claude_code/test_history_jsonl.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/claude_code/test_ingest_file.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/claude_code/test_integration.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/claude_code/test_model.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/claude_code/test_path_containment.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/claude_code/test_schemas.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/codex/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/codex/test_adapter.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/codex/test_discover.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/codex/test_ingest_file.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/codex/test_lines.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/codex/test_real_root.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/codex/test_records.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/codex/test_state.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/adapters/test_registry.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/cli/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/cli/test_indexing_cli.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/cli/test_pricing_refresh_cli.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/collector/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/collector/test_aggregate.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/collector/test_codex_incremental_invariant.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/collector/test_first_run.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/collector/test_first_run_shutdown.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/collector/test_fork_dedup.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/collector/test_fork_dedup_db.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/collector/test_incremental_invariant.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/collector/test_incremental_repairs.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/collector/test_pipeline.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/collector/test_pipeline_codex.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/collector/test_rollup_subagents.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/collector/test_scheduler.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/collector/test_session_files.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/collector/test_watcher.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/conftest.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/core/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/core/test_runtime.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/core/test_runtime_shutdown.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/daemon/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/daemon/test_logs.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/daemon/test_no_claude_dir.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/daemon/test_pidfile.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/daemon/test_pidfile_identity.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/daemon/test_process.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/daemon/test_service.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/daemon/test_spawn_safe_path.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/daemon/test_yield.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/dashboard/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/dashboard/test_no_raw_html.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/detectors/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/detectors/test_base_helpers.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/detectors/test_cache_hit_drop.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/detectors/test_cost_spike.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/detectors/test_registry.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/detectors/test_tool_error_rate_spike.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/pricing/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/pricing/test_compute.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/pricing/test_load.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/pricing/test_refresh.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/scaffold/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/scaffold/test_bundled_template.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/scaffold/test_cli_claude.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/scaffold/test_scaffold_containment.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/scaffold/test_scaffolder.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/scaffold/test_snapshot.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/scaffold/test_snapshot_secrets.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/scaffold/test_storage.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/schema/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/schema/test_types.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/server/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/server/test_api.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/server/test_api_search.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/server/test_day_buckets.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/server/test_param_bounds.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/server/test_read_cache.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/server/test_server.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/server/test_spa_fallback.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/server/test_week_of.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/store/__init__.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/store/test_db.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/store/test_repository.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/store/test_transactions.py +0 -0
- {argus_code-0.7.1 → argus_code-0.8.0}/tests/test_e2e.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: argus-code
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary: Local-first observability for Claude Code and OpenAI Codex: per-session forensics, cost, tokens, tool health, sub-agents, alerts and full-text search
|
|
5
5
|
Project-URL: Homepage, https://github.com/KrishBhimani/argus-code
|
|
6
6
|
Project-URL: Repository, https://github.com/KrishBhimani/argus-code.git
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,g as y,h as N,r as h}from"./index-kEmLC0Ll.js";import{T as u,P as g}from"./TopBar-l88js9Iq.js";import{S as k}from"./Seg-BhkJzldV.js";import{P as p}from"./Panel-Bp9ZgSnf.js";import{B as v,P as f}from"./Button-C6Vpou9C.js";import{E as _}from"./ErrorPanel-DWD9Fov9.js";import{a as d}from"./AttentionStrip-DMp-7mLu.js";const $={info:"#3987e5",warning:"#fab219",critical:"#d03b3b"};function A({alerts:s,days:a=30,end:n=new Date,className:m=""}){const c=n.getTime(),l=c-a*864e5;return e.jsxs("svg",{className:`block w-full ${m}`,width:"100%",viewBox:"0 0 300 36",style:{aspectRatio:"300 / 36"},role:"img","aria-label":`Alerts, last ${a} days`,children:[e.jsx("line",{x1:0,y1:36/2,x2:300,y2:36/2,stroke:"#232934"}),s.filter(r=>r.at>=l&&r.at<=c).map((r,t)=>e.jsx("circle",{cx:(r.at-l)/(c-l)*292+4,cy:36/2,r:r.severity==="critical"?5:r.severity==="warning"?4:3,fill:$[r.severity],stroke:"#10131a",strokeWidth:2,children:e.jsx("title",{children:`${new Date(r.at).toLocaleDateString()} · ${r.severity}`})},t)),e.jsx("text",{x:0,y:34,fontSize:9,fill:"#667184",fontFamily:"var(--font-mono)",children:`-${a}d`}),e.jsx("text",{x:300,y:34,fontSize:9,fill:"#667184",textAnchor:"end",fontFamily:"var(--font-mono)",children:"now"})]})}const C={info:"info",warning:"warn",critical:"crit"},S={info:"shadow-[inset_3px_0_0_var(--color-s1)]",warning:"shadow-[inset_3px_0_0_var(--color-warn)]",critical:"shadow-[inset_3px_0_0_var(--color-crit)]"},w=({children:s})=>e.jsx("span",{className:"font-mono text-[11px] text-ink-1 bg-bg-3 px-1.5 rounded-sm",children:s}),D=[{n:"tool_error_rate_spike",on:!0,note:"7d vs 28d"},{n:"cost_spike",on:!0,note:"7d vs 28d/wk"},{n:"cache_hit_drop",on:!0,note:"7d vs 28d"}],E=s=>{const a=typeof s.metadata?.tool_name=="string"?s.metadata.tool_name:null,n=typeof s.metadata?.project=="string"?s.metadata.project:null;return[a&&`tool=${a}`,n&&`project=${n}`].filter(Boolean)};function F(){const s=y(),a=N(),[n,m]=h.useState("unseen"),i=h.useMemo(()=>new Set((s.data??[]).filter(t=>!t.seen_at).map(t=>t.id)),[s.data]),o=h.useMemo(()=>[...s.data??[]].sort((t,x)=>d(x).localeCompare(d(t))),[s.data]),c=n==="all"?o:n==="unseen"?o.filter(t=>i.has(t.id)):o.filter(t=>t.severity===n),l=o.filter(t=>Date.now()-new Date(d(t)).getTime()<30*864e5),r=t=>d(t)?new Date(d(t)).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"";return s.error?e.jsxs(e.Fragment,{children:[e.jsx(u,{crumbs:["Monitor","Alerts"]}),e.jsx(g,{children:e.jsx(_,{error:s.error})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(u,{crumbs:["Monitor","Alerts"],children:[e.jsx(k,{options:[{value:"unseen",label:`Unseen · ${i.size}`},{value:"all",label:`All · ${o.length}`},{value:"warning",label:"Warning"},{value:"critical",label:"Critical"}],value:n,onChange:m}),e.jsx(v,{variant:"ghost",disabled:!i.size,onClick:()=>i.forEach(t=>a.mutate(t)),children:"Mark all seen"})]}),e.jsxs(g,{row:!0,children:[e.jsxs(p,{padded:!1,className:"flex-1 self-start",children:[c.length===0&&e.jsxs("div",{className:"text-center text-ink-2 py-10 flex items-center justify-center gap-2",children:[e.jsx(f,{kind:"good",children:"ALL CLEAR"}),"nothing ",n==="all"?"recorded":n]}),c.map(t=>{const x=!i.has(t.id),b=E(t);return e.jsxs("div",{className:`flex items-start gap-3.5 p-3.5 border-b border-line ${x?"opacity-70":S[t.severity]}`,children:[e.jsx(f,{kind:C[t.severity],className:"mt-px",children:t.severity.toUpperCase()}),e.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[e.jsx("span",{className:"font-semibold",children:t.title}),e.jsx("span",{className:"text-ink-1",children:t.message}),e.jsxs("div",{className:"flex gap-2 mt-1.5 items-center",children:[e.jsx(w,{children:t.detector}),b.map(j=>e.jsx(w,{children:j},j))]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-2",children:[e.jsx("span",{className:"font-mono text-[11px] text-ink-2 whitespace-nowrap",children:r(t)}),x?e.jsx(f,{kind:"mute",children:"seen"}):e.jsx(v,{size:"sm",onClick:()=>a.mutate(t.id),children:"Mark seen"})]})]},t.id)})]}),e.jsxs("div",{className:"w-[300px] shrink-0 flex flex-col gap-3",children:[e.jsx(p,{title:"Detectors",sub:"run after each ingest",padded:!1,children:D.map(t=>e.jsxs("div",{className:`flex items-center gap-2.5 px-3.5 py-2.5 border-b border-line last:border-b-0 ${t.on?"":"text-ink-2"}`,children:[e.jsx("span",{className:`w-[7px] h-[7px] rounded-full ${t.on?"bg-good":"border border-line-2"}`}),e.jsx("span",{className:"font-mono text-[11.5px]",children:t.n}),e.jsxs("span",{className:`ml-auto font-mono text-[11px] ${t.on?"text-good":""}`,children:[t.on?"on":"off"," · ",t.note]})]},t.n))}),e.jsxs(p,{title:"Last 30 days",children:[e.jsx(A,{alerts:l.map(t=>({at:new Date(d(t)).getTime(),severity:t.severity}))}),e.jsxs("div",{className:"flex flex-col gap-2 mt-3 text-xs",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-ink-1",children:"Alerts raised"}),e.jsx("span",{className:"font-mono num",children:l.length})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-ink-1",children:"Critical"}),e.jsx("span",{className:"font-mono num",children:l.filter(t=>t.severity==="critical").length})]})]})]})]})]})]})}export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f,t as A,j as r}from"./index-
|
|
1
|
+
import{r as f,t as A,j as r}from"./index-kEmLC0Ll.js";import{A as h,S as e,h as j,L as w,U as E}from"./uplotTheme-DVpHp5Uh.js";function v({labels:s,series:o,stacked:l=!1,fill:u=!0,share:m=!1,format:x=A,height:i=220}){const c=f.useMemo(()=>{const t=s.map((n,p)=>p);if(!l)return[t,...o.map(n=>n.values)];const a=Array(s.length).fill(0);return[t,...o.map(n=>n.values.map((p,d)=>a[d]+=p))]},[s,o,l]),g=f.useMemo(()=>({cursor:{points:{size:8}},legend:{show:!1},padding:[8,12,0,0],scales:{x:{time:!1},y:m?{range:[0,1]}:{}},axes:[{...h,values:(t,a)=>a.map(n=>n==null?"":s[n]??"")},{...h,size:52,values:(t,a)=>a.map(n=>n==null?"":m?`${Math.round(n*100)}%`:x(n))}],series:[{},...o.map((t,a)=>({label:t.name,stroke:e[a%e.length],width:2,points:{show:!1},fill:u?j(e[a%e.length],l?.35:.1):void 0,...l&&a>0?{band:!0}:{}}))]}),[s,o,l,u,m,x]);return r.jsxs("div",{className:"flex flex-col gap-2 min-w-0",children:[o.length>=2&&r.jsx(w,{names:o.map(t=>t.name),colors:o.map((t,a)=>e[a%e.length])}),r.jsx(E,{options:g,data:c,height:i})]})}export{v as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as p,g as x,h as m,j as e,s as i,L as h}from"./index-
|
|
1
|
+
import{i as p,g as x,h as m,j as e,s as i,L as h}from"./index-kEmLC0Ll.js";import{P as j}from"./Panel-Bp9ZgSnf.js";import{P as l,B as u}from"./Button-C6Vpou9C.js";const f={info:"info",warning:"warn",critical:"crit"},n=t=>t.created_at??t.first_seen_at??"";function N(){const t=p().data??[],o=x().data??[],c=m(),r=t.slice(0,3),a=[...o].sort((s,d)=>n(d).localeCompare(n(s)))[0];return e.jsx(j,{title:"Needs attention",sub:`${t.length} unseen`,right:e.jsx(h,{to:"/alerts",className:"text-[11px]",children:"All alerts →"}),padded:!1,children:r.length===0?e.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5 text-ink-1",children:[e.jsx(l,{kind:"good",children:"ALL CLEAR"}),a?e.jsxs("span",{children:["last alert ",i(n(a)),": ",a.title]}):e.jsx("span",{children:"no alerts recorded yet"})]}):r.map(s=>e.jsxs("div",{className:"flex items-center gap-3 px-3.5 py-2.5 border-b border-line last:border-b-0 min-w-0",children:[e.jsx(l,{kind:f[s.severity],children:s.severity.toUpperCase()}),e.jsx("span",{className:"font-medium whitespace-nowrap",children:s.title}),e.jsx("span",{className:"text-ink-1 truncate",children:s.message}),e.jsx("span",{className:"ml-auto font-mono text-[11px] text-ink-1 bg-bg-3 px-1.5 rounded-sm whitespace-nowrap",children:s.detector}),e.jsx("span",{className:"font-mono text-[11px] text-ink-2 whitespace-nowrap",children:n(s)?i(n(s)):""}),e.jsx(u,{size:"sm",variant:"ghost",onClick:()=>c.mutate(s.id),children:"Mark seen"})]},s.id))})}export{N as A,n as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,t as o,I as m}from"./index-
|
|
1
|
+
import{j as s,t as o,I as m}from"./index-kEmLC0Ll.js";function d({rows:a,format:n=o,max:l,color:r="var(--color-s1)",className:i=""}){const t=l??Math.max(1,...a.map(e=>e.value));return s.jsx("div",{className:`flex flex-col gap-2.5 ${i}`,children:a.map(e=>s.jsxs("div",{className:"grid grid-cols-[minmax(0,200px)_1fr_auto] items-center gap-3 text-xs",children:[s.jsx("span",{className:"font-mono text-ink-0 truncate",title:e.name,children:e.name}),s.jsxs("div",{className:"relative h-1.5 rounded-sm bg-bg-3 overflow-hidden",children:[s.jsx("i",{"data-testid":"bar-fill",className:"absolute inset-y-0 left-0 rounded-r-sm",style:{width:`${e.value/t*100}%`,background:r}}),e.error?s.jsx("i",{"data-testid":"bar-error",className:"absolute inset-y-0 left-0",style:{width:`${e.error/t*100}%`,background:"var(--color-crit)"}}):null]}),s.jsxs("span",{className:"font-mono num text-ink-1 text-right min-w-16",children:[n(e.value),e.error?s.jsxs("span",{className:"text-crit-ink ml-2 inline-flex items-center gap-0.5",children:[s.jsx(m,{name:"x",size:9}),e.error]}):null]})]},e.name))})}export{d as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o,I as a}from"./index-
|
|
1
|
+
import{j as o,I as a}from"./index-kEmLC0Ll.js";const s={warn:"text-warn bg-warn/10 border-warn/25",crit:"text-crit-ink bg-crit/12 border-crit/30",info:"text-s1 bg-s1/12 border-s1/30",good:"text-good bg-good/12 border-good/30",mute:"text-ink-1 bg-bg-3 border-line-2"},c={warn:"warn",crit:"x",info:"info",good:"check"};function x({kind:t,children:e,icon:r=!0,className:n=""}){const i=c[t];return o.jsxs("span",{className:`inline-flex items-center gap-1.5 h-5 px-2 rounded-sm text-[11px] font-medium font-mono border whitespace-nowrap ${s[t]} ${n}`,children:[r&&i&&o.jsx(a,{name:i,size:11}),e]})}const d={default:"bg-bg-2 border-line-2 text-ink-0 hover:border-accent",primary:"bg-accent border-accent text-[#1a0f06]",ghost:"bg-transparent border-line-2 text-ink-0 hover:border-accent",danger:"bg-transparent border-crit text-crit-ink"};function g({variant:t="default",size:e="md",className:r="",...n}){return o.jsx("button",{type:"button",...n,className:`inline-flex items-center gap-1.5 ${e==="sm"?"h-6 px-2 text-[11px]":"h-7 px-2.5 text-xs"} rounded-md border font-medium whitespace-nowrap disabled:opacity-50 ${d[t]} ${r}`})}export{g as B,x as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,r as n}from"./index-
|
|
1
|
+
import{j as e,r as n}from"./index-kEmLC0Ll.js";import{C as o}from"./Chip-DX-VLUbj.js";function x({columns:s,rows:a}){return e.jsx("div",{className:"overflow-auto max-h-72",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsx("tr",{children:s.map((t,r)=>e.jsx("th",{className:`text-[10px] tracking-[0.08em] text-ink-2 font-medium px-3 py-2 border-b border-line bg-bg-1 sticky top-0 whitespace-nowrap ${r?"text-right":"text-left"}`,children:t},t))})}),e.jsx("tbody",{children:a.map((t,r)=>e.jsx("tr",{children:t.map((l,i)=>e.jsx("td",{className:`px-3 h-8 border-b border-line text-xs whitespace-nowrap ${i?"text-right font-mono num":"font-mono text-ink-1"}`,children:l},i))},r))})]})})}function h({chart:s,table:a}){const[t,r]=n.useState(!1);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(o,{active:t,onClick:()=>r(!t),children:"Table"})}),t?e.jsx(x,{...a}):s]})}export{h as C,x as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,I as a}from"./index-
|
|
1
|
+
import{j as t,I as a}from"./index-kEmLC0Ll.js";function i({active:e=!1,onClick:n,children:r,caret:s=!1}){return t.jsxs("button",{type:"button",onClick:n,"aria-pressed":e,className:`inline-flex items-center gap-1.5 h-6 px-2 rounded-md border text-[11px] whitespace-nowrap ${e?"border-accent text-accent-ink bg-accent/12":"border-line-2 text-ink-1 bg-bg-2 hover:text-ink-0"}`,children:[r,s&&t.jsx(a,{name:"chevron",size:10})]})}export{i as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./index-kEmLC0Ll.js";const s=({error:t})=>e.jsxs("div",{role:"alert",className:"border border-crit/40 bg-crit/8 rounded-md p-3 text-xs text-ink-1",children:[e.jsx("span",{className:"text-crit-ink font-medium",children:"Could not load."})," ",t instanceof Error?t.message:String(t)]});export{s as E};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as u,u as T,f as _,j as s,W as $,S as j,e as p,t as C,n as E}from"./index-kEmLC0Ll.js";import{T as f,P as b}from"./TopBar-l88js9Iq.js";import{S as y}from"./Seg-BhkJzldV.js";import{P as i}from"./Panel-Bp9ZgSnf.js";import{E as O}from"./ErrorPanel-DWD9Fov9.js";import{B as k}from"./Bars-BM1Q9Juw.js";import{S as W}from"./StackedColumns-DUiup4fS.js";import{M as B}from"./MultiLine-CH2ovZmZ.js";import{a as v}from"./ChartTable-jq-9YnND.js";import{p as g}from"./rollups-Dqiwg3gD.js";import{d as D,w as z}from"./windows-B3y4OLGl.js";import{t as A,s as F}from"./series-BjP-80tt.js";import"./uplotTheme-DVpHp5Uh.js";import"./AreaLine-C2pbmMiI.js";import"./Chip-DX-VLUbj.js";function se(){const[d,M]=u.useState("30d"),[x,S]=u.useState("lines"),a=T(d),r=z(d),N=r!=null?"day":"week",c=_(N,"model"),l=u.useMemo(()=>Object.keys({...a.data?.tokens_by_model,...a.data?.cost_by_model}).map(e=>({model:e,tokens:a.data?.tokens_by_model[e]??0,cost:a.data?.cost_by_model[e]??0})).sort((e,t)=>t.cost-e.cost),[a.data]),o=u.useMemo(()=>{if(!c.data)return null;const e=r!=null?new Set(D(new Date,r)):null,t=e?c.data.points.filter(m=>e.has(m.bucket)):c.data.points.slice(-26),n=A(t,"tokens"),P=F(n.rows);return{labels:n.labels,raw:n.names.map((m,h)=>({name:m,values:n.rows[h]})),pct:n.names.map((m,h)=>({name:m,values:P[h]}))}},[c.data,r]),w=l.reduce((e,t)=>e+t.cost,0);return a.error?s.jsxs(s.Fragment,{children:[s.jsx(f,{crumbs:["Analyze","Models"]}),s.jsx(b,{children:s.jsx(O,{error:a.error})})]}):s.jsxs(s.Fragment,{children:[s.jsx(f,{crumbs:["Analyze","Models"],children:s.jsx(y,{options:$.map(e=>({value:e,label:e})),value:d,onChange:M})}),s.jsxs(b,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsx(i,{title:"Tokens by model",children:a.data?l.length?s.jsx(k,{rows:l.map(e=>({name:e.model,value:e.tokens}))}):s.jsx("div",{className:"text-ink-2 text-center py-6",children:"No data."}):s.jsx(j,{w:"100%",h:"160px"})}),s.jsx(i,{title:"Estimated cost by model",children:a.data?l.length?s.jsx(k,{rows:l.map(e=>({name:e.model,value:e.cost})),format:p,color:"#285a95"}):s.jsx("div",{className:"text-ink-2 text-center py-6",children:"No data."}):s.jsx(j,{w:"100%",h:"160px"})})]}),s.jsx(i,{title:"Price efficiency",sub:"$ per million tokens, as experienced in this window",children:l.some(e=>e.tokens>0)?s.jsx(k,{rows:l.filter(e=>e.tokens>0).map(e=>({name:e.model,value:g(e.cost,e.tokens)??0})),format:p,color:"#3173c4"}):s.jsx("div",{className:"text-ink-2 text-center py-6",children:"No data."})}),s.jsx(i,{title:r!=null?"Model share by day":"Model share by week",sub:`% of each ${r!=null?"day":"week"}'s fresh + output tokens · last ${d}`,right:s.jsx(y,{options:[{value:"lines",label:"lines"},{value:"columns",label:"columns"},{value:"table",label:"table"}],value:x,onChange:S}),children:o?o.raw.length?x==="lines"?s.jsx(B,{labels:o.labels,series:o.pct,share:!0,height:240}):x==="columns"?s.jsx(W,{labels:o.labels,series:o.raw,share:!0,format:C}):s.jsx(v,{columns:[r!=null?"day":"week",...o.raw.map(e=>e.name)],rows:o.labels.map((e,t)=>[e,...o.pct.map(n=>`${Math.round((n.values[t]??0)*100)}%`)])}):s.jsx("div",{className:"text-ink-2 text-center py-6",children:"No data."}):s.jsx(j,{w:"100%",h:"240px"})}),s.jsx(i,{title:"Per-model details",padded:!1,children:s.jsx(v,{columns:["model","tokens","est. cost","$ / M tokens","share of cost"],rows:l.map(e=>{const t=g(e.cost,e.tokens);return[e.model,E(e.tokens),p(e.cost),t==null?"—":p(t),w?`${Math.round(e.cost/w*100)}%`:"—"]})})})]})]})}export{se as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./index-kEmLC0Ll.js";import{A as o}from"./AreaLine-C2pbmMiI.js";const e=s=>i.jsx(o,{...s,fill:!1});export{e as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,p as O,t as k,u as A,a as M,b as B,r as p,c as C,s as H,d as K,e as $,L,f as z,W as J,n as g,S as T}from"./index-kEmLC0Ll.js";import{T as W,P as R}from"./TopBar-l88js9Iq.js";import{S as G}from"./Seg-BhkJzldV.js";import{d as N,T as _}from"./Tile-BF8_h63E.js";import{P as w}from"./Panel-Bp9ZgSnf.js";import{C as U}from"./Chip-DX-VLUbj.js";import{E as q}from"./ErrorPanel-DWD9Fov9.js";import{A as Q}from"./AreaLine-C2pbmMiI.js";import{B as V}from"./Bars-BM1Q9Juw.js";import{d as E,w as S,a as X}from"./windows-B3y4OLGl.js";import{C as Y}from"./ChartTable-jq-9YnND.js";import{i as Z}from"./rollups-Dqiwg3gD.js";import{A as ee}from"./AttentionStrip-DMp-7mLu.js";import{t as se}from"./series-BjP-80tt.js";import"./uplotTheme-DVpHp5Uh.js";import"./Button-C6Vpou9C.js";const te=({children:t})=>e.jsx("kbd",{className:"font-mono text-[10px] border border-line-2 rounded-sm px-1 text-ink-2",children:t});function oe({parts:t,className:a=""}){const o=t.reduce((n,s)=>n+s.value,0)||1;return e.jsxs("div",{className:`flex flex-col gap-2 ${a}`,children:[e.jsx("div",{className:"flex h-2 rounded-sm overflow-hidden gap-[2px] bg-bg-0",children:t.map(n=>e.jsx("i",{style:{width:`${n.value/o*100}%`,background:n.color}},n.name))}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-ink-1",children:t.map(n=>e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("b",{className:"w-2 h-2 rounded-[2px] inline-block",style:{background:n.color}}),n.name," ",e.jsx("span",{className:"font-mono text-ink-0",children:O(n.value/o,0)})]},n.name))})]})}const D=["#141a24","#1f3c63","#285a95","#3173c4","#3987e5"],F=(t,a)=>t<=0?D[0]:D[Math.min(4,1+Math.floor(t/a*3.999))];function ae({byDay:t,days:a=90,end:o=new Date,className:n=""}){const s=E(o,a),l=Math.max(1,...s.map(i=>t[i]??0)),d=(new Date(s[0]+"T00:00:00").getDay()+6)%7,r=11,x=2,m=Math.ceil((a+d)/7);return e.jsxs("svg",{className:`block w-full ${n}`,width:"100%",viewBox:`0 0 ${m*(r+x)+28} ${7*(r+x)+4}`,style:{aspectRatio:`${m*(r+x)+28} / ${7*(r+x)+4}`},role:"img","aria-label":`Activity, last ${a} days`,children:[["M","W","F"].map((i,f)=>e.jsx("text",{x:0,y:f*2*(r+x)+r,fontSize:9,fill:"#667184",fontFamily:"var(--font-mono)",children:i},i)),s.map((i,f)=>{const c=f+d,v=24+Math.floor(c/7)*(r+x),y=c%7*(r+x),b=t[i]??0;return e.jsx("rect",{"data-day":i,x:v,y,width:r,height:r,rx:2,fill:F(b,l),children:e.jsx("title",{children:`${i} · ${k(b)} tokens`})},i)})]})}function ne({matrix:t,rowLabels:a,colLabels:o,className:n=""}){const s=Math.max(1,...t.flat()),l=16,d=14,r=2,x=26;return e.jsxs("svg",{className:`block w-full ${n}`,width:"100%",viewBox:`0 0 ${x+o.length*(l+r)} ${t.length*(d+r)+14}`,style:{aspectRatio:`${x+o.length*(l+r)} / ${t.length*(d+r)+14}`},role:"img","aria-label":"Sessions by weekday and hour",children:[a.map((m,i)=>e.jsx("text",{x:0,y:i*(d+r)+d-3,fontSize:9,fill:"#667184",fontFamily:"var(--font-mono)",children:m},m)),o.map((m,i)=>i%3===0?e.jsx("text",{x:x+i*(l+r),y:t.length*(d+r)+10,fontSize:9,fill:"#667184",fontFamily:"var(--font-mono)",children:m},m):null),t.map((m,i)=>m.map((f,c)=>e.jsx("rect",{x:x+c*(l+r),y:i*(d+r),width:l,height:d,rx:2,fill:F(f,s),children:e.jsx("title",{children:`${a[i]} ${o[c]}:00 · ${f}`})},`${i}-${c}`)))]})}const I={tokens:null,cost:null,sessions:null,errorRate:null};function re(t,a,o,n){if(S(a)==null||!t.prior_window)return I;const s=t.prior_window;let l=null;if(o&&n){const d=o.total_calls?o.total_errors/o.total_calls:0,r=n.total_calls-o.total_calls,x=n.total_errors-o.total_errors,m=r>0?x/r:null;l=m==null?null:{abs:d-m,pct:m?(d-m)/m:null,dir:d>m?"up":d<m?"down":"flat"}}return{tokens:N(t.total_tokens,s.tokens),cost:N(t.total_cost_usd,s.cost_usd),sessions:N(t.session_count,s.sessions),errorRate:l}}function le(t,a=new Date){const o=A(t),n=M(t),s=M(X(t)),l=B(),d=p.useMemo(()=>o.data?re(o.data,t,n.data,s.data):I,[o.data,n.data,s.data,t]),r=p.useMemo(()=>l.data?Z(l.data,t,a):[],[l.data,t]);return{cur:o.data,tiles:d,tools:n.data,sessionsInWindow:r,allSessions:l.data??[],isLoading:o.isLoading,error:o.error??n.error??l.error}}const ie=["STARTED","PROJECT","MODEL","TOKENS","EST. COST"];function ce({rows:t}){const a=Math.max(1,...t.map(s=>s.window_tokens)),o=C(),n=s=>o({to:"/sessions/$id",params:{id:s},search:{tab:"overview"}});return e.jsx(w,{title:"Top sessions",sub:"by tokens in window",right:e.jsx(L,{to:"/sessions",className:"text-[11px]",children:"All sessions →"}),padded:!1,children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{children:e.jsx("tr",{children:ie.map((s,l)=>e.jsx("th",{className:`text-[10px] tracking-[0.08em] text-ink-2 font-medium px-3 py-2 border-b border-line ${l>=3?"text-right":"text-left"} ${l===3?"w-56":""}`,children:s},s))})}),e.jsxs("tbody",{children:[t.slice(0,8).map(s=>e.jsxs("tr",{className:"hover:bg-bg-2 cursor-pointer",onClick:()=>n(s.id),onKeyDown:l=>l.key==="Enter"&&n(s.id),tabIndex:0,children:[e.jsxs("td",{className:"px-3 h-[34px] border-b border-line font-mono text-xs whitespace-nowrap",children:[e.jsx("span",{className:"text-ink-0",children:H(s.started_at)}),s.days_active>1&&e.jsxs("span",{className:"text-ink-2 text-[10px] ml-1",children:["+",s.days_active-1,"d"]})]}),e.jsx("td",{className:"px-3 border-b border-line font-mono text-xs text-ink-1 truncate max-w-[360px]",title:s.project_path,children:K(s.project_path)}),e.jsx("td",{className:"px-3 border-b border-line",children:e.jsx("span",{className:"font-mono text-[11.5px] text-ink-1 bg-bg-3 px-1.5 rounded-sm",children:s.primary_model})}),e.jsx("td",{className:"px-3 border-b border-line",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"relative h-1.5 flex-1 rounded-sm bg-bg-3 overflow-hidden",children:e.jsx("i",{className:"absolute inset-y-0 left-0 bg-s1 rounded-r-sm",style:{width:`${s.window_tokens/a*100}%`}})}),e.jsx("span",{className:"font-mono num text-xs w-14 text-right",children:k(s.window_tokens)})]})}),e.jsx("td",{className:"px-3 border-b border-line text-right font-mono num text-xs",children:$(s.window_cost_usd)})]},s.id)),t.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"text-center text-ink-2 py-8",children:"No sessions in this window."})})]})]})})}function de(t){const a={fresh:0,cacheWrite:0,cacheRead:0,output:0,total:0};for(const o of t)a.fresh+=o.total_fresh_input_tokens,a.cacheWrite+=o.total_cache_write_tokens,a.cacheRead+=o.total_cache_read_tokens,a.output+=o.total_output_tokens;return a.total=a.fresh+a.cacheWrite+a.cacheRead+a.output,a}function me(t,a=()=>1){const o=Array.from({length:7},()=>Array(24).fill(0));for(const n of t){const s=new Date(n.started_at),l=(s.getDay()+6)%7;o[l][s.getHours()]+=a(n)}return o}const xe=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ue=Array.from({length:24},(t,a)=>String(a).padStart(2,"0"));function We(){const[t,a]=p.useState("7d"),[o,n]=p.useState(!1),s=le(t),l=A("all"),d=z("day","model"),r=p.useMemo(()=>{const u=S(t);return u?E(new Date,u):Object.keys(s.cur?.tokens_by_day??{}).sort()},[t,s.cur]),x=p.useMemo(()=>{if(o&&d.data){const u=d.data.points.filter(j=>r.includes(j.bucket)),h=se(u,"tokens");return{labels:h.labels,series:h.names.map((j,P)=>({name:j,values:h.rows[P]}))}}return{labels:r,series:[{name:"tokens",values:r.map(u=>s.cur?.tokens_by_day[u]??0)}]}},[o,d.data,r,s.cur]),m=p.useMemo(()=>Object.entries(s.cur?.tokens_by_model??{}).map(([u,h])=>({name:u,value:h})).sort((u,h)=>h.value-u.value),[s.cur]),i=p.useMemo(()=>de(s.sessionsInWindow),[s.sessionsInWindow]),f=p.useMemo(()=>me(s.sessionsInWindow),[s.sessionsInWindow]);if(s.error)return e.jsxs(e.Fragment,{children:[e.jsx(W,{crumbs:["Monitor","Overview"]}),e.jsx(R,{children:e.jsx(q,{error:s.error})})]});const c=s.cur,v=S(t),y=c&&c.session_count?Math.round(c.total_tokens/c.session_count):0,b=s.tools?s.tools.total_calls?s.tools.total_errors/s.tools.total_calls:0:null;return e.jsxs(e.Fragment,{children:[e.jsxs(W,{crumbs:["Monitor","Overview"],children:[e.jsx(G,{options:J.map(u=>({value:u,label:u})),value:t,onChange:a}),e.jsxs("span",{className:"text-ink-2 text-xs flex items-center gap-2",children:["Jump anywhere ",e.jsx(te,{children:"Ctrl K"})]})]}),e.jsxs(R,{children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsx(_,{label:"Tokens",value:c?k(c.total_tokens):"—",delta:s.tiles.tokens,sub:"vs prior window",note:c?`${k(y)} / session`:void 0}),e.jsx(_,{label:"Estimated cost",value:c?$(c.total_cost_usd):"—",delta:s.tiles.cost,upIsBad:!0,sub:"vs prior window",note:c&&v?`${$(c.total_cost_usd/v)} / day`:void 0}),e.jsx(_,{label:"Sessions",value:c?g(c.session_count):"—",delta:s.tiles.sessions,sub:"vs prior window"}),e.jsx(_,{label:"Tool error rate",value:b==null?"—":O(b),delta:s.tiles.errorRate,upIsBad:!0,fmt:u=>`${u.abs>=0?"+":"−"}${(Math.abs(u.abs)*100).toFixed(1)} pt`,sub:s.tools?`${g(s.tools.total_errors)} of ${g(s.tools.total_calls)} calls`:void 0})]}),e.jsx(ee,{}),e.jsxs("div",{className:"grid grid-cols-[2fr_1fr] gap-3",children:[e.jsx(w,{title:"Tokens per day",sub:o?"fresh + output, by model":"all token kinds",right:e.jsx(U,{active:o,onClick:()=>n(!o),children:"Stack by model"}),children:c?e.jsx(Y,{chart:e.jsx(Q,{labels:x.labels,series:x.series,stacked:o}),table:{columns:["day",...x.series.map(u=>u.name)],rows:x.labels.map((u,h)=>[u,...x.series.map(j=>g(j.values[h]??0))])}}):e.jsx(T,{w:"100%",h:"220px"})}),e.jsxs(w,{title:"Models",sub:"share of tokens",children:[m.length?e.jsx(V,{rows:m}):e.jsx("div",{className:"text-ink-2 text-center py-6",children:"No data."}),e.jsx("div",{className:"mt-auto pt-3 border-t border-line",children:e.jsx(oe,{parts:[{name:"cache read",value:i.cacheRead,color:"#3987e5"},{name:"cache write",value:i.cacheWrite,color:"#285a95"},{name:"fresh",value:i.fresh,color:"#1f3c63"},{name:"output",value:i.output,color:"#9ec5f4"}]})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(w,{title:"Activity",sub:"last 90 days",children:l.data?e.jsx(ae,{byDay:l.data.tokens_by_day,days:90}):e.jsx(T,{w:"100%",h:"100px"})}),e.jsx(w,{title:"When you work",sub:"sessions started, by weekday × hour",children:e.jsx(ne,{matrix:f,rowLabels:xe,colLabels:ue})})]}),e.jsx(ce,{rows:c?.top_sessions??[]})]})]})}export{We as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./index-kEmLC0Ll.js";function o({title:s,sub:n,right:r,children:l,className:a="",padded:t=!0}){return e.jsxs("section",{className:`bg-bg-1 border border-line rounded-md flex flex-col overflow-hidden min-w-0 ${a}`,children:[s&&e.jsxs("header",{className:"flex items-center gap-2.5 h-9 px-3.5 border-b border-line shrink-0",children:[e.jsx("h3",{className:"m-0 text-xs font-semibold text-ink-0 whitespace-nowrap",children:s}),n&&e.jsx("span",{className:"text-[11px] text-ink-2 font-mono truncate",children:n}),r&&e.jsx("div",{className:"ml-auto flex items-center gap-1.5",children:r})]}),e.jsx("div",{className:`${t?"p-3.5":""} min-h-0 flex-1 flex flex-col`,children:l})]})}export{o as P};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as d,j as e,X as ne,Y as le,n as N,e as w,t as D,y as re,L as W,Z as oe,_ as ie,$ as ce,U as de}from"./index-kEmLC0Ll.js";import{T as xe,P as pe}from"./TopBar-l88js9Iq.js";import{p as G,O as Y,h as M,a as me,S as ue,e as R,E as he,P as fe,s as be}from"./ThreadCard-3Ao_BW3U.js";import{C as je}from"./Chip-DX-VLUbj.js";import{S as ge}from"./Seg-BhkJzldV.js";import{E as J}from"./ErrorPanel-DWD9Fov9.js";import{C as ve}from"./ChartTable-jq-9YnND.js";const K=(t,s)=>({a:Math.min(t,s),b:Math.max(t,s)});function Z({days:t,values:s,format:n,sel:r,onSel:l,height:o=64,label:j,color:h="#3987e5"}){const f=d.useRef(null),[g,_]=d.useState(null),y=d.useRef(null),k=p=>{y.current=p,_(p)},m=d.useRef(l);m.current=l;const c=g??r,S=Math.max(1,...s),b=100/Math.max(1,t.length),C=p=>{f.current!==null&&l(K(f.current,p)),f.current=null,k(null)};d.useEffect(()=>{const p=()=>{f.current!==null&&y.current&&m.current(y.current),f.current=null,y.current&&k(null)};return window.addEventListener("pointerup",p),()=>window.removeEventListener("pointerup",p)},[]);const x=p=>p.preventDefault();return e.jsx("svg",{role:"img","aria-label":j,viewBox:`0 0 100 ${o}`,preserveAspectRatio:"none",className:"w-full select-none touch-none",style:{height:o},onMouseDown:x,onDoubleClick:x,children:t.map((p,i)=>{const v=c!==null&&i>=c.a&&i<=c.b,$=s[i]/S*(o-2);return e.jsxs("g",{"data-testid":"daycol","data-selected":v,className:"cursor-pointer",onPointerDown:()=>{f.current=i,k({a:i,b:i})},onPointerEnter:()=>{f.current!==null&&k(K(f.current,i))},onPointerUp:()=>C(i),children:[e.jsx("title",{children:`${p} · ${n(s[i])}`}),e.jsx("rect",{x:i*b,y:0,width:b,height:o,fill:v?"var(--color-accent)":"transparent",fillOpacity:v?.1:0}),e.jsx("rect",{x:i*b+b*.15,y:o-$,width:b*.7,height:$,rx:.6,fill:h,fillOpacity:c&&!v?.35:1})]},p)})})}function Ne(t,s,n){if(!s)return{};const r=o=>new Date(Date.parse(`${o}T00:00:00Z`)-n*6e4),l=r(t[s.b]);return l.setUTCDate(l.getUTCDate()+1),{from:r(t[s.a]).toISOString(),to:l.toISOString()}}const ke=[{value:"tokens",label:"Tokens"},{value:"cost",label:"Cost"},{value:"time",label:"Time"}],z=t=>new Date(t).toLocaleDateString([],{month:"short",day:"numeric"}),ye=t=>new Date(t).toLocaleString([],{weekday:"short",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),we=t=>[...t].sort((s,n)=>n.last_ts.localeCompare(s.last_ts));function Se({s:t}){return e.jsxs("div",{className:"px-3 pb-3 flex flex-col gap-2.5 text-[12px]",children:[t.whole&&e.jsxs("p",{className:"m-0 text-ink-2",children:["part of a longer session (",z(t.whole.first_ts)," – ",z(t.whole.last_ts),"): ",D(t.whole.output_tokens)," tokens · ",w(t.whole.cost)]}),t.session_list.map(s=>e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-line bg-bg-1 px-2.5 py-1.5",children:[e.jsxs("span",{className:"text-ink-1 min-w-0 truncate",children:[e.jsx("b",{className:"text-ink-0 font-medium",children:s.title??"Untitled session"})," · ",s.model??"—"," · ",N(s.turns)," turns · ",ye(s.first_ts)," · ",M(s.active_ms,s.active_estimated)]}),e.jsx(W,{to:"/sessions/$id",params:{id:s.session_id},search:{tab:"overview"},className:"shrink-0",children:"Open session"})]},s.session_id)),t.commit_list.length>0&&e.jsxs("div",{className:"flex flex-col gap-1",children:[t.commit_list.slice(0,8).map(s=>e.jsxs("div",{className:"grid grid-cols-[64px_minmax(0,1fr)_auto] gap-x-3 items-center",children:[e.jsx("span",{className:"font-mono text-ink-2",children:s.sha.slice(0,7)}),e.jsx("span",{className:"truncate",children:s.subject}),e.jsx("span",{className:`text-[10px] px-1.5 rounded-full ${R(s.evidence).className}`,children:R(s.evidence).label})]},s.sha)),t.commit_list.length>8&&e.jsxs("span",{className:"text-ink-2",children:["and ",t.commit_list.length-8," more in Activity"]})]}),t.prs.length>0&&e.jsxs("p",{className:"m-0 text-ink-1",children:["PRs · ",t.prs.map(s=>`#${s}`).join(" ")]})]})}function _e({s:t,focused:s}){const[n,r]=d.useState(s);return e.jsxs("div",{"data-focused":s,className:`rounded-md border ${s?"border-accent/60 bg-accent/10":"border-line bg-bg-2"}`,children:[e.jsxs("button",{type:"button","aria-expanded":n,onClick:()=>r(l=>!l),className:"w-full text-left px-3 py-2.5 flex flex-col gap-1",children:[e.jsxs("span",{className:"flex items-start justify-between gap-2",children:[e.jsx("b",{className:"text-[13px] font-medium leading-snug",children:t.title}),e.jsx(ue,{state:t.state})]}),t.branch&&e.jsx("span",{className:"font-mono text-[10px] text-ink-2",children:t.branch}),e.jsxs("span",{className:"text-[11px] text-ink-1",children:[t.reason," · ",w(t.cost)," · ",re(t.last_ts)]})]}),n&&e.jsx(Se,{s:t})]})}function I({name:t,note:s,children:n}){return e.jsxs("section",{"aria-label":t,className:"rounded-lg border border-line bg-bg-1 flex flex-col min-w-0",children:[e.jsxs("header",{className:"px-3.5 py-2.5 border-b border-line flex items-baseline justify-between",children:[e.jsx("span",{className:"text-[11px] tracking-[0.1em] uppercase",children:t}),e.jsx("span",{className:"text-[11px] text-ink-2",children:s})]}),e.jsx("div",{className:"p-2.5 flex flex-col gap-2",children:n})]})}function $e({repo:t,scope:s="mine",days:n=30,focus:r}){const[l,o]=d.useState(null),[j,h]=d.useState("tokens"),[f,g]=d.useState(!1),[_,y]=d.useState(!1),[k,m]=d.useState(!1),c=ne(t,{days:n},s),S=c.data?.daily.days,b=d.useMemo(()=>Ne(S??[],l,le()),[S,l]),C=d.useRef(null);if(d.useEffect(()=>{C.current?.querySelector('[data-focused="true"]')?.scrollIntoView?.({block:"center",behavior:"smooth"})},[c.data,r]),c.error)return e.jsx(J,{error:c.error});if(!c.data)return null;const{tiles:x,prior:p,daily:i}=c.data,v=c.data.stories,$=we(b.from&&b.to?v.filter(a=>a.first_ts<b.to&&a.last_ts>=b.from):v),Q=a=>Y.has(a.state)||a.state==="unknown",q=$.filter(Q),F=$.filter(a=>a.state==="shipped"),T=$.filter(a=>a.state==="dropped"),O=$.filter(a=>a.state==="explored"),L=v.filter(a=>a.state==="shipped").length,H=v.filter(a=>a.state==="dropped"),V=v.filter(a=>a.state==="explored"),E=a=>w(a.reduce((u,ae)=>u+ae.cost,0)),ee=(a,u)=>n===0||!u?null:`${a>=u?"↑":"↓"} ${Math.round(Math.abs((a-u)/u)*100)}% vs previous ${n} days`,te=[{label:"Shipped",value:N(L),note:G(n)},{label:"Open",value:N(v.filter(a=>Y.has(a.state)).length),note:"not on main yet"},{label:"Dropped",value:N(H.length),note:`${E(H)} spent`},{label:"Explored",value:N(V.length),note:`${E(V)} · no files edited`},{label:"Spent",value:w(x.cost),note:ee(x.cost,p.cost)},{label:"Per shipped",value:L?w(x.cost/L):"—",note:"all spend ÷ shipped"}],B={tokens:{aria:"Output tokens by day",values:i.output_tokens,format:a=>D(a)},cost:{aria:"Cost by day",values:i.cost,format:a=>w(a)},time:{aria:"Active hours by day",values:i.active_ms,format:a=>M(a)}}[j],se={columns:["Day","Output tokens","Cost","Active","Commits"],rows:i.days.map((a,u)=>[a,D(i.output_tokens[u]),w(i.cost[u]),M(i.active_ms[u]),i.commits[u]])},P=a=>a.length?a.map(u=>e.jsx(_e,{s:u,focused:u.key===r},u.key)):e.jsx("p",{className:"m-0 text-[12px] text-ink-2 p-2",children:"None"});return e.jsxs("div",{ref:C,className:"flex flex-col gap-4",children:[e.jsx("div",{role:"group","aria-label":"Outcomes",className:"grid grid-cols-6 rounded-lg border border-line bg-bg-1",children:te.map((a,u)=>e.jsxs("div",{className:`px-5 py-3 flex flex-col gap-0.5 ${u?"border-l border-line":""}`,children:[e.jsx("span",{className:"text-[12px] text-ink-1",children:a.label}),e.jsx("span",{className:"font-mono text-[20px]",children:a.value}),e.jsx("span",{className:"text-[11px] text-ink-2",children:a.note??""})]},a.label))}),l&&e.jsx("div",{children:e.jsx(je,{active:!0,onClick:()=>o(null),children:`${i.days[l.a]} – ${i.days[l.b]} ✕`})}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 items-start",children:[e.jsx(I,{name:"Open",note:`${q.length}`,children:P(q)}),e.jsx(I,{name:"Shipped",note:`${F.length}`,children:P(F)}),e.jsxs(I,{name:"Not shipped",note:E([...T,...O]),children:[e.jsxs("button",{type:"button","aria-expanded":_,onClick:()=>y(a=>!a),className:"text-left text-[12px] text-ink-1 hover:text-ink-0 px-1",children:[_?"Hide":"Show"," ",T.length," dropped · ",E(T)," spent"]}),_&&P(T),e.jsxs("button",{type:"button","aria-expanded":k,onClick:()=>m(a=>!a),className:"text-left text-[12px] text-ink-1 hover:text-ink-0 px-1",children:[k?"Hide":"Show"," ",O.length," explored · ",E(O)," spent"]}),k&&P(O)]})]}),e.jsxs("p",{className:"m-0 text-[11px] text-ink-2",children:["How a commit is tied to the work: ",me]}),e.jsxs("section",{className:"rounded-lg border border-line bg-bg-1 px-5 py-3 flex flex-col gap-3",children:[e.jsxs("button",{type:"button","aria-expanded":f,onClick:()=>g(a=>!a),className:"text-left flex items-center gap-2",children:[e.jsx("span",{"aria-hidden":!0,className:"text-[10px] text-ink-2",children:f?"▾":"▸"}),e.jsx("b",{className:"text-[13px]",children:"Daily output"}),e.jsx("span",{className:"text-[11px] text-ink-2",children:"drag across days to narrow the threads above"})]}),f&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(ge,{options:ke,value:j,onChange:h})}),e.jsx(ve,{table:se,chart:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(Z,{label:B.aria,days:i.days,values:B.values,format:B.format,sel:l,onSel:o},j),e.jsx(Z,{label:"Commits by day",days:i.days,values:i.commits,format:a=>`${a} commits`,sel:l,onSel:o,height:32,color:"#4fc59a"})]})})]})]})]})}const U=t=>new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),Ce=t=>new Date(`${t}T12:00:00`).toLocaleDateString([],{weekday:"long",month:"short",day:"numeric"}),A=(t,s)=>`${N(t)} ${s}${t===1?"":"s"}`;function X({options:t,value:s,onChange:n,label:r}){return e.jsx("div",{role:"group","aria-label":r,className:"inline-flex border border-line-2 rounded-md overflow-hidden text-[12px]",children:t.map(l=>e.jsx("button",{type:"button","aria-pressed":l.value===s,onClick:()=>n(l.value),className:`px-2.5 py-[5px] ${l.value===s?"bg-bg-3 text-ink-0":"text-ink-1 hover:text-ink-0"}`,children:l.label},l.value))})}function Ee({s:t,focused:s}){const[n,r]=d.useState(!1),l=n?t.commits:t.commits.slice(0,6);return e.jsxs("article",{"data-session-id":t.session_id,"data-focused":s,className:`rounded-lg border px-4 py-3 flex flex-col gap-2 ${s?"border-accent/60 bg-accent/10":"border-s1/30 bg-s1/5"}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] tracking-[0.12em] text-[#8ab8ff]",children:"CLAUDE SESSION"}),e.jsx("b",{className:"text-[13px] truncate",children:t.title??"Untitled session"}),t.branch&&e.jsx("span",{className:"font-mono text-[10px] px-1.5 rounded-full border border-line-2 text-ink-1",children:t.branch})]}),e.jsxs("span",{className:"text-[11px] text-ink-1",children:[U(t.first_ts)," → ",U(t.last_ts)," · ",t.model??"—"," · ",N(t.turns)," turns · ",D(t.output_tokens)," tokens · ",w(t.cost)," · ",M(t.active_ms,t.active_estimated),t.tool_errors>0&&` · ${t.tool_errors} tool errors`]})]}),e.jsx(W,{to:"/sessions/$id",params:{id:t.session_id},search:{tab:"overview"},className:"text-[12px] shrink-0",children:"Open session"})]}),t.commits.length>0&&e.jsxs("div",{className:"flex flex-col gap-1 border-t border-line pt-2 text-[12px]",children:[l.map(o=>e.jsxs("div",{className:"grid grid-cols-[64px_minmax(0,1fr)_auto_auto] gap-x-3 items-center",children:[e.jsx("span",{className:"font-mono text-ink-2",children:o.sha.slice(0,7)}),e.jsx("span",{className:"truncate",children:o.subject}),e.jsxs("span",{className:"font-mono text-[11px]",children:[e.jsxs("span",{className:"text-[#5fd3a6]",children:["+",N(o.added)]})," ",e.jsxs("span",{className:"text-[#e5707a]",children:["−",N(o.deleted)]})]}),e.jsx("span",{className:`text-[10px] px-1.5 rounded-full ${R(o.evidence).className}`,children:R(o.evidence).label})]},o.sha)),t.commits.length>6&&e.jsx("button",{type:"button",onClick:()=>r(o=>!o),className:"self-start text-[12px] text-accent-ink",children:n?"Show fewer":`Show ${t.commits.length-6} more commits`})]})]})}function De({commits:t}){const[s,n]=d.useState(!1);return e.jsxs("div",{className:"rounded-lg border border-line bg-bg-1",children:[e.jsxs("button",{type:"button","aria-expanded":s,onClick:()=>n(r=>!r),className:"w-full text-left px-4 py-2.5 text-[12px] text-ink-1 hover:text-ink-0 flex items-center gap-2",children:[e.jsx("span",{"aria-hidden":!0,className:"text-[10px]",children:s?"▾":"▸"}),e.jsxs("span",{children:[e.jsx("b",{className:"text-ink-0 font-medium",children:A(t.length,"commit")})," made outside Claude sessions (merges, manual commits)"]})]}),s&&e.jsx("div",{className:"px-4 pb-3 pl-9 flex flex-col gap-1 text-[12px]",children:t.map(r=>e.jsxs("div",{className:"grid grid-cols-[44px_64px_minmax(0,1fr)_auto] gap-x-3 items-center",children:[e.jsx("span",{className:"font-mono text-ink-2",children:U(r.authored_at)}),e.jsx("span",{className:"font-mono text-ink-2",children:r.sha.slice(0,7)}),e.jsx("span",{className:"truncate",children:r.subject}),e.jsxs("span",{className:"font-mono text-[11px]",children:[e.jsxs("span",{className:"text-[#5fd3a6]",children:["+",N(r.added)]})," ",e.jsxs("span",{className:"text-[#e5707a]",children:["−",N(r.deleted)]})]})]},r.sha))})]})}function Te({repo:t,days:s=30,focus:n}){const[r,l]=d.useState("all"),[o,j]=d.useState("mine"),[h,f]=d.useState(""),g=oe(t,{days:s},{kind:r,scope:o,branch:h||void 0}),_=new Set(n?n.split(","):[]),y=d.useRef(null);d.useEffect(()=>{y.current?.querySelector('[data-focused="true"]')?.scrollIntoView?.({block:"center",behavior:"smooth"})},[g.data,n]);const k=[...new Set([...(g.data?.days??[]).flatMap(m=>m.items.flatMap(c=>c.kind==="session"&&c.branch?[c.branch]:[])),...h?[h]:[]])].sort();return g.error?e.jsx(J,{error:g.error}):e.jsxs("div",{ref:y,className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx(X,{label:"Show",value:r,onChange:l,options:[{value:"all",label:"Everything"},{value:"sessions",label:"Claude sessions only"}]}),e.jsx(X,{label:"Authors",value:o,onChange:j,options:[{value:"mine",label:"You + Claude"},{value:"all",label:"All authors"}]}),e.jsxs("label",{className:"flex items-center gap-2 text-[12px] text-ink-1",children:["Branch",e.jsxs("select",{value:h,onChange:m=>f(m.target.value),className:"bg-bg-1 text-ink-0 border border-line-2 rounded-md px-2 py-1",children:[e.jsx("option",{value:"",children:"All branches"}),k.map(m=>e.jsx("option",{value:m,children:m},m))]})]})]}),g.data&&g.data.days.length===0&&e.jsx(he,{title:`Nothing in ${G(s)}`}),g.data?.days.map(m=>{const c=m.items.filter(x=>x.kind==="session"),S=m.items.filter(x=>x.kind==="commit"),b=S.length+c.reduce((x,p)=>x+p.commits.length,0),C=c.length?`${A(c.length,"session")} · ${D(c.reduce((x,p)=>x+p.output_tokens,0))} tokens · ${w(c.reduce((x,p)=>x+p.cost,0))} · ${A(b,"commit")}`:`no new Claude sessions · ${A(b,"commit")}`;return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-baseline gap-3 border-b border-line pb-1.5",children:[e.jsx("h3",{className:"m-0 text-[13px] font-semibold",children:Ce(m.day)}),e.jsx("span",{className:"text-[12px] text-ink-2",children:C})]}),c.map(x=>e.jsx(Ee,{s:x,focused:_.has(x.session_id)},x.session_id)),S.length>0&&e.jsx(De,{commits:S})]},m.day)})]})}const Oe=[{id:"threads",label:"Threads"},{id:"activity",label:"Activity"}];function Pe({project:t}){const s=t.folders.length;return e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap text-[11px] text-ink-2 -mb-2",children:[s>1&&e.jsxs("span",{className:"text-ink-1",children:[s," folders"]}),t.folders.map((n,r)=>e.jsxs("span",{className:"flex items-center gap-1.5",children:[(r>0||s>1)&&e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{className:`font-mono ${n.present?"":"line-through opacity-60"}`,title:n.present?n.root:`${n.root} (folder no longer exists)`,children:be(n.root)})]},n.id))]})}function We(){const{repo:t}=ie({from:"/projects/$repo"}),{tab:s,focus:n}=ce({from:"/projects/$repo"}),r=Number(t),[l,o]=d.useState(30),j=de().data?.projects.find(h=>h.folder_ids.includes(r));return e.jsxs(e.Fragment,{children:[e.jsx(xe,{crumbs:[{label:"Projects",to:"/projects"},j?.display_name??`#${t}`]}),e.jsxs(pe,{children:[j&&e.jsx(Pe,{project:j}),e.jsxs("nav",{className:"flex items-center gap-5 border-b border-line -mb-1",children:[Oe.map(h=>e.jsx(W,{to:"/projects/$repo",params:{repo:t},search:{tab:h.id},className:`pb-2 text-[13px] ${s===h.id?"text-ink-0 shadow-[inset_0_-2px_0_var(--color-accent)]":"text-ink-1 hover:text-ink-0"}`,children:h.label},h.id)),e.jsx("div",{className:"ml-auto pb-2",children:e.jsx(fe,{days:l,onChange:o})})]}),s==="threads"&&e.jsx($e,{repo:r,days:l,focus:n},l),s==="activity"&&e.jsx(Te,{repo:r,days:l,focus:n})]})]})}export{We as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as p,U as C,V as E,c as $,j as e,y,n as v,e as g}from"./index-kEmLC0Ll.js";import{T as O,P as T}from"./TopBar-l88js9Iq.js";import{P as q,p as b,E as N,T as R}from"./ThreadCard-3Ao_BW3U.js";import{E as W}from"./ErrorPanel-DWD9Fov9.js";import"./Chip-DX-VLUbj.js";const m=s=>s.tokens===0&&s.commits===0&&s.active_ms===0,w=8,k=(s,a)=>`${v(s)} ${a}${s===1?"":"s"}`;function A({o:s}){const a=s.shipped+s.open+s.dropped+s.explored||1,n=c=>`${c/a*100}%`;return e.jsxs("span",{className:"flex flex-col gap-1.5",children:[e.jsxs("span",{className:"flex h-2 rounded-sm overflow-hidden bg-bg-3","aria-hidden":!0,children:[e.jsx("span",{style:{width:n(s.shipped)},className:"bg-[#4fc59a]"}),e.jsx("span",{style:{width:n(s.open)},className:"bg-s1"}),e.jsx("span",{style:{width:n(s.dropped)},className:"bg-line-2"}),e.jsx("span",{style:{width:n(s.explored)},className:"bg-bg-3 border-l border-line-2"})]}),e.jsxs("span",{className:"text-[11px] text-ink-1",children:[s.shipped," shipped · ",s.open," open · ",s.dropped," dropped · ",s.explored," explored"]})]})}function h({label:s,value:a}){return e.jsxs("span",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[10px] tracking-[0.06em] text-ink-2",children:s}),e.jsx("span",{className:"font-mono text-[14px]",children:a})]})}function H({p:s,onOpen:a}){return e.jsxs("button",{type:"button",onClick:a,title:s.root,className:`text-left rounded-lg border border-line bg-bg-1 hover:bg-bg-2 p-4 flex flex-col gap-3 ${m(s)?"opacity-60":""}`,children:[e.jsxs("span",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("b",{className:"font-mono text-[14px] font-medium truncate",children:s.display_name}),e.jsx("span",{className:"text-[11px] text-ink-2 shrink-0",children:s.last_worked_at?y(s.last_worked_at):"—"})]}),!s.present&&e.jsx("span",{className:"text-[10px] text-ink-2",children:"repo gone · archived"}),s.last_error&&e.jsx("span",{className:"text-[10px] text-warn",title:s.last_error,children:"scan warning"}),e.jsx(A,{o:s.outcomes}),e.jsxs("span",{className:"grid grid-cols-3 gap-2 border-t border-line pt-2.5",children:[e.jsx(h,{label:"SPENT",value:g(s.cost)}),e.jsx(h,{label:"PER SHIPPED",value:s.cost_per_shipped===null?"—":g(s.cost_per_shipped)}),e.jsx(h,{label:"YOUR COMMITS",value:v(s.commits)})]})]})}function F(){const[s,a]=p.useState(30),[n,c]=p.useState(!1),[j,_]=p.useState(!1),d=C(s),l=E(s),P=$(),x=d.data?.projects??[],f=x.filter(t=>!m(t)),i=x.filter(m),r=l.data?.open??[],o=l.data?.counts,S=new Set(r.map(t=>t.project_id)).size,u=d.error??l.error;return e.jsxs(e.Fragment,{children:[e.jsx(O,{crumbs:["Work","Projects"],children:e.jsx(q,{days:s,onChange:a})}),e.jsx(T,{children:u?e.jsx(W,{error:u}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-end justify-between gap-6 flex-wrap",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("h1",{className:"text-[20px] font-semibold",children:r.length?`${k(r.length,"thread")} open across ${k(S,"project")}`:"Nothing open"}),e.jsx("p",{className:"text-[13px] text-ink-1",children:"A thread is a piece of work with Claude. It closes when it lands on main, or after 7 quiet days. One that edited no project file is explored: a question or a review."})]}),o&&e.jsxs("p",{className:"text-[12px] text-ink-2 whitespace-nowrap",children:[b(s)," · ",e.jsxs("b",{className:"text-[#5fd3a6] font-medium",children:[o.shipped," shipped"]})," · ",e.jsxs("b",{className:"text-[#8ab8ff] font-medium",children:[o.open," open"]})," · ",e.jsxs("b",{className:"text-ink-1 font-medium",children:[o.dropped," dropped"]})," · ",e.jsxs("b",{className:"text-ink-1 font-medium",children:[o.explored," explored"]})]})]}),l.data?.remote_as_of&&e.jsxs("p",{className:"text-[11px] text-ink-2 -mt-2",children:["Remote state as of your last fetch, ",y(l.data.remote_as_of),". Argus never fetches."]}),r.length===0&&!l.isLoading?e.jsx(N,{title:"Nothing open",hint:"Everything has shipped or gone quiet."}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-3",children:(j?r:r.slice(0,w)).map(t=>e.jsx(R,{t},t.key))}),r.length>w&&e.jsx("button",{type:"button",onClick:()=>_(t=>!t),className:"self-start text-[12px] text-accent-ink",children:j?"Show fewer":`Show all ${r.length}`})]}),e.jsxs("section",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("h2",{className:"m-0 text-[14px] font-semibold",children:"Projects"}),e.jsx("span",{className:"text-[12px] text-ink-2",children:"most recent first"})]}),!d.isLoading&&x.length===0?e.jsx(N,{title:"No repos found yet",hint:"The work scan runs every 5 minutes; `argus work scan` runs one now."}):e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(300px,1fr))] gap-3",children:(n?[...f,...i]:f).map(t=>e.jsx(H,{p:t,onOpen:()=>P({to:"/projects/$repo",params:{repo:String(t.id)},search:{tab:"threads"}})},t.id))}),i.length>0&&e.jsxs("button",{type:"button",onClick:()=>c(t=>!t),"aria-expanded":n,className:"self-start text-[12px] text-ink-1 hover:text-ink-0",children:[n?"Hide":"Show"," ",i.length," quiet project",i.length===1?"":"s",", no Claude activity in ",s===0?"all time":`the ${b(s)}`]})]})]})})]})}export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,r as i,k as P,l as I,m as E,o as F,q as L,v as T,I as $,d as b,L as C}from"./index-kEmLC0Ll.js";import{T as D,P as M}from"./TopBar-l88js9Iq.js";import{P as O}from"./Panel-Bp9ZgSnf.js";import{C as N}from"./Chip-DX-VLUbj.js";import{P as y,B as q}from"./Button-C6Vpou9C.js";import{d as B}from"./windows-B3y4OLGl.js";import{a as Q,b as R}from"./agents-CDuRxAZi.js";function A({values:s,width:a=120,height:r=28,className:o=""}){if(!s.length)return null;const n=Math.max(1,...s),j=s.length>1?(a-4)/(s.length-1):0,c=s.map((x,u)=>[2+u*j,r-2-x/n*(r-4)]),k=c.map((x,u)=>`${u?"L":"M"}${x[0].toFixed(1)} ${x[1].toFixed(1)}`).join(" "),h=c[c.length-1];return e.jsxs("svg",{className:o,width:a,height:r,viewBox:`0 0 ${a} ${r}`,"aria-hidden":"true",children:[e.jsx("path",{d:k,fill:"none",stroke:"#3987e5",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"}),e.jsx("circle",{cx:h[0],cy:h[1],r:3,fill:"#3987e5",stroke:"#10131a",strokeWidth:2})]})}function K(s){return s.replace(/<command-(name|message|args)>[\s\S]*?<\/command-\1>/g,"").replace(/<local-command-caveat>[\s\S]*?<\/local-command-caveat>/g,"").replace(/<\/?local-command-stdout>/g,"").replace(/\s+/g," ").trim()}function Y(s){const a=[],r=/<mark>([\s\S]*?)<\/mark>/g;let o=0,n;for(;n=r.exec(s);)n.index>o&&a.push({t:s.slice(o,n.index),m:!1}),a.push({t:n[1],m:!0}),o=r.lastIndex;return o<s.length&&a.push({t:s.slice(o),m:!1}),a}const W=[{k:"prompt",l:"Your prompts"},{k:"user",l:"Your replies"},{k:"assistant",l:"Assistant"},{k:"thinking",l:"Thinking"},{k:"tool_result",l:"Tool output"}],z={prompt:"good",user:"good",assistant:"info"},G=(s,a)=>s==="assistant"?a?Q(R(a)):"assistant":s==="prompt"||s==="user"?"you":s;function X(s,a=250){const[r,o]=i.useState(s);return i.useEffect(()=>{const n=setTimeout(()=>o(s),a);return()=>clearTimeout(n)},[s,a]),r}function se(){const[s,a]=i.useState(""),[r,o]=i.useState(""),[n,j]=i.useState(["prompt","user","assistant"]),[c,k]=i.useState(!1),h=X(s),x=P().data??[],u=I(),v=E(),w=F({mutationFn:L.searchIndexEnable,onSuccess:()=>v.invalidateQueries({queryKey:["searchIndex"]})}),S=h.trim().length>=2,d=T({q:h,limit:200,project:r||void 0,includeSlash:c,roles:n},S),f=i.useMemo(()=>d.data?.results??[],[d.data]),_=i.useMemo(()=>{const t=B(new Date,30),m=Object.fromEntries(t.map(l=>[l,0]));for(const l of f){const p=new Date(l.timestamp_ms),g=`${p.getFullYear()}-${String(p.getMonth()+1).padStart(2,"0")}-${String(p.getDate()).padStart(2,"0")}`;g in m&&m[g]++}return t.map(l=>m[l])},[f]);return e.jsxs(e.Fragment,{children:[e.jsx(D,{crumbs:["Search","Transcripts"]}),e.jsxs(M,{children:[e.jsx("p",{className:"text-ink-2 text-xs m-0",children:"Searches every prompt you typed and every transcript your agents wrote. 100% local — SQLite FTS5, no embeddings, no API calls."}),u.data&&!u.data.enabled&&e.jsxs("div",{className:"flex items-center gap-3 border border-warn/30 bg-warn/8 rounded-md px-3.5 py-2.5 text-xs",children:[e.jsx(y,{kind:"warn",children:"INDEXING OFF"}),e.jsx("span",{className:"text-ink-1",children:"Only your prompts are searchable. Enable transcript indexing to search agent replies and tool output."}),e.jsx(q,{className:"ml-auto",onClick:()=>w.mutate(),children:"Enable indexing"})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("label",{className:"flex items-center gap-2 h-8 px-2.5 border border-line-2 rounded-md flex-1 min-w-72 text-ink-2",children:[e.jsx($,{name:"search",size:13}),e.jsx("input",{autoFocus:!0,value:s,onChange:t=>a(t.target.value),placeholder:"Search…",className:"bg-transparent outline-none text-ink-0 text-sm w-full placeholder:text-ink-2"})]}),e.jsxs("select",{value:r,onChange:t=>o(t.target.value),className:"h-8 bg-bg-2 border border-line-2 rounded-md text-xs text-ink-1 px-2 max-w-72",children:[e.jsx("option",{value:"",children:"All projects"}),x.map(t=>e.jsx("option",{value:t,children:b(t,60)},t))]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap text-xs",children:[e.jsx("span",{className:"text-ink-2",children:"Show:"}),W.map(t=>e.jsx(N,{active:n.includes(t.k),onClick:()=>j(n.includes(t.k)?n.filter(m=>m!==t.k):[...n,t.k]),children:t.l},t.k)),e.jsx(N,{active:c,onClick:()=>k(!c),children:"Include slash commands"}),d.data&&e.jsxs("span",{className:"ml-auto flex items-center gap-3 font-mono text-[11px] text-ink-2",children:[d.data.total," matches · ",d.data.prompt_total," prompts · ",d.data.transcript_total," transcript",e.jsx("span",{title:"hits per day, last 30 days",children:e.jsx(A,{values:_})})]})]}),e.jsxs(O,{padded:!1,className:"grow",children:[f.length===0&&e.jsx("div",{className:"text-center text-ink-2 py-10",children:S?d.isFetching?"Searching…":"No matches.":"Type at least two characters to search."}),f.map((t,m)=>{const l=K(t.snippet||t.text);return l?e.jsxs("div",{className:"grid grid-cols-[90px_1fr_160px] gap-3 px-3.5 py-2.5 border-b border-line items-start",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(y,{kind:z[t.role]??"mute",icon:!1,children:G(t.role,t.session_id)}),e.jsx("span",{className:"font-mono text-[10px] text-ink-2",children:new Date(t.timestamp_ms).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),e.jsxs("div",{className:"text-xs leading-relaxed break-words",children:[Y(l).map((p,g)=>p.m?e.jsx("mark",{className:"bg-accent/25 text-ink-0 rounded-sm px-0.5",children:p.t},g):e.jsx("span",{children:p.t},g)),t.pasted_chars>0&&e.jsxs("span",{className:"text-ink-2 font-mono text-[10px] ml-2",children:["+",t.pasted_chars," pasted chars"]})]}),e.jsxs("div",{className:"text-right flex flex-col gap-1 items-end min-w-0",children:[e.jsx("span",{className:"font-mono text-[11px] text-ink-2 truncate max-w-full",title:t.project_path??"",children:t.project_path?b(t.project_path):""}),t.session_id&&e.jsx(C,{to:"/sessions/$id",params:{id:t.session_id},search:{tab:"overview"},className:"text-[11px]",children:"Open session →"})]})]},m):null})]})]})]})}export{se as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as n}from"./index-kEmLC0Ll.js";function i({options:r,value:t,onChange:l}){return n.jsx("div",{role:"tablist",className:"inline-flex border border-line-2 rounded-md overflow-hidden font-mono text-[11px]",children:r.map(e=>n.jsx("button",{role:"tab",type:"button","aria-selected":e.value===t,onClick:()=>l(e.value),className:`px-2.5 py-[5px] whitespace-nowrap ${e.value===t?"bg-bg-3 text-ink-0":"text-ink-1 hover:text-ink-0"}`,children:e.label},e.value))})}export{i as S};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as g,j as e,I as T,t as S,
|
|
2
|
-
Click to copy${o?` (use with: ${o})`:""}`})(),className:`inline-flex items-center gap-1.5 font-mono text-[11px] px-1.5 h-5 rounded-sm border transition-colors ${m?"text-good border-good/40 bg-good/10":"text-ink-1 bg-bg-3 border-transparent hover:border-line-2 hover:text-ink-0"}`,children:[m?e.jsx(T,{name:"check",size:10}):null,m?"copied":a?d.slice(0,a):"copy"]})}function Q({turns:t,onPick:a,active:m}){const x=Math.max(1,t.length),d=1160,l=96,o=80,u=(d-8)/x,n=Math.max(2,Math.min(46,u-3)),h=Math.max(1,...t.map(R)),b=x>60?10:5;return e.jsxs("svg",{width:"100%",viewBox:`0 0 ${d} ${l}`,role:"img","aria-label":"Tokens per turn",className:"block w-full",style:{aspectRatio:`${d} / ${l}`},children:[e.jsx("line",{x1:0,y1:o,x2:d,y2:o,stroke:"#232934"}),t.map((c,p)=>{const j=4+p*u,y=R(c)/h*70,$=O(c)/h*70,r=P(c);return e.jsxs("g",{"data-turn":c.sequence,onClick:()=>a(c.sequence),className:"cursor-pointer",children:[e.jsx("title",{children:`#${c.sequence} · ${S(O(c))} fresh+output · ${S(c.cache_read_tokens)} cache read`}),m===c.sequence&&e.jsx("rect",{x:j-2,y:2,width:n+4,height:o-2,fill:"none",stroke:"#f0883e"}),e.jsx("rect",{x:j,y:o-y,width:n,height:y,fill:"#1f3c63"}),e.jsx("rect",{"data-kind":"top",x:j,y:o-y,width:n,height:Math.max(2,$),rx:1,fill:r?"#d03b3b":"#3987e5"}),(p%b===0||p===t.length-1)&&e.jsx("text",{x:j+n/2,y:l-2,fontSize:10,textAnchor:"middle",fill:r?"#ff7a7a":"#667184",fontFamily:"var(--font-mono)",children:c.sequence})]},c.sequence)})]})}function de({session:t,turns:a}){const m=Intl.DateTimeFormat().resolvedOptions().timeZone,x=[["Project",t.project_path],["Primary model",t.primary_model],[z(t.agent),t.agent_version??"—"],["Started",`${C(t.started_at)} (${m})`],["Ended",t.ended_at?C(t.ended_at):"running"],["Fresh input",`${f(t.total_fresh_input_tokens)} tokens`],["Output",`${f(t.total_output_tokens)} tokens`],["Cache writes",`${f(t.total_cache_write_tokens)} tokens`],["Cache reads",`${f(t.total_cache_read_tokens)} tokens`],["Pricing version",t.pricing_table_version]],d=oe(a);return e.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-3",children:[e.jsx(w,{title:"Session",padded:!1,children:e.jsxs("dl",{className:"grid grid-cols-[140px_1fr] text-xs m-0",children:[x.map(([l,o])=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"px-3.5 py-2 border-b border-line text-ink-1",children:l}),e.jsx("dd",{className:"px-3.5 py-2 border-b border-line font-mono m-0 break-all",children:o})]},l)),e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"px-3.5 py-2 border-b border-line text-ink-1",children:"Session id"}),e.jsxs("dd",{className:"px-3.5 py-2 border-b border-line font-mono m-0 break-all flex items-center gap-2",children:[e.jsx("span",{children:t.id}),e.jsx(I,{value:t.id,chars:0})]})]})]})}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(w,{title:"Tool mix",sub:"calls · red segment = errors",children:d.length?e.jsx(U,{rows:d,format:f}):e.jsx("div",{className:"text-ink-2 text-center py-4",children:"No tool calls."})}),e.jsx(w,{title:"Cache ratio per turn",sub:"share of each turn read from cache",children:e.jsx("svg",{className:"block w-full",viewBox:"0 0 1000 48",preserveAspectRatio:"none",style:{aspectRatio:"1000 / 48"},role:"img","aria-label":"Cache ratio per turn",children:a.map((l,o)=>{const u=1e3/Math.max(1,a.length),n=ae(l);return e.jsxs("g",{children:[e.jsx("title",{children:`#${l.sequence} · ${Math.round(n*100)}%`}),e.jsx("rect",{x:o*u,y:0,width:Math.max(.5,u-.5),height:48,fill:"#1d222c"}),e.jsx("rect",{x:o*u,y:48-n*48,width:Math.max(.5,u-.5),height:n*48,fill:"#3987e5"})]},l.sequence)})})})]})]})}const v=t=>t.total_tokens??t.tokens.fresh_input+t.tokens.output+t.tokens.cache_read+t.tokens.cache_write,xe=t=>t.tool_calls??t.tools.reduce((a,m)=>a+m.count,0);function me({subs:t,selected:a,onPick:m}){const l=Math.max(1,t.length),o=300/l,u=Math.max(1,o-(l>80?.5:1)),n=Math.max(1,...t.map(v));return e.jsx("svg",{className:"block w-full",viewBox:"0 0 300 40",preserveAspectRatio:"none",style:{aspectRatio:"300 / 40"},role:"img","aria-label":"Tokens per sub-agent",children:t.map((h,b)=>{const c=Math.max(2,v(h)/n*36),p=h.id===a;return e.jsxs("g",{onClick:()=>m(h.id),className:"cursor-pointer",children:[e.jsx("title",{children:`#${b+1} · ${S(v(h))} · ${h.errors} errors`}),e.jsx("rect",{x:b*o,y:0,width:u,height:40,fill:p?"rgba(240,136,62,0.18)":"transparent"}),e.jsx("rect",{x:b*o,y:40-c,width:u,height:c,fill:h.errors?"#d03b3b":p?"#ffb177":"#3987e5"})]},h.id)})})}function ue({sa:t,index:a}){const m=D(t.id),x=g.useMemo(()=>W(m.data?.turns??[]),[m.data]),[d,l]=g.useState(),o=v(t),u=n=>{l(n),requestAnimationFrame(()=>document.getElementById(`turn-${n}`)?.scrollIntoView({block:"center"}))};return e.jsxs("div",{className:"flex flex-col gap-3 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-ink-1",children:[e.jsxs("span",{className:"font-mono text-ink-2",children:["#",a+1]}),e.jsx(E,{kind:t.status==="ok"?"good":"crit",children:t.status==="ok"?"OK":`${t.errors} ERR`}),e.jsx("span",{className:"font-mono text-[11px] text-ink-1 bg-bg-3 px-1.5 rounded-sm",children:t.model}),e.jsx(I,{value:t.id}),e.jsx(X,{to:"/sessions/$id",params:{id:t.id},search:{tab:"timeline"},className:"ml-auto text-[11px]",children:"Open as its own session →"})]}),e.jsxs("div",{className:"grid grid-cols-5 gap-3",children:[e.jsx(_,{label:"Tokens",value:S(o),sub:`${B(o?t.tokens.cache_read/o:0,0)} cache read`}),e.jsx(_,{label:"Estimated cost",value:M(t.cost_usd??0)}),e.jsx(_,{label:"Turns",value:f(t.turns),sub:`${f(xe(t))} tool calls`}),e.jsx(_,{label:"Duration",value:F(t.duration_sec??null)}),e.jsx(_,{label:"Tool errors",value:f(t.errors),tone:t.errors?"crit":"default",sub:t.errors?"see red turns below":"none"})]}),e.jsx(w,{title:"Task given",sub:"first user message to the sub-agent",children:t.task_given?e.jsx("p",{className:"m-0 text-xs leading-relaxed whitespace-pre-wrap break-words max-h-40 overflow-auto",children:t.task_given}):e.jsx("span",{className:"text-ink-2 text-xs",children:"Not available — enable transcript indexing in Settings to keep sub-agent prompts."})}),e.jsxs("div",{className:"grid grid-cols-[1fr_2fr] gap-3",children:[e.jsx(w,{title:"Tools used",sub:"calls · red = errors",children:t.tools.length?e.jsx(U,{rows:t.tools.map(n=>({name:n.name,value:n.count,error:n.errors})),format:f}):e.jsx("div",{className:"text-ink-2 text-center py-4",children:"No tool calls recorded."})}),e.jsx(w,{title:"Sub-agent shape",sub:"tokens per turn · click to jump",right:e.jsx(K,{names:["fresh + output","cache read","tool error"],colors:["#3987e5","#1f3c63","#d03b3b"]}),children:x.length?e.jsx(Q,{turns:x,onPick:u,active:d}):m.isLoading?e.jsx(A,{w:"100%",h:"96px"}):e.jsx("div",{className:"text-ink-2 text-center py-4",children:"No turns recorded."})})]}),e.jsx(V,{id:t.id,turns:x,active:d})]})}function he({subs:t}){const[a,m]=g.useState(null),[x,d]=g.useState(""),[l,o]=g.useState(!1),[u,n]=g.useState("order"),h=g.useRef(null),b=g.useMemo(()=>new Map(t.map((s,k)=>[s.id,k])),[t]),c=g.useMemo(()=>{const s=x.trim().toLowerCase(),k=t.filter(i=>(!l||i.errors>0)&&(!s||(i.task_given??"").toLowerCase().includes(s)||i.model.toLowerCase().includes(s)));return u==="tokens"&&k.sort((i,N)=>v(N)-v(i)),u==="errors"&&k.sort((i,N)=>N.errors-i.errors||v(N)-v(i)),k},[t,x,l,u]),p=t.find(s=>s.id===a)??c[0]??t[0],j=s=>{m(s),document.getElementById("page-scroll")?.scrollTo({top:0,behavior:"smooth"}),h.current?.querySelector(`[data-sa="${CSS.escape(s)}"]`)?.scrollIntoView({block:"nearest"})},y=s=>{if(!p||s.key!=="ArrowDown"&&s.key!=="ArrowUp"&&s.key!=="j"&&s.key!=="k")return;const k=c.findIndex(N=>N.id===p.id),i=c[Math.max(0,Math.min(c.length-1,k+(s.key==="ArrowDown"||s.key==="j"?1:-1)))];i&&j(i.id),s.preventDefault()};if(g.useEffect(()=>{a&&!t.some(s=>s.id===a)&&m(null)},[t,a]),!t.length)return e.jsx(w,{title:"Sub-agents",children:e.jsx("div",{className:"text-ink-2 text-center py-6",children:"This session did not spawn sub-agents."})});if(!p)return null;const $=Math.max(1,...t.map(v)),r=t.filter(s=>s.errors>0).length;return e.jsxs("div",{className:"grid grid-cols-[340px_1fr] gap-3 items-start",children:[e.jsxs(w,{title:"Sub-agents",sub:`${t.length}${r?` · ${r} with errors`:""}`,padded:!1,className:"sticky top-0 max-h-[calc(100vh-7.5rem)]",children:[e.jsxs("div",{className:"px-3.5 pt-3 pb-2 border-b border-line flex flex-col gap-2 shrink-0",children:[e.jsx(me,{subs:t,selected:p.id,onPick:j}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsxs("label",{className:"flex items-center gap-1.5 h-6 px-2 border border-line-2 rounded-md text-ink-2 flex-1 min-w-28",children:[e.jsx(T,{name:"search",size:11}),e.jsx("input",{value:x,onChange:s=>d(s.target.value),placeholder:"Filter tasks",className:"bg-transparent outline-none text-ink-0 text-[11px] w-full placeholder:text-ink-2"})]}),e.jsx(ce,{active:l,onClick:()=>o(!l),children:"Errors"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(H,{options:[{value:"order",label:"order"},{value:"tokens",label:"tokens"},{value:"errors",label:"errors"}],value:u,onChange:n}),e.jsxs("span",{className:"ml-auto font-mono text-[10px] text-ink-2",children:["↑↓ to step · ",c.length," shown"]})]})]}),e.jsxs("div",{ref:h,tabIndex:0,onKeyDown:y,className:"overflow-auto min-h-0 flex-1 outline-none focus-visible:shadow-[inset_0_0_0_1px_var(--color-accent)]",children:[c.map(s=>{const k=b.get(s.id)??0,i=s.id===p.id;return e.jsxs("button",{type:"button","data-sa":s.id,onClick:()=>j(s.id),title:s.task_given??void 0,className:`w-full text-left px-3.5 h-[34px] border-b border-line flex items-center gap-2 hover:bg-bg-2 ${i?"bg-bg-2 shadow-[inset_2px_0_0_var(--color-accent)]":""}`,children:[e.jsxs("span",{className:"font-mono text-[11px] text-ink-2 w-8 shrink-0",children:["#",k+1]}),s.errors?e.jsxs("span",{className:"text-crit-ink inline-flex items-center gap-0.5 font-mono text-[11px] w-8 shrink-0",children:[e.jsx(T,{name:"x",size:9}),s.errors]}):e.jsx("span",{className:"text-good inline-flex items-center w-8 shrink-0",children:e.jsx(T,{name:"check",size:10})}),e.jsx("span",{className:"text-[11px] text-ink-1 truncate flex-1 min-w-0",children:s.task_given?s.task_given.replace(/\s+/g," "):e.jsx("span",{className:"text-ink-2",children:s.model})}),e.jsx("span",{className:"relative h-1.5 w-14 shrink-0 rounded-sm bg-bg-3 overflow-hidden",children:e.jsx("i",{className:"absolute inset-y-0 left-0 bg-s1 rounded-r-sm",style:{width:`${v(s)/$*100}%`}})}),e.jsx("span",{className:"font-mono num text-[11px] w-12 text-right shrink-0",children:S(v(s))})]},s.id)}),c.length===0&&e.jsx("div",{className:"text-ink-2 text-center py-6 text-xs",children:"No sub-agents match."})]})]}),e.jsx(ue,{sa:p,index:b.get(p.id)??0},p.id)]})}function Se(){const{id:t}=Y({from:"/sessions/$id"}),{tab:a}=Z({from:"/sessions/$id"}),m=G(),x=J(t),d=D(t),l=ee(t),[o,u]=g.useState(),n=g.useMemo(()=>W(d.data?.turns??[]),[d.data]),h=n.filter(P).length,b=g.useMemo(()=>le(n),[n]),c=g.useMemo(()=>[{name:"cumulative cost",values:b}],[b]),p=g.useMemo(()=>n.map(i=>`#${i.sequence}`),[n]),j=i=>m({to:"/sessions/$id",params:{id:t},search:{tab:i}}),y=i=>{u(i),a!=="timeline"&&j("timeline"),requestAnimationFrame(()=>document.getElementById(`turn-${i}`)?.scrollIntoView({block:"center"}))},$=["Analyze",{label:"Sessions",to:"/sessions"},x.data?te(x.data.session.project_path,30):"…"];if(x.error)return e.jsxs(e.Fragment,{children:[e.jsx(L,{crumbs:[...$]}),e.jsx(q,{children:e.jsx(se,{error:x.error})})]});const r=x.data?.session,s=r?r.total_fresh_input_tokens+r.total_output_tokens+r.total_cache_read_tokens+r.total_cache_write_tokens:0,k=n.reduce((i,N)=>i+N.tool_calls.length,0);return e.jsxs(e.Fragment,{children:[e.jsxs(L,{crumbs:[...$],children:[e.jsx(I,{value:t}),e.jsx(H,{options:[{value:"overview",label:"Overview"},{value:"timeline",label:"Timeline"},{value:"subagents",label:`Sub-agents · ${l.data?.length??0}`}],value:a,onChange:j}),r&&e.jsx(E,{kind:"mute",children:r.primary_model}),r?.agent_version&&e.jsxs(E,{kind:"mute",children:[z(r.agent)," ",r.agent_version]})]}),e.jsxs(q,{children:[r?e.jsxs("div",{className:"grid grid-cols-5 gap-3",children:[e.jsx(_,{label:"Tokens",value:S(s),sub:`${f(s)} · ${B(s?r.total_cache_read_tokens/s:0,0)} cache read`}),e.jsx(_,{label:"Estimated cost",value:M(r.total_cost_usd),sub:r.turn_count?`${M(r.total_cost_usd/r.turn_count)} / turn`:void 0}),e.jsx(_,{label:"Turns",value:n.length?f(n.length):f(r.turn_count),sub:`${f(k)} tool calls`,note:n.length&&n.length!==r.turn_count?`${f(r.turn_count)} raw`:void 0}),e.jsx(_,{label:"Duration",value:r.ended_at?F(r.duration_sec):"live",sub:C(r.started_at)}),e.jsx(_,{label:"Tool errors",value:String(h),tone:h?"crit":"default",sub:h?`first at turn #${n.find(P)?.sequence}`:"none"})]}):e.jsx(A,{w:"100%",h:"80px"}),e.jsx(w,{title:"Session shape",sub:"tokens per turn · click to jump",right:e.jsx(K,{names:["fresh + output","cache read","tool error"],colors:["#3987e5","#1f3c63","#d03b3b"]}),children:n.length?e.jsxs(e.Fragment,{children:[e.jsx(Q,{turns:n,onPick:y,active:o}),e.jsx("div",{className:"mt-2",children:e.jsx(ie,{labels:p,series:c,format:i=>i===0?"$0":M(i),height:110})})]}):d.isLoading?e.jsx(A,{w:"100%",h:"96px"}):e.jsx("div",{className:"text-ink-2 text-center py-4",children:"No turns recorded."})}),a==="overview"&&r&&e.jsx(de,{session:r,turns:n}),a==="timeline"&&e.jsx(V,{id:t,turns:n,active:o}),a==="subagents"&&e.jsx(he,{subs:l.data??[]})]})]})}export{Se as default};
|
|
1
|
+
import{r as g,j as e,I as T,t as S,a2 as C,n as f,a3 as D,L as Z,p as B,e as M,a1 as F,S as A,_ as G,$ as J,c as X,a4 as Y,a5 as ee,d as te}from"./index-kEmLC0Ll.js";import{T as L,P as q}from"./TopBar-l88js9Iq.js";import{S as H}from"./Seg-BhkJzldV.js";import{T as _}from"./Tile-BF8_h63E.js";import{P as E}from"./Button-C6Vpou9C.js";import{P as w}from"./Panel-Bp9ZgSnf.js";import{E as se}from"./ErrorPanel-DWD9Fov9.js";import{r as ne,b as re,c as z}from"./agents-CDuRxAZi.js";import{a as O,b as R,c as P,d as oe,e as ae,o as W,T as K,f as le}from"./TimelineTab-T9CBXijX.js";import{A as ie}from"./AreaLine-C2pbmMiI.js";import{L as V}from"./uplotTheme-DVpHp5Uh.js";import{B as Q}from"./Bars-BM1Q9Juw.js";import{C as ce}from"./Chip-DX-VLUbj.js";import"./cumulative-C3-3HW0n.js";function I({value:t,chars:a=8}){const[m,x]=g.useState(!1),d=t.includes(":")?t.slice(t.indexOf(":")+1):t,l=async()=>{try{await navigator.clipboard.writeText(d),x(!0),setTimeout(()=>x(!1),1400)}catch{window.prompt("Copy the session id",d)}};return e.jsxs("button",{type:"button",onClick:l,title:(()=>{const o=ne(re(t),d);return`Session id ${d}
|
|
2
|
+
Click to copy${o?` (use with: ${o})`:""}`})(),className:`inline-flex items-center gap-1.5 font-mono text-[11px] px-1.5 h-5 rounded-sm border transition-colors ${m?"text-good border-good/40 bg-good/10":"text-ink-1 bg-bg-3 border-transparent hover:border-line-2 hover:text-ink-0"}`,children:[m?e.jsx(T,{name:"check",size:10}):null,m?"copied":a?d.slice(0,a):"copy"]})}function U({turns:t,onPick:a,active:m}){const x=Math.max(1,t.length),d=1160,l=96,o=80,u=(d-8)/x,n=Math.max(2,Math.min(46,u-3)),h=Math.max(1,...t.map(O)),b=x>60?10:5;return e.jsxs("svg",{width:"100%",viewBox:`0 0 ${d} ${l}`,role:"img","aria-label":"Tokens per turn",className:"block w-full",style:{aspectRatio:`${d} / ${l}`},children:[e.jsx("line",{x1:0,y1:o,x2:d,y2:o,stroke:"#232934"}),t.map((c,p)=>{const j=4+p*u,y=O(c)/h*70,$=R(c)/h*70,r=P(c);return e.jsxs("g",{"data-turn":c.sequence,onClick:()=>a(c.sequence),className:"cursor-pointer",children:[e.jsx("title",{children:`#${c.sequence} · ${S(R(c))} fresh+output · ${S(c.cache_read_tokens)} cache read`}),m===c.sequence&&e.jsx("rect",{x:j-2,y:2,width:n+4,height:o-2,fill:"none",stroke:"#f0883e"}),e.jsx("rect",{x:j,y:o-y,width:n,height:y,fill:"#1f3c63"}),e.jsx("rect",{"data-kind":"top",x:j,y:o-y,width:n,height:Math.max(2,$),rx:1,fill:r?"#d03b3b":"#3987e5"}),(p%b===0||p===t.length-1)&&e.jsx("text",{x:j+n/2,y:l-2,fontSize:10,textAnchor:"middle",fill:r?"#ff7a7a":"#667184",fontFamily:"var(--font-mono)",children:c.sequence})]},c.sequence)})]})}function de({session:t,turns:a}){const m=Intl.DateTimeFormat().resolvedOptions().timeZone,x=[["Project",t.project_path],["Primary model",t.primary_model],[z(t.agent),t.agent_version??"—"],["Started",`${C(t.started_at)} (${m})`],["Ended",t.ended_at?C(t.ended_at):"running"],["Fresh input",`${f(t.total_fresh_input_tokens)} tokens`],["Output",`${f(t.total_output_tokens)} tokens`],["Cache writes",`${f(t.total_cache_write_tokens)} tokens`],["Cache reads",`${f(t.total_cache_read_tokens)} tokens`],["Pricing version",t.pricing_table_version]],d=oe(a);return e.jsxs("div",{className:"grid grid-cols-[1fr_1fr] gap-3",children:[e.jsx(w,{title:"Session",padded:!1,children:e.jsxs("dl",{className:"grid grid-cols-[140px_1fr] text-xs m-0",children:[x.map(([l,o])=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"px-3.5 py-2 border-b border-line text-ink-1",children:l}),e.jsx("dd",{className:"px-3.5 py-2 border-b border-line font-mono m-0 break-all",children:o})]},l)),e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"px-3.5 py-2 border-b border-line text-ink-1",children:"Session id"}),e.jsxs("dd",{className:"px-3.5 py-2 border-b border-line font-mono m-0 break-all flex items-center gap-2",children:[e.jsx("span",{children:t.id}),e.jsx(I,{value:t.id,chars:0})]})]})]})}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(w,{title:"Tool mix",sub:"calls · red segment = errors",children:d.length?e.jsx(Q,{rows:d,format:f}):e.jsx("div",{className:"text-ink-2 text-center py-4",children:"No tool calls."})}),e.jsx(w,{title:"Cache ratio per turn",sub:"share of each turn read from cache",children:e.jsx("svg",{className:"block w-full",viewBox:"0 0 1000 48",preserveAspectRatio:"none",style:{aspectRatio:"1000 / 48"},role:"img","aria-label":"Cache ratio per turn",children:a.map((l,o)=>{const u=1e3/Math.max(1,a.length),n=ae(l);return e.jsxs("g",{children:[e.jsx("title",{children:`#${l.sequence} · ${Math.round(n*100)}%`}),e.jsx("rect",{x:o*u,y:0,width:Math.max(.5,u-.5),height:48,fill:"#1d222c"}),e.jsx("rect",{x:o*u,y:48-n*48,width:Math.max(.5,u-.5),height:n*48,fill:"#3987e5"})]},l.sequence)})})})]})]})}const v=t=>t.total_tokens??t.tokens.fresh_input+t.tokens.output+t.tokens.cache_read+t.tokens.cache_write,xe=t=>t.tool_calls??t.tools.reduce((a,m)=>a+m.count,0);function me({subs:t,selected:a,onPick:m}){const l=Math.max(1,t.length),o=300/l,u=Math.max(1,o-(l>80?.5:1)),n=Math.max(1,...t.map(v));return e.jsx("svg",{className:"block w-full",viewBox:"0 0 300 40",preserveAspectRatio:"none",style:{aspectRatio:"300 / 40"},role:"img","aria-label":"Tokens per sub-agent",children:t.map((h,b)=>{const c=Math.max(2,v(h)/n*36),p=h.id===a;return e.jsxs("g",{onClick:()=>m(h.id),className:"cursor-pointer",children:[e.jsx("title",{children:`#${b+1} · ${S(v(h))} · ${h.errors} errors`}),e.jsx("rect",{x:b*o,y:0,width:u,height:40,fill:p?"rgba(240,136,62,0.18)":"transparent"}),e.jsx("rect",{x:b*o,y:40-c,width:u,height:c,fill:h.errors?"#d03b3b":p?"#ffb177":"#3987e5"})]},h.id)})})}function ue({sa:t,index:a}){const m=D(t.id),x=g.useMemo(()=>W(m.data?.turns??[]),[m.data]),[d,l]=g.useState(),o=v(t),u=n=>{l(n),requestAnimationFrame(()=>document.getElementById(`turn-${n}`)?.scrollIntoView({block:"center"}))};return e.jsxs("div",{className:"flex flex-col gap-3 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-ink-1",children:[e.jsxs("span",{className:"font-mono text-ink-2",children:["#",a+1]}),e.jsx(E,{kind:t.status==="ok"?"good":"crit",children:t.status==="ok"?"OK":`${t.errors} ERR`}),e.jsx("span",{className:"font-mono text-[11px] text-ink-1 bg-bg-3 px-1.5 rounded-sm",children:t.model}),e.jsx(I,{value:t.id}),e.jsx(Z,{to:"/sessions/$id",params:{id:t.id},search:{tab:"timeline"},className:"ml-auto text-[11px]",children:"Open as its own session →"})]}),e.jsxs("div",{className:"grid grid-cols-5 gap-3",children:[e.jsx(_,{label:"Tokens",value:S(o),sub:`${B(o?t.tokens.cache_read/o:0,0)} cache read`}),e.jsx(_,{label:"Estimated cost",value:M(t.cost_usd??0)}),e.jsx(_,{label:"Turns",value:f(t.turns),sub:`${f(xe(t))} tool calls`}),e.jsx(_,{label:"Duration",value:F(t.duration_sec??null)}),e.jsx(_,{label:"Tool errors",value:f(t.errors),tone:t.errors?"crit":"default",sub:t.errors?"see red turns below":"none"})]}),e.jsx(w,{title:"Task given",sub:"first user message to the sub-agent",children:t.task_given?e.jsx("p",{className:"m-0 text-xs leading-relaxed whitespace-pre-wrap break-words max-h-40 overflow-auto",children:t.task_given}):e.jsx("span",{className:"text-ink-2 text-xs",children:"Not available — enable transcript indexing in Settings to keep sub-agent prompts."})}),e.jsxs("div",{className:"grid grid-cols-[1fr_2fr] gap-3",children:[e.jsx(w,{title:"Tools used",sub:"calls · red = errors",children:t.tools.length?e.jsx(Q,{rows:t.tools.map(n=>({name:n.name,value:n.count,error:n.errors})),format:f}):e.jsx("div",{className:"text-ink-2 text-center py-4",children:"No tool calls recorded."})}),e.jsx(w,{title:"Sub-agent shape",sub:"tokens per turn · click to jump",right:e.jsx(V,{names:["fresh + output","cache read","tool error"],colors:["#3987e5","#1f3c63","#d03b3b"]}),children:x.length?e.jsx(U,{turns:x,onPick:u,active:d}):m.isLoading?e.jsx(A,{w:"100%",h:"96px"}):e.jsx("div",{className:"text-ink-2 text-center py-4",children:"No turns recorded."})})]}),e.jsx(K,{id:t.id,turns:x,active:d})]})}function he({subs:t}){const[a,m]=g.useState(null),[x,d]=g.useState(""),[l,o]=g.useState(!1),[u,n]=g.useState("order"),h=g.useRef(null),b=g.useMemo(()=>new Map(t.map((s,k)=>[s.id,k])),[t]),c=g.useMemo(()=>{const s=x.trim().toLowerCase(),k=t.filter(i=>(!l||i.errors>0)&&(!s||(i.task_given??"").toLowerCase().includes(s)||i.model.toLowerCase().includes(s)));return u==="tokens"&&k.sort((i,N)=>v(N)-v(i)),u==="errors"&&k.sort((i,N)=>N.errors-i.errors||v(N)-v(i)),k},[t,x,l,u]),p=t.find(s=>s.id===a)??c[0]??t[0],j=s=>{m(s),document.getElementById("page-scroll")?.scrollTo({top:0,behavior:"smooth"}),h.current?.querySelector(`[data-sa="${CSS.escape(s)}"]`)?.scrollIntoView({block:"nearest"})},y=s=>{if(!p||s.key!=="ArrowDown"&&s.key!=="ArrowUp"&&s.key!=="j"&&s.key!=="k")return;const k=c.findIndex(N=>N.id===p.id),i=c[Math.max(0,Math.min(c.length-1,k+(s.key==="ArrowDown"||s.key==="j"?1:-1)))];i&&j(i.id),s.preventDefault()};if(g.useEffect(()=>{a&&!t.some(s=>s.id===a)&&m(null)},[t,a]),!t.length)return e.jsx(w,{title:"Sub-agents",children:e.jsx("div",{className:"text-ink-2 text-center py-6",children:"This session did not spawn sub-agents."})});if(!p)return null;const $=Math.max(1,...t.map(v)),r=t.filter(s=>s.errors>0).length;return e.jsxs("div",{className:"grid grid-cols-[340px_1fr] gap-3 items-start",children:[e.jsxs(w,{title:"Sub-agents",sub:`${t.length}${r?` · ${r} with errors`:""}`,padded:!1,className:"sticky top-0 max-h-[calc(100vh-7.5rem)]",children:[e.jsxs("div",{className:"px-3.5 pt-3 pb-2 border-b border-line flex flex-col gap-2 shrink-0",children:[e.jsx(me,{subs:t,selected:p.id,onPick:j}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsxs("label",{className:"flex items-center gap-1.5 h-6 px-2 border border-line-2 rounded-md text-ink-2 flex-1 min-w-28",children:[e.jsx(T,{name:"search",size:11}),e.jsx("input",{value:x,onChange:s=>d(s.target.value),placeholder:"Filter tasks",className:"bg-transparent outline-none text-ink-0 text-[11px] w-full placeholder:text-ink-2"})]}),e.jsx(ce,{active:l,onClick:()=>o(!l),children:"Errors"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(H,{options:[{value:"order",label:"order"},{value:"tokens",label:"tokens"},{value:"errors",label:"errors"}],value:u,onChange:n}),e.jsxs("span",{className:"ml-auto font-mono text-[10px] text-ink-2",children:["↑↓ to step · ",c.length," shown"]})]})]}),e.jsxs("div",{ref:h,tabIndex:0,onKeyDown:y,className:"overflow-auto min-h-0 flex-1 outline-none focus-visible:shadow-[inset_0_0_0_1px_var(--color-accent)]",children:[c.map(s=>{const k=b.get(s.id)??0,i=s.id===p.id;return e.jsxs("button",{type:"button","data-sa":s.id,onClick:()=>j(s.id),title:s.task_given??void 0,className:`w-full text-left px-3.5 h-[34px] border-b border-line flex items-center gap-2 hover:bg-bg-2 ${i?"bg-bg-2 shadow-[inset_2px_0_0_var(--color-accent)]":""}`,children:[e.jsxs("span",{className:"font-mono text-[11px] text-ink-2 w-8 shrink-0",children:["#",k+1]}),s.errors?e.jsxs("span",{className:"text-crit-ink inline-flex items-center gap-0.5 font-mono text-[11px] w-8 shrink-0",children:[e.jsx(T,{name:"x",size:9}),s.errors]}):e.jsx("span",{className:"text-good inline-flex items-center w-8 shrink-0",children:e.jsx(T,{name:"check",size:10})}),e.jsx("span",{className:"text-[11px] text-ink-1 truncate flex-1 min-w-0",children:s.task_given?s.task_given.replace(/\s+/g," "):e.jsx("span",{className:"text-ink-2",children:s.model})}),e.jsx("span",{className:"relative h-1.5 w-14 shrink-0 rounded-sm bg-bg-3 overflow-hidden",children:e.jsx("i",{className:"absolute inset-y-0 left-0 bg-s1 rounded-r-sm",style:{width:`${v(s)/$*100}%`}})}),e.jsx("span",{className:"font-mono num text-[11px] w-12 text-right shrink-0",children:S(v(s))})]},s.id)}),c.length===0&&e.jsx("div",{className:"text-ink-2 text-center py-6 text-xs",children:"No sub-agents match."})]})]}),e.jsx(ue,{sa:p,index:b.get(p.id)??0},p.id)]})}function Me(){const{id:t}=G({from:"/sessions/$id"}),{tab:a}=J({from:"/sessions/$id"}),m=X(),x=Y(t),d=D(t),l=ee(t),[o,u]=g.useState(),n=g.useMemo(()=>W(d.data?.turns??[]),[d.data]),h=n.filter(P).length,b=g.useMemo(()=>le(n),[n]),c=g.useMemo(()=>[{name:"cumulative cost",values:b}],[b]),p=g.useMemo(()=>n.map(i=>`#${i.sequence}`),[n]),j=i=>m({to:"/sessions/$id",params:{id:t},search:{tab:i}}),y=i=>{u(i),a!=="timeline"&&j("timeline"),requestAnimationFrame(()=>document.getElementById(`turn-${i}`)?.scrollIntoView({block:"center"}))},$=["Analyze",{label:"Sessions",to:"/sessions"},x.data?te(x.data.session.project_path,30):"…"];if(x.error)return e.jsxs(e.Fragment,{children:[e.jsx(L,{crumbs:[...$]}),e.jsx(q,{children:e.jsx(se,{error:x.error})})]});const r=x.data?.session,s=r?r.total_fresh_input_tokens+r.total_output_tokens+r.total_cache_read_tokens+r.total_cache_write_tokens:0,k=n.reduce((i,N)=>i+N.tool_calls.length,0);return e.jsxs(e.Fragment,{children:[e.jsxs(L,{crumbs:[...$],children:[e.jsx(I,{value:t}),e.jsx(H,{options:[{value:"overview",label:"Overview"},{value:"timeline",label:"Timeline"},{value:"subagents",label:`Sub-agents · ${l.data?.length??0}`}],value:a,onChange:j}),r&&e.jsx(E,{kind:"mute",children:r.primary_model}),r?.agent_version&&e.jsxs(E,{kind:"mute",children:[z(r.agent)," ",r.agent_version]})]}),e.jsxs(q,{children:[r?e.jsxs("div",{className:"grid grid-cols-5 gap-3",children:[e.jsx(_,{label:"Tokens",value:S(s),sub:`${f(s)} · ${B(s?r.total_cache_read_tokens/s:0,0)} cache read`}),e.jsx(_,{label:"Estimated cost",value:M(r.total_cost_usd),sub:r.turn_count?`${M(r.total_cost_usd/r.turn_count)} / turn`:void 0}),e.jsx(_,{label:"Turns",value:n.length?f(n.length):f(r.turn_count),sub:`${f(k)} tool calls`,note:n.length&&n.length!==r.turn_count?`${f(r.turn_count)} raw`:void 0}),e.jsx(_,{label:"Duration",value:r.ended_at?F(r.duration_sec):"live",sub:C(r.started_at)}),e.jsx(_,{label:"Tool errors",value:String(h),tone:h?"crit":"default",sub:h?`first at turn #${n.find(P)?.sequence}`:"none"})]}):e.jsx(A,{w:"100%",h:"80px"}),e.jsx(w,{title:"Session shape",sub:"tokens per turn · click to jump",right:e.jsx(V,{names:["fresh + output","cache read","tool error"],colors:["#3987e5","#1f3c63","#d03b3b"]}),children:n.length?e.jsxs(e.Fragment,{children:[e.jsx(U,{turns:n,onPick:y,active:o}),e.jsx("div",{className:"mt-2",children:e.jsx(ie,{labels:p,series:c,format:i=>i===0?"$0":M(i),height:110})})]}):d.isLoading?e.jsx(A,{w:"100%",h:"96px"}):e.jsx("div",{className:"text-ink-2 text-center py-4",children:"No turns recorded."})}),a==="overview"&&r&&e.jsx(de,{session:r,turns:n}),a==="timeline"&&e.jsx(K,{id:t,turns:n,active:o}),a==="subagents"&&e.jsx(he,{subs:l.data??[]})]})]})}export{Me as default};
|