claude-scope 0.1.8 → 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/dist/claude-scope.cjs +764 -0
- package/package.json +9 -6
- package/dist/constants.d.ts +0 -56
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -57
- package/dist/constants.js.map +0 -1
- package/dist/core/renderer.d.ts +0 -51
- package/dist/core/renderer.d.ts.map +0 -1
- package/dist/core/renderer.js +0 -75
- package/dist/core/renderer.js.map +0 -1
- package/dist/core/types.d.ts +0 -56
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js +0 -5
- package/dist/core/types.js.map +0 -1
- package/dist/core/widget-registry.d.ts +0 -40
- package/dist/core/widget-registry.d.ts.map +0 -1
- package/dist/core/widget-registry.js +0 -75
- package/dist/core/widget-registry.js.map +0 -1
- package/dist/core/widget-types.d.ts +0 -30
- package/dist/core/widget-types.d.ts.map +0 -1
- package/dist/core/widget-types.js +0 -30
- package/dist/core/widget-types.js.map +0 -1
- package/dist/data/stdin-provider.d.ts +0 -44
- package/dist/data/stdin-provider.d.ts.map +0 -1
- package/dist/data/stdin-provider.js +0 -72
- package/dist/data/stdin-provider.js.map +0 -1
- package/dist/index.d.ts +0 -10
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/providers/git-provider.d.ts +0 -71
- package/dist/providers/git-provider.d.ts.map +0 -1
- package/dist/providers/git-provider.js +0 -73
- package/dist/providers/git-provider.js.map +0 -1
- package/dist/schemas/stdin-schema.d.ts +0 -84
- package/dist/schemas/stdin-schema.d.ts.map +0 -1
- package/dist/schemas/stdin-schema.js +0 -48
- package/dist/schemas/stdin-schema.js.map +0 -1
- package/dist/types.d.ts +0 -31
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -8
- package/dist/types.js.map +0 -1
- package/dist/ui/utils/colors.d.ts +0 -52
- package/dist/ui/utils/colors.d.ts.map +0 -1
- package/dist/ui/utils/colors.js +0 -54
- package/dist/ui/utils/colors.js.map +0 -1
- package/dist/ui/utils/formatters.d.ts +0 -56
- package/dist/ui/utils/formatters.d.ts.map +0 -1
- package/dist/ui/utils/formatters.js +0 -114
- package/dist/ui/utils/formatters.js.map +0 -1
- package/dist/validation/combinators.d.ts +0 -10
- package/dist/validation/combinators.d.ts.map +0 -1
- package/dist/validation/combinators.js +0 -49
- package/dist/validation/combinators.js.map +0 -1
- package/dist/validation/core.d.ts +0 -30
- package/dist/validation/core.d.ts.map +0 -1
- package/dist/validation/core.js +0 -2
- package/dist/validation/core.js.map +0 -1
- package/dist/validation/index.d.ts +0 -4
- package/dist/validation/index.d.ts.map +0 -1
- package/dist/validation/index.js +0 -4
- package/dist/validation/index.js.map +0 -1
- package/dist/validation/result.d.ts +0 -5
- package/dist/validation/result.d.ts.map +0 -1
- package/dist/validation/result.js +0 -11
- package/dist/validation/result.js.map +0 -1
- package/dist/validation/validators.d.ts +0 -7
- package/dist/validation/validators.d.ts.map +0 -1
- package/dist/validation/validators.js +0 -41
- package/dist/validation/validators.js.map +0 -1
- package/dist/widgets/context-widget.d.ts +0 -13
- package/dist/widgets/context-widget.d.ts.map +0 -1
- package/dist/widgets/context-widget.js +0 -31
- package/dist/widgets/context-widget.js.map +0 -1
- package/dist/widgets/core/stdin-data-widget.d.ts +0 -93
- package/dist/widgets/core/stdin-data-widget.d.ts.map +0 -1
- package/dist/widgets/core/stdin-data-widget.js +0 -84
- package/dist/widgets/core/stdin-data-widget.js.map +0 -1
- package/dist/widgets/cost-widget.d.ts +0 -13
- package/dist/widgets/cost-widget.d.ts.map +0 -1
- package/dist/widgets/cost-widget.js +0 -18
- package/dist/widgets/cost-widget.js.map +0 -1
- package/dist/widgets/duration-widget.d.ts +0 -13
- package/dist/widgets/duration-widget.d.ts.map +0 -1
- package/dist/widgets/duration-widget.js +0 -18
- package/dist/widgets/duration-widget.js.map +0 -1
- package/dist/widgets/git/git-changes-widget.d.ts +0 -38
- package/dist/widgets/git/git-changes-widget.d.ts.map +0 -1
- package/dist/widgets/git/git-changes-widget.js +0 -91
- package/dist/widgets/git/git-changes-widget.js.map +0 -1
- package/dist/widgets/git/git-widget.d.ts +0 -37
- package/dist/widgets/git/git-widget.d.ts.map +0 -1
- package/dist/widgets/git/git-widget.js +0 -67
- package/dist/widgets/git/git-widget.js.map +0 -1
- package/dist/widgets/model-widget.d.ts +0 -13
- package/dist/widgets/model-widget.d.ts.map +0 -1
- package/dist/widgets/model-widget.js +0 -15
- package/dist/widgets/model-widget.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-scope",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Claude Code plugin for session status and analytics",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -12,16 +12,19 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"bin": {
|
|
15
|
-
"claude-scope": "dist/
|
|
15
|
+
"claude-scope": "dist/claude-scope.cjs"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
|
-
"dist/",
|
|
18
|
+
"dist/claude-scope.cjs",
|
|
19
19
|
"README.md",
|
|
20
20
|
"LICENSE.md"
|
|
21
21
|
],
|
|
22
22
|
"scripts": {
|
|
23
|
-
"prepack": "
|
|
24
|
-
"build": "tsc &&
|
|
23
|
+
"prepack": "npm run build",
|
|
24
|
+
"build": "npm run build:tsc && npm run build:bundle",
|
|
25
|
+
"build:tsc": "tsc",
|
|
26
|
+
"build:bundle": "esbuild src/index.ts --bundle --platform=node --target=node18 --outfile=dist/claude-scope.cjs && chmod +x dist/claude-scope.cjs",
|
|
27
|
+
"prebuild:bundle": "npm run build:tsc",
|
|
25
28
|
"test": "tsx --test tests/e2e/stdin-flow.test.ts tests/integration/cli-flow.integration.test.ts tests/integration/five-widgets.integration.test.ts tests/unit/cli.test.ts tests/unit/types.test.ts tests/unit/core/*.test.ts tests/unit/data/*.test.ts tests/unit/utils/*.test.ts tests/unit/widgets/*.test.ts",
|
|
26
29
|
"test:unit": "tsx --test tests/unit/cli.test.ts tests/unit/types.test.ts tests/unit/core/*.test.ts tests/unit/data/*.test.ts tests/unit/utils/*.test.ts tests/unit/widgets/*.test.ts",
|
|
27
30
|
"test:integration": "tsx --test tests/e2e/stdin-flow.test.ts tests/integration/cli-flow.integration.test.ts tests/integration/five-widgets.integration.test.ts",
|
|
@@ -30,11 +33,11 @@
|
|
|
30
33
|
"test:snapshot:verify": "tsx --test tests/e2e/stdin-flow.test.ts tests/integration/cli-flow.integration.test.ts tests/integration/five-widgets.integration.test.ts tests/unit/cli.test.ts tests/unit/types.test.ts tests/unit/core/*.test.ts tests/unit/data/*.test.ts tests/unit/utils/*.test.ts tests/unit/widgets/*.test.ts",
|
|
31
34
|
"dev": "tsx src/index.ts"
|
|
32
35
|
},
|
|
33
|
-
"dependencies": {},
|
|
34
36
|
"devDependencies": {
|
|
35
37
|
"@types/node": "^22.10.2",
|
|
36
38
|
"c8": "^10.1.3",
|
|
37
39
|
"chai": "^6.2.2",
|
|
40
|
+
"esbuild": "^0.24.2",
|
|
38
41
|
"tsx": "^4.19.2",
|
|
39
42
|
"typescript": "^5.7.2"
|
|
40
43
|
},
|
package/dist/constants.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Constants used throughout the application
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Time-related constants
|
|
6
|
-
*/
|
|
7
|
-
export declare const TIME: {
|
|
8
|
-
/** Milliseconds per second */
|
|
9
|
-
readonly MS_PER_SECOND: 1000;
|
|
10
|
-
/** Seconds per minute */
|
|
11
|
-
readonly SECONDS_PER_MINUTE: 60;
|
|
12
|
-
/** Seconds per hour */
|
|
13
|
-
readonly SECONDS_PER_HOUR: 3600;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Cost formatting thresholds
|
|
17
|
-
*/
|
|
18
|
-
export declare const COST_THRESHOLDS: {
|
|
19
|
-
/** Below this value, show 4 decimal places ($0.0012) */
|
|
20
|
-
readonly SMALL: 0.01;
|
|
21
|
-
/** Above this value, show no decimal places ($123) */
|
|
22
|
-
readonly LARGE: 100;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Context usage color thresholds (percentages)
|
|
26
|
-
*/
|
|
27
|
-
export declare const CONTEXT_THRESHOLDS: {
|
|
28
|
-
/** Below this: green (low usage) */
|
|
29
|
-
readonly LOW_MEDIUM: 50;
|
|
30
|
-
/** Below this: yellow (medium usage), above: red (high usage) */
|
|
31
|
-
readonly MEDIUM_HIGH: 80;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Default values
|
|
35
|
-
*/
|
|
36
|
-
export declare const DEFAULTS: {
|
|
37
|
-
/** Default separator between widgets */
|
|
38
|
-
readonly SEPARATOR: " ";
|
|
39
|
-
/** Default width for progress bars in characters */
|
|
40
|
-
readonly PROGRESS_BAR_WIDTH: 20;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* ANSI color codes
|
|
44
|
-
*/
|
|
45
|
-
export declare const ANSI_COLORS: {
|
|
46
|
-
/** Green color */
|
|
47
|
-
readonly GREEN: "\u001B[32m";
|
|
48
|
-
/** Yellow color */
|
|
49
|
-
readonly YELLOW: "\u001B[33m";
|
|
50
|
-
/** Red color */
|
|
51
|
-
readonly RED: "\u001B[31m";
|
|
52
|
-
/** Reset color */
|
|
53
|
-
readonly RESET: "\u001B[0m";
|
|
54
|
-
};
|
|
55
|
-
export declare const DEFAULT_PROGRESS_BAR_WIDTH: 20;
|
|
56
|
-
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,eAAO,MAAM,IAAI;IACf,8BAA8B;;IAE9B,yBAAyB;;IAEzB,uBAAuB;;CAEf,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,eAAe;IAC1B,wDAAwD;;IAExD,sDAAsD;;CAE9C,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,kBAAkB;IAC7B,oCAAoC;;IAEpC,iEAAiE;;CAEzD,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,QAAQ;IACnB,wCAAwC;;IAExC,oDAAoD;;CAE5C,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,WAAW;IACtB,kBAAkB;;IAElB,mBAAmB;;IAEnB,gBAAgB;;IAEhB,kBAAkB;;CAEV,CAAC;AAGX,eAAO,MAAM,0BAA0B,IAA8B,CAAC"}
|
package/dist/constants.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Constants used throughout the application
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Time-related constants
|
|
6
|
-
*/
|
|
7
|
-
export const TIME = {
|
|
8
|
-
/** Milliseconds per second */
|
|
9
|
-
MS_PER_SECOND: 1000,
|
|
10
|
-
/** Seconds per minute */
|
|
11
|
-
SECONDS_PER_MINUTE: 60,
|
|
12
|
-
/** Seconds per hour */
|
|
13
|
-
SECONDS_PER_HOUR: 3600,
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Cost formatting thresholds
|
|
17
|
-
*/
|
|
18
|
-
export const COST_THRESHOLDS = {
|
|
19
|
-
/** Below this value, show 4 decimal places ($0.0012) */
|
|
20
|
-
SMALL: 0.01,
|
|
21
|
-
/** Above this value, show no decimal places ($123) */
|
|
22
|
-
LARGE: 100,
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Context usage color thresholds (percentages)
|
|
26
|
-
*/
|
|
27
|
-
export const CONTEXT_THRESHOLDS = {
|
|
28
|
-
/** Below this: green (low usage) */
|
|
29
|
-
LOW_MEDIUM: 50,
|
|
30
|
-
/** Below this: yellow (medium usage), above: red (high usage) */
|
|
31
|
-
MEDIUM_HIGH: 80,
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Default values
|
|
35
|
-
*/
|
|
36
|
-
export const DEFAULTS = {
|
|
37
|
-
/** Default separator between widgets */
|
|
38
|
-
SEPARATOR: ' ',
|
|
39
|
-
/** Default width for progress bars in characters */
|
|
40
|
-
PROGRESS_BAR_WIDTH: 20,
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* ANSI color codes
|
|
44
|
-
*/
|
|
45
|
-
export const ANSI_COLORS = {
|
|
46
|
-
/** Green color */
|
|
47
|
-
GREEN: '\x1b[32m',
|
|
48
|
-
/** Yellow color */
|
|
49
|
-
YELLOW: '\x1b[33m',
|
|
50
|
-
/** Red color */
|
|
51
|
-
RED: '\x1b[31m',
|
|
52
|
-
/** Reset color */
|
|
53
|
-
RESET: '\x1b[0m',
|
|
54
|
-
};
|
|
55
|
-
// Re-export for backward compatibility
|
|
56
|
-
export const DEFAULT_PROGRESS_BAR_WIDTH = DEFAULTS.PROGRESS_BAR_WIDTH;
|
|
57
|
-
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,8BAA8B;IAC9B,aAAa,EAAE,IAAI;IACnB,yBAAyB;IACzB,kBAAkB,EAAE,EAAE;IACtB,uBAAuB;IACvB,gBAAgB,EAAE,IAAI;CACd,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,wDAAwD;IACxD,KAAK,EAAE,IAAI;IACX,sDAAsD;IACtD,KAAK,EAAE,GAAG;CACF,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,oCAAoC;IACpC,UAAU,EAAE,EAAE;IACd,iEAAiE;IACjE,WAAW,EAAE,EAAE;CACP,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,wCAAwC;IACxC,SAAS,EAAE,GAAG;IACd,oDAAoD;IACpD,kBAAkB,EAAE,EAAE;CACd,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,kBAAkB;IAClB,KAAK,EAAE,UAAU;IACjB,mBAAmB;IACnB,MAAM,EAAE,UAAU;IAClB,gBAAgB;IAChB,GAAG,EAAE,UAAU;IACf,kBAAkB;IAClB,KAAK,EAAE,SAAS;CACR,CAAC;AAEX,uCAAuC;AACvC,MAAM,CAAC,MAAM,0BAA0B,GAAG,QAAQ,CAAC,kBAAkB,CAAC"}
|
package/dist/core/renderer.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unified rendering engine with error boundaries
|
|
3
|
-
* Combines widget outputs into statusline
|
|
4
|
-
*/
|
|
5
|
-
import type { IWidget } from './types.js';
|
|
6
|
-
import type { RenderContext } from '../types.js';
|
|
7
|
-
/**
|
|
8
|
-
* Renderer configuration options
|
|
9
|
-
*/
|
|
10
|
-
export interface RendererOptions {
|
|
11
|
-
/** Separator between widget outputs */
|
|
12
|
-
separator?: string;
|
|
13
|
-
/** Error handler callback for widget render failures */
|
|
14
|
-
onError?: (error: Error, widget: IWidget) => void;
|
|
15
|
-
/** Show error placeholder in output (for debugging) */
|
|
16
|
-
showErrors?: boolean;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Renderer for combining widget outputs with error boundaries
|
|
20
|
-
*
|
|
21
|
-
* Failed widgets are gracefully skipped, preventing single widget
|
|
22
|
-
* failures from breaking the entire statusline.
|
|
23
|
-
*/
|
|
24
|
-
export declare class Renderer {
|
|
25
|
-
private separator;
|
|
26
|
-
private onError?;
|
|
27
|
-
private showErrors;
|
|
28
|
-
constructor(options?: RendererOptions);
|
|
29
|
-
/**
|
|
30
|
-
* Render widgets into a single line with error boundaries
|
|
31
|
-
*
|
|
32
|
-
* Widgets that throw errors are logged (via onError callback) and skipped,
|
|
33
|
-
* allowing other widgets to continue rendering.
|
|
34
|
-
*
|
|
35
|
-
* @param widgets - Array of widgets to render
|
|
36
|
-
* @param context - Render context with width and timestamp
|
|
37
|
-
* @returns Combined widget outputs separated by separator
|
|
38
|
-
*/
|
|
39
|
-
render(widgets: IWidget[], context: RenderContext): Promise<string>;
|
|
40
|
-
/**
|
|
41
|
-
* Set custom separator
|
|
42
|
-
*/
|
|
43
|
-
setSeparator(separator: string): void;
|
|
44
|
-
/**
|
|
45
|
-
* Handle widget render errors
|
|
46
|
-
*
|
|
47
|
-
* Calls the onError callback if provided, otherwise logs to console.warn
|
|
48
|
-
*/
|
|
49
|
-
private handleError;
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/core/renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,uDAAuD;IACvD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;GAKG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAC,CAA0C;IAC1D,OAAO,CAAC,UAAU,CAAU;gBAEhB,OAAO,GAAE,eAAoB;IAMzC;;;;;;;;;OASG;IACG,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IA2BzE;;OAEG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIrC;;;;OAIG;IACH,OAAO,CAAC,WAAW;CAQpB"}
|
package/dist/core/renderer.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unified rendering engine with error boundaries
|
|
3
|
-
* Combines widget outputs into statusline
|
|
4
|
-
*/
|
|
5
|
-
import { DEFAULTS } from '../constants.js';
|
|
6
|
-
/**
|
|
7
|
-
* Renderer for combining widget outputs with error boundaries
|
|
8
|
-
*
|
|
9
|
-
* Failed widgets are gracefully skipped, preventing single widget
|
|
10
|
-
* failures from breaking the entire statusline.
|
|
11
|
-
*/
|
|
12
|
-
export class Renderer {
|
|
13
|
-
separator;
|
|
14
|
-
onError;
|
|
15
|
-
showErrors;
|
|
16
|
-
constructor(options = {}) {
|
|
17
|
-
this.separator = options.separator ?? DEFAULTS.SEPARATOR;
|
|
18
|
-
this.onError = options.onError;
|
|
19
|
-
this.showErrors = options.showErrors ?? false;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Render widgets into a single line with error boundaries
|
|
23
|
-
*
|
|
24
|
-
* Widgets that throw errors are logged (via onError callback) and skipped,
|
|
25
|
-
* allowing other widgets to continue rendering.
|
|
26
|
-
*
|
|
27
|
-
* @param widgets - Array of widgets to render
|
|
28
|
-
* @param context - Render context with width and timestamp
|
|
29
|
-
* @returns Combined widget outputs separated by separator
|
|
30
|
-
*/
|
|
31
|
-
async render(widgets, context) {
|
|
32
|
-
const outputs = [];
|
|
33
|
-
for (const widget of widgets) {
|
|
34
|
-
if (!widget.isEnabled()) {
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
try {
|
|
38
|
-
const output = await widget.render(context);
|
|
39
|
-
if (output !== null) {
|
|
40
|
-
outputs.push(output);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
// Log error but continue rendering other widgets
|
|
45
|
-
this.handleError(error, widget);
|
|
46
|
-
// Optional: show error placeholder in output
|
|
47
|
-
if (this.showErrors) {
|
|
48
|
-
outputs.push(`${widget.id}:<err>`);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return outputs.join(this.separator);
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Set custom separator
|
|
56
|
-
*/
|
|
57
|
-
setSeparator(separator) {
|
|
58
|
-
this.separator = separator;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Handle widget render errors
|
|
62
|
-
*
|
|
63
|
-
* Calls the onError callback if provided, otherwise logs to console.warn
|
|
64
|
-
*/
|
|
65
|
-
handleError(error, widget) {
|
|
66
|
-
if (this.onError) {
|
|
67
|
-
this.onError(error, widget);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
// Default: silent fail with console.warn
|
|
71
|
-
console.warn(`[Widget ${widget.id}] ${error.message}`);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=renderer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../src/core/renderer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAc3C;;;;;GAKG;AACH,MAAM,OAAO,QAAQ;IACX,SAAS,CAAS;IAClB,OAAO,CAA2C;IAClD,UAAU,CAAU;IAE5B,YAAY,UAA2B,EAAE;QACvC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,QAAQ,CAAC,SAAS,CAAC;QACzD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,KAAK,CAAC;IAChD,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,MAAM,CAAC,OAAkB,EAAE,OAAsB;QACrD,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;gBACxB,SAAS;YACX,CAAC;YAED,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBAC5C,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;oBACpB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,iDAAiD;gBACjD,IAAI,CAAC,WAAW,CAAC,KAAc,EAAE,MAAM,CAAC,CAAC;gBAEzC,6CAA6C;gBAC7C,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;oBACpB,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;gBACrC,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,SAAiB;QAC5B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACK,WAAW,CAAC,KAAY,EAAE,MAAe;QAC/C,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,yCAAyC;YACzC,OAAO,CAAC,IAAI,CAAC,WAAW,MAAM,CAAC,EAAE,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACzD,CAAC;IACH,CAAC;CACF"}
|
package/dist/core/types.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core types for the widget system
|
|
3
|
-
*/
|
|
4
|
-
import type { StdinData, RenderContext } from '../types.js';
|
|
5
|
-
/**
|
|
6
|
-
* Widget metadata describing the widget
|
|
7
|
-
*/
|
|
8
|
-
export interface IWidgetMetadata {
|
|
9
|
-
name: string;
|
|
10
|
-
description: string;
|
|
11
|
-
version: string;
|
|
12
|
-
author: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Initialization context passed to widgets
|
|
16
|
-
*/
|
|
17
|
-
export interface WidgetContext {
|
|
18
|
-
config: Record<string, unknown>;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Interface that all widgets must implement
|
|
22
|
-
*/
|
|
23
|
-
export interface IWidget {
|
|
24
|
-
/** Unique widget identifier */
|
|
25
|
-
readonly id: string;
|
|
26
|
-
/** Widget metadata */
|
|
27
|
-
readonly metadata: IWidgetMetadata;
|
|
28
|
-
/**
|
|
29
|
-
* Initialize the widget with context
|
|
30
|
-
* Called once when widget is registered
|
|
31
|
-
*/
|
|
32
|
-
initialize(context: WidgetContext): Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Render the widget output
|
|
35
|
-
* Called on each update cycle
|
|
36
|
-
* @returns String to render, or null if widget should not display
|
|
37
|
-
*/
|
|
38
|
-
render(context: RenderContext): Promise<string | null>;
|
|
39
|
-
/**
|
|
40
|
-
* Update widget with new data
|
|
41
|
-
* Called when new stdin data arrives
|
|
42
|
-
*/
|
|
43
|
-
update(data: StdinData): Promise<void>;
|
|
44
|
-
/**
|
|
45
|
-
* Check if widget is enabled
|
|
46
|
-
* Widget only renders if enabled
|
|
47
|
-
*/
|
|
48
|
-
isEnabled(): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Cleanup resources
|
|
51
|
-
* Optional - called when widget is unregistered
|
|
52
|
-
*/
|
|
53
|
-
cleanup?(): Promise<void>;
|
|
54
|
-
}
|
|
55
|
-
export type { StdinData, RenderContext };
|
|
56
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/core/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,sBAAsB;IACtB,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IAEnC;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEvD;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvC;;;OAGG;IACH,SAAS,IAAI,OAAO,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAID,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/core/types.js
DELETED
package/dist/core/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Central widget registry
|
|
3
|
-
* Manages widget lifecycle and retrieval
|
|
4
|
-
*/
|
|
5
|
-
import type { IWidget, WidgetContext } from './types.js';
|
|
6
|
-
/**
|
|
7
|
-
* Registry for managing widgets
|
|
8
|
-
*/
|
|
9
|
-
export declare class WidgetRegistry {
|
|
10
|
-
private widgets;
|
|
11
|
-
/**
|
|
12
|
-
* Register a widget
|
|
13
|
-
*/
|
|
14
|
-
register(widget: IWidget, context?: WidgetContext): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Unregister a widget
|
|
17
|
-
*/
|
|
18
|
-
unregister(id: string): Promise<void>;
|
|
19
|
-
/**
|
|
20
|
-
* Get a widget by id
|
|
21
|
-
*/
|
|
22
|
-
get(id: string): IWidget | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* Check if widget is registered
|
|
25
|
-
*/
|
|
26
|
-
has(id: string): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Get all registered widgets
|
|
29
|
-
*/
|
|
30
|
-
getAll(): IWidget[];
|
|
31
|
-
/**
|
|
32
|
-
* Get only enabled widgets
|
|
33
|
-
*/
|
|
34
|
-
getEnabledWidgets(): IWidget[];
|
|
35
|
-
/**
|
|
36
|
-
* Clear all widgets
|
|
37
|
-
*/
|
|
38
|
-
clear(): Promise<void>;
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=widget-registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"widget-registry.d.ts","sourceRoot":"","sources":["../../src/core/widget-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEzD;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAmC;IAElD;;OAEG;IACG,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAYvE;;OAEG;IACG,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAe3C;;OAEG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAIpC;;OAEG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIxB;;OAEG;IACH,MAAM,IAAI,OAAO,EAAE;IAInB;;OAEG;IACH,iBAAiB,IAAI,OAAO,EAAE;IAI9B;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAQ7B"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Central widget registry
|
|
3
|
-
* Manages widget lifecycle and retrieval
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Registry for managing widgets
|
|
7
|
-
*/
|
|
8
|
-
export class WidgetRegistry {
|
|
9
|
-
widgets = new Map();
|
|
10
|
-
/**
|
|
11
|
-
* Register a widget
|
|
12
|
-
*/
|
|
13
|
-
async register(widget, context) {
|
|
14
|
-
if (this.widgets.has(widget.id)) {
|
|
15
|
-
throw new Error(`Widget with id '${widget.id}' already registered`);
|
|
16
|
-
}
|
|
17
|
-
if (context) {
|
|
18
|
-
await widget.initialize(context);
|
|
19
|
-
}
|
|
20
|
-
this.widgets.set(widget.id, widget);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Unregister a widget
|
|
24
|
-
*/
|
|
25
|
-
async unregister(id) {
|
|
26
|
-
const widget = this.widgets.get(id);
|
|
27
|
-
if (!widget) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
try {
|
|
31
|
-
if (widget.cleanup) {
|
|
32
|
-
await widget.cleanup();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
finally {
|
|
36
|
-
this.widgets.delete(id);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Get a widget by id
|
|
41
|
-
*/
|
|
42
|
-
get(id) {
|
|
43
|
-
return this.widgets.get(id);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Check if widget is registered
|
|
47
|
-
*/
|
|
48
|
-
has(id) {
|
|
49
|
-
return this.widgets.has(id);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Get all registered widgets
|
|
53
|
-
*/
|
|
54
|
-
getAll() {
|
|
55
|
-
return Array.from(this.widgets.values());
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Get only enabled widgets
|
|
59
|
-
*/
|
|
60
|
-
getEnabledWidgets() {
|
|
61
|
-
return this.getAll().filter(w => w.isEnabled());
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Clear all widgets
|
|
65
|
-
*/
|
|
66
|
-
async clear() {
|
|
67
|
-
for (const widget of this.widgets.values()) {
|
|
68
|
-
if (widget.cleanup) {
|
|
69
|
-
await widget.cleanup();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
this.widgets.clear();
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=widget-registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"widget-registry.js","sourceRoot":"","sources":["../../src/core/widget-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,OAAO,cAAc;IACjB,OAAO,GAAyB,IAAI,GAAG,EAAE,CAAC;IAElD;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,MAAe,EAAE,OAAuB;QACrD,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,CAAC,EAAE,sBAAsB,CAAC,CAAC;QACtE,CAAC;QAED,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU,CAAC,EAAU;QACzB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO;QACT,CAAC;QAED,IAAI,CAAC;YACH,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;YACzB,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,EAAU;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,iBAAiB;QACf,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;YAC3C,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;YACzB,CAAC;QACH,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Widget type utilities and helpers
|
|
3
|
-
*/
|
|
4
|
-
import type { IWidgetMetadata, IWidget } from './types.js';
|
|
5
|
-
/**
|
|
6
|
-
* Create widget metadata with defaults
|
|
7
|
-
*
|
|
8
|
-
* @param name - Widget name
|
|
9
|
-
* @param description - Widget description
|
|
10
|
-
* @param version - Widget version (default: '1.0.0')
|
|
11
|
-
* @param author - Widget author (default: 'claude-scope')
|
|
12
|
-
* @returns Widget metadata object
|
|
13
|
-
*/
|
|
14
|
-
export declare function createWidgetMetadata(name: string, description: string, version?: string, author?: string): IWidgetMetadata;
|
|
15
|
-
/**
|
|
16
|
-
* Type for widget constructor
|
|
17
|
-
* Can be used with dependency injection
|
|
18
|
-
*/
|
|
19
|
-
export type WidgetConstructor = new (...args: unknown[]) => IWidget;
|
|
20
|
-
/**
|
|
21
|
-
* Widget configuration options
|
|
22
|
-
*/
|
|
23
|
-
export interface WidgetConfig {
|
|
24
|
-
enabled?: boolean;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Create widget config with defaults
|
|
28
|
-
*/
|
|
29
|
-
export declare function createWidgetConfig(config?: WidgetConfig): WidgetConfig;
|
|
30
|
-
//# sourceMappingURL=widget-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"widget-types.d.ts","sourceRoot":"","sources":["../../src/core/widget-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE3D;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,OAAO,SAAU,EACjB,MAAM,SAAiB,GACtB,eAAe,CAOjB;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,GAAE,YAAiB,GAAG,YAAY,CAK1E"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Widget type utilities and helpers
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Create widget metadata with defaults
|
|
6
|
-
*
|
|
7
|
-
* @param name - Widget name
|
|
8
|
-
* @param description - Widget description
|
|
9
|
-
* @param version - Widget version (default: '1.0.0')
|
|
10
|
-
* @param author - Widget author (default: 'claude-scope')
|
|
11
|
-
* @returns Widget metadata object
|
|
12
|
-
*/
|
|
13
|
-
export function createWidgetMetadata(name, description, version = '1.0.0', author = 'claude-scope') {
|
|
14
|
-
return {
|
|
15
|
-
name,
|
|
16
|
-
description,
|
|
17
|
-
version,
|
|
18
|
-
author
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Create widget config with defaults
|
|
23
|
-
*/
|
|
24
|
-
export function createWidgetConfig(config = {}) {
|
|
25
|
-
return {
|
|
26
|
-
enabled: true,
|
|
27
|
-
...config
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=widget-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"widget-types.js","sourceRoot":"","sources":["../../src/core/widget-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAY,EACZ,WAAmB,EACnB,OAAO,GAAG,OAAO,EACjB,MAAM,GAAG,cAAc;IAEvB,OAAO;QACL,IAAI;QACJ,WAAW;QACX,OAAO;QACP,MAAM;KACP,CAAC;AACJ,CAAC;AAeD;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAuB,EAAE;IAC1D,OAAO;QACL,OAAO,EAAE,IAAI;QACb,GAAG,MAAM;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stdin provider for parsing JSON data from stdin
|
|
3
|
-
* Parses and validates Claude Code session data
|
|
4
|
-
*/
|
|
5
|
-
import type { StdinData } from '../types.js';
|
|
6
|
-
/**
|
|
7
|
-
* Error thrown when stdin parsing fails
|
|
8
|
-
*/
|
|
9
|
-
export declare class StdinParseError extends Error {
|
|
10
|
-
constructor(message: string);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Error thrown when stdin validation fails
|
|
14
|
-
*/
|
|
15
|
-
export declare class StdinValidationError extends Error {
|
|
16
|
-
constructor(message: string);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Stdin provider for parsing and validating JSON data
|
|
20
|
-
*/
|
|
21
|
-
export declare class StdinProvider {
|
|
22
|
-
/**
|
|
23
|
-
* Parse and validate JSON string from stdin
|
|
24
|
-
* @param input JSON string to parse
|
|
25
|
-
* @returns Validated StdinData object
|
|
26
|
-
* @throws StdinParseError if JSON is malformed
|
|
27
|
-
* @throws StdinValidationError if data doesn't match schema
|
|
28
|
-
*/
|
|
29
|
-
parse(input: string): Promise<StdinData>;
|
|
30
|
-
/**
|
|
31
|
-
* Safe parse that returns result instead of throwing
|
|
32
|
-
* Useful for testing and optional validation
|
|
33
|
-
* @param input JSON string to parse
|
|
34
|
-
* @returns Result object with success flag
|
|
35
|
-
*/
|
|
36
|
-
safeParse(input: string): Promise<{
|
|
37
|
-
success: true;
|
|
38
|
-
data: StdinData;
|
|
39
|
-
} | {
|
|
40
|
-
success: false;
|
|
41
|
-
error: string;
|
|
42
|
-
}>;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=stdin-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stdin-provider.d.ts","sourceRoot":"","sources":["../../src/data/stdin-provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB;;;;;;OAMG;IACG,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IA0B9C;;;;;OAKG;IACG,SAAS,CACb,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,SAAS,CAAA;KAAE,GAAG;QAAE,OAAO,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAQnF"}
|