codebuff 1.0.173 → 1.0.174
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/dist/checkpoint-file-manager.d.ts +14 -3
- package/dist/checkpoint-file-manager.js +65 -41
- package/dist/checkpoint-file-manager.js.map +1 -1
- package/dist/checkpoints.d.ts +2 -0
- package/dist/checkpoints.js +15 -2
- package/dist/checkpoints.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +6 -1
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +12 -12
- package/dist/common/actions.d.ts +168 -168
- package/dist/common/constants.d.ts +3 -3
- package/dist/common/constants.js +1 -8
- package/dist/common/constants.js.map +1 -1
- package/dist/common/types/agent-state.d.ts +34 -34
- package/dist/common/types/message.d.ts +24 -24
- package/dist/common/websockets/websocket-schema.d.ts +451 -451
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/worker-script-project-context.js +5 -1
- package/dist/worker-script-project-context.js.map +1 -1
- package/package.json +1 -1
|
@@ -29,9 +29,9 @@ export declare const PLAN_CONFIGS: Record<UsageLimits, PlanConfig>;
|
|
|
29
29
|
export declare const CREDITS_USAGE_LIMITS: Record<UsageLimits, number>;
|
|
30
30
|
export declare const costModes: readonly ["lite", "normal", "max"];
|
|
31
31
|
export type CostMode = (typeof costModes)[number];
|
|
32
|
-
export declare const getModelForMode: (costMode: CostMode, operation: "agent" | "file-requests" | "check-new-files") => "claude-3-
|
|
32
|
+
export declare const getModelForMode: (costMode: CostMode, operation: "agent" | "file-requests" | "check-new-files") => "claude-3-5-sonnet-20241022" | "claude-3-5-haiku-20241022" | "gpt-4o-2024-08-06" | "gpt-4o-mini-2024-07-18";
|
|
33
33
|
export declare const claudeModels: {
|
|
34
|
-
readonly sonnet: "claude-3-
|
|
34
|
+
readonly sonnet: "claude-3-5-sonnet-20241022";
|
|
35
35
|
readonly haiku: "claude-3-5-haiku-20241022";
|
|
36
36
|
};
|
|
37
37
|
export type AnthropicModel = (typeof claudeModels)[keyof typeof claudeModels];
|
|
@@ -59,7 +59,7 @@ export declare const models: {
|
|
|
59
59
|
readonly gpt4omini: "gpt-4o-mini-2024-07-18";
|
|
60
60
|
readonly o3mini: "o3-mini-2025-01-31";
|
|
61
61
|
readonly generatePatch: "ft:gpt-4o-2024-08-06:manifold-markets:generate-patch-batch2:AKYtDIhk";
|
|
62
|
-
readonly sonnet: "claude-3-
|
|
62
|
+
readonly sonnet: "claude-3-5-sonnet-20241022";
|
|
63
63
|
readonly haiku: "claude-3-5-haiku-20241022";
|
|
64
64
|
};
|
|
65
65
|
export type Model = (typeof models)[keyof typeof models];
|
package/dist/common/constants.js
CHANGED
|
@@ -76,12 +76,10 @@ exports.BILLING_PERIOD_DAYS = 30;
|
|
|
76
76
|
exports.OVERAGE_RATE_PRO = 0.99;
|
|
77
77
|
exports.OVERAGE_RATE_MOAR_PRO = 0.9;
|
|
78
78
|
exports.CREDITS_REFERRAL_BONUS = 500;
|
|
79
|
-
// Helper to convert from UsageLimits to display names
|
|
80
79
|
const getPlanDisplayName = (limit) => {
|
|
81
80
|
return exports.PLAN_CONFIGS[limit].displayName;
|
|
82
81
|
};
|
|
83
82
|
exports.getPlanDisplayName = getPlanDisplayName;
|
|
84
|
-
// Helper to convert from display name to UsageLimits
|
|
85
83
|
const getUsageLimitFromPlanName = (planName) => {
|
|
86
84
|
const entry = Object.entries(exports.PLAN_CONFIGS).find(([_, config]) => config.planName === planName);
|
|
87
85
|
if (!entry) {
|
|
@@ -96,7 +94,6 @@ exports.UsageLimits = {
|
|
|
96
94
|
PRO: 'PRO',
|
|
97
95
|
MOAR_PRO: 'MOAR_PRO',
|
|
98
96
|
};
|
|
99
|
-
// Define base configs with production values
|
|
100
97
|
exports.PLAN_CONFIGS = {
|
|
101
98
|
ANON: {
|
|
102
99
|
limit: 250,
|
|
@@ -127,16 +124,13 @@ exports.PLAN_CONFIGS = {
|
|
|
127
124
|
overageRate: exports.OVERAGE_RATE_MOAR_PRO,
|
|
128
125
|
},
|
|
129
126
|
};
|
|
130
|
-
// Increase limits by 1000 in local environment to make testing easier
|
|
131
127
|
if (process.env.NEXT_PUBLIC_ENVIRONMENT === 'local') {
|
|
132
128
|
Object.values(exports.PLAN_CONFIGS).forEach((config) => {
|
|
133
129
|
config.limit *= 1000;
|
|
134
130
|
});
|
|
135
131
|
}
|
|
136
|
-
// Helper to get credits limit from a plan config
|
|
137
132
|
exports.CREDITS_USAGE_LIMITS = Object.fromEntries(Object.entries(exports.PLAN_CONFIGS).map(([key, config]) => [key, config.limit]));
|
|
138
133
|
exports.costModes = ['lite', 'normal', 'max'];
|
|
139
|
-
// NOTE: This function not kept up to date.
|
|
140
134
|
const getModelForMode = (costMode, operation) => {
|
|
141
135
|
if (operation === 'agent') {
|
|
142
136
|
return costMode === 'lite' ? exports.claudeModels.haiku : exports.claudeModels.sonnet;
|
|
@@ -151,8 +145,7 @@ const getModelForMode = (costMode, operation) => {
|
|
|
151
145
|
};
|
|
152
146
|
exports.getModelForMode = getModelForMode;
|
|
153
147
|
exports.claudeModels = {
|
|
154
|
-
sonnet: 'claude-3-
|
|
155
|
-
// sonnet: 'claude-3-5-sonnet-20241022',
|
|
148
|
+
sonnet: 'claude-3-5-sonnet-20241022',
|
|
156
149
|
haiku: 'claude-3-5-haiku-20241022',
|
|
157
150
|
};
|
|
158
151
|
exports.openaiModels = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,GAAG,GAAG,MAAM,CAAA;AAC1B,QAAA,iBAAiB,GAAG,GAAG,GAAG,oBAAoB,CAAA;AAC9C,QAAA,oBAAoB,GAAG,oCAAoC,CAAA;AAE3D,QAAA,qBAAqB,GAAG;IACnC,MAAM;IACN,MAAM;IACN,QAAQ;IACR,KAAK;IACL,KAAK;IACL,SAAS;IACT,cAAc;IACd,MAAM;IACN,YAAY;IACZ,OAAO;IACP,aAAa;IACb,aAAa;IACb,aAAa;IACb,OAAO;IACP,WAAW;IACX,eAAe;IACf,aAAa;IACb,aAAa;IACb,OAAO;IACP,mBAAmB;IACnB,WAAW;CACZ,CAAA;AAEY,QAAA,yBAAyB,GAAG;IACvC,UAAU;IACV,MAAM;IACN,MAAM;IACN,SAAS;IACT,IAAI;IACJ,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,KAAK;IACL,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;IACP,KAAK;IACL,OAAO;IACP,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;IACL,KAAK;IACL,MAAM;IACN,MAAM;IACN,QAAQ;IACR,OAAO;IACP,MAAM;IACN,IAAI;IACJ,OAAO;IACP,SAAS;IACT,OAAO;IACP,IAAI;CACL,CAAA;AAEY,QAAA,6BAA6B,GAAG,CAAC,CAAA;AACjC,QAAA,QAAQ,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,CAAA;AACnC,QAAA,mBAAmB,GAAG,EAAE,CAAA;AACxB,QAAA,gBAAgB,GAAG,IAAI,CAAA;AACvB,QAAA,qBAAqB,GAAG,GAAG,CAAA;AAC3B,QAAA,sBAAsB,GAAG,GAAG,CAAA;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,GAAG,GAAG,MAAM,CAAA;AAC1B,QAAA,iBAAiB,GAAG,GAAG,GAAG,oBAAoB,CAAA;AAC9C,QAAA,oBAAoB,GAAG,oCAAoC,CAAA;AAE3D,QAAA,qBAAqB,GAAG;IACnC,MAAM;IACN,MAAM;IACN,QAAQ;IACR,KAAK;IACL,KAAK;IACL,SAAS;IACT,cAAc;IACd,MAAM;IAC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,sEAAsE;CAChE,CAAA;AAGG,QAAA,YAAY,GAAG;IAC1B,YAAY,EAAE,sBAAsB;CAC5B,CAAA;AAGG,QAAA,cAAc,GAAG;IAC5B,YAAY,EAAE,eAAe;IAC7B,gBAAgB,EAAE,mBAAmB;CAC7B,CAAA;AAGG,QAAA,MAAM,GAAG;IACpB,GAAG,oBAAY;IACf,GAAG,oBAAY;IACf,GAAG,oBAAY;IACf,GAAG,sBAAc;CACT,CAAA;AAIG,QAAA,YAAY,GAAG,cAAc,CAAA"}
|
|
@@ -5,12 +5,12 @@ export declare const ToolCallSchema: z.ZodObject<{
|
|
|
5
5
|
parameters: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
6
6
|
id: z.ZodString;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
name: string;
|
|
9
8
|
id: string;
|
|
9
|
+
name: string;
|
|
10
10
|
parameters: Record<string, string>;
|
|
11
11
|
}, {
|
|
12
|
-
name: string;
|
|
13
12
|
id: string;
|
|
13
|
+
name: string;
|
|
14
14
|
parameters: Record<string, string>;
|
|
15
15
|
}>;
|
|
16
16
|
export type ToolCall = z.infer<typeof ToolCallSchema>;
|
|
@@ -19,12 +19,12 @@ export declare const ToolResultSchema: z.ZodObject<{
|
|
|
19
19
|
result: z.ZodString;
|
|
20
20
|
id: z.ZodString;
|
|
21
21
|
}, "strip", z.ZodTypeAny, {
|
|
22
|
-
name: string;
|
|
23
22
|
id: string;
|
|
23
|
+
name: string;
|
|
24
24
|
result: string;
|
|
25
25
|
}, {
|
|
26
|
-
name: string;
|
|
27
26
|
id: string;
|
|
27
|
+
name: string;
|
|
28
28
|
result: string;
|
|
29
29
|
}>;
|
|
30
30
|
export type ToolResult = z.infer<typeof ToolResultSchema>;
|
|
@@ -42,13 +42,13 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
42
42
|
diffCached: z.ZodString;
|
|
43
43
|
lastCommitMessages: z.ZodString;
|
|
44
44
|
}, "strip", z.ZodTypeAny, {
|
|
45
|
-
status: string;
|
|
46
45
|
diff: string;
|
|
46
|
+
status: string;
|
|
47
47
|
diffCached: string;
|
|
48
48
|
lastCommitMessages: string;
|
|
49
49
|
}, {
|
|
50
|
-
status: string;
|
|
51
50
|
diff: string;
|
|
51
|
+
status: string;
|
|
52
52
|
diffCached: string;
|
|
53
53
|
lastCommitMessages: string;
|
|
54
54
|
}>;
|
|
@@ -92,8 +92,8 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
92
92
|
fileTokenScores: Record<string, Record<string, number>>;
|
|
93
93
|
knowledgeFiles: Record<string, string>;
|
|
94
94
|
gitChanges: {
|
|
95
|
-
status: string;
|
|
96
95
|
diff: string;
|
|
96
|
+
status: string;
|
|
97
97
|
diffCached: string;
|
|
98
98
|
lastCommitMessages: string;
|
|
99
99
|
};
|
|
@@ -118,8 +118,8 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
118
118
|
fileTokenScores: Record<string, Record<string, number>>;
|
|
119
119
|
knowledgeFiles: Record<string, string>;
|
|
120
120
|
gitChanges: {
|
|
121
|
-
status: string;
|
|
122
121
|
diff: string;
|
|
122
|
+
status: string;
|
|
123
123
|
diffCached: string;
|
|
124
124
|
lastCommitMessages: string;
|
|
125
125
|
};
|
|
@@ -152,14 +152,14 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
152
152
|
type: "ephemeral";
|
|
153
153
|
}>>;
|
|
154
154
|
}, "strip", z.ZodTypeAny, {
|
|
155
|
-
text: string;
|
|
156
155
|
type: "text";
|
|
156
|
+
text: string;
|
|
157
157
|
cache_control?: {
|
|
158
158
|
type: "ephemeral";
|
|
159
159
|
} | undefined;
|
|
160
160
|
}, {
|
|
161
|
-
text: string;
|
|
162
161
|
type: "text";
|
|
162
|
+
text: string;
|
|
163
163
|
cache_control?: {
|
|
164
164
|
type: "ephemeral";
|
|
165
165
|
} | undefined;
|
|
@@ -177,16 +177,16 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
177
177
|
}>>;
|
|
178
178
|
}, "strip", z.ZodTypeAny, {
|
|
179
179
|
type: "tool_use";
|
|
180
|
-
name: string;
|
|
181
180
|
id: string;
|
|
181
|
+
name: string;
|
|
182
182
|
input: Record<string, any>;
|
|
183
183
|
cache_control?: {
|
|
184
184
|
type: "ephemeral";
|
|
185
185
|
} | undefined;
|
|
186
186
|
}, {
|
|
187
187
|
type: "tool_use";
|
|
188
|
-
name: string;
|
|
189
188
|
id: string;
|
|
189
|
+
name: string;
|
|
190
190
|
input: Record<string, any>;
|
|
191
191
|
cache_control?: {
|
|
192
192
|
type: "ephemeral";
|
|
@@ -223,13 +223,13 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
223
223
|
media_type: z.ZodLiteral<"image/jpeg">;
|
|
224
224
|
data: z.ZodString;
|
|
225
225
|
}, "strip", z.ZodTypeAny, {
|
|
226
|
-
data: string;
|
|
227
226
|
type: "base64";
|
|
228
227
|
media_type: "image/jpeg";
|
|
229
|
-
}, {
|
|
230
228
|
data: string;
|
|
229
|
+
}, {
|
|
231
230
|
type: "base64";
|
|
232
231
|
media_type: "image/jpeg";
|
|
232
|
+
data: string;
|
|
233
233
|
}>;
|
|
234
234
|
cache_control: z.ZodOptional<z.ZodObject<{
|
|
235
235
|
type: z.ZodLiteral<"ephemeral">;
|
|
@@ -241,9 +241,9 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
241
241
|
}, "strip", z.ZodTypeAny, {
|
|
242
242
|
type: "image";
|
|
243
243
|
source: {
|
|
244
|
-
data: string;
|
|
245
244
|
type: "base64";
|
|
246
245
|
media_type: "image/jpeg";
|
|
246
|
+
data: string;
|
|
247
247
|
};
|
|
248
248
|
cache_control?: {
|
|
249
249
|
type: "ephemeral";
|
|
@@ -251,25 +251,26 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
251
251
|
}, {
|
|
252
252
|
type: "image";
|
|
253
253
|
source: {
|
|
254
|
-
data: string;
|
|
255
254
|
type: "base64";
|
|
256
255
|
media_type: "image/jpeg";
|
|
256
|
+
data: string;
|
|
257
257
|
};
|
|
258
258
|
cache_control?: {
|
|
259
259
|
type: "ephemeral";
|
|
260
260
|
} | undefined;
|
|
261
261
|
}>]>, "many">]>;
|
|
262
262
|
}, "strip", z.ZodTypeAny, {
|
|
263
|
+
role: "user" | "assistant";
|
|
263
264
|
content: string | ({
|
|
264
|
-
text: string;
|
|
265
265
|
type: "text";
|
|
266
|
+
text: string;
|
|
266
267
|
cache_control?: {
|
|
267
268
|
type: "ephemeral";
|
|
268
269
|
} | undefined;
|
|
269
270
|
} | {
|
|
270
271
|
type: "tool_use";
|
|
271
|
-
name: string;
|
|
272
272
|
id: string;
|
|
273
|
+
name: string;
|
|
273
274
|
input: Record<string, any>;
|
|
274
275
|
cache_control?: {
|
|
275
276
|
type: "ephemeral";
|
|
@@ -284,26 +285,26 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
284
285
|
} | {
|
|
285
286
|
type: "image";
|
|
286
287
|
source: {
|
|
287
|
-
data: string;
|
|
288
288
|
type: "base64";
|
|
289
289
|
media_type: "image/jpeg";
|
|
290
|
+
data: string;
|
|
290
291
|
};
|
|
291
292
|
cache_control?: {
|
|
292
293
|
type: "ephemeral";
|
|
293
294
|
} | undefined;
|
|
294
295
|
})[];
|
|
295
|
-
role: "user" | "assistant";
|
|
296
296
|
}, {
|
|
297
|
+
role: "user" | "assistant";
|
|
297
298
|
content: string | ({
|
|
298
|
-
text: string;
|
|
299
299
|
type: "text";
|
|
300
|
+
text: string;
|
|
300
301
|
cache_control?: {
|
|
301
302
|
type: "ephemeral";
|
|
302
303
|
} | undefined;
|
|
303
304
|
} | {
|
|
304
305
|
type: "tool_use";
|
|
305
|
-
name: string;
|
|
306
306
|
id: string;
|
|
307
|
+
name: string;
|
|
307
308
|
input: Record<string, any>;
|
|
308
309
|
cache_control?: {
|
|
309
310
|
type: "ephemeral";
|
|
@@ -318,15 +319,14 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
318
319
|
} | {
|
|
319
320
|
type: "image";
|
|
320
321
|
source: {
|
|
321
|
-
data: string;
|
|
322
322
|
type: "base64";
|
|
323
323
|
media_type: "image/jpeg";
|
|
324
|
+
data: string;
|
|
324
325
|
};
|
|
325
326
|
cache_control?: {
|
|
326
327
|
type: "ephemeral";
|
|
327
328
|
} | undefined;
|
|
328
329
|
})[];
|
|
329
|
-
role: "user" | "assistant";
|
|
330
330
|
}>, "many">;
|
|
331
331
|
}, "strip", z.ZodTypeAny, {
|
|
332
332
|
agentContext: string;
|
|
@@ -336,8 +336,8 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
336
336
|
fileTokenScores: Record<string, Record<string, number>>;
|
|
337
337
|
knowledgeFiles: Record<string, string>;
|
|
338
338
|
gitChanges: {
|
|
339
|
-
status: string;
|
|
340
339
|
diff: string;
|
|
340
|
+
status: string;
|
|
341
341
|
diffCached: string;
|
|
342
342
|
lastCommitMessages: string;
|
|
343
343
|
};
|
|
@@ -358,16 +358,17 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
358
358
|
userKnowledgeFiles?: Record<string, string> | undefined;
|
|
359
359
|
};
|
|
360
360
|
messageHistory: {
|
|
361
|
+
role: "user" | "assistant";
|
|
361
362
|
content: string | ({
|
|
362
|
-
text: string;
|
|
363
363
|
type: "text";
|
|
364
|
+
text: string;
|
|
364
365
|
cache_control?: {
|
|
365
366
|
type: "ephemeral";
|
|
366
367
|
} | undefined;
|
|
367
368
|
} | {
|
|
368
369
|
type: "tool_use";
|
|
369
|
-
name: string;
|
|
370
370
|
id: string;
|
|
371
|
+
name: string;
|
|
371
372
|
input: Record<string, any>;
|
|
372
373
|
cache_control?: {
|
|
373
374
|
type: "ephemeral";
|
|
@@ -382,15 +383,14 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
382
383
|
} | {
|
|
383
384
|
type: "image";
|
|
384
385
|
source: {
|
|
385
|
-
data: string;
|
|
386
386
|
type: "base64";
|
|
387
387
|
media_type: "image/jpeg";
|
|
388
|
+
data: string;
|
|
388
389
|
};
|
|
389
390
|
cache_control?: {
|
|
390
391
|
type: "ephemeral";
|
|
391
392
|
} | undefined;
|
|
392
393
|
})[];
|
|
393
|
-
role: "user" | "assistant";
|
|
394
394
|
}[];
|
|
395
395
|
}, {
|
|
396
396
|
agentContext: string;
|
|
@@ -400,8 +400,8 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
400
400
|
fileTokenScores: Record<string, Record<string, number>>;
|
|
401
401
|
knowledgeFiles: Record<string, string>;
|
|
402
402
|
gitChanges: {
|
|
403
|
-
status: string;
|
|
404
403
|
diff: string;
|
|
404
|
+
status: string;
|
|
405
405
|
diffCached: string;
|
|
406
406
|
lastCommitMessages: string;
|
|
407
407
|
};
|
|
@@ -422,16 +422,17 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
422
422
|
userKnowledgeFiles?: Record<string, string> | undefined;
|
|
423
423
|
};
|
|
424
424
|
messageHistory: {
|
|
425
|
+
role: "user" | "assistant";
|
|
425
426
|
content: string | ({
|
|
426
|
-
text: string;
|
|
427
427
|
type: "text";
|
|
428
|
+
text: string;
|
|
428
429
|
cache_control?: {
|
|
429
430
|
type: "ephemeral";
|
|
430
431
|
} | undefined;
|
|
431
432
|
} | {
|
|
432
433
|
type: "tool_use";
|
|
433
|
-
name: string;
|
|
434
434
|
id: string;
|
|
435
|
+
name: string;
|
|
435
436
|
input: Record<string, any>;
|
|
436
437
|
cache_control?: {
|
|
437
438
|
type: "ephemeral";
|
|
@@ -446,15 +447,14 @@ export declare const AgentStateSchema: z.ZodObject<{
|
|
|
446
447
|
} | {
|
|
447
448
|
type: "image";
|
|
448
449
|
source: {
|
|
449
|
-
data: string;
|
|
450
450
|
type: "base64";
|
|
451
451
|
media_type: "image/jpeg";
|
|
452
|
+
data: string;
|
|
452
453
|
};
|
|
453
454
|
cache_control?: {
|
|
454
455
|
type: "ephemeral";
|
|
455
456
|
} | undefined;
|
|
456
457
|
})[];
|
|
457
|
-
role: "user" | "assistant";
|
|
458
458
|
}[];
|
|
459
459
|
}>;
|
|
460
460
|
export type AgentState = z.infer<typeof AgentStateSchema>;
|
|
@@ -10,14 +10,14 @@ declare const MessageContentObjectSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
10
10
|
type: "ephemeral";
|
|
11
11
|
}>>;
|
|
12
12
|
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
text: string;
|
|
14
13
|
type: "text";
|
|
14
|
+
text: string;
|
|
15
15
|
cache_control?: {
|
|
16
16
|
type: "ephemeral";
|
|
17
17
|
} | undefined;
|
|
18
18
|
}, {
|
|
19
|
-
text: string;
|
|
20
19
|
type: "text";
|
|
20
|
+
text: string;
|
|
21
21
|
cache_control?: {
|
|
22
22
|
type: "ephemeral";
|
|
23
23
|
} | undefined;
|
|
@@ -35,16 +35,16 @@ declare const MessageContentObjectSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
35
35
|
}>>;
|
|
36
36
|
}, "strip", z.ZodTypeAny, {
|
|
37
37
|
type: "tool_use";
|
|
38
|
-
name: string;
|
|
39
38
|
id: string;
|
|
39
|
+
name: 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
|
-
name: string;
|
|
47
46
|
id: string;
|
|
47
|
+
name: string;
|
|
48
48
|
input: Record<string, any>;
|
|
49
49
|
cache_control?: {
|
|
50
50
|
type: "ephemeral";
|
|
@@ -81,13 +81,13 @@ declare const MessageContentObjectSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
81
81
|
media_type: z.ZodLiteral<"image/jpeg">;
|
|
82
82
|
data: z.ZodString;
|
|
83
83
|
}, "strip", z.ZodTypeAny, {
|
|
84
|
-
data: string;
|
|
85
84
|
type: "base64";
|
|
86
85
|
media_type: "image/jpeg";
|
|
87
|
-
}, {
|
|
88
86
|
data: string;
|
|
87
|
+
}, {
|
|
89
88
|
type: "base64";
|
|
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">;
|
|
@@ -99,9 +99,9 @@ declare const MessageContentObjectSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
99
99
|
}, "strip", z.ZodTypeAny, {
|
|
100
100
|
type: "image";
|
|
101
101
|
source: {
|
|
102
|
-
data: string;
|
|
103
102
|
type: "base64";
|
|
104
103
|
media_type: "image/jpeg";
|
|
104
|
+
data: string;
|
|
105
105
|
};
|
|
106
106
|
cache_control?: {
|
|
107
107
|
type: "ephemeral";
|
|
@@ -109,9 +109,9 @@ declare const MessageContentObjectSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
109
109
|
}, {
|
|
110
110
|
type: "image";
|
|
111
111
|
source: {
|
|
112
|
-
data: string;
|
|
113
112
|
type: "base64";
|
|
114
113
|
media_type: "image/jpeg";
|
|
114
|
+
data: string;
|
|
115
115
|
};
|
|
116
116
|
cache_control?: {
|
|
117
117
|
type: "ephemeral";
|
|
@@ -130,14 +130,14 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
130
130
|
type: "ephemeral";
|
|
131
131
|
}>>;
|
|
132
132
|
}, "strip", z.ZodTypeAny, {
|
|
133
|
-
text: string;
|
|
134
133
|
type: "text";
|
|
134
|
+
text: string;
|
|
135
135
|
cache_control?: {
|
|
136
136
|
type: "ephemeral";
|
|
137
137
|
} | undefined;
|
|
138
138
|
}, {
|
|
139
|
-
text: string;
|
|
140
139
|
type: "text";
|
|
140
|
+
text: string;
|
|
141
141
|
cache_control?: {
|
|
142
142
|
type: "ephemeral";
|
|
143
143
|
} | undefined;
|
|
@@ -155,16 +155,16 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
155
155
|
}>>;
|
|
156
156
|
}, "strip", z.ZodTypeAny, {
|
|
157
157
|
type: "tool_use";
|
|
158
|
-
name: string;
|
|
159
158
|
id: string;
|
|
159
|
+
name: 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
|
-
name: string;
|
|
167
166
|
id: string;
|
|
167
|
+
name: string;
|
|
168
168
|
input: Record<string, any>;
|
|
169
169
|
cache_control?: {
|
|
170
170
|
type: "ephemeral";
|
|
@@ -201,13 +201,13 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
201
201
|
media_type: z.ZodLiteral<"image/jpeg">;
|
|
202
202
|
data: z.ZodString;
|
|
203
203
|
}, "strip", z.ZodTypeAny, {
|
|
204
|
-
data: string;
|
|
205
204
|
type: "base64";
|
|
206
205
|
media_type: "image/jpeg";
|
|
207
|
-
}, {
|
|
208
206
|
data: string;
|
|
207
|
+
}, {
|
|
209
208
|
type: "base64";
|
|
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">;
|
|
@@ -219,9 +219,9 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
219
219
|
}, "strip", z.ZodTypeAny, {
|
|
220
220
|
type: "image";
|
|
221
221
|
source: {
|
|
222
|
-
data: string;
|
|
223
222
|
type: "base64";
|
|
224
223
|
media_type: "image/jpeg";
|
|
224
|
+
data: string;
|
|
225
225
|
};
|
|
226
226
|
cache_control?: {
|
|
227
227
|
type: "ephemeral";
|
|
@@ -229,25 +229,26 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
229
229
|
}, {
|
|
230
230
|
type: "image";
|
|
231
231
|
source: {
|
|
232
|
-
data: string;
|
|
233
232
|
type: "base64";
|
|
234
233
|
media_type: "image/jpeg";
|
|
234
|
+
data: string;
|
|
235
235
|
};
|
|
236
236
|
cache_control?: {
|
|
237
237
|
type: "ephemeral";
|
|
238
238
|
} | undefined;
|
|
239
239
|
}>]>, "many">]>;
|
|
240
240
|
}, "strip", z.ZodTypeAny, {
|
|
241
|
+
role: "user" | "assistant";
|
|
241
242
|
content: string | ({
|
|
242
|
-
text: string;
|
|
243
243
|
type: "text";
|
|
244
|
+
text: string;
|
|
244
245
|
cache_control?: {
|
|
245
246
|
type: "ephemeral";
|
|
246
247
|
} | undefined;
|
|
247
248
|
} | {
|
|
248
249
|
type: "tool_use";
|
|
249
|
-
name: string;
|
|
250
250
|
id: string;
|
|
251
|
+
name: string;
|
|
251
252
|
input: Record<string, any>;
|
|
252
253
|
cache_control?: {
|
|
253
254
|
type: "ephemeral";
|
|
@@ -262,26 +263,26 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
262
263
|
} | {
|
|
263
264
|
type: "image";
|
|
264
265
|
source: {
|
|
265
|
-
data: string;
|
|
266
266
|
type: "base64";
|
|
267
267
|
media_type: "image/jpeg";
|
|
268
|
+
data: string;
|
|
268
269
|
};
|
|
269
270
|
cache_control?: {
|
|
270
271
|
type: "ephemeral";
|
|
271
272
|
} | undefined;
|
|
272
273
|
})[];
|
|
273
|
-
role: "user" | "assistant";
|
|
274
274
|
}, {
|
|
275
|
+
role: "user" | "assistant";
|
|
275
276
|
content: string | ({
|
|
276
|
-
text: string;
|
|
277
277
|
type: "text";
|
|
278
|
+
text: string;
|
|
278
279
|
cache_control?: {
|
|
279
280
|
type: "ephemeral";
|
|
280
281
|
} | undefined;
|
|
281
282
|
} | {
|
|
282
283
|
type: "tool_use";
|
|
283
|
-
name: string;
|
|
284
284
|
id: string;
|
|
285
|
+
name: string;
|
|
285
286
|
input: Record<string, any>;
|
|
286
287
|
cache_control?: {
|
|
287
288
|
type: "ephemeral";
|
|
@@ -296,15 +297,14 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
296
297
|
} | {
|
|
297
298
|
type: "image";
|
|
298
299
|
source: {
|
|
299
|
-
data: string;
|
|
300
300
|
type: "base64";
|
|
301
301
|
media_type: "image/jpeg";
|
|
302
|
+
data: string;
|
|
302
303
|
};
|
|
303
304
|
cache_control?: {
|
|
304
305
|
type: "ephemeral";
|
|
305
306
|
} | undefined;
|
|
306
307
|
})[];
|
|
307
|
-
role: "user" | "assistant";
|
|
308
308
|
}>;
|
|
309
309
|
export type Message = z.infer<typeof MessageSchema>;
|
|
310
310
|
export type MessageContentObject = z.infer<typeof MessageContentObjectSchema>;
|