codebuff 1.0.175 → 1.0.176

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 (46) hide show
  1. package/dist/checkpoints.d.ts +2 -1
  2. package/dist/checkpoints.js +6 -3
  3. package/dist/checkpoints.js.map +1 -1
  4. package/dist/cli.d.ts +0 -1
  5. package/dist/cli.js +23 -48
  6. package/dist/cli.js.map +1 -1
  7. package/dist/client.d.ts +7 -6
  8. package/dist/client.js +8 -1
  9. package/dist/client.js.map +1 -1
  10. package/dist/code-map/tsconfig.tsbuildinfo +1 -1
  11. package/dist/common/actions.d.ts +155 -155
  12. package/dist/common/browser-actions.d.ts +28 -28
  13. package/dist/common/constants.d.ts +0 -1
  14. package/dist/common/constants.js +1 -44
  15. package/dist/common/constants.js.map +1 -1
  16. package/dist/common/logger.d.ts +1 -0
  17. package/dist/common/logger.js +7 -0
  18. package/dist/common/logger.js.map +1 -0
  19. package/dist/common/project-file-tree.d.ts +1 -0
  20. package/dist/common/project-file-tree.js +3 -1
  21. package/dist/common/project-file-tree.js.map +1 -1
  22. package/dist/common/types/agent-state.d.ts +20 -20
  23. package/dist/common/types/message.d.ts +16 -16
  24. package/dist/common/types/usage.d.ts +2 -2
  25. package/dist/common/util/constants.d.ts +1 -0
  26. package/dist/common/util/constants.js +7 -0
  27. package/dist/common/util/constants.js.map +1 -0
  28. package/dist/common/util/credentials.d.ts +2 -2
  29. package/dist/common/util/file.d.ts +4 -4
  30. package/dist/common/util/helpers.d.ts +1 -0
  31. package/dist/common/util/helpers.js +6 -0
  32. package/dist/common/util/helpers.js.map +1 -0
  33. package/dist/common/util/token-counter.d.ts +3 -0
  34. package/dist/common/util/token-counter.js +27 -0
  35. package/dist/common/util/token-counter.js.map +1 -0
  36. package/dist/common/websockets/websocket-schema.d.ts +444 -444
  37. package/dist/index.js +1 -1
  38. package/dist/project-files.d.ts +2 -2
  39. package/dist/tool-handlers.d.ts +2 -1
  40. package/dist/tool-handlers.js +3 -3
  41. package/dist/tool-handlers.js.map +1 -1
  42. package/dist/utils/terminal.js +4 -40
  43. package/dist/utils/terminal.js.map +1 -1
  44. package/dist/utils/tool-renderers.js +14 -2
  45. package/dist/utils/tool-renderers.js.map +1 -1
  46. package/package.json +1 -1
