codebuff 1.0.120 → 1.0.122
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.
- package/README.md +7 -0
- package/dist/cli.d.ts +3 -6
- package/dist/cli.js +14 -18
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +2 -2
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/common/actions.d.ts +44 -44
- package/dist/common/constants.d.ts +2 -0
- package/dist/common/constants.js +3 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/types/usage.d.ts +3 -0
- package/dist/common/types/usage.js +1 -0
- package/dist/common/types/usage.js.map +1 -1
- package/dist/common/util/git.d.ts +2 -0
- package/dist/common/util/git.js +12 -0
- package/dist/common/util/git.js.map +1 -1
- package/dist/common/websockets/websocket-schema.d.ts +76 -76
- package/dist/index.js +12 -9
- package/dist/index.js.map +1 -1
- package/dist/menu.js +1 -0
- package/dist/menu.js.map +1 -1
- package/dist/tool-handlers.d.ts +1 -0
- package/dist/tool-handlers.js +32 -1
- package/dist/tool-handlers.js.map +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +10 -3
|
@@ -122,15 +122,15 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
122
122
|
}>>;
|
|
123
123
|
}, "strip", z.ZodTypeAny, {
|
|
124
124
|
type: "tool_result";
|
|
125
|
-
tool_use_id: string;
|
|
126
125
|
content: string;
|
|
126
|
+
tool_use_id: string;
|
|
127
127
|
cache_control?: {
|
|
128
128
|
type: "ephemeral";
|
|
129
129
|
} | undefined;
|
|
130
130
|
}, {
|
|
131
131
|
type: "tool_result";
|
|
132
|
-
tool_use_id: string;
|
|
133
132
|
content: string;
|
|
133
|
+
tool_use_id: string;
|
|
134
134
|
cache_control?: {
|
|
135
135
|
type: "ephemeral";
|
|
136
136
|
} | undefined;
|
|
@@ -152,8 +152,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
152
152
|
} | undefined;
|
|
153
153
|
} | {
|
|
154
154
|
type: "tool_result";
|
|
155
|
-
tool_use_id: string;
|
|
156
155
|
content: string;
|
|
156
|
+
tool_use_id: string;
|
|
157
157
|
cache_control?: {
|
|
158
158
|
type: "ephemeral";
|
|
159
159
|
} | undefined;
|
|
@@ -176,8 +176,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
176
176
|
} | undefined;
|
|
177
177
|
} | {
|
|
178
178
|
type: "tool_result";
|
|
179
|
-
tool_use_id: string;
|
|
180
179
|
content: string;
|
|
180
|
+
tool_use_id: string;
|
|
181
181
|
cache_control?: {
|
|
182
182
|
type: "ephemeral";
|
|
183
183
|
} | undefined;
|
|
@@ -296,12 +296,12 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
296
296
|
content: z.ZodString;
|
|
297
297
|
}, "strip", z.ZodTypeAny, {
|
|
298
298
|
type: "patch" | "file";
|
|
299
|
-
content: string;
|
|
300
299
|
filePath: string;
|
|
300
|
+
content: string;
|
|
301
301
|
}, {
|
|
302
302
|
type: "patch" | "file";
|
|
303
|
-
content: string;
|
|
304
303
|
filePath: string;
|
|
304
|
+
content: string;
|
|
305
305
|
}>, "many">;
|
|
306
306
|
costMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["lite", "normal", "pro"]>>>;
|
|
307
307
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -325,8 +325,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
325
325
|
} | undefined;
|
|
326
326
|
} | {
|
|
327
327
|
type: "tool_result";
|
|
328
|
-
tool_use_id: string;
|
|
329
328
|
content: string;
|
|
329
|
+
tool_use_id: string;
|
|
330
330
|
cache_control?: {
|
|
331
331
|
type: "ephemeral";
|
|
332
332
|
} | undefined;
|
|
@@ -361,8 +361,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
361
361
|
};
|
|
362
362
|
changesAlreadyApplied: {
|
|
363
363
|
type: "patch" | "file";
|
|
364
|
-
content: string;
|
|
365
364
|
filePath: string;
|
|
365
|
+
content: string;
|
|
366
366
|
}[];
|
|
367
367
|
costMode: "lite" | "normal" | "pro";
|
|
368
368
|
authToken?: string | undefined;
|
|
@@ -387,8 +387,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
387
387
|
} | undefined;
|
|
388
388
|
} | {
|
|
389
389
|
type: "tool_result";
|
|
390
|
-
tool_use_id: string;
|
|
391
390
|
content: string;
|
|
391
|
+
tool_use_id: string;
|
|
392
392
|
cache_control?: {
|
|
393
393
|
type: "ephemeral";
|
|
394
394
|
} | undefined;
|
|
@@ -423,8 +423,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
423
423
|
};
|
|
424
424
|
changesAlreadyApplied: {
|
|
425
425
|
type: "patch" | "file";
|
|
426
|
-
content: string;
|
|
427
426
|
filePath: string;
|
|
427
|
+
content: string;
|
|
428
428
|
}[];
|
|
429
429
|
authToken?: string | undefined;
|
|
430
430
|
costMode?: "lite" | "normal" | "pro" | undefined;
|
|
@@ -700,8 +700,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
700
700
|
} | undefined;
|
|
701
701
|
} | {
|
|
702
702
|
type: "tool_result";
|
|
703
|
-
tool_use_id: string;
|
|
704
703
|
content: string;
|
|
704
|
+
tool_use_id: string;
|
|
705
705
|
cache_control?: {
|
|
706
706
|
type: "ephemeral";
|
|
707
707
|
} | undefined;
|
|
@@ -736,8 +736,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
736
736
|
};
|
|
737
737
|
changesAlreadyApplied: {
|
|
738
738
|
type: "patch" | "file";
|
|
739
|
-
content: string;
|
|
740
739
|
filePath: string;
|
|
740
|
+
content: string;
|
|
741
741
|
}[];
|
|
742
742
|
costMode: "lite" | "normal" | "pro";
|
|
743
743
|
authToken?: string | undefined;
|
|
@@ -822,8 +822,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
822
822
|
} | undefined;
|
|
823
823
|
} | {
|
|
824
824
|
type: "tool_result";
|
|
825
|
-
tool_use_id: string;
|
|
826
825
|
content: string;
|
|
826
|
+
tool_use_id: string;
|
|
827
827
|
cache_control?: {
|
|
828
828
|
type: "ephemeral";
|
|
829
829
|
} | undefined;
|
|
@@ -858,8 +858,8 @@ export declare const CLIENT_MESSAGE_SCHEMAS: {
|
|
|
858
858
|
};
|
|
859
859
|
changesAlreadyApplied: {
|
|
860
860
|
type: "patch" | "file";
|
|
861
|
-
content: string;
|
|
862
861
|
filePath: string;
|
|
862
|
+
content: string;
|
|
863
863
|
}[];
|
|
864
864
|
authToken?: string | undefined;
|
|
865
865
|
costMode?: "lite" | "normal" | "pro" | undefined;
|
|
@@ -1041,15 +1041,15 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
1041
1041
|
}>>;
|
|
1042
1042
|
}, "strip", z.ZodTypeAny, {
|
|
1043
1043
|
type: "tool_result";
|
|
1044
|
-
tool_use_id: string;
|
|
1045
1044
|
content: string;
|
|
1045
|
+
tool_use_id: string;
|
|
1046
1046
|
cache_control?: {
|
|
1047
1047
|
type: "ephemeral";
|
|
1048
1048
|
} | undefined;
|
|
1049
1049
|
}, {
|
|
1050
1050
|
type: "tool_result";
|
|
1051
|
-
tool_use_id: string;
|
|
1052
1051
|
content: string;
|
|
1052
|
+
tool_use_id: string;
|
|
1053
1053
|
cache_control?: {
|
|
1054
1054
|
type: "ephemeral";
|
|
1055
1055
|
} | undefined;
|
|
@@ -1071,8 +1071,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
1071
1071
|
} | undefined;
|
|
1072
1072
|
} | {
|
|
1073
1073
|
type: "tool_result";
|
|
1074
|
-
tool_use_id: string;
|
|
1075
1074
|
content: string;
|
|
1075
|
+
tool_use_id: string;
|
|
1076
1076
|
cache_control?: {
|
|
1077
1077
|
type: "ephemeral";
|
|
1078
1078
|
} | undefined;
|
|
@@ -1095,8 +1095,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
1095
1095
|
} | undefined;
|
|
1096
1096
|
} | {
|
|
1097
1097
|
type: "tool_result";
|
|
1098
|
-
tool_use_id: string;
|
|
1099
1098
|
content: string;
|
|
1099
|
+
tool_use_id: string;
|
|
1100
1100
|
cache_control?: {
|
|
1101
1101
|
type: "ephemeral";
|
|
1102
1102
|
} | undefined;
|
|
@@ -1215,12 +1215,12 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
1215
1215
|
content: z.ZodString;
|
|
1216
1216
|
}, "strip", z.ZodTypeAny, {
|
|
1217
1217
|
type: "patch" | "file";
|
|
1218
|
-
content: string;
|
|
1219
1218
|
filePath: string;
|
|
1219
|
+
content: string;
|
|
1220
1220
|
}, {
|
|
1221
1221
|
type: "patch" | "file";
|
|
1222
|
-
content: string;
|
|
1223
1222
|
filePath: string;
|
|
1223
|
+
content: string;
|
|
1224
1224
|
}>, "many">;
|
|
1225
1225
|
costMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<["lite", "normal", "pro"]>>>;
|
|
1226
1226
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1244,8 +1244,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
1244
1244
|
} | undefined;
|
|
1245
1245
|
} | {
|
|
1246
1246
|
type: "tool_result";
|
|
1247
|
-
tool_use_id: string;
|
|
1248
1247
|
content: string;
|
|
1248
|
+
tool_use_id: string;
|
|
1249
1249
|
cache_control?: {
|
|
1250
1250
|
type: "ephemeral";
|
|
1251
1251
|
} | undefined;
|
|
@@ -1280,8 +1280,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
1280
1280
|
};
|
|
1281
1281
|
changesAlreadyApplied: {
|
|
1282
1282
|
type: "patch" | "file";
|
|
1283
|
-
content: string;
|
|
1284
1283
|
filePath: string;
|
|
1284
|
+
content: string;
|
|
1285
1285
|
}[];
|
|
1286
1286
|
costMode: "lite" | "normal" | "pro";
|
|
1287
1287
|
authToken?: string | undefined;
|
|
@@ -1306,8 +1306,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
1306
1306
|
} | undefined;
|
|
1307
1307
|
} | {
|
|
1308
1308
|
type: "tool_result";
|
|
1309
|
-
tool_use_id: string;
|
|
1310
1309
|
content: string;
|
|
1310
|
+
tool_use_id: string;
|
|
1311
1311
|
cache_control?: {
|
|
1312
1312
|
type: "ephemeral";
|
|
1313
1313
|
} | undefined;
|
|
@@ -1342,8 +1342,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
1342
1342
|
};
|
|
1343
1343
|
changesAlreadyApplied: {
|
|
1344
1344
|
type: "patch" | "file";
|
|
1345
|
-
content: string;
|
|
1346
1345
|
filePath: string;
|
|
1346
|
+
content: string;
|
|
1347
1347
|
}[];
|
|
1348
1348
|
authToken?: string | undefined;
|
|
1349
1349
|
costMode?: "lite" | "normal" | "pro" | undefined;
|
|
@@ -1619,8 +1619,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
1619
1619
|
} | undefined;
|
|
1620
1620
|
} | {
|
|
1621
1621
|
type: "tool_result";
|
|
1622
|
-
tool_use_id: string;
|
|
1623
1622
|
content: string;
|
|
1623
|
+
tool_use_id: string;
|
|
1624
1624
|
cache_control?: {
|
|
1625
1625
|
type: "ephemeral";
|
|
1626
1626
|
} | undefined;
|
|
@@ -1655,8 +1655,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
1655
1655
|
};
|
|
1656
1656
|
changesAlreadyApplied: {
|
|
1657
1657
|
type: "patch" | "file";
|
|
1658
|
-
content: string;
|
|
1659
1658
|
filePath: string;
|
|
1659
|
+
content: string;
|
|
1660
1660
|
}[];
|
|
1661
1661
|
costMode: "lite" | "normal" | "pro";
|
|
1662
1662
|
authToken?: string | undefined;
|
|
@@ -1741,8 +1741,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
1741
1741
|
} | undefined;
|
|
1742
1742
|
} | {
|
|
1743
1743
|
type: "tool_result";
|
|
1744
|
-
tool_use_id: string;
|
|
1745
1744
|
content: string;
|
|
1745
|
+
tool_use_id: string;
|
|
1746
1746
|
cache_control?: {
|
|
1747
1747
|
type: "ephemeral";
|
|
1748
1748
|
} | undefined;
|
|
@@ -1777,8 +1777,8 @@ export declare const CLIENT_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
1777
1777
|
};
|
|
1778
1778
|
changesAlreadyApplied: {
|
|
1779
1779
|
type: "patch" | "file";
|
|
1780
|
-
content: string;
|
|
1781
1780
|
filePath: string;
|
|
1781
|
+
content: string;
|
|
1782
1782
|
}[];
|
|
1783
1783
|
authToken?: string | undefined;
|
|
1784
1784
|
costMode?: "lite" | "normal" | "pro" | undefined;
|
|
@@ -1884,12 +1884,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
|
|
|
1884
1884
|
content: z.ZodString;
|
|
1885
1885
|
}, "strip", z.ZodTypeAny, {
|
|
1886
1886
|
type: "patch" | "file";
|
|
1887
|
-
content: string;
|
|
1888
1887
|
filePath: string;
|
|
1888
|
+
content: string;
|
|
1889
1889
|
}, {
|
|
1890
1890
|
type: "patch" | "file";
|
|
1891
|
-
content: string;
|
|
1892
1891
|
filePath: string;
|
|
1892
|
+
content: string;
|
|
1893
1893
|
}>, "many">;
|
|
1894
1894
|
changesAlreadyApplied: z.ZodArray<z.ZodObject<{
|
|
1895
1895
|
type: z.ZodEnum<["patch", "file"]>;
|
|
@@ -1897,12 +1897,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
|
|
|
1897
1897
|
content: z.ZodString;
|
|
1898
1898
|
}, "strip", z.ZodTypeAny, {
|
|
1899
1899
|
type: "patch" | "file";
|
|
1900
|
-
content: string;
|
|
1901
1900
|
filePath: string;
|
|
1901
|
+
content: string;
|
|
1902
1902
|
}, {
|
|
1903
1903
|
type: "patch" | "file";
|
|
1904
|
-
content: string;
|
|
1905
1904
|
filePath: string;
|
|
1905
|
+
content: string;
|
|
1906
1906
|
}>, "many">;
|
|
1907
1907
|
addedFileVersions: z.ZodArray<z.ZodObject<{
|
|
1908
1908
|
path: z.ZodString;
|
|
@@ -1927,14 +1927,14 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
|
|
|
1927
1927
|
userInputId: string;
|
|
1928
1928
|
changesAlreadyApplied: {
|
|
1929
1929
|
type: "patch" | "file";
|
|
1930
|
-
content: string;
|
|
1931
1930
|
filePath: string;
|
|
1931
|
+
content: string;
|
|
1932
1932
|
}[];
|
|
1933
1933
|
response: string;
|
|
1934
1934
|
changes: {
|
|
1935
1935
|
type: "patch" | "file";
|
|
1936
|
-
content: string;
|
|
1937
1936
|
filePath: string;
|
|
1937
|
+
content: string;
|
|
1938
1938
|
}[];
|
|
1939
1939
|
addedFileVersions: {
|
|
1940
1940
|
path: string;
|
|
@@ -1952,14 +1952,14 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
|
|
|
1952
1952
|
userInputId: string;
|
|
1953
1953
|
changesAlreadyApplied: {
|
|
1954
1954
|
type: "patch" | "file";
|
|
1955
|
-
content: string;
|
|
1956
1955
|
filePath: string;
|
|
1956
|
+
content: string;
|
|
1957
1957
|
}[];
|
|
1958
1958
|
response: string;
|
|
1959
1959
|
changes: {
|
|
1960
1960
|
type: "patch" | "file";
|
|
1961
|
-
content: string;
|
|
1962
1961
|
filePath: string;
|
|
1962
|
+
content: string;
|
|
1963
1963
|
}[];
|
|
1964
1964
|
addedFileVersions: {
|
|
1965
1965
|
path: string;
|
|
@@ -2004,12 +2004,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
|
|
|
2004
2004
|
content: z.ZodString;
|
|
2005
2005
|
}, "strip", z.ZodTypeAny, {
|
|
2006
2006
|
type: "patch" | "file";
|
|
2007
|
-
content: string;
|
|
2008
2007
|
filePath: string;
|
|
2008
|
+
content: string;
|
|
2009
2009
|
}, {
|
|
2010
2010
|
type: "patch" | "file";
|
|
2011
|
-
content: string;
|
|
2012
2011
|
filePath: string;
|
|
2012
|
+
content: string;
|
|
2013
2013
|
}>, "many">;
|
|
2014
2014
|
changesAlreadyApplied: z.ZodArray<z.ZodObject<{
|
|
2015
2015
|
type: z.ZodEnum<["patch", "file"]>;
|
|
@@ -2017,12 +2017,12 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
|
|
|
2017
2017
|
content: z.ZodString;
|
|
2018
2018
|
}, "strip", z.ZodTypeAny, {
|
|
2019
2019
|
type: "patch" | "file";
|
|
2020
|
-
content: string;
|
|
2021
2020
|
filePath: string;
|
|
2021
|
+
content: string;
|
|
2022
2022
|
}, {
|
|
2023
2023
|
type: "patch" | "file";
|
|
2024
|
-
content: string;
|
|
2025
2024
|
filePath: string;
|
|
2025
|
+
content: string;
|
|
2026
2026
|
}>, "many">;
|
|
2027
2027
|
addedFileVersions: z.ZodArray<z.ZodObject<{
|
|
2028
2028
|
path: z.ZodString;
|
|
@@ -2040,14 +2040,14 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
|
|
|
2040
2040
|
userInputId: string;
|
|
2041
2041
|
changesAlreadyApplied: {
|
|
2042
2042
|
type: "patch" | "file";
|
|
2043
|
-
content: string;
|
|
2044
2043
|
filePath: string;
|
|
2044
|
+
content: string;
|
|
2045
2045
|
}[];
|
|
2046
2046
|
response: string;
|
|
2047
2047
|
changes: {
|
|
2048
2048
|
type: "patch" | "file";
|
|
2049
|
-
content: string;
|
|
2050
2049
|
filePath: string;
|
|
2050
|
+
content: string;
|
|
2051
2051
|
}[];
|
|
2052
2052
|
addedFileVersions: {
|
|
2053
2053
|
path: string;
|
|
@@ -2064,14 +2064,14 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
|
|
|
2064
2064
|
userInputId: string;
|
|
2065
2065
|
changesAlreadyApplied: {
|
|
2066
2066
|
type: "patch" | "file";
|
|
2067
|
-
content: string;
|
|
2068
2067
|
filePath: string;
|
|
2068
|
+
content: string;
|
|
2069
2069
|
}[];
|
|
2070
2070
|
response: string;
|
|
2071
2071
|
changes: {
|
|
2072
2072
|
type: "patch" | "file";
|
|
2073
|
-
content: string;
|
|
2074
2073
|
filePath: string;
|
|
2074
|
+
content: string;
|
|
2075
2075
|
}[];
|
|
2076
2076
|
addedFileVersions: {
|
|
2077
2077
|
path: string;
|
|
@@ -2261,14 +2261,14 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
|
|
|
2261
2261
|
userInputId: string;
|
|
2262
2262
|
changesAlreadyApplied: {
|
|
2263
2263
|
type: "patch" | "file";
|
|
2264
|
-
content: string;
|
|
2265
2264
|
filePath: string;
|
|
2265
|
+
content: string;
|
|
2266
2266
|
}[];
|
|
2267
2267
|
response: string;
|
|
2268
2268
|
changes: {
|
|
2269
2269
|
type: "patch" | "file";
|
|
2270
|
-
content: string;
|
|
2271
2270
|
filePath: string;
|
|
2271
|
+
content: string;
|
|
2272
2272
|
}[];
|
|
2273
2273
|
addedFileVersions: {
|
|
2274
2274
|
path: string;
|
|
@@ -2293,14 +2293,14 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
|
|
|
2293
2293
|
userInputId: string;
|
|
2294
2294
|
changesAlreadyApplied: {
|
|
2295
2295
|
type: "patch" | "file";
|
|
2296
|
-
content: string;
|
|
2297
2296
|
filePath: string;
|
|
2297
|
+
content: string;
|
|
2298
2298
|
}[];
|
|
2299
2299
|
response: string;
|
|
2300
2300
|
changes: {
|
|
2301
2301
|
type: "patch" | "file";
|
|
2302
|
-
content: string;
|
|
2303
2302
|
filePath: string;
|
|
2303
|
+
content: string;
|
|
2304
2304
|
}[];
|
|
2305
2305
|
addedFileVersions: {
|
|
2306
2306
|
path: string;
|
|
@@ -2366,14 +2366,14 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
|
|
|
2366
2366
|
userInputId: string;
|
|
2367
2367
|
changesAlreadyApplied: {
|
|
2368
2368
|
type: "patch" | "file";
|
|
2369
|
-
content: string;
|
|
2370
2369
|
filePath: string;
|
|
2370
|
+
content: string;
|
|
2371
2371
|
}[];
|
|
2372
2372
|
response: string;
|
|
2373
2373
|
changes: {
|
|
2374
2374
|
type: "patch" | "file";
|
|
2375
|
-
content: string;
|
|
2376
2375
|
filePath: string;
|
|
2376
|
+
content: string;
|
|
2377
2377
|
}[];
|
|
2378
2378
|
addedFileVersions: {
|
|
2379
2379
|
path: string;
|
|
@@ -2398,14 +2398,14 @@ export declare const SERVER_MESSAGE_SCHEMAS: {
|
|
|
2398
2398
|
userInputId: string;
|
|
2399
2399
|
changesAlreadyApplied: {
|
|
2400
2400
|
type: "patch" | "file";
|
|
2401
|
-
content: string;
|
|
2402
2401
|
filePath: string;
|
|
2402
|
+
content: string;
|
|
2403
2403
|
}[];
|
|
2404
2404
|
response: string;
|
|
2405
2405
|
changes: {
|
|
2406
2406
|
type: "patch" | "file";
|
|
2407
|
-
content: string;
|
|
2408
2407
|
filePath: string;
|
|
2408
|
+
content: string;
|
|
2409
2409
|
}[];
|
|
2410
2410
|
addedFileVersions: {
|
|
2411
2411
|
path: string;
|
|
@@ -2489,12 +2489,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
2489
2489
|
content: z.ZodString;
|
|
2490
2490
|
}, "strip", z.ZodTypeAny, {
|
|
2491
2491
|
type: "patch" | "file";
|
|
2492
|
-
content: string;
|
|
2493
2492
|
filePath: string;
|
|
2493
|
+
content: string;
|
|
2494
2494
|
}, {
|
|
2495
2495
|
type: "patch" | "file";
|
|
2496
|
-
content: string;
|
|
2497
2496
|
filePath: string;
|
|
2497
|
+
content: string;
|
|
2498
2498
|
}>, "many">;
|
|
2499
2499
|
changesAlreadyApplied: z.ZodArray<z.ZodObject<{
|
|
2500
2500
|
type: z.ZodEnum<["patch", "file"]>;
|
|
@@ -2502,12 +2502,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
2502
2502
|
content: z.ZodString;
|
|
2503
2503
|
}, "strip", z.ZodTypeAny, {
|
|
2504
2504
|
type: "patch" | "file";
|
|
2505
|
-
content: string;
|
|
2506
2505
|
filePath: string;
|
|
2506
|
+
content: string;
|
|
2507
2507
|
}, {
|
|
2508
2508
|
type: "patch" | "file";
|
|
2509
|
-
content: string;
|
|
2510
2509
|
filePath: string;
|
|
2510
|
+
content: string;
|
|
2511
2511
|
}>, "many">;
|
|
2512
2512
|
addedFileVersions: z.ZodArray<z.ZodObject<{
|
|
2513
2513
|
path: z.ZodString;
|
|
@@ -2532,14 +2532,14 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
2532
2532
|
userInputId: string;
|
|
2533
2533
|
changesAlreadyApplied: {
|
|
2534
2534
|
type: "patch" | "file";
|
|
2535
|
-
content: string;
|
|
2536
2535
|
filePath: string;
|
|
2536
|
+
content: string;
|
|
2537
2537
|
}[];
|
|
2538
2538
|
response: string;
|
|
2539
2539
|
changes: {
|
|
2540
2540
|
type: "patch" | "file";
|
|
2541
|
-
content: string;
|
|
2542
2541
|
filePath: string;
|
|
2542
|
+
content: string;
|
|
2543
2543
|
}[];
|
|
2544
2544
|
addedFileVersions: {
|
|
2545
2545
|
path: string;
|
|
@@ -2557,14 +2557,14 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
2557
2557
|
userInputId: string;
|
|
2558
2558
|
changesAlreadyApplied: {
|
|
2559
2559
|
type: "patch" | "file";
|
|
2560
|
-
content: string;
|
|
2561
2560
|
filePath: string;
|
|
2561
|
+
content: string;
|
|
2562
2562
|
}[];
|
|
2563
2563
|
response: string;
|
|
2564
2564
|
changes: {
|
|
2565
2565
|
type: "patch" | "file";
|
|
2566
|
-
content: string;
|
|
2567
2566
|
filePath: string;
|
|
2567
|
+
content: string;
|
|
2568
2568
|
}[];
|
|
2569
2569
|
addedFileVersions: {
|
|
2570
2570
|
path: string;
|
|
@@ -2609,12 +2609,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
2609
2609
|
content: z.ZodString;
|
|
2610
2610
|
}, "strip", z.ZodTypeAny, {
|
|
2611
2611
|
type: "patch" | "file";
|
|
2612
|
-
content: string;
|
|
2613
2612
|
filePath: string;
|
|
2613
|
+
content: string;
|
|
2614
2614
|
}, {
|
|
2615
2615
|
type: "patch" | "file";
|
|
2616
|
-
content: string;
|
|
2617
2616
|
filePath: string;
|
|
2617
|
+
content: string;
|
|
2618
2618
|
}>, "many">;
|
|
2619
2619
|
changesAlreadyApplied: z.ZodArray<z.ZodObject<{
|
|
2620
2620
|
type: z.ZodEnum<["patch", "file"]>;
|
|
@@ -2622,12 +2622,12 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
2622
2622
|
content: z.ZodString;
|
|
2623
2623
|
}, "strip", z.ZodTypeAny, {
|
|
2624
2624
|
type: "patch" | "file";
|
|
2625
|
-
content: string;
|
|
2626
2625
|
filePath: string;
|
|
2626
|
+
content: string;
|
|
2627
2627
|
}, {
|
|
2628
2628
|
type: "patch" | "file";
|
|
2629
|
-
content: string;
|
|
2630
2629
|
filePath: string;
|
|
2630
|
+
content: string;
|
|
2631
2631
|
}>, "many">;
|
|
2632
2632
|
addedFileVersions: z.ZodArray<z.ZodObject<{
|
|
2633
2633
|
path: z.ZodString;
|
|
@@ -2645,14 +2645,14 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
2645
2645
|
userInputId: string;
|
|
2646
2646
|
changesAlreadyApplied: {
|
|
2647
2647
|
type: "patch" | "file";
|
|
2648
|
-
content: string;
|
|
2649
2648
|
filePath: string;
|
|
2649
|
+
content: string;
|
|
2650
2650
|
}[];
|
|
2651
2651
|
response: string;
|
|
2652
2652
|
changes: {
|
|
2653
2653
|
type: "patch" | "file";
|
|
2654
|
-
content: string;
|
|
2655
2654
|
filePath: string;
|
|
2655
|
+
content: string;
|
|
2656
2656
|
}[];
|
|
2657
2657
|
addedFileVersions: {
|
|
2658
2658
|
path: string;
|
|
@@ -2669,14 +2669,14 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
2669
2669
|
userInputId: string;
|
|
2670
2670
|
changesAlreadyApplied: {
|
|
2671
2671
|
type: "patch" | "file";
|
|
2672
|
-
content: string;
|
|
2673
2672
|
filePath: string;
|
|
2673
|
+
content: string;
|
|
2674
2674
|
}[];
|
|
2675
2675
|
response: string;
|
|
2676
2676
|
changes: {
|
|
2677
2677
|
type: "patch" | "file";
|
|
2678
|
-
content: string;
|
|
2679
2678
|
filePath: string;
|
|
2679
|
+
content: string;
|
|
2680
2680
|
}[];
|
|
2681
2681
|
addedFileVersions: {
|
|
2682
2682
|
path: string;
|
|
@@ -2866,14 +2866,14 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
2866
2866
|
userInputId: string;
|
|
2867
2867
|
changesAlreadyApplied: {
|
|
2868
2868
|
type: "patch" | "file";
|
|
2869
|
-
content: string;
|
|
2870
2869
|
filePath: string;
|
|
2870
|
+
content: string;
|
|
2871
2871
|
}[];
|
|
2872
2872
|
response: string;
|
|
2873
2873
|
changes: {
|
|
2874
2874
|
type: "patch" | "file";
|
|
2875
|
-
content: string;
|
|
2876
2875
|
filePath: string;
|
|
2876
|
+
content: string;
|
|
2877
2877
|
}[];
|
|
2878
2878
|
addedFileVersions: {
|
|
2879
2879
|
path: string;
|
|
@@ -2898,14 +2898,14 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
2898
2898
|
userInputId: string;
|
|
2899
2899
|
changesAlreadyApplied: {
|
|
2900
2900
|
type: "patch" | "file";
|
|
2901
|
-
content: string;
|
|
2902
2901
|
filePath: string;
|
|
2902
|
+
content: string;
|
|
2903
2903
|
}[];
|
|
2904
2904
|
response: string;
|
|
2905
2905
|
changes: {
|
|
2906
2906
|
type: "patch" | "file";
|
|
2907
|
-
content: string;
|
|
2908
2907
|
filePath: string;
|
|
2908
|
+
content: string;
|
|
2909
2909
|
}[];
|
|
2910
2910
|
addedFileVersions: {
|
|
2911
2911
|
path: string;
|
|
@@ -2971,14 +2971,14 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
2971
2971
|
userInputId: string;
|
|
2972
2972
|
changesAlreadyApplied: {
|
|
2973
2973
|
type: "patch" | "file";
|
|
2974
|
-
content: string;
|
|
2975
2974
|
filePath: string;
|
|
2975
|
+
content: string;
|
|
2976
2976
|
}[];
|
|
2977
2977
|
response: string;
|
|
2978
2978
|
changes: {
|
|
2979
2979
|
type: "patch" | "file";
|
|
2980
|
-
content: string;
|
|
2981
2980
|
filePath: string;
|
|
2981
|
+
content: string;
|
|
2982
2982
|
}[];
|
|
2983
2983
|
addedFileVersions: {
|
|
2984
2984
|
path: string;
|
|
@@ -3003,14 +3003,14 @@ export declare const SERVER_MESSAGE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
|
3003
3003
|
userInputId: string;
|
|
3004
3004
|
changesAlreadyApplied: {
|
|
3005
3005
|
type: "patch" | "file";
|
|
3006
|
-
content: string;
|
|
3007
3006
|
filePath: string;
|
|
3007
|
+
content: string;
|
|
3008
3008
|
}[];
|
|
3009
3009
|
response: string;
|
|
3010
3010
|
changes: {
|
|
3011
3011
|
type: "patch" | "file";
|
|
3012
|
-
content: string;
|
|
3013
3012
|
filePath: string;
|
|
3013
|
+
content: string;
|
|
3014
3014
|
}[];
|
|
3015
3015
|
addedFileVersions: {
|
|
3016
3016
|
path: string;
|
package/dist/index.js
CHANGED
|
@@ -14,16 +14,16 @@ const picocolors_1 = require("picocolors");
|
|
|
14
14
|
const cli_1 = require("./cli");
|
|
15
15
|
const project_files_1 = require("./project-files");
|
|
16
16
|
const update_codebuff_1 = require("./update-codebuff");
|
|
17
|
-
async function codebuff(projectDir, { initialInput,
|
|
17
|
+
async function codebuff(projectDir, { initialInput, git, costMode }) {
|
|
18
18
|
const dir = (0, project_files_1.setProjectRoot)(projectDir);
|
|
19
19
|
const updatePromise = (0, update_codebuff_1.updateCodebuff)();
|
|
20
20
|
const initFileContextPromise = (0, project_files_1.initProjectFileContextWithWorker)(dir);
|
|
21
21
|
const readyPromise = Promise.all([updatePromise, initFileContextPromise]);
|
|
22
|
-
const cli = new cli_1.CLI(readyPromise, {
|
|
22
|
+
const cli = new cli_1.CLI(readyPromise, { git, costMode });
|
|
23
23
|
const costModeDescription = {
|
|
24
|
-
lite: (0, picocolors_1.bold)((0, picocolors_1.yellow)('Lite mode ✨enabled')),
|
|
24
|
+
lite: (0, picocolors_1.bold)((0, picocolors_1.yellow)('Lite mode ✨ enabled')),
|
|
25
25
|
normal: '',
|
|
26
|
-
pro: (0, picocolors_1.bold)((0, picocolors_1.blueBright)('Pro mode️ ⚡enabled')),
|
|
26
|
+
pro: (0, picocolors_1.bold)((0, picocolors_1.blueBright)('Pro mode️ ⚡ enabled')),
|
|
27
27
|
};
|
|
28
28
|
console.log(`${costModeDescription[costMode]}`);
|
|
29
29
|
console.log(`Codebuff will read and write files in "${dir}". Type "help" for a list of commands.`);
|
|
@@ -36,9 +36,12 @@ async function codebuff(projectDir, { initialInput, autoGit, costMode, }) {
|
|
|
36
36
|
if (require.main === module) {
|
|
37
37
|
const args = process.argv.slice(2);
|
|
38
38
|
const help = args.includes('--help') || args.includes('-h');
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const gitArg = args.indexOf('--git');
|
|
40
|
+
const git = gitArg !== -1 && args[gitArg + 1] === 'stage'
|
|
41
|
+
? 'stage'
|
|
42
|
+
: undefined;
|
|
43
|
+
if (gitArg !== -1) {
|
|
44
|
+
args.splice(gitArg, 2);
|
|
42
45
|
}
|
|
43
46
|
let costMode = 'normal';
|
|
44
47
|
if (args.includes('--lite')) {
|
|
@@ -60,11 +63,11 @@ if (require.main === module) {
|
|
|
60
63
|
console.log('Options:');
|
|
61
64
|
console.log(' --lite Use budget models & fetch fewer files');
|
|
62
65
|
console.log(' --pro Use higher quality models and fetch more files');
|
|
63
|
-
console.log(' --
|
|
66
|
+
console.log(' --git stage Stage changes from last message');
|
|
64
67
|
console.log();
|
|
65
68
|
console.log('Codebuff allows you to interact with your codebase using natural language.');
|
|
66
69
|
process.exit(0);
|
|
67
70
|
}
|
|
68
|
-
codebuff(projectPath, { initialInput,
|
|
71
|
+
codebuff(projectPath, { initialInput, git, costMode });
|
|
69
72
|
}
|
|
70
73
|
//# sourceMappingURL=index.js.map
|