@reynsu/reactlens-diagnosis-prompts 0.1.0 → 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.
@@ -1,41 +1,30 @@
1
1
  import { z } from 'zod';
2
- export declare const ClassificationSchema: z.ZodEnum<["real-bug", "test-bug", "flaky", "env-issue"]>;
2
+ export declare const ClassificationSchema: z.ZodEnum<{
3
+ "real-bug": "real-bug";
4
+ "test-bug": "test-bug";
5
+ flaky: "flaky";
6
+ "env-issue": "env-issue";
7
+ }>;
3
8
  export type Classification = z.infer<typeof ClassificationSchema>;
4
- export declare const ConfidenceSchema: z.ZodEnum<["high", "medium", "low"]>;
9
+ export declare const ConfidenceSchema: z.ZodEnum<{
10
+ high: "high";
11
+ medium: "medium";
12
+ low: "low";
13
+ }>;
5
14
  export type Confidence = z.infer<typeof ConfidenceSchema>;
6
15
  export declare const PatchEntrySchema: z.ZodObject<{
7
16
  file: z.ZodString;
8
17
  oldStr: z.ZodString;
9
18
  newStr: z.ZodString;
10
19
  rationale: z.ZodString;
11
- }, "strip", z.ZodTypeAny, {
12
- file: string;
13
- oldStr: string;
14
- newStr: string;
15
- rationale: string;
16
- }, {
17
- file: string;
18
- oldStr: string;
19
- newStr: string;
20
- rationale: string;
21
- }>;
20
+ }, z.core.$strip>;
22
21
  export type PatchEntry = z.infer<typeof PatchEntrySchema>;
23
22
  export declare const GitContextEntrySchema: z.ZodObject<{
24
23
  sha: z.ZodString;
25
24
  author: z.ZodString;
26
25
  date: z.ZodString;
27
26
  message: z.ZodString;
28
- }, "strip", z.ZodTypeAny, {
29
- message: string;
30
- sha: string;
31
- author: string;
32
- date: string;
33
- }, {
34
- message: string;
35
- sha: string;
36
- author: string;
37
- date: string;
38
- }>;
27
+ }, z.core.$strip>;
39
28
  export type GitContextEntry = z.infer<typeof GitContextEntrySchema>;
40
29
  export declare const GitContextSchema: z.ZodObject<{
41
30
  componentLastChanged: z.ZodOptional<z.ZodObject<{
@@ -43,196 +32,51 @@ export declare const GitContextSchema: z.ZodObject<{
43
32
  author: z.ZodString;
44
33
  date: z.ZodString;
45
34
  message: z.ZodString;
46
- }, "strip", z.ZodTypeAny, {
47
- message: string;
48
- sha: string;
49
- author: string;
50
- date: string;
51
- }, {
52
- message: string;
53
- sha: string;
54
- author: string;
55
- date: string;
56
- }>>;
35
+ }, z.core.$strip>>;
57
36
  specLastChanged: z.ZodOptional<z.ZodObject<{
58
37
  sha: z.ZodString;
59
38
  author: z.ZodString;
60
39
  date: z.ZodString;
61
40
  message: z.ZodString;
62
- }, "strip", z.ZodTypeAny, {
63
- message: string;
64
- sha: string;
65
- author: string;
66
- date: string;
67
- }, {
68
- message: string;
69
- sha: string;
70
- author: string;
71
- date: string;
72
- }>>;
73
- }, "strip", z.ZodTypeAny, {
74
- componentLastChanged?: {
75
- message: string;
76
- sha: string;
77
- author: string;
78
- date: string;
79
- } | undefined;
80
- specLastChanged?: {
81
- message: string;
82
- sha: string;
83
- author: string;
84
- date: string;
85
- } | undefined;
86
- }, {
87
- componentLastChanged?: {
88
- message: string;
89
- sha: string;
90
- author: string;
91
- date: string;
92
- } | undefined;
93
- specLastChanged?: {
94
- message: string;
95
- sha: string;
96
- author: string;
97
- date: string;
98
- } | undefined;
99
- }>;
41
+ }, z.core.$strip>>;
42
+ }, z.core.$strip>;
100
43
  export type GitContext = z.infer<typeof GitContextSchema>;
