claude-scope 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/package.json +2 -8
  2. package/dist/index.js +0 -78
package/package.json CHANGED
@@ -1,16 +1,10 @@
1
1
  {
2
2
  "name": "claude-scope",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Claude Code plugin for session status and analytics",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "main": "dist/index.js",
8
- "exports": {
9
- ".": {
10
- "import": "dist/index.js",
11
- "types": "dist/index.d.ts"
12
- }
13
- },
7
+ "main": "dist/claude-scope.cjs",
14
8
  "bin": {
15
9
  "claude-scope": "dist/claude-scope.cjs"
16
10
  },
package/dist/index.js DELETED
@@ -1,78 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Claude Scope - Claude Code statusline plugin
4
- * Entry point
5
- */
6
- import { WidgetRegistry } from './core/widget-registry.js';
7
- import { Renderer } from './core/renderer.js';
8
- import { GitWidget } from './widgets/git/git-widget.js';
9
- import { ModelWidget } from './widgets/model-widget.js';
10
- import { ContextWidget } from './widgets/context-widget.js';
11
- import { CostWidget } from './widgets/cost-widget.js';
12
- import { DurationWidget } from './widgets/duration-widget.js';
13
- import { GitChangesWidget } from './widgets/git/git-changes-widget.js';
14
- import { StdinProvider } from './data/stdin-provider.js';
15
- /**
16
- * Read stdin as string
17
- */
18
- async function readStdin() {
19
- const chunks = [];
20
- for await (const chunk of process.stdin) {
21
- chunks.push(chunk);
22
- }
23
- return Buffer.concat(chunks).toString('utf8');
24
- }
25
- /**
26
- * Main entry point
27
- */
28
- export async function main() {
29
- try {
30
- // Read JSON from stdin
31
- const stdin = await readStdin();
32
- // If stdin is empty, return empty string
33
- if (!stdin || stdin.trim().length === 0) {
34
- return '';
35
- }
36
- // Parse and validate with StdinProvider
37
- const provider = new StdinProvider();
38
- const stdinData = await provider.parse(stdin);
39
- // Create registry
40
- const registry = new WidgetRegistry();
41
- // Register all widgets (no constructor args needed)
42
- await registry.register(new ModelWidget());
43
- await registry.register(new ContextWidget());
44
- await registry.register(new CostWidget());
45
- await registry.register(new DurationWidget());
46
- await registry.register(new GitWidget());
47
- await registry.register(new GitChangesWidget());
48
- // Create renderer with error handling configuration
49
- const renderer = new Renderer({
50
- separator: ' │ ',
51
- onError: (error, widget) => {
52
- // Silently ignore widget errors - they return null
53
- },
54
- showErrors: false
55
- });
56
- // Update all widgets with data
57
- for (const widget of registry.getAll()) {
58
- await widget.update(stdinData);
59
- }
60
- // Render
61
- const output = await renderer.render(registry.getEnabledWidgets(), { width: 80, timestamp: Date.now() });
62
- return output || '';
63
- }
64
- catch (error) {
65
- // Return empty string on any error
66
- return '';
67
- }
68
- }
69
- // Run when executed (works with both direct node and npx)
70
- main().then((output) => {
71
- if (output) {
72
- console.log(output);
73
- }
74
- }).catch(() => {
75
- // Silently fail - return empty status line
76
- process.exit(0);
77
- });
78
- //# sourceMappingURL=index.js.map