@idoa/dev-doctor-types 0.1.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 ADDED
@@ -0,0 +1,15 @@
1
+ # @idoa/dev-doctor-types
2
+
3
+ Shared TypeScript contracts for checks, results, pipeline reports, and adapter integration.
4
+
5
+ ## Highlights
6
+
7
+ - standardized severity and status models
8
+ - check/pipeline type contracts
9
+ - adapter interface for chain-specific repositories
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ import type { DiagnosticCheck, Severity } from '@idoa/dev-doctor-types';
15
+ ```
@@ -0,0 +1,60 @@
1
+ export type Severity = 'info' | 'warning' | 'error' | 'critical';
2
+ export type CheckStatus = 'pass' | 'warn' | 'fail' | 'skip';
3
+ export interface CheckMessage {
4
+ code: string;
5
+ message: string;
6
+ details?: Record<string, unknown>;
7
+ }
8
+ export interface CheckResult {
9
+ id: string;
10
+ title: string;
11
+ status: CheckStatus;
12
+ severity: Severity;
13
+ durationMs: number;
14
+ messages: CheckMessage[];
15
+ metadata?: Record<string, unknown>;
16
+ error?: {
17
+ name: string;
18
+ message: string;
19
+ };
20
+ }
21
+ export interface DiagnosticContext {
22
+ chainId?: string;
23
+ env?: Record<string, string | undefined>;
24
+ cwd?: string;
25
+ [key: string]: unknown;
26
+ }
27
+ export interface DiagnosticCheck<TContext extends DiagnosticContext = DiagnosticContext> {
28
+ id: string;
29
+ title: string;
30
+ defaultSeverity: Severity;
31
+ timeoutMs?: number;
32
+ run: (context: TContext) => Promise<Omit<CheckResult, 'id' | 'title' | 'severity' | 'durationMs'>>;
33
+ }
34
+ export interface PipelineConfig {
35
+ timeoutMs: number;
36
+ retries: number;
37
+ retryDelayMs: number;
38
+ maxRetryDelayMs: number;
39
+ }
40
+ export interface PipelineSummary {
41
+ total: number;
42
+ passed: number;
43
+ warned: number;
44
+ failed: number;
45
+ skipped: number;
46
+ highestSeverity: Severity;
47
+ }
48
+ export interface PipelineReport {
49
+ startedAt: string;
50
+ finishedAt: string;
51
+ durationMs: number;
52
+ summary: PipelineSummary;
53
+ results: CheckResult[];
54
+ }
55
+ export interface ChainAdapter<TContext extends DiagnosticContext = DiagnosticContext> {
56
+ readonly chainName: string;
57
+ createContext: () => Promise<TContext>;
58
+ checks: DiagnosticCheck<TContext>[];
59
+ }
60
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;AAEjE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAA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
+ "description": "Shared contracts and standardized types for chain-dev-doctor.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Mateja3m/chain-dev-doctor-core.git",
9
+ "directory": "packages/types"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/Mateja3m/chain-dev-doctor-core/issues"
13
+ },
14
+ "homepage": "https://github.com/Mateja3m/chain-dev-doctor-core/tree/main/packages/types#readme",
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "sideEffects": false,
19
+ "keywords": [
20
+ "idoa",
21
+ "types",
22
+ "web3",
23
+ "diagnostics"
24
+ ],
25
+ "type": "module",
26
+ "main": "./dist/index.js",
27
+ "module": "./dist/index.js",
28
+ "types": "./dist/index.d.ts",
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.js"
33
+ }
34
+ },
35
+ "files": [
36
+ "dist"
37
+ ],
38
+ "scripts": {
39
+ "build": "tsup src/index.ts --format esm --clean && tsc -p tsconfig.build.json",
40
+ "clean": "rm -rf dist",
41
+ "lint": "eslint src test --ext .ts",
42
+ "test": "vitest run",
43
+ "typecheck": "tsc -p tsconfig.json --noEmit"
44
+ }
45
+ }