codebuff 1.0.249 → 1.0.250

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 (82) hide show
  1. package/dist/background-process-manager.js +359 -0
  2. package/dist/background-process-manager.js.map +1 -0
  3. package/dist/browser-runner.js +680 -0
  4. package/dist/browser-runner.js.map +1 -0
  5. package/dist/chat-storage.js +93 -0
  6. package/dist/chat-storage.js.map +1 -0
  7. package/dist/checkpoints/checkpoint-manager.js +280 -0
  8. package/dist/checkpoints/checkpoint-manager.js.map +1 -0
  9. package/dist/cli-handlers/api-key.js +66 -0
  10. package/dist/cli-handlers/api-key.js.map +1 -0
  11. package/dist/cli-handlers/checkpoint.js +195 -0
  12. package/dist/cli-handlers/checkpoint.js.map +1 -0
  13. package/dist/cli-handlers/diff.js +31 -0
  14. package/dist/cli-handlers/diff.js.map +1 -0
  15. package/dist/cli-handlers/inititalization-flow.js +24 -0
  16. package/dist/cli-handlers/inititalization-flow.js.map +1 -0
  17. package/dist/cli.js +478 -0
  18. package/dist/cli.js.map +1 -0
  19. package/dist/client.js +836 -0
  20. package/dist/client.js.map +1 -0
  21. package/dist/common/actions.d.ts +32 -32
  22. package/dist/common/types/usage.d.ts +2 -2
  23. package/dist/common/websockets/websocket-schema.d.ts +68 -68
  24. package/dist/credentials.js +38 -0
  25. package/dist/credentials.js.map +1 -0
  26. package/dist/dev-process-manager.js +54 -0
  27. package/dist/dev-process-manager.js.map +1 -0
  28. package/dist/index.js +117 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/menu.js +126 -0
  31. package/dist/menu.js.map +1 -0
  32. package/dist/project-files.js +513 -0
  33. package/dist/project-files.js.map +1 -0
  34. package/dist/startup-process-handler.js +21 -0
  35. package/dist/startup-process-handler.js.map +1 -0
  36. package/dist/tool-handlers.js +240 -0
  37. package/dist/tool-handlers.js.map +1 -0
  38. package/dist/{common/types/plan.js → types.js} +1 -1
  39. package/dist/types.js.map +1 -0
  40. package/dist/utils/__tests__/tool-renderers.test.js +51 -0
  41. package/dist/utils/__tests__/tool-renderers.test.js.map +1 -0
  42. package/dist/utils/__tests__/xml-stream-parser.test.js +229 -0
  43. package/dist/utils/__tests__/xml-stream-parser.test.js.map +1 -0
  44. package/dist/utils/analytics.js +59 -0
  45. package/dist/utils/analytics.js.map +1 -0
  46. package/dist/utils/logger.js +105 -0
  47. package/dist/utils/logger.js.map +1 -0
  48. package/dist/utils/terminal.js +474 -0
  49. package/dist/utils/terminal.js.map +1 -0
  50. package/dist/utils/tool-renderers.js +145 -0
  51. package/dist/utils/tool-renderers.js.map +1 -0
  52. package/dist/utils/xml-stream-parser.js +128 -0
  53. package/dist/utils/xml-stream-parser.js.map +1 -0
  54. package/dist/web-scraper.js +57 -0
  55. package/dist/web-scraper.js.map +1 -0
  56. package/dist/workers/project-context.js +17 -0
  57. package/dist/workers/project-context.js.map +1 -0
  58. package/package.json +1 -1
  59. package/dist/common/billing/auto-topup.d.ts +0 -8
  60. package/dist/common/billing/auto-topup.js +0 -192
  61. package/dist/common/billing/auto-topup.js.map +0 -1
  62. package/dist/common/billing/balance-calculator.d.ts +0 -57
  63. package/dist/common/billing/balance-calculator.js +0 -218
  64. package/dist/common/billing/balance-calculator.js.map +0 -1
  65. package/dist/common/billing/conversion.d.ts +0 -9
  66. package/dist/common/billing/conversion.js +0 -20
  67. package/dist/common/billing/conversion.js.map +0 -1
  68. package/dist/common/billing/credit-conversion.d.ts +0 -24
  69. package/dist/common/billing/credit-conversion.js +0 -48
  70. package/dist/common/billing/credit-conversion.js.map +0 -1
  71. package/dist/common/billing/grant-credits.d.ts +0 -43
  72. package/dist/common/billing/grant-credits.js +0 -266
  73. package/dist/common/billing/grant-credits.js.map +0 -1
  74. package/dist/common/billing/plans.d.ts +0 -13
  75. package/dist/common/billing/plans.js +0 -44
  76. package/dist/common/billing/plans.js.map +0 -1
  77. package/dist/common/json-config/__tests__/__snapshots__/stringify-schema.test.js.snap +0 -66
  78. package/dist/common/types/plan.d.ts +0 -24
  79. package/dist/common/types/plan.js.map +0 -1
  80. package/dist/common/util/server/referral.d.ts +0 -14
  81. package/dist/common/util/server/referral.js +0 -85
  82. package/dist/common/util/server/referral.js.map +0 -1
