@purpleschool/gptbot 0.20.0-stage-2 → 0.20.1-stage-2

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.
@@ -212,7 +212,24 @@ export declare namespace AnthropicMessagesCommand {
212
212
  type: z.ZodLiteral<"text">;
213
213
  text: z.ZodString;
214
214
  }, z.core.$strict>;
215
- const ResponseSchema: z.ZodObject<{
215
+ const ResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
216
+ id: z.ZodString;
217
+ type: z.ZodLiteral<"message">;
218
+ role: z.ZodLiteral<"assistant">;
219
+ content: z.ZodArray<z.ZodObject<{
220
+ type: z.ZodLiteral<"text">;
221
+ text: z.ZodString;
222
+ }, z.core.$strict>>;
223
+ model: z.ZodString;
224
+ stop_reason: z.ZodNullable<z.ZodString>;
225
+ stop_sequence: z.ZodNullable<z.ZodString>;
226
+ usage: z.ZodObject<{
227
+ input_tokens: z.ZodNumber;
228
+ output_tokens: z.ZodNumber;
229
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
230
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
231
+ }, z.core.$strict>;
232
+ }, z.core.$strict>, z.ZodObject<{
216
233
  id: z.ZodString;
217
234
  type: z.ZodLiteral<"message">;
218
235
  role: z.ZodLiteral<import("../..").ANTHROPIC_ROLE.ASSISTANT>;
@@ -252,8 +269,65 @@ export declare namespace AnthropicMessagesCommand {
252
269
  cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
253
270
  cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
254
271
  }, z.core.$loose>;
255
- }, z.core.$loose>;
256
- const StreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
272
+ }, z.core.$loose>]>;
273
+ const StreamEventSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
274
+ type: z.ZodLiteral<"message_start">;
275
+ message: z.ZodObject<{
276
+ id: z.ZodString;
277
+ type: z.ZodLiteral<"message">;
278
+ role: z.ZodLiteral<"assistant">;
279
+ content: z.ZodArray<z.ZodObject<{
280
+ type: z.ZodLiteral<"text">;
281
+ text: z.ZodString;
282
+ }, z.core.$strict>>;
283
+ model: z.ZodString;
284
+ stop_reason: z.ZodNullable<z.ZodString>;
285
+ stop_sequence: z.ZodNullable<z.ZodString>;
286
+ usage: z.ZodObject<{
287
+ input_tokens: z.ZodNumber;
288
+ output_tokens: z.ZodNumber;
289
+ cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
290
+ cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
291
+ }, z.core.$strict>;
292
+ }, z.core.$strict>;
293
+ }, z.core.$strict>, z.ZodObject<{
294
+ type: z.ZodLiteral<"content_block_start">;
295
+ index: z.ZodNumber;
296
+ content_block: z.ZodObject<{
297
+ type: z.ZodLiteral<"text">;
298
+ text: z.ZodString;
299
+ }, z.core.$strict>;
300
+ }, z.core.$strict>, z.ZodObject<{
301
+ type: z.ZodLiteral<"content_block_delta">;
302
+ index: z.ZodNumber;
303
+ delta: z.ZodObject<{
304
+ type: z.ZodLiteral<"text_delta">;
305
+ text: z.ZodString;
306
+ }, z.core.$strict>;
307
+ }, z.core.$strict>, z.ZodObject<{
308
+ type: z.ZodLiteral<"content_block_stop">;
309
+ index: z.ZodNumber;
310
+ }, z.core.$strict>, z.ZodObject<{
311
+ type: z.ZodLiteral<"message_delta">;
312
+ delta: z.ZodObject<{
313
+ stop_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
314
+ stop_sequence: z.ZodOptional<z.ZodNullable<z.ZodString>>;
315
+ }, z.core.$strict>;
316
+ usage: z.ZodOptional<z.ZodObject<{
317
+ input_tokens: z.ZodOptional<z.ZodNumber>;
318
+ output_tokens: z.ZodOptional<z.ZodNumber>;
319
+ cache_creation_input_tokens: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
320
+ cache_read_input_tokens: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
321
+ }, z.core.$strict>>;
322
+ }, z.core.$strict>, z.ZodObject<{
323
+ type: z.ZodLiteral<"message_stop">;
324
+ }, z.core.$strict>, z.ZodObject<{
325
+ type: z.ZodLiteral<"error">;
326
+ error: z.ZodObject<{
327
+ type: z.ZodString;
328
+ message: z.ZodString;
329
+ }, z.core.$strict>;
330
+ }, z.core.$strict>]>, z.ZodDiscriminatedUnion<[z.ZodObject<{
257
331
  type: z.ZodLiteral<import("../..").ANTHROPIC_EVENT.MESSAGE_START>;
258
332
  message: z.ZodObject<{
259
333
  id: z.ZodString;
@@ -364,7 +438,7 @@ export declare namespace AnthropicMessagesCommand {
364
438
  }, z.core.$loose>, z.ZodObject<{
365
439
  type: z.ZodLiteral<import("../..").ANTHROPIC_EVENT.ERROR>;
366
440
  error: z.ZodUnknown;
367
- }, z.core.$loose>], "type">;
441
+ }, z.core.$loose>], "type">]>;
368
442
  const ErrorResponseSchema: z.ZodObject<{
369
443
  type: z.ZodLiteral<"error">;
370
444
  error: z.ZodObject<{
@@ -151,7 +151,76 @@ var AnthropicMessagesCommand;
151
151
  text: zod_1.z.string(),
152
152
  })
