codebuff 1.0.165 → 1.0.167

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.
@@ -0,0 +1,311 @@
1
+ import { z } from 'zod';
2
+ declare const MessageContentObjectSchema: z.ZodUnion<[z.ZodObject<{
3
+ type: z.ZodLiteral<"text">;
4
+ text: z.ZodString;
5
+ cache_control: z.ZodOptional<z.ZodObject<{
6
+ type: z.ZodLiteral<"ephemeral">;
7
+ }, "strip", z.ZodTypeAny, {
8
+ type: "ephemeral";
9
+ }, {
10
+ type: "ephemeral";
11
+ }>>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ type: "text";
14
+ text: string;
15
+ cache_control?: {
16
+ type: "ephemeral";
17
+ } | undefined;
18
+ }, {
19
+ type: "text";
20
+ text: string;
21
+ cache_control?: {
22
+ type: "ephemeral";
23
+ } | undefined;
24
+ }>, z.ZodObject<{
25
+ type: z.ZodLiteral<"tool_use">;
26
+ id: z.ZodString;
27
+ name: z.ZodString;
28
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
29
+ cache_control: z.ZodOptional<z.ZodObject<{
30
+ type: z.ZodLiteral<"ephemeral">;
31
+ }, "strip", z.ZodTypeAny, {
32
+ type: "ephemeral";
33
+ }, {
34
+ type: "ephemeral";
35
+ }>>;
36
+ }, "strip", z.ZodTypeAny, {
37
+ type: "tool_use";
38
+ name: string;
39
+ id: string;
40
+ input: Record<string, any>;
41
+ cache_control?: {
42
+ type: "ephemeral";
43
+ } | undefined;
44
+ }, {
45
+ type: "tool_use";
46
+ name: string;
47
+ id: string;
48
+ input: Record<string, any>;
49
+ cache_control?: {
50
+ type: "ephemeral";
51
+ } | undefined;
52
+ }>, z.ZodObject<{
53
+ type: z.ZodLiteral<"tool_result">;
54
+ tool_use_id: z.ZodString;
55
+ content: z.ZodString;
56
+ cache_control: z.ZodOptional<z.ZodObject<{
57
+ type: z.ZodLiteral<"ephemeral">;
58
+ }, "strip", z.ZodTypeAny, {
59
+ type: "ephemeral";
60
+ }, {
61
+ type: "ephemeral";
62
+ }>>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ content: string;
65
+ type: "tool_result";
66
+ tool_use_id: string;
67
+ cache_control?: {
68
+ type: "ephemeral";
69
+ } | undefined;
70
+ }, {
71
+ content: string;
72
+ type: "tool_result";
73
+ tool_use_id: string;
74
+ cache_control?: {
75
+ type: "ephemeral";
76
+ } | undefined;
77
+ }>, z.ZodObject<{
78
+ type: z.ZodLiteral<"image">;
79
+ source: z.ZodObject<{
80
+ type: z.ZodLiteral<"base64">;
81
+ media_type: z.ZodLiteral<"image/jpeg">;
82
+ data: z.ZodString;
83
+ }, "strip", z.ZodTypeAny, {
84
+ type: "base64";
85
+ media_type: "image/jpeg";
86
+ data: string;
87
+ }, {
88
+ type: "base64";
89
+ media_type: "image/jpeg";
90
+ data: string;
91
+ }>;
92
+ cache_control: z.ZodOptional<z.ZodObject<{
93
+ type: z.ZodLiteral<"ephemeral">;
94
+ }, "strip", z.ZodTypeAny, {
95
+ type: "ephemeral";
96
+ }, {
97
+ type: "ephemeral";
98
+ }>>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ type: "image";
101
+ source: {
102
+ type: "base64";
103
+ media_type: "image/jpeg";
104
+ data: string;
105
+ };
106
+ cache_control?: {
107
+ type: "ephemeral";
108
+ } | undefined;
109
+ }, {
110
+ type: "image";
111
+ source: {
112
+ type: "base64";
113
+ media_type: "image/jpeg";
114
+ data: string;
115
+ };
116
+ cache_control?: {
117
+ type: "ephemeral";
118
+ } | undefined;
119
+ }>]>;
120
+ export declare const MessageSchema: z.ZodObject<{
121
+ role: z.ZodUnion<[z.ZodLiteral<"user">, z.ZodLiteral<"assistant">]>;
122
+ content: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
123
+ type: z.ZodLiteral<"text">;
124
+ text: z.ZodString;
125
+ cache_control: z.ZodOptional<z.ZodObject<{
126
+ type: z.ZodLiteral<"ephemeral">;
127
+ }, "strip", z.ZodTypeAny, {
128
+ type: "ephemeral";
129
+ }, {
130
+ type: "ephemeral";
131
+ }>>;
132
+ }, "strip", z.ZodTypeAny, {
133
+ type: "text";
134
+ text: string;
135
+ cache_control?: {
136
+ type: "ephemeral";
137
+ } | undefined;
138
+ }, {
139
+ type: "text";
140
+ text: string;
141
+ cache_control?: {
142
+ type: "ephemeral";
143
+ } | undefined;
144
+ }>, z.ZodObject<{
145
+ type: z.ZodLiteral<"tool_use">;
146
+ id: z.ZodString;
147
+ name: z.ZodString;
148
+ input: z.ZodRecord<z.ZodString, z.ZodAny>;
149
+ cache_control: z.ZodOptional<z.ZodObject<{
150
+ type: z.ZodLiteral<"ephemeral">;
151
+ }, "strip", z.ZodTypeAny, {
152
+ type: "ephemeral";
153
+ }, {
154
+ type: "ephemeral";
155
+ }>>;
156
+ }, "strip", z.ZodTypeAny, {
157
+ type: "tool_use";
158
+ name: string;
159
+ id: string;
160
+ input: Record<string, any>;
161
+ cache_control?: {
162
+ type: "ephemeral";
163
+ } | undefined;
164
+ }, {
165
+ type: "tool_use";
166
+ name: string;
167
+ id: string;
168
+ input: Record<string, any>;
169
+ cache_control?: {
170
+ type: "ephemeral";
171
+ } | undefined;
172
+ }>, z.ZodObject<{
173
+ type: z.ZodLiteral<"tool_result">;
174
+ tool_use_id: z.ZodString;
175
+ content: z.ZodString;
176
+ cache_control: z.ZodOptional<z.ZodObject<{
177
+ type: z.ZodLiteral<"ephemeral">;
178
+ }, "strip", z.ZodTypeAny, {
179
+ type: "ephemeral";
180
+ }, {
181
+ type: "ephemeral";
182
+ }>>;
183
+ }, "strip", z.ZodTypeAny, {
184
+ content: string;
185
+ type: "tool_result";
186
+ tool_use_id: string;
187
+ cache_control?: {
188
+ type: "ephemeral";
189
+ } | undefined;
190
+ }, {
191
+ content: string;
192
+ type: "tool_result";
193
+ tool_use_id: string;
194
+ cache_control?: {
195
+ type: "ephemeral";
196
+ } | undefined;
197
+ }>, z.ZodObject<{
198
+ type: z.ZodLiteral<"image">;
199
+ source: z.ZodObject<{
200
+ type: z.ZodLiteral<"base64">;
201
+ media_type: z.ZodLiteral<"image/jpeg">;
202
+ data: z.ZodString;
203
+ }, "strip", z.ZodTypeAny, {
204
+ type: "base64";
205
+ media_type: "image/jpeg";
206
+ data: string;
207
+ }, {
208
+ type: "base64";
209
+ media_type: "image/jpeg";
210
+ data: string;
211
+ }>;
212
+ cache_control: z.ZodOptional<z.ZodObject<{
213
+ type: z.ZodLiteral<"ephemeral">;
214
+ }, "strip", z.ZodTypeAny, {
215
+ type: "ephemeral";
216
+ }, {
217
+ type: "ephemeral";
218
+ }>>;
219
+ }, "strip", z.ZodTypeAny, {
220
+ type: "image";
221
+ source: {
222
+ type: "base64";
223
+ media_type: "image/jpeg";
224
+ data: string;
225
+ };
226
+ cache_control?: {
227
+ type: "ephemeral";
228
+ } | undefined;
229
+ }, {
230
+ type: "image";
231
+ source: {
232
+ type: "base64";
233
+ media_type: "image/jpeg";
234
+ data: string;
235
+ };
236
+ cache_control?: {
237
+ type: "ephemeral";
238
+ } | undefined;
239
+ }>]>, "many">]>;
240
+ }, "strip", z.ZodTypeAny, {
241
+ content: string | ({
242
+ type: "text";
243
+ text: string;
244
+ cache_control?: {
245
+ type: "ephemeral";
246
+ } | undefined;
247
+ } | {
248
+ type: "tool_use";
249
+ name: string;
250
+ id: string;
251
+ input: Record<string, any>;
252
+ cache_control?: {
253
+ type: "ephemeral";
254
+ } | undefined;
255
+ } | {
256
+ content: string;
257
+ type: "tool_result";
258
+ tool_use_id: string;
259
+ cache_control?: {
260
+ type: "ephemeral";
261
+ } | undefined;
262
+ } | {
263
+ type: "image";
264
+ source: {
265
+ type: "base64";
266
+ media_type: "image/jpeg";
267
+ data: string;
268
+ };
269
+ cache_control?: {
270
+ type: "ephemeral";
271
+ } | undefined;
272
+ })[];
273
+ role: "user" | "assistant";
274
+ }, {
275
+ content: string | ({
276
+ type: "text";
277
+ text: string;
278
+ cache_control?: {
279
+ type: "ephemeral";
280
+ } | undefined;
281
+ } | {
282
+ type: "tool_use";
283
+ name: string;
284
+ id: string;
285
+ input: Record<string, any>;
286
+ cache_control?: {
287
+ type: "ephemeral";
288
+ } | undefined;
289
+ } | {
290
+ content: string;
291
+ type: "tool_result";
292
+ tool_use_id: string;
293
+ cache_control?: {
294
+ type: "ephemeral";
295
+ } | undefined;
296
+ } | {
297
+ type: "image";
298
+ source: {
299
+ type: "base64";
300
+ media_type: "image/jpeg";
301
+ data: string;
302
+ };
303
+ cache_control?: {
304
+ type: "ephemeral";
305
+ } | undefined;
306
+ })[];
307
+ role: "user" | "assistant";
308
+ }>;
309
+ export type Message = z.infer<typeof MessageSchema>;
310
+ export type MessageContentObject = z.infer<typeof MessageContentObjectSchema>;
311
+ export {};
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MessageSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const MessageContentObjectSchema = zod_1.z.union([
6
+ zod_1.z.object({
7
+ type: zod_1.z.literal('text'),
8
+ text: zod_1.z.string(),
9
+ cache_control: zod_1.z
10
+ .object({
11
+ type: zod_1.z.literal('ephemeral'),
12
+ })
13
+ .optional(),
14
+ }),
15
+ zod_1.z.object({
16
+ type: zod_1.z.literal('tool_use'),
17
+ id: zod_1.z.string(),
18
+ name: zod_1.z.string(),
19
+ input: zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
20
+ cache_control: zod_1.z
21
+ .object({
22
+ type: zod_1.z.literal('ephemeral'),
23
+ })
24
+ .optional(),
25
+ }),
26
+ zod_1.z.object({
27
+ type: zod_1.z.literal('tool_result'),
28
+ tool_use_id: zod_1.z.string(),
29
+ content: zod_1.z.string(),
30
+ cache_control: zod_1.z
31
+ .object({
32
+ type: zod_1.z.literal('ephemeral'),
33
+ })
34
+ .optional(),
35
+ }),
36
+ zod_1.z.object({
37
+ type: zod_1.z.literal('image'),
38
+ source: zod_1.z.object({
39
+ type: zod_1.z.literal('base64'),
40
+ media_type: zod_1.z.literal('image/jpeg'),
41
+ data: zod_1.z.string(),
42
+ }),
43
+ cache_control: zod_1.z
44
+ .object({
45
+ type: zod_1.z.literal('ephemeral'),
46
+ })
47
+ .optional(),
48
+ }),
49
+ ]);
50
+ exports.MessageSchema = zod_1.z.object({
51
+ role: zod_1.z.union([zod_1.z.literal('user'), zod_1.z.literal('assistant')]),
52
+ content: zod_1.z.union([zod_1.z.string(), zod_1.z.array(MessageContentObjectSchema)]),
53
+ });
54
+ //# sourceMappingURL=message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/types/message.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEvB,MAAM,0BAA0B,GAAG,OAAC,CAAC,KAAK,CAAC;IACzC,OAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QACvB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;QAChB,aAAa,EAAE,OAAC;aACb,MAAM,CAAC;YACN,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,WAAW,CAAC;SAC7B,CAAC;aACD,QAAQ,EAAE;KACd,CAAC;IACF,OAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,UAAU,CAAC;QAC3B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;QACd,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;QAChB,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC;QACpC,aAAa,EAAE,OAAC;aACb,MAAM,CAAC;YACN,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,WAAW,CAAC;SAC7B,CAAC;aACD,QAAQ,EAAE;KACd,CAAC;IACF,OAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,aAAa,CAAC;QAC9B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;QACvB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;QACnB,aAAa,EAAE,OAAC;aACb,MAAM,CAAC;YACN,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,WAAW,CAAC;SAC7B,CAAC;aACD,QAAQ,EAAE;KACd,CAAC;IACF,OAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,OAAO,CAAC;QACxB,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;YACf,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;YACzB,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,YAAY,CAAC;YACnC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;SACjB,CAAC;QACF,aAAa,EAAE,OAAC;aACb,MAAM,CAAC;YACN,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,WAAW,CAAC;SAC7B,CAAC;aACD,QAAQ,EAAE;KACd,CAAC;CACH,CAAC,CAAA;AAEW,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,OAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1D,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,CAAC;CACpE,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ export type RawToolCall = {
2
+ name: string;
3
+ id: string;
4
+ parameters: Record<string, any>;
5
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/types/tools.ts"],"names":[],"mappings":""}
@@ -7,18 +7,18 @@ export declare const userSchema: z.ZodObject<{
7
7
  fingerprintId: z.ZodString;
8
8
  fingerprintHash: z.ZodString;
9
9
  }, "strip", z.ZodTypeAny, {
10
- id: string;
11
- name: string | null;
12
10
  email: string;
13
- authToken: string;
11
+ name: string | null;
12
+ id: string;
14
13
  fingerprintId: string;
14
+ authToken: string;
15
15
  fingerprintHash: string;
16
16
  }, {
17
- id: string;
18
- name: string | null;
19
17
  email: string;
20
- authToken: string;
18
+ name: string | null;
19
+ id: string;
21
20
  fingerprintId: string;
21
+ authToken: string;
22
22
  fingerprintHash: string;
23
23
  }>;
24
24
  export type User = z.infer<typeof userSchema>;