@@ -6,12 +6,12 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
6
6
  clientSessionId: z.ZodString;
7
7
  }, "strip", z.ZodTypeAny, {
8
8
  type: "identify";
9
- txid: number;
10
9
  clientSessionId: string;
10
+ txid: number;
11
11
  }, {
12
12
  type: "identify";
13
- txid: number;
14
13
  clientSessionId: string;
14
+ txid: number;
15
15
  }>;
16
16
  readonly subscribe: z.ZodObject<{
17
17
  type: z.ZodLiteral<"subscribe">;
@@ -790,7 +790,6 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
790
790
  }>;
791
791
  }, "strip", z.ZodTypeAny, {
792
792
  type: "init";
793
- fingerprintId: string;
794
793
  fileContext: {
795
794
  currentWorkingDirectory: string;
796
795
  fileTree: import("../util/file").FileTreeNode[];
@@ -818,10 +817,10 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
818
817
  content: string;
819
818
  }[][] | undefined;
820
819
  };
820
+ fingerprintId: string;
821
821
  authToken?: string | undefined;
822
822
  }, {
823
823
  type: "init";
824
- fingerprintId: string;
825
824
  fileContext: {
826
825
  currentWorkingDirectory: string;
827
826
  fileTree: import("../util/file").FileTreeNode[];
@@ -849,6 +848,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
849
848
  content: string;
850
849
  }[][] | undefined;
851
850
  };
851
+ fingerprintId: string;
852
852
  authToken?: string | undefined;
853
853
  }>, z.ZodObject<{
854
854
  type: z.ZodLiteral<"generate-commit-message">;
@@ -953,7 +953,6 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
953
953
  requestId?: string | undefined;
954
954
  } | {
955
955
  type: "init";
956
- fingerprintId: string;
957
956
  fileContext: {
958
957
  currentWorkingDirectory: string;
959
958
  fileTree: import("../util/file").FileTreeNode[];
@@ -981,6 +980,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
981
980
  content: string;
982
981
  }[][] | undefined;
983
982
  };
983
+ fingerprintId: string;
984
984
  authToken?: string | undefined;
985
985
  } | {
986
986
  type: "generate-commit-message";
@@ -1076,7 +1076,6 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1076
1076
  requestId?: string | undefined;
1077
1077
  } | {
1078
1078
  type: "init";
1079
- fingerprintId: string;
1080
1079
  fileContext: {
1081
1080
  currentWorkingDirectory: string;
1082
1081
  fileTree: import("../util/file").FileTreeNode[];
@@ -1104,6 +1103,7 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
1104
1103
  content: string;
1105
1104
  }[][] | undefined;
1106
1105
  };
1106
+ fingerprintId: string;
1107
1107
  authToken?: string | undefined;
1108
1108
  } | {
1109
1109
  type: "generate-commit-message";
@@ -1120,12 +1120,12 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1120
1120
  clientSessionId: z.ZodString;
1121
1121
  }, "strip", z.ZodTypeAny, {
1122
1122
  type: "identify";
1123
- txid: number;
1124
1123
  clientSessionId: string;
1124
+ txid: number;
1125
1125
  }, {
1126
1126
  type: "identify";
1127
- txid: number;
1128
1127
  clientSessionId: string;
1128
+ txid: number;
1129
1129
  }>, z.ZodObject<{
1130
1130
  type: z.ZodLiteral<"subscribe">;
1131
1131
  txid: z.ZodNumber;
@@ -1900,7 +1900,6 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1900
1900
  }>;