101
44
  export declare const DiagnosisSchema: z.ZodObject<{
102
- classification: z.ZodEnum<["real-bug", "test-bug", "flaky", "env-issue"]>;
103
- confidence: z.ZodEnum<["high", "medium", "low"]>;
45
+ classification: z.ZodEnum<{
46
+ "real-bug": "real-bug";
47
+ "test-bug": "test-bug";
48
+ flaky: "flaky";
49
+ "env-issue": "env-issue";
50
+ }>;
51
+ confidence: z.ZodEnum<{
52
+ high: "high";
53
+ medium: "medium";
54
+ low: "low";
55
+ }>;
104
56
  rootCause: z.ZodString;
105
- evidence: z.ZodArray<z.ZodString, "many">;
57
+ evidence: z.ZodArray<z.ZodString>;
106
58
  suggestedFix: z.ZodString;
107
59
  patch: z.ZodOptional<z.ZodArray<z.ZodObject<{
108
60
  file: z.ZodString;
109
61
  oldStr: z.ZodString;
110
62
  newStr: z.ZodString;
111
63
  rationale: z.ZodString;
112
- }, "strip", z.ZodTypeAny, {
113
- file: string;
114
- oldStr: string;
115
- newStr: string;
116
- rationale: string;
117
- }, {
118
- file: string;
119
- oldStr: string;
120
- newStr: string;
121
- rationale: string;
122
- }>, "many">>;
64
+ }, z.core.$strip>>>;
123
65
  gitContext: z.ZodOptional<z.ZodObject<{
124
66
  componentLastChanged: z.ZodOptional<z.ZodObject<{
125
67
  sha: z.ZodString;
126
68
  author: z.ZodString;
127
69
  date: z.ZodString;
128
70
  message: z.ZodString;
129
- }, "strip", z.ZodTypeAny, {
130
- message: string;
131
- sha: string;
132
- author: string;
133
- date: string;
134
- }, {
135
- message: string;
136
- sha: string;
137
- author: string;
138
- date: string;
139
- }>>;
71
+ }, z.core.$strip>>;
140
72
  specLastChanged: z.ZodOptional<z.ZodObject<{
141
73
  sha: z.ZodString;
142
74
  author: z.ZodString;
143
75
  date: z.ZodString;
144
76
  message: z.ZodString;
145
- }, "strip", z.ZodTypeAny, {
146
- message: string;
147
- sha: string;
148
- author: string;
149
- date: string;
150
- }, {
151
- message: string;
152
- sha: string;
153
- author: string;
154
- date: string;
155
- }>>;
156
- }, "strip", z.ZodTypeAny, {
157
- componentLastChanged?: {
158
- message: string;
159
- sha: string;
160
- author: string;
161
- date: string;
162
- } | undefined;
163
- specLastChanged?: {
164
- message: string;
165
- sha: string;
166
- author: string;
167
- date: string;
168
- } | undefined;
169
- }, {
170
- componentLastChanged?: {
171
- message: string;
172
- sha: string;
173
- author: string;
174
- date: string;
175
- } | undefined;
176
- specLastChanged?: {
177
- message: string;
178
- sha: string;
179
- author: string;
180
- date: string;
181
- } | undefined;
182
- }>>;
183
- }, "strip", z.ZodTypeAny, {
184
- classification: "real-bug" | "test-bug" | "flaky" | "env-issue";
185
- confidence: "high" | "medium" | "low";
186
- rootCause: string;
187
- evidence: string[];
188
- suggestedFix: string;
189
- patch?: {
190
- file: string;
191
- oldStr: string;
192
- newStr: string;
193
- rationale: string;
194
- }[] | undefined;
195
- gitContext?: {
196
- componentLastChanged?: {
197
- message: string;
198
- sha: string;
199
- author: string;
200
- date: string;
201
- } | undefined;
202
- specLastChanged?: {
203
- message: string;
204
- sha: string;
205
- author: string;
206
- date: string;
207
- } | undefined;
208
- } | undefined;
209
- }, {
210
- classification: "real-bug" | "test-bug" | "flaky" | "env-issue";
211
- confidence: "high" | "medium" | "low";
212
- rootCause: string;
213
- evidence: string[];
214
- suggestedFix: string;
215
- patch?: {
216
- file: string;
217
- oldStr: string;
218
- newStr: string;
219
- rationale: string;
220
- }[] | undefined;
221
- gitContext?: {
222
- componentLastChanged?: {
223
- message: string;
224
- sha: string;
225
- author: string;
226
- date: string;
227
- } | undefined;
228
- specLastChanged?: {
229
- message: string;
230
- sha: string;
231
- author: string;
232
- date: string;
233
- } | undefined;
234
- } | undefined;
235
- }>;
77
+ }, z.core.$strip>>;
78
+ }, z.core.$strip>>;
79
+ }, z.core.$strip>;
236
80
  export type Diagnosis = z.infer<typeof DiagnosisSchema>;
