@synchronized-studio/cmsassets-agent 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.
@@ -0,0 +1,811 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const FrameworkName: z.ZodEnum<["nuxt", "nuxt2", "next", "remix", "astro", "sveltekit", "express", "hono", "fastify", "unknown"]>;
4
+ type FrameworkName = z.infer<typeof FrameworkName>;
5
+ declare const CmsType: z.ZodEnum<["prismic", "contentful", "sanity", "shopify", "cloudinary", "imgix", "generic", "unknown"]>;
6
+ type CmsType = z.infer<typeof CmsType>;
7
+ declare const PackageManager: z.ZodEnum<["npm", "yarn", "pnpm", "bun"]>;
8
+ type PackageManager = z.infer<typeof PackageManager>;
9
+ declare const Confidence: z.ZodEnum<["high", "medium", "low"]>;
10
+ type Confidence = z.infer<typeof Confidence>;
11
+ declare const InjectionType: z.ZodEnum<["return", "res.json", "assignment", "useFetch-transform", "useAsyncData-transform", "loader-return", "getServerSideProps-return", "getStaticProps-return", "load-return", "frontmatter-assignment", "asyncData-return", "vuex-action-return"]>;
12
+ type InjectionType = z.infer<typeof InjectionType>;
13
+ declare const VerifyProfile: z.ZodEnum<["quick", "full"]>;
14
+ type VerifyProfile = z.infer<typeof VerifyProfile>;
15
+ declare const FrameworkInfo: z.ZodObject<{
16
+ name: z.ZodEnum<["nuxt", "nuxt2", "next", "remix", "astro", "sveltekit", "express", "hono", "fastify", "unknown"]>;
17
+ version: z.ZodString;
18
+ configFile: z.ZodNullable<z.ZodString>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ name: "nuxt" | "nuxt2" | "next" | "remix" | "astro" | "sveltekit" | "express" | "hono" | "fastify" | "unknown";
21
+ version: string;
22
+ configFile: string | null;
23
+ }, {
24
+ name: "nuxt" | "nuxt2" | "next" | "remix" | "astro" | "sveltekit" | "express" | "hono" | "fastify" | "unknown";
25
+ version: string;
26
+ configFile: string | null;
27
+ }>;
28
+ type FrameworkInfo = z.infer<typeof FrameworkInfo>;
29
+ declare const CmsInfo: z.ZodObject<{
30
+ type: z.ZodEnum<["prismic", "contentful", "sanity", "shopify", "cloudinary", "imgix", "generic", "unknown"]>;
31
+ params: z.ZodRecord<z.ZodString, z.ZodString>;
32
+ detectedFrom: z.ZodArray<z.ZodString, "many">;
33
+ }, "strip", z.ZodTypeAny, {
34
+ type: "unknown" | "prismic" | "contentful" | "sanity" | "shopify" | "cloudinary" | "imgix" | "generic";
35
+ params: Record<string, string>;
36
+ detectedFrom: string[];
37
+ }, {
38
+ type: "unknown" | "prismic" | "contentful" | "sanity" | "shopify" | "cloudinary" | "imgix" | "generic";
39
+ params: Record<string, string>;
40
+ detectedFrom: string[];
41
+ }>;
42
+ type CmsInfo = z.infer<typeof CmsInfo>;
43
+ declare const InjectionCandidate: z.ZodObject<{
44
+ filePath: z.ZodString;
45
+ line: z.ZodNumber;
46
+ type: z.ZodEnum<["return", "res.json", "assignment", "useFetch-transform", "useAsyncData-transform", "loader-return", "getServerSideProps-return", "getStaticProps-return", "load-return", "frontmatter-assignment", "asyncData-return", "vuex-action-return"]>;
47
+ score: z.ZodNumber;
48
+ confidence: z.ZodEnum<["high", "medium", "low"]>;
49
+ targetCode: z.ZodString;
50
+ context: z.ZodString;
51
+ reasons: z.ZodArray<z.ZodString, "many">;
52
+ }, "strip", z.ZodTypeAny, {
53
+ type: "return" | "res.json" | "assignment" | "useFetch-transform" | "useAsyncData-transform" | "loader-return" | "getServerSideProps-return" | "getStaticProps-return" | "load-return" | "frontmatter-assignment" | "asyncData-return" | "vuex-action-return";
54
+ filePath: string;
55
+ line: number;
56
+ score: number;
57
+ confidence: "high" | "medium" | "low";
58
+ targetCode: string;
59
+ context: string;
60
+ reasons: string[];
61
+ }, {
62
+ type: "return" | "res.json" | "assignment" | "useFetch-transform" | "useAsyncData-transform" | "loader-return" | "getServerSideProps-return" | "getStaticProps-return" | "load-return" | "frontmatter-assignment" | "asyncData-return" | "vuex-action-return";
63
+ filePath: string;
64
+ line: number;
65
+ score: number;
66
+ confidence: "high" | "medium" | "low";
67
+ targetCode: string;
68
+ context: string;
69
+ reasons: string[];
70
+ }>;
71
+ type InjectionCandidate = z.infer<typeof InjectionCandidate>;
72
+ declare const ScanResult: z.ZodObject<{
73
+ framework: z.ZodObject<{
74
+ name: z.ZodEnum<["nuxt", "nuxt2", "next", "remix", "astro", "sveltekit", "express", "hono", "fastify", "unknown"]>;
75
+ version: z.ZodString;
76
+ configFile: z.ZodNullable<z.ZodString>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ name: "nuxt" | "nuxt2" | "next" | "remix" | "astro" | "sveltekit" | "express" | "hono" | "fastify" | "unknown";
79
+ version: string;
80
+ configFile: string | null;
81
+ }, {
82
+ name: "nuxt" | "nuxt2" | "next" | "remix" | "astro" | "sveltekit" | "express" | "hono" | "fastify" | "unknown";
83
+ version: string;
84
+ configFile: string | null;
85
+ }>;
86
+ cms: z.ZodObject<{
87
+ type: z.ZodEnum<["prismic", "contentful", "sanity", "shopify", "cloudinary", "imgix", "generic", "unknown"]>;
88
+ params: z.ZodRecord<z.ZodString, z.ZodString>;
89
+ detectedFrom: z.ZodArray<z.ZodString, "many">;
90
+ }, "strip", z.ZodTypeAny, {
91
+ type: "unknown" | "prismic" | "contentful" | "sanity" | "shopify" | "cloudinary" | "imgix" | "generic";
92
+ params: Record<string, string>;
93
+ detectedFrom: string[];
94
+ }, {
95
+ type: "unknown" | "prismic" | "contentful" | "sanity" | "shopify" | "cloudinary" | "imgix" | "generic";
96
+ params: Record<string, string>;
97
+ detectedFrom: string[];
98
+ }>;
99
+ injectionPoints: z.ZodArray<z.ZodObject<{
100
+ filePath: z.ZodString;
101
+ line: z.ZodNumber;
102
+ type: z.ZodEnum<["return", "res.json", "assignment", "useFetch-transform", "useAsyncData-transform", "loader-return", "getServerSideProps-return", "getStaticProps-return", "load-return", "frontmatter-assignment", "asyncData-return", "vuex-action-return"]>;
103
+ score: z.ZodNumber;
104
+ confidence: z.ZodEnum<["high", "medium", "low"]>;
105
+ targetCode: z.ZodString;
106
+ context: z.ZodString;
107
+ reasons: z.ZodArray<z.ZodString, "many">;
108
+ }, "strip", z.ZodTypeAny, {
109
+ type: "return" | "res.json" | "assignment" | "useFetch-transform" | "useAsyncData-transform" | "loader-return" | "getServerSideProps-return" | "getStaticProps-return" | "load-return" | "frontmatter-assignment" | "asyncData-return" | "vuex-action-return";
110
+ filePath: string;
111
+ line: number;
112
+ score: number;
113
+ confidence: "high" | "medium" | "low";
114
+ targetCode: string;
115
+ context: string;
116
+ reasons: string[];
117
+ }, {
118
+ type: "return" | "res.json" | "assignment" | "useFetch-transform" | "useAsyncData-transform" | "loader-return" | "getServerSideProps-return" | "getStaticProps-return" | "load-return" | "frontmatter-assignment" | "asyncData-return" | "vuex-action-return";
119
+ filePath: string;
120
+ line: number;
121
+ score: number;
122
+ confidence: "high" | "medium" | "low";
123
+ targetCode: string;
124
+ context: string;
125
+ reasons: string[];
126
+ }>, "many">;
127
+ packageManager: z.ZodEnum<["npm", "yarn", "pnpm", "bun"]>;
128
+ projectRoot: z.ZodString;
129
+ }, "strip", z.ZodTypeAny, {
130
+ cms: {
131
+ type: "unknown" | "prismic" | "contentful" | "sanity" | "shopify" | "cloudinary" | "imgix" | "generic";
132
+ params: Record<string, string>;
133
+ detectedFrom: string[];
134
+ };
135
+ framework: {
136
+ name: "nuxt" | "nuxt2" | "next" | "remix" | "astro" | "sveltekit" | "express" | "hono" | "fastify" | "unknown";
137
+ version: string;
138
+ configFile: string | null;
139
+ };
140
+ injectionPoints: {
141
+ type: "return" | "res.json" | "assignment" | "useFetch-transform" | "useAsyncData-transform" | "loader-return" | "getServerSideProps-return" | "getStaticProps-return" | "load-return" | "frontmatter-assignment" | "asyncData-return" | "vuex-action-return";
142
+ filePath: string;
143
+ line: number;
144
+ score: number;
145
+ confidence: "high" | "medium" | "low";
146
+ targetCode: string;
147
+ context: string;
148
+ reasons: string[];
149
+ }[];
150
+ packageManager: "npm" | "yarn" | "pnpm" | "bun";
151
+ projectRoot: string;
152
+ }, {
153
+ cms: {
154
+ type: "unknown" | "prismic" | "contentful" | "sanity" | "shopify" | "cloudinary" | "imgix" | "generic";
155
+ params: Record<string, string>;
156
+ detectedFrom: string[];
157
+ };
158
+ framework: {
159
+ name: "nuxt" | "nuxt2" | "next" | "remix" | "astro" | "sveltekit" | "express" | "hono" | "fastify" | "unknown";
160
+ version: string;
161
+ configFile: string | null;
162
+ };
163
+ injectionPoints: {
164
+ type: "return" | "res.json" | "assignment" | "useFetch-transform" | "useAsyncData-transform" | "loader-return" | "getServerSideProps-return" | "getStaticProps-return" | "load-return" | "frontmatter-assignment" | "asyncData-return" | "vuex-action-return";
165
+ filePath: string;
166
+ line: number;
167
+ score: number;
168
+ confidence: "high" | "medium" | "low";
169
+ targetCode: string;
170
+ context: string;
171
+ reasons: string[];
172
+ }[];
173
+ packageManager: "npm" | "yarn" | "pnpm" | "bun";
174
+ projectRoot: string;
175
+ }>;
176
+ type ScanResult = z.infer<typeof ScanResult>;
177
+ declare const FilePatch: z.ZodObject<{
178
+ filePath: z.ZodString;
179
+ description: z.ZodString;
180
+ importToAdd: z.ZodString;
181
+ wrapTarget: z.ZodObject<{
182
+ line: z.ZodNumber;
183
+ originalCode: z.ZodString;
184
+ transformedCode: z.ZodString;
185
+ }, "strip", z.ZodTypeAny, {
186
+ line: number;
187
+ originalCode: string;
188
+ transformedCode: string;
189
+ }, {
190
+ line: number;
191
+ originalCode: string;
192
+ transformedCode: string;
193
+ }>;
194
+ confidence: z.ZodEnum<["high", "medium", "low"]>;
195
+ reasons: z.ZodArray<z.ZodString, "many">;
196
+ }, "strip", z.ZodTypeAny, {
197
+ description: string;
198
+ filePath: string;
199
+ confidence: "high" | "medium" | "low";
200
+ reasons: string[];
201
+ importToAdd: string;
202
+ wrapTarget: {
203
+ line: number;
204
+ originalCode: string;
205
+ transformedCode: string;
206
+ };
207
+ }, {
208
+ description: string;
209
+ filePath: string;
210
+ confidence: "high" | "medium" | "low";
211
+ reasons: string[];
212
+ importToAdd: string;
213
+ wrapTarget: {
214
+ line: number;
215
+ originalCode: string;
216
+ transformedCode: string;
217
+ };
218
+ }>;
219
+ type FilePatch = z.infer<typeof FilePatch>;
220
+ declare const PatchPlan: z.ZodObject<{
221
+ schemaVersion: z.ZodLiteral<"1.0">;
222
+ scan: z.ZodObject<{
223
+ framework: z.ZodObject<{
224
+ name: z.ZodEnum<["nuxt", "nuxt2", "next", "remix", "astro", "sveltekit", "express", "hono", "fastify", "unknown"]>;
225
+ version: z.ZodString;
226
+ configFile: z.ZodNullable<z.ZodString>;
227
+ }, "strip", z.ZodTypeAny, {
228
+ name: "nuxt" | "nuxt2" | "next" | "remix" | "astro" | "sveltekit" | "express" | "hono" | "fastify" | "unknown";
229
+ version: string;
230
+ configFile: string | null;
231
+ }, {
232
+ name: "nuxt" | "nuxt2" | "next" | "remix" | "astro" | "sveltekit" | "express" | "hono" | "fastify" | "unknown";
233
+ version: string;
234
+ configFile: string | null;
235
+ }>;
236
+ cms: z.ZodObject<{
237
+ type: z.ZodEnum<["prismic", "contentful", "sanity", "shopify", "cloudinary", "imgix", "generic", "unknown"]>;
238
+ params: z.ZodRecord<z.ZodString, z.ZodString>;
239
+ detectedFrom: z.ZodArray<z.ZodString, "many">;
240
+ }, "strip", z.ZodTypeAny, {
241
+ type: "unknown" | "prismic" | "contentful" | "sanity" | "shopify" | "cloudinary" | "imgix" | "generic";
242
+ params: Record<string, string>;
243
+ detectedFrom: string[];
244
+ }, {
245
+ type: "unknown" | "prismic" | "contentful" | "sanity" | "shopify" | "cloudinary" | "imgix" | "generic";
246
+ params: Record<string, string>;
247
+ detectedFrom: string[];
248
+ }>;
249
+ injectionPoints: z.ZodArray<z.ZodObject<{
250
+ filePath: z.ZodString;
251
+ line: z.ZodNumber;
252
+ type: z.ZodEnum<["return", "res.json", "assignment", "useFetch-transform", "useAsyncData-transform", "loader-return", "getServerSideProps-return", "getStaticProps-return", "load-return", "frontmatter-assignment", "asyncData-return", "vuex-action-return"]>;
253
+ score: z.ZodNumber;
254
+ confidence: z.ZodEnum<["high", "medium", "low"]>;
255
+ targetCode: z.ZodString;
256
+ context: z.ZodString;
257
+ reasons: z.ZodArray<z.ZodString, "many">;
258
+ }, "strip", z.ZodTypeAny, {
259
+ type: "return" | "res.json" | "assignment" | "useFetch-transform" | "useAsyncData-transform" | "loader-return" | "getServerSideProps-return" | "getStaticProps-return" | "load-return" | "frontmatter-assignment" | "asyncData-return" | "vuex-action-return";
260
+ filePath: string;
261
+ line: number;
262
+ score: number;
263
+ confidence: "high" | "medium" | "low";
264
+ targetCode: string;
265
+ context: string;
266
+ reasons: string[];
267
+ }, {
268
+ type: "return" | "res.json" | "assignment" | "useFetch-transform" | "useAsyncData-transform" | "loader-return" | "getServerSideProps-return" | "getStaticProps-return" | "load-return" | "frontmatter-assignment" | "asyncData-return" | "vuex-action-return";
269
+ filePath: string;
270
+ line: number;
271
+ score: number;
272
+ confidence: "high" | "medium" | "low";
273
+ targetCode: string;
274
+ context: string;
275
+ reasons: string[];
276
+ }>, "many">;
277
+ packageManager: z.ZodEnum<["npm", "yarn", "pnpm", "bun"]>;
278
+ projectRoot: z.ZodString;
279
+ }, "strip", z.ZodTypeAny, {
280
+ cms: {
281
+ type: "unknown" | "prismic" | "contentful" | "sanity" | "shopify" | "cloudinary" | "imgix" | "generic";
282
+ params: Record<string, string>;
283
+ detectedFrom: string[];
284
+ };
285
+ framework: {
286
+ name: "nuxt" | "nuxt2" | "next" | "remix" | "astro" | "sveltekit" | "express" | "hono" | "fastify" | "unknown";
287
+ version: string;
288
+ configFile: string | null;
289
+ };
290
+ injectionPoints: {
291
+ type: "return" | "res.json" | "assignment" | "useFetch-transform" | "useAsyncData-transform" | "loader-return" | "getServerSideProps-return" | "getStaticProps-return" | "load-return" | "frontmatter-assignment" | "asyncData-return" | "vuex-action-return";
292
+ filePath: string;
293
+ line: number;
294
+ score: number;
295
+ confidence: "high" | "medium" | "low";
296
+ targetCode: string;
297
+ context: string;
298
+ reasons: string[];
299
+ }[];
300
+ packageManager: "npm" | "yarn" | "pnpm" | "bun";
301
+ projectRoot: string;
302
+ }, {
303
+ cms: {
304
+ type: "unknown" | "prismic" | "contentful" | "sanity" | "shopify" | "cloudinary" | "imgix" | "generic";
305
+ params: Record<string, string>;
306
+ detectedFrom: string[];
307
+ };
308
+ framework: {
309
+ name: "nuxt" | "nuxt2" | "next" | "remix" | "astro" | "sveltekit" | "express" | "hono" | "fastify" | "unknown";
310
+ version: string;
311
+ configFile: string | null;
312
+ };
313
+ injectionPoints: {
314
+ type: "return" | "res.json" | "assignment" | "useFetch-transform" | "useAsyncData-transform" | "loader-return" | "getServerSideProps-return" | "getStaticProps-return" | "load-return" | "frontmatter-assignment" | "asyncData-return" | "vuex-action-return";
315
+ filePath: string;
316
+ line: number;
317
+ score: number;
318
+ confidence: "high" | "medium" | "low";
319
+ targetCode: string;
320
+ context: string;
321
+ reasons: string[];
322
+ }[];
323
+ packageManager: "npm" | "yarn" | "pnpm" | "bun";
324
+ projectRoot: string;
325
+ }>;
326
+ install: z.ZodObject<{
327
+ package: z.ZodLiteral<"@synchronized-studio/response-transformer">;
328
+ command: z.ZodString;
329
+ }, "strip", z.ZodTypeAny, {
330
+ package: "@synchronized-studio/response-transformer";
331
+ command: string;
332
+ }, {
333
+ package: "@synchronized-studio/response-transformer";
334
+ command: string;
335
+ }>;
336
+ env: z.ZodObject<{
337
+ key: z.ZodLiteral<"CMS_ASSETS_URL">;
338
+ placeholder: z.ZodString;
339
+ files: z.ZodArray<z.ZodString, "many">;
340
+ }, "strip", z.ZodTypeAny, {
341
+ key: "CMS_ASSETS_URL";
342
+ placeholder: string;
343
+ files: string[];
344
+ }, {
345
+ key: "CMS_ASSETS_URL";
346
+ placeholder: string;
347
+ files: string[];
348
+ }>;
349
+ patches: z.ZodArray<z.ZodObject<{
350
+ filePath: z.ZodString;
351
+ description: z.ZodString;
352
+ importToAdd: z.ZodString;
353
+ wrapTarget: z.ZodObject<{
354
+ line: z.ZodNumber;
355
+ originalCode: z.ZodString;
356
+ transformedCode: z.ZodString;
357
+ }, "strip", z.ZodTypeAny, {
358
+ line: number;
359
+ originalCode: string;
360
+ transformedCode: string;
361
+ }, {
362
+ line: number;
363
+ originalCode: string;
364
+ transformedCode: string;
365
+ }>;
366
+ confidence: z.ZodEnum<["high", "medium", "low"]>;
367
+ reasons: z.ZodArray<z.ZodString, "many">;
368
+ }, "strip", z.ZodTypeAny, {
369
+ description: string;
370
+ filePath: string;
371
+ confidence: "high" | "medium" | "low";
372
+ reasons: string[];
373
+ importToAdd: string;
374
+ wrapTarget: {
375
+ line: number;
376
+ originalCode: string;
377
+ transformedCode: string;
378
+ };
379
+ }, {
380
+ description: string;
381
+ filePath: string;
382
+ confidence: "high" | "medium" | "low";
383
+ reasons: string[];
384
+ importToAdd: string;
385
+ wrapTarget: {
386
+ line: number;
387
+ originalCode: string;
388
+ transformedCode: string;
389
+ };
390
+ }>, "many">;
391
+ policies: z.ZodObject<{
392
+ maxFilesAutoApply: z.ZodDefault<z.ZodNumber>;
393
+ allowLlmFallback: z.ZodDefault<z.ZodBoolean>;
394
+ /** When true, try LLM for any failed AST patch (not just low confidence). Useful for testing. */
395
+ llmFallbackForAll: z.ZodDefault<z.ZodBoolean>;
396
+ /** When true, skip AST entirely and use LLM for all patches (testing only). */
397
+ llmOnly: z.ZodDefault<z.ZodBoolean>;
398
+ verifyProfile: z.ZodDefault<z.ZodEnum<["quick", "full"]>>;
399
+ }, "strip", z.ZodTypeAny, {
400
+ maxFilesAutoApply: number;
401
+ allowLlmFallback: boolean;
402
+ llmFallbackForAll: boolean;
403
+ llmOnly: boolean;
404
+ verifyProfile: "quick" | "full";
405
+ }, {
406
+ maxFilesAutoApply?: number | undefined;
407
+ allowLlmFallback?: boolean | undefined;
408
+ llmFallbackForAll?: boolean | undefined;
409
+ llmOnly?: boolean | undefined;
410
+ verifyProfile?: "quick" | "full" | undefined;
411
+ }>;
412
+ }, "strip", z.ZodTypeAny, {
413
+ scan: {
414
+ cms: {
415
+ type: "unknown" | "prismic" | "contentful" | "sanity" | "shopify" | "cloudinary" | "imgix" | "generic";
416
+ params: Record<string, string>;
417
+ detectedFrom: string[];
418
+ };
419
+ framework: {
420
+ name: "nuxt" | "nuxt2" | "next" | "remix" | "astro" | "sveltekit" | "express" | "hono" | "fastify" | "unknown";
421
+ version: string;
422
+ configFile: string | null;
423
+ };
424
+ injectionPoints: {
425
+ type: "return" | "res.json" | "assignment" | "useFetch-transform" | "useAsyncData-transform" | "loader-return" | "getServerSideProps-return" | "getStaticProps-return" | "load-return" | "frontmatter-assignment" | "asyncData-return" | "vuex-action-return";
426
+ filePath: string;
427
+ line: number;
428
+ score: number;
429
+ confidence: "high" | "medium" | "low";
430
+ targetCode: string;
431
+ context: string;
432
+ reasons: string[];
433
+ }[];
434
+ packageManager: "npm" | "yarn" | "pnpm" | "bun";
435
+ projectRoot: string;
436
+ };
437
+ install: {
438
+ package: "@synchronized-studio/response-transformer";
439
+ command: string;
440
+ };
441
+ schemaVersion: "1.0";
442
+ env: {
443
+ key: "CMS_ASSETS_URL";
444
+ placeholder: string;
445
+ files: string[];
446
+ };
447
+ patches: {
448
+ description: string;
449
+ filePath: string;
450
+ confidence: "high" | "medium" | "low";
451
+ reasons: string[];
452
+ importToAdd: string;
453
+ wrapTarget: {
454
+ line: number;
455
+ originalCode: string;
456
+ transformedCode: string;
457
+ };
458
+ }[];
459
+ policies: {
460
+ maxFilesAutoApply: number;
461
+ allowLlmFallback: boolean;
462
+ llmFallbackForAll: boolean;
463
+ llmOnly: boolean;
464
+ verifyProfile: "quick" | "full";
465
+ };
466
+ }, {
467
+ scan: {
468
+ cms: {
469
+ type: "unknown" | "prismic" | "contentful" | "sanity" | "shopify" | "cloudinary" | "imgix" | "generic";
470
+ params: Record<string, string>;
471
+ detectedFrom: string[];
472
+ };
473
+ framework: {
474
+ name: "nuxt" | "nuxt2" | "next" | "remix" | "astro" | "sveltekit" | "express" | "hono" | "fastify" | "unknown";
475
+ version: string;
476
+ configFile: string | null;
477
+ };
478
+ injectionPoints: {
479
+ type: "return" | "res.json" | "assignment" | "useFetch-transform" | "useAsyncData-transform" | "loader-return" | "getServerSideProps-return" | "getStaticProps-return" | "load-return" | "frontmatter-assignment" | "asyncData-return" | "vuex-action-return";
480
+ filePath: string;
481
+ line: number;
482
+ score: number;
483
+ confidence: "high" | "medium" | "low";
484
+ targetCode: string;
485
+ context: string;
486
+ reasons: string[];
487
+ }[];
488
+ packageManager: "npm" | "yarn" | "pnpm" | "bun";
489
+ projectRoot: string;
490
+ };
491
+ install: {
492
+ package: "@synchronized-studio/response-transformer";
493
+ command: string;
494
+ };
495
+ schemaVersion: "1.0";
496
+ env: {
497
+ key: "CMS_ASSETS_URL";
498
+ placeholder: string;
499
+ files: string[];
500
+ };
501
+ patches: {
502
+ description: string;
503
+ filePath: string;
504
+ confidence: "high" | "medium" | "low";
505
+ reasons: string[];
506
+ importToAdd: string;
507
+ wrapTarget: {
508
+ line: number;
509
+ originalCode: string;
510
+ transformedCode: string;
511
+ };
512
+ }[];
513
+ policies: {
514
+ maxFilesAutoApply?: number | undefined;
515
+ allowLlmFallback?: boolean | undefined;
516
+ llmFallbackForAll?: boolean | undefined;
517
+ llmOnly?: boolean | undefined;
518
+ verifyProfile?: "quick" | "full" | undefined;
519
+ };
520
+ }>;
521
+ type PatchPlan = z.infer<typeof PatchPlan>;
522
+ declare const PatchedFileReport: z.ZodObject<{
523
+ filePath: z.ZodString;
524
+ applied: z.ZodBoolean;
525
+ method: z.ZodEnum<["ast", "llm", "skipped"]>;
526
+ reason: z.ZodOptional<z.ZodString>;
527
+ durationMs: z.ZodNumber;
528
+ }, "strip", z.ZodTypeAny, {
529
+ filePath: string;
530
+ applied: boolean;
531
+ method: "llm" | "ast" | "skipped";
532
+ durationMs: number;
533
+ reason?: string | undefined;
534
+ }, {
535
+ filePath: string;
536
+ applied: boolean;
537
+ method: "llm" | "ast" | "skipped";
538
+ durationMs: number;
539
+ reason?: string | undefined;
540
+ }>;
541
+ type PatchedFileReport = z.infer<typeof PatchedFileReport>;
542
+ declare const ApplyReport: z.ZodObject<{
543
+ schemaVersion: z.ZodLiteral<"1.0">;
544
+ timestamp: z.ZodString;
545
+ projectRoot: z.ZodString;
546
+ gitBranch: z.ZodNullable<z.ZodString>;
547
+ gitCommit: z.ZodNullable<z.ZodString>;
548
+ installed: z.ZodBoolean;
549
+ envUpdated: z.ZodBoolean;
550
+ files: z.ZodArray<z.ZodObject<{
551
+ filePath: z.ZodString;
552
+ applied: z.ZodBoolean;
553
+ method: z.ZodEnum<["ast", "llm", "skipped"]>;
554
+ reason: z.ZodOptional<z.ZodString>;
555
+ durationMs: z.ZodNumber;
556
+ }, "strip", z.ZodTypeAny, {
557
+ filePath: string;
558
+ applied: boolean;
559
+ method: "llm" | "ast" | "skipped";
560
+ durationMs: number;
561
+ reason?: string | undefined;
562
+ }, {
563
+ filePath: string;
564
+ applied: boolean;
565
+ method: "llm" | "ast" | "skipped";
566
+ durationMs: number;
567
+ reason?: string | undefined;
568
+ }>, "many">;
569
+ totalDurationMs: z.ZodNumber;
570
+ }, "strip", z.ZodTypeAny, {
571
+ projectRoot: string;
572
+ schemaVersion: "1.0";
573
+ files: {
574
+ filePath: string;
575
+ applied: boolean;
576
+ method: "llm" | "ast" | "skipped";
577
+ durationMs: number;
578
+ reason?: string | undefined;
579
+ }[];
580
+ timestamp: string;
581
+ gitBranch: string | null;
582
+ gitCommit: string | null;
583
+ installed: boolean;
584
+ envUpdated: boolean;
585
+ totalDurationMs: number;
586
+ }, {
587
+ projectRoot: string;
588
+ schemaVersion: "1.0";
589
+ files: {
590
+ filePath: string;
591
+ applied: boolean;
592
+ method: "llm" | "ast" | "skipped";
593
+ durationMs: number;
594
+ reason?: string | undefined;
595
+ }[];
596
+ timestamp: string;
597
+ gitBranch: string | null;
598
+ gitCommit: string | null;
599
+ installed: boolean;
600
+ envUpdated: boolean;
601
+ totalDurationMs: number;
602
+ }>;
603
+ type ApplyReport = z.infer<typeof ApplyReport>;
604
+ declare const VerifyReport: z.ZodObject<{
605
+ schemaVersion: z.ZodLiteral<"1.0">;
606
+ profile: z.ZodEnum<["quick", "full"]>;
607
+ lintPassed: z.ZodNullable<z.ZodBoolean>;
608
+ buildPassed: z.ZodNullable<z.ZodBoolean>;
609
+ testsPassed: z.ZodNullable<z.ZodBoolean>;
610
+ patchedFiles: z.ZodArray<z.ZodString, "many">;
611
+ warnings: z.ZodArray<z.ZodString, "many">;
612
+ durationMs: z.ZodNumber;
613
+ }, "strip", z.ZodTypeAny, {
614
+ profile: "quick" | "full";
615
+ schemaVersion: "1.0";
616
+ durationMs: number;
617
+ lintPassed: boolean | null;
618
+ buildPassed: boolean | null;
619
+ testsPassed: boolean | null;
620
+ patchedFiles: string[];
621
+ warnings: string[];
622
+ }, {
623
+ profile: "quick" | "full";
624
+ schemaVersion: "1.0";
625
+ durationMs: number;
626
+ lintPassed: boolean | null;
627
+ buildPassed: boolean | null;
628
+ testsPassed: boolean | null;
629
+ patchedFiles: string[];
630
+ warnings: string[];
631
+ }>;
632
+ type VerifyReport = z.infer<typeof VerifyReport>;
633
+ declare const AiFileResult: z.ZodObject<{
634
+ filePath: z.ZodString;
635
+ passed: z.ZodBoolean;
636
+ issues: z.ZodArray<z.ZodString, "many">;
637
+ fixAttempted: z.ZodBoolean;
638
+ fixApplied: z.ZodBoolean;
639
+ iterations: z.ZodNumber;
640
+ }, "strip", z.ZodTypeAny, {
641
+ issues: string[];
642
+ filePath: string;
643
+ passed: boolean;
644
+ fixAttempted: boolean;
645
+ fixApplied: boolean;
646
+ iterations: number;
647
+ }, {
648
+ issues: string[];
649
+ filePath: string;
650
+ passed: boolean;
651
+ fixAttempted: boolean;
652
+ fixApplied: boolean;
653
+ iterations: number;
654
+ }>;
655
+ type AiFileResult = z.infer<typeof AiFileResult>;
656
+ declare const AiReviewReport: z.ZodObject<{
657
+ schemaVersion: z.ZodLiteral<"1.0">;
658
+ filesReviewed: z.ZodNumber;
659
+ filesPassed: z.ZodNumber;
660
+ filesFixed: z.ZodNumber;
661
+ filesFailed: z.ZodNumber;
662
+ results: z.ZodArray<z.ZodObject<{
663
+ filePath: z.ZodString;
664
+ passed: z.ZodBoolean;
665
+ issues: z.ZodArray<z.ZodString, "many">;
666
+ fixAttempted: z.ZodBoolean;
667
+ fixApplied: z.ZodBoolean;
668
+ iterations: z.ZodNumber;
669
+ }, "strip", z.ZodTypeAny, {
670
+ issues: string[];
671
+ filePath: string;
672
+ passed: boolean;
673
+ fixAttempted: boolean;
674
+ fixApplied: boolean;
675
+ iterations: number;
676
+ }, {
677
+ issues: string[];
678
+ filePath: string;
679
+ passed: boolean;
680
+ fixAttempted: boolean;
681
+ fixApplied: boolean;
682
+ iterations: number;
683
+ }>, "many">;
684
+ totalDurationMs: z.ZodNumber;
685
+ tokensUsed: z.ZodNumber;
686
+ }, "strip", z.ZodTypeAny, {
687
+ schemaVersion: "1.0";
688
+ totalDurationMs: number;
689
+ filesReviewed: number;
690
+ filesPassed: number;
691
+ filesFixed: number;
692
+ filesFailed: number;
693
+ results: {
694
+ issues: string[];
695
+ filePath: string;
696
+ passed: boolean;
697
+ fixAttempted: boolean;
698
+ fixApplied: boolean;
699
+ iterations: number;
700
+ }[];
701
+ tokensUsed: number;
702
+ }, {
703
+ schemaVersion: "1.0";
704
+ totalDurationMs: number;
705
+ filesReviewed: number;
706
+ filesPassed: number;
707
+ filesFixed: number;
708
+ filesFailed: number;
709
+ results: {
710
+ issues: string[];
711
+ filePath: string;
712
+ passed: boolean;
713
+ fixAttempted: boolean;
714
+ fixApplied: boolean;
715
+ iterations: number;
716
+ }[];
717
+ tokensUsed: number;
718
+ }>;
719
+ type AiReviewReport = z.infer<typeof AiReviewReport>;
720
+
721
+ declare function scan(projectRoot?: string): ScanResult;
722
+
723
+ declare function createPlan(scan: ScanResult): PatchPlan;
724
+
725
+ interface ApplyOptions {
726
+ dryRun?: boolean;
727
+ includeTests?: boolean;
728
+ maxFiles?: number;
729
+ }
730
+ declare function applyPlan(plan: PatchPlan, opts?: ApplyOptions): Promise<ApplyReport>;
731
+
732
+ interface VerifyOptions {
733
+ profile?: VerifyProfile;
734
+ framework?: FrameworkName;
735
+ patchedFiles?: string[];
736
+ }
737
+ declare function verify(root: string, opts?: VerifyOptions): VerifyReport;
738
+
739
+ interface AiReviewOptions {
740
+ maxIterations?: number;
741
+ model?: string;
742
+ }
743
+ declare function aiReviewAll(root: string, patchedFiles: string[], plan: PatchPlan, opts?: AiReviewOptions): Promise<AiReviewReport>;
744
+
745
+ declare const gitOps: {
746
+ isGitRepo(cwd: string): boolean;
747
+ isClean(cwd: string): boolean;
748
+ getCurrentBranch(cwd: string): string | null;
749
+ getHeadCommit(cwd: string): string | null;
750
+ createBranch(cwd: string, name: string): boolean;
751
+ stageAll(cwd: string): void;
752
+ commit(cwd: string, message: string): string | null;
753
+ rollbackToCommit(cwd: string, commitHash: string): boolean;
754
+ getLastCommitByAgent(cwd: string): string | null;
755
+ getCommitBefore(cwd: string, commitHash: string): string | null;
756
+ push(cwd: string, remote?: string): boolean;
757
+ };
758
+
759
+ interface AgentReport {
760
+ version: '1.0';
761
+ timestamp: string;
762
+ scan?: ScanResult;
763
+ plan?: PatchPlan;
764
+ apply?: ApplyReport;
765
+ verify?: VerifyReport;
766
+ aiReview?: AiReviewReport;
767
+ }
768
+ declare function createReport(parts: Omit<AgentReport, 'version' | 'timestamp'>): AgentReport;
769
+ declare function saveReport(root: string, report: AgentReport): string;
770
+ declare function savePlanFile(root: string, plan: PatchPlan): string;
771
+ declare function loadPlanFile(filePath: string): PatchPlan | null;
772
+
773
+ /**
774
+ * Unified engine used by all distribution channels:
775
+ * - npx CLI (commands call these directly)
776
+ * - GitHub App (webhook handler calls runFullPipeline)
777
+ * - Admin panel (API endpoint calls runFullPipeline)
778
+ *
779
+ * Every channel uses the same scan -> plan -> apply -> verify pipeline
780
+ * to guarantee identical results regardless of trigger source.
781
+ */
782
+
783
+ interface PipelineOptions {
784
+ projectRoot: string;
785
+ dryRun?: boolean;
786
+ includeTests?: boolean;
787
+ maxFiles?: number;
788
+ allowLlmFallback?: boolean;
789
+ verifyProfile?: VerifyProfile;
790
+ gitBranch?: boolean;
791
+ gitCommit?: boolean;
792
+ savePlan?: boolean;
793
+ saveReport?: boolean;
794
+ cmsOverride?: string;
795
+ paramsOverride?: Record<string, string>;
796
+ slug?: string;
797
+ aiVerify?: boolean;
798
+ aiModel?: string;
799
+ aiMaxIterations?: number;
800
+ }
801
+ interface PipelineResult {
802
+ scan: ScanResult;
803
+ plan: PatchPlan;
804
+ report: AgentReport;
805
+ aiReview?: AiReviewReport;
806
+ planFilePath?: string;
807
+ reportFilePath?: string;
808
+ }
809
+ declare function runFullPipeline(opts: PipelineOptions): Promise<PipelineResult>;
810
+
811
+ export { AiFileResult, AiReviewReport, ApplyReport, CmsInfo, CmsType, Confidence, FilePatch, FrameworkInfo, FrameworkName, InjectionCandidate, InjectionType, PackageManager, PatchPlan, PatchedFileReport, type PipelineOptions, type PipelineResult, ScanResult, VerifyProfile, VerifyReport, aiReviewAll, applyPlan, createPlan, createReport, gitOps, loadPlanFile, runFullPipeline, savePlanFile, saveReport, scan, verify };