1901
1901
  }, "strip", z.ZodTypeAny, {
1902
1902
  type: "init";
1903
- fingerprintId: string;
1904
1903
  fileContext: {
1905
1904
  currentWorkingDirectory: string;
1906
1905
  fileTree: import("../util/file").FileTreeNode[];
@@ -1928,10 +1927,10 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1928
1927
  content: string;
1929
1928
  }[][] | undefined;
1930
1929
  };
1930
+ fingerprintId: string;
1931
1931
  authToken?: string | undefined;
1932
1932
  }, {
1933
1933
  type: "init";
1934
- fingerprintId: string;
1935
1934
  fileContext: {
1936
1935
  currentWorkingDirectory: string;
1937
1936
  fileTree: import("../util/file").FileTreeNode[];
@@ -1959,6 +1958,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
1959
1958
  content: string;
1960
1959
  }[][] | undefined;
1961
1960
  };
1961
+ fingerprintId: string;
1962
1962
  authToken?: string | undefined;
1963
1963
  }>, z.ZodObject<{
1964
1964
  type: z.ZodLiteral<"generate-commit-message">;
@@ -2063,7 +2063,6 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2063
2063
  requestId?: string | undefined;
2064
2064
  } | {
2065
2065
  type: "init";
2066
- fingerprintId: string;
2067
2066
  fileContext: {
2068
2067
  currentWorkingDirectory: string;
2069
2068
  fileTree: import("../util/file").FileTreeNode[];
@@ -2091,6 +2090,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2091
2090
  content: string;
2092
2091
  }[][] | undefined;
2093
2092
  };
2093
+ fingerprintId: string;
2094
2094
  authToken?: string | undefined;
2095
2095
  } | {
2096
2096
  type: "generate-commit-message";
@@ -2186,7 +2186,6 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2186
2186
  requestId?: string | undefined;
2187
2187
  } | {
2188
2188
  type: "init";
2189
- fingerprintId: string;
2190
2189
  fileContext: {
2191
2190
  currentWorkingDirectory: string;
2192
2191
  fileTree: import("../util/file").FileTreeNode[];
@@ -2214,6 +2213,7 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
2214
2213
  content: string;
2215
2214
  }[][] | undefined;
2216
2215
  };
2216
+ fingerprintId: string;
2217
2217
  authToken?: string | undefined;
2218
2218
  } | {
2219
2219
  type: "generate-commit-message";
@@ -2265,12 +2265,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2265
2265
  path: z.ZodString;
2266
2266
  content: z.ZodString;
2267
2267
  }, "strip", z.ZodTypeAny, {
2268
- type: "patch" | "file";
2269
2268
  path: string;
2269
+ type: "file" | "patch";
2270
2270
  content: string;
2271
2271
  }, {
2272
- type: "patch" | "file";
2273
2272
  path: string;
2273
+ type: "file" | "patch";
2274
2274
  content: string;
2275
2275
  }>, "many">;
2276
2276
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
@@ -2278,12 +2278,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2278
2278
  path: z.ZodString;
2279
2279
  content: z.ZodString;
2280
2280
  }, "strip", z.ZodTypeAny, {
2281
- type: "patch" | "file";
2282
2281
  path: string;
2282
+ type: "file" | "patch";
2283
2283
  content: string;
2284
2284
  }, {
2285
- type: "patch" | "file";
2286
2285
  path: string;
2286
+ type: "file" | "patch";
2287
2287
  content: string;
2288
2288
  }>, "many">;
