@exodus/xqa 5.5.0 → 6.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.
@@ -0,0 +1,131 @@
1
+ import type { Result, ResultAsync } from './consumer-neverthrow.js';
2
+
3
+ export interface RedactedCause {
4
+ readonly safeMessage: string;
5
+ readonly safeStack?: string;
6
+ }
7
+ export type CatalogError = {
8
+ readonly type: "CATALOG_MODULE_NOT_FOUND";
9
+ readonly path: string;
10
+ } | {
11
+ readonly type: "CATALOG_MODULE_LOAD_FAILED";
12
+ readonly path: string;
13
+ readonly cause: RedactedCause;
14
+ } | {
15
+ readonly type: "CATALOG_MODULE_OUTSIDE_ROOT";
16
+ readonly path: string;
17
+ readonly resolvedPath: string;
18
+ } | {
19
+ readonly type: "CATALOG_MODULE_WORLD_WRITABLE";
20
+ readonly path: string;
21
+ readonly mode: number;
22
+ readonly offender: "file" | "ancestor";
23
+ readonly ancestorPath?: string;
24
+ } | {
25
+ readonly type: "CATALOG_MODULE_INVALID_SHAPE";
26
+ readonly path: string;
27
+ readonly reason: string;
28
+ } | {
29
+ readonly type: "CATALOG_VERSION_MISMATCH";
30
+ readonly path: string;
31
+ readonly expected: number;
32
+ readonly actual: unknown;
33
+ } | {
34
+ readonly type: "CATALOG_FETCH_FAILED";
35
+ readonly phase: "specs" | "suites";
36
+ readonly cause: RedactedCause;
37
+ } | {
38
+ readonly type: "CATALOG_FETCH_TIMEOUT";
39
+ readonly phase: "specs" | "suites";
40
+ readonly timeoutMs: number;
41
+ } | {
42
+ readonly type: "CATALOG_RESULT_TOO_LARGE";
43
+ readonly phase: "specs" | "suites";
44
+ readonly count: number;
45
+ readonly limit: number;
46
+ } | {
47
+ readonly type: "CATALOG_SPEC_CONTENT_REJECTED";
48
+ readonly kind: "spec" | "suite";
49
+ readonly id: string;
50
+ readonly reason: string;
51
+ } | {
52
+ readonly type: "CATALOG_DUPLICATE_ID";
53
+ readonly kind: "spec" | "suite";
54
+ readonly id: string;
55
+ } | {
56
+ readonly type: "CATALOG_INVALID_ID";
57
+ readonly kind: "spec" | "suite";
58
+ readonly id: string;
59
+ } | {
60
+ readonly type: "CATALOG_CACHE_WRITE_FAILED";
61
+ readonly path: string;
62
+ readonly cause: RedactedCause;
63
+ } | {
64
+ readonly type: "CATALOG_CACHE_CLEANUP_FAILED";
65
+ readonly path: string;
66
+ readonly cause: RedactedCause;
67
+ };
68
+ export declare function redactCause(value: unknown): RedactedCause;
69
+ export type SpecId = string & {
70
+ readonly __brand: "SpecId";
71
+ };
72
+ export type SuiteId = string & {
73
+ readonly __brand: "SuiteId";
74
+ };
75
+ export interface SpecStep {
76
+ readonly intent: string;
77
+ readonly outcome?: string;
78
+ readonly hint?: string;
79
+ }
80
+ export interface Spec {
81
+ readonly feature: string;
82
+ readonly setup: string;
83
+ readonly steps: readonly SpecStep[];
84
+ readonly assertions?: readonly string[];
85
+ readonly timeoutMs?: number;
86
+ }
87
+ export interface CatalogSpec {
88
+ readonly id: SpecId;
89
+ readonly spec: Spec;
90
+ }
91
+ export declare const toSpecId: (value: string) => Result<SpecId, CatalogError>;
92
+ export declare const toSuiteId: (value: string) => Result<SuiteId, CatalogError>;
93
+ export interface FreestyleEntry {
94
+ readonly prompt?: string;
95
+ readonly timeoutSeconds?: number;
96
+ }
97
+ export interface HookConfig {
98
+ readonly script: string;
99
+ readonly env?: Record<string, string>;
100
+ readonly timeoutSeconds?: number;
101
+ readonly retries?: number;
102
+ }
103
+ export interface SuiteHooks {
104
+ readonly beforeEach?: HookConfig;
105
+ }
106
+ export interface SuiteConfig {
107
+ readonly specs: readonly string[];
108
+ readonly freestyle: readonly FreestyleEntry[];
109
+ readonly hooks?: SuiteHooks;
110
+ }
111
+ export interface CatalogSuite {
112
+ readonly id: SuiteId;
113
+ readonly config: SuiteConfig;
114
+ }
115
+ export declare const CATALOG_INTERFACE_VERSION: 1;
116
+ export interface Catalog {
117
+ readonly catalogVersion: typeof CATALOG_INTERFACE_VERSION;
118
+ getSpecs(): ResultAsync<readonly CatalogSpec[], CatalogError>;
119
+ getSuites(): ResultAsync<readonly CatalogSuite[], CatalogError>;
120
+ }
121
+ export interface SharedSpecError {
122
+ readonly type: "STORED_SPEC_PARSE_FAILED";
123
+ readonly reason: string;
124
+ readonly cause?: unknown;
125
+ }
126
+ export declare function parseSpecShared(raw: string): Result<{
127
+ readonly spec: Spec;
128
+ readonly frontmatter: Record<string, unknown>;
129
+ }, SharedSpecError>;
130
+
131
+ export {};