@purpleschool/gptbot 0.19.27 → 0.20.0-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.
Files changed (32) hide show
  1. package/build/api/controllers/http/b2b-compatible.d.ts +1 -0
  2. package/build/api/controllers/http/b2b-compatible.js +1 -0
  3. package/build/commands/b2b-compatible/anthropic-messages.command.d.ts +125 -48
  4. package/build/commands/b2b-compatible/anthropic-messages.command.js +3 -63
  5. package/build/commands/b2b-compatible/anthropic-tool-messages.command.d.ts +302 -0
  6. package/build/commands/b2b-compatible/anthropic-tool-messages.command.js +248 -0
  7. package/build/commands/b2b-compatible/index.d.ts +3 -0
  8. package/build/commands/b2b-compatible/index.js +3 -0
  9. package/build/commands/b2b-compatible/openai-chat-completions.command.d.ts +132 -0
  10. package/build/commands/b2b-compatible/openai-chat-completions.command.js +128 -0
  11. package/build/commands/b2b-compatible/openai-responses.command.d.ts +148 -15
  12. package/build/commands/b2b-compatible/openai-responses.command.js +13 -3
  13. package/build/commands/b2b-compatible/openai-tool-responses.command.d.ts +155 -0
  14. package/build/commands/b2b-compatible/openai-tool-responses.command.js +155 -0
  15. package/build/commands/payment/get-payment-history.command.d.ts +1 -0
  16. package/build/commands/payment/get-purchase-history.command.d.ts +1 -0
  17. package/build/commands/team-account/get-team-account-payment-history.command.d.ts +1 -0
  18. package/build/constants/ai-model/enums/index.d.ts +0 -1
  19. package/build/constants/ai-model/enums/index.js +0 -1
  20. package/build/constants/b2b/enums/anthropic-tool.enum.d.ts +70 -0
  21. package/build/constants/b2b/enums/anthropic-tool.enum.js +87 -0
  22. package/build/constants/b2b/enums/index.d.ts +2 -0
  23. package/build/constants/b2b/enums/index.js +2 -0
  24. package/build/constants/b2b/enums/openai-tool.enum.d.ts +34 -0
  25. package/build/constants/b2b/enums/openai-tool.enum.js +43 -0
  26. package/build/models/payment-history-item.schema.d.ts +1 -0
  27. package/build/models/payment-history-item.schema.js +1 -0
  28. package/build/models/purchase-history.schema.d.ts +1 -0
  29. package/build/models/push/push-campaign-segment.schema.js +1 -1
  30. package/package.json +1 -1
  31. package/build/constants/ai-model/enums/ai-model-strategy.enum.d.ts +0 -21
  32. package/build/constants/ai-model/enums/ai-model-strategy.enum.js +0 -25
@@ -57,12 +57,12 @@ export declare const OpenAIResponseInputMessageSchema: z.ZodObject<{
57
57
  }, z.core.$loose>], "type">>]>;
58
58
  }, z.core.$loose>;
59
59
  export declare namespace OpenAIResponsesCommand {
60
- const HeadersSchema: z.ZodObject<{
60
+ export const HeadersSchema: z.ZodObject<{
61
61
  authorization: z.ZodString;
62
62
  }, z.core.$strict>;
63
- const BodySchema: z.ZodObject<{
63
+ export const BodySchema: z.ZodObject<{
64
64
  model: z.ZodString;
65
- input: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
65
+ input: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
66
66
  type: z.ZodOptional<z.ZodLiteral<"message">>;
67
67
  role: z.ZodEnum<{
68
68
  assistant: "assistant";
@@ -94,7 +94,37 @@ export declare namespace OpenAIResponsesCommand {
94
94
  filename: z.ZodOptional<z.ZodString>;
95
95
  mime_type: z.ZodOptional<z.ZodString>;
96
96
  }, z.core.$loose>], "type">>]>;
97
- }, z.core.$loose>>]>;
97
+ }, z.core.$loose>, z.ZodUnion<readonly [z.ZodObject<{
98
+ type: z.ZodOptional<z.ZodLiteral<import("./openai-tool-responses.command").OPENAI_ITEM_TYPE.MESSAGE>>;
99
+ role: z.ZodEnum<{
100
+ assistant: import("./openai-tool-responses.command").OPENAI_ROLE.ASSISTANT;
101
+ developer: import("./openai-tool-responses.command").OPENAI_ROLE.DEVELOPER;
102
+ system: import("./openai-tool-responses.command").OPENAI_ROLE.SYSTEM;
103
+ user: import("./openai-tool-responses.command").OPENAI_ROLE.USER;
104
+ }>;
105
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
106
+ type: z.ZodEnum<{
107
+ input_text: "input_text";
108
+ output_text: "output_text";
109
+ text: "text";
110
+ }>;
111
+ text: z.ZodString;
112
+ }, z.core.$loose>>]>;
113
+ }, z.core.$loose>, z.ZodObject<{
114
+ type: z.ZodLiteral<import("./openai-tool-responses.command").OPENAI_ITEM_TYPE.FUNCTION_CALL>;
115
+ call_id: z.ZodString;
116
+ name: z.ZodString;
117
+ arguments: z.ZodString;
118
+ }, z.core.$loose>, z.ZodObject<{
119
+ type: z.ZodLiteral<import("./openai-tool-responses.command").OPENAI_ITEM_TYPE.FUNCTION_OUTPUT>;
120
+ call_id: z.ZodString;
121
+ output: z.ZodString;
122
+ }, z.core.$loose>, z.ZodObject<{
123
+ type: z.ZodLiteral<import("./openai-tool-responses.command").OPENAI_ITEM_TYPE.REASONING>;
124
+ id: z.ZodString;
125
+ summary: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
126
+ encrypted_content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
127
+ }, z.core.$loose>]>]>>]>;
98
128
  instructions: z.ZodOptional<z.ZodString>;
