codebuff 1.0.152 → 1.0.153

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.
Files changed (49) hide show
  1. package/dist/browser-runner.js +7 -17
  2. package/dist/browser-runner.js.map +1 -1
  3. package/dist/chat-storage.js +7 -17
  4. package/dist/chat-storage.js.map +1 -1
  5. package/dist/cli.js +7 -17
  6. package/dist/cli.js.map +1 -1
  7. package/dist/client.js +16 -25
  8. package/dist/client.js.map +1 -1
  9. package/dist/code-map/languages.js +7 -17
  10. package/dist/code-map/languages.js.map +1 -1
  11. package/dist/code-map/parse.js +7 -17
  12. package/dist/code-map/parse.js.map +1 -1
  13. package/dist/code-map/tsconfig.tsbuildinfo +1 -1
  14. package/dist/common/advanced-analyzer.d.ts +19 -0
  15. package/dist/common/advanced-analyzer.js +140 -0
  16. package/dist/common/advanced-analyzer.js.map +1 -0
  17. package/dist/common/browser-actions.d.ts +50 -50
  18. package/dist/common/message-image-handling.d.ts +41 -0
  19. package/dist/common/message-image-handling.js +57 -0
  20. package/dist/common/message-image-handling.js.map +1 -0
  21. package/dist/common/types/usage.d.ts +2 -2
  22. package/dist/common/util/credentials.d.ts +2 -2
  23. package/dist/create-template-project.js +7 -17
  24. package/dist/create-template-project.js.map +1 -1
  25. package/dist/index.js +1 -1
  26. package/dist/menu.js +7 -17
  27. package/dist/menu.js.map +1 -1
  28. package/dist/project-files.js +7 -17
  29. package/dist/project-files.js.map +1 -1
  30. package/dist/tool-handlers.js +7 -17
  31. package/dist/tool-handlers.js.map +1 -1
  32. package/dist/utils/terminal.js +7 -17
  33. package/dist/utils/terminal.js.map +1 -1
  34. package/package.json +1 -1
  35. package/dist/common/logger.d.ts +0 -1
  36. package/dist/common/logger.js +0 -7
  37. package/dist/common/logger.js.map +0 -1
  38. package/dist/common/util/constants.d.ts +0 -1
  39. package/dist/common/util/constants.js +0 -7
  40. package/dist/common/util/constants.js.map +0 -1
  41. package/dist/common/util/helpers.d.ts +0 -1
  42. package/dist/common/util/helpers.js +0 -6
  43. package/dist/common/util/helpers.js.map +0 -1
  44. package/dist/common/util/messages.d.ts +0 -1
  45. package/dist/common/util/messages.js +0 -7
  46. package/dist/common/util/messages.js.map +0 -1
  47. package/dist/common/util/token-counter.d.ts +0 -3
  48. package/dist/common/util/token-counter.js +0 -27
  49. package/dist/common/util/token-counter.js.map +0 -1
