glassbox 0.1.4 → 0.2.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/README.md CHANGED
@@ -24,7 +24,7 @@ That's it. Opens in your browser. Works in any git repo.
24
24
 
25
25
  <br>
26
26
 
27
- <img src="assets/screenshot.png" alt="Glassbox reviewing a diff" width="720">
27
+ <img src="assets/demo-guided-review.png" alt="Glassbox reviewing a diff with guided review notes" width="720">
28
28
 
29
29
  </div>
30
30
 
@@ -38,6 +38,8 @@ Most developers review AI output by skimming files in their editor, mentally dif
38
38
 
39
39
  Glassbox gives you a proper diff viewer with annotation categories designed for AI feedback:
40
40
 
41
+ <img src="assets/demo-annotations.png" alt="Inline annotations with category badges" width="720">
42
+
41
43
  | Category | What it tells the AI |
42
44
  |----------|---------------------|
43
45
  | **Bug** | "This is broken. Fix it." |
@@ -82,7 +84,62 @@ Then you run `glassbox` again. Your previous annotations carry forward — match
82
84
  - **Structured export** — markdown output with file paths, line numbers, categories, and instructions for AI consumption
83
85
  - **Automatic .gitignore prompt** — reminds you to exclude `.glassbox/` from version control
84
86
  - **Auto port selection** — if the default port is busy, it finds an open one
85
- - **Fully local** — no network calls, no accounts, no telemetry. Your code stays on your machine.
87
+ - **Fully local** — no network calls (unless you opt into AI features), no accounts, no telemetry. Your code stays on your machine.
88
+ - **AI-powered analysis** *(optional)* — risk scoring, narrative reading order, and guided review to help you focus and learn as you review
89
+
90
+ ---
91
+
92
+ ## AI-Powered Review Intelligence
93
+
94
+ > Entirely optional. Glassbox is fully functional without it.
95
+
96
+ When reviewing a large diff, knowing *where to look first* is half the battle. Glassbox can optionally connect to an AI provider to analyze your changes and surface what matters:
97
+
98
+ ### Risk Analysis
99
+
100
+ Every file is scored across six dimensions — security, correctness, error handling, maintainability, architecture, and performance — on a 0.0 to 1.0 scale. Files are ranked by their highest-risk dimension, so a single critical issue won't hide behind low averages.
101
+
102
+ When you open a file, inline risk notes highlight the specific lines and concerns the AI flagged, giving you a heads-up before you even start reading.
103
+
104
+ <img src="assets/demo-risk-mode.png" alt="Risk mode with scores and inline risk notes" width="720">
105
+
106
+ ### Narrative Reading Order
107
+
108
+ For large, multi-file changes, the AI determines the optimal reading order: types and interfaces first, then utilities, then business logic, then integration code. Each file gets walkthrough notes that explain what changed and how it connects to the rest of the diff — like having a colleague walk you through their PR.
109
+
110
+ <img src="assets/demo-narrative-mode.png" alt="Narrative mode with reading order and walkthrough notes" width="720">
111
+
112
+ ### Guided Review
113
+
114
+ If you're learning a new language, onboarding to an unfamiliar codebase, or new to programming, Guided Review generates educational annotations inline with the diff. Enable it in Settings and select the topics that apply to you — "Programming," "This codebase," or specific languages. Glassbox runs a separate analysis pass and inserts green "Learn" notes that explain concepts, idioms, and design decisions relevant to your experience level.
115
+
116
+ Guided Review works in all three sidebar modes (folder, risk, and narrative) and runs independently of risk or narrative analysis. When enabled, risk and narrative analysis also adjust their output to be more detailed and educational.
117
+
118
+ ### How to use it
119
+
120
+ Click the shield or book icon in the sidebar to switch from the default folder view to risk or narrative mode. If you haven't configured an API key yet, a settings dialog will prompt you. Analysis runs once and results are cached for the session. To enable Guided Review, open the Settings dialog (gear icon) and check "Enable guided review."
121
+
122
+ <img src="assets/demo-settings.png" alt="Settings dialog with guided review configuration" width="480">
123
+
124
+ ### Supported providers
125
+
126
+ | Provider | Models | Env variable |
127
+ |----------|--------|-------------|
128
+ | **Anthropic** | Claude Sonnet 4, Claude Haiku 4 | `ANTHROPIC_API_KEY` |
129
+ | **OpenAI** | GPT-4o, GPT-4o Mini | `OPENAI_API_KEY` |
130
+ | **Google** | Gemini 2.5 Flash, Gemini 2.5 Pro | `GEMINI_API_KEY` |
131
+
132
+ You can switch providers and models in the settings dialog (gear icon in the sidebar).
133
+
134
+ ### API key storage
135
+
136
+ Your API key never leaves your machine. Glassbox resolves keys in this order:
137
+
138
+ 1. **Environment variables** — if `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or `GEMINI_API_KEY` is set, it's used automatically. Nothing is stored.
139
+ 2. **OS keychain** — on macOS (Keychain), Linux (GNOME Keyring / KDE Wallet via `secret-tool`), or Windows (Credential Manager). Keys are encrypted by your operating system and tied to your user account.
140
+ 3. **Config file** — stored in `~/.glassbox/config.json` with `0600` permissions, base64-encoded. Use this as a fallback if your OS keychain isn't available.
141
+
142
+ Keys entered through the settings dialog are stored in the OS keychain by default when available, and never sent anywhere except directly to the AI provider's API.
86
143
 
87
144
  ---
88
145
 
@@ -183,7 +240,7 @@ Point the tool at the file. The export includes an "Instructions for AI Tools" s
183
240
  | Build | tsup (single-file bundle) |
184
241
  | Storage | `~/.glassbox/data/` |
185
242
 
186
- Data stays local. The only network call is an optional once-per-day npm update check.
243
+ Data stays local. The only network calls are an optional once-per-day npm update check and AI analysis requests if you opt in.
187
244
 
188
245
  ## Development
189
246