153
153
  .strict();
154
- AnthropicMessagesCommand.ResponseSchema = anthropic_tool_messages_command_1.AnthropicToolMessagesCommand.ResponseSchema;
155
- AnthropicMessagesCommand.StreamEventSchema = anthropic_tool_messages_command_1.AnthropicToolMessagesCommand.StreamEventSchema;
154
+ const LegacyResponseSchema = zod_1.z
155
+ .object({
156
+ id: zod_1.z.string(),
157
+ type: zod_1.z.literal('message'),
158
+ role: zod_1.z.literal('assistant'),
159
+ content: zod_1.z.array(AnthropicMessagesCommand.TextContentBlockResponseSchema),
160
+ model: zod_1.z.string(),
161
+ stop_reason: common_schemas_1.NullableStringSchema,
162
+ stop_sequence: common_schemas_1.NullableStringSchema,
163
+ usage: AnthropicMessagesCommand.UsageSchema,
164
+ })
165
+ .strict();
166
+ const LegacyStreamEventSchema = zod_1.z.union([
167
+ zod_1.z
168
+ .object({
169
+ type: zod_1.z.literal('message_start'),
170
+ message: LegacyResponseSchema,
171
+ })
172
+ .strict(),
173
+ zod_1.z
174
+ .object({
175
+ type: zod_1.z.literal('content_block_start'),
176
+ index: zod_1.z.number().int(),
177
+ content_block: AnthropicMessagesCommand.TextContentBlockResponseSchema,
178
+ })
179
+ .strict(),
180
+ zod_1.z
181
+ .object({
182
+ type: zod_1.z.literal('content_block_delta'),
183
+ index: zod_1.z.number().int(),
184
+ delta: zod_1.z
185
+ .object({
186
+ type: zod_1.z.literal('text_delta'),
187
+ text: zod_1.z.string(),
188
+ })
189
+ .strict(),
190
+ })
191
+ .strict(),
192
+ zod_1.z
193
+ .object({
194
+ type: zod_1.z.literal('content_block_stop'),
195
+ index: zod_1.z.number().int(),
196
+ })
197
+ .strict(),
198
+ zod_1.z
199
+ .object({
200
+ type: zod_1.z.literal('message_delta'),
201
+ delta: zod_1.z
202
+ .object({
203
+ stop_reason: common_schemas_1.NullableStringSchema.optional(),
204
+ stop_sequence: common_schemas_1.NullableStringSchema.optional(),
205
+ })
206
+ .strict(),
207
+ usage: AnthropicMessagesCommand.UsageSchema.partial().optional(),
208
+ })
209
+ .strict(),
210
+ zod_1.z
211
+ .object({
212
+ type: zod_1.z.literal('message_stop'),
213
+ })
214
+ .strict(),
215
+ common_schemas_1.AnthropicErrorResponseSchema,
216
+ ]);
217
+ AnthropicMessagesCommand.ResponseSchema = zod_1.z.union([
218
+ LegacyResponseSchema,
219
+ anthropic_tool_messages_command_1.AnthropicToolMessagesCommand.ResponseSchema,
220
+ ]);
221
+ AnthropicMessagesCommand.StreamEventSchema = zod_1.z.union([
222
+ LegacyStreamEventSchema,
223
+ anthropic_tool_messages_command_1.AnthropicToolMessagesCommand.StreamEventSchema,
224
+ ]);
156
225
  AnthropicMessagesCommand.ErrorResponseSchema = common_schemas_1.AnthropicErrorResponseSchema;
157
226
  })(AnthropicMessagesCommand || (exports.AnthropicMessagesCommand = AnthropicMessagesCommand = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.20.0-stage-2",
3
+ "version": "0.20.1-stage-2",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",