@@ -35,8 +35,8 @@ export declare const LogSchema: z.ZodObject<{
35
35
  }, "strip", z.ZodTypeAny, {
36
36
  type: "error" | "warning" | "info" | "debug" | "verbose";
37
37
  message: string;
38
- source: "browser" | "tool";
39
38
  timestamp: number;
39
+ source: "browser" | "tool";
40
40
  location?: string | undefined;
41
41
  stack?: string | undefined;
42
42
  category?: string | undefined;
@@ -45,11 +45,11 @@ export declare const LogSchema: z.ZodObject<{
45
45
  type: "error" | "warning" | "info" | "debug" | "verbose";
46
46
  message: string;
47
47
  timestamp: number;
48
- source?: "browser" | "tool" | undefined;
49
48
  location?: string | undefined;
50
49
  stack?: string | undefined;
51
50
  category?: string | undefined;
52
51
  level?: number | undefined;
52
+ source?: "browser" | "tool" | undefined;
53
53
  }>;
54
54
  export type Log = z.infer<typeof LogSchema>;
55
55
  export declare const MetricsSchema: z.ZodObject<{
@@ -90,14 +90,14 @@ export declare const NetworkEventSchema: z.ZodObject<{
90
90
  errorText: z.ZodOptional<z.ZodString>;
91
91
  timestamp: z.ZodNumber;
92
92
  }, "strip", z.ZodTypeAny, {
93
- url: string;
94
93
  timestamp: number;
94
+ url: string;
95
95
  method: string;
96
96
  status?: number | undefined;
97
97
  errorText?: string | undefined;
98
98
  }, {
99
- url: string;
100
99
  timestamp: number;
100
+ url: string;
101
101
  method: string;
102
102
  status?: number | undefined;
103
103
  errorText?: string | undefined;
@@ -248,14 +248,14 @@ export declare const BrowserResponseChunkSchema: z.ZodObject<{
248
248
  data: z.ZodString;
249
249
  }, "strip", z.ZodTypeAny, {
250
250
  id: string;
251
- data: string;
252
251
  total: number;
253
252
  index: number;
253
+ data: string;
254
254
  }, {
255
255
  id: string;
256
- data: string;
257
256
  total: number;
258
257
  index: number;
258
+ data: string;
259
259
  }>;
260
260
  export declare const ImageContentSchema: z.ZodObject<{
261
261
  type: z.ZodLiteral<"image">;
@@ -265,26 +265,26 @@ export declare const ImageContentSchema: z.ZodObject<{
265
265
  data: z.ZodString;
266
266
  }, "strip", z.ZodTypeAny, {
267
267
  type: "base64";
268
- media_type: "image/jpeg";
269
268
  data: string;
269
+ media_type: "image/jpeg";
270
270
  }, {
271
271
  type: "base64";
272
- media_type: "image/jpeg";
273
272
  data: string;
273
+ media_type: "image/jpeg";
274
274
  }>;
275
275
  }, "strip", z.ZodTypeAny, {
276
276
  type: "image";
277
277
  source: {
278
278
  type: "base64";
279
- media_type: "image/jpeg";
280
279
  data: string;
280
+ media_type: "image/jpeg";
281
281
  };
282
282
  }, {
283
283
  type: "image";
284
284
  source: {
285
285
  type: "base64";
286
- media_type: "image/jpeg";
287
286
  data: string;
287
+ media_type: "image/jpeg";
288
288
  };
289
289
  }>;
290
290
  export type ImageContent = z.infer<typeof ImageContentSchema>;
@@ -299,26 +299,26 @@ export declare const BrowserResponseSchema: z.ZodObject<{
299
299
  data: z.ZodString;
300
300
  }, "strip", z.ZodTypeAny, {
301
301
  type: "base64";
302
- media_type: "image/jpeg";
303
302
  data: string;
303
+ media_type: "image/jpeg";
304
304
  }, {
305
305
  type: "base64";
306
- media_type: "image/jpeg";
307
306
  data: string;
307
+ media_type: "image/jpeg";
308
308
  }>;
309
309
  }, "strip", z.ZodTypeAny, {
310
310
  type: "image";
311
311
  source: {
312
312
  type: "base64";
313
- media_type: "image/jpeg";
314
313
  data: string;
314
+ media_type: "image/jpeg";
315
315
  };
316
316
  }, {
317
317
  type: "image";
318
318
  source: {
319
319
  type: "base64";
320
- media_type: "image/jpeg";
321
320
  data: string;
321
+ media_type: "image/jpeg";
322
322
  };
323
323
  }>>;
324
324
  logs: z.ZodArray<z.ZodObject<{
@@ -333,8 +333,8 @@ export declare const BrowserResponseSchema: z.ZodObject<{
333
333
  }, "strip", z.ZodTypeAny, {
334
334
  type: "error" | "warning" | "info" | "debug" | "verbose";
335
335
  message: string;
336
- source: "browser" | "tool";
337
336
  timestamp: number;
337
+ source: "browser" | "tool";
338
338
  location?: string | undefined;
339
339
  stack?: string | undefined;
340
340
  category?: string | undefined;
@@ -343,11 +343,11 @@ export declare const BrowserResponseSchema: z.ZodObject<{
343
343
  type: "error" | "warning" | "info" | "debug" | "verbose";
344
344
  message: string;
345
345
  timestamp: number;
346
- source?: "browser" | "tool" | undefined;
347
346
  location?: string | undefined;
348
347
  stack?: string | undefined;
349
348
  category?: string | undefined;
350
349
  level?: number | undefined;
350
+ source?: "browser" | "tool" | undefined;
351
351
  }>, "many">;
352
352
  metrics: z.ZodOptional<z.ZodObject<{
353
353
  loadTime: z.ZodNumber;
@@ -387,14 +387,14 @@ export declare const BrowserResponseSchema: z.ZodObject<{
387
387
  errorText: z.ZodOptional<z.ZodString>;
388
388
  timestamp: z.ZodNumber;
389
389
  }, "strip", z.ZodTypeAny, {
390
- url: string;
391
390
  timestamp: number;
391
+ url: string;
392
392
  method: string;
393
393
  status?: number | undefined;
394
394
  errorText?: string | undefined;
395
395
  }, {
396
- url: string;
397
396
  timestamp: number;
397
+ url: string;
398
398
  method: string;
399
399
  status?: number | undefined;
400
400
  errorText?: string | undefined;
@@ -419,22 +419,22 @@ export declare const BrowserResponseSchema: z.ZodObject<{
419
419
  data: z.ZodString;
420
420
  }, "strip", z.ZodTypeAny, {
421
421
  id: string;
422
- data: string;
423
422
  total: number;
424
423
  index: number;
424
+ data: string;
425
425
  }, {
426
426
  id: string;
427
- data: string;
428
427
  total: number;
429
428
  index: number;
429
+ data: string;
430
430
  }>, "many">>;
431
431
  }, "strip", z.ZodTypeAny, {
432
432
  success: boolean;
433
433
  logs: {
434
434
  type: "error" | "warning" | "info" | "debug" | "verbose";
435
435
  message: string;
436
- source: "browser" | "tool";
437
436
  timestamp: number;
437
+ source: "browser" | "tool";
438
438
  location?: string | undefined;
439
439
  stack?: string | undefined;
440
440
  category?: string | undefined;
@@ -450,8 +450,8 @@ export declare const BrowserResponseSchema: z.ZodObject<{
450
450
  type: "image";
451
451
  source: {
452
452
  type: "base64";
453
- media_type: "image/jpeg";
454
453
  data: string;
454
+ media_type: "image/jpeg";
455
455
  };
456
456
  } | undefined;
457
457
  metrics?: {
@@ -466,17 +466,17 @@ export declare const BrowserResponseSchema: z.ZodObject<{
466
466
  sessionDuration?: number | undefined;
467
467
  } | undefined;
468
468
  networkEvents?: {
469
- url: string;
470
469
  timestamp: number;
470
+ url: string;
471
471
  method: string;
472
472
  status?: number | undefined;
473
473
  errorText?: string | undefined;
474
474
  }[] | undefined;
475
475
  chunks?: {
476
476
  id: string;
477
- data: string;
478
477
  total: number;
479
478
  index: number;
479
+ data: string;
480
480
  }[] | undefined;
481
481
  }, {
482
482
  success: boolean;
@@ -484,11 +484,11 @@ export declare const BrowserResponseSchema: z.ZodObject<{
484
484
  type: "error" | "warning" | "info" | "debug" | "verbose";
485
485
  message: string;
486
486
  timestamp: number;
487
- source?: "browser" | "tool" | undefined;
488
487
  location?: string | undefined;
489
488
  stack?: string | undefined;
490
489
  category?: string | undefined;
491
490
  level?: number | undefined;
491
+ source?: "browser" | "tool" | undefined;
492
492
  }[];
493
493
  error?: string | undefined;
494
494
  logFilter?: {
@@ -500,8 +500,8 @@ export declare const BrowserResponseSchema: z.ZodObject<{
500
500
  type: "image";
501
501
  source: {
502
502
  type: "base64";
503
- media_type: "image/jpeg";
504
503
  data: string;
504
+ media_type: "image/jpeg";
505
505
  };
506
506
  } | undefined;
507
507
  metrics?: {
@@ -516,17 +516,17 @@ export declare const BrowserResponseSchema: z.ZodObject<{
516
516
  sessionDuration?: number | undefined;
517
517
  } | undefined;
518
518
  networkEvents?: {
519
- url: string;
520
519
  timestamp: number;
520
+ url: string;
521
521
  method: string;
522
522
  status?: number | undefined;
523
523
  errorText?: string | undefined;
524
524
  }[] | undefined;
525
525
  chunks?: {
526
526
  id: string;
527
- data: string;
528
527
  total: number;
529
528
  index: number;
529
+ data: string;
530
530
  }[] | undefined;
531
531
  }>;
532
532
  export declare const RequiredBrowserStartActionSchema: z.ZodObject<{
@@ -772,12 +772,12 @@ export declare const RequiredBrowserTypeActionSchema: z.ZodObject<{
772
772
  text: z.ZodString;
773
773
  }, "strip", z.ZodTypeAny, {
774
774
  type: "type";
775
- text: string;
776
775
  selector: string;
776
+ text: string;
777
777
  }, {
778
778
  type: "type";
779
- text: string;
780
779
  selector: string;
780
+ text: string;
781
781
  }>;
782
782
  export declare const BrowserTypeActionSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
783
783
  type: z.ZodLiteral<"type">;
@@ -816,8 +816,8 @@ export declare const BrowserTypeActionSchema: z.ZodObject<z.objectUtil.extendSha
816
816
  delay: z.ZodOptional<z.ZodNumber>;
817
817
  }>, "strip", z.ZodTypeAny, {
818
818
  type: "type";
819
- text: string;
820
819
  selector: string;
820
+ text: string;
821
821
  debug?: boolean | undefined;
822
822
  timeout?: number | undefined;
823
823
  retryOptions?: {
@@ -833,8 +833,8 @@ export declare const BrowserTypeActionSchema: z.ZodObject<z.objectUtil.extendSha
833
833
  delay?: number | undefined;
834
834
  }, {
835
835
  type: "type";
836
- text: string;
837
836
  selector: string;
837
+ text: string;
838
838
  debug?: boolean | undefined;
839
839
  timeout?: number | undefined;
840
840
  retryOptions?: {
@@ -1320,8 +1320,8 @@ export declare const DiagnosticStepSchema: z.ZodObject<{
1320
1320
  delay: z.ZodOptional<z.ZodNumber>;
1321
1321
  }>, "strip", z.ZodTypeAny, {
1322
1322
  type: "type";
1323
- text: string;
1324
1323
  selector: string;
1324
+ text: string;
1325
1325
  debug?: boolean | undefined;
1326
1326
  timeout?: number | undefined;
1327
1327
  retryOptions?: {
@@ -1337,8 +1337,8 @@ export declare const DiagnosticStepSchema: z.ZodObject<{
1337
1337
  delay?: number | undefined;
1338
1338
  }, {
1339
1339
  type: "type";
1340
- text: string;
1341
1340
  selector: string;
1341
+ text: string;
1342
1342
  debug?: boolean | undefined;
1343
1343
  timeout?: number | undefined;
1344
1344
  retryOptions?: {
@@ -1605,8 +1605,8 @@ export declare const DiagnosticStepSchema: z.ZodObject<{
1605
1605
  visualThreshold?: number | undefined;
1606
1606
  } | {
1607
1607
  type: "type";
1608
- text: string;
1609
1608
  selector: string;
1609
+ text: string;
1610
1610
  debug?: boolean | undefined;
1611
1611
  timeout?: number | undefined;
1612
1612
  retryOptions?: {
@@ -1727,8 +1727,8 @@ export declare const DiagnosticStepSchema: z.ZodObject<{
1727
1727
  visualThreshold?: number | undefined;
1728
1728
  } | {
1729
1729
  type: "type";
1730
- text: string;
1731
1730
  selector: string;
1731
+ text: string;
1732
1732
  debug?: boolean | undefined;
1733
1733
  timeout?: number | undefined;
1734
1734
  retryOptions?: {
@@ -2072,8 +2072,8 @@ export declare const BrowserDiagnoseActionSchema: z.ZodObject<{
2072
2072
  delay: z.ZodOptional<z.ZodNumber>;
2073
2073
  }>, "strip", z.ZodTypeAny, {
2074
2074
  type: "type";
2075
- text: string;
2076
2075
  selector: string;
2076
+ text: string;
2077
2077
  debug?: boolean | undefined;
2078
2078
  timeout?: number | undefined;
2079
2079
  retryOptions?: {
@@ -2089,8 +2089,8 @@ export declare const BrowserDiagnoseActionSchema: z.ZodObject<{
2089
2089
  delay?: number | undefined;
2090
2090
  }, {
2091
2091
  type: "type";
2092
- text: string;
2093
2092
  selector: string;
2093
+ text: string;
2094
2094
  debug?: boolean | undefined;
2095
2095
  timeout?: number | undefined;
2096
2096
  retryOptions?: {
@@ -2357,8 +2357,8 @@ export declare const BrowserDiagnoseActionSchema: z.ZodObject<{
2357
2357
  visualThreshold?: number | undefined;
2358
2358
  } | {
2359
2359
  type: "type";
2360
- text: string;
2361
2360
  selector: string;
2361
+ text: string;
2362
2362
  debug?: boolean | undefined;
2363
2363
  timeout?: number | undefined;
2364
2364
  retryOptions?: {
@@ -2479,8 +2479,8 @@ export declare const BrowserDiagnoseActionSchema: z.ZodObject<{
2479
2479
  visualThreshold?: number | undefined;
2480
2480
  } | {
2481
2481
  type: "type";
2482
- text: string;
2483
2482
  selector: string;
2483
+ text: string;
2484
2484
  debug?: boolean | undefined;
2485
2485
  timeout?: number | undefined;
2486
2486
  retryOptions?: {
@@ -2607,8 +2607,8 @@ export declare const BrowserDiagnoseActionSchema: z.ZodObject<{
2607
2607
  visualThreshold?: number | undefined;
2608
2608
  } | {
2609
2609
  type: "type";
2610
- text: string;
2611
2610
  selector: string;
2611
+ text: string;
2612
2612
  debug?: boolean | undefined;
2613
2613
  timeout?: number | undefined;
2614
2614
  retryOptions?: {
@@ -2747,8 +2747,8 @@ export declare const BrowserDiagnoseActionSchema: z.ZodObject<{
2747
2747
  visualThreshold?: number | undefined;
2748
2748
  } | {
2749
2749
  type: "type";
2750
- text: string;
2751
2750
  selector: string;
2751
+ text: string;
2752
2752
  debug?: boolean | undefined;
2753
2753
  timeout?: number | undefined;
2754
2754
  retryOptions?: {
@@ -3076,8 +3076,8 @@ export declare const BrowserActionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
3076
3076
  delay: z.ZodOptional<z.ZodNumber>;
3077
3077
  }>, "strip", z.ZodTypeAny, {
3078
3078
  type: "type";
3079
- text: string;
3080
3079
  selector: string;
3080
+ text: string;
3081
3081
  debug?: boolean | undefined;
3082
3082
  timeout?: number | undefined;
3083
3083
  retryOptions?: {
@@ -3093,8 +3093,8 @@ export declare const BrowserActionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
3093
3093
  delay?: number | undefined;
3094
3094
  }, {
3095
3095
  type: "type";
3096
- text: string;
3097
3096
  selector: string;
3097
+ text: string;
3098
3098
  debug?: boolean | undefined;
3099
3099
  timeout?: number | undefined;
3100
3100
  retryOptions?: {
@@ -3578,8 +3578,8 @@ export declare const BrowserActionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
3578
3578
  delay: z.ZodOptional<z.ZodNumber>;
3579
3579
  }>, "strip", z.ZodTypeAny, {
3580
3580
  type: "type";
3581
- text: string;
3582
3581
  selector: string;
3582
+ text: string;
3583
3583
  debug?: boolean | undefined;
3584
3584
  timeout?: number | undefined;
3585
3585
  retryOptions?: {
@@ -3595,8 +3595,8 @@ export declare const BrowserActionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
3595
3595
  delay?: number | undefined;
3596
3596
  }, {
3597
3597
  type: "type";
3598
- text: string;
3599
3598
  selector: string;
3599
+ text: string;
3600
3600
  debug?: boolean | undefined;
3601
3601
  timeout?: number | undefined;
3602
3602
  retryOptions?: {
@@ -3863,8 +3863,8 @@ export declare const BrowserActionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
3863
3863
  visualThreshold?: number | undefined;
3864
3864
  } | {
3865
3865
  type: "type";
3866
- text: string;
3867
3866
  selector: string;
3867
+ text: string;
3868
3868
  debug?: boolean | undefined;
3869
3869
  timeout?: number | undefined;
3870
3870
  retryOptions?: {
@@ -3985,8 +3985,8 @@ export declare const BrowserActionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
3985
3985
  visualThreshold?: number | undefined;
3986
3986
  } | {
3987
3987
  type: "type";
3988
- text: string;
3989
3988
  selector: string;
3989
+ text: string;
3990
3990
  debug?: boolean | undefined;
3991
3991
  timeout?: number | undefined;
3992
3992
  retryOptions?: {
@@ -4113,8 +4113,8 @@ export declare const BrowserActionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
4113
4113
  visualThreshold?: number | undefined;
4114
4114
  } | {
4115
4115
  type: "type";
4116
- text: string;
4117
4116
  selector: string;
4117
+ text: string;
4118
4118
  debug?: boolean | undefined;
4119
4119
  timeout?: number | undefined;
4120
4120
  retryOptions?: {
@@ -4253,8 +4253,8 @@ export declare const BrowserActionSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
4253
4253
  visualThreshold?: number | undefined;
4254
4254
  } | {
4255
4255
  type: "type";
4256
- text: string;
4257
4256
  selector: string;
4257
+ text: string;
4258
4258
  debug?: boolean | undefined;
4259
4259
  timeout?: number | undefined;
4260
4260
  retryOptions?: {
@@ -0,0 +1,41 @@
1
+ import { Message } from './actions';
2
+ /**
3
+ * Contexts where message processing may occur
4
+ */
5
+ export declare enum ProcessingContext {
6
+ ModelCall = "model-call",
7
+ FileCache = "file-cache",
8
+ WarmCache = "warm-cache"
9
+ }
10
+ /**
11
+ * Interface for provider-specific image handling
12
+ */
13
+ export interface IImageHandler {
14
+ /**
15
+ * Returns whether images should be passed along in the given context
16
+ */
17
+ supportsImages(context: ProcessingContext): boolean;
18
+ /**
19
+ * Transform a message by either stripping, replacing, or modifying image blocks
20
+ */
21
+ transformMessage(message: Message, context: ProcessingContext): Message;
22
+ }
23
+ /**
24
+ * Base handler that removes all images unless explicitly allowed
25
+ */
26
+ export declare class DefaultImageHandler implements IImageHandler {
27
+ supportsImages(context: ProcessingContext): boolean;
28
+ transformMessage(message: Message, context: ProcessingContext): Message;
29
+ }
30
+ /**
31
+ * Register a new image handler for a provider
32
+ */
33
+ export declare function registerImageHandler(provider: string, handler: IImageHandler): void;
34
+ /**
35
+ * Transform a message for a specific provider and context
36
+ */
37
+ export declare function transformMessageForProvider(message: Message, provider: string, context: ProcessingContext): Message;
38
+ /**
39
+ * Transform an array of messages for a specific provider and context
40
+ */
41
+ export declare function transformMessagesForProvider(messages: Message[], provider: string, context: ProcessingContext): Message[];
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DefaultImageHandler = exports.ProcessingContext = void 0;
4
+ exports.registerImageHandler = registerImageHandler;
5
+ exports.transformMessageForProvider = transformMessageForProvider;
6
+ exports.transformMessagesForProvider = transformMessagesForProvider;
7
+ /**
8
+ * Contexts where message processing may occur
9
+ */
10
+ var ProcessingContext;
11
+ (function (ProcessingContext) {
12
+ ProcessingContext["ModelCall"] = "model-call";
13
+ ProcessingContext["FileCache"] = "file-cache";
14
+ ProcessingContext["WarmCache"] = "warm-cache";
15
+ })(ProcessingContext || (exports.ProcessingContext = ProcessingContext = {}));
16
+ /**
17
+ * Base handler that removes all images unless explicitly allowed
18
+ */
19
+ class DefaultImageHandler {
20
+ supportsImages(context) {
21
+ return context === ProcessingContext.FileCache;
22
+ }
23
+ transformMessage(message, context) {
24
+ if (!this.supportsImages(context)) {
25
+ const transformed = Array.isArray(message.content)
26
+ ? message.content.filter(block => typeof block === 'string' ? true : block.type !== 'image')
27
+ : message.content;
28
+ return { ...message, content: transformed };
29
+ }
30
+ return message;
31
+ }
32
+ }
33
+ exports.DefaultImageHandler = DefaultImageHandler;
34
+ /**
35
+ * Registry mapping provider names to their image handlers
36
+ */
37
+ const imageHandlerRegistry = {};
38
+ /**
39
+ * Register a new image handler for a provider
40
+ */
41
+ function registerImageHandler(provider, handler) {
42
+ imageHandlerRegistry[provider] = handler;
43
+ }
44
+ /**
45
+ * Transform a message for a specific provider and context
46
+ */
47
+ function transformMessageForProvider(message, provider, context) {
48
+ const handler = imageHandlerRegistry[provider] || new DefaultImageHandler();
49
+ return handler.transformMessage(message, context);
50
+ }
51
+ /**
52
+ * Transform an array of messages for a specific provider and context
53
+ */
54
+ function transformMessagesForProvider(messages, provider, context) {
55
+ return messages.map(message => transformMessageForProvider(message, provider, context));
56
+ }
57
+ //# sourceMappingURL=message-image-handling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-image-handling.js","sourceRoot":"","sources":["../src/message-image-handling.ts"],"names":[],"mappings":";;;AAuDA,oDAEC;AAKD,kEAOC;AAKD,oEAMC;AA9ED;;GAEG;AACH,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,6CAAwB,CAAA;IACxB,6CAAwB,CAAA;IACxB,6CAAwB,CAAA;AAC1B,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B;AAiBD;;GAEG;AACH,MAAa,mBAAmB;IAC9B,cAAc,CAAC,OAA0B;QACvC,OAAO,OAAO,KAAK,iBAAiB,CAAC,SAAS,CAA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{
8
8
  overageRate: z.ZodNullable<z.ZodNumber>;
9
9
  }, "strip", z.ZodTypeAny, {
10
10
  creditsUsed: number;
11
+ overageRate: number | null;
11
12
  totalQuota: number;
12
13
  remainingCredits: number;
13
14
  subscriptionActive: boolean;
14
15
  nextQuotaReset: Date;
15
- overageRate: number | null;
16
16
  }, {
17
17
  creditsUsed: number;
18
+ overageRate: number | null;
18
19
  totalQuota: number;
19
20
  remainingCredits: number;
20
21
  subscriptionActive: boolean;
21
22
  nextQuotaReset: Date;
22
- overageRate: number | null;
23
23
  }>;
24
24
  export type UsageData = z.infer<typeof usageDataSchema>;
@@ -7,15 +7,15 @@ export declare const userSchema: z.ZodObject<{
7
7
  fingerprintId: z.ZodString;
8
8
  fingerprintHash: z.ZodString;
9
9
  }, "strip", z.ZodTypeAny, {
10
- email: string;
11
10
  name: string | null;
11
+ email: string;
12
12
  id: string;
13
13
  authToken: string;
14
14
  fingerprintId: string;
15
15
  fingerprintHash: string;
16
16
  }, {
17
- email: string;
18
17
  name: string | null;
18
+ email: string;
19
19
  id: string;
20
20
  authToken: string;
21
21
  fingerprintId: string;
@@ -15,23 +15,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
35
25
  Object.defineProperty(exports, "__esModule", { value: true });
36
26
  exports.createTemplateProject = createTemplateProject;
37
27
  const child_process_1 = require("child_process");
@@ -1 +1 @@
1
- {"version":3,"file":"create-template-project.js","sourceRoot":"","sources":["../src/create-template-project.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,sDAqGC;AA3GD,iDAAwC;AACxC,+BAA2B;AAC3B,uCAAwB;AACxB,uCAAwB;AACxB,2CAAkC;AAE3B,KAAK,UAAU,qBAAqB,CACzC,QAAgB,EAChB,UAAkB,EAClB,cAAsB,QAAQ;IAE9B,OAAO,CAAC,GAAG,CACT,yBAAyB,QAAQ,gBAAgB,UAAU,IAAI,WAAW,EAAE,CAC7E,CAAA;IAED,+EAA+E;IAC/E,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvC,OAAO,CAAC,KAAK,CACX,sEAAsE,CACvE,CAAA;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAED,wBAAwB;IACxB,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QAC1C,OAAO,CAAC,KAAK,CACX,qEAAqE,CACtE,CAAA;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAED,MAAM,WAAW,GAAG,IAAA,WAAI,EAAC,UAAU,EAAE,WAAW,CAAC,CAAA;IAEjD,oCAAoC;IACpC,IAAI,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,OAAO,CAAC,KAAK,CAAC,aAAa,WAAW,iBAAiB,CAAC,CAAA;QACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC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AC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAA;QACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"create-template-project.js","sourceRoot":"","sources":["../src/create-template-project.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,sDAqGC;AA3GD,iDAAwC;AACxC,+BAA2B;AAC3B,uCAAwB;AACxB,uCAAwB;AACxB,2CAAkC;AAE3B,KAAK,UAAU,qBAAqB,CACzC,QAAgB,EAChB,UAAkB,EAClB,cAAsB,QAAQ;IAE9B,OAAO,CAAC,GAAG,CACT,yBAAyB,QAAQ,gBAAgB,UAAU,IAAI,WAAW,EAAE,CAC7E,CAAA;IAED,+EAA+E;IAC/E,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvC,OAAO,CAAC,KAAK,CACX,sEAAsE,CACvE,CAAA;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAED,wBAAwB;IACxB,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QAC1C,OAAO,CAAC,KAAK,CACX,qEAAqE,CACtE,CAAA;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAED,MAAM,WAAW,GAAG,IAAA,WAAI,EAAC,UAAU,EAAE,WAAW,CAAC,CAAA;IAEjD,oCAAoC;IACpC,IAAI,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,OAAO,CAAC,KAAK,CAAC,aAAa,WAAW,iBAAiB,CAAC,CAAA;QACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAED,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,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AC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAA;QACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  process.env.ENVIRONMENT = 'production';
3
3
  process.env.NEXT_PUBLIC_BACKEND_URL = 'manicode-backend.onrender.com';
4
- process.env.NEXT_PUBLIC_APP_URL = 'https://codebuff.com';
4
+ process.env.NEXT_PUBLIC_APP_URL = 'https://www.codebuff.com';
5
5
  process.env.NEXT_PUBLIC_SUPPORT_EMAIL = 'support@codebuff.com';
6
6
  "use strict";
7
7
  var __importDefault = (this && this.__importDefault) || function (mod) {