@relkit/diagnostics 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 rel-kit
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @relkit/diagnostics
2
+
3
+ Unsupported internal RELKIT diagnostics; use @relkit/cli.
4
+
5
+ See [@relkit/app](https://github.com/rel-kit/relkit) for supported application APIs.
@@ -0,0 +1,45 @@
1
+ import type { SourceLocation } from "@relkit/contracts";
2
+ export type DiagnosticSeverity = "info" | "warning" | "error";
3
+ /** A secondary source location attached to a diagnostic. */
4
+ export interface DiagnosticLocation extends SourceLocation {
5
+ readonly message?: string;
6
+ readonly descriptorId?: string;
7
+ }
8
+ export interface Diagnostic {
9
+ readonly code: string;
10
+ readonly severity: DiagnosticSeverity;
11
+ readonly message: string;
12
+ readonly file?: string;
13
+ readonly line?: number;
14
+ readonly column?: number;
15
+ readonly descriptorId?: string;
16
+ readonly related?: readonly DiagnosticLocation[];
17
+ readonly suggestion?: string;
18
+ readonly documentationPath?: string;
19
+ }
20
+ export type DiagnosticLocationInput = DiagnosticLocation;
21
+ export interface DiagnosticInput {
22
+ readonly code: string;
23
+ readonly severity: DiagnosticSeverity;
24
+ readonly message: string;
25
+ readonly location?: SourceLocation;
26
+ readonly file?: string;
27
+ readonly line?: number;
28
+ readonly column?: number;
29
+ readonly descriptorId?: string;
30
+ readonly descriptor?: string;
31
+ readonly related?: readonly DiagnosticLocationInput[];
32
+ readonly suggestion?: string;
33
+ readonly documentationPath?: string;
34
+ readonly docs?: string;
35
+ }
36
+ export interface DiagnosticNormalizationOptions {
37
+ readonly projectRoot?: string;
38
+ }
39
+ /** Creates an immutable diagnostic with normalized, project-relative paths. */
40
+ export declare function createDiagnostic(input: DiagnosticInput, options?: DiagnosticNormalizationOptions): Diagnostic;
41
+ /** Normalizes an existing diagnostic or a diagnostic-shaped value. */
42
+ export declare const normalizeDiagnostic: typeof createDiagnostic;
43
+ /** Sorts diagnostics by portable source location and stable content. */
44
+ export declare function sortDiagnostics(diagnostics: readonly DiagnosticInput[], options?: DiagnosticNormalizationOptions): readonly Diagnostic[];
45
+ //# sourceMappingURL=diagnostic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostic.d.ts","sourceRoot":"","sources":["../src/diagnostic.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAE9D,4DAA4D;AAC5D,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,C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I,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAID,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,eAAe,EACtB,OAAO,GAAE,8BAAmC,GAC3C,UAAU,CAkBZ;AAED,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,yBAAmB,CAAC;AAEpD,wEAAwE;AACxE,wBAAgB,eAAe,CAC7B,WAAW,EAAE,SAAS,eAAe,EAAE,EACvC,OAAO,GAAE,8BAAmC,GAC3C,SAAS,UAAU,EAAE,CAIvB"}
@@ -0,0 +1,113 @@
1
+ import { createSourceLocation, normalizeId, normalizeSourceLocation, normalizeSourcePath, } from "@relkit/contracts";
2
+ /** Creates an immutable diagnostic with normalized, project-relative paths. */
3
+ export function createDiagnostic(input, options = {}) {
4
+ const location = readLocation(input, options.projectRoot);
5
+ const descriptorId = input.descriptorId ?? input.descriptor;
6
+ const related = input.related?.map((entry) => normalizeRelated(entry, options.projectRoot));
7
+ const documentationPath = input.documentationPath ?? input.docs;
8
+ const value = {
9
+ code: requiredText(input.code, "code"),
10
+ severity: readSeverity(input.severity),
11
+ message: requiredText(input.message, "message"),
12
+ ...(location ?? {}),
13
+ ...(descriptorId === undefined ? {} : { descriptorId: normalizeId(descriptorId) }),
14
+ ...(related === undefined ? {} : { related: sortRelated(related) }),
15
+ ...(input.suggestion === undefined ? {} : { suggestion: input.suggestion }),
16
+ ...(documentationPath === undefined
17
+ ? {}
18
+ : { documentationPath: normalizeDocumentationPath(documentationPath, options.projectRoot) }),
19
+ };
20
+ return deepFreeze(value);
21
+ }
22
+ /** Normalizes an existing diagnostic or a diagnostic-shaped value. */
23
+ export const normalizeDiagnostic = createDiagnostic;
24
+ /** Sorts diagnostics by portable source location and stable content. */
25
+ export function sortDiagnostics(diagnostics, options = {}) {
26
+ return diagnostics
27
+ .map((diagnostic) => createDiagnostic(diagnostic, options))
28
+ .sort(compareDiagnostics);
29
+ }
30
+ function readLocation(input, projectRoot) {
31
+ const hasFlat = input.file !== undefined || input.line !== undefined || input.column !== undefined;
32
+ if (input.location !== undefined && hasFlat) {
33
+ throw new TypeError("Diagnostic location must use location or file/line/column, not both");
34
+ }
35
+ if (input.location !== undefined)
36
+ return normalizeSourceLocation(input.location, projectRoot);
37
+ if (!hasFlat)
38
+ return undefined;
39
+ if (input.file === undefined || input.line === undefined || input.column === undefined) {
40
+ throw new TypeError("Diagnostic locations require file, line, and column");
41
+ }
42
+ return createSourceLocation(input.file, input.line, input.column, projectRoot);
43
+ }
44
+ function normalizeRelated(input, projectRoot) {
45
+ const location = normalizeSourceLocation(input, projectRoot);
46
+ const value = {
47
+ ...location,
48
+ ...(input.message === undefined ? {} : { message: input.message }),
49
+ ...(input.descriptorId === undefined ? {} : { descriptorId: normalizeId(input.descriptorId) }),
50
+ };
51
+ return deepFreeze(value);
52
+ }
53
+ function sortRelated(locations) {
54
+ return Object.freeze([...locations].sort((left, right) => {
55
+ const location = compareLocations(left, right);
56
+ if (location !== 0)
57
+ return location;
58
+ return compareText(left.message ?? "", right.message ?? "");
59
+ }));
60
+ }
61
+ function compareDiagnostics(left, right) {
62
+ const location = compareLocations(left, right);
63
+ if (location !== 0)
64
+ return location;
65
+ const code = compareText(left.code, right.code);
66
+ if (code !== 0)
67
+ return code;
68
+ const severity = compareText(left.severity, right.severity);
69
+ if (severity !== 0)
70
+ return severity;
71
+ return compareText(left.message, right.message);
72
+ }
73
+ function compareLocations(left, right) {
74
+ const file = compareText(left.file ?? "\uffff", right.file ?? "\uffff");
75
+ if (file !== 0)
76
+ return file;
77
+ const line = (left.line ?? Number.MAX_SAFE_INTEGER) - (right.line ?? Number.MAX_SAFE_INTEGER);
78
+ if (line !== 0)
79
+ return line;
80
+ return (left.column ?? Number.MAX_SAFE_INTEGER) - (right.column ?? Number.MAX_SAFE_INTEGER);
81
+ }
82
+ function compareText(left, right) {
83
+ return left < right ? -1 : left > right ? 1 : 0;
84
+ }
85
+ function normalizeDocumentationPath(path, projectRoot) {
86
+ const value = requiredText(path, "documentationPath");
87
+ if (/^[a-z][a-z\d+.-]*:\/\//i.test(value))
88
+ return value;
89
+ if (value.startsWith("/") || /^[A-Za-z]:[\\/]/.test(value)) {
90
+ return normalizeSourcePath(value, projectRoot);
91
+ }
92
+ return value.replaceAll("\\", "/");
93
+ }
94
+ function requiredText(value, label) {
95
+ if (typeof value !== "string" || value.trim().length === 0) {
96
+ throw new TypeError(`Diagnostic ${label} must be a non-empty string`);
97
+ }
98
+ return value.trim();
99
+ }
100
+ function readSeverity(value) {
101
+ if (value === "info" || value === "warning" || value === "error")
102
+ return value;
103
+ throw new TypeError("Diagnostic severity must be info, warning, or error");
104
+ }
105
+ function deepFreeze(value) {
106
+ Object.freeze(value);
107
+ for (const child of Object.values(value)) {
108
+ if (child && typeof child === "object" && !Object.isFrozen(child))
109
+ deepFreeze(child);
110
+ }
111
+ return value;
112
+ }
113
+ //# sourceMappingURL=diagnostic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostic.js","sourceRoot":"","sources":["../src/diagnostic.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAgD3B,+EAA+E;AAC/E,MAAM,UAAU,gBAAgB,CAC9B,KAAsB,EACtB,UAA0C,EAAE;IAE5C,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1D,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,UAAU,CAAC;IAC5D,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5F,MAAM,iBAA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AAI,SAAS,CAAC,cAAc,KAAK,6BAA6B,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IAC/E,MAAM,IAAI,SAAS,CAAC,qDAAqD,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,UAAU,CAAmB,KAAQ;IAC5C,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QACzC,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IACvF,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./diagnostic.js";
2
+ export * from "./reporter.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./diagnostic.js";
2
+ export * from "./reporter.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { type DiagnosticInput } from "./diagnostic.js";
2
+ export interface DiagnosticReporterOptions {
3
+ readonly projectRoot?: string;
4
+ readonly source?: (file: string) => string | undefined;
5
+ readonly color?: boolean;
6
+ }
7
+ export interface CiAnnotation {
8
+ readonly level: "notice" | "warning" | "error";
9
+ readonly title: string;
10
+ readonly message: string;
11
+ readonly file?: string;
12
+ readonly line?: number;
13
+ readonly column?: number;
14
+ }
15
+ /** Formats one diagnostic for a deterministic human-readable terminal. */
16
+ export declare function formatDiagnostic(input: DiagnosticInput, options?: DiagnosticReporterOptions): string;
17
+ /** Formats diagnostics in stable source/content order. */
18
+ export declare function formatDiagnostics(diagnostics: readonly DiagnosticInput[], options?: DiagnosticReporterOptions): string;
19
+ /** Serializes diagnostics with recursively sorted object keys for machine consumers. */
20
+ export declare function serializeDiagnostics(diagnostics: readonly DiagnosticInput[], options?: DiagnosticReporterOptions): string;
21
+ export declare const diagnosticsToJson: typeof serializeDiagnostics;
22
+ /** Converts diagnostics into portable CI annotations without absolute paths. */
23
+ export declare function toCiAnnotations(diagnostics: readonly DiagnosticInput[], options?: DiagnosticReporterOptions): readonly CiAnnotation[];
24
+ /** Encodes CI annotations using GitHub Actions' portable command format. */
25
+ export declare function formatCiAnnotations(diagnostics: readonly DiagnosticInput[], options?: DiagnosticReporterOptions): string;
26
+ /** Creates compiler/inspector/CI adapters sharing one normalization policy. */
27
+ export declare function createDiagnosticReporter(options?: DiagnosticReporterOptions): Readonly<{
28
+ text: (diagnostics: readonly DiagnosticInput[]) => string;
29
+ json: (diagnostics: readonly DiagnosticInput[]) => string;
30
+ ci: (diagnostics: readonly DiagnosticInput[]) => string;
31
+ }>;
32
+ export type DiagnosticReporter = ReturnType<typeof createDiagnosticReporter>;
33
+ //# sourceMappingURL=reporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../src/reporter.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,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SAAS,eAAe,EAAE;GAE/C;AAED,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,117 @@
1
+ import { canonicalJson } from "@relkit/contracts";
2
+ import { createDiagnostic, sortDiagnostics, } from "./diagnostic.js";
3
+ /** Formats one diagnostic for a deterministic human-readable terminal. */
4
+ export function formatDiagnostic(input, options = {}) {
5
+ const diagnostic = createDiagnostic(input, options);
6
+ const location = diagnostic.file
7
+ ? `${diagnostic.file}:${diagnostic.line}:${diagnostic.column}`
8
+ : undefined;
9
+ const heading = `${location ? `${location} - ` : ""}${paint(diagnostic.severity, options.color === true)} ${diagnostic.code}: ${diagnostic.message}`;
10
+ const lines = [heading];
11
+ if (diagnostic.file && diagnostic.line !== undefined && diagnostic.column !== undefined) {
12
+ lines.push(...renderExcerpt({ file: diagnostic.file, line: diagnostic.line, column: diagnostic.column }, readSource(diagnostic.file, options), 1, options.color === true));
13
+ }
14
+ for (const related of diagnostic.related ?? []) {
15
+ lines.push(` related: ${formatRelated(related)}`);
16
+ lines.push(...renderExcerpt(related, readSource(related.file, options), 1, options.color === true));
17
+ }
18
+ if (diagnostic.suggestion !== undefined)
19
+ lines.push(` suggestion: ${diagnostic.suggestion}`);
20
+ if (diagnostic.documentationPath !== undefined) {
21
+ lines.push(` docs: ${diagnostic.documentationPath}`);
22
+ }
23
+ return lines.join("\n");
24
+ }
25
+ /** Formats diagnostics in stable source/content order. */
26
+ export function formatDiagnostics(diagnostics, options = {}) {
27
+ return sortDiagnostics(diagnostics, options)
28
+ .map((diagnostic) => formatDiagnostic(diagnostic, options))
29
+ .join("\n");
30
+ }
31
+ /** Serializes diagnostics with recursively sorted object keys for machine consumers. */
32
+ export function serializeDiagnostics(diagnostics, options = {}) {
33
+ return canonicalJson(sortDiagnostics(diagnostics, options));
34
+ }
35
+ export const diagnosticsToJson = serializeDiagnostics;
36
+ /** Converts diagnostics into portable CI annotations without absolute paths. */
37
+ export function toCiAnnotations(diagnostics, options = {}) {
38
+ return Object.freeze(sortDiagnostics(diagnostics, options).map((diagnostic) => Object.freeze({
39
+ level: diagnostic.severity === "info" ? "notice" : diagnostic.severity,
40
+ title: diagnostic.code,
41
+ message: diagnostic.message,
42
+ code: diagnostic.code,
43
+ ...(diagnostic.file === undefined ? {} : { file: diagnostic.file }),
44
+ ...(diagnostic.line === undefined ? {} : { line: diagnostic.line }),
45
+ ...(diagnostic.column === undefined ? {} : { column: diagnostic.column }),
46
+ })));
47
+ }
48
+ /** Encodes CI annotations using GitHub Actions' portable command format. */
49
+ export function formatCiAnnotations(diagnostics, options = {}) {
50
+ return toCiAnnotations(diagnostics, options)
51
+ .map((annotation) => {
52
+ const properties = [
53
+ annotation.file === undefined ? undefined : `file=${escapeCommand(annotation.file)}`,
54
+ annotation.line === undefined ? undefined : `line=${annotation.line}`,
55
+ annotation.column === undefined ? undefined : `col=${annotation.column}`,
56
+ `title=${escapeCommand(annotation.title)}`,
57
+ ]
58
+ .filter((property) => property !== undefined)
59
+ .join(",");
60
+ return `::${annotation.level}${properties ? ` ${properties}` : ""}::${escapeCommand(annotation.message)}`;
61
+ })
62
+ .join("\n");
63
+ }
64
+ /** Creates compiler/inspector/CI adapters sharing one normalization policy. */
65
+ export function createDiagnosticReporter(options = {}) {
66
+ return Object.freeze({
67
+ text: (diagnostics) => formatDiagnostics(diagnostics, options),
68
+ json: (diagnostics) => serializeDiagnostics(diagnostics, options),
69
+ ci: (diagnostics) => formatCiAnnotations(diagnostics, options),
70
+ });
71
+ }
72
+ function readSource(file, options) {
73
+ if (options.source)
74
+ return options.source(file);
75
+ return undefined;
76
+ }
77
+ function renderExcerpt(location, source, context, color) {
78
+ if (source === undefined)
79
+ return [];
80
+ const lines = source.replaceAll("\r\n", "\n").replaceAll("\r", "\n").split("\n");
81
+ if (location.line > lines.length)
82
+ return [];
83
+ const start = Math.max(1, location.line - context);
84
+ const end = Math.min(lines.length, location.line + context);
85
+ const width = String(end).length;
86
+ const result = [];
87
+ for (let line = start; line <= end; line += 1) {
88
+ const marked = line === location.line;
89
+ const marker = marked ? ">" : " ";
90
+ const content = lines[line - 1] ?? "";
91
+ result.push(` ${marker} ${String(line).padStart(width)} | ${content}`);
92
+ if (marked) {
93
+ const column = Math.min(Math.max(location.column, 1), content.length + 1);
94
+ const caret = ` ${" ".repeat(width)} | ${" ".repeat(column - 1)}^`;
95
+ result.push(color ? `\u001b[31m${caret}\u001b[0m` : caret);
96
+ }
97
+ }
98
+ return result;
99
+ }
100
+ function formatRelated(location) {
101
+ return `${location.file}:${location.line}:${location.column}${location.message === undefined ? "" : ` - ${location.message}`}`;
102
+ }
103
+ function paint(severity, color) {
104
+ if (!color)
105
+ return severity;
106
+ const code = severity === "error" ? 31 : severity === "warning" ? 33 : 36;
107
+ return `\u001b[${code}m${severity}\u001b[0m`;
108
+ }
109
+ function escapeCommand(value) {
110
+ return value
111
+ .replaceAll("%", "%25")
112
+ .replaceAll("\r", "%0D")
113
+ .replaceAll("\n", "%0A")
114
+ .replaceAll(":", "%3A")
115
+ .replaceAll(",", "%2C");
116
+ }
117
+ //# sourceMappingURL=reporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporter.js","sourceRoot":"","sources":["../src/reporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EACL,gBAAgB,EAChB,eAAe,GAIhB,MAAM,iBAAiB,CAAC;AAiBzB,0EAA0E;AAC1E,MAAM,UAAU,gBAAgB,CAC9B,KAAsB,EACtB,UAAqC,EAAE;IAEvC,MAAM,UAAU,GAAG,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI;QAC9B,CAAC,CAAC,GAAG,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,MAAM,EAAE;QAC9D,CAAC,CAAC,SAAS,CAAC;IACd,M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,QAAQ,CAAC;IAC5B,MAAM,IAAI,GAAG,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1E,OAAO,UAAU,IAAI,IAAI,QAAQ,WAAW,CAAC;AAC/C,CAAC;AAED,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,KAAK;SACT,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC;SACtB,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC;SACvB,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC;SACvB,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC;SACtB,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC5B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@relkit/diagnostics",
3
+ "version": "0.0.0",
4
+ "description": "Unsupported internal RELKIT diagnostics; use @relkit/cli.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/rel-kit/relkit.git",
9
+ "directory": "packages/diagnostics"
10
+ },
11
+ "homepage": "https://github.com/rel-kit/relkit#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/rel-kit/relkit/issues"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "engines": {
22
+ "bun": ">=1.3.10"
23
+ },
24
+ "type": "module",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/index.js"
29
+ }
30
+ },
31
+ "dependencies": {
32
+ "@relkit/contracts": "0.0.0"
33
+ },
34
+ "scripts": {
35
+ "build": "tsc -b",
36
+ "check": "tsc -b --pretty false",
37
+ "typecheck": "tsc -b --pretty false"
38
+ }
39
+ }