cc-context-stats 1.8.0 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -1
- package/scripts/context-stats.sh +1 -1
- package/.editorconfig +0 -60
- package/.eslintrc.json +0 -35
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -49
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -31
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -33
- package/.github/dependabot.yml +0 -44
- package/.github/workflows/ci.yml +0 -294
- package/.github/workflows/release.yml +0 -151
- package/.pre-commit-config.yaml +0 -74
- package/.prettierrc +0 -33
- package/.shellcheckrc +0 -10
- package/CHANGELOG.md +0 -187
- package/CLAUDE.md +0 -66
- package/CODE_OF_CONDUCT.md +0 -59
- package/CONTRIBUTING.md +0 -240
- package/RELEASE_NOTES.md +0 -19
- package/SECURITY.md +0 -44
- package/TODOS.md +0 -72
- package/assets/logo/favicon.svg +0 -19
- package/assets/logo/logo-black.svg +0 -24
- package/assets/logo/logo-full.svg +0 -40
- package/assets/logo/logo-icon.svg +0 -27
- package/assets/logo/logo-mark.svg +0 -28
- package/assets/logo/logo-white.svg +0 -24
- package/assets/logo/logo-wordmark.svg +0 -6
- package/config/settings-example.json +0 -7
- package/config/settings-node.json +0 -7
- package/config/settings-python.json +0 -7
- package/docs/ARCHITECTURE.md +0 -128
- package/docs/CSV_FORMAT.md +0 -42
- package/docs/DEPLOYMENT.md +0 -71
- package/docs/DEVELOPMENT.md +0 -161
- package/docs/MODEL_INTELLIGENCE.md +0 -396
- package/docs/configuration.md +0 -118
- package/docs/context-stats.md +0 -143
- package/docs/installation.md +0 -255
- package/docs/scripts.md +0 -140
- package/docs/troubleshooting.md +0 -278
- package/images/claude-statusline-token-graph.gif +0 -0
- package/images/claude-statusline.png +0 -0
- package/images/context-status-dumbzone.png +0 -0
- package/images/context-status.png +0 -0
- package/images/statusline-detail.png +0 -0
- package/images/token-graph.jpeg +0 -0
- package/images/token-graph.png +0 -0
- package/images/v1.6.1.png +0 -0
- package/install +0 -351
- package/install.sh +0 -298
- package/jest.config.js +0 -11
- package/pyproject.toml +0 -115
- package/requirements-dev.txt +0 -12
- package/scripts/statusline-full.sh +0 -438
- package/scripts/statusline-git.sh +0 -88
- package/scripts/statusline-minimal.sh +0 -67
- package/scripts/statusline.py +0 -569
- package/src/claude_statusline/__init__.py +0 -11
- package/src/claude_statusline/__main__.py +0 -6
- package/src/claude_statusline/cli/__init__.py +0 -1
- package/src/claude_statusline/cli/context_stats.py +0 -542
- package/src/claude_statusline/cli/explain.py +0 -228
- package/src/claude_statusline/cli/statusline.py +0 -184
- package/src/claude_statusline/core/__init__.py +0 -1
- package/src/claude_statusline/core/colors.py +0 -124
- package/src/claude_statusline/core/config.py +0 -165
- package/src/claude_statusline/core/git.py +0 -78
- package/src/claude_statusline/core/state.py +0 -323
- package/src/claude_statusline/formatters/__init__.py +0 -1
- package/src/claude_statusline/formatters/layout.py +0 -67
- package/src/claude_statusline/formatters/time.py +0 -50
- package/src/claude_statusline/formatters/tokens.py +0 -70
- package/src/claude_statusline/graphs/__init__.py +0 -1
- package/src/claude_statusline/graphs/intelligence.py +0 -162
- package/src/claude_statusline/graphs/renderer.py +0 -401
- package/src/claude_statusline/graphs/statistics.py +0 -92
- package/src/claude_statusline/ui/__init__.py +0 -1
- package/src/claude_statusline/ui/icons.py +0 -93
- package/src/claude_statusline/ui/waiting.py +0 -62
- package/tests/bash/test_delta_parity.bats +0 -199
- package/tests/bash/test_install.bats +0 -29
- package/tests/bash/test_parity.bats +0 -315
- package/tests/bash/test_statusline_full.bats +0 -139
- package/tests/bash/test_statusline_git.bats +0 -42
- package/tests/bash/test_statusline_minimal.bats +0 -37
- package/tests/fixtures/json/comma_in_path.json +0 -31
- package/tests/fixtures/json/high_usage.json +0 -17
- package/tests/fixtures/json/low_usage.json +0 -17
- package/tests/fixtures/json/medium_usage.json +0 -17
- package/tests/fixtures/json/valid_full.json +0 -30
- package/tests/fixtures/json/valid_minimal.json +0 -9
- package/tests/fixtures/mi_test_vectors.json +0 -140
- package/tests/node/intelligence.test.js +0 -98
- package/tests/node/rotation.test.js +0 -89
- package/tests/node/statusline.test.js +0 -240
- package/tests/python/conftest.py +0 -84
- package/tests/python/test_colors.py +0 -105
- package/tests/python/test_config_colors.py +0 -78
- package/tests/python/test_data_pipeline.py +0 -446
- package/tests/python/test_explain.py +0 -177
- package/tests/python/test_icons.py +0 -152
- package/tests/python/test_intelligence.py +0 -314
- package/tests/python/test_layout.py +0 -127
- package/tests/python/test_state_rotation_validation.py +0 -232
- package/tests/python/test_statusline.py +0 -215
- package/tests/python/test_waiting.py +0 -127
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"""Tests for rotating waiting text and activity detection."""
|
|
2
|
-
|
|
3
|
-
import time
|
|
4
|
-
|
|
5
|
-
from claude_statusline.core.state import StateEntry
|
|
6
|
-
from claude_statusline.ui.waiting import (
|
|
7
|
-
STATIC_MESSAGE,
|
|
8
|
-
WAITING_MESSAGES,
|
|
9
|
-
get_waiting_text,
|
|
10
|
-
is_active,
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def _make_entry(timestamp: int = 0) -> StateEntry:
|
|
15
|
-
"""Helper to create a StateEntry for testing."""
|
|
16
|
-
return StateEntry(
|
|
17
|
-
timestamp=timestamp,
|
|
18
|
-
total_input_tokens=1000,
|
|
19
|
-
total_output_tokens=0,
|
|
20
|
-
current_input_tokens=1000,
|
|
21
|
-
current_output_tokens=0,
|
|
22
|
-
cache_creation=0,
|
|
23
|
-
cache_read=0,
|
|
24
|
-
cost_usd=0.0,
|
|
25
|
-
lines_added=0,
|
|
26
|
-
lines_removed=0,
|
|
27
|
-
session_id="test",
|
|
28
|
-
model_id="test-model",
|
|
29
|
-
workspace_project_dir="/tmp/test",
|
|
30
|
-
context_window_size=200_000,
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
class TestGetWaitingText:
|
|
35
|
-
"""Tests for rotating waiting text."""
|
|
36
|
-
|
|
37
|
-
def test_returns_string(self):
|
|
38
|
-
text = get_waiting_text(0)
|
|
39
|
-
assert isinstance(text, str)
|
|
40
|
-
assert len(text) > 0
|
|
41
|
-
|
|
42
|
-
def test_rotates_every_two_cycles(self):
|
|
43
|
-
"""Messages should change every 2 cycles."""
|
|
44
|
-
text_0 = get_waiting_text(0)
|
|
45
|
-
text_1 = get_waiting_text(1)
|
|
46
|
-
text_2 = get_waiting_text(2)
|
|
47
|
-
|
|
48
|
-
# Cycle 0 and 1 should be the same (same message index)
|
|
49
|
-
assert text_0 == text_1
|
|
50
|
-
# Cycle 2 should be different (next message)
|
|
51
|
-
assert text_0 != text_2
|
|
52
|
-
|
|
53
|
-
def test_wraps_around(self):
|
|
54
|
-
"""Should cycle back to the first message."""
|
|
55
|
-
total_messages = len(WAITING_MESSAGES)
|
|
56
|
-
# After going through all messages (2 cycles each), should wrap
|
|
57
|
-
first = get_waiting_text(0)
|
|
58
|
-
wrapped = get_waiting_text(total_messages * 2)
|
|
59
|
-
assert first == wrapped
|
|
60
|
-
|
|
61
|
-
def test_all_messages_reachable(self):
|
|
62
|
-
"""Every message should appear at some cycle."""
|
|
63
|
-
seen = set()
|
|
64
|
-
for i in range(len(WAITING_MESSAGES) * 2):
|
|
65
|
-
seen.add(get_waiting_text(i))
|
|
66
|
-
assert seen == set(WAITING_MESSAGES)
|
|
67
|
-
|
|
68
|
-
def test_reduced_motion_returns_static(self):
|
|
69
|
-
"""With reduced_motion=True, always return static message."""
|
|
70
|
-
for i in range(10):
|
|
71
|
-
text = get_waiting_text(i, reduced_motion=True)
|
|
72
|
-
assert text == STATIC_MESSAGE
|
|
73
|
-
|
|
74
|
-
def test_reduced_motion_consistent(self):
|
|
75
|
-
"""Static message should be the same regardless of cycle."""
|
|
76
|
-
texts = {get_waiting_text(i, reduced_motion=True) for i in range(20)}
|
|
77
|
-
assert len(texts) == 1
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
class TestIsActive:
|
|
81
|
-
"""Tests for session activity detection."""
|
|
82
|
-
|
|
83
|
-
def test_empty_entries(self):
|
|
84
|
-
assert is_active([]) is False
|
|
85
|
-
|
|
86
|
-
def test_recent_entry_is_active(self):
|
|
87
|
-
"""Entry within timeout is active."""
|
|
88
|
-
entry = _make_entry(timestamp=int(time.time()) - 5)
|
|
89
|
-
assert is_active([entry]) is True
|
|
90
|
-
|
|
91
|
-
def test_old_entry_is_not_active(self):
|
|
92
|
-
"""Entry older than timeout is not active."""
|
|
93
|
-
entry = _make_entry(timestamp=int(time.time()) - 60)
|
|
94
|
-
assert is_active([entry]) is False
|
|
95
|
-
|
|
96
|
-
def test_exactly_at_timeout_is_active(self):
|
|
97
|
-
"""Entry exactly at timeout boundary is still active."""
|
|
98
|
-
entry = _make_entry(timestamp=int(time.time()) - 30)
|
|
99
|
-
assert is_active([entry], timeout=30) is True
|
|
100
|
-
|
|
101
|
-
def test_just_past_timeout_is_not_active(self):
|
|
102
|
-
"""Entry just past timeout boundary is not active."""
|
|
103
|
-
entry = _make_entry(timestamp=int(time.time()) - 31)
|
|
104
|
-
assert is_active([entry], timeout=30) is False
|
|
105
|
-
|
|
106
|
-
def test_custom_timeout(self):
|
|
107
|
-
"""Custom timeout should be respected."""
|
|
108
|
-
entry = _make_entry(timestamp=int(time.time()) - 10)
|
|
109
|
-
assert is_active([entry], timeout=5) is False
|
|
110
|
-
assert is_active([entry], timeout=15) is True
|
|
111
|
-
|
|
112
|
-
def test_uses_last_entry(self):
|
|
113
|
-
"""Should check the most recent (last) entry, not the first."""
|
|
114
|
-
old_entry = _make_entry(timestamp=int(time.time()) - 120)
|
|
115
|
-
recent_entry = _make_entry(timestamp=int(time.time()) - 5)
|
|
116
|
-
assert is_active([old_entry, recent_entry]) is True
|
|
117
|
-
|
|
118
|
-
def test_old_entries_with_recent_last(self):
|
|
119
|
-
"""Multiple old entries don't matter if last one is recent."""
|
|
120
|
-
now = int(time.time())
|
|
121
|
-
entries = [
|
|
122
|
-
_make_entry(timestamp=now - 300),
|
|
123
|
-
_make_entry(timestamp=now - 200),
|
|
124
|
-
_make_entry(timestamp=now - 100),
|
|
125
|
-
_make_entry(timestamp=now - 2),
|
|
126
|
-
]
|
|
127
|
-
assert is_active(entries) is True
|