99
129
  stream: z.ZodOptional<z.ZodBoolean>;
100
130
  max_output_tokens: z.ZodOptional<z.ZodNumber>;
@@ -126,7 +156,7 @@ export declare namespace OpenAIResponsesCommand {
126
156
  truncation: z.ZodOptional<z.ZodString>;
127
157
  user: z.ZodOptional<z.ZodString>;
128
158
  }, z.core.$loose>;
129
- const UsageSchema: z.ZodObject<{
159
+ export const UsageSchema: z.ZodObject<{
130
160
  input_tokens: z.ZodNumber;
131
161
  output_tokens: z.ZodNumber;
132
162
  total_tokens: z.ZodNumber;
@@ -134,7 +164,7 @@ export declare namespace OpenAIResponsesCommand {
134
164
  cached_tokens: z.ZodOptional<z.ZodNumber>;
135
165
  }, z.core.$strict>>;
136
166
  }, z.core.$strict>;
137
- const ResponseSchema: z.ZodObject<{
167
+ const LegacyResponseSchema: z.ZodObject<{
138
168
  id: z.ZodString;
139
169
  object: z.ZodLiteral<"response">;
140
170
  created_at: z.ZodNumber;
@@ -161,7 +191,71 @@ export declare namespace OpenAIResponsesCommand {
161
191
  }, z.core.$strict>>;
162
192
  }, z.core.$strict>;
163
193
  }, z.core.$strict>;
164
- const StreamEventSchema: z.ZodUnion<readonly [z.ZodObject<{
194
+ export const ResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
195
+ id: z.ZodString;
196
+ object: z.ZodLiteral<"response">;
197
+ created_at: z.ZodNumber;
198
+ status: z.ZodLiteral<"completed">;
199
+ model: z.ZodString;
200
+ output: z.ZodArray<z.ZodObject<{
201
+ id: z.ZodString;
202
+ type: z.ZodLiteral<"message">;
203
+ status: z.ZodLiteral<"completed">;
204
+ role: z.ZodLiteral<"assistant">;
205
+ content: z.ZodArray<z.ZodObject<{
206
+ type: z.ZodLiteral<"output_text">;
207
+ text: z.ZodString;
208
+ annotations: z.ZodArray<z.ZodUnknown>;
209
+ }, z.core.$strict>>;
210
+ }, z.core.$strict>>;
211
+ output_text: z.ZodString;
212
+ usage: z.ZodObject<{
213
+ input_tokens: z.ZodNumber;
214
+ output_tokens: z.ZodNumber;
215
+ total_tokens: z.ZodNumber;
216
+ input_tokens_details: z.ZodOptional<z.ZodObject<{
217
+ cached_tokens: z.ZodOptional<z.ZodNumber>;
218
+ }, z.core.$strict>>;
219
+ }, z.core.$strict>;
220
+ }, z.core.$strict>, z.ZodObject<{
221
+ id: z.ZodString;
222
+ object: z.ZodLiteral<"response">;
223
+ created_at: z.ZodNumber;
224
+ status: z.ZodEnum<{
225
+ completed: "completed";
226
+ incomplete: "incomplete";
227
+ }>;
228
+ model: z.ZodString;
229
+ output: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
230
+ type: z.ZodLiteral<import("./openai-tool-responses.command").OPENAI_ITEM_TYPE.FUNCTION_CALL>;
231
+ id: z.ZodString;
232
+ call_id: z.ZodString;
233
+ name: z.ZodString;
234
+ arguments: z.ZodString;
235
+ }, z.core.$loose>, z.ZodObject<{
236
+ type: z.ZodLiteral<import("./openai-tool-responses.command").OPENAI_ITEM_TYPE.MESSAGE>;
237
+ id: z.ZodString;
238
+ role: z.ZodLiteral<import("./openai-tool-responses.command").OPENAI_ROLE.ASSISTANT>;
239
+ content: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
240
+ type: z.ZodLiteral<"output_text">;
241
+ text: z.ZodString;
242
+ }, z.core.$loose>, z.ZodObject<{
243
+ type: z.ZodLiteral<"refusal">;
244
+ refusal: z.ZodString;
245
+ }, z.core.$loose>]>>;
246
+ }, z.core.$loose>, z.ZodObject<{
247
+ type: z.ZodLiteral<import("./openai-tool-responses.command").OPENAI_ITEM_TYPE.REASONING>;
248
+ id: z.ZodString;
249
+ summary: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
250
+ encrypted_content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
251
+ }, z.core.$loose>]>>;
252
+ usage: z.ZodObject<{
253
+ input_tokens: z.ZodNumber;
254
+ output_tokens: z.ZodNumber;
255
+ total_tokens: z.ZodNumber;
256
+ }, z.core.$loose>;
257
+ }, z.core.$loose>]>;
258
+ export const StreamEventSchema: z.ZodUnion<readonly [z.ZodObject<{
165
259
  type: z.ZodLiteral<"response.created">;
166
260
  response: z.ZodObject<{
167
261
  id: z.ZodString;
@@ -194,7 +288,7 @@ export declare namespace OpenAIResponsesCommand {
194
288
  text: z.ZodString;
195
289
  }, z.core.$strict>, z.ZodObject<{
196
290
  type: z.ZodLiteral<"response.completed">;
197
- response: z.ZodObject<{
291
+ response: z.ZodUnion<readonly [z.ZodObject<{
198
292
  id: z.ZodString;
199
293
  object: z.ZodLiteral<"response">;
200
294
  created_at: z.ZodNumber;
@@ -220,7 +314,44 @@ export declare namespace OpenAIResponsesCommand {
220
314
  cached_tokens: z.ZodOptional<z.ZodNumber>;
221
315
  }, z.core.$strict>>;
222
316
  }, z.core.$strict>;
223
- }, z.core.$strict>;
317
+ }, z.core.$strict>, z.ZodObject<{
318
+ id: z.ZodString;
319
+ object: z.ZodLiteral<"response">;
320
+ created_at: z.ZodNumber;
321
+ status: z.ZodEnum<{
322
+ completed: "completed";
323
+ incomplete: "incomplete";
324
+ }>;
325
+ model: z.ZodString;
326
+ output: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
327
+ type: z.ZodLiteral<import("./openai-tool-responses.command").OPENAI_ITEM_TYPE.FUNCTION_CALL>;
328
+ id: z.ZodString;
329
+ call_id: z.ZodString;
330
+ name: z.ZodString;
331
+ arguments: z.ZodString;
332
+ }, z.core.$loose>, z.ZodObject<{
333
+ type: z.ZodLiteral<import("./openai-tool-responses.command").OPENAI_ITEM_TYPE.MESSAGE>;
334
+ id: z.ZodString;
335
+ role: z.ZodLiteral<import("./openai-tool-responses.command").OPENAI_ROLE.ASSISTANT>;
336
+ content: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
337
+ type: z.ZodLiteral<"output_text">;
338
+ text: z.ZodString;
339
+ }, z.core.$loose>, z.ZodObject<{
340
+ type: z.ZodLiteral<"refusal">;
341
+ refusal: z.ZodString;
342
+ }, z.core.$loose>]>>;
343
+ }, z.core.$loose>, z.ZodObject<{
344
+ type: z.ZodLiteral<import("./openai-tool-responses.command").OPENAI_ITEM_TYPE.REASONING>;
345
+ id: z.ZodString;
346
+ summary: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
347
+ encrypted_content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
348
+ }, z.core.$loose>]>>;
349
+ usage: z.ZodObject<{
350
+ input_tokens: z.ZodNumber;
351
+ output_tokens: z.ZodNumber;
352
+ total_tokens: z.ZodNumber;
353
+ }, z.core.$loose>;
354
+ }, z.core.$loose>]>;
224
355
  }, z.core.$strict>, z.ZodObject<{
225
356
  error: z.ZodObject<{
226
357
  message: z.ZodString;
@@ -229,7 +360,7 @@ export declare namespace OpenAIResponsesCommand {
229
360
  code: z.ZodNullable<z.ZodString>;
230
361
  }, z.core.$strict>;
231
362
  }, z.core.$strict>]>;
