cc-context-stats 1.8.0 → 1.8.1
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 +9 -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
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-context-stats",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "Monitor your Claude Code session context in real-time - track token usage and never run out of context",
|
|
5
5
|
"main": "scripts/statusline.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"context-stats": "scripts/context-stats.sh",
|
|
8
|
+
"claude-statusline": "scripts/statusline.js"
|
|
9
|
+
},
|
|
6
10
|
"scripts": {
|
|
7
11
|
"test": "jest",
|
|
8
12
|
"test:watch": "jest --watch",
|
|
@@ -34,6 +38,10 @@
|
|
|
34
38
|
"jest": "^29.7.0",
|
|
35
39
|
"prettier": "^3.8.1"
|
|
36
40
|
},
|
|
41
|
+
"files": [
|
|
42
|
+
"scripts/statusline.js",
|
|
43
|
+
"scripts/context-stats.sh"
|
|
44
|
+
],
|
|
37
45
|
"engines": {
|
|
38
46
|
"node": ">=18"
|
|
39
47
|
}
|
package/scripts/context-stats.sh
CHANGED
package/.editorconfig
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# EditorConfig for claude-statusline project
|
|
2
|
-
# https://editorconfig.org
|
|
3
|
-
|
|
4
|
-
root = true
|
|
5
|
-
|
|
6
|
-
# Default settings for all files
|
|
7
|
-
[*]
|
|
8
|
-
charset = utf-8
|
|
9
|
-
end_of_line = lf
|
|
10
|
-
insert_final_newline = true
|
|
11
|
-
trim_trailing_whitespace = true
|
|
12
|
-
indent_style = space
|
|
13
|
-
indent_size = 4
|
|
14
|
-
|
|
15
|
-
# Shell scripts
|
|
16
|
-
[*.{sh,bash}]
|
|
17
|
-
indent_style = space
|
|
18
|
-
indent_size = 4
|
|
19
|
-
|
|
20
|
-
# Python
|
|
21
|
-
[*.py]
|
|
22
|
-
indent_style = space
|
|
23
|
-
indent_size = 4
|
|
24
|
-
max_line_length = 100
|
|
25
|
-
|
|
26
|
-
# JavaScript
|
|
27
|
-
[*.js]
|
|
28
|
-
indent_style = space
|
|
29
|
-
indent_size = 4
|
|
30
|
-
max_line_length = 100
|
|
31
|
-
|
|
32
|
-
# JSON files
|
|
33
|
-
[*.json]
|
|
34
|
-
indent_style = space
|
|
35
|
-
indent_size = 2
|
|
36
|
-
|
|
37
|
-
# YAML files
|
|
38
|
-
[*.{yml,yaml}]
|
|
39
|
-
indent_style = space
|
|
40
|
-
indent_size = 2
|
|
41
|
-
|
|
42
|
-
# TOML files
|
|
43
|
-
[*.toml]
|
|
44
|
-
indent_style = space
|
|
45
|
-
indent_size = 4
|
|
46
|
-
|
|
47
|
-
# Markdown
|
|
48
|
-
[*.md]
|
|
49
|
-
indent_style = space
|
|
50
|
-
indent_size = 2
|
|
51
|
-
trim_trailing_whitespace = false
|
|
52
|
-
|
|
53
|
-
# Makefile
|
|
54
|
-
[Makefile]
|
|
55
|
-
indent_style = tab
|
|
56
|
-
|
|
57
|
-
# Bats test files
|
|
58
|
-
[*.bats]
|
|
59
|
-
indent_style = space
|
|
60
|
-
indent_size = 4
|
package/.eslintrc.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"node": true,
|
|
4
|
-
"es2022": true,
|
|
5
|
-
"jest": true
|
|
6
|
-
},
|
|
7
|
-
"parserOptions": {
|
|
8
|
-
"ecmaVersion": 2022,
|
|
9
|
-
"sourceType": "commonjs"
|
|
10
|
-
},
|
|
11
|
-
"extends": ["eslint:recommended"],
|
|
12
|
-
"rules": {
|
|
13
|
-
"indent": ["error", 4],
|
|
14
|
-
"linebreak-style": ["error", "unix"],
|
|
15
|
-
"quotes": ["error", "single", { "avoidEscape": true }],
|
|
16
|
-
"semi": ["error", "always"],
|
|
17
|
-
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
|
|
18
|
-
"no-console": "off",
|
|
19
|
-
"eqeqeq": ["error", "always"],
|
|
20
|
-
"curly": ["error", "all"],
|
|
21
|
-
"brace-style": ["error", "1tbs"],
|
|
22
|
-
"comma-dangle": ["error", "only-multiline"],
|
|
23
|
-
"comma-spacing": ["error", { "before": false, "after": true }],
|
|
24
|
-
"keyword-spacing": ["error", { "before": true, "after": true }],
|
|
25
|
-
"space-before-blocks": ["error", "always"],
|
|
26
|
-
"object-curly-spacing": ["error", "always"],
|
|
27
|
-
"array-bracket-spacing": ["error", "never"],
|
|
28
|
-
"no-trailing-spaces": "error",
|
|
29
|
-
"eol-last": ["error", "always"],
|
|
30
|
-
"max-len": ["warn", { "code": 100, "ignoreStrings": true, "ignoreTemplateLiterals": true }],
|
|
31
|
-
"prefer-const": "error",
|
|
32
|
-
"no-var": "error"
|
|
33
|
-
},
|
|
34
|
-
"ignorePatterns": ["node_modules/", "coverage/", "*.min.js"]
|
|
35
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Bug Report
|
|
3
|
-
about: Report a bug to help us improve
|
|
4
|
-
title: '[BUG] '
|
|
5
|
-
labels: bug
|
|
6
|
-
assignees: ''
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Bug Description
|
|
10
|
-
|
|
11
|
-
A clear and concise description of what the bug is.
|
|
12
|
-
|
|
13
|
-
## Steps to Reproduce
|
|
14
|
-
|
|
15
|
-
1. Install cc-context-stats via '...'
|
|
16
|
-
2. Run '...'
|
|
17
|
-
3. See error
|
|
18
|
-
|
|
19
|
-
## Expected Behavior
|
|
20
|
-
|
|
21
|
-
A clear and concise description of what you expected to happen.
|
|
22
|
-
|
|
23
|
-
## Actual Behavior
|
|
24
|
-
|
|
25
|
-
What actually happened instead.
|
|
26
|
-
|
|
27
|
-
## Screenshots
|
|
28
|
-
|
|
29
|
-
If applicable, add screenshots to help explain your problem.
|
|
30
|
-
|
|
31
|
-
## Environment
|
|
32
|
-
|
|
33
|
-
- OS: [e.g., macOS 14.0, Ubuntu 22.04, Windows 11]
|
|
34
|
-
- Shell: [e.g., zsh, bash, PowerShell]
|
|
35
|
-
- cc-context-stats version: [e.g., 1.6.0]
|
|
36
|
-
- Installation method: [npm, pip, shell script]
|
|
37
|
-
- Node.js version: [if applicable]
|
|
38
|
-
- Python version: [if applicable]
|
|
39
|
-
- Claude Code version: [if applicable]
|
|
40
|
-
|
|
41
|
-
## Additional Context
|
|
42
|
-
|
|
43
|
-
Add any other context about the problem here.
|
|
44
|
-
|
|
45
|
-
## State File Content (if relevant)
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
# Paste output of: cat ~/.claude/statusline/statusline.*.state
|
|
49
|
-
```
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Feature Request
|
|
3
|
-
about: Suggest an idea for this project
|
|
4
|
-
title: '[FEATURE] '
|
|
5
|
-
labels: enhancement
|
|
6
|
-
assignees: ''
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Problem Statement
|
|
10
|
-
|
|
11
|
-
A clear and concise description of what the problem is.
|
|
12
|
-
Ex. I'm always frustrated when [...]
|
|
13
|
-
|
|
14
|
-
## Proposed Solution
|
|
15
|
-
|
|
16
|
-
A clear and concise description of what you want to happen.
|
|
17
|
-
|
|
18
|
-
## Alternatives Considered
|
|
19
|
-
|
|
20
|
-
A clear and concise description of any alternative solutions or features you've considered.
|
|
21
|
-
|
|
22
|
-
## Use Cases
|
|
23
|
-
|
|
24
|
-
Describe specific use cases where this feature would be beneficial:
|
|
25
|
-
|
|
26
|
-
1. Use case 1
|
|
27
|
-
2. Use case 2
|
|
28
|
-
|
|
29
|
-
## Additional Context
|
|
30
|
-
|
|
31
|
-
Add any other context, mockups, or screenshots about the feature request here.
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
## Description
|
|
2
|
-
|
|
3
|
-
Brief description of the changes in this PR.
|
|
4
|
-
|
|
5
|
-
## Related Issue
|
|
6
|
-
|
|
7
|
-
Fixes #(issue number)
|
|
8
|
-
|
|
9
|
-
## Type of Change
|
|
10
|
-
|
|
11
|
-
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
12
|
-
- [ ] New feature (non-breaking change which adds functionality)
|
|
13
|
-
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
|
14
|
-
- [ ] Documentation update
|
|
15
|
-
- [ ] Refactoring (no functional changes)
|
|
16
|
-
|
|
17
|
-
## Checklist
|
|
18
|
-
|
|
19
|
-
- [ ] My code follows the project's style guidelines
|
|
20
|
-
- [ ] I have performed a self-review of my code
|
|
21
|
-
- [ ] I have made corresponding changes to the documentation
|
|
22
|
-
- [ ] My changes generate no new warnings
|
|
23
|
-
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
24
|
-
- [ ] New and existing unit tests pass locally with my changes
|
|
25
|
-
- [ ] All three implementations (bash, Python, Node.js) produce consistent output (if applicable)
|
|
26
|
-
|
|
27
|
-
## Screenshots (if applicable)
|
|
28
|
-
|
|
29
|
-
Add screenshots to help explain your changes.
|
|
30
|
-
|
|
31
|
-
## Additional Notes
|
|
32
|
-
|
|
33
|
-
Any additional information that reviewers should know.
|
package/.github/dependabot.yml
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
version: 2
|
|
2
|
-
updates:
|
|
3
|
-
# GitHub Actions
|
|
4
|
-
- package-ecosystem: "github-actions"
|
|
5
|
-
directory: "/"
|
|
6
|
-
schedule:
|
|
7
|
-
interval: "weekly"
|
|
8
|
-
day: "monday"
|
|
9
|
-
commit-message:
|
|
10
|
-
prefix: "ci"
|
|
11
|
-
labels:
|
|
12
|
-
- "dependencies"
|
|
13
|
-
- "github-actions"
|
|
14
|
-
|
|
15
|
-
# npm dependencies
|
|
16
|
-
- package-ecosystem: "npm"
|
|
17
|
-
directory: "/"
|
|
18
|
-
schedule:
|
|
19
|
-
interval: "weekly"
|
|
20
|
-
day: "monday"
|
|
21
|
-
commit-message:
|
|
22
|
-
prefix: "deps"
|
|
23
|
-
labels:
|
|
24
|
-
- "dependencies"
|
|
25
|
-
- "javascript"
|
|
26
|
-
groups:
|
|
27
|
-
dev-dependencies:
|
|
28
|
-
patterns:
|
|
29
|
-
- "*"
|
|
30
|
-
update-types:
|
|
31
|
-
- "minor"
|
|
32
|
-
- "patch"
|
|
33
|
-
|
|
34
|
-
# pip dependencies
|
|
35
|
-
- package-ecosystem: "pip"
|
|
36
|
-
directory: "/"
|
|
37
|
-
schedule:
|
|
38
|
-
interval: "weekly"
|
|
39
|
-
day: "monday"
|
|
40
|
-
commit-message:
|
|
41
|
-
prefix: "deps"
|
|
42
|
-
labels:
|
|
43
|
-
- "dependencies"
|
|
44
|
-
- "python"
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [main]
|
|
8
|
-
|
|
9
|
-
concurrency:
|
|
10
|
-
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
-
cancel-in-progress: true
|
|
12
|
-
|
|
13
|
-
jobs:
|
|
14
|
-
# ============================================
|
|
15
|
-
# BASH SCRIPTS - LINT AND TEST
|
|
16
|
-
# ============================================
|
|
17
|
-
bash-lint:
|
|
18
|
-
name: Bash Lint (ShellCheck)
|
|
19
|
-
runs-on: ubuntu-latest
|
|
20
|
-
steps:
|
|
21
|
-
- name: Checkout
|
|
22
|
-
uses: actions/checkout@v4
|
|
23
|
-
|
|
24
|
-
- name: Run ShellCheck
|
|
25
|
-
uses: ludeeus/action-shellcheck@master
|
|
26
|
-
with:
|
|
27
|
-
scandir: './scripts'
|
|
28
|
-
additional_files: 'install.sh'
|
|
29
|
-
severity: warning
|
|
30
|
-
format: tty
|
|
31
|
-
|
|
32
|
-
bash-test:
|
|
33
|
-
name: Bash Tests (${{ matrix.os }})
|
|
34
|
-
needs: bash-lint
|
|
35
|
-
runs-on: ${{ matrix.os }}
|
|
36
|
-
strategy:
|
|
37
|
-
fail-fast: false
|
|
38
|
-
matrix:
|
|
39
|
-
os: [ubuntu-latest, macos-latest]
|
|
40
|
-
steps:
|
|
41
|
-
- name: Checkout
|
|
42
|
-
uses: actions/checkout@v4
|
|
43
|
-
|
|
44
|
-
- name: Install jq
|
|
45
|
-
run: |
|
|
46
|
-
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
|
47
|
-
sudo apt-get update && sudo apt-get install -y jq
|
|
48
|
-
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
49
|
-
brew install jq
|
|
50
|
-
fi
|
|
51
|
-
|
|
52
|
-
- name: Install Bats
|
|
53
|
-
run: |
|
|
54
|
-
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
|
55
|
-
sudo apt-get install -y bats
|
|
56
|
-
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
57
|
-
brew install bats-core
|
|
58
|
-
fi
|
|
59
|
-
|
|
60
|
-
- name: Run Bats tests
|
|
61
|
-
run: bats tests/bash/*.bats
|
|
62
|
-
|
|
63
|
-
# ============================================
|
|
64
|
-
# PYTHON SCRIPT - LINT AND TEST
|
|
65
|
-
# ============================================
|
|
66
|
-
python-lint:
|
|
67
|
-
name: Python Lint
|
|
68
|
-
runs-on: ubuntu-latest
|
|
69
|
-
steps:
|
|
70
|
-
- name: Checkout
|
|
71
|
-
uses: actions/checkout@v4
|
|
72
|
-
|
|
73
|
-
- name: Set up Python
|
|
74
|
-
uses: actions/setup-python@v5
|
|
75
|
-
with:
|
|
76
|
-
python-version: '3.11'
|
|
77
|
-
cache: 'pip'
|
|
78
|
-
cache-dependency-path: 'requirements-dev.txt'
|
|
79
|
-
|
|
80
|
-
- name: Install dependencies
|
|
81
|
-
run: pip install -r requirements-dev.txt
|
|
82
|
-
|
|
83
|
-
- name: Run Ruff (linting)
|
|
84
|
-
run: ruff check scripts/statusline.py
|
|
85
|
-
|
|
86
|
-
- name: Run Ruff (formatting check)
|
|
87
|
-
run: ruff format --check scripts/statusline.py
|
|
88
|
-
|
|
89
|
-
- name: Run MyPy (type checking)
|
|
90
|
-
run: mypy scripts/statusline.py --ignore-missing-imports
|
|
91
|
-
|
|
92
|
-
python-test:
|
|
93
|
-
name: Python Tests (${{ matrix.os }}, Python ${{ matrix.python-version }})
|
|
94
|
-
needs: python-lint
|
|
95
|
-
runs-on: ${{ matrix.os }}
|
|
96
|
-
strategy:
|
|
97
|
-
fail-fast: false
|
|
98
|
-
matrix:
|
|
99
|
-
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
100
|
-
python-version: ['3.9', '3.10', '3.11', '3.12']
|
|
101
|
-
steps:
|
|
102
|
-
- name: Checkout
|
|
103
|
-
uses: actions/checkout@v4
|
|
104
|
-
|
|
105
|
-
- name: Set up Python ${{ matrix.python-version }}
|
|
106
|
-
uses: actions/setup-python@v5
|
|
107
|
-
with:
|
|
108
|
-
python-version: ${{ matrix.python-version }}
|
|
109
|
-
cache: 'pip'
|
|
110
|
-
cache-dependency-path: 'requirements-dev.txt'
|
|
111
|
-
|
|
112
|
-
- name: Install dependencies
|
|
113
|
-
run: |
|
|
114
|
-
pip install -r requirements-dev.txt
|
|
115
|
-
pip install -e .
|
|
116
|
-
|
|
117
|
-
- name: Run pytest with coverage
|
|
118
|
-
run: pytest tests/python/ -v --cov=scripts --cov=src --cov-report=xml --cov-report=term
|
|
119
|
-
|
|
120
|
-
- name: Upload coverage to Codecov
|
|
121
|
-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
|
|
122
|
-
uses: codecov/codecov-action@v4
|
|
123
|
-
with:
|
|
124
|
-
files: ./coverage.xml
|
|
125
|
-
flags: python
|
|
126
|
-
fail_ci_if_error: false
|
|
127
|
-
|
|
128
|
-
# ============================================
|
|
129
|
-
# NODE.JS SCRIPT - LINT AND TEST
|
|
130
|
-
# ============================================
|
|
131
|
-
node-lint:
|
|
132
|
-
name: Node.js Lint
|
|
133
|
-
runs-on: ubuntu-latest
|
|
134
|
-
steps:
|
|
135
|
-
- name: Checkout
|
|
136
|
-
uses: actions/checkout@v4
|
|
137
|
-
|
|
138
|
-
- name: Set up Node.js
|
|
139
|
-
uses: actions/setup-node@v4
|
|
140
|
-
with:
|
|
141
|
-
node-version: '20'
|
|
142
|
-
cache: 'npm'
|
|
143
|
-
|
|
144
|
-
- name: Install dependencies
|
|
145
|
-
run: npm ci
|
|
146
|
-
|
|
147
|
-
- name: Run ESLint
|
|
148
|
-
run: npx eslint scripts/statusline.js
|
|
149
|
-
|
|
150
|
-
- name: Run Prettier check
|
|
151
|
-
run: npx prettier --check scripts/statusline.js
|
|
152
|
-
|
|
153
|
-
node-test:
|
|
154
|
-
name: Node.js Tests (${{ matrix.os }}, Node ${{ matrix.node-version }})
|
|
155
|
-
needs: node-lint
|
|
156
|
-
runs-on: ${{ matrix.os }}
|
|
157
|
-
strategy:
|
|
158
|
-
fail-fast: false
|
|
159
|
-
matrix:
|
|
160
|
-
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
161
|
-
node-version: ['18', '20', '22']
|
|
162
|
-
steps:
|
|
163
|
-
- name: Checkout
|
|
164
|
-
uses: actions/checkout@v4
|
|
165
|
-
|
|
166
|
-
- name: Set up Node.js ${{ matrix.node-version }}
|
|
167
|
-
uses: actions/setup-node@v4
|
|
168
|
-
with:
|
|
169
|
-
node-version: ${{ matrix.node-version }}
|
|
170
|
-
cache: 'npm'
|
|
171
|
-
|
|
172
|
-
- name: Install dependencies
|
|
173
|
-
run: npm ci
|
|
174
|
-
|
|
175
|
-
- name: Run Jest tests
|
|
176
|
-
run: npm test -- --coverage
|
|
177
|
-
|
|
178
|
-
- name: Upload coverage to Codecov
|
|
179
|
-
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20'
|
|
180
|
-
uses: codecov/codecov-action@v4
|
|
181
|
-
with:
|
|
182
|
-
files: ./coverage/node/lcov.info
|
|
183
|
-
flags: node
|
|
184
|
-
fail_ci_if_error: false
|
|
185
|
-
|
|
186
|
-
# ============================================
|
|
187
|
-
# CROSS-IMPLEMENTATION PARITY TESTS
|
|
188
|
-
# ============================================
|
|
189
|
-
parity-test:
|
|
190
|
-
name: Parity Tests (${{ matrix.os }})
|
|
191
|
-
needs: [python-test, node-test]
|
|
192
|
-
runs-on: ${{ matrix.os }}
|
|
193
|
-
strategy:
|
|
194
|
-
fail-fast: false
|
|
195
|
-
matrix:
|
|
196
|
-
os: [ubuntu-latest, macos-latest]
|
|
197
|
-
steps:
|
|
198
|
-
- name: Checkout
|
|
199
|
-
uses: actions/checkout@v4
|
|
200
|
-
|
|
201
|
-
- name: Set up Python
|
|
202
|
-
uses: actions/setup-python@v5
|
|
203
|
-
with:
|
|
204
|
-
python-version: '3.11'
|
|
205
|
-
|
|
206
|
-
- name: Set up Node.js
|
|
207
|
-
uses: actions/setup-node@v4
|
|
208
|
-
with:
|
|
209
|
-
node-version: '20'
|
|
210
|
-
|
|
211
|
-
- name: Install Bats
|
|
212
|
-
run: |
|
|
213
|
-
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
|
214
|
-
sudo apt-get update && sudo apt-get install -y bats
|
|
215
|
-
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
216
|
-
brew install bats-core
|
|
217
|
-
fi
|
|
218
|
-
|
|
219
|
-
- name: Run parity tests
|
|
220
|
-
run: bats tests/bash/test_parity.bats
|
|
221
|
-
|
|
222
|
-
# ============================================
|
|
223
|
-
# INTEGRATION TESTS
|
|
224
|
-
# ============================================
|
|
225
|
-
integration-test:
|
|
226
|
-
name: Integration Tests (${{ matrix.os }})
|
|
227
|
-
needs: [bash-test, python-test, node-test]
|
|
228
|
-
runs-on: ${{ matrix.os }}
|
|
229
|
-
strategy:
|
|
230
|
-
fail-fast: false
|
|
231
|
-
matrix:
|
|
232
|
-
os: [ubuntu-latest, macos-latest]
|
|
233
|
-
steps:
|
|
234
|
-
- name: Checkout
|
|
235
|
-
uses: actions/checkout@v4
|
|
236
|
-
|
|
237
|
-
- name: Install jq
|
|
238
|
-
run: |
|
|
239
|
-
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
|
240
|
-
sudo apt-get update && sudo apt-get install -y jq
|
|
241
|
-
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
|
242
|
-
brew install jq
|
|
243
|
-
fi
|
|
244
|
-
|
|
245
|
-
- name: Set up Python
|
|
246
|
-
uses: actions/setup-python@v5
|
|
247
|
-
with:
|
|
248
|
-
python-version: '3.11'
|
|
249
|
-
|
|
250
|
-
- name: Set up Node.js
|
|
251
|
-
uses: actions/setup-node@v4
|
|
252
|
-
with:
|
|
253
|
-
node-version: '20'
|
|
254
|
-
|
|
255
|
-
- name: Run integration tests
|
|
256
|
-
run: |
|
|
257
|
-
SAMPLE_INPUT='{"model":{"display_name":"Claude 3.5 Sonnet"},"workspace":{"current_dir":"/tmp/test","project_dir":"/tmp/test"},"context_window":{"context_window_size":200000,"current_usage":{"input_tokens":1000,"cache_creation_input_tokens":500,"cache_read_input_tokens":200}}}'
|
|
258
|
-
|
|
259
|
-
echo "Testing bash scripts..."
|
|
260
|
-
echo "$SAMPLE_INPUT" | ./scripts/statusline-full.sh
|
|
261
|
-
echo "$SAMPLE_INPUT" | ./scripts/statusline-git.sh
|
|
262
|
-
echo "$SAMPLE_INPUT" | ./scripts/statusline-minimal.sh
|
|
263
|
-
|
|
264
|
-
echo "Testing Python script..."
|
|
265
|
-
echo "$SAMPLE_INPUT" | python3 ./scripts/statusline.py
|
|
266
|
-
|
|
267
|
-
echo "Testing Node.js script..."
|
|
268
|
-
echo "$SAMPLE_INPUT" | node ./scripts/statusline.js
|
|
269
|
-
|
|
270
|
-
echo "All integration tests passed!"
|
|
271
|
-
|
|
272
|
-
# ============================================
|
|
273
|
-
# FINAL STATUS CHECK
|
|
274
|
-
# ============================================
|
|
275
|
-
ci-success:
|
|
276
|
-
name: CI Success
|
|
277
|
-
needs: [bash-lint, bash-test, python-lint, python-test, node-lint, node-test, integration-test, parity-test]
|
|
278
|
-
runs-on: ubuntu-latest
|
|
279
|
-
if: always()
|
|
280
|
-
steps:
|
|
281
|
-
- name: Check all jobs passed
|
|
282
|
-
run: |
|
|
283
|
-
if [[ "${{ needs.bash-lint.result }}" != "success" ]] || \
|
|
284
|
-
[[ "${{ needs.bash-test.result }}" != "success" ]] || \
|
|
285
|
-
[[ "${{ needs.python-lint.result }}" != "success" ]] || \
|
|
286
|
-
[[ "${{ needs.python-test.result }}" != "success" ]] || \
|
|
287
|
-
[[ "${{ needs.node-lint.result }}" != "success" ]] || \
|
|
288
|
-
[[ "${{ needs.node-test.result }}" != "success" ]] || \
|
|
289
|
-
[[ "${{ needs.integration-test.result }}" != "success" ]] || \
|
|
290
|
-
[[ "${{ needs.parity-test.result }}" != "success" ]]; then
|
|
291
|
-
echo "One or more jobs failed"
|
|
292
|
-
exit 1
|
|
293
|
-
fi
|
|
294
|
-
echo "All CI jobs passed successfully!"
|