deepflow 0.1.0 → 0.1.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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * deepflow statusline for Claude Code
4
- * Displays: model | project | context usage
4
+ * Displays: update | model | project | context usage
5
5
  */
6
6
 
7
7
  const fs = require('fs');
@@ -43,38 +43,36 @@ function buildStatusLine(data) {
43
43
  parts.push(`${colors.yellow}⬆ /df:update${colors.reset}`);
44
44
  }
45
45
 
46
- // Model name
47
- const model = formatModel(data.model || 'unknown');
46
+ // Model name (Claude Code format: data.model.display_name)
47
+ const model = data.model?.display_name || data.model?.id || 'unknown';
48
48
  parts.push(model);
49
49
 
50
- // Project name (from cwd)
51
- const project = path.basename(data.cwd || process.cwd());
50
+ // Project name (Claude Code format: data.workspace.current_dir)
51
+ const currentDir = data.workspace?.current_dir || data.cwd || process.cwd();
52
+ const project = path.basename(currentDir);
52
53
  parts.push(`${colors.cyan}${project}${colors.reset}`);
53
54
 
54
- // Context window meter
55
- const contextMeter = buildContextMeter(data.tokenUsage || {});
55
+ // Context window meter (Claude Code format: data.context_window)
56
+ const contextMeter = buildContextMeter(data.context_window || {});
56
57
  parts.push(contextMeter);
57
58
 
58
59
  return parts.join(` ${colors.dim}│${colors.reset} `);
59
60
  }
60
61
 
61
- function formatModel(model) {
62
- // Shorten model names
63
- const modelMap = {
64
- 'claude-opus-4-5-20251101': 'Opus 4.5',
65
- 'claude-sonnet-4-20250514': 'Sonnet 4',
66
- 'claude-haiku-3-5-20241022': 'Haiku 3.5'
67
- };
68
- return modelMap[model] || model.replace('claude-', '').replace(/-\d+$/, '');
69
- }
70
-
71
- function buildContextMeter(tokenUsage) {
72
- const used = tokenUsage.total || 0;
73
- const limit = tokenUsage.limit || 200000;
62
+ function buildContextMeter(contextWindow) {
63
+ // Use pre-calculated percentage if available
64
+ let percentage = contextWindow.used_percentage || 0;
65
+
66
+ // Fallback: calculate from current_usage if available
67
+ if (!percentage && contextWindow.current_usage && contextWindow.context_window_size) {
68
+ const usage = contextWindow.current_usage;
69
+ const totalTokens = (usage.input_tokens || 0) +
70
+ (usage.cache_creation_input_tokens || 0) +
71
+ (usage.cache_read_input_tokens || 0);
72
+ percentage = (totalTokens / contextWindow.context_window_size) * 100;
73
+ }
74
74
 
75
- // Scale so 80% shows as 100% (enforce 80% limit visually)
76
- const effectiveLimit = limit * 0.8;
77
- const percentage = Math.min(100, Math.round((used / effectiveLimit) * 100));
75
+ percentage = Math.min(100, Math.round(percentage));
78
76
 
79
77
  // Build 10-segment bar
80
78
  const segments = 10;
@@ -83,11 +81,11 @@ function buildContextMeter(tokenUsage) {
83
81
 
84
82
  // Color based on usage
85
83
  let color;
86
- if (percentage < 63) {
84
+ if (percentage < 50) {
87
85
  color = colors.green;
88
- } else if (percentage < 81) {
86
+ } else if (percentage < 70) {
89
87
  color = colors.yellow;
90
- } else if (percentage < 95) {
88
+ } else if (percentage < 90) {
91
89
  color = colors.orange;
92
90
  } else {
93
91
  color = colors.blink + colors.red;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepflow",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Stay in flow state - lightweight spec-driven task orchestration for Claude Code",
5
5
  "keywords": [
6
6
  "claude",