232
- const ErrorResponseSchema: z.ZodObject<{
363
+ export const ErrorResponseSchema: z.ZodObject<{
233
364
  error: z.ZodObject<{
234
365
  message: z.ZodString;
235
366
  type: z.ZodString;
@@ -237,9 +368,11 @@ export declare namespace OpenAIResponsesCommand {
237
368
  code: z.ZodNullable<z.ZodString>;
238
369
  }, z.core.$strict>;
239
370
  }, z.core.$strict>;
240
- type Headers = z.infer<typeof HeadersSchema>;
241
- type Body = z.infer<typeof BodySchema>;
242
- type Response = z.infer<typeof ResponseSchema>;
243
- type StreamEvent = z.infer<typeof StreamEventSchema>;
244
- type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
371
+ export type Headers = z.infer<typeof HeadersSchema>;
372
+ export type Body = z.infer<typeof BodySchema>;
373
+ export type LegacyResponse = z.infer<typeof LegacyResponseSchema>;
374
+ export type Response = z.infer<typeof ResponseSchema>;
375
+ export type StreamEvent = z.infer<typeof StreamEventSchema>;
376
+ export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
377
+ export {};
245
378
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OpenAIResponsesCommand = exports.OpenAIResponseInputMessageSchema = exports.OpenAIResponseInputContentPartSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const common_schemas_1 = require("./common.schemas");
6
+ const openai_tool_responses_command_1 = require("./openai-tool-responses.command");
6
7
  const OpenAIInputTextContentPartSchema = zod_1.z
7
8
  .object({
8
9
  type: zod_1.z.enum(['input_text', 'text', 'output_text']),
@@ -92,7 +93,12 @@ var OpenAIResponsesCommand;
92
93
  OpenAIResponsesCommand.BodySchema = zod_1.z
93
94
  .object({
94
95
  model: zod_1.z.string(),
95
- input: zod_1.z.union([zod_1.z.string(), zod_1.z.array(exports.OpenAIResponseInputMessageSchema).min(1)]),
96
+ input: zod_1.z.union([
97
+ zod_1.z.string(),
98
+ zod_1.z
99
+ .array(zod_1.z.union([exports.OpenAIResponseInputMessageSchema, openai_tool_responses_command_1.OpenAIToolInputItemSchema]))
100
+ .min(1),
101
+ ]),
96
102
  instructions: zod_1.z.string().optional(),
97
103
  stream: zod_1.z.boolean().optional(),
98
104
  max_output_tokens: zod_1.z.number().int().positive().optional(),
@@ -118,7 +124,7 @@ var OpenAIResponsesCommand;
118
124
  })
119
125
  .loose();
120
126
  OpenAIResponsesCommand.UsageSchema = OpenAIResponseUsageSchema;
121
- OpenAIResponsesCommand.ResponseSchema = zod_1.z
127
+ const LegacyResponseSchema = zod_1.z
122
128
  .object({
123
129
  id: zod_1.z.string(),
124
130
  object: zod_1.z.literal('response'),
@@ -130,11 +136,15 @@ var OpenAIResponsesCommand;
130
136
  usage: OpenAIResponsesCommand.UsageSchema,
131
137
  })
132
138
  .strict();
139
+ OpenAIResponsesCommand.ResponseSchema = zod_1.z.union([
140
+ LegacyResponseSchema,
141
+ openai_tool_responses_command_1.OpenAIToolResponsesCommand.ResponseSchema,
142
+ ]);
133
143
  OpenAIResponsesCommand.StreamEventSchema = zod_1.z.union([
134
144
  zod_1.z
135
145
  .object({
136
146
  type: zod_1.z.literal('response.created'),
137
- response: OpenAIResponsesCommand.ResponseSchema.omit({ status: true }).extend({
147
+ response: LegacyResponseSchema.omit({ status: true }).extend({
138
148
  status: zod_1.z.literal('in_progress'),
139
149
  output: zod_1.z.array(zod_1.z.never()),
140
150
  output_text: zod_1.z.literal(''),
@@ -0,0 +1,155 @@
1
+ import { z } from 'zod';
2
+ import { OPENAI_ITEM_TYPE, OPENAI_ROLE, OPENAI_TOOL_TYPE, OPENAI_TOOL_CHOICE, TOOL_THINKING_TYPE } from '../../constants';
3
+ export { OPENAI_ITEM_TYPE, OPENAI_ROLE, OPENAI_TOOL_TYPE, OPENAI_TOOL_CHOICE, } from '../../constants';
4
+ export declare const OpenAIFunctionDefinitionSchema: z.ZodObject<{
5
+ name: z.ZodString;
6
+ description: z.ZodOptional<z.ZodString>;
7
+ parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
8
+ strict: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
9
+ }, z.core.$strict>;
10
+ export declare const OpenAIFunctionToolSchema: z.ZodObject<{
11
+ name: z.ZodString;
12
+ description: z.ZodOptional<z.ZodString>;
13
+ parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
14
+ strict: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
15
+ type: z.ZodLiteral<OPENAI_TOOL_TYPE>;
16
+ }, z.core.$strict>;
17
+ export declare const OpenAIToolChoiceSchema: z.ZodUnion<readonly [z.ZodEnum<typeof OPENAI_TOOL_CHOICE>, z.ZodObject<{
18
+ type: z.ZodLiteral<OPENAI_TOOL_TYPE>;
19
+ name: z.ZodString;
20
+ }, z.core.$strict>]>;
21
+ export declare const OpenAIToolInputItemSchema: z.ZodUnion<readonly [z.ZodObject<{
22
+ type: z.ZodOptional<z.ZodLiteral<OPENAI_ITEM_TYPE.MESSAGE>>;
23
+ role: z.ZodEnum<{
24
+ assistant: OPENAI_ROLE.ASSISTANT;
25
+ developer: OPENAI_ROLE.DEVELOPER;
26
+ system: OPENAI_ROLE.SYSTEM;
27
+ user: OPENAI_ROLE.USER;
28
+ }>;
29
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
30
+ type: z.ZodEnum<{
31
+ input_text: "input_text";
32
+ output_text: "output_text";
33
+ text: "text";
34
+ }>;
35
+ text: z.ZodString;
36
+ }, z.core.$loose>>]>;
37
+ }, z.core.$loose>, z.ZodObject<{
38
+ type: z.ZodLiteral<OPENAI_ITEM_TYPE.FUNCTION_CALL>;
39
+ call_id: z.ZodString;
40
+ name: z.ZodString;
41
+ arguments: z.ZodString;
42
+ }, z.core.$loose>, z.ZodObject<{
43
+ type: z.ZodLiteral<OPENAI_ITEM_TYPE.FUNCTION_OUTPUT>;
44
+ call_id: z.ZodString;
45
+ output: z.ZodString;
46
+ }, z.core.$loose>, z.ZodObject<{
47
+ type: z.ZodLiteral<OPENAI_ITEM_TYPE.REASONING>;
48
+ id: z.ZodString;
49
+ summary: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
50
+ encrypted_content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
+ }, z.core.$loose>]>;
52
+ export declare namespace OpenAIToolResponsesCommand {
53
+ const BodySchema: z.ZodObject<{
54
+ model: z.ZodString;
55
+ input: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
56
+ type: z.ZodOptional<z.ZodLiteral<OPENAI_ITEM_TYPE.MESSAGE>>;
57
+ role: z.ZodEnum<{
58
+ assistant: OPENAI_ROLE.ASSISTANT;
59
+ developer: OPENAI_ROLE.DEVELOPER;
60
+ system: OPENAI_ROLE.SYSTEM;
61
+ user: OPENAI_ROLE.USER;
62
+ }>;
63
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
64
+ type: z.ZodEnum<{
65
+ input_text: "input_text";
66
+ output_text: "output_text";
67
+ text: "text";
68
+ }>;
69
+ text: z.ZodString;
70
+ }, z.core.$loose>>]>;
71
+ }, z.core.$loose>, z.ZodObject<{
72
+ type: z.ZodLiteral<OPENAI_ITEM_TYPE.FUNCTION_CALL>;
73
+ call_id: z.ZodString;
74
+ name: z.ZodString;
75
+ arguments: z.ZodString;
76
+ }, z.core.$loose>, z.ZodObject<{
77
+ type: z.ZodLiteral<OPENAI_ITEM_TYPE.FUNCTION_OUTPUT>;
78
+ call_id: z.ZodString;
79
+ output: z.ZodString;
80
+ }, z.core.$loose>, z.ZodObject<{
81
+ type: z.ZodLiteral<OPENAI_ITEM_TYPE.REASONING>;
82
+ id: z.ZodString;
83
+ summary: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
84
+ encrypted_content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
85
+ }, z.core.$loose>]>>]>;
86
+ instructions: z.ZodOptional<z.ZodString>;
87
+ tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
88
+ name: z.ZodString;
89
+ description: z.ZodOptional<z.ZodString>;
90
+ parameters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
91
+ strict: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
92
+ type: z.ZodLiteral<OPENAI_TOOL_TYPE>;
93
+ }, z.core.$strict>>>;
94
+ tool_choice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<typeof OPENAI_TOOL_CHOICE>, z.ZodObject<{
95
+ type: z.ZodLiteral<OPENAI_TOOL_TYPE>;
96
+ name: z.ZodString;
97
+ }, z.core.$strict>]>>;
98
+ parallel_tool_calls: z.ZodOptional<z.ZodBoolean>;
99
+ max_output_tokens: z.ZodOptional<z.ZodNumber>;
100
+ reasoning: z.ZodOptional<z.ZodObject<{
101
+ effort: z.ZodOptional<z.ZodString>;
102
+ summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
+ }, z.core.$strict>>;
104
+ temperature: z.ZodOptional<z.ZodNumber>;
105
+ top_p: z.ZodOptional<z.ZodNumber>;
106
+ stream: z.ZodOptional<z.ZodBoolean>;
107
+ thinking: z.ZodOptional<z.ZodObject<{
108
+ type: z.ZodEnum<typeof TOOL_THINKING_TYPE>;
109
+ }, z.core.$strict>>;
110
+ store: z.ZodOptional<z.ZodBoolean>;
111
+ previous_response_id: z.ZodOptional<z.ZodNull>;
112
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
113
+ include: z.ZodOptional<z.ZodArray<z.ZodLiteral<"reasoning.encrypted_content">>>;
114
+ }, z.core.$strict>;
115
+ const ResponseSchema: z.ZodObject<{
116
+ id: z.ZodString;
117
+ object: z.ZodLiteral<"response">;
118
+ created_at: z.ZodNumber;
119
+ status: z.ZodEnum<{
120
+ completed: "completed";
121
+ incomplete: "incomplete";
122
+ }>;
123
+ model: z.ZodString;
124
+ output: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
125
+ type: z.ZodLiteral<OPENAI_ITEM_TYPE.FUNCTION_CALL>;
126
+ id: z.ZodString;
127
+ call_id: z.ZodString;
128
+ name: z.ZodString;
129
+ arguments: z.ZodString;
130
+ }, z.core.$loose>, z.ZodObject<{
131
+ type: z.ZodLiteral<OPENAI_ITEM_TYPE.MESSAGE>;
132
+ id: z.ZodString;
133
+ role: z.ZodLiteral<OPENAI_ROLE.ASSISTANT>;
134
+ content: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
135
+ type: z.ZodLiteral<"output_text">;
136
+ text: z.ZodString;
137
+ }, z.core.$loose>, z.ZodObject<{
138
+ type: z.ZodLiteral<"refusal">;
139
+ refusal: z.ZodString;
140
+ }, z.core.$loose>]>>;
141
+ }, z.core.$loose>, z.ZodObject<{
142
+ type: z.ZodLiteral<OPENAI_ITEM_TYPE.REASONING>;
143
+ id: z.ZodString;
144
+ summary: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
145
+ encrypted_content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
146
+ }, z.core.$loose>]>>;
147
+ usage: z.ZodObject<{
148
+ input_tokens: z.ZodNumber;
149
+ output_tokens: z.ZodNumber;
150
+ total_tokens: z.ZodNumber;
151
+ }, z.core.$loose>;
152
+ }, z.core.$loose>;
153
+ type Body = z.infer<typeof BodySchema>;
154
+ type Response = z.infer<typeof ResponseSchema>;
155
+ }
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenAIToolResponsesCommand = exports.OpenAIToolInputItemSchema = exports.OpenAIToolChoiceSchema = exports.OpenAIFunctionToolSchema = exports.OpenAIFunctionDefinitionSchema = exports.OPENAI_TOOL_CHOICE = exports.OPENAI_TOOL_TYPE = exports.OPENAI_ROLE = exports.OPENAI_ITEM_TYPE = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ var constants_2 = require("../../constants");
7
+ Object.defineProperty(exports, "OPENAI_ITEM_TYPE", { enumerable: true, get: function () { return constants_2.OPENAI_ITEM_TYPE; } });
8
+ Object.defineProperty(exports, "OPENAI_ROLE", { enumerable: true, get: function () { return constants_2.OPENAI_ROLE; } });
9
+ Object.defineProperty(exports, "OPENAI_TOOL_TYPE", { enumerable: true, get: function () { return constants_2.OPENAI_TOOL_TYPE; } });
10
+ Object.defineProperty(exports, "OPENAI_TOOL_CHOICE", { enumerable: true, get: function () { return constants_2.OPENAI_TOOL_CHOICE; } });
11
+ const jsonObject = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown());
12
+ const textPart = zod_1.z
13
+ .object({ type: zod_1.z.enum(['input_text', 'output_text', 'text']), text: zod_1.z.string() })
14
+ .loose();
15
+ exports.OpenAIFunctionDefinitionSchema = zod_1.z
16
+ .object({
17
+ name: zod_1.z
18
+ .string()
19
+ .min(1)
20
+ .max(64)
21
+ .regex(/^[a-zA-Z0-9_-]+$/),
22
+ description: zod_1.z.string().optional(),
23
+ parameters: jsonObject.default({ type: 'object', properties: {} }),
24
+ strict: zod_1.z.boolean().nullable().optional(),
25
+ })
26
+ .strict();
27
+ exports.OpenAIFunctionToolSchema = exports.OpenAIFunctionDefinitionSchema.extend({
28
+ type: zod_1.z.literal(constants_1.OPENAI_TOOL_TYPE.FUNCTION),
29
+ });
30
+ exports.OpenAIToolChoiceSchema = zod_1.z.union([
31
+ zod_1.z.enum(constants_1.OPENAI_TOOL_CHOICE),
32
+ zod_1.z.object({ type: zod_1.z.literal(constants_1.OPENAI_TOOL_TYPE.FUNCTION), name: zod_1.z.string().min(1) }).strict(),
33
+ ]);
34
+ exports.OpenAIToolInputItemSchema = zod_1.z.union([
35
+ zod_1.z
36
+ .object({
37
+ type: zod_1.z.literal(constants_1.OPENAI_ITEM_TYPE.MESSAGE).optional(),
38
+ role: zod_1.z.enum([
39
+ constants_1.OPENAI_ROLE.SYSTEM,
40
+ constants_1.OPENAI_ROLE.DEVELOPER,
41
+ constants_1.OPENAI_ROLE.USER,
42
+ constants_1.OPENAI_ROLE.ASSISTANT,
43
+ ]),
44
+ content: zod_1.z.union([zod_1.z.string(), zod_1.z.array(textPart)]),
45
+ })
46
+ .loose(),
47
+ zod_1.z
48
+ .object({
49
+ type: zod_1.z.literal(constants_1.OPENAI_ITEM_TYPE.FUNCTION_CALL),
50
+ call_id: zod_1.z.string().min(1),
51
+ name: zod_1.z.string().min(1),
52
+ arguments: zod_1.z.string(),
53
+ })
54
+ .loose(),
55
+ zod_1.z
56
+ .object({
57
+ type: zod_1.z.literal(constants_1.OPENAI_ITEM_TYPE.FUNCTION_OUTPUT),
58
+ call_id: zod_1.z.string().min(1),
59
+ output: zod_1.z.string(),
60
+ })
61
+ .loose(),
62
+ zod_1.z
63
+ .object({
64
+ type: zod_1.z.literal(constants_1.OPENAI_ITEM_TYPE.REASONING),
65
+ id: zod_1.z.string(),
66
+ summary: zod_1.z.array(jsonObject),
67
+ encrypted_content: zod_1.z.string().nullable().optional(),
68
+ })
69
+ .loose(),
70
+ ]);
71
+ var OpenAIToolResponsesCommand;
72
+ (function (OpenAIToolResponsesCommand) {
73
+ OpenAIToolResponsesCommand.BodySchema = zod_1.z
74
+ .object({
75
+ model: zod_1.z.string().min(1),
76
+ input: zod_1.z.union([zod_1.z.string(), zod_1.z.array(exports.OpenAIToolInputItemSchema).min(1)]),
77
+ instructions: zod_1.z.string().optional(),
78
+ tools: zod_1.z.array(exports.OpenAIFunctionToolSchema).optional(),
79
+ tool_choice: exports.OpenAIToolChoiceSchema.optional(),
80
+ parallel_tool_calls: zod_1.z.boolean().optional(),
81
+ max_output_tokens: zod_1.z.number().int().positive().optional(),
82
+ reasoning: zod_1.z
83
+ .object({
84
+ effort: zod_1.z.string().optional(),
85
+ summary: zod_1.z.string().nullable().optional(),
86
+ })
87
+ .strict()
88
+ .optional(),
89
+ temperature: zod_1.z.number().optional(),
90
+ top_p: zod_1.z.number().optional(),
91
+ stream: zod_1.z.boolean().optional(),
92
+ thinking: zod_1.z
93
+ .object({ type: zod_1.z.enum(constants_1.TOOL_THINKING_TYPE) })
94
+ .strict()
95
+ .optional(),
96
+ store: zod_1.z.boolean().optional(),
97
+ previous_response_id: zod_1.z.null().optional(),
98
+ metadata: jsonObject.nullable().optional(),
99
+ include: zod_1.z.array(zod_1.z.literal('reasoning.encrypted_content')).optional(),
100
+ })
101
+ .strict();
102
+ OpenAIToolResponsesCommand.ResponseSchema = zod_1.z
103
+ .object({
104
+ id: zod_1.z.string(),
105
+ object: zod_1.z.literal('response'),
106
+ created_at: zod_1.z.number(),
107
+ status: zod_1.z.enum(['completed', 'incomplete']),
108
+ model: zod_1.z.string(),
109
+ output: zod_1.z.array(zod_1.z.union([
110
+ zod_1.z
111
+ .object({
112
+ type: zod_1.z.literal(constants_1.OPENAI_ITEM_TYPE.FUNCTION_CALL),
113
+ id: zod_1.z.string(),
114
+ call_id: zod_1.z.string().min(1),
115
+ name: zod_1.z.string().min(1),
116
+ arguments: zod_1.z.string(),
117
+ })
118
+ .loose(),
119
+ zod_1.z
120
+ .object({
121
+ type: zod_1.z.literal(constants_1.OPENAI_ITEM_TYPE.MESSAGE),
122
+ id: zod_1.z.string(),
123
+ role: zod_1.z.literal(constants_1.OPENAI_ROLE.ASSISTANT),
124
+ content: zod_1.z.array(zod_1.z.union([
125
+ zod_1.z
126
+ .object({
127
+ type: zod_1.z.literal('output_text'),
128
+ text: zod_1.z.string(),
129
+ })
130
+ .loose(),
131
+ zod_1.z
132
+ .object({ type: zod_1.z.literal('refusal'), refusal: zod_1.z.string() })
133
+ .loose(),
134
+ ])),
135
+ })
136
+ .loose(),
137
+ zod_1.z
138
+ .object({
139
+ type: zod_1.z.literal(constants_1.OPENAI_ITEM_TYPE.REASONING),
140
+ id: zod_1.z.string(),
141
+ summary: zod_1.z.array(jsonObject),
142
+ encrypted_content: zod_1.z.string().nullable().optional(),
143
+ })
144
+ .loose(),
145
+ ])),
146
+ usage: zod_1.z
147
+ .object({
148
+ input_tokens: zod_1.z.number().nonnegative(),
149
+ output_tokens: zod_1.z.number().nonnegative(),
150
+ total_tokens: zod_1.z.number().nonnegative(),
151
+ })
152
+ .loose(),
153
+ })
154
+ .loose();
155
+ })(OpenAIToolResponsesCommand || (exports.OpenAIToolResponsesCommand = OpenAIToolResponsesCommand = {}));
@@ -10,6 +10,7 @@ export declare namespace GetPaymentHistoryCommand {
10
10
  uuid: z.ZodUUID;
11
11
  status: z.ZodEnum<typeof import("../..").PAYMENT_STATUS>;
12
12
  sum: z.ZodNumber;
13
+ currency: z.ZodString;
13
14
  description: z.ZodString;
14
15
  type: z.ZodEnum<typeof import("../..").PAYMENT_HISTORY_ITEM_TYPE>;
15
16
  createdAt: z.ZodDate;
@@ -14,6 +14,7 @@ export declare namespace GetPurchaseHistoryCommand {
14
14
  uuid: z.ZodUUID;
15
15
  status: z.ZodEnum<typeof import("../..").PAYMENT_STATUS>;
16
16
  sum: z.ZodNumber;
17
+ currency: z.ZodString;
17
18
  description: z.ZodString;
18
19
  type: z.ZodEnum<typeof import("../..").PAYMENT_HISTORY_ITEM_TYPE>;
19
20
  createdAt: z.ZodISODateTime;
@@ -9,6 +9,7 @@ export declare namespace GetTeamAccountPaymentHistoryCommand {
9
9
  uuid: z.ZodUUID;
10
10
  status: z.ZodEnum<typeof import("../..").PAYMENT_STATUS>;
11
11
  sum: z.ZodNumber;
12
+ currency: z.ZodString;
12
13
  description: z.ZodString;
13
14
  type: z.ZodEnum<typeof import("../..").PAYMENT_HISTORY_ITEM_TYPE>;
14
15
  createdAt: z.ZodDate;
@@ -1,7 +1,6 @@
1
1
  export * from './ai-model-config-selector-type.enum';
2
2
  export * from './ai-model-feature.enum';
3
3
  export * from './ai-model-status.enum';
4
- export * from './ai-model-strategy.enum';
5
4
  export * from './ai-model-tag.enum';
6
5
  export * from './ai-text-provider-status.enum';
7
6
  export * from './ai-text-provider.enum';
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ai-model-config-selector-type.enum"), exports);
18
18
  __exportStar(require("./ai-model-feature.enum"), exports);
19
19
  __exportStar(require("./ai-model-status.enum"), exports);
20
- __exportStar(require("./ai-model-strategy.enum"), exports);
21
20
  __exportStar(require("./ai-model-tag.enum"), exports);
22
21
  __exportStar(require("./ai-text-provider-status.enum"), exports);
23
22
  __exportStar(require("./ai-text-provider.enum"), exports);