energy-state-analyzer 0.23.3 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- package/README.md +5 -1
- package/dist/{a5f4afce3ed7382a77b6.wasm → 32e18d5b63d8bd81a7b3.wasm} +0 -0
- package/dist/cli.js +1 -1
- package/dist/web-tree-sitter.wasm +0 -0
- package/docs/agent-integration.md +6 -3
- package/docs/cli.md +3 -3
- package/grammars/tree-sitter-tsx.wasm +0 -0
- package/grammars/tree-sitter-typescript.NOTICE.md +6 -0
- package/package.json +2 -4
|
Binary file
|
|
@@ -46,10 +46,13 @@ any medium/high-severity violation is found (`0` otherwise). That exit code lets
|
|
|
46
46
|
refinement loop; inspect the report to distinguish findings from analysis failures:
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
npx energy-state-analyzer path/to/file.py --report json # or .fs / .
|
|
49
|
+
npx energy-state-analyzer path/to/file.py --report json # or .fs / .ts / .kt / .cpp / .cs / .erl / .rs
|
|
50
50
|
echo $? # 0 = no blocking findings; 1 = blocking findings or analysis failure
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
+
See [supported file suffixes](cli.md#supported-file-suffixes) for the complete list, including
|
|
54
|
+
Erlang headers, F# scripts, and C++ headers.
|
|
55
|
+
|
|
53
56
|
Findings live under `files[].violations` in the JSON report. Each finding includes its zero-based `line` and `column`, the violation `type`, its
|
|
54
57
|
`severity`, the detector `message` (which contains a concrete suggested fix), and any `hotspots`.
|
|
55
58
|
The agent uses the locations and suggested fixes to resolve valid findings, verifies behavior,
|
|
@@ -235,7 +238,7 @@ repos:
|
|
|
235
238
|
name: Energy State Analyzer
|
|
236
239
|
entry: npx energy-state-analyzer
|
|
237
240
|
language: system
|
|
238
|
-
files: '\.(py|fs|fsx|ts|kt|cpp|cs)$'
|
|
241
|
+
files: '\.(py|fs|fsx|fsi|ts|kt|kts|cpp|cppm|cc|ccm|cxx|cxxm|c\+\+|c\+\+m|hpp|hh|hxx|h\+\+|h|ii|ino|inl|ipp|ixx|mpp|mxx|tpp|txx|hpp\.in|h\.in|cs|csx|erl|hrl|rs)$'
|
|
239
242
|
pass_filenames: true
|
|
240
243
|
```
|
|
241
244
|
|
|
@@ -258,7 +261,7 @@ Merge these entries into `package.json`, preserving existing scripts. Husky init
|
|
|
258
261
|
"prepare": "husky"
|
|
259
262
|
},
|
|
260
263
|
"lint-staged": {
|
|
261
|
-
"*.{py,fs,fsx,ts,kt,cpp,cs}": ["energy-state-analyzer"]
|
|
264
|
+
"*.{py,fs,fsx,fsi,ts,kt,kts,cpp,cppm,cc,ccm,cxx,cxxm,c++,c++m,hpp,hh,hxx,h++,h,ii,ino,inl,ipp,ixx,mpp,mxx,tpp,txx,hpp.in,h.in,cs,csx,erl,hrl,rs}": ["energy-state-analyzer"]
|
|
262
265
|
}
|
|
263
266
|
}
|
|
264
267
|
```
|
package/docs/cli.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
The same detectors also run headlessly, without VS Code, useful for CI or for an AI coding agent that wants to fix findings in code it just generated and verify the result. Published to npm, so no clone or install step is required:
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npx energy-state-analyzer path/to/file.py # or .fs / .fsx / .ts / .kt / .cpp / .cs / .erl / .rs
|
|
6
|
+
npx energy-state-analyzer path/to/file.py # or .fs / .fsx / .ts / .tsx / .kt / .cpp / .cs / .erl / .rs
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
Or install it as a project/global dependency and call it directly:
|
|
@@ -30,7 +30,7 @@ Unknown flags, invalid flag values, missing explicit paths, and unsupported expl
|
|
|
30
30
|
| --- | --- |
|
|
31
31
|
| Python | `.py` |
|
|
32
32
|
| F# | `.fs`, `.fsx`, `.fsi` |
|
|
33
|
-
| TypeScript | `.ts` |
|
|
33
|
+
| TypeScript / TSX | `.ts`, `.tsx` |
|
|
34
34
|
| C# | `.cs`, `.csx` |
|
|
35
35
|
| Erlang | `.erl`, `.hrl` |
|
|
36
36
|
| Rust | `.rs` |
|
|
@@ -75,7 +75,7 @@ npx energy-state-analyzer src --report sarif
|
|
|
75
75
|
|
|
76
76
|
Each SARIF result has a stable `ESA###` rule ID (for example, `ESA006` for magic literals), a one-based source location, a severity mapped to SARIF `error`/`warning`/`note`, and the detector message with its concrete remediation guidance. The default JSON report carries the same findings in a flat `files[].violations[]` shape at roughly half SARIF's size, so there is nothing to walk; use `md` or `human` for human-readable output. SARIF is available for scan mode; `--base-ref` continues to emit its score-delta JSON or Markdown report.
|
|
77
77
|
|
|
78
|
-
In VS Code, run **Energy State Analyzer: Export SARIF Report** to scan the open workspace and write `.energy-state/latest.sarif`.
|
|
78
|
+
In VS Code, run **Energy State Analyzer: Export SARIF Report** to scan the open workspace and write `.energy-state/latest.sarif`. Optionally install the [SARIF Viewer](https://marketplace.visualstudio.com/items?itemName=MS-SarifVSCode.sarif-viewer) and open that file for its report panel, grouping, and filtering.
|
|
79
79
|
|
|
80
80
|
Only one glob shape is supported: a trailing `**/*.ext` pattern on an otherwise literal directory prefix (e.g. `src/**/*.py`). There's no brace expansion, negation, or mid-path wildcards, pass explicit directories/files for anything more complex.
|
|
81
81
|
|
|
Binary file
|
|
@@ -5,3 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
- SHA-256: `778025db5a8be0e70f8ccc3671e486dfeddd048c25d9e8a70c26de2e1bf6f97d`
|
|
7
7
|
- License: MIT; see `tree-sitter-typescript.LICENSE` in this directory.
|
|
8
|
+
|
|
9
|
+
`tree-sitter-tsx.wasm` is the companion official WebAssembly release artifact from
|
|
10
|
+
the same release, used for TypeScript with JSX (`.tsx`).
|
|
11
|
+
|
|
12
|
+
- SHA-256: `79e5da75ea62855a0cd67177685f0164eac87d5f630b3cbe1e0a099751ad30f8`
|
|
13
|
+
- License: MIT; see `tree-sitter-typescript.LICENSE` in this directory.
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "energy-state-analyzer",
|
|
3
3
|
"displayName": "Energy State Analyzer",
|
|
4
4
|
"description": "Visualize code energy states in real-time (Python, F#, TypeScript, Kotlin, C++, C#, Erlang, Rust)",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.24.0",
|
|
6
6
|
"publisher": "cardamom-code",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"icon": "images/icon.png",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"onLanguage:python",
|
|
39
39
|
"onLanguage:fsharp",
|
|
40
40
|
"onLanguage:typescript",
|
|
41
|
+
"onLanguage:typescriptreact",
|
|
41
42
|
"onLanguage:kotlin",
|
|
42
43
|
"onLanguage:cpp",
|
|
43
44
|
"onLanguage:csharp",
|
|
@@ -49,9 +50,6 @@
|
|
|
49
50
|
"energy-state-analyzer": "./dist/cli.js",
|
|
50
51
|
"energy-state-cli": "./dist/cli.js"
|
|
51
52
|
},
|
|
52
|
-
"extensionPack": [
|
|
53
|
-
"ms-sarifvscode.sarif-viewer"
|
|
54
|
-
],
|
|
55
53
|
"contributes": {
|
|
56
54
|
"languages": [
|
|
57
55
|
{
|