@@ -61,15 +61,15 @@ declare const MessageContentObjectSchema: z.ZodUnion<[z.ZodObject<{
61
61
  type: "ephemeral";
62
62
  }>>;
63
63
  }, "strip", z.ZodTypeAny, {
64
- type: "tool_result";
65
64
  content: string;
65
+ type: "tool_result";
66
66
  tool_use_id: string;
67
67
  cache_control?: {
68
68
  type: "ephemeral";
69
69
  } | undefined;
70
70
  }, {
71
- type: "tool_result";
72
71
  content: string;
72
+ type: "tool_result";
73
73
  tool_use_id: string;
74
74
  cache_control?: {
75
75
  type: "ephemeral";
@@ -82,12 +82,12 @@ declare const MessageContentObjectSchema: z.ZodUnion<[z.ZodObject<{
82
82
  data: z.ZodString;
83
83
  }, "strip", z.ZodTypeAny, {
84
84
  type: "base64";
85
- data: string;
86
85
  media_type: "image/jpeg";
86
+ data: string;
87
87
  }, {
88
88
  type: "base64";
89
- data: string;
90
89
  media_type: "image/jpeg";
90
+ data: string;
91
91
  }>;
92
92
  cache_control: z.ZodOptional<z.ZodObject<{
93
93
  type: z.ZodLiteral<"ephemeral">;
@@ -100,8 +100,8 @@ declare const MessageContentObjectSchema: z.ZodUnion<[z.ZodObject<{
100
100
  type: "image";
101
101
  source: {
102
102
  type: "base64";
103
- data: string;
104
103
  media_type: "image/jpeg";
104
+ data: string;
105
105
  };
106
106
  cache_control?: {
107
107
  type: "ephemeral";
@@ -110,8 +110,8 @@ declare const MessageContentObjectSchema: z.ZodUnion<[z.ZodObject<{
110
110
  type: "image";
111
111
  source: {
112
112
  type: "base64";
113
- data: string;
114
113
  media_type: "image/jpeg";
114
+ data: string;
115
115
  };
116
116
  cache_control?: {
117
117
  type: "ephemeral";
@@ -181,15 +181,15 @@ export declare const MessageSchema: z.ZodObject<{
181
181
  type: "ephemeral";
182
182
  }>>;
183
183
  }, "strip", z.ZodTypeAny, {
184
- type: "tool_result";
185
184
  content: string;
185
+ type: "tool_result";
186
186
  tool_use_id: string;
187
187
  cache_control?: {
188
188
  type: "ephemeral";
189
189
  } | undefined;
190
190
  }, {
191
- type: "tool_result";
192
191
  content: string;
192
+ type: "tool_result";
193
193
  tool_use_id: string;
194
194
  cache_control?: {
195
195
  type: "ephemeral";
@@ -202,12 +202,12 @@ export declare const MessageSchema: z.ZodObject<{
202
202
  data: z.ZodString;
203
203
  }, "strip", z.ZodTypeAny, {
204
204
  type: "base64";
205
- data: string;
206
205
  media_type: "image/jpeg";
206
+ data: string;
207
207
  }, {
208
208
  type: "base64";
209
- data: string;
210
209
  media_type: "image/jpeg";
210
+ data: string;
211
211
  }>;
212
212
  cache_control: z.ZodOptional<z.ZodObject<{
213
213
  type: z.ZodLiteral<"ephemeral">;
@@ -220,8 +220,8 @@ export declare const MessageSchema: z.ZodObject<{
220
220
  type: "image";
221
221
  source: {
222
222
  type: "base64";
223
- data: string;
224
223
  media_type: "image/jpeg";
224
+ data: string;
225
225
  };
226
226
  cache_control?: {
227
227
  type: "ephemeral";
@@ -230,8 +230,8 @@ export declare const MessageSchema: z.ZodObject<{
230
230
  type: "image";
231
231
  source: {
232
232
  type: "base64";
233
- data: string;
234
233
  media_type: "image/jpeg";
234
+ data: string;
235
235
  };
236
236
  cache_control?: {
237
237
  type: "ephemeral";
@@ -253,8 +253,8 @@ export declare const MessageSchema: z.ZodObject<{
253
253
  type: "ephemeral";
254
254
  } | undefined;
255
255
  } | {
256
- type: "tool_result";
257
256
  content: string;
257
+ type: "tool_result";
258
258
  tool_use_id: string;
259
259
  cache_control?: {
260
260
  type: "ephemeral";
@@ -263,8 +263,8 @@ export declare const MessageSchema: z.ZodObject<{
263
263
  type: "image";
264
264
  source: {
265
265
  type: "base64";
266
- data: string;
267
266
  media_type: "image/jpeg";
267
+ data: string;
268
268
  };
269
269
  cache_control?: {
270
270
  type: "ephemeral";
@@ -287,8 +287,8 @@ export declare const MessageSchema: z.ZodObject<{
287
287
  type: "ephemeral";
288
288
  } | undefined;
289
289
  } | {
290
- type: "tool_result";
291
290
  content: string;
291
+ type: "tool_result";
292
292
  tool_use_id: string;
293
293
  cache_control?: {
294
294
  type: "ephemeral";
@@ -297,8 +297,8 @@ export declare const MessageSchema: z.ZodObject<{
297
297
  type: "image";
298
298
  source: {
299
299
  type: "base64";
300
- data: string;
301
300
  media_type: "image/jpeg";
301
+ data: string;
302
302
  };
303
303
  cache_control?: {
304
304
  type: "ephemeral";
@@ -8,17 +8,17 @@ export declare const usageDataSchema: z.ZodObject<{
8
8
  overageRate: z.ZodNullable<z.ZodNumber>;
9
9
  }, "strip", z.ZodTypeAny, {
10
10
  creditsUsed: number;
11
- overageRate: number | null;
12
11
  totalQuota: number;
13
12
  remainingCredits: number;
14
13
  subscriptionActive: boolean;
15
14
  nextQuotaReset: Date;
15
+ overageRate: number | null;
16
16
  }, {
17
17
  creditsUsed: number;
18
- overageRate: number | null;
19
18
  totalQuota: number;
20
19
  remainingCredits: number;
21
20
  subscriptionActive: boolean;
22
21
  nextQuotaReset: Date;
22
+ overageRate: number | null;
23
23
  }>;
24
24
  export type UsageData = z.infer<typeof usageDataSchema>;
@@ -0,0 +1 @@
1
+ export declare function getModelForMode(mode: string): string;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getModelForMode = getModelForMode;
4
+ function getModelForMode(mode) {
5
+ return 'claude-3-sonnet';
6
+ }
7
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/util/constants.ts"],"names":[],"mappings":";;AAAA,0CAEC;AAFD,SAAgB,eAAe,CAAC,IAAY;IAC1C,OAAO,iBAAiB,CAAA;AAC1B,CAAC"}
@@ -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
- name: string | null;
11
10
  email: string;
11
+ name: string | null;
12
12
  id: string;
13
13
  fingerprintId: string;
14
14
  authToken: string;
15
15
  fingerprintHash: string;
16
16
  }, {
17
- name: string | null;
18
17
  email: string;
18
+ name: string | null;
19
19
  id: string;
20
20
  fingerprintId: string;
21
21
  authToken: string;
@@ -38,13 +38,13 @@ export declare const ProjectFileContextSchema: z.ZodObject<{
38
38
  diffCached: z.ZodString;
39
39
  lastCommitMessages: z.ZodString;
40
40
  }, "strip", z.ZodTypeAny, {
41
- diff: string;
42
41
  status: string;
42
+ diff: string;
43
43
  diffCached: string;
44
44
  lastCommitMessages: string;
45
45
  }, {
46
- diff: string;
47
46
  status: string;
47
+ diff: string;
48
48
  diffCached: string;
49
49
  lastCommitMessages: string;
50
50
  }>;
@@ -88,8 +88,8 @@ export declare const ProjectFileContextSchema: z.ZodObject<{
88
88
  fileTokenScores: Record<string, Record<string, number>>;
89
89
  knowledgeFiles: Record<string, string>;
90
90
  gitChanges: {
91
- diff: string;
92
91
  status: string;
92
+ diff: string;
93
93
  diffCached: string;
94
94
  lastCommitMessages: string;
95
95
  };
@@ -114,8 +114,8 @@ export declare const ProjectFileContextSchema: z.ZodObject<{
114
114
  fileTokenScores: Record<string, Record<string, number>>;
115
115
  knowledgeFiles: Record<string, string>;
116
116
  gitChanges: {
117
- diff: string;
118
117
  status: string;
118
+ diff: string;
119
119
  diffCached: string;
120
120
  lastCommitMessages: string;
121
121
  };
@@ -0,0 +1 @@
1
+ export declare const sleep: (ms: number) => Promise<unknown>;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sleep = void 0;
4
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
5
+ exports.sleep = sleep;
6
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/util/helpers.ts"],"names":[],"mappings":";;;AAAO,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;AAA7D,QAAA,KAAK,SAAwD"}
@@ -0,0 +1,3 @@
1
+ export declare function countTokens(text: string): number;
2
+ export declare function countTokensJson(text: string | object): number;
3
+ export declare function countTokensForFiles(files: Record<string, string | null>): Record<string, number>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.countTokens = countTokens;
4
+ exports.countTokensJson = countTokensJson;
5
+ exports.countTokensForFiles = countTokensForFiles;
6
+ const gpt_4o_1 = require("gpt-tokenizer/esm/model/gpt-4o");
7
+ const ANTHROPIC_TOKEN_FUDGE_FACTOR = 1.35;
8
+ function countTokens(text) {
9
+ try {
10
+ return Math.floor((0, gpt_4o_1.encode)(text).length * ANTHROPIC_TOKEN_FUDGE_FACTOR);
11
+ }
12
+ catch (e) {
13
+ console.error('Error counting tokens', e);
14
+ return Math.ceil(text.length / 3);
15
+ }
16
+ }
17
+ function countTokensJson(text) {
18
+ return countTokens(JSON.stringify(text));
19
+ }
20
+ function countTokensForFiles(files) {
21
+ const tokenCounts = {};
22
+ for (const [filePath, content] of Object.entries(files)) {
23
+ tokenCounts[filePath] = content ? countTokens(content) : 0;
24
+ }
25
+ return tokenCounts;
26
+ }
27
+ //# sourceMappingURL=token-counter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-counter.js","sourceRoot":"","sources":["../../src/util/token-counter.ts"],"names":[],"mappings":";;AAIA,kCAOC;AAED,0CAEC;AAED,kDAQC;AAzBD,2DAAuD;AAEvD,MAAM,4BAA4B,GAAG,IAAI,CAAA;AAEzC,SAAgB,WAAW,CAAC,IAAY;IACtC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,eAAM,EAAC,IAAI,CAAC,CAAC,MAAM,GAAG,4BAA4B,CAAC,CAAA;IACvE,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAA;QACzC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IACnC,CAAC;AACH,CAAC;AAED,SAAgB,eAAe,CAAC,IAAqB;IACnD,OAAO,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;AAC1C,CAAC;AAED,SAAgB,mBAAmB,CACjC,KAAoC;IAEpC,MAAM,WAAW,GAA2B,EAAE,CAAA;IAC9C,KAAK,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxD,WAAW,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC5D,CAAC;IACD,OAAO,WAAW,CAAA;AACpB,CAAC"}