2289
2289
  addedFileVersions: z.ZodArray<z.ZodObject<{
@@ -2308,13 +2308,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2308
2308
  userInputId: string;
2309
2309
  response: string;
2310
2310
  changes: {
2311
- type: "patch" | "file";
2312
2311
  path: string;
2312
+ type: "file" | "patch";
2313
2313
  content: string;
2314
2314
  }[];
2315
2315
  changesAlreadyApplied: {
2316
- type: "patch" | "file";
2317
2316
  path: string;
2317
+ type: "file" | "patch";
2318
2318
  content: string;
2319
2319
  }[];
2320
2320
  addedFileVersions: {
@@ -2332,13 +2332,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
2332
2332
  userInputId: string;
2333
2333
  response: string;
2334
2334
  changes: {
2335
- type: "patch" | "file";
2336
2335
  path: string;
2336
+ type: "file" | "patch";
2337
2337
  content: string;
2338
2338
  }[];
2339
2339
  changesAlreadyApplied: {
2340
- type: "patch" | "file";
2341
2340
  path: string;
2341
+ type: "file" | "patch";
2342
2342
  content: string;
2343
2343
  }[];
2344
2344
  addedFileVersions: {
@@ -3004,12 +3004,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3004
3004
  path: z.ZodString;
3005
3005
  content: z.ZodString;
3006
3006
  }, "strip", z.ZodTypeAny, {
3007
- type: "patch" | "file";
3008
3007
  path: string;
3008
+ type: "file" | "patch";
3009
3009
  content: string;
3010
3010
  }, {
3011
- type: "patch" | "file";
3012
3011
  path: string;
3012
+ type: "file" | "patch";
3013
3013
  content: string;
3014
3014
  }>, "many">;
3015
3015
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
@@ -3017,12 +3017,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3017
3017
  path: z.ZodString;
3018
3018
  content: z.ZodString;
3019
3019
  }, "strip", z.ZodTypeAny, {
3020
- type: "patch" | "file";
3021
3020
  path: string;
3021
+ type: "file" | "patch";
3022
3022
  content: string;
3023
3023
  }, {
3024
- type: "patch" | "file";
3025
3024
  path: string;
3025
+ type: "file" | "patch";
3026
3026
  content: string;
3027
3027
  }>, "many">;
3028
3028
  addedFileVersions: z.ZodArray<z.ZodObject<{
@@ -3046,13 +3046,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3046
3046
  userInputId: string;
3047
3047
  response: string;
3048
3048
  changes: {
3049
- type: "patch" | "file";
3050
3049
  path: string;
3050
+ type: "file" | "patch";
3051
3051
  content: string;
3052
3052
  }[];
3053
3053
  changesAlreadyApplied: {
3054
- type: "patch" | "file";
3055
3054
  path: string;
3055
+ type: "file" | "patch";
3056
3056
  content: string;
3057
3057
  }[];
3058
3058
  addedFileVersions: {
@@ -3070,13 +3070,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3070
3070
  userInputId: string;
3071
3071
  response: string;
3072
3072
  changes: {
3073
- type: "patch" | "file";
3074
3073
  path: string;
3074
+ type: "file" | "patch";
3075
3075
  content: string;
3076
3076
  }[];
3077
3077
  changesAlreadyApplied: {
3078
- type: "patch" | "file";
3079
3078
  path: string;
3079
+ type: "file" | "patch";
3080
3080
  content: string;
3081
3081
  }[];
3082
3082
  addedFileVersions: {
@@ -3170,13 +3170,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3170
3170
  error: z.ZodOptional<z.ZodString>;
3171
3171
  remainingBalance: z.ZodOptional<z.ZodNumber>;
3172
3172
  }, "strip", z.ZodTypeAny, {
3173
- type: "action-error";
3174
3173
  message: string;
3174
+ type: "action-error";
3175
3175
  remainingBalance?: number | undefined;
3176
3176
  error?: string | undefined;
3177
3177
  }, {
3178
- type: "action-error";
3179
3178
  message: string;
3179
+ type: "action-error";
3180
3180
  remainingBalance?: number | undefined;
3181
3181
  error?: string | undefined;
3182
3182
  }>, z.ZodObject<{
@@ -3216,13 +3216,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3216
3216
  userInputId: string;
3217
3217
  response: string;
3218
3218
  changes: {
3219
- type: "patch" | "file";
3220
3219
  path: string;
3220
+ type: "file" | "patch";
3221
3221
  content: string;
3222
3222
  }[];
3223
3223
  changesAlreadyApplied: {
3224
- type: "patch" | "file";
3225
3224
  path: string;
3225
+ type: "file" | "patch";
3226
3226
  content: string;
3227
3227
  }[];
3228
3228
  addedFileVersions: {
@@ -3336,13 +3336,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3336
3336
  userInputId: string;
3337
3337
  response: string;
3338
3338
  changes: {
3339
- type: "patch" | "file";
3340
3339
  path: string;
3340
+ type: "file" | "patch";
3341
3341
  content: string;
3342
3342
  }[];
3343
3343
  changesAlreadyApplied: {
3344
- type: "patch" | "file";
3345
3344
  path: string;
3345
+ type: "file" | "patch";
3346
3346
  content: string;
3347
3347
  }[];
3348
3348
  addedFileVersions: {
@@ -3359,8 +3359,8 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3359
3359
  isUpToDate: boolean;
3360
3360
  latestVersion: string;
3361
3361
  } | {
3362
- type: "action-error";
3363
3362
  message: string;
3363
+ type: "action-error";
3364
3364
  remainingBalance?: number | undefined;
3365
3365
  error?: string | undefined;
3366
3366
  } | {
@@ -3390,13 +3390,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3390
3390
  userInputId: string;
3391
3391
  response: string;
3392
3392
  changes: {
3393
- type: "patch" | "file";
3394
3393
  path: string;
3394
+ type: "file" | "patch";
3395
3395
  content: string;
3396
3396
  }[];
3397
3397
  changesAlreadyApplied: {
3398
- type: "patch" | "file";
3399
3398
  path: string;
3399
+ type: "file" | "patch";
3400
3400
  content: string;
3401
3401
  }[];
3402
3402
  addedFileVersions: {
@@ -3510,13 +3510,13 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3510
3510
  userInputId: string;
3511
3511
  response: string;
3512
3512
  changes: {
3513
- type: "patch" | "file";
3514
3513
  path: string;
3514
+ type: "file" | "patch";
3515
3515
  content: string;
3516
3516
  }[];
3517
3517
  changesAlreadyApplied: {
3518
- type: "patch" | "file";
3519
3518
  path: string;
3519
+ type: "file" | "patch";
3520
3520
  content: string;
3521
3521
  }[];
3522
3522
  addedFileVersions: {
@@ -3533,8 +3533,8 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
3533
3533
  isUpToDate: boolean;
3534
3534
  latestVersion: string;
3535
3535
  } | {
3536
- type: "action-error";
3537
3536
  message: string;
3537
+ type: "action-error";
3538
3538
  remainingBalance?: number | undefined;
3539
3539
  error?: string | undefined;
3540
3540
  } | {
@@ -3583,12 +3583,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3583
3583
  path: z.ZodString;
3584
3584
  content: z.ZodString;
3585
3585
  }, "strip", z.ZodTypeAny, {
3586
- type: "patch" | "file";
3587
3586
  path: string;
3587
+ type: "file" | "patch";
3588
3588
  content: string;
3589
3589
  }, {
3590
- type: "patch" | "file";
3591
3590
  path: string;
3591
+ type: "file" | "patch";
3592
3592
  content: string;
3593
3593
  }>, "many">;
3594
3594
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
@@ -3596,12 +3596,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3596
3596
  path: z.ZodString;
3597
3597
  content: z.ZodString;
3598
3598
  }, "strip", z.ZodTypeAny, {
3599
- type: "patch" | "file";
3600
3599
  path: string;
3600
+ type: "file" | "patch";
3601
3601
  content: string;
3602
3602
  }, {
3603
- type: "patch" | "file";
3604
3603
  path: string;
3604
+ type: "file" | "patch";
3605
3605
  content: string;
3606
3606
  }>, "many">;
3607
3607
  addedFileVersions: z.ZodArray<z.ZodObject<{
@@ -3626,13 +3626,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3626
3626
  userInputId: string;
3627
3627
  response: string;
3628
3628
  changes: {
3629
- type: "patch" | "file";
3630
3629
  path: string;
3630
+ type: "file" | "patch";
3631
3631
  content: string;
3632
3632
  }[];
3633
3633
  changesAlreadyApplied: {
3634
- type: "patch" | "file";
3635
3634
  path: string;
3635
+ type: "file" | "patch";
3636
3636
  content: string;
3637
3637
  }[];
3638
3638
  addedFileVersions: {
@@ -3650,13 +3650,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
3650
3650
  userInputId: string;
3651
3651
  response: string;
3652
3652
  changes: {
3653
- type: "patch" | "file";
3654
3653
  path: string;
3654
+ type: "file" | "patch";
3655
3655
  content: string;
3656
3656
  }[];
3657
3657
  changesAlreadyApplied: {
3658
- type: "patch" | "file";
3659
3658
  path: string;
3659
+ type: "file" | "patch";
3660
3660
  content: string;
3661
3661
  }[];
3662
3662
  addedFileVersions: {
@@ -4322,12 +4322,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4322
4322
  path: z.ZodString;
4323
4323
  content: z.ZodString;
4324
4324
  }, "strip", z.ZodTypeAny, {
4325
- type: "patch" | "file";
4326
4325
  path: string;
4326
+ type: "file" | "patch";
4327
4327
  content: string;
4328
4328
  }, {
4329
- type: "patch" | "file";
4330
4329
  path: string;
4330
+ type: "file" | "patch";
4331
4331
  content: string;
4332
4332
  }>, "many">;
4333
4333
  changesAlreadyApplied: z.ZodArray<z.ZodObject<{
@@ -4335,12 +4335,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4335
4335
  path: z.ZodString;
4336
4336
  content: z.ZodString;
4337
4337
  }, "strip", z.ZodTypeAny, {
4338
- type: "patch" | "file";
4339
4338
  path: string;
4339
+ type: "file" | "patch";
4340
4340
  content: string;
4341
4341
  }, {
4342
- type: "patch" | "file";
4343
4342
  path: string;
4343
+ type: "file" | "patch";
4344
4344
  content: string;
4345
4345
  }>, "many">;
4346
4346
  addedFileVersions: z.ZodArray<z.ZodObject<{
@@ -4364,13 +4364,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4364
4364
  userInputId: string;
4365
4365
  response: string;
4366
4366
  changes: {
4367
- type: "patch" | "file";
4368
4367
  path: string;
4368
+ type: "file" | "patch";
4369
4369
  content: string;
4370
4370
  }[];
4371
4371
  changesAlreadyApplied: {
4372
- type: "patch" | "file";
4373
4372
  path: string;
4373
+ type: "file" | "patch";
4374
4374
  content: string;
4375
4375
  }[];
4376
4376
  addedFileVersions: {
@@ -4388,13 +4388,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4388
4388
  userInputId: string;
4389
4389
  response: string;
4390
4390
  changes: {
4391
- type: "patch" | "file";
4392
4391
  path: string;
4392
+ type: "file" | "patch";
4393
4393
  content: string;
4394
4394
  }[];
4395
4395
  changesAlreadyApplied: {
4396
- type: "patch" | "file";
4397
4396
  path: string;
4397
+ type: "file" | "patch";
4398
4398
  content: string;
4399
4399
  }[];
4400
4400
  addedFileVersions: {
@@ -4488,13 +4488,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4488
4488
  error: z.ZodOptional<z.ZodString>;
4489
4489
  remainingBalance: z.ZodOptional<z.ZodNumber>;
4490
4490
  }, "strip", z.ZodTypeAny, {
4491
- type: "action-error";
4492
4491
  message: string;
4492
+ type: "action-error";
4493
4493
  remainingBalance?: number | undefined;
4494
4494
  error?: string | undefined;
4495
4495
  }, {
4496
- type: "action-error";
4497
4496
  message: string;
4497
+ type: "action-error";
4498
4498
  remainingBalance?: number | undefined;
4499
4499
  error?: string | undefined;
4500
4500
  }>, z.ZodObject<{
@@ -4534,13 +4534,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4534
4534
  userInputId: string;
4535
4535
  response: string;
4536
4536
  changes: {
4537
- type: "patch" | "file";
4538
4537
  path: string;
4538
+ type: "file" | "patch";
4539
4539
  content: string;
4540
4540
  }[];
4541
4541
  changesAlreadyApplied: {
4542
- type: "patch" | "file";
4543
4542
  path: string;
4543
+ type: "file" | "patch";
4544
4544
  content: string;
4545
4545
  }[];
4546
4546
  addedFileVersions: {
@@ -4654,13 +4654,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4654
4654
  userInputId: string;
4655
4655
  response: string;
4656
4656
  changes: {
4657
- type: "patch" | "file";
4658
4657
  path: string;
4658
+ type: "file" | "patch";
4659
4659
  content: string;
4660
4660
  }[];
4661
4661
  changesAlreadyApplied: {
4662
- type: "patch" | "file";
4663
4662
  path: string;
4663
+ type: "file" | "patch";
4664
4664
  content: string;
4665
4665
  }[];
4666
4666
  addedFileVersions: {
@@ -4677,8 +4677,8 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4677
4677
  isUpToDate: boolean;
4678
4678
  latestVersion: string;
4679
4679
  } | {
4680
- type: "action-error";
4681
4680
  message: string;
4681
+ type: "action-error";
4682
4682
  remainingBalance?: number | undefined;
4683
4683
  error?: string | undefined;
4684
4684
  } | {
@@ -4708,13 +4708,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4708
4708
  userInputId: string;
4709
4709
  response: string;
4710
4710
  changes: {
4711
- type: "patch" | "file";
4712
4711
  path: string;
4712
+ type: "file" | "patch";
4713
4713
  content: string;
4714
4714
  }[];
4715
4715
  changesAlreadyApplied: {
4716
- type: "patch" | "file";
4717
4716
  path: string;
4717
+ type: "file" | "patch";
4718
4718
  content: string;
4719
4719
  }[];
4720
4720
  addedFileVersions: {
@@ -4828,13 +4828,13 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4828
4828
  userInputId: string;
4829
4829
  response: string;
4830
4830
  changes: {
4831
- type: "patch" | "file";
4832
4831
  path: string;
4832
+ type: "file" | "patch";
4833
4833
  content: string;
4834
4834
  }[];
4835
4835
  changesAlreadyApplied: {
4836
- type: "patch" | "file";
4837
4836
  path: string;
4837
+ type: "file" | "patch";
4838
4838
  content: string;
4839
4839
  }[];
4840
4840
  addedFileVersions: {
@@ -4851,8 +4851,8 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
4851
4851
  isUpToDate: boolean;
4852
4852
  latestVersion: string;
4853
4853
  } | {
4854
- type: "action-error";
4855
4854
  message: string;
4855
+ type: "action-error";
4856
4856
  remainingBalance?: number | undefined;
4857
4857
  error?: string | undefined;
4858
4858
  } | {
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CREDENTIALS_PATH = exports.CONFIG_DIR = exports.userFromJson = void 0;
7
+ const credentials_1 = require("./common/util/credentials");
8
+ const zod_1 = require("zod");
9
+ const os_1 = __importDefault(require("os"));
10
+ const node_path_1 = __importDefault(require("node:path"));
11
+ const credentialsSchema = zod_1.z
12
+ .object({
13
+ default: credentials_1.userSchema,
14
+ })
15
+ .catchall(credentials_1.userSchema);
16
+ const userFromJson = (json, profileName = 'default') => {
17
+ try {
18
+ const allCredentials = credentialsSchema.parse(JSON.parse(json));
19
+ const profile = allCredentials[profileName];
20
+ return profile;
21
+ }
22
+ catch (error) {
23
+ console.error('Error parsing user JSON:', error);
24
+ return;
25
+ }
26
+ };
27
+ exports.userFromJson = userFromJson;
28
+ const file_1 = require("./common/util/file");
29
+ exports.CONFIG_DIR = node_path_1.default.join(os_1.default.homedir(), '.config', 'manicode' +
30
+ // on a development stack?
31
+ (process.env.NEXT_PUBLIC_CB_ENVIRONMENT &&
32
+ process.env.NEXT_PUBLIC_CB_ENVIRONMENT !== 'production'
33
+ ? `-${process.env.NEXT_PUBLIC_CB_ENVIRONMENT}`
34
+ : ''));
35
+ // Ensure config directory exists
36
+ (0, file_1.ensureDirectoryExists)(exports.CONFIG_DIR);
37
+ exports.CREDENTIALS_PATH = node_path_1.default.join(exports.CONFIG_DIR, 'credentials.json');
38
+ //# sourceMappingURL=credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":";;;;;;AAAA,yDAA0D;AAC1D,6BAAuB;AACvB,4CAAmB;AACnB,0DAA4B;AAE5B,MAAM,iBAAiB,GAAG,OAAC;KACxB,MAAM,CAAC;IACN,OAAO,EAAE,wBAAU;CACpB,CAAC;KACD,QAAQ,CAAC,wBAAU,CAAC,CAAA;AAEhB,MAAM,YAAY,GAAG,CAC1B,IAAY,EACZ,cAAsB,SAAS,EACb,EAAE;IACpB,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;QAChE,MAAM,OAAO,GAAG,cAAc,CAAC,WAAW,CAAC,CAAA;QAC3C,OAAO,OAAO,CAAA;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAA;QAChD,OAAM;IACR,CAAC;AACH,CAAC,CAAA;AAZY,QAAA,YAAY,gBAYxB;AAED,2CAAwD;AAE3C,QAAA,UAAU,GAAG,mBAAI,CAAC,IAAI,CACjC,YAAE,CAAC,OAAO,EAAE,EACZ,SAAS,EACT,UAAU;IACR,0BAA0B;IAC1B,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B;QACvC,OAAO,CAAC,GAAG,CAAC,0BAA0B,KAAK,YAAY;QACrD,CAAC,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE;QAC9C,CAAC,CAAC,EAAE,CAAC,CACV,CAAA;AAED,iCAAiC;AACjC,IAAA,4BAAqB,EAAC,kBAAU,CAAC,CAAA;AACpB,QAAA,gBAAgB,GAAG,mBAAI,CAAC,IAAI,CAAC,kBAAU,EAAE,kBAAkB,CAAC,CAAA"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.startDevProcesses = startDevProcesses;
7
+ const path_1 = __importDefault(require("path"));
8
+ const string_1 = require("./common/util/string");
9
+ const picocolors_1 = require("picocolors");
10
+ const terminal_1 = require("./utils/terminal");
11
+ /**
12
+ * Starts background development processes defined in the config file.
13
+ * Processes are started asynchronously and their output is tracked.
14
+ * Only enabled processes are started.
15
+ *
16
+ * @param processes - Array of startup process configurations
17
+ * @param projectPath - Base path of the project
18
+ */
19
+ function startDevProcesses(processes, projectPath) {
20
+ const toStart = processes.filter((process) => process.enabled);
21
+ if (!toStart.length) {
22
+ return;
23
+ }
24
+ console.log((0, picocolors_1.yellow)('Starting codebuff.json processes:'));
25
+ for (const { name, command, cwd, enabled, stderrFile, stdoutFile, } of processes) {
26
+ if (!enabled) {
27
+ continue;
28
+ }
29
+ // Resolve working directory
30
+ const workingDir = cwd
31
+ ? path_1.default.isAbsolute(cwd)
32
+ ? cwd
33
+ : path_1.default.resolve(projectPath, cwd)
34
+ : projectPath;
35
+ // Start the process
36
+ (0, terminal_1.runBackgroundCommand)({
37
+ toolCallId: (0, string_1.generateCompactId)(),
38
+ command,
39
+ mode: 'user',
40
+ projectPath: workingDir,
41
+ stdoutFile,
42
+ stderrFile,
43
+ }, ({ result }) => {
44
+ const m = result.match(/<process_id>(\d+)<\/process_id>/);
45
+ if (m) {
46
+ console.log((0, picocolors_1.yellow)(`- ${name}: ${command}`));
47
+ }
48
+ else {
49
+ console.log((0, picocolors_1.yellow)(`- ${name}: ${command} — failed to start`));
50
+ }
51
+ });
52
+ }
53
+ }
54
+ //# sourceMappingURL=dev-process-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-process-manager.js","sourceRoot":"","sources":["../src/dev-process-manager.ts"],"names":[],"mappings":";;;;;AAgBA,8CAmDC;AAnED,gDAAuB;AAGvB,+CAAsD;AACtD,2CAAmC;AAEnC,+CAAuD;AAEvD;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAC/B,SAA2B,EAC3B,WAAmB;IAEnB,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAE9D,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,OAAM;IACR,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,IAAA,mBAAM,EAAC,mCAAmC,CAAC,CAAC,CAAA;IAExD,KAAK,MAAM,EACT,IAAI,EACJ,OAAO,EACP,GAAG,EACH,OAAO,EACP,UAAU,EACV,UAAU,GACX,IAAI,SAAS,EAAE,CAAC;QACf,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,SAAQ;QACV,CAAC;QAED,4BAA4B;QAC5B,MAAM,UAAU,GAAG,GAAG;YACpB,CAAC,CAAC,cAAI,CAAC,UAAU,CAAC,GAAG,CAAC;gBACpB,CAAC,CAAC,GAAG;gBACL,CAAC,CAAC,cAAI,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC;YAClC,CAAC,CAAC,WAAW,CAAA;QAEf,oBAAoB;QACpB,IAAA,+BAAoB,EAClB;YACE,UAAU,EAAE,IAAA,0BAAiB,GAAE;YAC/B,OAAO;YACP,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,UAAU;YACvB,UAAU;YACV,UAAU;SACX,EACD,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;YACb,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAA;YACzD,IAAI,CAAC,EAAE,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,IAAA,mBAAM,EAAC,KAAK,IAAI,KAAK,OAAO,EAAE,CAAC,CAAC,CAAA;YAC9C,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,IAAA,mBAAM,EAAC,KAAK,IAAI,KAAK,OAAO,oBAAoB,CAAC,CAAC,CAAA;YAChE,CAAC;QACH,CAAC,CACF,CAAA;IACH,CAAC;AACH,CAAC"}