237
81
  export type FailedTest = {
238
82
  testId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"diagnosis.d.ts","sourceRoot":"","sources":["../src/diagnosis.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB,2DAAyD,CAAC;AAC3F,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,gBAAgB,sCAAoC,CAAC;AAClE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAK3B,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: z.ZodObject<{
4
- expectedClassification: z.ZodEnum<["real-bug", "test-bug", "flaky", "env-issue"]>;
5
- minimumConfidence: z.ZodEnum<["high", "medium", "low"]>;
4
+ expectedClassification: z.ZodEnum<{
5
+ "real-bug": "real-bug";
6
+ "test-bug": "test-bug";
7
+ flaky: "flaky";
8
+ "env-issue": "env-issue";
9
+ }>;
10
+ minimumConfidence: z.ZodEnum<{
11
+ high: "high";
12
+ medium: "medium";
13
+ low: "low";
14
+ }>;
6
15
  category: z.ZodOptional<z.ZodString>;
7
16
  notes: z.ZodOptional<z.ZodString>;
8
- }, "strip", z.ZodTypeAny, {
9
- expectedClassification: "real-bug" | "test-bug" | "flaky" | "env-issue";
10
- minimumConfidence: "high" | "medium" | "low";
11
- category?: string | undefined;
12
- notes?: string | undefined;
13
- }, {
14
- expectedClassification: "real-bug" | "test-bug" | "flaky" | "env-issue";
15
- minimumConfidence: "high" | "medium" | "low";
16
- category?: string | undefined;
17
- notes?: string | undefined;
18
- }>;
17
+ }, z.core.$strip>;
19
18
  export type Truth = z.infer<typeof TruthSchema>;
20
19
  export type CaseResult = {
21
20
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"eval-metrics.d.ts","sourceRoot":"","sources":["../src/eval-metrics.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAA0C,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE7G,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;EAKtB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEhD,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC;IAChB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IAIjB,eAAe,EAAE,OAAO,CAAC;CAC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AAM,GAAG,UAAU,CAS3F;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IAEjB,mBAAmB,EAAE,MAAM,CAAC;IAG5B,iBAAiB,EAAE,MAAM,CAAC,cAAc,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/E,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,WAAW,CAsBnE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reynsu/reactlens-diagnosis-prompts",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Canonical diagnosis prompts + Zod Diagnosis schema + pure eval-metrics for the reactlens / nativelens AI failure-diagnosis loop. Pure helpers only — no LLM SDK dep.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,12 +24,13 @@
24
24
  "typecheck": "tsc --noEmit",
25
25
  "prepublishOnly": "npm run typecheck && npm test && npm run build"
26
26
  },
27
- "dependencies": {
28
- "zod": "^3.23.8"
27
+ "peerDependencies": {
28
+ "zod": ">=3.23.8 <5"
29
29
  },
30
30
  "devDependencies": {
31
31
  "typescript": "~5.9.2",
32
- "vitest": "^2.1.0"
32
+ "vitest": "^2.1.0",
33
+ "zod": "^4.0.0"
33
34
  },
34
35
  "publishConfig": {
35
36
  "access": "public"