codebuff 1.0.168 → 1.0.169

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.
@@ -1,461 +0,0 @@
1
- import { z } from 'zod';
2
- import { ProjectFileContext } from '../util/file';
3
- export declare const ToolCallSchema: z.ZodObject<{
4
- name: z.ZodString;
5
- parameters: z.ZodRecord<z.ZodString, z.ZodString>;
6
- id: z.ZodString;
7
- }, "strip", z.ZodTypeAny, {
8
- id: string;
9
- name: string;
10
- parameters: Record<string, string>;
11
- }, {
12
- id: string;
13
- name: string;
14
- parameters: Record<string, string>;
15
- }>;
16
- export type ToolCall = z.infer<typeof ToolCallSchema>;
17
- export declare const ToolResultSchema: z.ZodObject<{
18
- name: z.ZodString;
19
- result: z.ZodString;
20
- id: z.ZodString;
21
- }, "strip", z.ZodTypeAny, {
22
- id: string;
23
- name: string;
24
- result: string;
25
- }, {
26
- id: string;
27
- name: string;
28
- result: string;
29
- }>;
30
- export type ToolResult = z.infer<typeof ToolResultSchema>;
31
- export declare const AgentStateSchema: z.ZodObject<{
32
- agentContext: z.ZodString;
33
- fileContext: z.ZodObject<{
34
- currentWorkingDirectory: z.ZodString;
35
- fileTree: z.ZodArray<z.ZodType<import("../util/file").FileTreeNode, z.ZodTypeDef, import("../util/file").FileTreeNode>, "many">;
36
- fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
37
- knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>;
38
- userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
39
- gitChanges: z.ZodObject<{
40
- status: z.ZodString;
41
- diff: z.ZodString;
42
- diffCached: z.ZodString;
43
- lastCommitMessages: z.ZodString;
44
- }, "strip", z.ZodTypeAny, {
45
- diff: string;
46
- status: string;
47
- diffCached: string;
48
- lastCommitMessages: string;
49
- }, {
50
- diff: string;
51
- status: string;
52
- diffCached: string;
53
- lastCommitMessages: string;
54
- }>;
55
- changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>;
56
- shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>;
57
- systemInfo: z.ZodObject<{
58
- platform: z.ZodString;
59
- shell: z.ZodString;
60
- nodeVersion: z.ZodString;
61
- arch: z.ZodString;
62
- homedir: z.ZodString;
63
- cpus: z.ZodNumber;
64
- }, "strip", z.ZodTypeAny, {
65
- platform: string;
66
- shell: string;
67
- nodeVersion: string;
68
- arch: string;
69
- homedir: string;
70
- cpus: number;
71
- }, {
72
- platform: string;
73
- shell: string;
74
- nodeVersion: string;
75
- arch: string;
76
- homedir: string;
77
- cpus: number;
78
- }>;
79
- fileVersions: z.ZodArray<z.ZodArray<z.ZodObject<{
80
- path: z.ZodString;
81
- content: z.ZodString;
82
- }, "strip", z.ZodTypeAny, {
83
- path: string;
84
- content: string;
85
- }, {
86
- path: string;
87
- content: string;
88
- }>, "many">, "many">;
89
- }, "strip", z.ZodTypeAny, {
90
- currentWorkingDirectory: string;
91
- fileTree: import("../util/file").FileTreeNode[];
92
- fileTokenScores: Record<string, Record<string, number>>;
93
- knowledgeFiles: Record<string, string>;
94
- gitChanges: {
95
- diff: string;
96
- status: string;
97
- diffCached: string;
98
- lastCommitMessages: string;
99
- };
100
- changesSinceLastChat: Record<string, string>;
101
- shellConfigFiles: Record<string, string>;
102
- systemInfo: {
103
- platform: string;
104
- shell: string;
105
- nodeVersion: string;
106
- arch: string;
107
- homedir: string;
108
- cpus: number;
109
- };
110
- fileVersions: {
111
- path: string;
112
- content: string;
113
- }[][];
114
- userKnowledgeFiles?: Record<string, string> | undefined;
115
- }, {
116
- currentWorkingDirectory: string;
117
- fileTree: import("../util/file").FileTreeNode[];
118
- fileTokenScores: Record<string, Record<string, number>>;
119
- knowledgeFiles: Record<string, string>;
120
- gitChanges: {
121
- diff: string;
122
- status: string;
123
- diffCached: string;
124
- lastCommitMessages: string;
125
- };
126
- changesSinceLastChat: Record<string, string>;
127
- shellConfigFiles: Record<string, string>;
128
- systemInfo: {
129
- platform: string;
130
- shell: string;
131
- nodeVersion: string;
132
- arch: string;
133
- homedir: string;
134
- cpus: number;
135
- };
136
- fileVersions: {
137
- path: string;
138
- content: string;
139
- }[][];
140
- userKnowledgeFiles?: Record<string, string> | undefined;
141
- }>;
142
- messageHistory: z.ZodArray<z.ZodObject<{
143
- role: z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
144
- content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
145
- type: z.ZodLiteral<"text">;
146
- text: z.ZodString;
147
- cache_control: z.ZodOptional<z.ZodObject<{
148
- type: z.ZodLiteral<"ephemeral">;
149
- }, "strip", z.ZodTypeAny, {
150
- type: "ephemeral";
151
- }, {
152
- type: "ephemeral";
153
- }>>;
154
- }, "strip", z.ZodTypeAny, {
155
- type: "text";
156
- text: string;
157
- cache_control?: {
158
- type: "ephemeral";
159
- } | undefined;
160
- }, {
161
- type: "text";
162
- text: string;
163
- cache_control?: {
164
- type: "ephemeral";
165
- } | undefined;
166
- }>, z.ZodObject<{
167
- type: z.ZodLiteral<"tool_use">;
168
- id: z.ZodString;
169
- name: z.ZodString;
170
- input: z.ZodRecord<z.ZodString, z.ZodAny>;
171
- cache_control: z.ZodOptional<z.ZodObject<{
172
- type: z.ZodLiteral<"ephemeral">;
173
- }, "strip", z.ZodTypeAny, {
174
- type: "ephemeral";
175
- }, {
176
- type: "ephemeral";
177
- }>>;
178
- }, "strip", z.ZodTypeAny, {
179
- type: "tool_use";
180
- id: string;
181
- name: string;
182
- input: Record<string, any>;
183
- cache_control?: {
184
- type: "ephemeral";
185
- } | undefined;
186
- }, {
187
- type: "tool_use";
188
- id: string;
189
- name: string;
190
- input: Record<string, any>;
191
- cache_control?: {
192
- type: "ephemeral";
193
- } | undefined;
194
- }>, z.ZodObject<{
195
- type: z.ZodLiteral<"tool_result">;
196
- tool_use_id: z.ZodString;
197
- content: z.ZodString;
198
- cache_control: z.ZodOptional<z.ZodObject<{
199
- type: z.ZodLiteral<"ephemeral">;
200
- }, "strip", z.ZodTypeAny, {
201
- type: "ephemeral";
202
- }, {
203
- type: "ephemeral";
204
- }>>;
205
- }, "strip", z.ZodTypeAny, {
206
- type: "tool_result";
207
- content: string;
208
- tool_use_id: string;
209
- cache_control?: {
210
- type: "ephemeral";
211
- } | undefined;
212
- }, {
213
- type: "tool_result";
214
- content: string;
215
- tool_use_id: string;
216
- cache_control?: {
217
- type: "ephemeral";
218
- } | undefined;
219
- }>, z.ZodObject<{
220
- type: z.ZodLiteral<"image">;
221
- source: z.ZodObject<{
222
- type: z.ZodLiteral<"base64">;
223
- media_type: z.ZodLiteral<"image/jpeg">;
224
- data: z.ZodString;
225
- }, "strip", z.ZodTypeAny, {
226
- type: "base64";
227
- media_type: "image/jpeg";
228
- data: string;
229
- }, {
230
- type: "base64";
231
- media_type: "image/jpeg";
232
- data: string;
233
- }>;
234
- cache_control: z.ZodOptional<z.ZodObject<{
235
- type: z.ZodLiteral<"ephemeral">;
236
- }, "strip", z.ZodTypeAny, {
237
- type: "ephemeral";
238
- }, {
239
- type: "ephemeral";
240
- }>>;
241
- }, "strip", z.ZodTypeAny, {
242
- type: "image";
243
- source: {
244
- type: "base64";
245
- media_type: "image/jpeg";
246
- data: string;
247
- };
248
- cache_control?: {
249
- type: "ephemeral";
250
- } | undefined;
251
- }, {
252
- type: "image";
253
- source: {
254
- type: "base64";
255
- media_type: "image/jpeg";
256
- data: string;
257
- };
258
- cache_control?: {
259
- type: "ephemeral";
260
- } | undefined;
261
- }>]>, "many">]>;
262
- }, "strip", z.ZodTypeAny, {
263
- role: "user" | "assistant";
264
- content: string | ({
265
- type: "text";
266
- text: string;
267
- cache_control?: {
268
- type: "ephemeral";
269
- } | undefined;
270
- } | {
271
- type: "tool_use";
272
- id: string;
273
- name: string;
274
- input: Record<string, any>;
275
- cache_control?: {
276
- type: "ephemeral";
277
- } | undefined;
278
- } | {
279
- type: "tool_result";
280
- content: string;
281
- tool_use_id: string;
282
- cache_control?: {
283
- type: "ephemeral";
284
- } | undefined;
285
- } | {
286
- type: "image";
287
- source: {
288
- type: "base64";
289
- media_type: "image/jpeg";
290
- data: string;
291
- };
292
- cache_control?: {
293
- type: "ephemeral";
294
- } | undefined;
295
- })[];
296
- }, {
297
- role: "user" | "assistant";
298
- content: string | ({
299
- type: "text";
300
- text: string;
301
- cache_control?: {
302
- type: "ephemeral";
303
- } | undefined;
304
- } | {
305
- type: "tool_use";
306
- id: string;
307
- name: string;
308
- input: Record<string, any>;
309
- cache_control?: {
310
- type: "ephemeral";
311
- } | undefined;
312
- } | {
313
- type: "tool_result";
314
- content: string;
315
- tool_use_id: string;
316
- cache_control?: {
317
- type: "ephemeral";
318
- } | undefined;
319
- } | {
320
- type: "image";
321
- source: {
322
- type: "base64";
323
- media_type: "image/jpeg";
324
- data: string;
325
- };
326
- cache_control?: {
327
- type: "ephemeral";
328
- } | undefined;
329
- })[];
330
- }>, "many">;
331
- }, "strip", z.ZodTypeAny, {
332
- agentContext: string;
333
- fileContext: {
334
- currentWorkingDirectory: string;
335
- fileTree: import("../util/file").FileTreeNode[];
336
- fileTokenScores: Record<string, Record<string, number>>;
337
- knowledgeFiles: Record<string, string>;
338
- gitChanges: {
339
- diff: string;
340
- status: string;
341
- diffCached: string;
342
- lastCommitMessages: string;
343
- };
344
- changesSinceLastChat: Record<string, string>;
345
- shellConfigFiles: Record<string, string>;
346
- systemInfo: {
347
- platform: string;
348
- shell: string;
349
- nodeVersion: string;
350
- arch: string;
351
- homedir: string;
352
- cpus: number;
353
- };
354
- fileVersions: {
355
- path: string;
356
- content: string;
357
- }[][];
358
- userKnowledgeFiles?: Record<string, string> | undefined;
359
- };
360
- messageHistory: {
361
- role: "user" | "assistant";
362
- content: string | ({
363
- type: "text";
364
- text: string;
365
- cache_control?: {
366
- type: "ephemeral";
367
- } | undefined;
368
- } | {
369
- type: "tool_use";
370
- id: string;
371
- name: string;
372
- input: Record<string, any>;
373
- cache_control?: {
374
- type: "ephemeral";
375
- } | undefined;
376
- } | {
377
- type: "tool_result";
378
- content: string;
379
- tool_use_id: string;
380
- cache_control?: {
381
- type: "ephemeral";
382
- } | undefined;
383
- } | {
384
- type: "image";
385
- source: {
386
- type: "base64";
387
- media_type: "image/jpeg";
388
- data: string;
389
- };
390
- cache_control?: {
391
- type: "ephemeral";
392
- } | undefined;
393
- })[];
394
- }[];
395
- }, {
396
- agentContext: string;
397
- fileContext: {
398
- currentWorkingDirectory: string;
399
- fileTree: import("../util/file").FileTreeNode[];
400
- fileTokenScores: Record<string, Record<string, number>>;
401
- knowledgeFiles: Record<string, string>;
402
- gitChanges: {
403
- diff: string;
404
- status: string;
405
- diffCached: string;
406
- lastCommitMessages: string;
407
- };
408
- changesSinceLastChat: Record<string, string>;
409
- shellConfigFiles: Record<string, string>;
410
- systemInfo: {
411
- platform: string;
412
- shell: string;
413
- nodeVersion: string;
414
- arch: string;
415
- homedir: string;
416
- cpus: number;
417
- };
418
- fileVersions: {
419
- path: string;
420
- content: string;
421
- }[][];
422
- userKnowledgeFiles?: Record<string, string> | undefined;
423
- };
424
- messageHistory: {
425
- role: "user" | "assistant";
426
- content: string | ({
427
- type: "text";
428
- text: string;
429
- cache_control?: {
430
- type: "ephemeral";
431
- } | undefined;
432
- } | {
433
- type: "tool_use";
434
- id: string;
435
- name: string;
436
- input: Record<string, any>;
437
- cache_control?: {
438
- type: "ephemeral";
439
- } | undefined;
440
- } | {
441
- type: "tool_result";
442
- content: string;
443
- tool_use_id: string;
444
- cache_control?: {
445
- type: "ephemeral";
446
- } | undefined;
447
- } | {
448
- type: "image";
449
- source: {
450
- type: "base64";
451
- media_type: "image/jpeg";
452
- data: string;
453
- };
454
- cache_control?: {
455
- type: "ephemeral";
456
- } | undefined;
457
- })[];
458
- }[];
459
- }>;
460
- export type AgentState = z.infer<typeof AgentStateSchema>;
461
- export declare function getInitialAgentState(fileContext: ProjectFileContext): AgentState;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AgentStateSchema = exports.ToolResultSchema = exports.ToolCallSchema = void 0;
4
- exports.getInitialAgentState = getInitialAgentState;
5
- const zod_1 = require("zod");
6
- const file_1 = require("../util/file");
7
- const message_1 = require("./message");
8
- exports.ToolCallSchema = zod_1.z.object({
9
- name: zod_1.z.string(),
10
- parameters: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
11
- id: zod_1.z.string(),
12
- });
13
- exports.ToolResultSchema = zod_1.z.object({
14
- name: zod_1.z.string(),
15
- result: zod_1.z.string(),
16
- id: zod_1.z.string(),
17
- });
18
- exports.AgentStateSchema = zod_1.z.object({
19
- agentContext: zod_1.z.string(),
20
- fileContext: file_1.ProjectFileContextSchema,
21
- messageHistory: zod_1.z.array(message_1.MessageSchema),
22
- });
23
- function getInitialAgentState(fileContext) {
24
- return {
25
- agentContext: '',
26
- messageHistory: [],
27
- fileContext,
28
- };
29
- }
30
- //# sourceMappingURL=agent-state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-state.js","sourceRoot":"","sources":["../../src/types/agent-state.ts"],"names":[],"mappings":";;;AAwBA,oDAQC;AAhCD,6BAAuB;AACvB,uCAA2E;AAC3E,uCAAyC;AAE5B,QAAA,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC;IAC5C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAA;AAEW,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAA;AAGW,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;IACxB,WAAW,EAAE,+BAAwB;IACrC,cAAc,EAAE,OAAC,CAAC,KAAK,CAAC,uBAAa,CAAC;CACvC,CAAC,CAAA;AAGF,SAAgB,oBAAoB,CAClC,WAA+B;IAE/B,OAAO;QACL,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,EAAE;QAClB,WAAW;KACZ,CAAA;AACH,CAAC"}