codebuff 1.0.177 → 1.0.179

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 (36) hide show
  1. package/dist/checkpoints/checkpoint-manager.js +1 -1
  2. package/dist/checkpoints/checkpoint-manager.js.map +1 -1
  3. package/dist/client.d.ts +4 -4
  4. package/dist/client.js +9 -10
  5. package/dist/client.js.map +1 -1
  6. package/dist/code-map/tsconfig.tsbuildinfo +1 -1
  7. package/dist/common/actions.d.ts +120 -120
  8. package/dist/common/browser-actions.d.ts +44 -44
  9. package/dist/common/logger.d.ts +1 -0
  10. package/dist/common/logger.js +7 -0
  11. package/dist/common/logger.js.map +1 -0
  12. package/dist/common/types/agent-state.d.ts +26 -26
  13. package/dist/common/types/message.d.ts +14 -14
  14. package/dist/common/types/usage.d.ts +2 -2
  15. package/dist/common/util/constants.d.ts +1 -0
  16. package/dist/common/util/constants.js +7 -0
  17. package/dist/common/util/constants.js.map +1 -0
  18. package/dist/common/util/credentials.d.ts +2 -2
  19. package/dist/common/util/helpers.d.ts +1 -0
  20. package/dist/common/util/helpers.js +6 -0
  21. package/dist/common/util/helpers.js.map +1 -0
  22. package/dist/common/util/token-counter.d.ts +3 -0
  23. package/dist/common/util/token-counter.js +27 -0
  24. package/dist/common/util/token-counter.js.map +1 -0
  25. package/dist/common/websockets/websocket-schema.d.ts +368 -368
  26. package/dist/index.js +1 -1
  27. package/package.json +1 -1
  28. package/dist/common/advanced-analyzer.d.ts +0 -19
  29. package/dist/common/advanced-analyzer.js +0 -140
  30. package/dist/common/advanced-analyzer.js.map +0 -1
  31. package/dist/common/message-image-handling.d.ts +0 -41
  32. package/dist/common/message-image-handling.js +0 -57
  33. package/dist/common/message-image-handling.js.map +0 -1
  34. package/dist/common/util/process-stream.d.ts +0 -8
  35. package/dist/common/util/process-stream.js +0 -102
  36. package/dist/common/util/process-stream.js.map +0 -1
@@ -35,16 +35,16 @@ declare const MessageContentObjectSchema: z.ZodUnion<[z.ZodObject<{
35
35
  }>>;
36
36
  }, "strip", z.ZodTypeAny, {
37
37
  type: "tool_use";
38
- id: string;
39
38
  name: string;
39
+ id: string;
40
40
  input: Record<string, any>;
41
41
  cache_control?: {
42
42
  type: "ephemeral";
43
43
  } | undefined;
44
44
  }, {
45
45
  type: "tool_use";
46
- id: string;
47
46
  name: string;
47
+ id: string;
48
48
  input: Record<string, any>;
49
49
  cache_control?: {
50
50
  type: "ephemeral";
@@ -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";
@@ -155,16 +155,16 @@ export declare const MessageSchema: z.ZodObject<{
155
155
  }>>;
156
156
  }, "strip", z.ZodTypeAny, {
157
157
  type: "tool_use";
158
- id: string;
159
158
  name: string;
159
+ id: string;
160
160
  input: Record<string, any>;
161
161
  cache_control?: {
162
162
  type: "ephemeral";
163
163
  } | undefined;
164
164
  }, {
165
165
  type: "tool_use";
166
- id: string;
167
166
  name: string;
167
+ id: string;
168
168
  input: Record<string, any>;
169
169
  cache_control?: {
170
170
  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";
@@ -238,7 +238,6 @@ export declare const MessageSchema: z.ZodObject<{
238
238
  } | undefined;
239
239
  }>]>, "many">]>;
240
240
  }, "strip", z.ZodTypeAny, {
241
- role: "user" | "assistant";
242
241
  content: string | ({
243
242
  type: "text";
244
243
  text: string;
@@ -247,15 +246,15 @@ export declare const MessageSchema: z.ZodObject<{
247
246
  } | undefined;
248
247
  } | {
249
248
  type: "tool_use";
250
- id: string;
251
249
  name: string;
250
+ id: string;
252
251
  input: Record<string, any>;
253
252
  cache_control?: {
254
253
  type: "ephemeral";
255
254
  } | undefined;
256
255
  } | {
257
- type: "tool_result";
258
256
  content: string;
257
+ type: "tool_result";
259
258
  tool_use_id: string;
260
259
  cache_control?: {
261
260
  type: "ephemeral";
@@ -271,8 +270,8 @@ export declare const MessageSchema: z.ZodObject<{
271
270
  type: "ephemeral";
272
271
  } | undefined;
273
272
  })[];
274
- }, {
275
273
  role: "user" | "assistant";
274
+ }, {
276
275
  content: string | ({
277
276
  type: "text";
278
277
  text: string;
@@ -281,15 +280,15 @@ export declare const MessageSchema: z.ZodObject<{
281
280
  } | undefined;
282
281
  } | {
283
282
  type: "tool_use";
284
- id: string;
285
283
  name: string;
284
+ id: string;
286
285
  input: Record<string, any>;
287
286
  cache_control?: {
288
287
  type: "ephemeral";
289
288
  } | undefined;
290
289
  } | {
291
- type: "tool_result";
292
290
  content: string;
291
+ type: "tool_result";
293
292
  tool_use_id: string;
294
293
  cache_control?: {
295
294
  type: "ephemeral";
@@ -305,6 +304,7 @@ export declare const MessageSchema: z.ZodObject<{
305
304
  type: "ephemeral";
306
305
  } | undefined;
307
306
  })[];
307
+ role: "user" | "assistant";
308
308
  }>;
309
309
  export type Message = z.infer<typeof MessageSchema>;
310
310
  export type MessageContentObject = z.infer<typeof MessageContentObjectSchema>;
@@ -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;
@@ -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"}